diff --git a/node/node_modules/npm/.npmrc b/node/node_modules/npm/.npmrc new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/node/node_modules/npm/LICENSE b/node/node_modules/npm/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..cd9b6bd90657076045e63dad5595e02b103690c3 --- /dev/null +++ b/node/node_modules/npm/LICENSE @@ -0,0 +1,235 @@ +The npm application +Copyright (c) npm, Inc. and Contributors +Licensed on the terms of The Artistic License 2.0 + +Node package dependencies of the npm application +Copyright (c) their respective copyright owners +Licensed on their respective license terms + +The npm public registry at https://registry.npmjs.org +and the npm website at https://www.npmjs.com +Operated by npm, Inc. +Use governed by terms published on https://www.npmjs.com + +"Node.js" +Trademark Joyent, Inc., https://joyent.com +Neither npm nor npm, Inc. are affiliated with Joyent, Inc. + +The Node.js application +Project of Node Foundation, https://nodejs.org + +The npm Logo +Copyright (c) Mathias Pettersson and Brian Hammond + +"Gubblebum Blocky" typeface +Copyright (c) Tjarda Koster, https://jelloween.deviantart.com +Used with permission + + +-------- + + +The Artistic License 2.0 + +Copyright (c) 2000-2006, The Perl Foundation. + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +Preamble + +This license establishes the terms under which a given free software +Package may be copied, modified, distributed, and/or redistributed. +The intent is that the Copyright Holder maintains some artistic +control over the development of that Package while still keeping the +Package available as open source and free software. + +You are always permitted to make arrangements wholly outside of this +license directly with the Copyright Holder of a given Package. If the +terms of this license do not permit the full use that you propose to +make of the Package, you should contact the Copyright Holder and seek +a different licensing arrangement. + +Definitions + + "Copyright Holder" means the individual(s) or organization(s) + named in the copyright notice for the entire Package. + + "Contributor" means any party that has contributed code or other + material to the Package, in accordance with the Copyright Holder's + procedures. + + "You" and "your" means any person who would like to copy, + distribute, or modify the Package. + + "Package" means the collection of files distributed by the + Copyright Holder, and derivatives of that collection and/or of + those files. A given Package may consist of either the Standard + Version, or a Modified Version. + + "Distribute" means providing a copy of the Package or making it + accessible to anyone else, or in the case of a company or + organization, to others outside of your company or organization. + + "Distributor Fee" means any fee that you charge for Distributing + this Package or providing support for this Package to another + party. It does not mean licensing fees. + + "Standard Version" refers to the Package if it has not been + modified, or has been modified only in ways explicitly requested + by the Copyright Holder. + + "Modified Version" means the Package, if it has been changed, and + such changes were not explicitly requested by the Copyright + Holder. + + "Original License" means this Artistic License as Distributed with + the Standard Version of the Package, in its current version or as + it may be modified by The Perl Foundation in the future. + + "Source" form means the source code, documentation source, and + configuration files for the Package. + + "Compiled" form means the compiled bytecode, object code, binary, + or any other form resulting from mechanical transformation or + translation of the Source form. + + +Permission for Use and Modification Without Distribution + +(1) You are permitted to use the Standard Version and create and use +Modified Versions for any purpose without restriction, provided that +you do not Distribute the Modified Version. + + +Permissions for Redistribution of the Standard Version + +(2) You may Distribute verbatim copies of the Source form of the +Standard Version of this Package in any medium without restriction, +either gratis or for a Distributor Fee, provided that you duplicate +all of the original copyright notices and associated disclaimers. At +your discretion, such verbatim copies may or may not include a +Compiled form of the Package. + +(3) You may apply any bug fixes, portability changes, and other +modifications made available from the Copyright Holder. The resulting +Package will still be considered the Standard Version, and as such +will be subject to the Original License. + + +Distribution of Modified Versions of the Package as Source + +(4) You may Distribute your Modified Version as Source (either gratis +or for a Distributor Fee, and with or without a Compiled form of the +Modified Version) provided that you clearly document how it differs +from the Standard Version, including, but not limited to, documenting +any non-standard features, executables, or modules, and provided that +you do at least ONE of the following: + + (a) make the Modified Version available to the Copyright Holder + of the Standard Version, under the Original License, so that the + Copyright Holder may include your modifications in the Standard + Version. + + (b) ensure that installation of your Modified Version does not + prevent the user installing or running the Standard Version. In + addition, the Modified Version must bear a name that is different + from the name of the Standard Version. + + (c) allow anyone who receives a copy of the Modified Version to + make the Source form of the Modified Version available to others + under + + (i) the Original License or + + (ii) a license that permits the licensee to freely copy, + modify and redistribute the Modified Version using the same + licensing terms that apply to the copy that the licensee + received, and requires that the Source form of the Modified + Version, and of any works derived from it, be made freely + available in that license fees are prohibited but Distributor + Fees are allowed. + + +Distribution of Compiled Forms of the Standard Version +or Modified Versions without the Source + +(5) You may Distribute Compiled forms of the Standard Version without +the Source, provided that you include complete instructions on how to +get the Source of the Standard Version. Such instructions must be +valid at the time of your distribution. If these instructions, at any +time while you are carrying out such distribution, become invalid, you +must provide new instructions on demand or cease further distribution. +If you provide valid instructions or cease distribution within thirty +days after you become aware that the instructions are invalid, then +you do not forfeit any of your rights under this license. + +(6) You may Distribute a Modified Version in Compiled form without +the Source, provided that you comply with Section 4 with respect to +the Source of the Modified Version. + + +Aggregating or Linking the Package + +(7) You may aggregate the Package (either the Standard Version or +Modified Version) with other packages and Distribute the resulting +aggregation provided that you do not charge a licensing fee for the +Package. Distributor Fees are permitted, and licensing fees for other +components in the aggregation are permitted. The terms of this license +apply to the use and Distribution of the Standard or Modified Versions +as included in the aggregation. + +(8) You are permitted to link Modified and Standard Versions with +other works, to embed the Package in a larger work of your own, or to +build stand-alone binary or bytecode versions of applications that +include the Package, and Distribute the result without restriction, +provided the result does not expose a direct interface to the Package. + + +Items That are Not Considered Part of a Modified Version + +(9) Works (including, but not limited to, modules and scripts) that +merely extend or make use of the Package, do not, by themselves, cause +the Package to be a Modified Version. In addition, such works are not +considered parts of the Package itself, and are not subject to the +terms of this license. + + +General Provisions + +(10) Any use, modification, and distribution of the Standard or +Modified Versions is governed by this Artistic License. By using, +modifying or distributing the Package, you accept this license. Do not +use, modify, or distribute the Package, if you do not accept this +license. + +(11) If your Modified Version has been derived from a Modified +Version made by someone other than you, you are nevertheless required +to ensure that your Modified Version complies with the requirements of +this license. + +(12) This license does not grant you the right to use any trademark, +service mark, tradename, or logo of the Copyright Holder. + +(13) This license includes the non-exclusive, worldwide, +free-of-charge patent license to make, have made, use, offer to sell, +sell, import and otherwise transfer the Package with respect to any +patent claims licensable by the Copyright Holder that are necessarily +infringed by the Package. If you institute patent litigation +(including a cross-claim or counterclaim) against any party alleging +that the Package constitutes direct or contributory patent +infringement, then this Artistic License to you shall terminate on the +date that such litigation is filed. + +(14) Disclaimer of Warranty: +THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS +IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL +LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------- diff --git a/node/node_modules/npm/README.md b/node/node_modules/npm/README.md new file mode 100644 index 0000000000000000000000000000000000000000..dc915ab277867cd9ddf4f049d047647196adff9e --- /dev/null +++ b/node/node_modules/npm/README.md @@ -0,0 +1,53 @@ +# npm - a JavaScript package manager + +### Requirements + +You should be running a currently supported version of [Node.js](https://nodejs.org/en/download/) to run **`npm`**. For a list of which versions of Node.js are currently supported, please see the [Node.js releases](https://nodejs.org/en/about/previous-releases) page. + +### Installation + +**`npm`** comes bundled with [**`node`**](https://nodejs.org/), & most third-party distributions, by default. Officially supported downloads/distributions can be found at: [nodejs.org/en/download](https://nodejs.org/en/download) + +#### Direct Download + +You can download & install **`npm`** directly from [**npmjs**.com](https://npmjs.com/) using our custom `install.sh` script: + +```bash +curl -qL https://www.npmjs.com/install.sh | sh +``` + +#### Node Version Managers + +If you're looking to manage multiple versions of **`Node.js`** &/or **`npm`**, consider using a [node version manager](https://github.com/search?q=node+version+manager+archived%3Afalse&type=repositories&ref=advsearch) + +### Usage + +```bash +npm +``` + +### Links & Resources + +* [**Documentation**](https://docs.npmjs.com/) - Official docs & how-tos for all things **npm** + * Note: you can also search docs locally with `npm help-search ` +* [**Bug Tracker**](https://github.com/npm/cli/issues) - Search or submit bugs against the CLI +* [**Community Feedback and Discussions**](https://github.com/orgs/community/discussions/categories/npm) - Contribute ideas & discussion around the npm registry, website & CLI +* [**RFCs**](https://github.com/npm/rfcs) - Contribute ideas & specifications for the API/design of the npm CLI +* [**Service Status**](https://status.npmjs.org/) - Monitor the current status & see incident reports for the website & registry +* [**Project Status**](https://npm.github.io/statusboard/) - See the health of all our maintained OSS projects in one view +* [**Support**](https://www.npmjs.com/support) - Experiencing problems with the **npm** [website](https://npmjs.com) or [registry](https://registry.npmjs.org)? [File a ticket](https://www.npmjs.com/support) + +### Acknowledgments + +* `npm` is configured to use the **npm Public Registry** at [https://registry.npmjs.org](https://registry.npmjs.org) by default; Usage of this registry is subject to **Terms of Use** available at [https://npmjs.com/policies/terms](https://npmjs.com/policies/terms) +* You can configure `npm` to use any other compatible registry you prefer. You can read more about [configuring third-party registries](https://docs.npmjs.com/cli/v7/using-npm/registry) + +### FAQ on Branding + +#### Is it "npm" or "NPM" or "Npm"? + +**`npm`** should never be capitalized unless it is being displayed in a location that is customarily all-capitals (ex. titles on `man` pages). + +#### Is "npm" an acronym for "Node Package Manager"? + +Contrary to popular belief, **`npm`** **is not** an acronym for "Node Package Manager." It is a recursive backronymic abbreviation for **"npm is not an acronym"** (if the project were named "ninaa," then it would be an acronym). The precursor to **`npm`** was actually a bash utility named **"pm"**, which was the shortform name of **"pkgmakeinst"** - a bash function that installed various things on various platforms. If **`npm`** were ever considered an acronym, it would be as "node pm" or, potentially, "new pm". diff --git a/node/node_modules/npm/bin/npm b/node/node_modules/npm/bin/npm new file mode 100644 index 0000000000000000000000000000000000000000..027dc9d128d22c1585b8a747a778a1d41ea02a42 --- /dev/null +++ b/node/node_modules/npm/bin/npm @@ -0,0 +1,65 @@ +#!/usr/bin/env bash + +# This is used by the Node.js installer, which expects the cygwin/mingw +# shell script to already be present in the npm dependency folder. + +(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix + +basedir=`dirname "$0"` + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ `uname` = 'Linux' ] && type wslpath &>/dev/null ; then + IS_WSL="true" +fi + +function no_node_dir { + # if this didn't work, then everything else below will fail + echo "Could not determine Node.js install directory" >&2 + exit 1 +} + +NODE_EXE="$basedir/node.exe" +if ! [ -x "$NODE_EXE" ]; then + NODE_EXE="$basedir/node" +fi +if ! [ -x "$NODE_EXE" ]; then + NODE_EXE=node +fi + +# this path is passed to node.exe, so it needs to match whatever +# kind of paths Node.js thinks it's using, typically win32 paths. +CLI_BASEDIR="$("$NODE_EXE" -p 'require("path").dirname(process.execPath)' 2> /dev/null)" +if [ $? -ne 0 ]; then + # this fails under WSL 1 so add an additional message. we also suppress stderr above + # because the actual error raised is not helpful. in WSL 1 node.exe cannot handle + # output redirection properly. See https://github.com/microsoft/WSL/issues/2370 + if [ "$IS_WSL" == "true" ]; then + echo "WSL 1 is not supported. Please upgrade to WSL 2 or above." >&2 + fi + no_node_dir +fi +NPM_PREFIX_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-prefix.js" +NPM_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-cli.js" +NPM_PREFIX=`"$NODE_EXE" "$NPM_PREFIX_JS"` +if [ $? -ne 0 ]; then + no_node_dir +fi +NPM_PREFIX_NPM_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npm-cli.js" + +# a path that will fail -f test on any posix bash +NPM_WSL_PATH="/.." + +# WSL can run Windows binaries, so we have to give it the win32 path +# however, WSL bash tests against posix paths, so we need to construct that +# to know if npm is installed globally. +if [ "$IS_WSL" == "true" ]; then + NPM_WSL_PATH=`wslpath "$NPM_PREFIX_NPM_CLI_JS"` +fi +if [ -f "$NPM_PREFIX_NPM_CLI_JS" ] || [ -f "$NPM_WSL_PATH" ]; then + NPM_CLI_JS="$NPM_PREFIX_NPM_CLI_JS" +fi + +"$NODE_EXE" "$NPM_CLI_JS" "$@" diff --git a/node/node_modules/npm/bin/npm-cli.js b/node/node_modules/npm/bin/npm-cli.js new file mode 100644 index 0000000000000000000000000000000000000000..c4314f9776387bf9787a5276197622db5f67c57b --- /dev/null +++ b/node/node_modules/npm/bin/npm-cli.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('../lib/cli.js')(process) diff --git a/node/node_modules/npm/bin/npm-prefix.js b/node/node_modules/npm/bin/npm-prefix.js new file mode 100644 index 0000000000000000000000000000000000000000..f764238a1da48880acad65bf2da0c4e34a486a55 --- /dev/null +++ b/node/node_modules/npm/bin/npm-prefix.js @@ -0,0 +1,30 @@ +#!/usr/bin/env node +// This is a single-use bin to help windows discover the proper prefix for npm +// without having to load all of npm first +// It does not accept argv params + +const path = require('node:path') +const Config = require('@npmcli/config') +const { definitions, flatten, shorthands } = require('@npmcli/config/lib/definitions') +const config = new Config({ + npmPath: path.dirname(__dirname), + // argv is explicitly not looked at since prefix is not something that can be changed via argv + argv: [], + definitions, + flatten, + shorthands, + excludeNpmCwd: false, +}) + +async function main () { + try { + await config.load() + // eslint-disable-next-line no-console + console.log(config.globalPrefix) + } catch (err) { + // eslint-disable-next-line no-console + console.error(err) + process.exit(1) + } +} +main() diff --git a/node/node_modules/npm/bin/npm.cmd b/node/node_modules/npm/bin/npm.cmd new file mode 100644 index 0000000000000000000000000000000000000000..1a02e83ac365a91ee3e3d3c502ef39abef93f6d3 --- /dev/null +++ b/node/node_modules/npm/bin/npm.cmd @@ -0,0 +1,20 @@ +:: Created by npm, please don't edit manually. +@ECHO OFF + +SETLOCAL + +SET "NODE_EXE=%~dp0\node.exe" +IF NOT EXIST "%NODE_EXE%" ( + SET "NODE_EXE=node" +) + +SET "NPM_PREFIX_JS=%~dp0\node_modules\npm\bin\npm-prefix.js" +SET "NPM_CLI_JS=%~dp0\node_modules\npm\bin\npm-cli.js" +FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_PREFIX_JS%"') DO ( + SET "NPM_PREFIX_NPM_CLI_JS=%%F\node_modules\npm\bin\npm-cli.js" +) +IF EXIST "%NPM_PREFIX_NPM_CLI_JS%" ( + SET "NPM_CLI_JS=%NPM_PREFIX_NPM_CLI_JS%" +) + +"%NODE_EXE%" "%NPM_CLI_JS%" %* diff --git a/node/node_modules/npm/bin/npm.ps1 b/node/node_modules/npm/bin/npm.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..2f994488c66506657db808aaa4e09515354800c7 --- /dev/null +++ b/node/node_modules/npm/bin/npm.ps1 @@ -0,0 +1,50 @@ +#!/usr/bin/env pwsh + +Set-StrictMode -Version 'Latest' + +$NODE_EXE="$PSScriptRoot/node.exe" +if (-not (Test-Path $NODE_EXE)) { + $NODE_EXE="$PSScriptRoot/node" +} +if (-not (Test-Path $NODE_EXE)) { + $NODE_EXE="node" +} + +$NPM_PREFIX_JS="$PSScriptRoot/node_modules/npm/bin/npm-prefix.js" +$NPM_CLI_JS="$PSScriptRoot/node_modules/npm/bin/npm-cli.js" +$NPM_PREFIX=(& $NODE_EXE $NPM_PREFIX_JS) + +if ($LASTEXITCODE -ne 0) { + Write-Host "Could not determine Node.js install directory" + exit 1 +} + +$NPM_PREFIX_NPM_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npm-cli.js" +if (Test-Path $NPM_PREFIX_NPM_CLI_JS) { + $NPM_CLI_JS=$NPM_PREFIX_NPM_CLI_JS +} + +if ($MyInvocation.ExpectingInput) { # takes pipeline input + $input | & $NODE_EXE $NPM_CLI_JS $args +} elseif (-not $MyInvocation.Line) { # used "-File" argument + & $NODE_EXE $NPM_CLI_JS $args +} else { # used "-Command" argument + if (($MyInvocation | Get-Member -Name 'Statement') -and $MyInvocation.Statement) { + $NPM_ORIGINAL_COMMAND = $MyInvocation.Statement + } else { + $NPM_ORIGINAL_COMMAND = ( + [Management.Automation.InvocationInfo].GetProperty('ScriptPosition', [Reflection.BindingFlags] 'Instance, NonPublic') + ).GetValue($MyInvocation).Text + } + + $NODE_EXE = $NODE_EXE.Replace("``", "````") + $NPM_CLI_JS = $NPM_CLI_JS.Replace("``", "````") + + $NPM_COMMAND_ARRAY = [Management.Automation.Language.Parser]::ParseInput($NPM_ORIGINAL_COMMAND, [ref] $null, [ref] $null). + EndBlock.Statements.PipelineElements.CommandElements.Extent.Text + $NPM_ARGS = ($NPM_COMMAND_ARRAY | Select-Object -Skip 1) -join ' ' + + Invoke-Expression "& `"$NODE_EXE`" `"$NPM_CLI_JS`" $NPM_ARGS" +} + +exit $LASTEXITCODE diff --git a/node/node_modules/npm/bin/npx b/node/node_modules/npm/bin/npx new file mode 100644 index 0000000000000000000000000000000000000000..b8619ee9c5e37ad509959213da26dfa24805432e --- /dev/null +++ b/node/node_modules/npm/bin/npx @@ -0,0 +1,65 @@ +#!/usr/bin/env bash + +# This is used by the Node.js installer, which expects the cygwin/mingw +# shell script to already be present in the npm dependency folder. + +(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix + +basedir=`dirname "$0"` + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ `uname` = 'Linux' ] && type wslpath &>/dev/null ; then + IS_WSL="true" +fi + +function no_node_dir { + # if this didn't work, then everything else below will fail + echo "Could not determine Node.js install directory" >&2 + exit 1 +} + +NODE_EXE="$basedir/node.exe" +if ! [ -x "$NODE_EXE" ]; then + NODE_EXE="$basedir/node" +fi +if ! [ -x "$NODE_EXE" ]; then + NODE_EXE=node +fi + +# this path is passed to node.exe, so it needs to match whatever +# kind of paths Node.js thinks it's using, typically win32 paths. +CLI_BASEDIR="$("$NODE_EXE" -p 'require("path").dirname(process.execPath)' 2> /dev/null)" +if [ $? -ne 0 ]; then + # this fails under WSL 1 so add an additional message. we also suppress stderr above + # because the actual error raised is not helpful. in WSL 1 node.exe cannot handle + # output redirection properly. See https://github.com/microsoft/WSL/issues/2370 + if [ "$IS_WSL" == "true" ]; then + echo "WSL 1 is not supported. Please upgrade to WSL 2 or above." >&2 + fi + no_node_dir +fi +NPM_PREFIX_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-prefix.js" +NPX_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npx-cli.js" +NPM_PREFIX=`"$NODE_EXE" "$NPM_PREFIX_JS"` +if [ $? -ne 0 ]; then + no_node_dir +fi +NPM_PREFIX_NPX_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npx-cli.js" + +# a path that will fail -f test on any posix bash +NPX_WSL_PATH="/.." + +# WSL can run Windows binaries, so we have to give it the win32 path +# however, WSL bash tests against posix paths, so we need to construct that +# to know if npm is installed globally. +if [ "$IS_WSL" == "true" ]; then + NPX_WSL_PATH=`wslpath "$NPM_PREFIX_NPX_CLI_JS"` +fi +if [ -f "$NPM_PREFIX_NPX_CLI_JS" ] || [ -f "$NPX_WSL_PATH" ]; then + NPX_CLI_JS="$NPM_PREFIX_NPX_CLI_JS" +fi + +"$NODE_EXE" "$NPX_CLI_JS" "$@" diff --git a/node/node_modules/npm/bin/npx-cli.js b/node/node_modules/npm/bin/npx-cli.js new file mode 100644 index 0000000000000000000000000000000000000000..81e848ced9598b92ed8508a14792ada481899552 --- /dev/null +++ b/node/node_modules/npm/bin/npx-cli.js @@ -0,0 +1,130 @@ +#!/usr/bin/env node + +const cli = require('../lib/cli.js') + +// run the resulting command as `npm exec ...args` +process.argv[1] = require.resolve('./npm-cli.js') +process.argv.splice(2, 0, 'exec') + +// TODO: remove the affordances for removed items in npm v9 +const removedSwitches = new Set([ + 'always-spawn', + 'ignore-existing', + 'shell-auto-fallback', +]) + +const removedOpts = new Set([ + 'npm', + 'node-arg', + 'n', +]) + +const removed = new Set([ + ...removedSwitches, + ...removedOpts, +]) + +const { definitions, shorthands } = require('@npmcli/config/lib/definitions') +const npmSwitches = Object.entries(definitions) + .filter(([, { type }]) => type === Boolean || + (Array.isArray(type) && type.includes(Boolean))) + .map(([key]) => key) + +// things that don't take a value +const switches = new Set([ + ...removedSwitches, + ...npmSwitches, + 'no-install', + 'quiet', + 'q', + 'version', + 'v', + 'help', + 'h', +]) + +// things that do take a value +const opts = new Set([ + ...removedOpts, + 'package', + 'p', + 'cache', + 'userconfig', + 'call', + 'c', + 'shell', + 'npm', + 'node-arg', + 'n', +]) + +// break out of loop when we find a positional argument or -- +// If we find a positional arg, we shove -- in front of it, and +// let the normal npm cli handle the rest. +let i +let sawRemovedFlags = false +for (i = 3; i < process.argv.length; i++) { + const arg = process.argv[i] + if (arg === '--') { + break + } else if (/^-/.test(arg)) { + const [key, ...v] = arg.replace(/^-+/, '').split('=') + + switch (key) { + case 'p': + process.argv[i] = ['--package', ...v].join('=') + break + + case 'shell': + process.argv[i] = ['--script-shell', ...v].join('=') + break + + case 'no-install': + process.argv[i] = '--yes=false' + break + + default: + // resolve shorthands and run again + if (shorthands[key] && !removed.has(key)) { + const a = [...shorthands[key]] + if (v.length) { + a.push(v.join('=')) + } + process.argv.splice(i, 1, ...a) + i-- + continue + } + break + } + + if (removed.has(key)) { + // eslint-disable-next-line no-console + console.error(`npx: the --${key} argument has been removed.`) + sawRemovedFlags = true + process.argv.splice(i, 1) + i-- + } + + if (v.length === 0 && !switches.has(key) && + (opts.has(key) || !/^-/.test(process.argv[i + 1]))) { + // value will be next argument, skip over it. + if (removed.has(key)) { + // also remove the value for the cut key. + process.argv.splice(i + 1, 1) + } else { + i++ + } + } + } else { + // found a positional arg, put -- in front of it, and we're done + process.argv.splice(i, 0, '--') + break + } +} + +if (sawRemovedFlags) { + // eslint-disable-next-line no-console + console.error('See `npm help exec` for more information') +} + +cli(process) diff --git a/node/node_modules/npm/bin/npx.cmd b/node/node_modules/npm/bin/npx.cmd new file mode 100644 index 0000000000000000000000000000000000000000..0f02d2dc4985440d3946534fb6d8d38828bb9bab --- /dev/null +++ b/node/node_modules/npm/bin/npx.cmd @@ -0,0 +1,20 @@ +:: Created by npm, please don't edit manually. +@ECHO OFF + +SETLOCAL + +SET "NODE_EXE=%~dp0\node.exe" +IF NOT EXIST "%NODE_EXE%" ( + SET "NODE_EXE=node" +) + +SET "NPM_PREFIX_JS=%~dp0\node_modules\npm\bin\npm-prefix.js" +SET "NPX_CLI_JS=%~dp0\node_modules\npm\bin\npx-cli.js" +FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_PREFIX_JS%"') DO ( + SET "NPM_PREFIX_NPX_CLI_JS=%%F\node_modules\npm\bin\npx-cli.js" +) +IF EXIST "%NPM_PREFIX_NPX_CLI_JS%" ( + SET "NPX_CLI_JS=%NPM_PREFIX_NPX_CLI_JS%" +) + +"%NODE_EXE%" "%NPX_CLI_JS%" %* diff --git a/node/node_modules/npm/bin/npx.ps1 b/node/node_modules/npm/bin/npx.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..bf6752a3c1daa43d194341481fbe45129371287c --- /dev/null +++ b/node/node_modules/npm/bin/npx.ps1 @@ -0,0 +1,50 @@ +#!/usr/bin/env pwsh + +Set-StrictMode -Version 'Latest' + +$NODE_EXE="$PSScriptRoot/node.exe" +if (-not (Test-Path $NODE_EXE)) { + $NODE_EXE="$PSScriptRoot/node" +} +if (-not (Test-Path $NODE_EXE)) { + $NODE_EXE="node" +} + +$NPM_PREFIX_JS="$PSScriptRoot/node_modules/npm/bin/npm-prefix.js" +$NPX_CLI_JS="$PSScriptRoot/node_modules/npm/bin/npx-cli.js" +$NPM_PREFIX=(& $NODE_EXE $NPM_PREFIX_JS) + +if ($LASTEXITCODE -ne 0) { + Write-Host "Could not determine Node.js install directory" + exit 1 +} + +$NPM_PREFIX_NPX_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npx-cli.js" +if (Test-Path $NPM_PREFIX_NPX_CLI_JS) { + $NPX_CLI_JS=$NPM_PREFIX_NPX_CLI_JS +} + +if ($MyInvocation.ExpectingInput) { # takes pipeline input + $input | & $NODE_EXE $NPX_CLI_JS $args +} elseif (-not $MyInvocation.Line) { # used "-File" argument + & $NODE_EXE $NPX_CLI_JS $args +} else { # used "-Command" argument + if (($MyInvocation | Get-Member -Name 'Statement') -and $MyInvocation.Statement) { + $NPX_ORIGINAL_COMMAND = $MyInvocation.Statement + } else { + $NPX_ORIGINAL_COMMAND = ( + [Management.Automation.InvocationInfo].GetProperty('ScriptPosition', [Reflection.BindingFlags] 'Instance, NonPublic') + ).GetValue($MyInvocation).Text + } + + $NODE_EXE = $NODE_EXE.Replace("``", "````") + $NPX_CLI_JS = $NPX_CLI_JS.Replace("``", "````") + + $NPX_COMMAND_ARRAY = [Management.Automation.Language.Parser]::ParseInput($NPX_ORIGINAL_COMMAND, [ref] $null, [ref] $null). + EndBlock.Statements.PipelineElements.CommandElements.Extent.Text + $NPX_ARGS = ($NPX_COMMAND_ARRAY | Select-Object -Skip 1) -join ' ' + + Invoke-Expression "& `"$NODE_EXE`" `"$NPX_CLI_JS`" $NPX_ARGS" +} + +exit $LASTEXITCODE diff --git a/node/node_modules/npm/index.js b/node/node_modules/npm/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ff825e816ef052768574e6d7d84afc31b137667c --- /dev/null +++ b/node/node_modules/npm/index.js @@ -0,0 +1,5 @@ +if (require.main === module) { + require('./lib/cli.js')(process) +} else { + throw new Error('The programmatic API was removed in npm v8.0.0') +} diff --git a/node/node_modules/npm/lib/arborist-cmd.js b/node/node_modules/npm/lib/arborist-cmd.js new file mode 100644 index 0000000000000000000000000000000000000000..6f6a0e13be2160acd50a76ffbd2414a5005092a2 --- /dev/null +++ b/node/node_modules/npm/lib/arborist-cmd.js @@ -0,0 +1,49 @@ +const { log } = require('proc-log') +const BaseCommand = require('./base-cmd.js') + +// This is the base for all commands whose execWorkspaces just gets a list of workspace names and passes it on to new Arborist() to be able to run a filtered Arborist.reify() at some point. +class ArboristCmd extends BaseCommand { + get isArboristCmd () { + return true + } + + static params = [ + 'workspace', + 'workspaces', + 'include-workspace-root', + 'install-links', + ] + + static workspaces = true + static ignoreImplicitWorkspace = false + static checkDevEngines = true + + constructor (npm) { + super(npm) + + const { config } = this.npm + + // when location isn't set and global isn't true check for a package.json at the localPrefix and set the location to project if found + const locationProject = config.get('location') === 'project' || ( + config.isDefault('location') + // this is different then `npm.global` which falls back to checking + // location which we do not want to use here + && !config.get('global') + && npm.localPackage + ) + + // if audit is not set and we are in global mode and location is not project and we assume its not a project related context, then we set audit=false + if (config.isDefault('audit') && (this.npm.global || !locationProject)) { + config.set('audit', false) + } else if (this.npm.global && config.get('audit')) { + log.warn('config', 'includes both --global and --audit, which is currently unsupported.') + } + } + + async execWorkspaces (args) { + await this.setWorkspaces() + return this.exec(args) + } +} + +module.exports = ArboristCmd diff --git a/node/node_modules/npm/lib/base-cmd.js b/node/node_modules/npm/lib/base-cmd.js new file mode 100644 index 0000000000000000000000000000000000000000..a7a5e7291515b9ce4c94b0e6d8bbf58d62d63a5e --- /dev/null +++ b/node/node_modules/npm/lib/base-cmd.js @@ -0,0 +1,435 @@ +const { log } = require('proc-log') +const { definitions, shorthands } = require('@npmcli/config/lib/definitions') +const nopt = require('nopt') + +class BaseCommand { + // these defaults can be overridden by individual commands + static workspaces = false + static ignoreImplicitWorkspace = true + static checkDevEngines = false + + // these should always be overridden by individual commands + static name = null + static description = null + static params = null + static definitions = null + static subcommands = null + // Number of expected positional arguments (null = unlimited/unchecked) + static positionals = null + + // this is a static so that we can read from it without instantiating a command which would require loading the config + static get describeUsage () { + return this.getUsage() + } + + static getUsage (parentName = null, includeDescriptions = true) { + const { aliases: cmdAliases } = require('./utils/cmd-list') + const seenExclusive = new Set() + const wrapWidth = 80 + const { description, usage = [''], name } = this + + // Resolve to a definitions array: if the command has its own definitions, use those directly; otherwise resolve params from the global definitions pool. + let cmdDefs + if (this.definitions) { + cmdDefs = this.definitions + } else if (this.params) { + cmdDefs = this.params.map(p => definitions[p]).filter(Boolean) + } + + // If this is a subcommand, prepend parent name + const fullCommandName = parentName ? `${parentName} ${name}` : name + + const fullUsage = [ + `${description}`, + '', + 'Usage:', + ] + if (usage) { + fullUsage.push(...usage.map(u => `npm ${fullCommandName} ${u}`.trim())) + } + + if (this.subcommands) { + for (const sub in this.subcommands) { + fullUsage.push(`npm ${fullCommandName} ${sub} ${this.subcommands[sub].usage}`) + } + fullUsage.push('') + fullUsage.push('Subcommands:') + const subcommandEntries = Object.entries(this.subcommands) + for (let i = 0; i < subcommandEntries.length; i++) { + const [subName, SubCommand] = subcommandEntries[i] + fullUsage.push(` ${subName}`) + if (SubCommand.description) { + fullUsage.push(` ${SubCommand.description}`) + } + // Add space between subcommands except after the last one + if (i < subcommandEntries.length - 1) { + fullUsage.push('') + } + } + fullUsage.push('') + fullUsage.push(`Run "npm ${name} --help" for more info on a subcommand.`) + } + + if (cmdDefs) { + let results = '' + let line = '' + for (const def of cmdDefs) { + /* istanbul ignore next */ + if (seenExclusive.has(def.key)) { + continue + } + let paramUsage = def.usage + if (def.exclusive) { + const exclusiveParams = [paramUsage] + for (const e of def.exclusive) { + seenExclusive.add(e) + const eDef = cmdDefs.find(d => d.key === e) || definitions[e] + exclusiveParams.push(eDef?.usage) + } + paramUsage = `${exclusiveParams.join('|')}` + } + paramUsage = `[${paramUsage}]` + if (line.length + paramUsage.length > wrapWidth) { + results = [results, line].filter(Boolean).join('\n') + line = '' + } + line = [line, paramUsage].filter(Boolean).join(' ') + } + fullUsage.push('') + fullUsage.push('Options:') + fullUsage.push([results, line].filter(Boolean).join('\n')) + + // Add flag descriptions + if (cmdDefs.length > 0 && includeDescriptions) { + fullUsage.push('') + for (const def of cmdDefs) { + if (def.description) { + const desc = def.description.trim().split('\n')[0] + const shortcuts = def.short ? `-${def.short}` : '' + const aliases = (def.alias || []).map(v => `--${v}`).join('|') + const mainFlag = `--${def.key}` + const flagName = [shortcuts, mainFlag, aliases].filter(Boolean).join('|') + const requiredNote = def.required ? ' (required)' : '' + fullUsage.push(` ${flagName}${requiredNote}`) + fullUsage.push(` ${desc}`) + fullUsage.push('') + } + } + } + } + + const aliases = Object.entries(cmdAliases).reduce((p, [k, v]) => { + return p.concat(v === name ? k : []) + }, []) + + if (aliases.length) { + const plural = aliases.length === 1 ? '' : 'es' + fullUsage.push('') + fullUsage.push(`alias${plural}: ${aliases.join(', ')}`) + } + + fullUsage.push('') + fullUsage.push(`Run "npm help ${name}" for more info`) + + return fullUsage.join('\n') + } + + constructor (npm) { + this.npm = npm + this.commandArgs = null + + const { config } = this + + if (!this.constructor.skipConfigValidation) { + config.validate() + } + + if (config.get('workspaces') === false && config.get('workspace').length) { + throw new Error('Cannot use --no-workspaces and --workspace at the same time') + } + } + + get config () { + // Return command-specific config if it exists, otherwise use npm's config + return this.npm.config + } + + get name () { + return this.constructor.name + } + + get description () { + return this.constructor.description + } + + get params () { + return this.constructor.params + } + + get usage () { + return this.constructor.describeUsage + } + + usageError (prefix = '') { + if (prefix) { + prefix += '\n\n' + } + return Object.assign(new Error(`\n${prefix}${this.usage}`), { + code: 'EUSAGE', + }) + } + + // Compare the number of entries with what was expected + checkExpected (entries) { + if (!this.npm.config.isDefault('expect-results')) { + const expected = this.npm.config.get('expect-results') + if (!!entries !== !!expected) { + log.warn(this.name, `Expected ${expected ? '' : 'no '}results, got ${entries}`) + process.exitCode = 1 + } + } else if (!this.npm.config.isDefault('expect-result-count')) { + const expected = this.npm.config.get('expect-result-count') + if (expected !== entries) { + log.warn(this.name, `Expected ${expected} result${expected === 1 ? '' : 's'}, got ${entries}`) + process.exitCode = 1 + } + } + } + + // Checks the devEngines entry in the package.json at this.localPrefix + async checkDevEngines () { + const force = this.npm.flatOptions.force + + const { devEngines } = await require('@npmcli/package-json') + .normalize(this.npm.config.localPrefix) + .then(p => p.content) + .catch(() => ({})) + + if (typeof devEngines === 'undefined') { + return + } + + const { checkDevEngines, currentEnv } = require('npm-install-checks') + const current = currentEnv.devEngines({ + nodeVersion: this.npm.nodeVersion, + npmVersion: this.npm.version, + }) + + const failures = checkDevEngines(devEngines, current) + const warnings = failures.filter(f => f.isWarn) + const errors = failures.filter(f => f.isError) + + const genMsg = (failure, i = 0) => { + return [...new Set([ + // eslint-disable-next-line + i === 0 ? 'The developer of this package has specified the following through devEngines' : '', + `${failure.message}`, + `${failure.errors.map(e => e.message).join('\n')}`, + ])].filter(v => v).join('\n') + } + + [...warnings, ...(force ? errors : [])].forEach((failure, i) => { + const message = genMsg(failure, i) + log.warn('EBADDEVENGINES', message) + log.warn('EBADDEVENGINES', { + current: failure.current, + required: failure.required, + }) + }) + + if (force) { + return + } + + if (errors.length) { + const failure = errors[0] + const message = genMsg(failure) + throw Object.assign(new Error(message), { + engine: failure.engine, + code: 'EBADDEVENGINES', + current: failure.current, + required: failure.required, + }) + } + } + + async setWorkspaces () { + const { relative } = require('node:path') + + const includeWorkspaceRoot = this.isArboristCmd + ? false + : this.npm.config.get('include-workspace-root') + + const prefixInsideCwd = relative(this.npm.localPrefix, process.cwd()).startsWith('..') + const relativeFrom = prefixInsideCwd ? this.npm.localPrefix : process.cwd() + + const filters = this.npm.config.get('workspace') + const getWorkspaces = require('./utils/get-workspaces.js') + const ws = await getWorkspaces(filters, { + path: this.npm.localPrefix, + includeWorkspaceRoot, + relativeFrom, + }) + + this.workspaces = ws + this.workspaceNames = [...ws.keys()] + this.workspacePaths = [...ws.values()] + } + + flags (depth = 1) { + const commandDefinitions = this.constructor.definitions || [] + + // Build types, shorthands, and defaults from definitions + const types = {} + const defaults = {} + const cmdShorthands = {} + const aliasMap = {} // Track which aliases map to which main keys + + for (const def of commandDefinitions) { + defaults[def.key] = def.default + types[def.key] = def.type + + // Handle aliases defined in the definition + if (def.alias && Array.isArray(def.alias)) { + for (const aliasKey of def.alias) { + types[aliasKey] = def.type // Needed for nopt to parse aliases + if (!aliasMap[def.key]) { + aliasMap[def.key] = [] + } + aliasMap[def.key].push(aliasKey) + } + } + + // Handle short options + if (def.short) { + const shorts = Array.isArray(def.short) ? def.short : [def.short] + for (const short of shorts) { + cmdShorthands[short] = [`--${def.key}`] + } + } + } + + // Parse args + let parsed = {} + let remains = [] + const argv = this.config.argv + if (argv && argv.length > 0) { + // config.argv contains the full command line including node, npm, and command names + // Format: ['node', 'npm', 'command', 'subcommand', 'positional', '--flags'] + // depth tells us how many command names to skip (1 for top-level, 2 for subcommand, etc.) + const offset = 2 + depth // Skip 'node', 'npm', and all command/subcommand names + parsed = nopt(types, cmdShorthands, argv, offset) + remains = parsed.argv.remain + delete parsed.argv + } + + // Validate flags - only if command has definitions (new system) + if (this.constructor.definitions && this.constructor.definitions.length > 0) { + this.#validateFlags(parsed, commandDefinitions, remains) + } + + // Check for conflicts between main flags and their aliases + // Also map aliases back to their main keys + for (const [mainKey, aliases] of Object.entries(aliasMap)) { + const providedKeys = [] + if (mainKey in parsed) { + providedKeys.push(mainKey) + } + for (const alias of aliases) { + if (alias in parsed) { + providedKeys.push(alias) + } + } + if (providedKeys.length > 1) { + const flagList = providedKeys.map(k => `--${k}`).join(' or ') + throw new Error(`Please provide only one of ${flagList}`) + } + + // If an alias was provided, map it to the main key + if (providedKeys.length === 1 && providedKeys[0] !== mainKey) { + const aliasKey = providedKeys[0] + parsed[mainKey] = parsed[aliasKey] + delete parsed[aliasKey] + } + } + + // Only include keys that are defined in commandDefinitions (main keys only) + const filtered = {} + for (const def of commandDefinitions) { + if (def.key in parsed) { + filtered[def.key] = parsed[def.key] + } + } + return [{ ...defaults, ...filtered }, remains] + } + + // Validate flags and throw errors for unknown flags or unexpected positionals + #validateFlags (parsed, commandDefinitions, remains) { + // Build a set of all valid flag names (global + command-specific + shorthands) + const validFlags = new Set([ + ...Object.keys(definitions), + ...commandDefinitions.map(d => d.key), + ...Object.keys(shorthands), // Add global shorthands like 'verbose', 'dd', etc. + ]) + + // Add aliases to valid flags + for (const def of commandDefinitions) { + if (def.alias && Array.isArray(def.alias)) { + for (const alias of def.alias) { + validFlags.add(alias) + } + } + } + + // Check parsed flags against valid flags + const unknownFlags = [] + for (const key of Object.keys(parsed)) { + if (!validFlags.has(key)) { + unknownFlags.push(key) + } + } + + // Throw error if unknown flags were found + if (unknownFlags.length > 0) { + const flagList = unknownFlags.map(f => `--${f}`).join(', ') + throw this.usageError(`Unknown flag${unknownFlags.length > 1 ? 's' : ''}: ${flagList}`) + } + + // Remove warnings for command-specific definitions that npm's global config doesn't know about (these were queued as "unknown" during config.load()) + for (const def of commandDefinitions) { + this.npm.config.removeWarning(def.key) + if (def.alias && Array.isArray(def.alias)) { + for (const alias of def.alias) { + this.npm.config.removeWarning(alias) + } + } + } + + // Remove warnings for unknown positionals that were actually consumed as flag values by command-specific definitions (e.g., --id where --id is command-specific) + const remainsSet = new Set(remains) + for (const unknownPos of this.npm.config.getUnknownPositionals()) { + if (!remainsSet.has(unknownPos)) { + // This value was consumed as a flag value, not truly a positional + this.npm.config.removeUnknownPositional(unknownPos) + } + } + + // Warn about extra positional arguments beyond what the command expects + const expectedPositionals = this.constructor.positionals + if (expectedPositionals !== null && remains.length > expectedPositionals) { + const extraPositionals = remains.slice(expectedPositionals) + for (const extra of extraPositionals) { + throw new Error(`Unknown positional argument: ${extra}`) + } + } + + this.npm.config.logWarnings() + } + + async exec () { + // This method should be overridden by commands + // Subcommand routing is handled in npm.js #exec + } +} + +module.exports = BaseCommand diff --git a/node/node_modules/npm/lib/cli.js b/node/node_modules/npm/lib/cli.js new file mode 100644 index 0000000000000000000000000000000000000000..ad2ea11cda6e793fc25d36e2786a9cc836421dc7 --- /dev/null +++ b/node/node_modules/npm/lib/cli.js @@ -0,0 +1,12 @@ +try { + const { enableCompileCache } = require('node:module') + /* istanbul ignore next */ + if (enableCompileCache) { + enableCompileCache() + } +} catch (e) { /* istanbul ignore next */ } + +const validateEngines = require('./cli/validate-engines.js') +const cliEntry = require('node:path').resolve(__dirname, 'cli/entry.js') + +module.exports = (process) => validateEngines(process, () => require(cliEntry)) diff --git a/node/node_modules/npm/lib/lifecycle-cmd.js b/node/node_modules/npm/lib/lifecycle-cmd.js new file mode 100644 index 0000000000000000000000000000000000000000..ba8f7ec800b8524510cf8197cc857299e190ff75 --- /dev/null +++ b/node/node_modules/npm/lib/lifecycle-cmd.js @@ -0,0 +1,20 @@ +const BaseCommand = require('./base-cmd.js') + +// The implementation of commands that are just "run a script" +// e.g. restart, start, stop, test +class LifecycleCmd extends BaseCommand { + static usage = ['[-- ]'] + static isShellout = true + static workspaces = true + static ignoreImplicitWorkspace = false + + async exec (args) { + return this.npm.exec('run', [this.constructor.name, ...args]) + } + + async execWorkspaces (args) { + return this.npm.exec('run', [this.constructor.name, ...args]) + } +} + +module.exports = LifecycleCmd diff --git a/node/node_modules/npm/lib/npm.js b/node/node_modules/npm/lib/npm.js new file mode 100644 index 0000000000000000000000000000000000000000..4b89bca0dfea538f46192ace41c773747ee0a9db --- /dev/null +++ b/node/node_modules/npm/lib/npm.js @@ -0,0 +1,525 @@ +const { resolve, dirname, join } = require('node:path') +const Config = require('@npmcli/config') +const which = require('which') +const fs = require('node:fs/promises') +const { definitions, flatten, nerfDarts, shorthands } = require('@npmcli/config/lib/definitions') +const usage = require('./utils/npm-usage.js') +const LogFile = require('./utils/log-file.js') +const Timers = require('./utils/timers.js') +const Display = require('./utils/display.js') +const { log, time, output, META } = require('proc-log') +const { redactLog: replaceInfo } = require('@npmcli/redact') +const pkg = require('../package.json') +const { deref } = require('./utils/cmd-list.js') +const { jsonError, outputError } = require('./utils/output-error.js') + +class Npm { + static get version () { + return pkg.version + } + + static cmd (c) { + const command = deref(c) + if (!command) { + throw Object.assign(new Error(`Unknown command ${c}`), { + code: 'EUNKNOWNCOMMAND', + command: c, + }) + } + return require(`./commands/${command}`) + } + + unrefPromises = [] + updateNotification = null + argv = [] + + #command = null + #runId = new Date().toISOString().replace(/[.:]/g, '_') + #title = 'npm' + #argvClean = [] + #npmRoot = null + + #display = null + #logFile = new LogFile() + #timers = new Timers() + + // All these options are only used by tests in order to make testing more closely resemble real world usage. + // For now, npm has no programmatic API so it is ok to add stuff here, but we should not rely on it more than necessary. + // XXX: make these options not necessary by refactoring @npmcli/config + // - npmRoot: this is where npm looks for docs files and the builtin config + // - argv: this allows tests to extend argv in the same way the argv would be passed in via a CLI arg. + // - excludeNpmCwd: this is a hack to get @npmcli/config to stop walking up dirs to set a local prefix when it encounters the `npmRoot`. + // this allows tests created by tap inside this repo to not set the local prefix to `npmRoot` since that is the first dir it would encounter when doing implicit detection + constructor ({ + stdout = process.stdout, + stderr = process.stderr, + npmRoot = dirname(__dirname), + argv = [], + excludeNpmCwd = false, + } = {}) { + this.#display = new Display({ stdout, stderr }) + this.#npmRoot = npmRoot + this.config = new Config({ + npmPath: this.#npmRoot, + definitions, + flatten, + nerfDarts, + shorthands, + argv: [...process.argv, ...argv], + excludeNpmCwd, + warn: false, + }) + } + + async load () { + let err + try { + return await time.start('npm:load', () => this.#load()) + } catch (e) { + err = e + } + return this.#handleError(err) + } + + async #load () { + await time.start('npm:load:whichnode', async () => { + // TODO should we throw here? + const node = await which(process.argv[0]).catch(() => {}) + if (node && node.toUpperCase() !== process.execPath.toUpperCase()) { + log.verbose('node symlink', node) + process.execPath = node + this.config.execPath = node + } + }) + + await time.start('npm:load:configload', () => this.config.load()) + + // npm --versions + if (this.config.get('versions', 'cli')) { + this.argv = ['version'] + this.config.set('usage', false, 'cli') + } else { + this.argv = [...this.config.parsedArgv.remain] + } + + // Remove first argv since that is our command as typed + // Note that this might not be the actual name of the command due to aliases, etc. + // But we use the raw form of it later in user output so it must be preserved as is. + const commandArg = this.argv.shift() + + // This is the actual name of the command that will be run or undefined if deref could not find a match + const command = deref(commandArg) + + await this.#display.load({ + command, + loglevel: this.config.get('loglevel'), + stdoutColor: this.color, + stderrColor: this.logColor, + timing: this.config.get('timing'), + unicode: this.config.get('unicode'), + progress: this.flatOptions.progress, + json: this.config.get('json'), + heading: this.config.get('heading'), + }) + process.env.COLOR = this.color ? '1' : '0' + + // npm -v + // return from here early so we don't create any caches/logfiles/timers etc + if (this.config.get('version', 'cli')) { + output.standard(this.version) + return { exec: false } + } + + // mkdir this separately since the logs dir can be set to a different location. + // if this fails, then we don't have a cache dir, but we don't want to fail immediately since the command might not need a cache dir (like `npm --version`) + await time.start('npm:load:mkdirpcache', () => + fs.mkdir(this.cache, { recursive: true }) + .catch((e) => log.verbose('cache', `could not create cache: ${e}`))) + + // it's ok if this fails. user might have specified an invalid dir which we will tell them about at the end + if (this.config.get('logs-max') > 0) { + await time.start('npm:load:mkdirplogs', () => + fs.mkdir(this.#logsDir, { recursive: true }) + .catch((e) => log.verbose('logfile', `could not create logs-dir: ${e}`))) + } + + // note: this MUST be shorter than the actual argv length, because it uses the same memory, so node will truncate it if it's too long. + // We time this because setting process.title is slow sometimes but we have to do it for security reasons. But still helpful to know how slow it is. + time.start('npm:load:setTitle', () => { + const { parsedArgv: { cooked, remain } } = this.config + // Secrets are mostly in configs, so title is set using only the positional args to keep those from being leaked. + // We still do a best effort replaceInfo. + this.#title = ['npm'].concat(replaceInfo(remain)).join(' ').trim() + process.title = this.#title + // The cooked argv is also logged separately for debugging purposes. + // It is cleaned as a best effort by replacing known secrets like basic auth password and strings that look like npm tokens. + // XXX: for this to be safer the config should create a sanitized version of the argv as it has the full context of what each option contains. + this.#argvClean = replaceInfo(cooked) + log.verbose('title', this.title) + log.verbose('argv', this.#argvClean.map(JSON.stringify).join(' ')) + }) + + // logFile.load returns a promise that resolves when old logs are done being cleaned. + // We save this promise to an array so that we can await it in tests to ensure more deterministic logging behavior. + // The process will also hang open if this were to take a long time to resolve, but that is why process.exit is called explicitly in the exit-handler. + this.unrefPromises.push(this.#logFile.load({ + command, + path: this.logPath, + logsMax: this.config.get('logs-max'), + timing: this.config.get('timing'), + })) + + this.#timers.load({ + path: this.logPath, + timing: this.config.get('timing'), + }) + + const configScope = this.config.get('scope') + if (configScope && !/^@/.test(configScope)) { + this.config.set('scope', `@${configScope}`, this.config.find('scope')) + } + + if (this.config.get('force')) { + log.warn('using --force', 'Recommended protections disabled.') + } + + return { exec: true, command: commandArg, args: this.argv } + } + + async exec (cmd, args = this.argv) { + if (!this.#command) { + let err + try { + await this.#exec(cmd, args) + } catch (e) { + err = e + } + return this.#handleError(err) + } else { + return this.#exec(cmd, args) + } + } + + // Call an npm command + async #exec (cmd, args) { + const Command = this.constructor.cmd(cmd) + const command = new Command(this) + + // since 'test', 'start', 'stop', etc. commands re-enter this function to call the run command, we need to only set it one time. + if (!this.#command) { + this.#command = command + process.env.npm_command = this.command + } + + // Only log warnings for legacy commands without definitions or subcommands + // Commands with definitions will handle warnings in base-cmd flags() + // Commands with subcommands will delegate to the subcommand to handle warnings + if (!Command.definitions && !Command.subcommands) { + this.config.logWarnings() + } + + // this needs to be rest after because some commands run this.npm.config.checkUnknown('publishConfig', key) + this.config.warn = true + + return this.execCommandClass(command, args, [cmd]) + } + + // Unified command execution for both top-level commands and subcommands + // Supports n-depth subcommands, workspaces, and definitions + async execCommandClass (commandInstance, args, commandPath = []) { + const Command = commandInstance.constructor + const commandName = commandPath.join(':') + + // Handle subcommands if present + if (Command.subcommands) { + const subcommandName = args[0] + + // If help is requested without a subcommand, show main command help + if (this.config.get('usage') && !subcommandName) { + return output.standard(commandInstance.usage) + } + + // If no subcommand provided, show usage error + if (!subcommandName) { + throw commandInstance.usageError() + } + + // Check if the subcommand exists + const SubCommand = Command.subcommands[subcommandName] + if (!SubCommand) { + throw commandInstance.usageError(`Unknown subcommand: ${subcommandName}`) + } + + // Check if help is requested for the subcommand + if (this.config.get('usage')) { + const parentName = commandPath[0] + return output.standard(SubCommand.getUsage(parentName)) + } + + // Create subcommand instance and recurse + const subcommandInstance = new SubCommand(this) + const subcommandArgs = args.slice(1) // Remove subcommand name from args + const subcommandPath = [...commandPath, subcommandName] + + return time.start(`command:${subcommandPath.join(':')}`, () => + this.execCommandClass(subcommandInstance, subcommandArgs, subcommandPath)) + } + + // No subcommands - execute this command + if (this.config.get('usage')) { + return output.standard(commandInstance.usage) + } + + let execWorkspaces = false + const hasWsConfig = this.config.get('workspaces') || this.config.get('workspace').length + // if cwd is a workspace, the default is set to [that workspace] + const implicitWs = this.config.get('workspace', 'default').length + // (-ws || -w foo) && (cwd is not a workspace || command is not ignoring implicit workspaces) + if (hasWsConfig && (!implicitWs || !Command.ignoreImplicitWorkspace)) { + if (this.global) { + throw new Error('Workspaces not supported for global packages') + } + if (!Command.workspaces) { + throw Object.assign(new Error('This command does not support workspaces.'), { + code: 'ENOWORKSPACES', + }) + } + execWorkspaces = true + } + + // Check dev engines if needed + if (commandInstance.checkDevEngines && !this.global) { + await commandInstance.checkDevEngines() + } + + // Execute command with or without definitions + if (Command.definitions) { + // config.argv contains the full argv with flags (set by Config in production, by MockNpm in tests) + // Pass depth so flags() knows how many command names to skip + const [flags, positionalArgs] = commandInstance.flags(commandPath.length) + return time.start(`command:${commandName}`, () => + execWorkspaces + ? commandInstance.execWorkspaces(positionalArgs, flags) + : commandInstance.exec(positionalArgs, flags)) + } else { + // Legacy commands without definitions + this.config.logWarnings() + return time.start(`command:${commandName}`, () => + execWorkspaces ? commandInstance.execWorkspaces(args) : commandInstance.exec(args)) + } + } + + // This gets called at the end of the exit handler and during any tests to cleanup all of our listeners + // Everything in here should be synchronous + unload () { + this.#timers.off() + this.#display.off() + this.#logFile.off() + } + + finish (err) { + // Finish all our timer work, this will write the file if requested, end timers, etc + this.#timers.finish({ + id: this.#runId, + command: this.#argvClean, + logfiles: this.logFiles, + version: this.version, + }) + + output.flush({ + [META]: true, + // json can be set during a command so we send the final value of it to the display layer here + json: this.loaded && this.config.get('json'), + jsonError: jsonError(err, this), + }) + } + + exitErrorMessage () { + if (this.logFiles.length) { + return `A complete log of this run can be found in: ${this.logFiles}` + } + + const logsMax = this.config.get('logs-max') + if (logsMax <= 0) { + // user specified no log file + return `Log files were not written due to the config logs-max=${logsMax}` + } + + // could be an error writing to the directory + return `Log files were not written due to an error writing to the directory: ${this.#logsDir}` + + '\nYou can rerun the command with `--loglevel=verbose` to see the logs in your terminal' + } + + async #handleError (err) { + if (err) { + // Get the local package if it exists for a more helpful error message + const localPkg = await require('@npmcli/package-json') + .normalize(this.localPrefix) + .then(p => p.content) + .catch(() => null) + Object.assign(err, this.#getError(err, { pkg: localPkg })) + } + + this.finish(err) + + if (err) { + throw err + } + } + + #getError (rawErr, opts) { + const { files = [], ...error } = require('./utils/error-message.js').getError(rawErr, { + npm: this, + command: this.#command, + ...opts, + }) + + const { writeFileSync } = require('node:fs') + for (const [file, content] of files) { + const filePath = `${this.logPath}${file}` + const fileContent = `'Log files:\n${this.logFiles.join('\n')}\n\n${content.trim()}\n` + try { + writeFileSync(filePath, fileContent) + error.detail.push(['', `\n\nFor a full report see:\n${filePath}`]) + } catch (fileErr) { + log.warn('', `Could not write error message to ${file} due to ${fileErr}`) + } + } + + outputError(error) + + return error + } + + get title () { + return this.#title + } + + get loaded () { + return this.config.loaded + } + + get version () { + return this.constructor.version + } + + get command () { + return this.#command?.name + } + + get flatOptions () { + const { flat } = this.config + flat.nodeVersion = process.version + flat.npmVersion = pkg.version + if (this.command) { + flat.npmCommand = this.command + } + return flat + } + + // color and logColor are a special derived values that takes into consideration not only the config, but whether or not we are operating in a tty with the associated output (stdout/stderr) + get color () { + return this.flatOptions.color + } + + get logColor () { + return this.flatOptions.logColor + } + + get noColorChalk () { + return this.#display.chalk.noColor + } + + get chalk () { + return this.#display.chalk.stdout + } + + get logChalk () { + return this.#display.chalk.stderr + } + + get global () { + return this.config.get('global') || this.config.get('location') === 'global' + } + + get silent () { + return this.flatOptions.silent + } + + get lockfileVersion () { + return 2 + } + + get started () { + return this.#timers.started + } + + get logFiles () { + return this.#logFile.files + } + + get #logsDir () { + return this.config.get('logs-dir') || join(this.cache, '_logs') + } + + get logPath () { + return resolve(this.#logsDir, `${this.#runId}-`) + } + + get npmRoot () { + return this.#npmRoot + } + + get cache () { + return this.config.get('cache') + } + + get globalPrefix () { + return this.config.globalPrefix + } + + get localPrefix () { + return this.config.localPrefix + } + + get localPackage () { + return this.config.localPackage + } + + get globalDir () { + return process.platform !== 'win32' + ? resolve(this.globalPrefix, 'lib', 'node_modules') + : resolve(this.globalPrefix, 'node_modules') + } + + get localDir () { + return resolve(this.localPrefix, 'node_modules') + } + + get dir () { + return this.global ? this.globalDir : this.localDir + } + + get globalBin () { + const b = this.globalPrefix + return process.platform !== 'win32' ? resolve(b, 'bin') : b + } + + get localBin () { + return resolve(this.dir, '.bin') + } + + get bin () { + return this.global ? this.globalBin : this.localBin + } + + get prefix () { + return this.global ? this.globalPrefix : this.localPrefix + } + + get usage () { + return usage(this) + } +} + +module.exports = Npm diff --git a/node/node_modules/npm/lib/package-url-cmd.js b/node/node_modules/npm/lib/package-url-cmd.js new file mode 100644 index 0000000000000000000000000000000000000000..23e9c4e762724a700a525e081dd789abc7ab572e --- /dev/null +++ b/node/node_modules/npm/lib/package-url-cmd.js @@ -0,0 +1,63 @@ +const pacote = require('pacote') +const { openUrl } = require('./utils/open-url.js') +const { log } = require('proc-log') +const BaseCommand = require('./base-cmd.js') + +// Base command for opening urls from a package manifest (bugs, docs, repo) +class PackageUrlCommand extends BaseCommand { + static params = [ + 'browser', + 'registry', + 'workspace', + 'workspaces', + 'include-workspace-root', + ] + + static workspaces = true + static ignoreImplicitWorkspace = false + static usage = ['[ [ ...]]'] + + async exec (args) { + if (!args || !args.length) { + args = ['.'] + } + + for (const arg of args) { + // XXX It is very odd that `where` is how pacote knows to look anywhere other than the cwd. + const opts = { + ...this.npm.flatOptions, + where: this.npm.localPrefix, + fullMetadata: true, + _isRoot: true, + } + const mani = await pacote.manifest(arg, opts) + const url = this.getUrl(arg, mani) + log.silly(this.name, 'url', url) + await openUrl(this.npm, url, `${mani.name} ${this.name} available at the following URL`) + } + } + + async execWorkspaces (args) { + if (args && args.length) { + return this.exec(args) + } + await this.setWorkspaces() + return this.exec(this.workspacePaths) + } + + // given a manifest, try to get the hosted git info from it based on repository (if a string) or repository.url (if an object) + // returns null if it's not a valid repo, or not a known hosted repo + hostedFromMani (mani) { + const hostedGitInfo = require('hosted-git-info') + const r = mani.repository + const rurl = !r ? null + : typeof r === 'string' ? r + : typeof r === 'object' && typeof r.url === 'string' ? r.url + : null + + // hgi returns undefined sometimes, but let's always return null here + return (rurl && hostedGitInfo.fromUrl(rurl.replace(/^git\+/, ''))) || null + } +} + +module.exports = PackageUrlCommand diff --git a/node/node_modules/npm/lib/trust-cmd.js b/node/node_modules/npm/lib/trust-cmd.js new file mode 100644 index 0000000000000000000000000000000000000000..c687b65021b9754ba438076936f38d2e25f6004e --- /dev/null +++ b/node/node_modules/npm/lib/trust-cmd.js @@ -0,0 +1,284 @@ +const BaseCommand = require('./base-cmd.js') +const { otplease } = require('./utils/auth.js') +const npmFetch = require('npm-registry-fetch') +const npa = require('npm-package-arg') +const { read: _read } = require('read') +const { input, output, log, META } = require('proc-log') +const gitinfo = require('hosted-git-info') +const pkgJson = require('@npmcli/package-json') + +const NPM_FRONTEND = 'https://www.npmjs.com' + +class TrustCommand extends BaseCommand { + // Helper to format template strings with color + // Blue text with reset color for interpolated values + warnString (strings, ...values) { + const chalk = this.npm.chalk + const message = strings.reduce((result, str, i) => { + return result + chalk.blue(str) + (values[i] ? chalk.reset(values[i]) : '') + }, '') + return message + } + + // Log a warning message with blue formatting + warn (strings, ...values) { + log.warn('trust', this.warnString(strings, ...values)) + } + + // dialogue is non-log text that is different from our usual npm prefix logging + // it should always show to the user unless --json is specified + // it's not controled by log levels + dialogue (strings, ...values) { + const json = this.config.get('json') + if (!json) { + output.standard(this.warnString(strings, ...values)) + } + } + + createConfig (pkg, body) { + const spec = npa(pkg) + const uri = `/-/package/${spec.escapedName}/trust` + return otplease(this.npm, this.npm.flatOptions, opts => npmFetch(uri, { + ...opts, + method: 'POST', + body: body, + })) + } + + logOptions (options, pad = true) { + const { values, warnings, fromPackageJson, urls } = { warnings: [], ...options } + if (warnings && warnings.length > 0) { + for (const warningMsg of warnings) { + log.warn('trust', warningMsg) + } + } + + const json = this.config.get('json') + if (json) { + // Disable redaction: trust config values (e.g. CircleCI UUIDs) are not secrets + output.standard(JSON.stringify(options.values, null, 2), { [META]: true, redact: false }) + return + } + + const chalk = this.npm.chalk + const { type, id, ...rest } = values || {} + + if (values) { + const lines = [] + if (type) { + lines.push(`type: ${chalk.green(type)}`) + } + if (id) { + lines.push(`id: ${chalk.green(id)}`) + } + for (const [key, value] of Object.entries(rest)) { + if (value !== null && value !== undefined) { + const parts = [ + `${chalk.reset(key)}: ${chalk.green(value)}`, + ] + if (fromPackageJson && fromPackageJson[key]) { + parts.push(`(${chalk.yellow(`from package.json`)})`) + } + lines.push(parts.join(' ')) + } + } + if (pad) { + output.standard() + } + output.standard(lines.join('\n'), { [META]: true, redact: false }) + // Print URLs on their own lines after config, following the same order as rest keys + if (urls) { + const urlLines = [] + for (const key of Object.keys(rest)) { + if (urls[key]) { + urlLines.push(chalk.blue(urls[key])) + } + } + if (urlLines.length > 0) { + output.standard() + output.standard(urlLines.join('\n'), { [META]: true, redact: false }) + } + } + if (pad) { + output.standard() + } + } + } + + async confirmOperation (yes) { + // Ask for confirmation unless --yes flag is set + if (yes === true) { + return + } + if (yes === false) { + throw new Error('User cancelled operation') + } + const confirm = await input.read( + () => _read({ prompt: 'Do you want to proceed? (y/N) ', default: 'n' }) + ) + const normalized = confirm.toLowerCase() + if (['y', 'yes'].includes(normalized)) { + return + } + throw new Error('User cancelled operation') + } + + getFrontendUrl ({ pkgName }) { + if (this.registryIsDefault) { + return new URL(`/package/${pkgName}`, NPM_FRONTEND).toString() + } + return null + } + + getRepositoryFromPackageJson (pkg) { + const info = gitinfo.fromUrl(pkg.repository?.url || pkg?.repository) + if (!info) { + return null + } + const repository = info.user + '/' + info.project + const type = info.type + return { repository, type } + } + + async optionalPkgJson () { + try { + const { content } = await pkgJson.normalize(this.npm.prefix) + return content + } catch (err) { + return {} + } + } + + get registryIsDefault () { + return this.npm.config.defaults.registry === this.npm.config.get('registry') + } + + // generic + static bodyToOptions (body) { + return { + ...(body.id) && { id: body.id }, + ...(body.type) && { type: body.type }, + } + } + + async createConfigCommand ({ positionalArgs, flags }) { + const { providerName, providerEntity, providerHostname } = this.constructor + const dryRun = this.config.get('dry-run') + const yes = this.config.get('yes') // deep-lore this allows for --no-yes + const options = await this.flagsToOptions({ positionalArgs, flags, providerHostname }) + this.dialogue`Establishing trust between ${options.values.package} package and ${providerName}` + this.dialogue`Anyone with ${providerEntity} write access can publish to ${options.values.package}` + this.dialogue`Two-factor authentication is required for this operation` + if (!this.registryIsDefault) { + this.warn`Registry ${this.npm.config.get('registry')} may not support trusted publishing` + } + this.logOptions(options) + if (dryRun) { + return + } + await this.confirmOperation(yes) + const trustConfig = this.constructor.optionsToBody(options.values) + const response = await this.createConfig(options.values.package, [trustConfig]) + const body = await response.json() + this.dialogue`Trust configuration created successfully for ${options.values.package} with the following settings:` + this.displayResponseBody({ body, packageName: options.values.package }) + } + + async flagsToOptions ({ positionalArgs, flags, providerHostname }) { + const { entityKey, name, providerEntity, providerFile } = this.constructor + const content = await this.optionalPkgJson() + const pkgPositional = positionalArgs[0] + const pkgJsonName = content.name + const git = this.getRepositoryFromPackageJson(content) + // the provided positional matches package.json name or no positional provided + const matchPkg = (!pkgPositional || pkgPositional === pkgJsonName) + const pkgName = pkgPositional || pkgJsonName + const usedPkgNameFromPkgJson = !pkgPositional && Boolean(pkgJsonName) + const invalidPkgJsonProviderType = matchPkg && git && git?.type !== name + + let entity + let entitySource + + if (flags[entityKey]) { + entity = flags[entityKey] + entitySource = 'flag' + } else if (!invalidPkgJsonProviderType && git?.repository) { + entity = git.repository + entitySource = 'package.json' + } + const mismatchPkgJsonRepository = matchPkg && git && entity !== git.repository + const usedRepositoryInPkgJson = entitySource === 'package.json' + + const warnings = [] + if (!pkgName) { + throw new Error('Package name must be specified either as an argument or in package.json file') + } + + if (!flags.file) { + throw new Error(`${providerFile} must be specified with the file option`) + } + if (!flags.file.endsWith('.yml') && !flags.file.endsWith('.yaml')) { + throw new Error(`${providerFile} must end in .yml or .yaml`) + } + + this.validateFile?.(flags.file) + + if (invalidPkgJsonProviderType) { + const message = this.warnString`Repository in package.json is not a ${providerEntity}` + if (!flags[entityKey]) { + throw new Error(message) + } else { + warnings.push(message) + } + } else { + if (mismatchPkgJsonRepository) { + warnings.push(this.warnString`Repository in package.json (${git.repository}) differs from provided ${providerEntity} (${entity})`) + } + } + + if (!entity && matchPkg) { + throw new Error(`${providerEntity} must be specified with ${entityKey} option or inferred from the package.json repository field`) + } + if (!entity) { + throw new Error(`${providerEntity} must be specified with ${entityKey} option`) + } + + this.validateEntity(entity) + + return { + values: { + package: pkgName, + file: flags.file, + [entityKey]: entity, + ...(flags.environment && { environment: flags.environment }), + }, + fromPackageJson: { + [entityKey]: usedRepositoryInPkgJson, + package: usedPkgNameFromPkgJson, + }, + warnings: warnings, + urls: { + package: this.getFrontendUrl({ pkgName }), + [entityKey]: this.getEntityUrl({ providerHostname, entity }), + file: this.getEntityUrl({ providerHostname, entity, file: flags.file }), + }, + } + } + + displayResponseBody ({ body, packageName }) { + if (!body || body.length === 0) { + this.dialogue`No trust configurations found for package (${packageName})` + return + } + const items = Array.isArray(body) ? body : [body] + for (const config of items) { + const values = this.constructor.bodyToOptions(config) + output.standard() + this.logOptions({ values }, false) + } + output.standard() + } +} + +module.exports = TrustCommand +module.exports.NPM_FRONTEND = NPM_FRONTEND diff --git a/node/node_modules/npm/node_modules/abbrev/LICENSE b/node/node_modules/npm/node_modules/abbrev/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..7a22a2602f2d80aad671c6ce7e4662c446197b15 --- /dev/null +++ b/node/node_modules/npm/node_modules/abbrev/LICENSE @@ -0,0 +1,46 @@ +This software is dual-licensed under the ISC and MIT licenses. +You may use this software under EITHER of the following licenses. + +---------- + +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---------- + +Copyright Isaac Z. Schlueter and Contributors +All rights reserved. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/abbrev/package.json b/node/node_modules/npm/node_modules/abbrev/package.json new file mode 100644 index 0000000000000000000000000000000000000000..ba8062e962c14e4095f8d1ddf79ef6ac9475bf0e --- /dev/null +++ b/node/node_modules/npm/node_modules/abbrev/package.json @@ -0,0 +1,41 @@ +{ + "name": "abbrev", + "version": "4.0.0", + "description": "Like ruby's abbrev module, but in js", + "author": "GitHub Inc.", + "main": "lib/index.js", + "scripts": { + "test": "node --test", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "snap": "node --test --test-update-snapshots", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", + "test:cover": "node --test --experimental-test-coverage --test-timeout=3000 --test-coverage-lines=100 --test-coverage-functions=100 --test-coverage-branches=100" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/abbrev-js.git" + }, + "license": "ISC", + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.26.1" + }, + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.26.1", + "publish": true, + "testRunner": "node:test", + "latestCiVersion": 24 + } +} diff --git a/node/node_modules/npm/node_modules/agent-base/LICENSE b/node/node_modules/npm/node_modules/agent-base/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..614e769385ba807ca65acb9f19090eb02d6548fc --- /dev/null +++ b/node/node_modules/npm/node_modules/agent-base/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2013 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/agent-base/package.json b/node/node_modules/npm/node_modules/agent-base/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9fb5a4b91a738632cb24afb89a6110b87d2cf05e --- /dev/null +++ b/node/node_modules/npm/node_modules/agent-base/package.json @@ -0,0 +1,46 @@ +{ + "name": "agent-base", + "version": "7.1.4", + "description": "Turn a function into an `http.Agent` instance", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], + "repository": { + "type": "git", + "url": "https://github.com/TooTallNate/proxy-agents.git", + "directory": "packages/agent-base" + }, + "keywords": [ + "http", + "agent", + "base", + "barebones", + "https" + ], + "author": "Nathan Rajlich (http://n8.io/)", + "license": "MIT", + "devDependencies": { + "@types/debug": "^4.1.7", + "@types/jest": "^29.5.1", + "@types/node": "^14.18.45", + "@types/semver": "^7.3.13", + "@types/ws": "^6.0.4", + "async-listen": "^3.0.0", + "jest": "^29.5.0", + "ts-jest": "^29.1.0", + "typescript": "^5.0.4", + "ws": "^5.2.4", + "tsconfig": "0.0.0" + }, + "engines": { + "node": ">= 14" + }, + "scripts": { + "build": "tsc", + "test": "jest --env node --verbose --bail", + "lint": "eslint . --ext .ts", + "pack": "node ../../scripts/pack.mjs" + } +} \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/aproba/LICENSE b/node/node_modules/npm/node_modules/aproba/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c8633408954df9cb0f8a816496a7a863353a1d04 --- /dev/null +++ b/node/node_modules/npm/node_modules/aproba/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/node/node_modules/npm/node_modules/aproba/index.js b/node/node_modules/npm/node_modules/aproba/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3ffe0a4cd3f586a8c1fe503a109b56f256985dc7 --- /dev/null +++ b/node/node_modules/npm/node_modules/aproba/index.js @@ -0,0 +1,105 @@ +'use strict' +module.exports = validate + +function isArguments (thingy) { + return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') +} + +const types = { + '*': {label: 'any', check: () => true}, + A: {label: 'array', check: _ => Array.isArray(_) || isArguments(_)}, + S: {label: 'string', check: _ => typeof _ === 'string'}, + N: {label: 'number', check: _ => typeof _ === 'number'}, + F: {label: 'function', check: _ => typeof _ === 'function'}, + O: {label: 'object', check: _ => typeof _ === 'object' && _ != null && !types.A.check(_) && !types.E.check(_)}, + B: {label: 'boolean', check: _ => typeof _ === 'boolean'}, + E: {label: 'error', check: _ => _ instanceof Error}, + Z: {label: 'null', check: _ => _ == null} +} + +function addSchema (schema, arity) { + const group = arity[schema.length] = arity[schema.length] || [] + if (group.indexOf(schema) === -1) group.push(schema) +} + +function validate (rawSchemas, args) { + if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) + if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') + if (!args) throw missingRequiredArg(1, 'args') + if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) + if (!types.A.check(args)) throw invalidType(1, ['array'], args) + const schemas = rawSchemas.split('|') + const arity = {} + + schemas.forEach(schema => { + for (let ii = 0; ii < schema.length; ++ii) { + const type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + } + if (/E.*E/.test(schema)) throw moreThanOneError(schema) + addSchema(schema, arity) + if (/E/.test(schema)) { + addSchema(schema.replace(/E.*$/, 'E'), arity) + addSchema(schema.replace(/E/, 'Z'), arity) + if (schema.length === 1) addSchema('', arity) + } + }) + let matching = arity[args.length] + if (!matching) { + throw wrongNumberOfArgs(Object.keys(arity), args.length) + } + for (let ii = 0; ii < args.length; ++ii) { + let newMatching = matching.filter(schema => { + const type = schema[ii] + const typeCheck = types[type].check + return typeCheck(args[ii]) + }) + if (!newMatching.length) { + const labels = matching.map(_ => types[_[ii]].label).filter(_ => _ != null) + throw invalidType(ii, labels, args[ii]) + } + matching = newMatching + } +} + +function missingRequiredArg (num) { + return newException('EMISSINGARG', 'Missing required argument #' + (num + 1)) +} + +function unknownType (num, type) { + return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1)) +} + +function invalidType (num, expectedTypes, value) { + let valueType + Object.keys(types).forEach(typeCode => { + if (types[typeCode].check(value)) valueType = types[typeCode].label + }) + return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + + englishList(expectedTypes) + ' but got ' + valueType) +} + +function englishList (list) { + return list.join(', ').replace(/, ([^,]+)$/, ' or $1') +} + +function wrongNumberOfArgs (expected, got) { + const english = englishList(expected) + const args = expected.every(ex => ex.length === 1) + ? 'argument' + : 'arguments' + return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) +} + +function moreThanOneError (schema) { + return newException('ETOOMANYERRORTYPES', + 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') +} + +function newException (code, msg) { + const err = new TypeError(msg) + err.code = code + /* istanbul ignore else */ + if (Error.captureStackTrace) Error.captureStackTrace(err, validate) + return err +} diff --git a/node/node_modules/npm/node_modules/aproba/package.json b/node/node_modules/npm/node_modules/aproba/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2ef517ea48936e5c8402113962808d1ea466f18f --- /dev/null +++ b/node/node_modules/npm/node_modules/aproba/package.json @@ -0,0 +1,35 @@ +{ + "name": "aproba", + "version": "2.1.0", + "description": "A ridiculously light-weight argument validator (now browser friendly)", + "main": "index.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "standard": "^11.0.1", + "tap": "^12.0.1" + }, + "files": [ + "index.js" + ], + "scripts": { + "pretest": "standard", + "test": "tap --100 -J test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/iarna/aproba" + }, + "keywords": [ + "argument", + "validate" + ], + "author": "Rebecca Turner ", + "license": "ISC", + "bugs": { + "url": "https://github.com/iarna/aproba/issues" + }, + "homepage": "https://github.com/iarna/aproba" +} diff --git a/node/node_modules/npm/node_modules/archy/LICENSE b/node/node_modules/npm/node_modules/archy/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c477f448849a0dc6110f443cda7b3968a77cf24a --- /dev/null +++ b/node/node_modules/npm/node_modules/archy/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/archy/index.js b/node/node_modules/npm/node_modules/archy/index.js new file mode 100644 index 0000000000000000000000000000000000000000..039db0c58c7a7c16af8eb86be79c81f9dd3588e3 --- /dev/null +++ b/node/node_modules/npm/node_modules/archy/index.js @@ -0,0 +1,35 @@ +module.exports = function archy (obj, prefix, opts) { + if (prefix === undefined) prefix = ''; + if (!opts) opts = {}; + var chr = function (s) { + var chars = { + '│' : '|', + '└' : '`', + '├' : '+', + '─' : '-', + '┬' : '-' + }; + return opts.unicode === false ? chars[s] : s; + }; + + if (typeof obj === 'string') obj = { label : obj }; + + var nodes = obj.nodes || []; + var lines = (obj.label || '').split('\n'); + var splitter = '\n' + prefix + (nodes.length ? chr('│') : ' ') + ' '; + + return prefix + + lines.join(splitter) + '\n' + + nodes.map(function (node, ix) { + var last = ix === nodes.length - 1; + var more = node.nodes && node.nodes.length; + var prefix_ = prefix + (last ? ' ' : chr('│')) + ' '; + + return prefix + + (last ? chr('└') : chr('├')) + chr('─') + + (more ? chr('┬') : chr('─')) + ' ' + + archy(node, prefix_, opts).slice(prefix.length + 2) + ; + }).join('') + ; +}; diff --git a/node/node_modules/npm/node_modules/archy/package.json b/node/node_modules/npm/node_modules/archy/package.json new file mode 100644 index 0000000000000000000000000000000000000000..6679cf49d07392337954d4847c29e7aff65fc4fc --- /dev/null +++ b/node/node_modules/npm/node_modules/archy/package.json @@ -0,0 +1,40 @@ +{ + "name" : "archy", + "version" : "1.0.0", + "description" : "render nested hierarchies `npm ls` style with unicode pipes", + "main" : "index.js", + "devDependencies" : { + "tap" : "~0.3.3", + "tape" : "~0.1.1" + }, + "scripts" : { + "test" : "tap test" + }, + "testling" : { + "files" : "test/*.js", + "browsers" : { + "iexplore" : [ "6.0", "7.0", "8.0", "9.0" ], + "chrome" : [ "20.0" ], + "firefox" : [ "10.0", "15.0" ], + "safari" : [ "5.1" ], + "opera" : [ "12.0" ] + } + }, + "repository" : { + "type" : "git", + "url" : "http://github.com/substack/node-archy.git" + }, + "keywords" : [ + "hierarchy", + "npm ls", + "unicode", + "pretty", + "print" + ], + "author" : { + "name" : "James Halliday", + "email" : "mail@substack.net", + "url" : "http://substack.net" + }, + "license" : "MIT" +} diff --git a/node/node_modules/npm/node_modules/balanced-match/LICENSE.md b/node/node_modules/npm/node_modules/balanced-match/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..5a87387a7fea27a0b653bb2c120bfb99e9409821 --- /dev/null +++ b/node/node_modules/npm/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,23 @@ +(MIT) + +Original code Copyright Julian Gruber + +Port to TypeScript Copyright Isaac Z. Schlueter + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node/node_modules/npm/node_modules/balanced-match/package.json b/node/node_modules/npm/node_modules/balanced-match/package.json new file mode 100644 index 0000000000000000000000000000000000000000..db4770429369fef915102a8aeb10a72f249a2086 --- /dev/null +++ b/node/node_modules/npm/node_modules/balanced-match/package.json @@ -0,0 +1,68 @@ +{ + "name": "balanced-match", + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "version": "4.0.4", + "files": [ + "dist" + ], + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "type": "module", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write .", + "benchmark": "node benchmark/index.js", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "devDependencies": { + "@types/brace-expansion": "^1.1.2", + "@types/node": "^25.2.1", + "mkdirp": "^3.0.1", + "prettier": "^3.3.2", + "tap": "^21.6.2", + "tshy": "^3.0.2", + "typedoc": "^0.28.5" + }, + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js" +} diff --git a/node/node_modules/npm/node_modules/bin-links/LICENSE b/node/node_modules/npm/node_modules/bin-links/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..3d4e2b4fb62e71b5d7251a510e16c4c8d7c0b287 --- /dev/null +++ b/node/node_modules/npm/node_modules/bin-links/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/bin-links/package.json b/node/node_modules/npm/node_modules/bin-links/package.json new file mode 100644 index 0000000000000000000000000000000000000000..cd2bb8de1eb574e688d31df2ccb84553e1088faf --- /dev/null +++ b/node/node_modules/npm/node_modules/bin-links/package.json @@ -0,0 +1,61 @@ +{ + "name": "bin-links", + "version": "6.0.0", + "description": "JavaScript package binary linker", + "main": "./lib/index.js", + "scripts": { + "snap": "tap", + "test": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "posttest": "npm run lint", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/bin-links.git" + }, + "keywords": [ + "npm", + "link", + "bins" + ], + "license": "ISC", + "dependencies": { + "cmd-shim": "^8.0.0", + "npm-normalize-package-bin": "^5.0.0", + "proc-log": "^6.0.0", + "read-cmd-shim": "^6.0.0", + "write-file-atomic": "^7.0.0" + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "require-inject": "^1.4.4", + "tap": "^16.0.1" + }, + "tap": { + "check-coverage": true, + "coverage-map": "map.js", + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "author": "GitHub Inc.", + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "windowsCI": false, + "version": "4.27.1", + "publish": true + } +} diff --git a/node/node_modules/npm/node_modules/binary-extensions/binary-extensions.json b/node/node_modules/npm/node_modules/binary-extensions/binary-extensions.json new file mode 100644 index 0000000000000000000000000000000000000000..e267c3cfcc79cdf75fab7ff650ab6f038653cf66 --- /dev/null +++ b/node/node_modules/npm/node_modules/binary-extensions/binary-extensions.json @@ -0,0 +1,264 @@ +[ + "3dm", + "3ds", + "3g2", + "3gp", + "7z", + "a", + "aac", + "adp", + "afdesign", + "afphoto", + "afpub", + "ai", + "aif", + "aiff", + "alz", + "ape", + "apk", + "appimage", + "ar", + "arj", + "asf", + "au", + "avi", + "bak", + "baml", + "bh", + "bin", + "bk", + "bmp", + "btif", + "bz2", + "bzip2", + "cab", + "caf", + "cgm", + "class", + "cmx", + "cpio", + "cr2", + "cr3", + "cur", + "dat", + "dcm", + "deb", + "dex", + "djvu", + "dll", + "dmg", + "dng", + "doc", + "docm", + "docx", + "dot", + "dotm", + "dra", + "DS_Store", + "dsk", + "dts", + "dtshd", + "dvb", + "dwg", + "dxf", + "ecelp4800", + "ecelp7470", + "ecelp9600", + "egg", + "eol", + "eot", + "epub", + "exe", + "f4v", + "fbs", + "fh", + "fla", + "flac", + "flatpak", + "fli", + "flv", + "fpx", + "fst", + "fvt", + "g3", + "gh", + "gif", + "graffle", + "gz", + "gzip", + "h261", + "h263", + "h264", + "icns", + "ico", + "ief", + "img", + "ipa", + "iso", + "jar", + "jpeg", + "jpg", + "jpgv", + "jpm", + "jxr", + "key", + "ktx", + "lha", + "lib", + "lvp", + "lz", + "lzh", + "lzma", + "lzo", + "m3u", + "m4a", + "m4v", + "mar", + "mdi", + "mht", + "mid", + "midi", + "mj2", + "mka", + "mkv", + "mmr", + "mng", + "mobi", + "mov", + "movie", + "mp3", + "mp4", + "mp4a", + "mpeg", + "mpg", + "mpga", + "mxu", + "nef", + "npx", + "numbers", + "nupkg", + "o", + "odp", + "ods", + "odt", + "oga", + "ogg", + "ogv", + "otf", + "ott", + "pages", + "pbm", + "pcx", + "pdb", + "pdf", + "pea", + "pgm", + "pic", + "png", + "pnm", + "pot", + "potm", + "potx", + "ppa", + "ppam", + "ppm", + "pps", + "ppsm", + "ppsx", + "ppt", + "pptm", + "pptx", + "psd", + "pya", + "pyc", + "pyo", + "pyv", + "qt", + "rar", + "ras", + "raw", + "resources", + "rgb", + "rip", + "rlc", + "rmf", + "rmvb", + "rpm", + "rtf", + "rz", + "s3m", + "s7z", + "scpt", + "sgi", + "shar", + "snap", + "sil", + "sketch", + "slk", + "smv", + "snk", + "so", + "stl", + "suo", + "sub", + "swf", + "tar", + "tbz", + "tbz2", + "tga", + "tgz", + "thmx", + "tif", + "tiff", + "tlz", + "ttc", + "ttf", + "txz", + "udf", + "uvh", + "uvi", + "uvm", + "uvp", + "uvs", + "uvu", + "viv", + "vob", + "war", + "wav", + "wax", + "wbmp", + "wdp", + "weba", + "webm", + "webp", + "whl", + "wim", + "wm", + "wma", + "wmv", + "wmx", + "woff", + "woff2", + "wrm", + "wvx", + "xbm", + "xif", + "xla", + "xlam", + "xls", + "xlsb", + "xlsm", + "xlsx", + "xlt", + "xltm", + "xltx", + "xm", + "xmind", + "xpi", + "xpm", + "xwd", + "xz", + "z", + "zip", + "zipx" +] diff --git a/node/node_modules/npm/node_modules/binary-extensions/index.js b/node/node_modules/npm/node_modules/binary-extensions/index.js new file mode 100644 index 0000000000000000000000000000000000000000..bd4f0aed39cf22b9546449fa6c9b35c316ebe8dd --- /dev/null +++ b/node/node_modules/npm/node_modules/binary-extensions/index.js @@ -0,0 +1,3 @@ +import binaryExtensions from './binary-extensions.json' with {type: 'json'}; + +export default binaryExtensions; diff --git a/node/node_modules/npm/node_modules/binary-extensions/license b/node/node_modules/npm/node_modules/binary-extensions/license new file mode 100644 index 0000000000000000000000000000000000000000..7cbe2d32ece998606d9cf0601d065e66e56f8077 --- /dev/null +++ b/node/node_modules/npm/node_modules/binary-extensions/license @@ -0,0 +1,10 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) +Copyright (c) Paul Miller (https://paulmillr.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/binary-extensions/package.json b/node/node_modules/npm/node_modules/binary-extensions/package.json new file mode 100644 index 0000000000000000000000000000000000000000..da5b04fdd3feedcca388bb5c7f6c1d9f04daf5ba --- /dev/null +++ b/node/node_modules/npm/node_modules/binary-extensions/package.json @@ -0,0 +1,45 @@ +{ + "name": "binary-extensions", + "version": "3.1.0", + "description": "List of binary file extensions", + "license": "MIT", + "repository": "sindresorhus/binary-extensions", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": { + "types": "./index.d.ts", + "default": "./index.js" + }, + "sideEffects": false, + "engines": { + "node": ">=18.20" + }, + "scripts": { + "//test": "xo && ava && tsd", + "test": "ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts", + "binary-extensions.json" + ], + "keywords": [ + "binary", + "extensions", + "extension", + "file", + "json", + "list", + "array" + ], + "devDependencies": { + "ava": "^6.1.2", + "tsd": "^0.31.0", + "xo": "^0.58.0" + } +} diff --git a/node/node_modules/npm/node_modules/brace-expansion/LICENSE b/node/node_modules/npm/node_modules/brace-expansion/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a2140c713e21ab80eedc700d411dceb362f99bdc --- /dev/null +++ b/node/node_modules/npm/node_modules/brace-expansion/LICENSE @@ -0,0 +1,23 @@ +MIT License + +Copyright Julian Gruber + +TypeScript port Copyright Isaac Z. Schlueter + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node/node_modules/npm/node_modules/brace-expansion/package.json b/node/node_modules/npm/node_modules/brace-expansion/package.json new file mode 100644 index 0000000000000000000000000000000000000000..df6dec866611510ea214b367604cdbd4c35e5d45 --- /dev/null +++ b/node/node_modules/npm/node_modules/brace-expansion/package.json @@ -0,0 +1,64 @@ +{ + "name": "brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "5.0.5", + "files": [ + "dist" + ], + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "type": "module", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write .", + "benchmark": "node benchmark/index.js", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "devDependencies": { + "@types/brace-expansion": "^1.1.2", + "@types/node": "^25.2.1", + "mkdirp": "^3.0.1", + "prettier": "^3.3.2", + "tap": "^21.6.2", + "tshy": "^3.0.2", + "typedoc": "^0.28.5" + }, + "dependencies": { + "balanced-match": "^4.0.2" + }, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/juliangruber/brace-expansion.git" + } +} diff --git a/node/node_modules/npm/node_modules/cacache/LICENSE.md b/node/node_modules/npm/node_modules/cacache/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..70afbdaa31d47c3016859724e15011b292cc7b3a --- /dev/null +++ b/node/node_modules/npm/node_modules/cacache/LICENSE.md @@ -0,0 +1,16 @@ +ISC License + +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted, provided that the +above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS +ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/cacache/package.json b/node/node_modules/npm/node_modules/cacache/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2cf0e8b7f1d089b44809de8d2cfdf33da3f5091a --- /dev/null +++ b/node/node_modules/npm/node_modules/cacache/package.json @@ -0,0 +1,81 @@ +{ + "name": "cacache", + "version": "20.0.4", + "cache-version": { + "content": "2", + "index": "5" + }, + "description": "Fast, fault-tolerant, cross-platform, disk-based, data-agnostic, content-addressable cache.", + "main": "lib/index.js", + "files": [ + "bin/", + "lib/" + ], + "scripts": { + "test": "tap", + "snap": "tap", + "coverage": "tap", + "test-docker": "docker run -it --rm --name pacotest -v \"$PWD\":/tmp -w /tmp node:latest npm test", + "lint": "npm run eslint", + "npmclilint": "npmcli-lint", + "lintfix": "npm run eslint -- --fix", + "postsnap": "npm run lintfix --", + "postlint": "template-oss-check", + "posttest": "npm run lint", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cacache.git" + }, + "keywords": [ + "cache", + "caching", + "content-addressable", + "sri", + "sri hash", + "subresource integrity", + "cache", + "storage", + "store", + "file store", + "filesystem", + "disk cache", + "disk storage" + ], + "license": "ISC", + "dependencies": { + "@npmcli/fs": "^5.0.0", + "fs-minipass": "^3.0.0", + "glob": "^13.0.0", + "lru-cache": "^11.1.0", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^7.0.2", + "ssri": "^13.0.0" + }, + "devDependencies": { + "@npmcli/eslint-config": "^6.0.1", + "@npmcli/template-oss": "4.29.0", + "tap": "^16.0.0" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "windowsCI": false, + "version": "4.29.0", + "publish": "true" + }, + "author": "GitHub Inc.", + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node/node_modules/npm/node_modules/chalk/license b/node/node_modules/npm/node_modules/chalk/license new file mode 100644 index 0000000000000000000000000000000000000000..0f2d6cdf18ca059e54ad911b1debe1a08a708b84 --- /dev/null +++ b/node/node_modules/npm/node_modules/chalk/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/chalk/package.json b/node/node_modules/npm/node_modules/chalk/package.json new file mode 100644 index 0000000000000000000000000000000000000000..53ef2284e983f2dbcb38b1bd55b1f4541353cbfa --- /dev/null +++ b/node/node_modules/npm/node_modules/chalk/package.json @@ -0,0 +1,83 @@ +{ + "name": "chalk", + "version": "5.6.2", + "description": "Terminal string styling done right", + "license": "MIT", + "repository": "chalk/chalk", + "funding": "https://github.com/chalk/chalk?sponsor=1", + "type": "module", + "main": "./source/index.js", + "exports": "./source/index.js", + "imports": { + "#ansi-styles": "./source/vendor/ansi-styles/index.js", + "#supports-color": { + "node": "./source/vendor/supports-color/index.js", + "default": "./source/vendor/supports-color/browser.js" + } + }, + "types": "./source/index.d.ts", + "sideEffects": false, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "scripts": { + "test": "xo && c8 ava && tsd", + "bench": "matcha benchmark.js" + }, + "files": [ + "source", + "!source/index.test-d.ts" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "devDependencies": { + "@types/node": "^16.11.10", + "ava": "^3.15.0", + "c8": "^7.10.0", + "color-convert": "^2.0.1", + "execa": "^6.0.0", + "log-update": "^5.0.0", + "matcha": "^0.7.0", + "tsd": "^0.19.0", + "xo": "^0.57.0", + "yoctodelay": "^2.0.0" + }, + "xo": { + "rules": { + "unicorn/prefer-string-slice": "off", + "@typescript-eslint/consistent-type-imports": "off", + "@typescript-eslint/consistent-type-exports": "off", + "@typescript-eslint/consistent-type-definitions": "off", + "unicorn/expiring-todo-comments": "off" + } + }, + "c8": { + "reporter": [ + "text", + "lcov" + ], + "exclude": [ + "source/vendor" + ] + } +} diff --git a/node/node_modules/npm/node_modules/chownr/LICENSE.md b/node/node_modules/npm/node_modules/chownr/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..d4082d06dd2530afb592b94ccbaa7ae6cd7091e4 --- /dev/null +++ b/node/node_modules/npm/node_modules/chownr/LICENSE.md @@ -0,0 +1,63 @@ +All packages under `src/` are licensed according to the terms in +their respective `LICENSE` or `LICENSE.md` files. + +The remainder of this project is licensed under the Blue Oak +Model License, as follows: + +----- + +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** diff --git a/node/node_modules/npm/node_modules/chownr/package.json b/node/node_modules/npm/node_modules/chownr/package.json new file mode 100644 index 0000000000000000000000000000000000000000..38041f972982f6424a31559c0d3c72469782d513 --- /dev/null +++ b/node/node_modules/npm/node_modules/chownr/package.json @@ -0,0 +1,69 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "name": "chownr", + "description": "like `chown -R`", + "version": "3.0.0", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/chownr.git" + }, + "files": [ + "dist" + ], + "devDependencies": { + "@types/node": "^20.12.5", + "mkdirp": "^3.0.1", + "prettier": "^3.2.5", + "rimraf": "^5.0.5", + "tap": "^18.7.2", + "tshy": "^1.13.1", + "typedoc": "^0.25.12" + }, + "scripts": { + "prepare": "tshy", + "pretest": "npm run prepare", + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "format": "prettier --write . --loglevel warn", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "type": "module", + "prettier": { + "semi": false, + "printWidth": 75, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + } +} diff --git a/node/node_modules/npm/node_modules/ci-info/LICENSE b/node/node_modules/npm/node_modules/ci-info/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..dca41826876348b6902152fb25c96750a32098c4 --- /dev/null +++ b/node/node_modules/npm/node_modules/ci-info/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Thomas Watson Steen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node/node_modules/npm/node_modules/ci-info/index.js b/node/node_modules/npm/node_modules/ci-info/index.js new file mode 100644 index 0000000000000000000000000000000000000000..133d3c5e29920faced7f63ae341cddedc1f2d764 --- /dev/null +++ b/node/node_modules/npm/node_modules/ci-info/index.js @@ -0,0 +1,104 @@ +'use strict' + +const vendors = require('./vendors.json') + +const env = process.env + +// Used for testing only +Object.defineProperty(exports, '_vendors', { + value: vendors.map(function (v) { + return v.constant + }) +}) + +exports.name = null +exports.isPR = null +exports.id = null + +if (env.CI !== 'false') { + vendors.forEach(function (vendor) { + const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env] + const isCI = envs.every(function (obj) { + return checkEnv(obj) + }) + + exports[vendor.constant] = isCI + + if (!isCI) { + return + } + + exports.name = vendor.name + exports.isPR = checkPR(vendor) + exports.id = vendor.constant + }) +} + +exports.isCI = !!( + env.CI !== 'false' && // Bypass all checks if CI env is explicitly set to 'false' + (env.BUILD_ID || // Jenkins, Cloudbees + env.BUILD_NUMBER || // Jenkins, TeamCity + env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari, Cloudflare Pages/Workers + env.CI_APP_ID || // Appflow + env.CI_BUILD_ID || // Appflow + env.CI_BUILD_NUMBER || // Appflow + env.CI_NAME || // Codeship and others + env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI + env.RUN_ID || // TaskCluster, dsari + exports.name || + false) +) + +function checkEnv (obj) { + // "env": "CIRRUS" + if (typeof obj === 'string') return !!env[obj] + + // "env": { "env": "NODE", "includes": "/app/.heroku/node/bin/node" } + if ('env' in obj) { + // Currently there are no other types, uncomment when there are + // if ('includes' in obj) { + return env[obj.env] && env[obj.env].includes(obj.includes) + // } + } + + if ('any' in obj) { + return obj.any.some(function (k) { + return !!env[k] + }) + } + + return Object.keys(obj).every(function (k) { + return env[k] === obj[k] + }) +} + +function checkPR (vendor) { + switch (typeof vendor.pr) { + case 'string': + // "pr": "CIRRUS_PR" + return !!env[vendor.pr] + case 'object': + if ('env' in vendor.pr) { + if ('any' in vendor.pr) { + // "pr": { "env": "CODEBUILD_WEBHOOK_EVENT", "any": ["PULL_REQUEST_CREATED", "PULL_REQUEST_UPDATED"] } + return vendor.pr.any.some(function (key) { + return env[vendor.pr.env] === key + }) + } else { + // "pr": { "env": "BUILDKITE_PULL_REQUEST", "ne": "false" } + return vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne + } + } else if ('any' in vendor.pr) { + // "pr": { "any": ["ghprbPullId", "CHANGE_ID"] } + return vendor.pr.any.some(function (key) { + return !!env[key] + }) + } else { + // "pr": { "DRONE_BUILD_EVENT": "pull_request" } + return checkEnv(vendor.pr) + } + default: + // PR detection not supported for this vendor + return null + } +} diff --git a/node/node_modules/npm/node_modules/ci-info/package.json b/node/node_modules/npm/node_modules/ci-info/package.json new file mode 100644 index 0000000000000000000000000000000000000000..cb31277a83a813a720835b8bdad47a26327a9fa8 --- /dev/null +++ b/node/node_modules/npm/node_modules/ci-info/package.json @@ -0,0 +1,54 @@ +{ + "name": "ci-info", + "version": "4.4.0", + "description": "Get details about the current Continuous Integration environment", + "main": "index.js", + "typings": "index.d.ts", + "type": "commonjs", + "author": "Thomas Watson Steen (https://twitter.com/wa7son)", + "license": "MIT", + "repository": "github:watson/ci-info", + "bugs": "https://github.com/watson/ci-info/issues", + "homepage": "https://github.com/watson/ci-info", + "contributors": [ + { + "name": "Sibiraj", + "url": "https://github.com/sibiraj-s" + } + ], + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "keywords": [ + "ci", + "continuous", + "integration", + "test", + "detect" + ], + "files": [ + "vendors.json", + "index.js", + "index.d.ts", + "CHANGELOG.md" + ], + "scripts": { + "build": "node sort-vendors.js && node create-typings.js", + "lint:fix": "standard --fix", + "test": "standard && node test.js", + "prepare": "husky install || true" + }, + "devDependencies": { + "clear-module": "^4.1.2", + "husky": "^9.1.7", + "publint": "^0.3.12", + "standard": "^17.1.2", + "tape": "^5.9.0" + }, + "engines": { + "node": ">=8" + } +} diff --git a/node/node_modules/npm/node_modules/ci-info/vendors.json b/node/node_modules/npm/node_modules/ci-info/vendors.json new file mode 100644 index 0000000000000000000000000000000000000000..13eb543aec75f76f2e136f15ee92d5ec16207daf --- /dev/null +++ b/node/node_modules/npm/node_modules/ci-info/vendors.json @@ -0,0 +1,363 @@ +[ + { + "name": "Agola CI", + "constant": "AGOLA", + "env": "AGOLA_GIT_REF", + "pr": "AGOLA_PULL_REQUEST_ID" + }, + { + "name": "Alpic", + "constant": "ALPIC", + "env": "ALPIC_HOST" + }, + { + "name": "Appcircle", + "constant": "APPCIRCLE", + "env": "AC_APPCIRCLE", + "pr": { + "env": "AC_GIT_PR", + "ne": "false" + } + }, + { + "name": "AppVeyor", + "constant": "APPVEYOR", + "env": "APPVEYOR", + "pr": "APPVEYOR_PULL_REQUEST_NUMBER" + }, + { + "name": "AWS CodeBuild", + "constant": "CODEBUILD", + "env": "CODEBUILD_BUILD_ARN", + "pr": { + "env": "CODEBUILD_WEBHOOK_EVENT", + "any": [ + "PULL_REQUEST_CREATED", + "PULL_REQUEST_UPDATED", + "PULL_REQUEST_REOPENED" + ] + } + }, + { + "name": "Azure Pipelines", + "constant": "AZURE_PIPELINES", + "env": "TF_BUILD", + "pr": { + "BUILD_REASON": "PullRequest" + } + }, + { + "name": "Bamboo", + "constant": "BAMBOO", + "env": "bamboo_planKey" + }, + { + "name": "Bitbucket Pipelines", + "constant": "BITBUCKET", + "env": "BITBUCKET_COMMIT", + "pr": "BITBUCKET_PR_ID" + }, + { + "name": "Bitrise", + "constant": "BITRISE", + "env": "BITRISE_IO", + "pr": "BITRISE_PULL_REQUEST" + }, + { + "name": "Buddy", + "constant": "BUDDY", + "env": "BUDDY_WORKSPACE_ID", + "pr": "BUDDY_EXECUTION_PULL_REQUEST_ID" + }, + { + "name": "Buildkite", + "constant": "BUILDKITE", + "env": "BUILDKITE", + "pr": { + "env": "BUILDKITE_PULL_REQUEST", + "ne": "false" + } + }, + { + "name": "CircleCI", + "constant": "CIRCLE", + "env": "CIRCLECI", + "pr": "CIRCLE_PULL_REQUEST" + }, + { + "name": "Cirrus CI", + "constant": "CIRRUS", + "env": "CIRRUS_CI", + "pr": "CIRRUS_PR" + }, + { + "name": "Cloudflare Pages", + "constant": "CLOUDFLARE_PAGES", + "env": "CF_PAGES" + }, + { + "name": "Cloudflare Workers", + "constant": "CLOUDFLARE_WORKERS", + "env": "WORKERS_CI" + }, + { + "name": "Codefresh", + "constant": "CODEFRESH", + "env": "CF_BUILD_ID", + "pr": { + "any": [ + "CF_PULL_REQUEST_NUMBER", + "CF_PULL_REQUEST_ID" + ] + } + }, + { + "name": "Codemagic", + "constant": "CODEMAGIC", + "env": "CM_BUILD_ID", + "pr": "CM_PULL_REQUEST" + }, + { + "name": "Codeship", + "constant": "CODESHIP", + "env": { + "CI_NAME": "codeship" + } + }, + { + "name": "Drone", + "constant": "DRONE", + "env": "DRONE", + "pr": { + "DRONE_BUILD_EVENT": "pull_request" + } + }, + { + "name": "dsari", + "constant": "DSARI", + "env": "DSARI" + }, + { + "name": "Earthly", + "constant": "EARTHLY", + "env": "EARTHLY_CI" + }, + { + "name": "Expo Application Services", + "constant": "EAS", + "env": "EAS_BUILD" + }, + { + "name": "Gerrit", + "constant": "GERRIT", + "env": "GERRIT_PROJECT" + }, + { + "name": "Gitea Actions", + "constant": "GITEA_ACTIONS", + "env": "GITEA_ACTIONS" + }, + { + "name": "GitHub Actions", + "constant": "GITHUB_ACTIONS", + "env": "GITHUB_ACTIONS", + "pr": { + "GITHUB_EVENT_NAME": "pull_request" + } + }, + { + "name": "GitLab CI", + "constant": "GITLAB", + "env": "GITLAB_CI", + "pr": "CI_MERGE_REQUEST_ID" + }, + { + "name": "GoCD", + "constant": "GOCD", + "env": "GO_PIPELINE_LABEL" + }, + { + "name": "Google Cloud Build", + "constant": "GOOGLE_CLOUD_BUILD", + "env": "BUILDER_OUTPUT" + }, + { + "name": "Harness CI", + "constant": "HARNESS", + "env": "HARNESS_BUILD_ID" + }, + { + "name": "Heroku", + "constant": "HEROKU", + "env": { + "env": "NODE", + "includes": "/app/.heroku/node/bin/node" + } + }, + { + "name": "Hudson", + "constant": "HUDSON", + "env": "HUDSON_URL" + }, + { + "name": "Jenkins", + "constant": "JENKINS", + "env": [ + "JENKINS_URL", + "BUILD_ID" + ], + "pr": { + "any": [ + "ghprbPullId", + "CHANGE_ID" + ] + } + }, + { + "name": "LayerCI", + "constant": "LAYERCI", + "env": "LAYERCI", + "pr": "LAYERCI_PULL_REQUEST" + }, + { + "name": "Magnum CI", + "constant": "MAGNUM", + "env": "MAGNUM" + }, + { + "name": "Netlify CI", + "constant": "NETLIFY", + "env": "NETLIFY", + "pr": { + "env": "PULL_REQUEST", + "ne": "false" + } + }, + { + "name": "Nevercode", + "constant": "NEVERCODE", + "env": "NEVERCODE", + "pr": { + "env": "NEVERCODE_PULL_REQUEST", + "ne": "false" + } + }, + { + "name": "Prow", + "constant": "PROW", + "env": "PROW_JOB_ID" + }, + { + "name": "ReleaseHub", + "constant": "RELEASEHUB", + "env": "RELEASE_BUILD_ID" + }, + { + "name": "Render", + "constant": "RENDER", + "env": "RENDER", + "pr": { + "IS_PULL_REQUEST": "true" + } + }, + { + "name": "Sail CI", + "constant": "SAIL", + "env": "SAILCI", + "pr": "SAIL_PULL_REQUEST_NUMBER" + }, + { + "name": "Screwdriver", + "constant": "SCREWDRIVER", + "env": "SCREWDRIVER", + "pr": { + "env": "SD_PULL_REQUEST", + "ne": "false" + } + }, + { + "name": "Semaphore", + "constant": "SEMAPHORE", + "env": "SEMAPHORE", + "pr": "PULL_REQUEST_NUMBER" + }, + { + "name": "Sourcehut", + "constant": "SOURCEHUT", + "env": { + "CI_NAME": "sourcehut" + } + }, + { + "name": "Strider CD", + "constant": "STRIDER", + "env": "STRIDER" + }, + { + "name": "TaskCluster", + "constant": "TASKCLUSTER", + "env": [ + "TASK_ID", + "RUN_ID" + ] + }, + { + "name": "TeamCity", + "constant": "TEAMCITY", + "env": "TEAMCITY_VERSION" + }, + { + "name": "Travis CI", + "constant": "TRAVIS", + "env": "TRAVIS", + "pr": { + "env": "TRAVIS_PULL_REQUEST", + "ne": "false" + } + }, + { + "name": "Vela", + "constant": "VELA", + "env": "VELA", + "pr": { + "VELA_PULL_REQUEST": "1" + } + }, + { + "name": "Vercel", + "constant": "VERCEL", + "env": { + "any": [ + "NOW_BUILDER", + "VERCEL" + ] + }, + "pr": "VERCEL_GIT_PULL_REQUEST_ID" + }, + { + "name": "Visual Studio App Center", + "constant": "APPCENTER", + "env": "APPCENTER_BUILD_ID" + }, + { + "name": "Woodpecker", + "constant": "WOODPECKER", + "env": { + "CI": "woodpecker" + }, + "pr": { + "CI_BUILD_EVENT": "pull_request" + } + }, + { + "name": "Xcode Cloud", + "constant": "XCODE_CLOUD", + "env": "CI_XCODE_PROJECT", + "pr": "CI_PULL_REQUEST_NUMBER" + }, + { + "name": "Xcode Server", + "constant": "XCODE_SERVER", + "env": "XCS" + } +] diff --git a/node/node_modules/npm/node_modules/cidr-regex/LICENSE b/node/node_modules/npm/node_modules/cidr-regex/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..05e941baf1a4ff1a892259169f9436e461be60b5 --- /dev/null +++ b/node/node_modules/npm/node_modules/cidr-regex/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) silverwind +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node/node_modules/npm/node_modules/cidr-regex/package.json b/node/node_modules/npm/node_modules/cidr-regex/package.json new file mode 100644 index 0000000000000000000000000000000000000000..16e8a860e02507309215136210db547835c81a95 --- /dev/null +++ b/node/node_modules/npm/node_modules/cidr-regex/package.json @@ -0,0 +1,38 @@ +{ + "name": "cidr-regex", + "version": "5.0.4", + "description": "Regular expression for matching IP addresses in CIDR notation", + "author": "silverwind ", + "contributors": [ + "Felipe Apostol (http://flipjs.io/)" + ], + "repository": "silverwind/cidr-regex", + "license": "BSD-2-Clause", + "type": "module", + "sideEffects": false, + "main": "./dist/index.js", + "exports": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], + "engines": { + "node": ">=20" + }, + "devDependencies": { + "@types/node": "25.6.0", + "@typescript/native-preview": "7.0.0-dev.20260420.1", + "eslint": "10.2.1", + "eslint-config-silverwind": "131.0.5", + "jest-extended": "7.0.0", + "tsdown": "0.21.9", + "tsdown-config-silverwind": "2.1.0", + "typescript": "6.0.3", + "typescript-config-silverwind": "18.0.0", + "updates": "17.15.5", + "updates-config-silverwind": "2.1.0", + "versions": "15.0.0", + "vitest": "4.1.4", + "vitest-config-silverwind": "11.3.0" + } +} \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/cmd-shim/LICENSE b/node/node_modules/npm/node_modules/cmd-shim/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..215e9f0de625433a71e86b99d9ad3d74d25e7e2e --- /dev/null +++ b/node/node_modules/npm/node_modules/cmd-shim/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm, Inc. and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/cmd-shim/package.json b/node/node_modules/npm/node_modules/cmd-shim/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2c9677d71ecc0855745ce868810a71a58632b65f --- /dev/null +++ b/node/node_modules/npm/node_modules/cmd-shim/package.json @@ -0,0 +1,48 @@ +{ + "name": "cmd-shim", + "version": "8.0.0", + "description": "Used in npm for command line application support", + "scripts": { + "test": "tap", + "snap": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cmd-shim.git" + }, + "license": "ISC", + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "tap": "^16.0.1" + }, + "files": [ + "bin/", + "lib/" + ], + "main": "lib/index.js", + "tap": { + "before": "test/00-setup.js", + "after": "test/zz-cleanup.js", + "check-coverage": true, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "author": "GitHub Inc.", + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": true + } +} diff --git a/node/node_modules/npm/node_modules/common-ancestor-path/LICENSE.md b/node/node_modules/npm/node_modules/common-ancestor-path/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..3da8747dc3a48e2da66615e4116cefcfde495d7c --- /dev/null +++ b/node/node_modules/npm/node_modules/common-ancestor-path/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** diff --git a/node/node_modules/npm/node_modules/common-ancestor-path/package.json b/node/node_modules/npm/node_modules/common-ancestor-path/package.json new file mode 100644 index 0000000000000000000000000000000000000000..cb399bd5d54a8a1ba9b8fb0e5bd153e7c4166505 --- /dev/null +++ b/node/node_modules/npm/node_modules/common-ancestor-path/package.json @@ -0,0 +1,60 @@ +{ + "name": "common-ancestor-path", + "version": "2.0.0", + "files": [ + "dist" + ], + "description": "Find the common ancestor of 2 or more paths on Windows or Unix", + "repository": { + "type": "git", + "url": "git@github.com:isaacs/common-ancestor-path" + }, + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "BlueOak-1.0.0", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write . --log-level warn --cache", + "typedoc": "typedoc" + }, + "devDependencies": { + "@types/node": "^24.10.1", + "prettier": "^3.6.2", + "require-inject": "^1.4.4", + "tap": "^21.1.6", + "tshy": "^3.1.0", + "typedoc": "^0.28.14" + }, + "type": "module", + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js", + "engines": { + "node": ">= 18" + } +} diff --git a/node/node_modules/npm/node_modules/cssesc/LICENSE-MIT.txt b/node/node_modules/npm/node_modules/cssesc/LICENSE-MIT.txt new file mode 100644 index 0000000000000000000000000000000000000000..b216658d4a21f121ad3ccfee383beae1dde5b976 --- /dev/null +++ b/node/node_modules/npm/node_modules/cssesc/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/cssesc/README.md b/node/node_modules/npm/node_modules/cssesc/README.md new file mode 100644 index 0000000000000000000000000000000000000000..72111693961e4a39ff7c910e5d2b0b2130a47175 --- /dev/null +++ b/node/node_modules/npm/node_modules/cssesc/README.md @@ -0,0 +1,201 @@ +# cssesc [![Build status](https://travis-ci.org/mathiasbynens/cssesc.svg?branch=master)](https://travis-ci.org/mathiasbynens/cssesc) [![Code coverage status](https://img.shields.io/codecov/c/github/mathiasbynens/cssesc.svg)](https://codecov.io/gh/mathiasbynens/cssesc) + +A JavaScript library for escaping CSS strings and identifiers while generating the shortest possible ASCII-only output. + +This is a JavaScript library for [escaping text for use in CSS strings or identifiers](https://mathiasbynens.be/notes/css-escapes) while generating the shortest possible valid ASCII-only output. [Here’s an online demo.](https://mothereff.in/css-escapes) + +[A polyfill for the CSSOM `CSS.escape()` method is available in a separate repository.](https://mths.be/cssescape) (In comparison, _cssesc_ is much more powerful.) + +Feel free to fork if you see possible improvements! + +## Installation + +Via [npm](https://www.npmjs.com/): + +```bash +npm install cssesc +``` + +In a browser: + +```html + +``` + +In [Node.js](https://nodejs.org/): + +```js +const cssesc = require('cssesc'); +``` + +In Ruby using [the `ruby-cssesc` wrapper gem](https://github.com/borodean/ruby-cssesc): + +```bash +gem install ruby-cssesc +``` + +```ruby +require 'ruby-cssesc' +CSSEsc.escape('I ♥ Ruby', is_identifier: true) +``` + +In Sass using [`sassy-escape`](https://github.com/borodean/sassy-escape): + +```bash +gem install sassy-escape +``` + +```scss +body { + content: escape('I ♥ Sass', $is-identifier: true); +} +``` + +## API + +### `cssesc(value, options)` + +This function takes a value and returns an escaped version of the value where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in CSS strings or identifiers](https://mathiasbynens.be/notes/css-escapes). + +```js +cssesc('Ich ♥ Bücher'); +// → 'Ich \\2665 B\\FC cher' + +cssesc('foo 𝌆 bar'); +// → 'foo \\1D306 bar' +``` + +By default, `cssesc` returns a string that can be used as part of a CSS string. If the target is a CSS identifier rather than a CSS string, use the `isIdentifier: true` setting (see below). + +The optional `options` argument accepts an object with the following options: + +#### `isIdentifier` + +The default value for the `isIdentifier` option is `false`. This means that the input text will be escaped for use in a CSS string literal. If you want to use the result as a CSS identifier instead (in a selector, for example), set this option to `true`. + +```js +cssesc('123a2b'); +// → '123a2b' + +cssesc('123a2b', { + 'isIdentifier': true +}); +// → '\\31 23a2b' +``` + +#### `quotes` + +The default value for the `quotes` option is `'single'`. This means that any occurences of `'` in the input text will be escaped as `\'`, so that the output can be used in a CSS string literal wrapped in single quotes. + +```js +cssesc('Lorem ipsum "dolor" sit \'amet\' etc.'); +// → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.' +// → "Lorem ipsum \"dolor\" sit \\'amet\\' etc." + +cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'single' +}); +// → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.' +// → "Lorem ipsum \"dolor\" sit \\'amet\\' etc." +``` + +If you want to use the output as part of a CSS string literal wrapped in double quotes, set the `quotes` option to `'double'`. + +```js +cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'double' +}); +// → 'Lorem ipsum \\"dolor\\" sit \'amet\' etc.' +// → "Lorem ipsum \\\"dolor\\\" sit 'amet' etc." +``` + +#### `wrap` + +The `wrap` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output will be a valid CSS string literal wrapped in quotes. The type of quotes can be specified through the `quotes` setting. + +```js +cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'single', + 'wrap': true +}); +// → '\'Lorem ipsum "dolor" sit \\\'amet\\\' etc.\'' +// → "\'Lorem ipsum \"dolor\" sit \\\'amet\\\' etc.\'" + +cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'double', + 'wrap': true +}); +// → '"Lorem ipsum \\"dolor\\" sit \'amet\' etc."' +// → "\"Lorem ipsum \\\"dolor\\\" sit \'amet\' etc.\"" +``` + +#### `escapeEverything` + +The `escapeEverything` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, all the symbols in the output will be escaped, even printable ASCII symbols. + +```js +cssesc('lolwat"foo\'bar', { + 'escapeEverything': true +}); +// → '\\6C\\6F\\6C\\77\\61\\74\\"\\66\\6F\\6F\\\'\\62\\61\\72' +// → "\\6C\\6F\\6C\\77\\61\\74\\\"\\66\\6F\\6F\\'\\62\\61\\72" +``` + +#### Overriding the default options globally + +The global default settings can be overridden by modifying the `css.options` object. This saves you from passing in an `options` object for every call to `encode` if you want to use the non-default setting. + +```js +// Read the global default setting for `escapeEverything`: +cssesc.options.escapeEverything; +// → `false` by default + +// Override the global default setting for `escapeEverything`: +cssesc.options.escapeEverything = true; + +// Using the global default setting for `escapeEverything`, which is now `true`: +cssesc('foo © bar ≠ baz 𝌆 qux'); +// → '\\66\\6F\\6F\\ \\A9\\ \\62\\61\\72\\ \\2260\\ \\62\\61\\7A\\ \\1D306\\ \\71\\75\\78' +``` + +### `cssesc.version` + +A string representing the semantic version number. + +### Using the `cssesc` binary + +To use the `cssesc` binary in your shell, simply install cssesc globally using npm: + +```bash +npm install -g cssesc +``` + +After that you will be able to escape text for use in CSS strings or identifiers from the command line: + +```bash +$ cssesc 'föo ♥ bår 𝌆 baz' +f\F6o \2665 b\E5r \1D306 baz +``` + +If the output needs to be a CSS identifier rather than part of a string literal, use the `-i`/`--identifier` option: + +```bash +$ cssesc --identifier 'föo ♥ bår 𝌆 baz' +f\F6o\ \2665\ b\E5r\ \1D306\ baz +``` + +See `cssesc --help` for the full list of options. + +## Support + +This library supports the Node.js and browser versions mentioned in [`.babelrc`](https://github.com/mathiasbynens/cssesc/blob/master/.babelrc). For a version that supports a wider variety of legacy browsers and environments out-of-the-box, [see v0.1.0](https://github.com/mathiasbynens/cssesc/releases/tag/v0.1.0). + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## License + +This library is available under the [MIT](https://mths.be/mit) license. diff --git a/node/node_modules/npm/node_modules/cssesc/cssesc.js b/node/node_modules/npm/node_modules/cssesc/cssesc.js new file mode 100644 index 0000000000000000000000000000000000000000..db7ead8b15ef9075bd2065e669e6d1441b7a57a4 --- /dev/null +++ b/node/node_modules/npm/node_modules/cssesc/cssesc.js @@ -0,0 +1,110 @@ +/*! https://mths.be/cssesc v3.0.0 by @mathias */ +'use strict'; + +var object = {}; +var hasOwnProperty = object.hasOwnProperty; +var merge = function merge(options, defaults) { + if (!options) { + return defaults; + } + var result = {}; + for (var key in defaults) { + // `if (defaults.hasOwnProperty(key) { … }` is not needed here, since + // only recognized option names are used. + result[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key]; + } + return result; +}; + +var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/; +var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/; +var regexAlwaysEscape = /['"\\]/; +var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g; + +// https://mathiasbynens.be/notes/css-escapes#css +var cssesc = function cssesc(string, options) { + options = merge(options, cssesc.options); + if (options.quotes != 'single' && options.quotes != 'double') { + options.quotes = 'single'; + } + var quote = options.quotes == 'double' ? '"' : '\''; + var isIdentifier = options.isIdentifier; + + var firstChar = string.charAt(0); + var output = ''; + var counter = 0; + var length = string.length; + while (counter < length) { + var character = string.charAt(counter++); + var codePoint = character.charCodeAt(); + var value = void 0; + // If it’s not a printable ASCII character… + if (codePoint < 0x20 || codePoint > 0x7E) { + if (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) { + // It’s a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { + // next character is low surrogate + codePoint = ((codePoint & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000; + } else { + // It’s an unmatched surrogate; only append this code unit, in case + // the next code unit is the high surrogate of a surrogate pair. + counter--; + } + } + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } else { + if (options.escapeEverything) { + if (regexAnySingleEscape.test(character)) { + value = '\\' + character; + } else { + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } + } else if (/[\t\n\f\r\x0B]/.test(character)) { + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } else if (character == '\\' || !isIdentifier && (character == '"' && quote == character || character == '\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) { + value = '\\' + character; + } else { + value = character; + } + } + output += value; + } + + if (isIdentifier) { + if (/^-[-\d]/.test(output)) { + output = '\\-' + output.slice(1); + } else if (/\d/.test(firstChar)) { + output = '\\3' + firstChar + ' ' + output.slice(1); + } + } + + // Remove spaces after `\HEX` escapes that are not followed by a hex digit, + // since they’re redundant. Note that this is only possible if the escape + // sequence isn’t preceded by an odd number of backslashes. + output = output.replace(regexExcessiveSpaces, function ($0, $1, $2) { + if ($1 && $1.length % 2) { + // It’s not safe to remove the space, so don’t. + return $0; + } + // Strip the space. + return ($1 || '') + $2; + }); + + if (!isIdentifier && options.wrap) { + return quote + output + quote; + } + return output; +}; + +// Expose default options (so they can be overridden globally). +cssesc.options = { + 'escapeEverything': false, + 'isIdentifier': false, + 'quotes': 'single', + 'wrap': false +}; + +cssesc.version = '3.0.0'; + +module.exports = cssesc; diff --git a/node/node_modules/npm/node_modules/cssesc/package.json b/node/node_modules/npm/node_modules/cssesc/package.json new file mode 100644 index 0000000000000000000000000000000000000000..489368fbdfd7217b6f1271f5ef5927e8941a772d --- /dev/null +++ b/node/node_modules/npm/node_modules/cssesc/package.json @@ -0,0 +1,51 @@ +{ + "name": "cssesc", + "version": "3.0.0", + "description": "A JavaScript library for escaping CSS strings and identifiers while generating the shortest possible ASCII-only output.", + "homepage": "https://mths.be/cssesc", + "engines": { + "node": ">=4" + }, + "main": "cssesc.js", + "bin": "bin/cssesc", + "man": "man/cssesc.1", + "keywords": [ + "css", + "escape", + "identifier", + "string", + "tool" + ], + "license": "MIT", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "repository": { + "type": "git", + "url": "https://github.com/mathiasbynens/cssesc.git" + }, + "bugs": "https://github.com/mathiasbynens/cssesc/issues", + "files": [ + "LICENSE-MIT.txt", + "cssesc.js", + "bin/", + "man/" + ], + "scripts": { + "build": "grunt template && babel cssesc.js -o cssesc.js", + "test": "mocha tests", + "cover": "istanbul cover --report html node_modules/.bin/_mocha tests -- -u exports -R spec" + }, + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-preset-env": "^1.6.1", + "codecov": "^1.0.1", + "grunt": "^1.0.1", + "grunt-template": "^1.0.0", + "istanbul": "^0.4.4", + "mocha": "^2.5.3", + "regenerate": "^1.2.1", + "requirejs": "^2.1.16" + } +} diff --git a/node/node_modules/npm/node_modules/debug/LICENSE b/node/node_modules/npm/node_modules/debug/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a7a3b3bff5491169191909d22341583a75728461 --- /dev/null +++ b/node/node_modules/npm/node_modules/debug/LICENSE @@ -0,0 +1,20 @@ +(The MIT License) + +Copyright (c) 2014-2017 TJ Holowaychuk +Copyright (c) 2018-2021 Josh Junon + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node/node_modules/npm/node_modules/debug/package.json b/node/node_modules/npm/node_modules/debug/package.json new file mode 100644 index 0000000000000000000000000000000000000000..bb79c77ababd65bb4943eef789c94d32395a43e8 --- /dev/null +++ b/node/node_modules/npm/node_modules/debug/package.json @@ -0,0 +1,64 @@ +{ + "name": "debug", + "version": "4.4.3", + "repository": { + "type": "git", + "url": "git://github.com/debug-js/debug.git" + }, + "description": "Lightweight debugging utility for Node.js and the browser", + "keywords": [ + "debug", + "log", + "debugger" + ], + "files": [ + "src", + "LICENSE", + "README.md" + ], + "author": "Josh Junon (https://github.com/qix-)", + "contributors": [ + "TJ Holowaychuk ", + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne " + ], + "license": "MIT", + "scripts": { + "lint": "xo", + "test": "npm run test:node && npm run test:browser && npm run lint", + "test:node": "mocha test.js test.node.js", + "test:browser": "karma start --single-run", + "test:coverage": "cat ./coverage/lcov.info | coveralls" + }, + "dependencies": { + "ms": "^2.1.3" + }, + "devDependencies": { + "brfs": "^2.0.1", + "browserify": "^16.2.3", + "coveralls": "^3.0.2", + "karma": "^3.1.4", + "karma-browserify": "^6.0.0", + "karma-chrome-launcher": "^2.2.0", + "karma-mocha": "^1.3.0", + "mocha": "^5.2.0", + "mocha-lcov-reporter": "^1.2.0", + "sinon": "^14.0.0", + "xo": "^0.23.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + }, + "main": "./src/index.js", + "browser": "./src/browser.js", + "engines": { + "node": ">=6.0" + }, + "xo": { + "rules": { + "import/extensions": "off" + } + } +} diff --git a/node/node_modules/npm/node_modules/diff/CONTRIBUTING.md b/node/node_modules/npm/node_modules/diff/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..cfc8eea14668fe62f4fea3b78bce666e713c8e89 --- /dev/null +++ b/node/node_modules/npm/node_modules/diff/CONTRIBUTING.md @@ -0,0 +1,28 @@ +## Building and testing + +``` +yarn +yarn test +``` + +To run tests in a *browser* (for instance to test compatibility with Firefox, with Safari, or with old browser versions), run `yarn karma start`, then open http://localhost:9876/ in the browser you want to test in. Results of the test run will appear in the terminal where `yarn karma start` is running. + +If you notice any problems, please report them to the GitHub issue tracker at +[http://github.com/kpdecker/jsdiff/issues](http://github.com/kpdecker/jsdiff/issues). + +## Releasing + +Run a test in Firefox via the procedure above before releasing. + +A full release may be completed by first updating the `"version"` property in package.json, then running the following: + +``` +yarn clean +yarn build +yarn npm publish +``` + +After releasing, remember to: +* commit the `package.json` change and push it to GitHub +* create a new version tag on GitHub +* update `diff.js` on the `gh-pages` branch to the latest built version from the `dist/` folder. diff --git a/node/node_modules/npm/node_modules/diff/LICENSE b/node/node_modules/npm/node_modules/diff/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..517a5fa0fe92f9055a53756a2ecd21c902d85c4a --- /dev/null +++ b/node/node_modules/npm/node_modules/diff/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2009-2015, Kevin Decker +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node/node_modules/npm/node_modules/diff/eslint.config.mjs b/node/node_modules/npm/node_modules/diff/eslint.config.mjs new file mode 100644 index 0000000000000000000000000000000000000000..ce0886d8dae55d933472ab5042adeac4ce99187a --- /dev/null +++ b/node/node_modules/npm/node_modules/diff/eslint.config.mjs @@ -0,0 +1,182 @@ +// @ts-check + +import eslint from '@eslint/js'; +import tseslint from 'typescript-eslint'; +import globals from "globals"; + +export default tseslint.config( + { + ignores: [ + "**/*", // ignore everything... + "!src/**/", "!src/**/*.ts", // ... except our TypeScript source files... + "!test/**/", "!test/**/*.js", // ... and our tests + ], + }, + eslint.configs.recommended, + tseslint.configs.recommended, + { + files: ['src/**/*.ts'], + languageOptions: { + parserOptions: { + projectService: true, + tsconfigRootDir: import.meta.dirname, + }, + }, + extends: [tseslint.configs.recommendedTypeChecked], + rules: { + // Not sure if these actually serve a purpose, but they provide a way to enforce SOME of what + // would be imposed by having "verbatimModuleSyntax": true in our tsconfig.json without + // actually doing that. + "@typescript-eslint/consistent-type-imports": 2, + "@typescript-eslint/consistent-type-exports": 2, + + // Things from the recommendedTypeChecked shared config that are disabled simply because they + // caused lots of errors in our existing code when tried. Plausibly useful to turn on if + // possible and somebody fancies doing the work: + "@typescript-eslint/no-unsafe-argument": 0, + "@typescript-eslint/no-unsafe-assignment": 0, + "@typescript-eslint/no-unsafe-call": 0, + "@typescript-eslint/no-unsafe-member-access": 0, + "@typescript-eslint/no-unsafe-return": 0, + } + }, + { + languageOptions: { + globals: { + ...globals.browser, + }, + }, + + rules: { + // Possible Errors // + //-----------------// + "comma-dangle": [2, "never"], + "no-console": 1, // Allow for debugging + "no-debugger": 1, // Allow for debugging + "no-extra-parens": [2, "functions"], + "no-extra-semi": 2, + "no-negated-in-lhs": 2, + "no-unreachable": 1, // Optimizer and coverage will handle/highlight this and can be useful for debugging + + // Best Practices // + //----------------// + curly: 2, + "default-case": 1, + "dot-notation": [2, { + allowKeywords: false, + }], + "guard-for-in": 1, + "no-alert": 2, + "no-caller": 2, + "no-div-regex": 1, + "no-eval": 2, + "no-extend-native": 2, + "no-extra-bind": 2, + "no-floating-decimal": 2, + "no-implied-eval": 2, + "no-iterator": 2, + "no-labels": 2, + "no-lone-blocks": 2, + "no-multi-spaces": 2, + "no-multi-str": 1, + "no-native-reassign": 2, + "no-new": 2, + "no-new-func": 2, + "no-new-wrappers": 2, + "no-octal-escape": 2, + "no-process-env": 2, + "no-proto": 2, + "no-return-assign": 2, + "no-script-url": 2, + "no-self-compare": 2, + "no-sequences": 2, + "no-throw-literal": 2, + "no-unused-expressions": 2, + "no-warning-comments": 1, + radix: 2, + "wrap-iife": 2, + + // Variables // + //-----------// + "no-catch-shadow": 2, + "no-label-var": 2, + "no-undef-init": 2, + + // Node.js // + //---------// + + // Stylistic // + //-----------// + "brace-style": [2, "1tbs", { + allowSingleLine: true, + }], + camelcase: 2, + "comma-spacing": [2, { + before: false, + after: true, + }], + "comma-style": [2, "last"], + "consistent-this": [1, "self"], + "eol-last": 2, + "func-style": [2, "declaration"], + "key-spacing": [2, { + beforeColon: false, + afterColon: true, + }], + "new-cap": 2, + "new-parens": 2, + "no-array-constructor": 2, + "no-lonely-if": 2, + "no-mixed-spaces-and-tabs": 2, + "no-nested-ternary": 1, + "no-new-object": 2, + "no-spaced-func": 2, + "no-trailing-spaces": 2, + "quote-props": [2, "as-needed", { + keywords: true, + }], + quotes: [2, "single", "avoid-escape"], + semi: 2, + "semi-spacing": [2, { + before: false, + after: true, + }], + "space-before-blocks": [2, "always"], + "space-before-function-paren": [2, { + anonymous: "never", + named: "never", + }], + "space-in-parens": [2, "never"], + "space-infix-ops": 2, + "space-unary-ops": 2, + "spaced-comment": [2, "always"], + "wrap-regex": 1, + "no-var": 2, + + // Typescript // + //------------// + "@typescript-eslint/no-explicit-any": 0, // Very strict rule, incompatible with our code + + // We use these intentionally - e.g. + // export interface DiffCssOptions extends CommonDiffOptions {} + // for the options argument to diffCss which currently takes no options beyond the ones + // common to all diffFoo functions. Doing this allows consistency (one options interface per + // diffFoo function) and future-proofs against the API having to change in future if we add a + // non-common option to one of these functions. + "@typescript-eslint/no-empty-object-type": [2, {allowInterfaces: 'with-single-extends'}], + }, + }, + { + files: ['test/**/*.js'], + languageOptions: { + globals: { + ...globals.node, + ...globals.mocha, + }, + }, + rules: { + "no-unused-expressions": 0, // Needs disabling to support Chai `.to.be.undefined` etc syntax + "@typescript-eslint/no-unused-expressions": 0, // (as above) + }, + } +); diff --git a/node/node_modules/npm/node_modules/diff/package.json b/node/node_modules/npm/node_modules/diff/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1d80358cfde6e1e08490d820875f33df5d6f049c --- /dev/null +++ b/node/node_modules/npm/node_modules/diff/package.json @@ -0,0 +1,130 @@ +{ + "name": "diff", + "version": "8.0.4", + "description": "A JavaScript text diff implementation.", + "keywords": [ + "diff", + "jsdiff", + "compare", + "patch", + "text", + "json", + "css", + "javascript" + ], + "maintainers": [ + "Kevin Decker (http://incaseofstairs.com)", + "Mark Amery " + ], + "bugs": { + "email": "kpdecker@gmail.com", + "url": "http://github.com/kpdecker/jsdiff/issues" + }, + "license": "BSD-3-Clause", + "repository": { + "type": "git", + "url": "https://github.com/kpdecker/jsdiff.git" + }, + "engines": { + "node": ">=0.3.1" + }, + "main": "./libcjs/index.js", + "module": "./libesm/index.js", + "browser": "./dist/diff.js", + "unpkg": "./dist/diff.js", + "exports": { + ".": { + "import": { + "types": "./libesm/index.d.ts", + "default": "./libesm/index.js" + }, + "require": { + "types": "./libcjs/index.d.ts", + "default": "./libcjs/index.js" + } + }, + "./package.json": "./package.json", + "./lib/*.js": { + "import": { + "types": "./libesm/*.d.ts", + "default": "./libesm/*.js" + }, + "require": { + "types": "./libcjs/*.d.ts", + "default": "./libcjs/*.js" + } + }, + "./lib/": { + "import": { + "types": "./libesm/", + "default": "./libesm/" + }, + "require": { + "types": "./libcjs/", + "default": "./libcjs/" + } + } + }, + "type": "module", + "types": "libcjs/index.d.ts", + "scripts": { + "clean": "rm -rf libcjs/ libesm/ dist/ coverage/ .nyc_output/", + "lint": "yarn eslint", + "build": "yarn lint && yarn generate-esm && yarn generate-cjs && yarn check-types && yarn run-rollup && yarn run-uglify", + "generate-cjs": "yarn tsc --module commonjs --outDir libcjs && node --eval \"fs.writeFileSync('libcjs/package.json', JSON.stringify({type:'commonjs',sideEffects:false}))\"", + "generate-esm": "yarn tsc --module nodenext --outDir libesm --target es6 && node --eval \"fs.writeFileSync('libesm/package.json', JSON.stringify({type:'module',sideEffects:false}))\"", + "check-types": "yarn run-tsd && yarn run-attw", + "test": "nyc yarn _test", + "_test": "yarn build && cross-env NODE_ENV=test yarn run-mocha", + "run-attw": "yarn attw --pack --entrypoints . && yarn attw --pack --entrypoints lib/diff/word.js --profile node16", + "run-tsd": "yarn tsd --typings libesm/ && yarn tsd --files test-d/", + "run-rollup": "rollup -c rollup.config.mjs", + "run-uglify": "uglifyjs dist/diff.js -c -o dist/diff.min.js", + "run-mocha": "mocha --require ./runtime 'test/**/*.js'" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.18.2", + "@babel/core": "^7.29.0", + "@babel/preset-env": "^7.29.2", + "@babel/register": "^7.28.6", + "@colors/colors": "^1.6.0", + "@eslint/js": "^10.0.1", + "babel-loader": "^10.1.1", + "babel-plugin-istanbul": "^7.0.1", + "chai": "^6.2.2", + "cross-env": "^10.1.0", + "eslint": "^10.1.0", + "globals": "^17.4.0", + "karma": "^6.4.4", + "karma-mocha": "^2.0.1", + "karma-mocha-reporter": "^2.2.5", + "karma-sourcemap-loader": "^0.4.0", + "karma-webpack": "^5.0.1", + "mocha": "^11.7.5", + "nyc": "^18.0.0", + "rollup": "^4.60.0", + "tsd": "^0.33.0", + "typescript": "^5.9.3", + "typescript-eslint": "^8.57.1", + "uglify-js": "^3.19.3", + "webpack": "^5.105.4", + "webpack-dev-server": "^5.2.3" + }, + "nyc": { + "require": [ + "@babel/register" + ], + "reporter": [ + "lcov", + "text" + ], + "sourceMap": false, + "instrument": false, + "check-coverage": true, + "branches": 100, + "lines": 100, + "functions": 100, + "statements": 100 + }, + "packageManager": "yarn@4.12.0" +} \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/diff/release-notes.md b/node/node_modules/npm/node_modules/diff/release-notes.md new file mode 100644 index 0000000000000000000000000000000000000000..f142ebec3a553e53cd91fe15820e888442ed94d1 --- /dev/null +++ b/node/node_modules/npm/node_modules/diff/release-notes.md @@ -0,0 +1,432 @@ +# Release Notes + +## 8.0.4 + +- [#667](https://github.com/kpdecker/jsdiff/pull/667) - **fix another bug in `diffWords` when used with an `Intl.Segmenter`**. If the text to be diffed included a combining mark after a whitespace character (i.e. roughly speaking, an accented space), `diffWords` would previously crash. Now this case is handled correctly. + +## 8.0.3 + +- [#631](https://github.com/kpdecker/jsdiff/pull/631) - **fix support for using an `Intl.Segmenter` with `diffWords`**. This has been almost completely broken since the feature was added in v6.0.0, since it would outright crash on any text that featured two consecutive newlines between a pair of words (a very common case). +- [#635](https://github.com/kpdecker/jsdiff/pull/635) - **small tweaks to tokenization behaviour of `diffWords`** when used *without* an `Intl.Segmenter`. Specifically, the soft hyphen (U+00AD) is no longer considered to be a word break, and the multiplication and division signs (`×` and `÷`) are now treated as punctuation instead of as letters / word characters. +- [#641](https://github.com/kpdecker/jsdiff/pull/641) - **the format of file headers in `createPatch` etc. patches can now be customised somewhat**. It now takes a `headerOptions` option that can be used to disable the file headers entirely, or omit the `Index:` line and/or the underline. In particular, this was motivated by a request to make jsdiff patches compatible with react-diff-view, which they now are if produced with `headerOptions: FILE_HEADERS_ONLY`. +- [#647](https://github.com/kpdecker/jsdiff/pull/647) and [#649](https://github.com/kpdecker/jsdiff/pull/649) - **fix denial-of-service vulnerabilities in `parsePatch` whereby adversarial input could cause a memory-leaking infinite loop, typically crashing the calling process**. Also fixed ReDOS vulnerabilities whereby adversarially-crafted patch headers could take cubic time to parse. Now, `parsePatch` should reliably take linear time. (Handling of headers that include the line break characters `\r`, `\u2028`, or `\u2029` in non-trailing positions is also now more reasonable as side effect of the fix.) + +## 8.0.2 + +- [#616](https://github.com/kpdecker/jsdiff/pull/616) **Restored compatibility of `diffSentences` with old Safari versions.** This was broken in 8.0.0 by the introduction of a regex with a [lookbehind assertion](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Lookbehind_assertion); these weren't supported in Safari prior to version 16.4. +- [#612](https://github.com/kpdecker/jsdiff/pull/612) **Improved tree shakeability** by marking the built CJS and ESM packages with `sideEffects: false`. + +## 8.0.1 + +- [#610](https://github.com/kpdecker/jsdiff/pull/610) **Fixes types for `diffJson` which were broken by 8.0.0**. The new bundled types in 8.0.0 only allowed `diffJson` to be passed string arguments, but it should've been possible to pass either strings or objects (and now is). Thanks to Josh Kelley for the fix. + +## 8.0.0 + +- [#580](https://github.com/kpdecker/jsdiff/pull/580) **Multiple tweaks to `diffSentences`**: + * tokenization no longer takes quadratic time on pathological inputs (reported as a ReDOS vulnerability by Snyk); is now linear instead + * the final sentence in the string is now handled the same by the tokenizer regardless of whether it has a trailing punctuation mark or not. (Previously, "foo. bar." tokenized to `["foo.", " ", "bar."]` but "foo. bar" tokenized to `["foo.", " bar"]` - i.e. whether the space between sentences was treated as a separate token depended upon whether the final sentence had trailing punctuation or not. This was arbitrary and surprising; it is no longer the case.) + * in a string that starts with a sentence end, like "! hello.", the "!" is now treated as a separate sentence + * the README now correctly documents the tokenization behaviour (it was wrong before) +- [#581](https://github.com/kpdecker/jsdiff/pull/581) - **fixed some regex operations used for tokenization in `diffWords` taking O(n^2) time** in pathological cases +- [#595](https://github.com/kpdecker/jsdiff/pull/595) - **fixed a crash in patch creation functions when handling a single hunk consisting of a very large number (e.g. >130k) of lines**. (This was caused by spreading indefinitely-large arrays to `.push()` using `.apply` or the spread operator and hitting the JS-implementation-specific limit on the maximum number of arguments to a function, as shown at https://stackoverflow.com/a/56809779/1709587; thus the exact threshold to hit the error will depend on the environment in which you were running JsDiff.) +- [#596](https://github.com/kpdecker/jsdiff/pull/596) - **removed the `merge` function**. Previously JsDiff included an undocumented function called `merge` that was meant to, in some sense, merge patches. It had at least a couple of serious bugs that could lead to it returning unambiguously wrong results, and it was difficult to simply "fix" because it was [unclear precisely what it was meant to do](https://github.com/kpdecker/jsdiff/issues/181#issuecomment-2198319542). For now, the fix is to remove it entirely. +- [#591](https://github.com/kpdecker/jsdiff/pull/591) - JsDiff's source code has been rewritten in TypeScript. This change entails the following changes for end users: + * **the `diff` package on npm now includes its own TypeScript type definitions**. Users who previously used the `@types/diff` npm package from DefinitelyTyped should remove that dependency when upgrading JsDiff to v8. + + Note that the transition from the DefinitelyTyped types to JsDiff's own type definitions includes multiple fixes and also removes many exported types previously used for `options` arguments to diffing and patch-generation functions. (There are now different exported options types for abortable calls - ones with a `timeout` or `maxEditLength` that may give a result of `undefined` - and non-abortable calls.) See the TypeScript section of the README for some usage tips. + + * **The `Diff` object is now a class**. Custom extensions of `Diff`, as described in the "Defining custom diffing behaviors" section of the README, can therefore now be done by writing a `class CustomDiff extends Diff` and overriding methods, instead of the old way based on prototype inheritance. (I *think* code that did things the old way should still work, though!) + + * **`diff/lib/index.es6.js` and `diff/lib/index.mjs` no longer exist, and the ESM version of the library is no longer bundled into a single file.** + + * **The `ignoreWhitespace` option for `diffWords` is no longer included in the type declarations**. The effect of passing `ignoreWhitespace: true` has always been to make `diffWords` just call `diffWordsWithSpace` instead, which was confusing, because that behaviour doesn't seem properly described as "ignoring" whitespace at all. The property remains available to non-TypeScript applications for the sake of backwards compatibility, but TypeScript applications will now see a type error if they try to pass `ignoreWhitespace: true` to `diffWords` and should change their code to call `diffWordsWithSpace` instead. + + * JsDiff no longer purports to support ES3 environments. (I'm pretty sure it never truly did, despite claiming to in its README, since even the 1.0.0 release used `Array.map` which was added in ES5.) +- [#601](https://github.com/kpdecker/jsdiff/pull/601) - **`diffJson`'s `stringifyReplacer` option behaves more like `JSON.stringify`'s `replacer` argument now.** In particular: + * Each key/value pair now gets passed through the replacer once instead of twice + * The `key` passed to the replacer when the top-level object is passed in as `value` is now `""` (previously, was `undefined`), and the `key` passed with an array element is the array index as a string, like `"0"` or `"1"` (previously was whatever the key for the entire array was). Both the new behaviours match that of `JSON.stringify`. +- [#602](https://github.com/kpdecker/jsdiff/pull/602) - **diffing functions now consistently return `undefined` when called in async mode** (i.e. with a callback). Previously, there was an odd quirk where they would return `true` if the strings being diffed were equal and `undefined` otherwise. + +## 7.0.0 + +Just a single (breaking) bugfix, undoing a behaviour change introduced accidentally in 6.0.0: + +- [#554](https://github.com/kpdecker/jsdiff/pull/554) **`diffWords` treats numbers and underscores as word characters again.** This behaviour was broken in v6.0.0. + +## 6.0.0 + +This is a release containing many, *many* breaking changes. The objective of this release was to carry out a mass fix, in one go, of all the open bugs and design problems that required breaking changes to fix. A substantial, but exhaustive, changelog is below. + +[Commits](https://github.com/kpdecker/jsdiff/compare/v5.2.0...v6.0.0) + +- [#497](https://github.com/kpdecker/jsdiff/pull/497) **`diffWords` behavior has been radically changed.** Previously, even with `ignoreWhitespace: true`, runs of whitespace were tokens, which led to unhelpful and unintuitive diffing behavior in typical texts. Specifically, even when two texts contained overlapping passages, `diffWords` would sometimes choose to delete all the words from the old text and insert them anew in their new positions in order to avoid having to delete or insert whitespace tokens. Whitespace sequences are no longer tokens as of this release, which affects both the generated diffs and the `count`s. + + Runs of whitespace are still tokens in `diffWordsWithSpace`. + + As part of the changes to `diffWords`, **a new `.postProcess` method has been added on the base `Diff` type**, which can be overridden in custom `Diff` implementations. + + **`diffLines` with `ignoreWhitespace: true` will no longer ignore the insertion or deletion of entire extra lines of whitespace at the end of the text**. Previously, these would not show up as insertions or deletions, as a side effect of a hack in the base diffing algorithm meant to help ignore whitespace in `diffWords`. More generally, **the undocumented special handling in the core algorithm for ignored terminals has been removed entirely.** (This special case behavior used to rewrite the final two change objects in a scenario where the final change object was an addition or deletion and its `value` was treated as equal to the empty string when compared using the diff object's `.equals` method.) + +- [#500](https://github.com/kpdecker/jsdiff/pull/500) **`diffChars` now diffs Unicode code points** instead of UTF-16 code units. +- [#508](https://github.com/kpdecker/jsdiff/pull/508) **`parsePatch` now always runs in what was previously "strict" mode; the undocumented `strict` option has been removed.** Previously, by default, `parsePatch` (and other patch functions that use it under the hood to parse patches) would accept a patch where the line counts in the headers were inconsistent with the actual patch content - e.g. where a hunk started with the header `@@ -1,3 +1,6 @@`, indicating that the content below spanned 3 lines in the old file and 6 lines in the new file, but then the actual content below the header consisted of some different number of lines, say 10 lines of context, 5 deletions, and 1 insertion. Actually trying to work with these patches using `applyPatch` or `merge`, however, would produce incorrect results instead of just ignoring the incorrect headers, making this "feature" more of a trap than something actually useful. It's been ripped out, and now we are always "strict" and will reject patches where the line counts in the headers aren't consistent with the actual patch content. +- [#435](https://github.com/kpdecker/jsdiff/pull/435) **Fix `parsePatch` handling of control characters.** `parsePatch` used to interpret various unusual control characters - namely vertical tabs, form feeds, lone carriage returns without a line feed, and EBCDIC NELs - as line breaks when parsing a patch file. This was inconsistent with the behavior of both JsDiff's own `diffLines` method and also the Unix `diff` and `patch` utils, which all simply treat those control characters as ordinary characters. The result of this discrepancy was that some well-formed patches - produced either by `diff` or by JsDiff itself and handled properly by the `patch` util - would be wrongly parsed by `parsePatch`, with the effect that it would disregard the remainder of a hunk after encountering one of these control characters. +- [#439](https://github.com/kpdecker/jsdiff/pull/439) **Prefer diffs that order deletions before insertions.** When faced with a choice between two diffs with an equal total edit distance, the Myers diff algorithm generally prefers one that does deletions before insertions rather than insertions before deletions. For instance, when diffing `abcd` against `acbd`, it will prefer a diff that says to delete the `b` and then insert a new `b` after the `c`, over a diff that says to insert a `c` before the `b` and then delete the existing `c`. JsDiff deviated from the published Myers algorithm in a way that led to it having the opposite preference in many cases, including that example. This is now fixed, meaning diffs output by JsDiff will more accurately reflect what the published Myers diff algorithm would output. +- [#455](https://github.com/kpdecker/jsdiff/pull/455) **The `added` and `removed` properties of change objects are now guaranteed to be set to a boolean value.** (Previously, they would be set to `undefined` or omitted entirely instead of setting them to false.) +- [#464](https://github.com/kpdecker/jsdiff/pull/464) Specifying `{maxEditLength: 0}` now sets a max edit length of 0 instead of no maximum. +- [#460](https://github.com/kpdecker/jsdiff/pull/460) **Added `oneChangePerToken` option.** +- [#467](https://github.com/kpdecker/jsdiff/pull/467) **Consistent ordering of arguments to `comparator(left, right)`.** Values from the old array will now consistently be passed as the first argument (`left`) and values from the new array as the second argument (`right`). Previously this was almost (but not quite) always the other way round. +- [#480](https://github.com/kpdecker/jsdiff/pull/480) **Passing `maxEditLength` to `createPatch` & `createTwoFilesPatch` now works properly** (i.e. returns undefined if the max edit distance is exceeded; previous behavior was to crash with a `TypeError` if the edit distance was exceeded). +- [#486](https://github.com/kpdecker/jsdiff/pull/486) **The `ignoreWhitespace` option of `diffLines` behaves more sensibly now.** `value`s in returned change objects now include leading/trailing whitespace even when `ignoreWhitespace` is used, just like how with `ignoreCase` the `value`s still reflect the case of one of the original texts instead of being all-lowercase. `ignoreWhitespace` is also now compatible with `newlineIsToken`. Finally, **`diffTrimmedLines` is deprecated** (and removed from the docs) in favour of using `diffLines` with `ignoreWhitespace: true`; the two are, and always have been, equivalent. +- [#490](https://github.com/kpdecker/jsdiff/pull/490) **When calling diffing functions in async mode by passing a `callback` option, the diff result will now be passed as the *first* argument to the callback instead of the second.** (Previously, the first argument was never used at all and would always have value `undefined`.) +- [#489](https://github.com/kpdecker/jsdiff/pull/489) **`this.options` no longer exists on `Diff` objects.** Instead, `options` is now passed as an argument to methods that rely on options, like `equals(left, right, options)`. This fixes a race condition in async mode, where diffing behaviour could be changed mid-execution if a concurrent usage of the same `Diff` instances overwrote its `options`. +- [#518](https://github.com/kpdecker/jsdiff/pull/518) **`linedelimiters` no longer exists** on patch objects; instead, when a patch with Windows-style CRLF line endings is parsed, **the lines in `lines` will end with `\r`**. There is now a **new `autoConvertLineEndings` option, on by default**, which makes it so that when a patch with Windows-style line endings is applied to a source file with Unix style line endings, the patch gets autoconverted to use Unix-style line endings, and when a patch with Unix-style line endings is applied to a source file with Windows-style line endings, it gets autoconverted to use Windows-style line endings. +- [#521](https://github.com/kpdecker/jsdiff/pull/521) **the `callback` option is now supported by `structuredPatch`, `createPatch`, and `createTwoFilesPatch`** +- [#529](https://github.com/kpdecker/jsdiff/pull/529) **`parsePatch` can now parse patches where lines starting with `--` or `++` are deleted/inserted**; previously, there were edge cases where the parser would choke on valid patches or give wrong results. +- [#530](https://github.com/kpdecker/jsdiff/pull/530) **Added `ignoreNewlineAtEof` option to `diffLines`** +- [#533](https://github.com/kpdecker/jsdiff/pull/533) **`applyPatch` uses an entirely new algorithm for fuzzy matching.** Differences between the old and new algorithm are as follows: + * The `fuzzFactor` now indicates the maximum [*Levenshtein* distance](https://en.wikipedia.org/wiki/Levenshtein_distance) that there can be between the context shown in a hunk and the actual file content at a location where we try to apply the hunk. (Previously, it represented a maximum [*Hamming* distance](https://en.wikipedia.org/wiki/Hamming_distance), meaning that a single insertion or deletion in the source file could stop a hunk from applying even with a high `fuzzFactor`.) + * A hunk containing a deletion can now only be applied in a context where the line to be deleted actually appears verbatim. (Previously, as long as enough context lines in the hunk matched, `applyPatch` would apply the hunk anyway and delete a completely different line.) + * The context line immediately before and immediately after an insertion must match exactly between the hunk and the file for a hunk to apply. (Previously this was not required.) +- [#535](https://github.com/kpdecker/jsdiff/pull/535) **A bug in patch generation functions is now fixed** that would sometimes previously cause `\ No newline at end of file` to appear in the wrong place in the generated patch, resulting in the patch being invalid. **These invalid patches can also no longer be applied successfully with `applyPatch`.** (It was already the case that tools other than jsdiff, like GNU `patch`, would consider them malformed and refuse to apply them; versions of jsdiff with this fix now do the same thing if you ask them to apply a malformed patch emitted by jsdiff v5.) +- [#535](https://github.com/kpdecker/jsdiff/pull/535) **Passing `newlineIsToken: true` to *patch*-generation functions is no longer allowed.** (Passing it to `diffLines` is still supported - it's only functions like `createPatch` where passing `newlineIsToken` is now an error.) Allowing it to be passed never really made sense, since in cases where the option had any effect on the output at all, the effect tended to be causing a garbled patch to be created that couldn't actually be applied to the source file. +- [#539](https://github.com/kpdecker/jsdiff/pull/539) **`diffWords` now takes an optional `intlSegmenter` option** which should be an `Intl.Segmenter` with word-level granularity. This provides better tokenization of text into words than the default behaviour, even for English but especially for some other languages for which the default behaviour is poor. + +## v5.2.2 - January 2026 + +Only change from 5.2.0 is a backport of the fix to https://github.com/kpdecker/jsdiff/security/advisories/GHSA-73rr-hh4g-fpgx. + +## v5.2.1 (deprecated) + +Accidental release - do not use. + +## v5.2.0 + +[Commits](https://github.com/kpdecker/jsdiff/compare/v5.1.0...v5.2.0) + +- [#411](https://github.com/kpdecker/jsdiff/pull/411) Big performance improvement. Previously an O(n) array-copying operation inside the innermost loop of jsdiff's base diffing code increased the overall worst-case time complexity of computing a diff from O(n²) to O(n³). This is now fixed, bringing the worst-case time complexity down to what it theoretically should be for a Myers diff implementation. +- [#448](https://github.com/kpdecker/jsdiff/pull/448) Performance improvement. Diagonals whose furthest-reaching D-path would go off the edge of the edit graph are now skipped, rather than being pointlessly considered as called for by the original Myers diff algorithm. This dramatically speeds up computing diffs where the new text just appends or truncates content at the end of the old text. +- [#351](https://github.com/kpdecker/jsdiff/issues/351) Importing from the lib folder - e.g. `require("diff/lib/diff/word.js")` - will work again now. This had been broken for users on the latest version of Node since Node 17.5.0, which changed how Node interprets the `exports` property in jsdiff's `package.json` file. +- [#344](https://github.com/kpdecker/jsdiff/issues/344) `diffLines`, `createTwoFilesPatch`, and other patch-creation methods now take an optional `stripTrailingCr: true` option which causes Windows-style `\r\n` line endings to be replaced with Unix-style `\n` line endings before calculating the diff, just like GNU `diff`'s `--strip-trailing-cr` flag. +- [#451](https://github.com/kpdecker/jsdiff/pull/451) Added `diff.formatPatch`. +- [#450](https://github.com/kpdecker/jsdiff/pull/450) Added `diff.reversePatch`. +- [#478](https://github.com/kpdecker/jsdiff/pull/478) Added `timeout` option. + +## v5.1.0 + +- [#365](https://github.com/kpdecker/jsdiff/issues/365) Allow early termination to limit execution time with degenerate cases + +[Commits](https://github.com/kpdecker/jsdiff/compare/v5.0.0...v5.1.0) + +## v5.0.0 + +- Breaking: UMD export renamed from `JsDiff` to `Diff`. +- Breaking: Newlines separated into separate tokens for word diff. +- Breaking: Unified diffs now match ["quirks"](https://www.artima.com/weblogs/viewpost.jsp?thread=164293) + +[Commits](https://github.com/kpdecker/jsdiff/compare/v4.0.1...v5.0.0) + +## v4.0.4 - January 2026 + +Only change from 4.0.2 is a backport of the fix to https://github.com/kpdecker/jsdiff/security/advisories/GHSA-73rr-hh4g-fpgx. + +## v4.0.3 (deprecated) + +Accidental release - do not use. + +## v4.0.2 + +No meaningful changes from v4.0.1 - just removed some cruft that shouldn't've been published. + +## v4.0.1 - January 6th, 2019 + +- Fix main reference path - b826104 + +[Commits](https://github.com/kpdecker/jsdiff/compare/v4.0.0...v4.0.1) + +## v4.0.0 - January 5th, 2019 + +- [#94](https://github.com/kpdecker/jsdiff/issues/94) - Missing "No newline at end of file" when comparing two texts that do not end in newlines ([@federicotdn](https://api.github.com/users/federicotdn)) +- [#227](https://github.com/kpdecker/jsdiff/issues/227) - Licence +- [#199](https://github.com/kpdecker/jsdiff/issues/199) - Import statement for jsdiff +- [#159](https://github.com/kpdecker/jsdiff/issues/159) - applyPatch affecting wrong line number with with new lines +- [#8](https://github.com/kpdecker/jsdiff/issues/8) - A new state "replace" +- Drop ie9 from karma targets - 79c31bd +- Upgrade deps. Convert from webpack to rollup - 2c1a29c +- Make ()[]"' as word boundaries between each other - f27b899 +- jsdiff: Replaced phantomJS by chrome - ec3114e +- Add yarn.lock to .npmignore - 29466d8 + +Compatibility notes: + +- Bower and Component packages no longer supported + +[Commits](https://github.com/kpdecker/jsdiff/compare/v3.5.0...v4.0.0) + +## v3.5.1 - January 2026 + +Only change from 3.5.0 is a backport of the fix to https://github.com/kpdecker/jsdiff/security/advisories/GHSA-73rr-hh4g-fpgx. + +## v3.5.0 - March 4th, 2018 + +- Omit redundant slice in join method of diffArrays - 1023590 +- Support patches with empty lines - fb0f208 +- Accept a custom JSON replacer function for JSON diffing - 69c7f0a +- Optimize parch header parser - 2aec429 +- Fix typos - e89c832 + +[Commits](https://github.com/kpdecker/jsdiff/compare/v3.4.0...v3.5.0) + +## v3.4.0 - October 7th, 2017 + +- [#183](https://github.com/kpdecker/jsdiff/issues/183) - Feature request: ability to specify a custom equality checker for `diffArrays` +- [#173](https://github.com/kpdecker/jsdiff/issues/173) - Bug: diffArrays gives wrong result on array of booleans +- [#158](https://github.com/kpdecker/jsdiff/issues/158) - diffArrays will not compare the empty string in array? +- comparator for custom equality checks - 30e141e +- count oldLines and newLines when there are conflicts - 53bf384 +- Fix: diffArrays can compare falsey items - 9e24284 +- Docs: Replace grunt with npm test - 00e2f94 + +[Commits](https://github.com/kpdecker/jsdiff/compare/v3.3.1...v3.4.0) + +## v3.3.1 - September 3rd, 2017 + +- [#141](https://github.com/kpdecker/jsdiff/issues/141) - Cannot apply patch because my file delimiter is "/r/n" instead of "/n" +- [#192](https://github.com/kpdecker/jsdiff/pull/192) - Fix: Bad merge when adding new files (#189) +- correct spelling mistake - 21fa478 + +[Commits](https://github.com/kpdecker/jsdiff/compare/v3.3.0...v3.3.1) + +## v3.3.0 - July 5th, 2017 + +- [#114](https://github.com/kpdecker/jsdiff/issues/114) - /patch/merge not exported +- Gracefully accept invalid newStart in hunks, same as patch(1) does. - d8a3635 +- Use regex rather than starts/ends with for parsePatch - 6cab62c +- Add browser flag - e64f674 +- refactor: simplified code a bit more - 8f8e0f2 +- refactor: simplified code a bit - b094a6f +- fix: some corrections re ignoreCase option - 3c78fd0 +- ignoreCase option - 3cbfbb5 +- Sanitize filename while parsing patches - 2fe8129 +- Added better installation methods - aced50b +- Simple export of functionality - 8690f31 + +[Commits](https://github.com/kpdecker/jsdiff/compare/v3.2.0...v3.3.0) + +## v3.2.0 - December 26th, 2016 + +- [#156](https://github.com/kpdecker/jsdiff/pull/156) - Add `undefinedReplacement` option to `diffJson` ([@ewnd9](https://api.github.com/users/ewnd9)) +- [#154](https://github.com/kpdecker/jsdiff/pull/154) - Add `examples` and `images` to `.npmignore`. ([@wtgtybhertgeghgtwtg](https://api.github.com/users/wtgtybhertgeghgtwtg)) +- [#153](https://github.com/kpdecker/jsdiff/pull/153) - feat(structuredPatch): Pass options to diffLines ([@Kiougar](https://api.github.com/users/Kiougar)) + +[Commits](https://github.com/kpdecker/jsdiff/compare/v3.1.0...v3.2.0) + +## v3.1.0 - November 27th, 2016 + +- [#146](https://github.com/kpdecker/jsdiff/pull/146) - JsDiff.diffArrays to compare arrays ([@wvanderdeijl](https://api.github.com/users/wvanderdeijl)) +- [#144](https://github.com/kpdecker/jsdiff/pull/144) - Split file using all possible line delimiter instead of hard-coded "/n" and join lines back using the original delimiters ([@soulbeing](https://api.github.com/users/soulbeing)) + +[Commits](https://github.com/kpdecker/jsdiff/compare/v3.0.1...v3.1.0) + +## v3.0.1 - October 9th, 2016 + +- [#139](https://github.com/kpdecker/jsdiff/pull/139) - Make README.md look nicer in npmjs.com ([@takenspc](https://api.github.com/users/takenspc)) +- [#135](https://github.com/kpdecker/jsdiff/issues/135) - parsePatch combines patches from multiple files into a single IUniDiff when there is no "Index" line ([@ramya-rao-a](https://api.github.com/users/ramya-rao-a)) +- [#124](https://github.com/kpdecker/jsdiff/issues/124) - IE7/IE8 failure since 2.0.0 ([@boneskull](https://api.github.com/users/boneskull)) + +[Commits](https://github.com/kpdecker/jsdiff/compare/v3.0.0...v3.0.1) + +## v3.0.0 - August 23rd, 2016 + +- [#130](https://github.com/kpdecker/jsdiff/pull/130) - Add callback argument to applyPatches `patched` option ([@piranna](https://api.github.com/users/piranna)) +- [#120](https://github.com/kpdecker/jsdiff/pull/120) - Correctly handle file names containing spaces ([@adius](https://api.github.com/users/adius)) +- [#119](https://github.com/kpdecker/jsdiff/pull/119) - Do single reflow ([@wifiextender](https://api.github.com/users/wifiextender)) +- [#117](https://github.com/kpdecker/jsdiff/pull/117) - Make more usable with long strings. ([@abnbgist](https://api.github.com/users/abnbgist)) + +Compatibility notes: + +- applyPatches patch callback now is async and requires the callback be called to continue operation + +[Commits](https://github.com/kpdecker/jsdiff/compare/v2.2.3...v3.0.0) + +## v2.2.3 - May 31st, 2016 + +- [#118](https://github.com/kpdecker/jsdiff/pull/118) - Add a fix for applying 0-length destination patches ([@chaaz](https://api.github.com/users/chaaz)) +- [#115](https://github.com/kpdecker/jsdiff/pull/115) - Fixed grammar in README ([@krizalys](https://api.github.com/users/krizalys)) +- [#113](https://github.com/kpdecker/jsdiff/pull/113) - fix typo ([@vmazare](https://api.github.com/users/vmazare)) + +[Commits](https://github.com/kpdecker/jsdiff/compare/v2.2.2...v2.2.3) + +## v2.2.2 - March 13th, 2016 + +- [#102](https://github.com/kpdecker/jsdiff/issues/102) - diffJson with dates, returns empty curly braces ([@dr-dimitru](https://api.github.com/users/dr-dimitru)) +- [#97](https://github.com/kpdecker/jsdiff/issues/97) - Whitespaces & diffWords ([@faiwer](https://api.github.com/users/faiwer)) +- [#92](https://github.com/kpdecker/jsdiff/pull/92) - Fixes typo in the readme ([@bg451](https://api.github.com/users/bg451)) + +[Commits](https://github.com/kpdecker/jsdiff/compare/v2.2.1...v2.2.2) + +## v2.2.1 - November 12th, 2015 + +- [#89](https://github.com/kpdecker/jsdiff/pull/89) - add in display selector to readme ([@FranDias](https://api.github.com/users/FranDias)) +- [#88](https://github.com/kpdecker/jsdiff/pull/88) - Split diffs based on file headers instead of 'Index:' metadata ([@piranna](https://api.github.com/users/piranna)) + +[Commits](https://github.com/kpdecker/jsdiff/compare/v2.2.0...v2.2.1) + +## v2.2.0 - October 29th, 2015 + +- [#80](https://github.com/kpdecker/jsdiff/pull/80) - Fix a typo: applyPath -> applyPatch ([@fluxxu](https://api.github.com/users/fluxxu)) +- [#83](https://github.com/kpdecker/jsdiff/pull/83) - Add basic fuzzy matching to applyPatch ([@piranna](https://github.com/piranna)) + [Commits](https://github.com/kpdecker/jsdiff/compare/v2.2.0...v2.2.0) + +## v2.2.0 - October 29th, 2015 + +- [#80](https://github.com/kpdecker/jsdiff/pull/80) - Fix a typo: applyPath -> applyPatch ([@fluxxu](https://api.github.com/users/fluxxu)) +- [#83](https://github.com/kpdecker/jsdiff/pull/83) - Add basic fuzzy matching to applyPatch ([@piranna](https://github.com/piranna)) + [Commits](https://github.com/kpdecker/jsdiff/compare/v2.1.3...v2.2.0) + +## v2.1.3 - September 30th, 2015 + +- [#78](https://github.com/kpdecker/jsdiff/pull/78) - fix: error throwing when apply patch to empty string ([@21paradox](https://api.github.com/users/21paradox)) + +[Commits](https://github.com/kpdecker/jsdiff/compare/v2.1.2...v2.1.3) + +## v2.1.2 - September 23rd, 2015 + +- [#76](https://github.com/kpdecker/jsdiff/issues/76) - diff headers give error ([@piranna](https://api.github.com/users/piranna)) + +[Commits](https://github.com/kpdecker/jsdiff/compare/v2.1.1...v2.1.2) + +## v2.1.1 - September 9th, 2015 + +- [#73](https://github.com/kpdecker/jsdiff/issues/73) - Is applyPatches() exposed in the API? ([@davidparsson](https://api.github.com/users/davidparsson)) + +[Commits](https://github.com/kpdecker/jsdiff/compare/v2.1.0...v2.1.1) + +## v2.1.0 - August 27th, 2015 + +- [#72](https://github.com/kpdecker/jsdiff/issues/72) - Consider using options object API for flag permutations ([@kpdecker](https://api.github.com/users/kpdecker)) +- [#70](https://github.com/kpdecker/jsdiff/issues/70) - diffWords treats \n at the end as significant whitespace ([@nesQuick](https://api.github.com/users/nesQuick)) +- [#69](https://github.com/kpdecker/jsdiff/issues/69) - Missing count ([@wfalkwallace](https://api.github.com/users/wfalkwallace)) +- [#68](https://github.com/kpdecker/jsdiff/issues/68) - diffLines seems broken ([@wfalkwallace](https://api.github.com/users/wfalkwallace)) +- [#60](https://github.com/kpdecker/jsdiff/issues/60) - Support multiple diff hunks ([@piranna](https://api.github.com/users/piranna)) +- [#54](https://github.com/kpdecker/jsdiff/issues/54) - Feature Request: 3-way merge ([@mog422](https://api.github.com/users/mog422)) +- [#42](https://github.com/kpdecker/jsdiff/issues/42) - Fuzz factor for applyPatch ([@stuartpb](https://api.github.com/users/stuartpb)) +- Move whitespace ignore out of equals method - 542063c +- Include source maps in babel output - 7f7ab21 +- Merge diff/line and diff/patch implementations - 1597705 +- Drop map utility method - 1ddc939 +- Documentation for parsePatch and applyPatches - 27c4b77 + +Compatibility notes: + +- The undocumented ignoreWhitespace flag has been removed from the Diff equality check directly. This implementation may be copied to diff utilities if dependencies existed on this functionality. + +[Commits](https://github.com/kpdecker/jsdiff/compare/v2.0.2...v2.1.0) + +## v2.0.2 - August 8th, 2015 + +- [#67](https://github.com/kpdecker/jsdiff/issues/67) - cannot require from npm module in node ([@commenthol](https://api.github.com/users/commenthol)) +- Convert to chai since we don’t support IE8 - a96bbad + +[Commits](https://github.com/kpdecker/jsdiff/compare/v2.0.1...v2.0.2) + +## v2.0.1 - August 7th, 2015 + +- Add release build at proper step - 57542fd + +[Commits](https://github.com/kpdecker/jsdiff/compare/v2.0.0...v2.0.1) + +## v2.0.0 - August 7th, 2015 + +- [#66](https://github.com/kpdecker/jsdiff/issues/66) - Add karma and sauce tests ([@kpdecker](https://api.github.com/users/kpdecker)) +- [#65](https://github.com/kpdecker/jsdiff/issues/65) - Create component repository for bower ([@kpdecker](https://api.github.com/users/kpdecker)) +- [#64](https://github.com/kpdecker/jsdiff/issues/64) - Automatically call removeEmpty for all tokenizer calls ([@kpdecker](https://api.github.com/users/kpdecker)) +- [#62](https://github.com/kpdecker/jsdiff/pull/62) - Allow access to structured object representation of patch data ([@bittrance](https://api.github.com/users/bittrance)) +- [#61](https://github.com/kpdecker/jsdiff/pull/61) - Use svg instead of png to get better image quality ([@PeterDaveHello](https://api.github.com/users/PeterDaveHello)) +- [#29](https://github.com/kpdecker/jsdiff/issues/29) - word tokenizer works only for 7 bit ascii ([@plasmagunman](https://api.github.com/users/plasmagunman)) + +Compatibility notes: + +- `this.removeEmpty` is now called automatically for all instances. If this is not desired, this may be overridden on a per instance basis. +- The library has been refactored to use some ES6 features. The external APIs should remain the same, but bower projects that directly referenced the repository will now have to point to the [components/jsdiff](https://github.com/components/jsdiff) repository. + +[Commits](https://github.com/kpdecker/jsdiff/compare/v1.4.0...v2.0.0) + +## v1.4.0 - May 6th, 2015 + +- [#57](https://github.com/kpdecker/jsdiff/issues/57) - createPatch -> applyPatch failed. ([@mog422](https://api.github.com/users/mog422)) +- [#56](https://github.com/kpdecker/jsdiff/pull/56) - Two files patch ([@rgeissert](https://api.github.com/users/rgeissert)) +- [#14](https://github.com/kpdecker/jsdiff/issues/14) - Flip added and removed order? ([@jakesandlund](https://api.github.com/users/jakesandlund)) + +[Commits](https://github.com/kpdecker/jsdiff/compare/v1.3.2...v1.4.0) + +## v1.3.2 - March 30th, 2015 + +- [#53](https://github.com/kpdecker/jsdiff/pull/53) - Updated README.MD with Bower installation instructions ([@ofbriggs](https://api.github.com/users/ofbriggs)) +- [#49](https://github.com/kpdecker/jsdiff/issues/49) - Cannot read property 'oldlines' of undefined ([@nwtn](https://api.github.com/users/nwtn)) +- [#44](https://github.com/kpdecker/jsdiff/issues/44) - invalid-meta jsdiff is missing "main" entry in bower.json + +[Commits](https://github.com/kpdecker/jsdiff/compare/v1.3.1...v1.3.2) + +## v1.3.1 - March 13th, 2015 + +- [#52](https://github.com/kpdecker/jsdiff/pull/52) - Fix for #51 Wrong result of JsDiff.diffLines ([@felicienfrancois](https://api.github.com/users/felicienfrancois)) + +[Commits](https://github.com/kpdecker/jsdiff/compare/v1.3.0...v1.3.1) + +## v1.3.0 - March 2nd, 2015 + +- [#47](https://github.com/kpdecker/jsdiff/pull/47) - Adding Diff Trimmed Lines ([@JamesGould123](https://api.github.com/users/JamesGould123)) + +[Commits](https://github.com/kpdecker/jsdiff/compare/v1.2.2...v1.3.0) + +## v1.2.2 - January 26th, 2015 + +- [#45](https://github.com/kpdecker/jsdiff/pull/45) - Fix AMD module loading ([@pedrocarrico](https://api.github.com/users/pedrocarrico)) +- [#43](https://github.com/kpdecker/jsdiff/pull/43) - added a bower file ([@nbrustein](https://api.github.com/users/nbrustein)) + +[Commits](https://github.com/kpdecker/jsdiff/compare/v1.2.1...v1.2.2) + +## v1.2.1 - December 26th, 2014 + +- [#41](https://github.com/kpdecker/jsdiff/pull/41) - change condition of using node export system. ([@ironhee](https://api.github.com/users/ironhee)) + +[Commits](https://github.com/kpdecker/jsdiff/compare/v1.2.0...v1.2.1) + +## v1.2.0 - November 29th, 2014 + +- [#37](https://github.com/kpdecker/jsdiff/pull/37) - Add support for sentences. ([@vmariano](https://api.github.com/users/vmariano)) +- [#28](https://github.com/kpdecker/jsdiff/pull/28) - Implemented diffJson ([@papandreou](https://api.github.com/users/papandreou)) +- [#27](https://github.com/kpdecker/jsdiff/issues/27) - Slow to execute over diffs with a large number of changes ([@termi](https://api.github.com/users/termi)) +- Allow for optional async diffing - 19385b9 +- Fix diffChars implementation - eaa44ed + +[Commits](https://github.com/kpdecker/jsdiff/compare/v1.1.0...v1.2.0) + +## v1.1.0 - November 25th, 2014 + +- [#33](https://github.com/kpdecker/jsdiff/pull/33) - AMD and global exports ([@ovcharik](https://api.github.com/users/ovcharik)) +- [#32](https://github.com/kpdecker/jsdiff/pull/32) - Add support for component ([@vmariano](https://api.github.com/users/vmariano)) +- [#31](https://github.com/kpdecker/jsdiff/pull/31) - Don't rely on Array.prototype.map ([@papandreou](https://api.github.com/users/papandreou)) + +[Commits](https://github.com/kpdecker/jsdiff/compare/v1.0.8...v1.1.0) + +## v1.0.8 - December 22nd, 2013 + +- [#24](https://github.com/kpdecker/jsdiff/pull/24) - Handle windows newlines on non windows machines. ([@benogle](https://api.github.com/users/benogle)) +- [#23](https://github.com/kpdecker/jsdiff/pull/23) - Prettied up the API formatting a little, and added basic node and web examples ([@airportyh](https://api.github.com/users/airportyh)) + +[Commits](https://github.com/kpdecker/jsdiff/compare/v1.0.7...v1.0.8) + +## v1.0.7 - September 11th, 2013 + +- [#22](https://github.com/kpdecker/jsdiff/pull/22) - Added variant of WordDiff that doesn't ignore whitespace differences ([@papandreou](https://api.github.com/users/papandreou) + +- Add 0.10 to travis tests - 243a526 + +[Commits](https://github.com/kpdecker/jsdiff/compare/v1.0.6...v1.0.7) + +## v1.0.6 - August 30th, 2013 + +- [#19](https://github.com/kpdecker/jsdiff/pull/19) - Explicitly define contents of npm package ([@sindresorhus](https://api.github.com/users/sindresorhus) + +[Commits](https://github.com/kpdecker/jsdiff/compare/v1.0.5...v1.0.6) diff --git a/node/node_modules/npm/node_modules/env-paths/index.js b/node/node_modules/npm/node_modules/env-paths/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e1d5be83bee48e381d1013b60a276a830170fde4 --- /dev/null +++ b/node/node_modules/npm/node_modules/env-paths/index.js @@ -0,0 +1,74 @@ +'use strict'; +const path = require('path'); +const os = require('os'); + +const homedir = os.homedir(); +const tmpdir = os.tmpdir(); +const {env} = process; + +const macos = name => { + const library = path.join(homedir, 'Library'); + + return { + data: path.join(library, 'Application Support', name), + config: path.join(library, 'Preferences', name), + cache: path.join(library, 'Caches', name), + log: path.join(library, 'Logs', name), + temp: path.join(tmpdir, name) + }; +}; + +const windows = name => { + const appData = env.APPDATA || path.join(homedir, 'AppData', 'Roaming'); + const localAppData = env.LOCALAPPDATA || path.join(homedir, 'AppData', 'Local'); + + return { + // Data/config/cache/log are invented by me as Windows isn't opinionated about this + data: path.join(localAppData, name, 'Data'), + config: path.join(appData, name, 'Config'), + cache: path.join(localAppData, name, 'Cache'), + log: path.join(localAppData, name, 'Log'), + temp: path.join(tmpdir, name) + }; +}; + +// https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html +const linux = name => { + const username = path.basename(homedir); + + return { + data: path.join(env.XDG_DATA_HOME || path.join(homedir, '.local', 'share'), name), + config: path.join(env.XDG_CONFIG_HOME || path.join(homedir, '.config'), name), + cache: path.join(env.XDG_CACHE_HOME || path.join(homedir, '.cache'), name), + // https://wiki.debian.org/XDGBaseDirectorySpecification#state + log: path.join(env.XDG_STATE_HOME || path.join(homedir, '.local', 'state'), name), + temp: path.join(tmpdir, username, name) + }; +}; + +const envPaths = (name, options) => { + if (typeof name !== 'string') { + throw new TypeError(`Expected string, got ${typeof name}`); + } + + options = Object.assign({suffix: 'nodejs'}, options); + + if (options.suffix) { + // Add suffix to prevent possible conflict with native apps + name += `-${options.suffix}`; + } + + if (process.platform === 'darwin') { + return macos(name); + } + + if (process.platform === 'win32') { + return windows(name); + } + + return linux(name); +}; + +module.exports = envPaths; +// TODO: Remove this for the next major release +module.exports.default = envPaths; diff --git a/node/node_modules/npm/node_modules/env-paths/license b/node/node_modules/npm/node_modules/env-paths/license new file mode 100644 index 0000000000000000000000000000000000000000..59992ba28491b21dc052c784c3208c6d74c0ae31 --- /dev/null +++ b/node/node_modules/npm/node_modules/env-paths/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/env-paths/package.json b/node/node_modules/npm/node_modules/env-paths/package.json new file mode 100644 index 0000000000000000000000000000000000000000..34e5c6c3fc3b7522d365b2b88eb24db928687038 --- /dev/null +++ b/node/node_modules/npm/node_modules/env-paths/package.json @@ -0,0 +1,45 @@ +{ + "name": "env-paths", + "version": "2.2.1", + "description": "Get paths for storing things like data, config, cache, etc", + "license": "MIT", + "repository": "sindresorhus/env-paths", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "common", + "user", + "paths", + "env", + "environment", + "directory", + "dir", + "appdir", + "path", + "data", + "config", + "cache", + "logs", + "temp", + "linux", + "unix" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.1", + "xo": "^0.24.0" + } +} diff --git a/node/node_modules/npm/node_modules/exponential-backoff/LICENSE b/node/node_modules/npm/node_modules/exponential-backoff/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..048dcdfd16896931a385e998f3ce72d2977bc1c5 --- /dev/null +++ b/node/node_modules/npm/node_modules/exponential-backoff/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2019 Coveo Solutions Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node/node_modules/npm/node_modules/exponential-backoff/package.json b/node/node_modules/npm/node_modules/exponential-backoff/package.json new file mode 100644 index 0000000000000000000000000000000000000000..513d68d3904dc5adc01c67eff900ae671c71ba03 --- /dev/null +++ b/node/node_modules/npm/node_modules/exponential-backoff/package.json @@ -0,0 +1,62 @@ +{ + "name": "exponential-backoff", + "version": "3.1.3", + "description": "A utility that allows retrying a function with an exponential delay between attempts.", + "files": [ + "dist/", + "src/" + ], + "main": "dist/backoff.js", + "types": "dist/backoff.d.ts", + "scripts": { + "build": "tsc", + "test": "jest", + "test:watch": "jest --watch" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "*.{ts,json,md}": [ + "prettier --write", + "git add" + ] + }, + "jest": { + "transform": { + "^.+\\.ts$": "ts-jest" + }, + "testRegex": "\\.spec\\.ts$", + "moduleFileExtensions": [ + "ts", + "js" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/coveooss/exponential-backoff.git" + }, + "keywords": [ + "exponential", + "backoff", + "retry" + ], + "author": "Sami Sayegh", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/coveooss/exponential-backoff/issues" + }, + "homepage": "https://github.com/coveooss/exponential-backoff#readme", + "devDependencies": { + "@types/jest": "^24.0.18", + "@types/node": "^10.14.21", + "husky": "^3.0.9", + "jest": "^24.9.0", + "lint-staged": "^9.4.2", + "prettier": "^1.18.2", + "ts-jest": "^24.1.0", + "typescript": "^3.6.4" + } +} diff --git a/node/node_modules/npm/node_modules/fastest-levenshtein/LICENSE.md b/node/node_modules/npm/node_modules/fastest-levenshtein/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b6cbd5b75cbd2f6b68f61e2c0a7739a9110a1cf7 --- /dev/null +++ b/node/node_modules/npm/node_modules/fastest-levenshtein/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Kasper Unn Weihe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/fastest-levenshtein/bench.js b/node/node_modules/npm/node_modules/fastest-levenshtein/bench.js new file mode 100644 index 0000000000000000000000000000000000000000..723f7063488a1a56d2617010b56dbd7e507614ee --- /dev/null +++ b/node/node_modules/npm/node_modules/fastest-levenshtein/bench.js @@ -0,0 +1,96 @@ +"use strict"; +exports.__esModule = true; +/* eslint-disable @typescript-eslint/no-var-requires */ +/* eslint-disable no-console */ +var Benchmark = require("benchmark"); +var mod_js_1 = require("./mod.js"); +var fast_levenshtein_1 = require("fast-levenshtein"); +var fs = require("fs"); +var jslevenshtein = require("js-levenshtein"); +var leven = require("leven"); +var levenshteinEditDistance = require("levenshtein-edit-distance"); +var suite = new Benchmark.Suite(); +var randomstring = function (length) { + var result = ""; + var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + var charactersLength = characters.length; + for (var i = 0; i < length; i++) { + result += characters.charAt(Math.floor(Math.random() * charactersLength)); + } + return result; +}; +var randomstringArr = function (stringSize, arraySize) { + var i = 0; + var arr = []; + for (i = 0; i < arraySize; i++) { + arr.push(randomstring(stringSize)); + } + return arr; +}; +var arrSize = 1000; +if (!fs.existsSync("data.json")) { + var data_1 = [ + randomstringArr(4, arrSize), + randomstringArr(8, arrSize), + randomstringArr(16, arrSize), + randomstringArr(32, arrSize), + randomstringArr(64, arrSize), + randomstringArr(128, arrSize), + randomstringArr(256, arrSize), + randomstringArr(512, arrSize), + randomstringArr(1024, arrSize), + ]; + fs.writeFileSync("data.json", JSON.stringify(data_1)); +} +var data = JSON.parse(fs.readFileSync("data.json", "utf8")); +var _loop_1 = function (i) { + var datapick = data[i]; + if (process.argv[2] !== "no") { + suite + .add("".concat(i, " - js-levenshtein"), function () { + for (var j = 0; j < arrSize - 1; j += 2) { + jslevenshtein(datapick[j], datapick[j + 1]); + } + }) + .add("".concat(i, " - leven"), function () { + for (var j = 0; j < arrSize - 1; j += 2) { + leven(datapick[j], datapick[j + 1]); + } + }) + .add("".concat(i, " - fast-levenshtein"), function () { + for (var j = 0; j < arrSize - 1; j += 2) { + (0, fast_levenshtein_1.get)(datapick[j], datapick[j + 1]); + } + }) + .add("".concat(i, " - levenshtein-edit-distance"), function () { + for (var j = 0; j < arrSize - 1; j += 2) { + levenshteinEditDistance(datapick[j], datapick[j + 1]); + } + }); + } + suite.add("".concat(i, " - fastest-levenshtein"), function () { + for (var j = 0; j < arrSize - 1; j += 2) { + (0, mod_js_1.distance)(datapick[j], datapick[j + 1]); + } + }); +}; +// BENCHMARKS +for (var i = 0; i < 9; i++) { + _loop_1(i); +} +var results = new Map(); +suite + .on("cycle", function (event) { + console.log(String(event.target)); + if (results.has(event.target.name[0])) { + results.get(event.target.name[0]).push(event.target.hz); + } + else { + results.set(event.target.name[0], [event.target.hz]); + } +}) + .on("complete", function () { + console.log(results); +}) + // run async + .run({ async: true }); diff --git a/node/node_modules/npm/node_modules/fastest-levenshtein/mod.js b/node/node_modules/npm/node_modules/fastest-levenshtein/mod.js new file mode 100644 index 0000000000000000000000000000000000000000..823f57f132fc13b38af1c155c8b9e10370e72325 --- /dev/null +++ b/node/node_modules/npm/node_modules/fastest-levenshtein/mod.js @@ -0,0 +1,142 @@ +"use strict"; +exports.__esModule = true; +exports.distance = exports.closest = void 0; +var peq = new Uint32Array(0x10000); +var myers_32 = function (a, b) { + var n = a.length; + var m = b.length; + var lst = 1 << (n - 1); + var pv = -1; + var mv = 0; + var sc = n; + var i = n; + while (i--) { + peq[a.charCodeAt(i)] |= 1 << i; + } + for (i = 0; i < m; i++) { + var eq = peq[b.charCodeAt(i)]; + var xv = eq | mv; + eq |= ((eq & pv) + pv) ^ pv; + mv |= ~(eq | pv); + pv &= eq; + if (mv & lst) { + sc++; + } + if (pv & lst) { + sc--; + } + mv = (mv << 1) | 1; + pv = (pv << 1) | ~(xv | mv); + mv &= xv; + } + i = n; + while (i--) { + peq[a.charCodeAt(i)] = 0; + } + return sc; +}; +var myers_x = function (b, a) { + var n = a.length; + var m = b.length; + var mhc = []; + var phc = []; + var hsize = Math.ceil(n / 32); + var vsize = Math.ceil(m / 32); + for (var i = 0; i < hsize; i++) { + phc[i] = -1; + mhc[i] = 0; + } + var j = 0; + for (; j < vsize - 1; j++) { + var mv_1 = 0; + var pv_1 = -1; + var start_1 = j * 32; + var vlen_1 = Math.min(32, m) + start_1; + for (var k = start_1; k < vlen_1; k++) { + peq[b.charCodeAt(k)] |= 1 << k; + } + for (var i = 0; i < n; i++) { + var eq = peq[a.charCodeAt(i)]; + var pb = (phc[(i / 32) | 0] >>> i) & 1; + var mb = (mhc[(i / 32) | 0] >>> i) & 1; + var xv = eq | mv_1; + var xh = ((((eq | mb) & pv_1) + pv_1) ^ pv_1) | eq | mb; + var ph = mv_1 | ~(xh | pv_1); + var mh = pv_1 & xh; + if ((ph >>> 31) ^ pb) { + phc[(i / 32) | 0] ^= 1 << i; + } + if ((mh >>> 31) ^ mb) { + mhc[(i / 32) | 0] ^= 1 << i; + } + ph = (ph << 1) | pb; + mh = (mh << 1) | mb; + pv_1 = mh | ~(xv | ph); + mv_1 = ph & xv; + } + for (var k = start_1; k < vlen_1; k++) { + peq[b.charCodeAt(k)] = 0; + } + } + var mv = 0; + var pv = -1; + var start = j * 32; + var vlen = Math.min(32, m - start) + start; + for (var k = start; k < vlen; k++) { + peq[b.charCodeAt(k)] |= 1 << k; + } + var score = m; + for (var i = 0; i < n; i++) { + var eq = peq[a.charCodeAt(i)]; + var pb = (phc[(i / 32) | 0] >>> i) & 1; + var mb = (mhc[(i / 32) | 0] >>> i) & 1; + var xv = eq | mv; + var xh = ((((eq | mb) & pv) + pv) ^ pv) | eq | mb; + var ph = mv | ~(xh | pv); + var mh = pv & xh; + score += (ph >>> (m - 1)) & 1; + score -= (mh >>> (m - 1)) & 1; + if ((ph >>> 31) ^ pb) { + phc[(i / 32) | 0] ^= 1 << i; + } + if ((mh >>> 31) ^ mb) { + mhc[(i / 32) | 0] ^= 1 << i; + } + ph = (ph << 1) | pb; + mh = (mh << 1) | mb; + pv = mh | ~(xv | ph); + mv = ph & xv; + } + for (var k = start; k < vlen; k++) { + peq[b.charCodeAt(k)] = 0; + } + return score; +}; +var distance = function (a, b) { + if (a.length < b.length) { + var tmp = b; + b = a; + a = tmp; + } + if (b.length === 0) { + return a.length; + } + if (a.length <= 32) { + return myers_32(a, b); + } + return myers_x(a, b); +}; +exports.distance = distance; +var closest = function (str, arr) { + var min_distance = Infinity; + var min_index = 0; + for (var i = 0; i < arr.length; i++) { + var dist = distance(str, arr[i]); + if (dist < min_distance) { + min_distance = dist; + min_index = i; + } + } + return arr[min_index]; +}; +exports.closest = closest; diff --git a/node/node_modules/npm/node_modules/fastest-levenshtein/package.json b/node/node_modules/npm/node_modules/fastest-levenshtein/package.json new file mode 100644 index 0000000000000000000000000000000000000000..22db7d58c107208c29fb38a405ec182ba7e90d7f --- /dev/null +++ b/node/node_modules/npm/node_modules/fastest-levenshtein/package.json @@ -0,0 +1,72 @@ +{ + "name": "fastest-levenshtein", + "version": "1.0.16", + "description": "Fastest Levenshtein distance implementation in JS.", + "main": "mod.js", + "types": "mod.d.ts", + "module": "./esm/mod.js", + "repository": { + "type": "git", + "url": "git+https://github.com/ka-weihe/fastest-levenshtein.git" + }, + "keywords": [ + "levenshtein", + "distance", + "fast", + "fastest", + "edit", + "string", + "similarity", + "algorithm", + "match", + "comparison", + "fuzzy", + "search", + "string", + "matching", + "similar", + "node", + "difference" + ], + "author": "Kasper U. Weihe", + "license": "MIT", + "bugs": { + "url": "https://github.com/ka-weihe/fastest-levenshtein/issues" + }, + "homepage": "https://github.com/ka-weihe/fastest-levenshtein#README", + "scripts": { + "build": "tsc mod.ts --declaration", + "build:esm": "tsc --declaration -p tsconfig.esm.json", + "prepare": "npm run build && npm run build:esm", + "bench": "npm run build && tsc bench.ts && node bench.js", + "test": "npm run build && tsc test.ts && jest test.js", + "test:coverage": "npm run build && jest --coverage", + "test:coveralls": "npm run build && jest --coverage --coverageReporters=text-lcov | coveralls" + }, + "devDependencies": { + "@types/benchmark": "^1.0.33", + "@types/jest": "^26.0.15", + "@typescript-eslint/eslint-plugin": "^4.7.0", + "@typescript-eslint/parser": "^4.7.0", + "benchmark": "^2.1.4", + "coveralls": "^3.1.0", + "eslint": "^7.13.0", + "eslint-config-node": "^4.1.0", + "eslint-config-prettier": "^6.15.0", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-prettier": "^3.1.4", + "fast-levenshtein": "^2.0.6", + "jest": "^26.6.3", + "js-levenshtein": "^1.1.6", + "leven": "^3.1.0", + "levenshtein-edit-distance": "^2.0.5", + "natural": "^2.1.5", + "prettier": "^2.1.2", + "talisman": "^1.1.3", + "typescript": "^4.0.5" + }, + "engines": { + "node": ">= 4.9.1" + } +} diff --git a/node/node_modules/npm/node_modules/fastest-levenshtein/test.js b/node/node_modules/npm/node_modules/fastest-levenshtein/test.js new file mode 100644 index 0000000000000000000000000000000000000000..e3030e93c9daac42d8bf99fdb44e898193520e49 --- /dev/null +++ b/node/node_modules/npm/node_modules/fastest-levenshtein/test.js @@ -0,0 +1,55 @@ +var _a = require("./mod.js"), closest = _a.closest, distance = _a.distance; +var levenshtein = function (a, b) { + if (a.length === 0) { + return b.length; + } + if (b.length === 0) { + return a.length; + } + if (a.length > b.length) { + var tmp = a; + a = b; + b = tmp; + } + var row = []; + for (var i = 0; i <= a.length; i++) { + row[i] = i; + } + for (var i = 1; i <= b.length; i++) { + var prev = i; + for (var j = 1; j <= a.length; j++) { + var val = 0; + if (b.charAt(i - 1) === a.charAt(j - 1)) { + val = row[j - 1]; + } + else { + val = Math.min(row[j - 1] + 1, prev + 1, row[j] + 1); + } + row[j - 1] = prev; + prev = val; + } + row[a.length] = prev; + } + return row[a.length]; +}; +var makeid = function (length) { + var result = ""; + var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + var charactersLength = characters.length; + for (var i = 0; i < length; i++) { + result += characters.charAt(Math.floor(Math.random() * charactersLength)); + } + return result; +}; +for (var i = 0; i < 10000; i++) { + var rnd_num1 = (Math.random() * 1000) | 0; + var rnd_num2 = (Math.random() * 1000) | 0; + var rnd_string1 = makeid(rnd_num1); + var rnd_string2 = makeid(rnd_num2); + var actual = distance(rnd_string1, rnd_string2); + var expected = levenshtein(rnd_string1, rnd_string2); + console.log(i); + if (actual !== expected) { + console.log("fail"); + } +} diff --git a/node/node_modules/npm/node_modules/fs-minipass/LICENSE b/node/node_modules/npm/node_modules/fs-minipass/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..32eb517086ebb24cfe3dd076033211d444186dc9 --- /dev/null +++ b/node/node_modules/npm/node_modules/fs-minipass/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/fs-minipass/package.json b/node/node_modules/npm/node_modules/fs-minipass/package.json new file mode 100644 index 0000000000000000000000000000000000000000..b43643d99c42d4337cb6752386b19f1c4ee8a6ef --- /dev/null +++ b/node/node_modules/npm/node_modules/fs-minipass/package.json @@ -0,0 +1,54 @@ +{ + "name": "fs-minipass", + "version": "3.0.3", + "main": "lib/index.js", + "scripts": { + "test": "tap", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "snap": "tap", + "posttest": "npm run lint" + }, + "keywords": [], + "author": "GitHub Inc.", + "license": "ISC", + "repository": { + "type": "git", + "url": "https://github.com/npm/fs-minipass.git" + }, + "bugs": { + "url": "https://github.com/npm/fs-minipass/issues" + }, + "homepage": "https://github.com/npm/fs-minipass#readme", + "description": "fs read and write streams based on minipass", + "dependencies": { + "minipass": "^7.0.3" + }, + "devDependencies": { + "@npmcli/eslint-config": "^4.0.1", + "@npmcli/template-oss": "4.18.0", + "mutate-fs": "^2.1.1", + "tap": "^16.3.2" + }, + "files": [ + "bin/", + "lib/" + ], + "tap": { + "check-coverage": true, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.18.0", + "publish": "true" + } +} diff --git a/node/node_modules/npm/node_modules/glob/LICENSE.md b/node/node_modules/npm/node_modules/glob/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..d4082d06dd2530afb592b94ccbaa7ae6cd7091e4 --- /dev/null +++ b/node/node_modules/npm/node_modules/glob/LICENSE.md @@ -0,0 +1,63 @@ +All packages under `src/` are licensed according to the terms in +their respective `LICENSE` or `LICENSE.md` files. + +The remainder of this project is licensed under the Blue Oak +Model License, as follows: + +----- + +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** diff --git a/node/node_modules/npm/node_modules/glob/package.json b/node/node_modules/npm/node_modules/glob/package.json new file mode 100644 index 0000000000000000000000000000000000000000..0f60e1732e7be51c2e0bfe7a462702f90d81496d --- /dev/null +++ b/node/node_modules/npm/node_modules/glob/package.json @@ -0,0 +1,98 @@ +{ + "author": "Isaac Z. Schlueter (https://blog.izs.me/)", + "name": "glob", + "description": "the most correct and second fastest glob implementation in JavaScript", + "version": "13.0.6", + "type": "module", + "tshy": { + "exports": { + "./package.json": "./package.json", + "./raw": "./src/index.ts", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + } + }, + "main": "./dist/commonjs/index.min.js", + "module": "./dist/esm/index.min.js", + "types": "./dist/commonjs/index.d.ts", + "exports": { + "./package.json": "./package.json", + "./raw": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + }, + "repository": { + "type": "git", + "url": "git@github.com:isaacs/node-glob.git" + }, + "files": [ + "dist" + ], + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "npm run benchclean; git push origin --follow-tags", + "prepare": "tshy && bash scripts/build.sh", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write . --log-level warn", + "typedoc": "typedoc", + "profclean": "rm -f v8.log profile.txt", + "test-regen": "npm run profclean && TEST_REGEN=1 node --no-warnings --loader ts-node/esm test/00-setup.ts", + "prebench": "npm run prepare", + "bench": "bash benchmark.sh", + "preprof": "npm run prepare", + "prof": "bash prof.sh", + "benchclean": "node benchclean.cjs" + }, + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "devDependencies": { + "@types/node": "^25.3.0", + "esbuild": "^0.27.3", + "memfs": "^4.50.0", + "mkdirp": "^3.0.1", + "prettier": "^3.6.2", + "rimraf": "^6.1.3", + "tap": "^21.6.1", + "tshy": "^3.3.2", + "typedoc": "^0.28.17" + }, + "license": "BlueOak-1.0.0", + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "engines": { + "node": "18 || 20 || >=22" + } +} diff --git a/node/node_modules/npm/node_modules/graceful-fs/LICENSE b/node/node_modules/npm/node_modules/graceful-fs/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..030f03bd33aebe1df66ab4c40533634bd997f9f3 --- /dev/null +++ b/node/node_modules/npm/node_modules/graceful-fs/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/graceful-fs/clone.js b/node/node_modules/npm/node_modules/graceful-fs/clone.js new file mode 100644 index 0000000000000000000000000000000000000000..3231fc276f1b8e7b8dad654caa11158d6d9ea6db --- /dev/null +++ b/node/node_modules/npm/node_modules/graceful-fs/clone.js @@ -0,0 +1,23 @@ +'use strict' + +module.exports = clone + +var getPrototypeOf = Object.getPrototypeOf || function (obj) { + return obj.__proto__ +} + +function clone (obj) { + if (obj === null || typeof obj !== 'object') + return obj + + if (obj instanceof Object) + var copy = { __proto__: getPrototypeOf(obj) } + else + var copy = Object.create(null) + + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) + + return copy +} diff --git a/node/node_modules/npm/node_modules/graceful-fs/graceful-fs.js b/node/node_modules/npm/node_modules/graceful-fs/graceful-fs.js new file mode 100644 index 0000000000000000000000000000000000000000..2f16b2b5b0b485e4a0085bcddeb9ecf9795731ff --- /dev/null +++ b/node/node_modules/npm/node_modules/graceful-fs/graceful-fs.js @@ -0,0 +1,448 @@ +var fs = require('fs') +var polyfills = require('./polyfills.js') +var legacy = require('./legacy-streams.js') +var clone = require('./clone.js') + +var util = require('util') + +/* istanbul ignore next - node 0.x polyfill */ +var gracefulQueue +var previousSymbol + +/* istanbul ignore else - node 0.x polyfill */ +if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { + gracefulQueue = Symbol.for('graceful-fs.queue') + // This is used in testing by future versions + previousSymbol = Symbol.for('graceful-fs.previous') +} else { + gracefulQueue = '___graceful-fs.queue' + previousSymbol = '___graceful-fs.previous' +} + +function noop () {} + +function publishQueue(context, queue) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue + } + }) +} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } + +// Once time initialization +if (!fs[gracefulQueue]) { + // This queue can be shared by multiple loaded instances + var queue = global[gracefulQueue] || [] + publishQueue(fs, queue) + + // Patch fs.close/closeSync to shared queue version, because we need + // to retry() whenever a close happens *anywhere* in the program. + // This is essential when multiple graceful-fs instances are + // in play at the same time. + fs.close = (function (fs$close) { + function close (fd, cb) { + return fs$close.call(fs, fd, function (err) { + // This function uses the graceful-fs shared queue + if (!err) { + resetQueue() + } + + if (typeof cb === 'function') + cb.apply(this, arguments) + }) + } + + Object.defineProperty(close, previousSymbol, { + value: fs$close + }) + return close + })(fs.close) + + fs.closeSync = (function (fs$closeSync) { + function closeSync (fd) { + // This function uses the graceful-fs shared queue + fs$closeSync.apply(fs, arguments) + resetQueue() + } + + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }) + return closeSync + })(fs.closeSync) + + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(fs[gracefulQueue]) + require('assert').equal(fs[gracefulQueue].length, 0) + }) + } +} + +if (!global[gracefulQueue]) { + publishQueue(global, fs[gracefulQueue]); +} + +module.exports = patch(clone(fs)) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { + module.exports = patch(fs) + fs.__patched = true; +} + +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch + + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readFile(path, options, cb) + + function go$readFile (path, options, cb, startTime) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$writeFile(path, data, options, cb) + + function go$writeFile (path, data, options, cb, startTime) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$appendFile(path, data, options, cb) + + function go$appendFile (path, data, options, cb, startTime) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$copyFile = fs.copyFile + if (fs$copyFile) + fs.copyFile = copyFile + function copyFile (src, dest, flags, cb) { + if (typeof flags === 'function') { + cb = flags + flags = 0 + } + return go$copyFile(src, dest, flags, cb) + + function go$copyFile (src, dest, flags, cb, startTime) { + return fs$copyFile(src, dest, flags, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$readdir = fs.readdir + fs.readdir = readdir + var noReaddirOptionVersions = /^v[0-5]\./ + function readdir (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + var go$readdir = noReaddirOptionVersions.test(process.version) + ? function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, fs$readdirCallback( + path, options, cb, startTime + )) + } + : function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, options, fs$readdirCallback( + path, options, cb, startTime + )) + } + + return go$readdir(path, options, cb) + + function fs$readdirCallback (path, options, cb, startTime) { + return function (err, files) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([ + go$readdir, + [path, options, cb], + err, + startTime || Date.now(), + Date.now() + ]) + else { + if (files && files.sort) + files.sort() + + if (typeof cb === 'function') + cb.call(this, err, files) + } + } + } + } + + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream + } + + var fs$ReadStream = fs.ReadStream + if (fs$ReadStream) { + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + } + + var fs$WriteStream = fs.WriteStream + if (fs$WriteStream) { + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open + } + + Object.defineProperty(fs, 'ReadStream', { + get: function () { + return ReadStream + }, + set: function (val) { + ReadStream = val + }, + enumerable: true, + configurable: true + }) + Object.defineProperty(fs, 'WriteStream', { + get: function () { + return WriteStream + }, + set: function (val) { + WriteStream = val + }, + enumerable: true, + configurable: true + }) + + // legacy names + var FileReadStream = ReadStream + Object.defineProperty(fs, 'FileReadStream', { + get: function () { + return FileReadStream + }, + set: function (val) { + FileReadStream = val + }, + enumerable: true, + configurable: true + }) + var FileWriteStream = WriteStream + Object.defineProperty(fs, 'FileWriteStream', { + get: function () { + return FileWriteStream + }, + set: function (val) { + FileWriteStream = val + }, + enumerable: true, + configurable: true + }) + + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + } + + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() + + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + that.read() + } + }) + } + + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + } + + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } + + function createReadStream (path, options) { + return new fs.ReadStream(path, options) + } + + function createWriteStream (path, options) { + return new fs.WriteStream(path, options) + } + + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null + + return go$open(path, flags, mode, cb) + + function go$open (path, flags, mode, cb, startTime) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + return fs +} + +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + fs[gracefulQueue].push(elem) + retry() +} + +// keep track of the timeout between retry() calls +var retryTimer + +// reset the startTime and lastTime to now +// this resets the start of the 60 second overall timeout as well as the +// delay between attempts so that we'll retry these jobs sooner +function resetQueue () { + var now = Date.now() + for (var i = 0; i < fs[gracefulQueue].length; ++i) { + // entries that are only a length of 2 are from an older version, don't + // bother modifying those since they'll be retried anyway. + if (fs[gracefulQueue][i].length > 2) { + fs[gracefulQueue][i][3] = now // startTime + fs[gracefulQueue][i][4] = now // lastTime + } + } + // call retry to make sure we're actively processing the queue + retry() +} + +function retry () { + // clear the timer and remove it to help prevent unintended concurrency + clearTimeout(retryTimer) + retryTimer = undefined + + if (fs[gracefulQueue].length === 0) + return + + var elem = fs[gracefulQueue].shift() + var fn = elem[0] + var args = elem[1] + // these items may be unset if they were added by an older graceful-fs + var err = elem[2] + var startTime = elem[3] + var lastTime = elem[4] + + // if we don't have a startTime we have no way of knowing if we've waited + // long enough, so go ahead and retry this item now + if (startTime === undefined) { + debug('RETRY', fn.name, args) + fn.apply(null, args) + } else if (Date.now() - startTime >= 60000) { + // it's been more than 60 seconds total, bail now + debug('TIMEOUT', fn.name, args) + var cb = args.pop() + if (typeof cb === 'function') + cb.call(null, err) + } else { + // the amount of time between the last attempt and right now + var sinceAttempt = Date.now() - lastTime + // the amount of time between when we first tried, and when we last tried + // rounded up to at least 1 + var sinceStart = Math.max(lastTime - startTime, 1) + // backoff. wait longer than the total time we've been retrying, but only + // up to a maximum of 100ms + var desiredDelay = Math.min(sinceStart * 1.2, 100) + // it's been long enough since the last retry, do it again + if (sinceAttempt >= desiredDelay) { + debug('RETRY', fn.name, args) + fn.apply(null, args.concat([startTime])) + } else { + // if we can't do this job yet, push it to the end of the queue + // and let the next iteration check again + fs[gracefulQueue].push(elem) + } + } + + // schedule our next run if one isn't already scheduled + if (retryTimer === undefined) { + retryTimer = setTimeout(retry, 0) + } +} diff --git a/node/node_modules/npm/node_modules/graceful-fs/legacy-streams.js b/node/node_modules/npm/node_modules/graceful-fs/legacy-streams.js new file mode 100644 index 0000000000000000000000000000000000000000..891ad8520cf54af8d0fada439d3d241bdb1d3443 --- /dev/null +++ b/node/node_modules/npm/node_modules/graceful-fs/legacy-streams.js @@ -0,0 +1,118 @@ +var Stream = require('stream').Stream + +module.exports = legacy + +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + } + + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); + + Stream.call(this); + + var self = this; + + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.encoding) this.setEncoding(this.encoding); + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + + if (this.start > this.end) { + throw new Error('start must be <= end'); + } + + this.pos = this.start; + } + + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } + + self.fd = fd; + self.emit('open', fd); + self._read(); + }) + } + + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); + + Stream.call(this); + + this.path = path; + this.fd = null; + this.writable = true; + + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } + + this.pos = this.start; + } + + this.busy = false; + this._queue = []; + + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } + } +} diff --git a/node/node_modules/npm/node_modules/graceful-fs/package.json b/node/node_modules/npm/node_modules/graceful-fs/package.json new file mode 100644 index 0000000000000000000000000000000000000000..459cb357b1948e0e2474fca04d9c3372e38251c1 --- /dev/null +++ b/node/node_modules/npm/node_modules/graceful-fs/package.json @@ -0,0 +1,53 @@ +{ + "name": "graceful-fs", + "description": "A drop-in replacement for fs, making various improvements.", + "version": "4.2.11", + "repository": { + "type": "git", + "url": "https://github.com/isaacs/node-graceful-fs" + }, + "main": "graceful-fs.js", + "directories": { + "test": "test" + }, + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags", + "test": "nyc --silent node test.js | tap -c -", + "posttest": "nyc report" + }, + "keywords": [ + "fs", + "module", + "reading", + "retry", + "retries", + "queue", + "error", + "errors", + "handling", + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" + ], + "license": "ISC", + "devDependencies": { + "import-fresh": "^2.0.0", + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", + "tap": "^16.3.4" + }, + "files": [ + "fs.js", + "graceful-fs.js", + "legacy-streams.js", + "polyfills.js", + "clone.js" + ], + "tap": { + "reporter": "classic" + } +} diff --git a/node/node_modules/npm/node_modules/graceful-fs/polyfills.js b/node/node_modules/npm/node_modules/graceful-fs/polyfills.js new file mode 100644 index 0000000000000000000000000000000000000000..14705832c09b043cbc6e29b31a6f12fda6a77f4e --- /dev/null +++ b/node/node_modules/npm/node_modules/graceful-fs/polyfills.js @@ -0,0 +1,355 @@ +var constants = require('constants') + +var origCwd = process.cwd +var cwd = null + +var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform + +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +try { + process.cwd() +} catch (er) {} + +// This check is needed until node.js 12 is required +if (typeof process.chdir === 'function') { + var chdir = process.chdir + process.chdir = function (d) { + cwd = null + chdir.call(process, d) + } + if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) +} + +module.exports = patch + +function patch (fs) { + // (re-)implement some things that are known busted or missing. + + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) + } + + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) + } + + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. + + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) + + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) + + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) + + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) + + fs.stat = statFix(fs.stat) + fs.fstat = statFix(fs.fstat) + fs.lstat = statFix(fs.lstat) + + fs.statSync = statFixSync(fs.statSync) + fs.fstatSync = statFixSync(fs.fstatSync) + fs.lstatSync = statFixSync(fs.lstatSync) + + // if lchmod/lchown do not exist, then make them no-ops + if (fs.chmod && !fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + if (cb) process.nextTick(cb) + } + fs.lchmodSync = function () {} + } + if (fs.chown && !fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + if (cb) process.nextTick(cb) + } + fs.lchownSync = function () {} + } + + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 60 seconds. + + // Set the timeout this long because some Windows Anti-Virus, such as Parity + // bit9, may lock files for up to a minute, causing npm package install + // failures. Also, take care to yield the scheduler. Windows scheduling gives + // CPU to a busy looping process, which can cause the program causing the lock + // contention to be starved of CPU by node, so the contention doesn't resolve. + if (platform === "win32") { + fs.rename = typeof fs.rename !== 'function' ? fs.rename + : (function (fs$rename) { + function rename (from, to, cb) { + var start = Date.now() + var backoff = 0; + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") + && Date.now() - start < 60000) { + setTimeout(function() { + fs.stat(to, function (stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er) + }) + }, backoff) + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er) + }) + } + if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename) + return rename + })(fs.rename) + } + + // if read() returns EAGAIN, then just try it again. + fs.read = typeof fs.read !== 'function' ? fs.read + : (function (fs$read) { + function read (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + + // This ensures `util.promisify` works as it does for native `fs.read`. + if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) + return read + })(fs.read) + + fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync + : (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) + + function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + if (callback) callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + if (callback) callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + } + + function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + if (er) { + if (cb) cb(er) + return + } + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + if (cb) cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + + } else if (fs.futimes) { + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } + fs.lutimesSync = function () {} + } + } + + function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + + function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + function statFix (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + function callback (er, stats) { + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + if (cb) cb.apply(this, arguments) + } + return options ? orig.call(fs, target, options, callback) + : orig.call(fs, target, callback) + } + } + + function statFixSync (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options) { + var stats = options ? orig.call(fs, target, options) + : orig.call(fs, target) + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + return stats; + } + } + + // ENOSYS means that the fs doesn't support the op. Just ignore + // that, because it doesn't matter. + // + // if there's no getuid, or if getuid() is something other + // than 0, and the error is EINVAL or EPERM, then just ignore + // it. + // + // This specific case is a silent failure in cp, install, tar, + // and most other unix tools that manage permissions. + // + // When running as root, or if other types of errors are + // encountered, then it's strict. + function chownErOk (er) { + if (!er) + return true + + if (er.code === "ENOSYS") + return true + + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true + } + + return false + } +} diff --git a/node/node_modules/npm/node_modules/hosted-git-info/LICENSE b/node/node_modules/npm/node_modules/hosted-git-info/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..8ed0832d12811909ca0e3a222a919046fe72f500 --- /dev/null +++ b/node/node_modules/npm/node_modules/hosted-git-info/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/hosted-git-info/package.json b/node/node_modules/npm/node_modules/hosted-git-info/package.json new file mode 100644 index 0000000000000000000000000000000000000000..f68f45a7a69df41ab60ae78c7c55313a6587769e --- /dev/null +++ b/node/node_modules/npm/node_modules/hosted-git-info/package.json @@ -0,0 +1,61 @@ +{ + "name": "hosted-git-info", + "version": "9.0.2", + "description": "Provides metadata and conversions from repository urls for GitHub, Bitbucket and GitLab", + "main": "./lib/index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/hosted-git-info.git" + }, + "keywords": [ + "git", + "github", + "bitbucket", + "gitlab" + ], + "author": "GitHub Inc.", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/hosted-git-info/issues" + }, + "homepage": "https://github.com/npm/hosted-git-info", + "scripts": { + "posttest": "npm run lint", + "snap": "tap", + "test": "tap", + "test:coverage": "tap --coverage-report=html", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "dependencies": { + "lru-cache": "^11.1.0" + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.25.1", + "tap": "^16.0.1" + }, + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "tap": { + "color": 1, + "coverage": true, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.25.1", + "publish": "true" + } +} diff --git a/node/node_modules/npm/node_modules/http-cache-semantics/LICENSE b/node/node_modules/npm/node_modules/http-cache-semantics/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..acfdb215b45d2e7370b2ba4645c39acd1f1aaca4 --- /dev/null +++ b/node/node_modules/npm/node_modules/http-cache-semantics/LICENSE @@ -0,0 +1,9 @@ +Copyright 2016-2018 Kornel Lesiński + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node/node_modules/npm/node_modules/http-cache-semantics/index.js b/node/node_modules/npm/node_modules/http-cache-semantics/index.js new file mode 100644 index 0000000000000000000000000000000000000000..898826eb18c55e13d03f74e0b580fdaf2fb4c9ce --- /dev/null +++ b/node/node_modules/npm/node_modules/http-cache-semantics/index.js @@ -0,0 +1,928 @@ +'use strict'; + +/** + * @typedef {Object} HttpRequest + * @property {Record} headers - Request headers + * @property {string} [method] - HTTP method + * @property {string} [url] - Request URL + */ + +/** + * @typedef {Object} HttpResponse + * @property {Record} headers - Response headers + * @property {number} [status] - HTTP status code + */ + +/** + * Set of default cacheable status codes per RFC 7231 section 6.1. + * @type {Set} + */ +const statusCodeCacheableByDefault = new Set([ + 200, + 203, + 204, + 206, + 300, + 301, + 308, + 404, + 405, + 410, + 414, + 501, +]); + +/** + * Set of HTTP status codes that the cache implementation understands. + * Note: This implementation does not understand partial responses (206). + * @type {Set} + */ +const understoodStatuses = new Set([ + 200, + 203, + 204, + 300, + 301, + 302, + 303, + 307, + 308, + 404, + 405, + 410, + 414, + 501, +]); + +/** + * Set of HTTP error status codes. + * @type {Set} + */ +const errorStatusCodes = new Set([ + 500, + 502, + 503, + 504, +]); + +/** + * Object representing hop-by-hop headers that should be removed. + * @type {Record} + */ +const hopByHopHeaders = { + date: true, // included, because we add Age update Date + connection: true, + 'keep-alive': true, + 'proxy-authenticate': true, + 'proxy-authorization': true, + te: true, + trailer: true, + 'transfer-encoding': true, + upgrade: true, +}; + +/** + * Headers that are excluded from revalidation update. + * @type {Record} + */ +const excludedFromRevalidationUpdate = { + // Since the old body is reused, it doesn't make sense to change properties of the body + 'content-length': true, + 'content-encoding': true, + 'transfer-encoding': true, + 'content-range': true, +}; + +/** + * Converts a string to a number or returns zero if the conversion fails. + * @param {string} s - The string to convert. + * @returns {number} The parsed number or 0. + */ +function toNumberOrZero(s) { + const n = parseInt(s, 10); + return isFinite(n) ? n : 0; +} + +/** + * Determines if the given response is an error response. + * Implements RFC 5861 behavior. + * @param {HttpResponse|undefined} response - The HTTP response object. + * @returns {boolean} true if the response is an error or undefined, false otherwise. + */ +function isErrorResponse(response) { + // consider undefined response as faulty + if (!response) { + return true; + } + return errorStatusCodes.has(response.status); +} + +/** + * Parses a Cache-Control header string into an object. + * @param {string} [header] - The Cache-Control header value. + * @returns {Record} An object representing Cache-Control directives. + */ +function parseCacheControl(header) { + /** @type {Record} */ + const cc = {}; + if (!header) return cc; + + // TODO: When there is more than one value present for a given directive (e.g., two Expires header fields, multiple Cache-Control: max-age directives), + // the directive's value is considered invalid. Caches are encouraged to consider responses that have invalid freshness information to be stale + const parts = header.trim().split(/,/); + for (const part of parts) { + const [k, v] = part.split(/=/, 2); + cc[k.trim()] = v === undefined ? true : v.trim().replace(/^"|"$/g, ''); + } + + return cc; +} + +/** + * Formats a Cache-Control directives object into a header string. + * @param {Record} cc - The Cache-Control directives. + * @returns {string|undefined} A formatted Cache-Control header string or undefined if empty. + */ +function formatCacheControl(cc) { + let parts = []; + for (const k in cc) { + const v = cc[k]; + parts.push(v === true ? k : k + '=' + v); + } + if (!parts.length) { + return undefined; + } + return parts.join(', '); +} + +module.exports = class CachePolicy { + /** + * Creates a new CachePolicy instance. + * @param {HttpRequest} req - Incoming client request. + * @param {HttpResponse} res - Received server response. + * @param {Object} [options={}] - Configuration options. + * @param {boolean} [options.shared=true] - Is the cache shared (a public proxy)? `false` for personal browser caches. + * @param {number} [options.cacheHeuristic=0.1] - Fallback heuristic (age fraction) for cache duration. + * @param {number} [options.immutableMinTimeToLive=86400000] - Minimum TTL for immutable responses in milliseconds. + * @param {boolean} [options.ignoreCargoCult=false] - Detect nonsense cache headers, and override them. + * @param {any} [options._fromObject] - Internal parameter for deserialization. Do not use. + */ + constructor( + req, + res, + { + shared, + cacheHeuristic, + immutableMinTimeToLive, + ignoreCargoCult, + _fromObject, + } = {} + ) { + if (_fromObject) { + this._fromObject(_fromObject); + return; + } + + if (!res || !res.headers) { + throw Error('Response headers missing'); + } + this._assertRequestHasHeaders(req); + + /** @type {number} Timestamp when the response was received */ + this._responseTime = this.now(); + /** @type {boolean} Indicates if the cache is shared */ + this._isShared = shared !== false; + /** @type {boolean} Indicates if legacy cargo cult directives should be ignored */ + this._ignoreCargoCult = !!ignoreCargoCult; + /** @type {number} Heuristic cache fraction */ + this._cacheHeuristic = + undefined !== cacheHeuristic ? cacheHeuristic : 0.1; // 10% matches IE + /** @type {number} Minimum TTL for immutable responses in ms */ + this._immutableMinTtl = + undefined !== immutableMinTimeToLive + ? immutableMinTimeToLive + : 24 * 3600 * 1000; + + /** @type {number} HTTP status code */ + this._status = 'status' in res ? res.status : 200; + /** @type {Record} Response headers */ + this._resHeaders = res.headers; + /** @type {Record} Parsed Cache-Control directives from response */ + this._rescc = parseCacheControl(res.headers['cache-control']); + /** @type {string} HTTP method (e.g., GET, POST) */ + this._method = 'method' in req ? req.method : 'GET'; + /** @type {string} Request URL */ + this._url = req.url; + /** @type {string} Host header from the request */ + this._host = req.headers.host; + /** @type {boolean} Whether the request does not include an Authorization header */ + this._noAuthorization = !req.headers.authorization; + /** @type {Record|null} Request headers used for Vary matching */ + this._reqHeaders = res.headers.vary ? req.headers : null; // Don't keep all request headers if they won't be used + /** @type {Record} Parsed Cache-Control directives from request */ + this._reqcc = parseCacheControl(req.headers['cache-control']); + + // Assume that if someone uses legacy, non-standard uncecessary options they don't understand caching, + // so there's no point stricly adhering to the blindly copy&pasted directives. + if ( + this._ignoreCargoCult && + 'pre-check' in this._rescc && + 'post-check' in this._rescc + ) { + delete this._rescc['pre-check']; + delete this._rescc['post-check']; + delete this._rescc['no-cache']; + delete this._rescc['no-store']; + delete this._rescc['must-revalidate']; + this._resHeaders = Object.assign({}, this._resHeaders, { + 'cache-control': formatCacheControl(this._rescc), + }); + delete this._resHeaders.expires; + delete this._resHeaders.pragma; + } + + // When the Cache-Control header field is not present in a request, caches MUST consider the no-cache request pragma-directive + // as having the same effect as if "Cache-Control: no-cache" were present (see Section 5.2.1). + if ( + res.headers['cache-control'] == null && + /no-cache/.test(res.headers.pragma) + ) { + this._rescc['no-cache'] = true; + } + } + + /** + * You can monkey-patch it for testing. + * @returns {number} Current time in milliseconds. + */ + now() { + return Date.now(); + } + + /** + * Determines if the response is storable in a cache. + * @returns {boolean} `false` if can never be cached. + */ + storable() { + // The "no-store" request directive indicates that a cache MUST NOT store any part of either this request or any response to it. + return !!( + !this._reqcc['no-store'] && + // A cache MUST NOT store a response to any request, unless: + // The request method is understood by the cache and defined as being cacheable, and + ('GET' === this._method || + 'HEAD' === this._method || + ('POST' === this._method && this._hasExplicitExpiration())) && + // the response status code is understood by the cache, and + understoodStatuses.has(this._status) && + // the "no-store" cache directive does not appear in request or response header fields, and + !this._rescc['no-store'] && + // the "private" response directive does not appear in the response, if the cache is shared, and + (!this._isShared || !this._rescc.private) && + // the Authorization header field does not appear in the request, if the cache is shared, + (!this._isShared || + this._noAuthorization || + this._allowsStoringAuthenticated()) && + // the response either: + // contains an Expires header field, or + (this._resHeaders.expires || + // contains a max-age response directive, or + // contains a s-maxage response directive and the cache is shared, or + // contains a public response directive. + this._rescc['max-age'] || + (this._isShared && this._rescc['s-maxage']) || + this._rescc.public || + // has a status code that is defined as cacheable by default + statusCodeCacheableByDefault.has(this._status)) + ); + } + + /** + * @returns {boolean} true if expiration is explicitly defined. + */ + _hasExplicitExpiration() { + // 4.2.1 Calculating Freshness Lifetime + return !!( + (this._isShared && this._rescc['s-maxage']) || + this._rescc['max-age'] || + this._resHeaders.expires + ); + } + + /** + * @param {HttpRequest} req - a request + * @throws {Error} if the headers are missing. + */ + _assertRequestHasHeaders(req) { + if (!req || !req.headers) { + throw Error('Request headers missing'); + } + } + + /** + * Checks if the request matches the cache and can be satisfied from the cache immediately, + * without having to make a request to the server. + * + * This doesn't support `stale-while-revalidate`. See `evaluateRequest()` for a more complete solution. + * + * @param {HttpRequest} req - The new incoming HTTP request. + * @returns {boolean} `true`` if the cached response used to construct this cache policy satisfies the request without revalidation. + */ + satisfiesWithoutRevalidation(req) { + const result = this.evaluateRequest(req); + return !result.revalidation; + } + + /** + * @param {{headers: Record, synchronous: boolean}|undefined} revalidation - Revalidation information, if any. + * @returns {{response: {headers: Record}, revalidation: {headers: Record, synchronous: boolean}|undefined}} An object with a cached response headers and revalidation info. + */ + _evaluateRequestHitResult(revalidation) { + return { + response: { + headers: this.responseHeaders(), + }, + revalidation, + }; + } + + /** + * @param {HttpRequest} request - new incoming + * @param {boolean} synchronous - whether revalidation must be synchronous (not s-w-r). + * @returns {{headers: Record, synchronous: boolean}} An object with revalidation headers and a synchronous flag. + */ + _evaluateRequestRevalidation(request, synchronous) { + return { + synchronous, + headers: this.revalidationHeaders(request), + }; + } + + /** + * @param {HttpRequest} request - new incoming + * @returns {{response: undefined, revalidation: {headers: Record, synchronous: boolean}}} An object indicating no cached response and revalidation details. + */ + _evaluateRequestMissResult(request) { + return { + response: undefined, + revalidation: this._evaluateRequestRevalidation(request, true), + }; + } + + /** + * Checks if the given request matches this cache entry, and how the cache can be used to satisfy it. Returns an object with: + * + * ``` + * { + * // If defined, you must send a request to the server. + * revalidation: { + * headers: {}, // HTTP headers to use when sending the revalidation response + * // If true, you MUST wait for a response from the server before using the cache + * // If false, this is stale-while-revalidate. The cache is stale, but you can use it while you update it asynchronously. + * synchronous: bool, + * }, + * // If defined, you can use this cached response. + * response: { + * headers: {}, // Updated cached HTTP headers you must use when responding to the client + * }, + * } + * ``` + * @param {HttpRequest} req - new incoming HTTP request + * @returns {{response: {headers: Record}|undefined, revalidation: {headers: Record, synchronous: boolean}|undefined}} An object containing keys: + * - revalidation: { headers: Record, synchronous: boolean } Set if you should send this to the origin server + * - response: { headers: Record } Set if you can respond to the client with these cached headers + */ + evaluateRequest(req) { + this._assertRequestHasHeaders(req); + + // In all circumstances, a cache MUST NOT ignore the must-revalidate directive + if (this._rescc['must-revalidate']) { + return this._evaluateRequestMissResult(req); + } + + if (!this._requestMatches(req, false)) { + return this._evaluateRequestMissResult(req); + } + + // When presented with a request, a cache MUST NOT reuse a stored response, unless: + // the presented request does not contain the no-cache pragma (Section 5.4), nor the no-cache cache directive, + // unless the stored response is successfully validated (Section 4.3), and + const requestCC = parseCacheControl(req.headers['cache-control']); + + if (requestCC['no-cache'] || /no-cache/.test(req.headers.pragma)) { + return this._evaluateRequestMissResult(req); + } + + if (requestCC['max-age'] && this.age() > toNumberOrZero(requestCC['max-age'])) { + return this._evaluateRequestMissResult(req); + } + + if (requestCC['min-fresh'] && this.maxAge() - this.age() < toNumberOrZero(requestCC['min-fresh'])) { + return this._evaluateRequestMissResult(req); + } + + // the stored response is either: + // fresh, or allowed to be served stale + if (this.stale()) { + // If a value is present, then the client is willing to accept a response that has + // exceeded its freshness lifetime by no more than the specified number of seconds + const allowsStaleWithoutRevalidation = 'max-stale' in requestCC && + (true === requestCC['max-stale'] || requestCC['max-stale'] > this.age() - this.maxAge()); + + if (allowsStaleWithoutRevalidation) { + return this._evaluateRequestHitResult(undefined); + } + + if (this.useStaleWhileRevalidate()) { + return this._evaluateRequestHitResult(this._evaluateRequestRevalidation(req, false)); + } + + return this._evaluateRequestMissResult(req); + } + + return this._evaluateRequestHitResult(undefined); + } + + /** + * @param {HttpRequest} req - check if this is for the same cache entry + * @param {boolean} allowHeadMethod - allow a HEAD method to match. + * @returns {boolean} `true` if the request matches. + */ + _requestMatches(req, allowHeadMethod) { + // The presented effective request URI and that of the stored response match, and + return !!( + (!this._url || this._url === req.url) && + this._host === req.headers.host && + // the request method associated with the stored response allows it to be used for the presented request, and + (!req.method || + this._method === req.method || + (allowHeadMethod && 'HEAD' === req.method)) && + // selecting header fields nominated by the stored response (if any) match those presented, and + this._varyMatches(req) + ); + } + + /** + * Determines whether storing authenticated responses is allowed. + * @returns {boolean} `true` if allowed. + */ + _allowsStoringAuthenticated() { + // following Cache-Control response directives (Section 5.2.2) have such an effect: must-revalidate, public, and s-maxage. + return !!( + this._rescc['must-revalidate'] || + this._rescc.public || + this._rescc['s-maxage'] + ); + } + + /** + * Checks whether the Vary header in the response matches the new request. + * @param {HttpRequest} req - incoming HTTP request + * @returns {boolean} `true` if the vary headers match. + */ + _varyMatches(req) { + if (!this._resHeaders.vary) { + return true; + } + + // A Vary header field-value of "*" always fails to match + if (this._resHeaders.vary === '*') { + return false; + } + + const fields = this._resHeaders.vary + .trim() + .toLowerCase() + .split(/\s*,\s*/); + for (const name of fields) { + if (req.headers[name] !== this._reqHeaders[name]) return false; + } + return true; + } + + /** + * Creates a copy of the given headers without any hop-by-hop headers. + * @param {Record} inHeaders - old headers from the cached response + * @returns {Record} A new headers object without hop-by-hop headers. + */ + _copyWithoutHopByHopHeaders(inHeaders) { + /** @type {Record} */ + const headers = {}; + for (const name in inHeaders) { + if (hopByHopHeaders[name]) continue; + headers[name] = inHeaders[name]; + } + // 9.1. Connection + if (inHeaders.connection) { + const tokens = inHeaders.connection.trim().split(/\s*,\s*/); + for (const name of tokens) { + delete headers[name]; + } + } + if (headers.warning) { + const warnings = headers.warning.split(/,/).filter(warning => { + return !/^\s*1[0-9][0-9]/.test(warning); + }); + if (!warnings.length) { + delete headers.warning; + } else { + headers.warning = warnings.join(',').trim(); + } + } + return headers; + } + + /** + * Returns the response headers adjusted for serving the cached response. + * Removes hop-by-hop headers and updates the Age and Date headers. + * @returns {Record} The adjusted response headers. + */ + responseHeaders() { + const headers = this._copyWithoutHopByHopHeaders(this._resHeaders); + const age = this.age(); + + // A cache SHOULD generate 113 warning if it heuristically chose a freshness + // lifetime greater than 24 hours and the response's age is greater than 24 hours. + if ( + age > 3600 * 24 && + !this._hasExplicitExpiration() && + this.maxAge() > 3600 * 24 + ) { + headers.warning = + (headers.warning ? `${headers.warning}, ` : '') + + '113 - "rfc7234 5.5.4"'; + } + headers.age = `${Math.round(age)}`; + headers.date = new Date(this.now()).toUTCString(); + return headers; + } + + /** + * Returns the Date header value from the response or the current time if invalid. + * @returns {number} Timestamp (in milliseconds) representing the Date header or response time. + */ + date() { + const serverDate = Date.parse(this._resHeaders.date); + if (isFinite(serverDate)) { + return serverDate; + } + return this._responseTime; + } + + /** + * Value of the Age header, in seconds, updated for the current time. + * May be fractional. + * @returns {number} The age in seconds. + */ + age() { + let age = this._ageValue(); + + const residentTime = (this.now() - this._responseTime) / 1000; + return age + residentTime; + } + + /** + * @returns {number} The Age header value as a number. + */ + _ageValue() { + return toNumberOrZero(this._resHeaders.age); + } + + /** + * Possibly outdated value of applicable max-age (or heuristic equivalent) in seconds. + * This counts since response's `Date`. + * + * For an up-to-date value, see `timeToLive()`. + * + * Returns the maximum age (freshness lifetime) of the response in seconds. + * @returns {number} The max-age value in seconds. + */ + maxAge() { + if (!this.storable() || this._rescc['no-cache']) { + return 0; + } + + // Shared responses with cookies are cacheable according to the RFC, but IMHO it'd be unwise to do so by default + // so this implementation requires explicit opt-in via public header + if ( + this._isShared && + (this._resHeaders['set-cookie'] && + !this._rescc.public && + !this._rescc.immutable) + ) { + return 0; + } + + if (this._resHeaders.vary === '*') { + return 0; + } + + if (this._isShared) { + if (this._rescc['proxy-revalidate']) { + return 0; + } + // if a response includes the s-maxage directive, a shared cache recipient MUST ignore the Expires field. + if (this._rescc['s-maxage']) { + return toNumberOrZero(this._rescc['s-maxage']); + } + } + + // If a response includes a Cache-Control field with the max-age directive, a recipient MUST ignore the Expires field. + if (this._rescc['max-age']) { + return toNumberOrZero(this._rescc['max-age']); + } + + const defaultMinTtl = this._rescc.immutable ? this._immutableMinTtl : 0; + + const serverDate = this.date(); + if (this._resHeaders.expires) { + const expires = Date.parse(this._resHeaders.expires); + // A cache recipient MUST interpret invalid date formats, especially the value "0", as representing a time in the past (i.e., "already expired"). + if (Number.isNaN(expires) || expires < serverDate) { + return 0; + } + return Math.max(defaultMinTtl, (expires - serverDate) / 1000); + } + + if (this._resHeaders['last-modified']) { + const lastModified = Date.parse(this._resHeaders['last-modified']); + if (isFinite(lastModified) && serverDate > lastModified) { + return Math.max( + defaultMinTtl, + ((serverDate - lastModified) / 1000) * this._cacheHeuristic + ); + } + } + + return defaultMinTtl; + } + + /** + * Remaining time this cache entry may be useful for, in *milliseconds*. + * You can use this as an expiration time for your cache storage. + * + * Prefer this method over `maxAge()`, because it includes other factors like `age` and `stale-while-revalidate`. + * @returns {number} Time-to-live in milliseconds. + */ + timeToLive() { + const age = this.maxAge() - this.age(); + const staleIfErrorAge = age + toNumberOrZero(this._rescc['stale-if-error']); + const staleWhileRevalidateAge = age + toNumberOrZero(this._rescc['stale-while-revalidate']); + return Math.round(Math.max(0, age, staleIfErrorAge, staleWhileRevalidateAge) * 1000); + } + + /** + * If true, this cache entry is past its expiration date. + * Note that stale cache may be useful sometimes, see `evaluateRequest()`. + * @returns {boolean} `false` doesn't mean it's fresh nor usable + */ + stale() { + return this.maxAge() <= this.age(); + } + + /** + * @returns {boolean} `true` if `stale-if-error` condition allows use of a stale response. + */ + _useStaleIfError() { + return this.maxAge() + toNumberOrZero(this._rescc['stale-if-error']) > this.age(); + } + + /** See `evaluateRequest()` for a more complete solution + * @returns {boolean} `true` if `stale-while-revalidate` is currently allowed. + */ + useStaleWhileRevalidate() { + const swr = toNumberOrZero(this._rescc['stale-while-revalidate']); + return swr > 0 && this.maxAge() + swr > this.age(); + } + + /** + * Creates a `CachePolicy` instance from a serialized object. + * @param {Object} obj - The serialized object. + * @returns {CachePolicy} A new CachePolicy instance. + */ + static fromObject(obj) { + return new this(undefined, undefined, { _fromObject: obj }); + } + + /** + * @param {any} obj - The serialized object. + * @throws {Error} If already initialized or if the object is invalid. + */ + _fromObject(obj) { + if (this._responseTime) throw Error('Reinitialized'); + if (!obj || obj.v !== 1) throw Error('Invalid serialization'); + + this._responseTime = obj.t; + this._isShared = obj.sh; + this._cacheHeuristic = obj.ch; + this._immutableMinTtl = + obj.imm !== undefined ? obj.imm : 24 * 3600 * 1000; + this._ignoreCargoCult = !!obj.icc; + this._status = obj.st; + this._resHeaders = obj.resh; + this._rescc = obj.rescc; + this._method = obj.m; + this._url = obj.u; + this._host = obj.h; + this._noAuthorization = obj.a; + this._reqHeaders = obj.reqh; + this._reqcc = obj.reqcc; + } + + /** + * Serializes the `CachePolicy` instance into a JSON-serializable object. + * @returns {Object} The serialized object. + */ + toObject() { + return { + v: 1, + t: this._responseTime, + sh: this._isShared, + ch: this._cacheHeuristic, + imm: this._immutableMinTtl, + icc: this._ignoreCargoCult, + st: this._status, + resh: this._resHeaders, + rescc: this._rescc, + m: this._method, + u: this._url, + h: this._host, + a: this._noAuthorization, + reqh: this._reqHeaders, + reqcc: this._reqcc, + }; + } + + /** + * Headers for sending to the origin server to revalidate stale response. + * Allows server to return 304 to allow reuse of the previous response. + * + * Hop by hop headers are always stripped. + * Revalidation headers may be added or removed, depending on request. + * @param {HttpRequest} incomingReq - The incoming HTTP request. + * @returns {Record} The headers for the revalidation request. + */ + revalidationHeaders(incomingReq) { + this._assertRequestHasHeaders(incomingReq); + const headers = this._copyWithoutHopByHopHeaders(incomingReq.headers); + + // This implementation does not understand range requests + delete headers['if-range']; + + if (!this._requestMatches(incomingReq, true) || !this.storable()) { + // revalidation allowed via HEAD + // not for the same resource, or wasn't allowed to be cached anyway + delete headers['if-none-match']; + delete headers['if-modified-since']; + return headers; + } + + /* MUST send that entity-tag in any cache validation request (using If-Match or If-None-Match) if an entity-tag has been provided by the origin server. */ + if (this._resHeaders.etag) { + headers['if-none-match'] = headers['if-none-match'] + ? `${headers['if-none-match']}, ${this._resHeaders.etag}` + : this._resHeaders.etag; + } + + // Clients MAY issue simple (non-subrange) GET requests with either weak validators or strong validators. Clients MUST NOT use weak validators in other forms of request. + const forbidsWeakValidators = + headers['accept-ranges'] || + headers['if-match'] || + headers['if-unmodified-since'] || + (this._method && this._method != 'GET'); + + /* SHOULD send the Last-Modified value in non-subrange cache validation requests (using If-Modified-Since) if only a Last-Modified value has been provided by the origin server. + Note: This implementation does not understand partial responses (206) */ + if (forbidsWeakValidators) { + delete headers['if-modified-since']; + + if (headers['if-none-match']) { + const etags = headers['if-none-match'] + .split(/,/) + .filter(etag => { + return !/^\s*W\//.test(etag); + }); + if (!etags.length) { + delete headers['if-none-match']; + } else { + headers['if-none-match'] = etags.join(',').trim(); + } + } + } else if ( + this._resHeaders['last-modified'] && + !headers['if-modified-since'] + ) { + headers['if-modified-since'] = this._resHeaders['last-modified']; + } + + return headers; + } + + /** + * Creates new CachePolicy with information combined from the previews response, + * and the new revalidation response. + * + * Returns {policy, modified} where modified is a boolean indicating + * whether the response body has been modified, and old cached body can't be used. + * + * @param {HttpRequest} request - The latest HTTP request asking for the cached entry. + * @param {HttpResponse} response - The latest revalidation HTTP response from the origin server. + * @returns {{policy: CachePolicy, modified: boolean, matches: boolean}} The updated policy and modification status. + * @throws {Error} If the response headers are missing. + */ + revalidatedPolicy(request, response) { + this._assertRequestHasHeaders(request); + + if (this._useStaleIfError() && isErrorResponse(response)) { + return { + policy: this, + modified: false, + matches: true, + }; + } + + if (!response || !response.headers) { + throw Error('Response headers missing'); + } + + // These aren't going to be supported exactly, since one CachePolicy object + // doesn't know about all the other cached objects. + let matches = false; + if (response.status !== undefined && response.status != 304) { + matches = false; + } else if ( + response.headers.etag && + !/^\s*W\//.test(response.headers.etag) + ) { + // "All of the stored responses with the same strong validator are selected. + // If none of the stored responses contain the same strong validator, + // then the cache MUST NOT use the new response to update any stored responses." + matches = + this._resHeaders.etag && + this._resHeaders.etag.replace(/^\s*W\//, '') === + response.headers.etag; + } else if (this._resHeaders.etag && response.headers.etag) { + // "If the new response contains a weak validator and that validator corresponds + // to one of the cache's stored responses, + // then the most recent of those matching stored responses is selected for update." + matches = + this._resHeaders.etag.replace(/^\s*W\//, '') === + response.headers.etag.replace(/^\s*W\//, ''); + } else if (this._resHeaders['last-modified']) { + matches = + this._resHeaders['last-modified'] === + response.headers['last-modified']; + } else { + // If the new response does not include any form of validator (such as in the case where + // a client generates an If-Modified-Since request from a source other than the Last-Modified + // response header field), and there is only one stored response, and that stored response also + // lacks a validator, then that stored response is selected for update. + if ( + !this._resHeaders.etag && + !this._resHeaders['last-modified'] && + !response.headers.etag && + !response.headers['last-modified'] + ) { + matches = true; + } + } + + const optionsCopy = { + shared: this._isShared, + cacheHeuristic: this._cacheHeuristic, + immutableMinTimeToLive: this._immutableMinTtl, + ignoreCargoCult: this._ignoreCargoCult, + }; + + if (!matches) { + return { + policy: new this.constructor(request, response, optionsCopy), + // Client receiving 304 without body, even if it's invalid/mismatched has no option + // but to reuse a cached body. We don't have a good way to tell clients to do + // error recovery in such case. + modified: response.status != 304, + matches: false, + }; + } + + // use other header fields provided in the 304 (Not Modified) response to replace all instances + // of the corresponding header fields in the stored response. + const headers = {}; + for (const k in this._resHeaders) { + headers[k] = + k in response.headers && !excludedFromRevalidationUpdate[k] + ? response.headers[k] + : this._resHeaders[k]; + } + + const newResponse = Object.assign({}, response, { + status: this._status, + method: this._method, + headers, + }); + return { + policy: new this.constructor(request, newResponse, optionsCopy), + modified: false, + matches: true, + }; + } +}; diff --git a/node/node_modules/npm/node_modules/http-cache-semantics/package.json b/node/node_modules/npm/node_modules/http-cache-semantics/package.json new file mode 100644 index 0000000000000000000000000000000000000000..4812e02e831679ac9ca05d6bd19bcdd873593ff3 --- /dev/null +++ b/node/node_modules/npm/node_modules/http-cache-semantics/package.json @@ -0,0 +1,22 @@ +{ + "name": "http-cache-semantics", + "version": "4.2.0", + "description": "Parses Cache-Control and other headers. Helps building correct HTTP caches and proxies", + "repository": { + "type": "git", + "url": "git+https://github.com/kornelski/http-cache-semantics.git" + }, + "main": "index.js", + "types": "index.js", + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js" + ], + "author": "Kornel Lesiński (https://kornel.ski/)", + "license": "BSD-2-Clause", + "devDependencies": { + "mocha": "^11.0" + } +} diff --git a/node/node_modules/npm/node_modules/http-proxy-agent/LICENSE b/node/node_modules/npm/node_modules/http-proxy-agent/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..560870310c1bdd56259b6caa64d4d2b08fcc4234 --- /dev/null +++ b/node/node_modules/npm/node_modules/http-proxy-agent/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2013 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/http-proxy-agent/package.json b/node/node_modules/npm/node_modules/http-proxy-agent/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d3e36540e30d2289d31ffa432edf3017b0677823 --- /dev/null +++ b/node/node_modules/npm/node_modules/http-proxy-agent/package.json @@ -0,0 +1,47 @@ +{ + "name": "http-proxy-agent", + "version": "7.0.2", + "description": "An HTTP(s) proxy `http.Agent` implementation for HTTP", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], + "repository": { + "type": "git", + "url": "https://github.com/TooTallNate/proxy-agents.git", + "directory": "packages/http-proxy-agent" + }, + "keywords": [ + "http", + "proxy", + "endpoint", + "agent" + ], + "author": "Nathan Rajlich (http://n8.io/)", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "devDependencies": { + "@types/debug": "^4.1.7", + "@types/jest": "^29.5.1", + "@types/node": "^14.18.45", + "async-listen": "^3.0.0", + "jest": "^29.5.0", + "ts-jest": "^29.1.0", + "typescript": "^5.0.4", + "proxy": "2.1.1", + "tsconfig": "0.0.0" + }, + "engines": { + "node": ">= 14" + }, + "scripts": { + "build": "tsc", + "test": "jest --env node --verbose --bail", + "lint": "eslint . --ext .ts", + "pack": "node ../../scripts/pack.mjs" + } +} \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/https-proxy-agent/LICENSE b/node/node_modules/npm/node_modules/https-proxy-agent/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..614e769385ba807ca65acb9f19090eb02d6548fc --- /dev/null +++ b/node/node_modules/npm/node_modules/https-proxy-agent/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2013 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/https-proxy-agent/package.json b/node/node_modules/npm/node_modules/https-proxy-agent/package.json new file mode 100644 index 0000000000000000000000000000000000000000..24ac93d5b62e9d53ae07d63aad77c69071ba9887 --- /dev/null +++ b/node/node_modules/npm/node_modules/https-proxy-agent/package.json @@ -0,0 +1,50 @@ +{ + "name": "https-proxy-agent", + "version": "7.0.6", + "description": "An HTTP(s) proxy `http.Agent` implementation for HTTPS", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], + "repository": { + "type": "git", + "url": "https://github.com/TooTallNate/proxy-agents.git", + "directory": "packages/https-proxy-agent" + }, + "keywords": [ + "https", + "proxy", + "endpoint", + "agent" + ], + "author": "Nathan Rajlich (http://n8.io/)", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "devDependencies": { + "@types/async-retry": "^1.4.5", + "@types/debug": "4", + "@types/jest": "^29.5.1", + "@types/node": "^14.18.45", + "async-listen": "^3.0.0", + "async-retry": "^1.3.3", + "jest": "^29.5.0", + "ts-jest": "^29.1.0", + "typescript": "^5.0.4", + "proxy": "2.2.0", + "tsconfig": "0.0.0" + }, + "engines": { + "node": ">= 14" + }, + "scripts": { + "build": "tsc", + "test": "jest --env node --verbose --bail test/test.ts", + "test-e2e": "jest --env node --verbose --bail test/e2e.test.ts", + "lint": "eslint --ext .ts", + "pack": "node ../../scripts/pack.mjs" + } +} \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/iconv-lite/LICENSE b/node/node_modules/npm/node_modules/iconv-lite/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..6671e6ea38be54964311262e01569fca4638eb5b --- /dev/null +++ b/node/node_modules/npm/node_modules/iconv-lite/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2011 Alexander Shtuchkin + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node/node_modules/npm/node_modules/iconv-lite/package.json b/node/node_modules/npm/node_modules/iconv-lite/package.json new file mode 100644 index 0000000000000000000000000000000000000000..7f7d51293173fbbbcece5f807e47f60384778cb0 --- /dev/null +++ b/node/node_modules/npm/node_modules/iconv-lite/package.json @@ -0,0 +1,70 @@ +{ + "name": "iconv-lite", + "description": "Convert character encodings in pure javascript.", + "version": "0.7.2", + "license": "MIT", + "keywords": [ + "iconv", + "convert", + "charset", + "icu" + ], + "author": "Alexander Shtuchkin ", + "main": "./lib/index.js", + "typings": "./lib/index.d.ts", + "homepage": "https://github.com/pillarjs/iconv-lite", + "bugs": "https://github.com/pillarjs/iconv-lite/issues", + "files": [ + "lib/", + "encodings/", + "types/" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "repository": { + "type": "git", + "url": "https://github.com/pillarjs/iconv-lite.git" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "lint": "eslint", + "lint:fix": "eslint --fix", + "test": "mocha --reporter spec --check-leaks --grep .", + "test:ci": "nyc --exclude test --reporter=lcovonly --reporter=text npm test", + "test:cov": "nyc --exclude test --reporter=html --reporter=text npm test", + "test:performance": "node --allow-natives-syntax performance/index.js", + "test:tap": "mocha --reporter tap --check-leaks --grep .", + "test:typescript": "tsc && attw --pack", + "test:webpack": "npm pack && mv iconv-lite-*.tgz test/webpack/iconv-lite.tgz && cd test/webpack && npm install && npm run test && rm iconv-lite.tgz", + "typegen": "node generation/gen-typings.js" + }, + "browser": { + "stream": false + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.4", + "@stylistic/eslint-plugin": "^5.1.0", + "@stylistic/eslint-plugin-js": "^4.1.0", + "@types/node": "^24.0.12", + "async": "^3.2.0", + "bench-node": "^0.10.0", + "eslint": "^9.0.0", + "errto": "^0.2.1", + "expect-type": "^1.2.0", + "iconv": "^2.3.5", + "mocha": "^6.2.2", + "neostandard": "^0.12.0", + "nyc": "^14.1.1", + "request": "^2.88.2", + "semver": "^6.3.0", + "typescript": "~5.9.2", + "unorm": "^1.6.0" + }, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } +} diff --git a/node/node_modules/npm/node_modules/ignore-walk/LICENSE b/node/node_modules/npm/node_modules/ignore-walk/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..32eb517086ebb24cfe3dd076033211d444186dc9 --- /dev/null +++ b/node/node_modules/npm/node_modules/ignore-walk/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/ignore-walk/package.json b/node/node_modules/npm/node_modules/ignore-walk/package.json new file mode 100644 index 0000000000000000000000000000000000000000..ce3e0f2fec87f505caa5a370920dd9476a0aeaeb --- /dev/null +++ b/node/node_modules/npm/node_modules/ignore-walk/package.json @@ -0,0 +1,64 @@ +{ + "name": "ignore-walk", + "version": "8.0.0", + "description": "Nested/recursive `.gitignore`/`.npmignore` parsing and filtering.", + "main": "lib/index.js", + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.24.3", + "mutate-fs": "^2.1.1", + "tap": "^16.0.1" + }, + "scripts": { + "test": "tap", + "posttest": "npm run lint", + "lint": "npm run eslint", + "lintfix": "npm run eslint -- --fix", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "test:windows-coverage": "npm pkg set tap.statements=99 --json && npm pkg set tap.branches=98 --json && npm pkg set tap.lines=99 --json", + "snap": "tap", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "keywords": [ + "ignorefile", + "ignore", + "file", + ".gitignore", + ".npmignore", + "glob" + ], + "author": "GitHub Inc.", + "license": "ISC", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/ignore-walk.git" + }, + "files": [ + "bin/", + "lib/" + ], + "dependencies": { + "minimatch": "^10.0.3" + }, + "tap": { + "test-env": "LC_ALL=sk", + "before": "test/00-setup.js", + "after": "test/zz-cleanup.js", + "timeout": 600, + "jobs": 1, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.24.3", + "content": "scripts/template-oss", + "publish": "true" + } +} diff --git a/node/node_modules/npm/node_modules/ini/LICENSE b/node/node_modules/npm/node_modules/ini/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..32eb517086ebb24cfe3dd076033211d444186dc9 --- /dev/null +++ b/node/node_modules/npm/node_modules/ini/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/ini/package.json b/node/node_modules/npm/node_modules/ini/package.json new file mode 100644 index 0000000000000000000000000000000000000000..cde0f13889eb6dd9569f66a9546fdf7fa4333d34 --- /dev/null +++ b/node/node_modules/npm/node_modules/ini/package.json @@ -0,0 +1,45 @@ +{ + "author": "GitHub Inc.", + "name": "ini", + "description": "An ini encoder/decoder for node", + "version": "6.0.0", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/ini.git" + }, + "main": "lib/ini.js", + "scripts": { + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", + "lint": "npm run eslint", + "lintfix": "npm run eslint -- --fix", + "test": "tap", + "snap": "tap", + "posttest": "npm run lint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force" + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "tap": "^16.0.1" + }, + "license": "ISC", + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": "true" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node/node_modules/npm/node_modules/init-package-json/LICENSE.md b/node/node_modules/npm/node_modules/init-package-json/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..532491aceda0f8b35c72c60970561d89b609e862 --- /dev/null +++ b/node/node_modules/npm/node_modules/init-package-json/LICENSE.md @@ -0,0 +1,18 @@ +ISC License + +Copyright npm, Inc. + +Permission to use, copy, modify, and/or distribute this +software for any purpose with or without fee is hereby +granted, provided that the above copyright notice and this +permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO +EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/init-package-json/package.json b/node/node_modules/npm/node_modules/init-package-json/package.json new file mode 100644 index 0000000000000000000000000000000000000000..8624ec08fe1844bf84276f2e6aa15c8e3b3c0a11 --- /dev/null +++ b/node/node_modules/npm/node_modules/init-package-json/package.json @@ -0,0 +1,66 @@ +{ + "name": "init-package-json", + "version": "8.2.5", + "main": "lib/init-package-json.js", + "scripts": { + "test": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "posttest": "npm run lint", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/init-package-json.git" + }, + "author": "GitHub Inc.", + "license": "ISC", + "description": "A node module to get your node module started", + "dependencies": { + "@npmcli/package-json": "^7.0.0", + "npm-package-arg": "^13.0.0", + "promzard": "^3.0.1", + "read": "^5.0.1", + "semver": "^7.7.2", + "validate-npm-package-name": "^7.0.0" + }, + "devDependencies": { + "@npmcli/config": "^10.0.0", + "@npmcli/eslint-config": "^6.0.1", + "@npmcli/template-oss": "4.29.0", + "tap": "^16.0.1" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "tap": { + "test-ignore": "fixtures/", + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ], + "timeout": 300 + }, + "keywords": [ + "init", + "package.json", + "package", + "helper", + "wizard", + "wizerd", + "prompt", + "start" + ], + "files": [ + "bin/", + "lib/" + ], + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.29.0", + "publish": true + } +} diff --git a/node/node_modules/npm/node_modules/ip-address/LICENSE b/node/node_modules/npm/node_modules/ip-address/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..1719966f8807eee22e638ab77227cccdcbdee4c3 --- /dev/null +++ b/node/node_modules/npm/node_modules/ip-address/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2011 by Beau Gunderson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/ip-address/package.json b/node/node_modules/npm/node_modules/ip-address/package.json new file mode 100644 index 0000000000000000000000000000000000000000..08cacc1c1935cca0bb1ef924d2bf8da06eb272f1 --- /dev/null +++ b/node/node_modules/npm/node_modules/ip-address/package.json @@ -0,0 +1,78 @@ +{ + "name": "ip-address", + "description": "A library for parsing IPv4 and IPv6 IP addresses in node and the browser.", + "keywords": [ + "ipv6", + "ipv4", + "browser", + "validation" + ], + "version": "10.1.0", + "author": "Beau Gunderson (https://beaugunderson.com/)", + "license": "MIT", + "main": "dist/ip-address.js", + "types": "dist/ip-address.d.ts", + "scripts": { + "docs": "documentation build --github --output docs --format html ./ip-address.js", + "build": "rm -rf dist; mkdir dist; tsc", + "prepack": "npm run build", + "release": "release-it", + "test-ci": "nyc mocha", + "test": "mocha", + "watch": "mocha --watch" + }, + "nyc": { + "extension": [ + ".ts" + ], + "exclude": [ + "**/*.d.ts", + ".eslintrc.js", + "coverage/", + "dist/", + "test/", + "tmp/" + ], + "reporter": [ + "html", + "lcov", + "text" + ], + "all": true + }, + "engines": { + "node": ">= 12" + }, + "files": [ + "src", + "dist" + ], + "repository": { + "type": "git", + "url": "git://github.com/beaugunderson/ip-address.git" + }, + "devDependencies": { + "@types/chai": "^5.0.0", + "@types/mocha": "^10.0.8", + "@typescript-eslint/eslint-plugin": "^8.8.0", + "@typescript-eslint/parser": "^8.8.0", + "chai": "^5.1.1", + "documentation": "^14.0.3", + "eslint": "^8.50.0", + "eslint_d": "^14.0.4", + "eslint-config-airbnb": "^19.0.4", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-filenames": "^1.3.2", + "eslint-plugin-import": "^2.30.0", + "eslint-plugin-jsx-a11y": "^6.10.0", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-sort-imports-es6-autofix": "^0.6.0", + "mocha": "^10.7.3", + "nyc": "^17.1.0", + "prettier": "^3.3.3", + "release-it": "^17.6.0", + "source-map-support": "^0.5.21", + "tsx": "^4.19.1", + "typescript": "<5.6.0" + } +} diff --git a/node/node_modules/npm/node_modules/is-cidr/LICENSE b/node/node_modules/npm/node_modules/is-cidr/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..05e941baf1a4ff1a892259169f9436e461be60b5 --- /dev/null +++ b/node/node_modules/npm/node_modules/is-cidr/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) silverwind +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node/node_modules/npm/node_modules/is-cidr/package.json b/node/node_modules/npm/node_modules/is-cidr/package.json new file mode 100644 index 0000000000000000000000000000000000000000..820fdcb1ff9c79ecef968d42d22e23b813e0cb53 --- /dev/null +++ b/node/node_modules/npm/node_modules/is-cidr/package.json @@ -0,0 +1,41 @@ +{ + "name": "is-cidr", + "version": "6.0.4", + "description": "Check if a string is an IP address in CIDR notation", + "author": "silverwind ", + "contributors": [ + "Felipe Apostol (http://flipjs.io/)" + ], + "repository": "silverwind/is-cidr", + "license": "BSD-2-Clause", + "type": "module", + "sideEffects": false, + "main": "./dist/index.js", + "exports": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], + "engines": { + "node": ">=20" + }, + "dependencies": { + "cidr-regex": "^5.0.4" + }, + "devDependencies": { + "@types/node": "25.6.0", + "@typescript/native-preview": "7.0.0-dev.20260420.1", + "eslint": "10.2.1", + "eslint-config-silverwind": "131.0.5", + "jest-extended": "7.0.0", + "tsdown": "0.21.9", + "tsdown-config-silverwind": "2.1.0", + "typescript": "6.0.3", + "typescript-config-silverwind": "18.0.0", + "updates": "17.15.5", + "updates-config-silverwind": "2.1.0", + "versions": "15.0.0", + "vitest": "4.1.4", + "vitest-config-silverwind": "11.3.0" + } +} \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/isexe/LICENSE.md b/node/node_modules/npm/node_modules/isexe/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..3da8747dc3a48e2da66615e4116cefcfde495d7c --- /dev/null +++ b/node/node_modules/npm/node_modules/isexe/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** diff --git a/node/node_modules/npm/node_modules/isexe/package.json b/node/node_modules/npm/node_modules/isexe/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3fae3b2aba8b6d228976dedfb6cf9e057da18a7f --- /dev/null +++ b/node/node_modules/npm/node_modules/isexe/package.json @@ -0,0 +1,78 @@ +{ + "name": "isexe", + "version": "4.0.0", + "description": "Minimal module to check if a file is executable.", + "main": "./dist/commonjs/index.min.js", + "module": "./dist/esm/index.min.js", + "types": "./dist/commonjs/index.d.ts", + "files": [ + "dist" + ], + "tshy": { + "selfLink": false, + "exports": { + "./raw": "./src/index.ts", + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + } + }, + "exports": { + "./raw": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + }, + "devDependencies": { + "@types/node": "^25.2.1", + "esbuild": "^0.27.3", + "prettier": "^3.8.1", + "tap": "^21.5.1", + "tshy": "^3.1.3", + "typedoc": "^0.28.16" + }, + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy && bash build.sh", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write .", + "typedoc": "typedoc" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "BlueOak-1.0.0", + "repository": "https://github.com/isaacs/isexe", + "engines": { + "node": ">=20" + }, + "type": "module" +} diff --git a/node/node_modules/npm/node_modules/json-parse-even-better-errors/LICENSE.md b/node/node_modules/npm/node_modules/json-parse-even-better-errors/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..6464b9ff2b2519d7e6417f1564b3033ef86d3474 --- /dev/null +++ b/node/node_modules/npm/node_modules/json-parse-even-better-errors/LICENSE.md @@ -0,0 +1,25 @@ +Copyright 2017 Kat Marchán +Copyright npm, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +--- + +This library is a fork of 'better-json-errors' by Kat Marchán, extended and +distributed under the terms of the MIT license above. diff --git a/node/node_modules/npm/node_modules/json-parse-even-better-errors/package.json b/node/node_modules/npm/node_modules/json-parse-even-better-errors/package.json new file mode 100644 index 0000000000000000000000000000000000000000..6a48d1f2083c23df68d28d343ba2355f8d7d2f7b --- /dev/null +++ b/node/node_modules/npm/node_modules/json-parse-even-better-errors/package.json @@ -0,0 +1,50 @@ +{ + "name": "json-parse-even-better-errors", + "version": "5.0.0", + "description": "JSON.parse with context information on error", + "main": "lib/index.js", + "files": [ + "bin/", + "lib/" + ], + "scripts": { + "test": "tap", + "snap": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/json-parse-even-better-errors.git" + }, + "keywords": [ + "JSON", + "parser" + ], + "author": "GitHub Inc.", + "license": "MIT", + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "tap": "^16.3.0" + }, + "tap": { + "check-coverage": true, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": true + } +} diff --git a/node/node_modules/npm/node_modules/json-stringify-nice/LICENSE b/node/node_modules/npm/node_modules/json-stringify-nice/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..32eb517086ebb24cfe3dd076033211d444186dc9 --- /dev/null +++ b/node/node_modules/npm/node_modules/json-stringify-nice/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/json-stringify-nice/index.js b/node/node_modules/npm/node_modules/json-stringify-nice/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6beff678d4f774c47c70c439b00cacc3ed268cd7 --- /dev/null +++ b/node/node_modules/npm/node_modules/json-stringify-nice/index.js @@ -0,0 +1,38 @@ +const isObj = val => !!val && !Array.isArray(val) && typeof val === 'object' + +const compare = (ak, bk, prefKeys) => + prefKeys.includes(ak) && !prefKeys.includes(bk) ? -1 + : prefKeys.includes(bk) && !prefKeys.includes(ak) ? 1 + : prefKeys.includes(ak) && prefKeys.includes(bk) + ? prefKeys.indexOf(ak) - prefKeys.indexOf(bk) + : ak.localeCompare(bk, 'en') + +const sort = (replacer, seen) => (key, val) => { + const prefKeys = Array.isArray(replacer) ? replacer : [] + + if (typeof replacer === 'function') + val = replacer(key, val) + + if (!isObj(val)) + return val + + if (seen.has(val)) + return seen.get(val) + + const ret = Object.entries(val).sort( + ([ak, av], [bk, bv]) => + isObj(av) === isObj(bv) ? compare(ak, bk, prefKeys) + : isObj(av) ? 1 + : -1 + ).reduce((set, [k, v]) => { + set[k] = v + return set + }, {}) + + seen.set(val, ret) + return ret +} + +module.exports = (obj, replacer, space = 2) => + JSON.stringify(obj, sort(replacer, new Map()), space) + + (space ? '\n' : '') diff --git a/node/node_modules/npm/node_modules/json-stringify-nice/package.json b/node/node_modules/npm/node_modules/json-stringify-nice/package.json new file mode 100644 index 0000000000000000000000000000000000000000..c5e2927b565fefe71f6ae3bd410d94a9b222fbb6 --- /dev/null +++ b/node/node_modules/npm/node_modules/json-stringify-nice/package.json @@ -0,0 +1,40 @@ +{ + "name": "json-stringify-nice", + "version": "1.1.4", + "description": "Stringify an object sorting scalars before objects, and defaulting to 2-space indent", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "posttest": "npm run lint", + "snap": "tap", + "postsnap": "npm run lintfix", + "eslint": "eslint", + "lint": "npm run eslint -- index.js test/**/*.js", + "lintfix": "npm run lint -- --fix", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "tap": { + "test-env": [ + "LC_ALL=sk" + ], + "check-coverage": true + }, + "devDependencies": { + "eslint": "^7.25.0", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.1.0", + "eslint-plugin-standard": "^5.0.0", + "tap": "^15.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "repository": "https://github.com/isaacs/json-stringify-nice", + "files": [ + "index.js" + ] +} diff --git a/node/node_modules/npm/node_modules/jsonparse/LICENSE b/node/node_modules/npm/node_modules/jsonparse/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a41899310248e31e6bd458a2f3f0a54c1a87dc78 --- /dev/null +++ b/node/node_modules/npm/node_modules/jsonparse/LICENSE @@ -0,0 +1,24 @@ +The MIT License + +Copyright (c) 2012 Tim Caswell + +Permission is hereby granted, free of charge, +to any person obtaining a copy of this software and +associated documentation files (the "Software"), to +deal in the Software without restriction, including +without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom +the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/jsonparse/bench.js b/node/node_modules/npm/node_modules/jsonparse/bench.js new file mode 100644 index 0000000000000000000000000000000000000000..0a91b09292663258530dce6ac5fea6429ba62406 --- /dev/null +++ b/node/node_modules/npm/node_modules/jsonparse/bench.js @@ -0,0 +1,26 @@ +var fs = require('fs'), + Parser = require('./jsonparse'); + + +var json = fs.readFileSync("samplejson/basic.json"); + + +while (true) { + var start = Date.now(); + for (var i = 0; i < 1000; i++) { + JSON.parse(json); + } + var first = Date.now() - start; + + start = Date.now(); + var p = new Parser(); + for (var i = 0; i < 1000; i++) { + p.write(json); + } + var second = Date.now() - start; + + + console.log("JSON.parse took %s", first); + console.log("streaming parser took %s", second); + console.log("streaming is %s times slower", second / first); +} diff --git a/node/node_modules/npm/node_modules/jsonparse/jsonparse.js b/node/node_modules/npm/node_modules/jsonparse/jsonparse.js new file mode 100644 index 0000000000000000000000000000000000000000..0b6de943c3e15dea9c0afc031107dfd9c47a322f --- /dev/null +++ b/node/node_modules/npm/node_modules/jsonparse/jsonparse.js @@ -0,0 +1,413 @@ +/*global Buffer*/ +// Named constants with unique integer values +var C = {}; +// Tokens +var LEFT_BRACE = C.LEFT_BRACE = 0x1; +var RIGHT_BRACE = C.RIGHT_BRACE = 0x2; +var LEFT_BRACKET = C.LEFT_BRACKET = 0x3; +var RIGHT_BRACKET = C.RIGHT_BRACKET = 0x4; +var COLON = C.COLON = 0x5; +var COMMA = C.COMMA = 0x6; +var TRUE = C.TRUE = 0x7; +var FALSE = C.FALSE = 0x8; +var NULL = C.NULL = 0x9; +var STRING = C.STRING = 0xa; +var NUMBER = C.NUMBER = 0xb; +// Tokenizer States +var START = C.START = 0x11; +var STOP = C.STOP = 0x12; +var TRUE1 = C.TRUE1 = 0x21; +var TRUE2 = C.TRUE2 = 0x22; +var TRUE3 = C.TRUE3 = 0x23; +var FALSE1 = C.FALSE1 = 0x31; +var FALSE2 = C.FALSE2 = 0x32; +var FALSE3 = C.FALSE3 = 0x33; +var FALSE4 = C.FALSE4 = 0x34; +var NULL1 = C.NULL1 = 0x41; +var NULL2 = C.NULL2 = 0x42; +var NULL3 = C.NULL3 = 0x43; +var NUMBER1 = C.NUMBER1 = 0x51; +var NUMBER3 = C.NUMBER3 = 0x53; +var STRING1 = C.STRING1 = 0x61; +var STRING2 = C.STRING2 = 0x62; +var STRING3 = C.STRING3 = 0x63; +var STRING4 = C.STRING4 = 0x64; +var STRING5 = C.STRING5 = 0x65; +var STRING6 = C.STRING6 = 0x66; +// Parser States +var VALUE = C.VALUE = 0x71; +var KEY = C.KEY = 0x72; +// Parser Modes +var OBJECT = C.OBJECT = 0x81; +var ARRAY = C.ARRAY = 0x82; +// Character constants +var BACK_SLASH = "\\".charCodeAt(0); +var FORWARD_SLASH = "\/".charCodeAt(0); +var BACKSPACE = "\b".charCodeAt(0); +var FORM_FEED = "\f".charCodeAt(0); +var NEWLINE = "\n".charCodeAt(0); +var CARRIAGE_RETURN = "\r".charCodeAt(0); +var TAB = "\t".charCodeAt(0); + +var STRING_BUFFER_SIZE = 64 * 1024; + +function Parser() { + this.tState = START; + this.value = undefined; + + this.string = undefined; // string data + this.stringBuffer = Buffer.alloc ? Buffer.alloc(STRING_BUFFER_SIZE) : new Buffer(STRING_BUFFER_SIZE); + this.stringBufferOffset = 0; + this.unicode = undefined; // unicode escapes + this.highSurrogate = undefined; + + this.key = undefined; + this.mode = undefined; + this.stack = []; + this.state = VALUE; + this.bytes_remaining = 0; // number of bytes remaining in multi byte utf8 char to read after split boundary + this.bytes_in_sequence = 0; // bytes in multi byte utf8 char to read + this.temp_buffs = { "2": new Buffer(2), "3": new Buffer(3), "4": new Buffer(4) }; // for rebuilding chars split before boundary is reached + + // Stream offset + this.offset = -1; +} + +// Slow code to string converter (only used when throwing syntax errors) +Parser.toknam = function (code) { + var keys = Object.keys(C); + for (var i = 0, l = keys.length; i < l; i++) { + var key = keys[i]; + if (C[key] === code) { return key; } + } + return code && ("0x" + code.toString(16)); +}; + +var proto = Parser.prototype; +proto.onError = function (err) { throw err; }; +proto.charError = function (buffer, i) { + this.tState = STOP; + this.onError(new Error("Unexpected " + JSON.stringify(String.fromCharCode(buffer[i])) + " at position " + i + " in state " + Parser.toknam(this.tState))); +}; +proto.appendStringChar = function (char) { + if (this.stringBufferOffset >= STRING_BUFFER_SIZE) { + this.string += this.stringBuffer.toString('utf8'); + this.stringBufferOffset = 0; + } + + this.stringBuffer[this.stringBufferOffset++] = char; +}; +proto.appendStringBuf = function (buf, start, end) { + var size = buf.length; + if (typeof start === 'number') { + if (typeof end === 'number') { + if (end < 0) { + // adding a negative end decreeses the size + size = buf.length - start + end; + } else { + size = end - start; + } + } else { + size = buf.length - start; + } + } + + if (size < 0) { + size = 0; + } + + if (this.stringBufferOffset + size > STRING_BUFFER_SIZE) { + this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset); + this.stringBufferOffset = 0; + } + + buf.copy(this.stringBuffer, this.stringBufferOffset, start, end); + this.stringBufferOffset += size; +}; +proto.write = function (buffer) { + if (typeof buffer === "string") buffer = new Buffer(buffer); + var n; + for (var i = 0, l = buffer.length; i < l; i++) { + if (this.tState === START){ + n = buffer[i]; + this.offset++; + if(n === 0x7b){ this.onToken(LEFT_BRACE, "{"); // { + }else if(n === 0x7d){ this.onToken(RIGHT_BRACE, "}"); // } + }else if(n === 0x5b){ this.onToken(LEFT_BRACKET, "["); // [ + }else if(n === 0x5d){ this.onToken(RIGHT_BRACKET, "]"); // ] + }else if(n === 0x3a){ this.onToken(COLON, ":"); // : + }else if(n === 0x2c){ this.onToken(COMMA, ","); // , + }else if(n === 0x74){ this.tState = TRUE1; // t + }else if(n === 0x66){ this.tState = FALSE1; // f + }else if(n === 0x6e){ this.tState = NULL1; // n + }else if(n === 0x22){ // " + this.string = ""; + this.stringBufferOffset = 0; + this.tState = STRING1; + }else if(n === 0x2d){ this.string = "-"; this.tState = NUMBER1; // - + }else{ + if (n >= 0x30 && n < 0x40) { // 1-9 + this.string = String.fromCharCode(n); this.tState = NUMBER3; + } else if (n === 0x20 || n === 0x09 || n === 0x0a || n === 0x0d) { + // whitespace + } else { + return this.charError(buffer, i); + } + } + }else if (this.tState === STRING1){ // After open quote + n = buffer[i]; // get current byte from buffer + // check for carry over of a multi byte char split between data chunks + // & fill temp buffer it with start of this data chunk up to the boundary limit set in the last iteration + if (this.bytes_remaining > 0) { + for (var j = 0; j < this.bytes_remaining; j++) { + this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence - this.bytes_remaining + j] = buffer[j]; + } + + this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]); + this.bytes_in_sequence = this.bytes_remaining = 0; + i = i + j - 1; + } else if (this.bytes_remaining === 0 && n >= 128) { // else if no remainder bytes carried over, parse multi byte (>=128) chars one at a time + if (n <= 193 || n > 244) { + return this.onError(new Error("Invalid UTF-8 character at position " + i + " in state " + Parser.toknam(this.tState))); + } + if ((n >= 194) && (n <= 223)) this.bytes_in_sequence = 2; + if ((n >= 224) && (n <= 239)) this.bytes_in_sequence = 3; + if ((n >= 240) && (n <= 244)) this.bytes_in_sequence = 4; + if ((this.bytes_in_sequence + i) > buffer.length) { // if bytes needed to complete char fall outside buffer length, we have a boundary split + for (var k = 0; k <= (buffer.length - 1 - i); k++) { + this.temp_buffs[this.bytes_in_sequence][k] = buffer[i + k]; // fill temp buffer of correct size with bytes available in this chunk + } + this.bytes_remaining = (i + this.bytes_in_sequence) - buffer.length; + i = buffer.length - 1; + } else { + this.appendStringBuf(buffer, i, i + this.bytes_in_sequence); + i = i + this.bytes_in_sequence - 1; + } + } else if (n === 0x22) { + this.tState = START; + this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset); + this.stringBufferOffset = 0; + this.onToken(STRING, this.string); + this.offset += Buffer.byteLength(this.string, 'utf8') + 1; + this.string = undefined; + } + else if (n === 0x5c) { + this.tState = STRING2; + } + else if (n >= 0x20) { this.appendStringChar(n); } + else { + return this.charError(buffer, i); + } + }else if (this.tState === STRING2){ // After backslash + n = buffer[i]; + if(n === 0x22){ this.appendStringChar(n); this.tState = STRING1; + }else if(n === 0x5c){ this.appendStringChar(BACK_SLASH); this.tState = STRING1; + }else if(n === 0x2f){ this.appendStringChar(FORWARD_SLASH); this.tState = STRING1; + }else if(n === 0x62){ this.appendStringChar(BACKSPACE); this.tState = STRING1; + }else if(n === 0x66){ this.appendStringChar(FORM_FEED); this.tState = STRING1; + }else if(n === 0x6e){ this.appendStringChar(NEWLINE); this.tState = STRING1; + }else if(n === 0x72){ this.appendStringChar(CARRIAGE_RETURN); this.tState = STRING1; + }else if(n === 0x74){ this.appendStringChar(TAB); this.tState = STRING1; + }else if(n === 0x75){ this.unicode = ""; this.tState = STRING3; + }else{ + return this.charError(buffer, i); + } + }else if (this.tState === STRING3 || this.tState === STRING4 || this.tState === STRING5 || this.tState === STRING6){ // unicode hex codes + n = buffer[i]; + // 0-9 A-F a-f + if ((n >= 0x30 && n < 0x40) || (n > 0x40 && n <= 0x46) || (n > 0x60 && n <= 0x66)) { + this.unicode += String.fromCharCode(n); + if (this.tState++ === STRING6) { + var intVal = parseInt(this.unicode, 16); + this.unicode = undefined; + if (this.highSurrogate !== undefined && intVal >= 0xDC00 && intVal < (0xDFFF + 1)) { //<56320,57343> - lowSurrogate + this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate, intVal))); + this.highSurrogate = undefined; + } else if (this.highSurrogate === undefined && intVal >= 0xD800 && intVal < (0xDBFF + 1)) { //<55296,56319> - highSurrogate + this.highSurrogate = intVal; + } else { + if (this.highSurrogate !== undefined) { + this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate))); + this.highSurrogate = undefined; + } + this.appendStringBuf(new Buffer(String.fromCharCode(intVal))); + } + this.tState = STRING1; + } + } else { + return this.charError(buffer, i); + } + } else if (this.tState === NUMBER1 || this.tState === NUMBER3) { + n = buffer[i]; + + switch (n) { + case 0x30: // 0 + case 0x31: // 1 + case 0x32: // 2 + case 0x33: // 3 + case 0x34: // 4 + case 0x35: // 5 + case 0x36: // 6 + case 0x37: // 7 + case 0x38: // 8 + case 0x39: // 9 + case 0x2e: // . + case 0x65: // e + case 0x45: // E + case 0x2b: // + + case 0x2d: // - + this.string += String.fromCharCode(n); + this.tState = NUMBER3; + break; + default: + this.tState = START; + var result = Number(this.string); + + if (isNaN(result)){ + return this.charError(buffer, i); + } + + if ((this.string.match(/[0-9]+/) == this.string) && (result.toString() != this.string)) { + // Long string of digits which is an ID string and not valid and/or safe JavaScript integer Number + this.onToken(STRING, this.string); + } else { + this.onToken(NUMBER, result); + } + + this.offset += this.string.length - 1; + this.string = undefined; + i--; + break; + } + }else if (this.tState === TRUE1){ // r + if (buffer[i] === 0x72) { this.tState = TRUE2; } + else { return this.charError(buffer, i); } + }else if (this.tState === TRUE2){ // u + if (buffer[i] === 0x75) { this.tState = TRUE3; } + else { return this.charError(buffer, i); } + }else if (this.tState === TRUE3){ // e + if (buffer[i] === 0x65) { this.tState = START; this.onToken(TRUE, true); this.offset+= 3; } + else { return this.charError(buffer, i); } + }else if (this.tState === FALSE1){ // a + if (buffer[i] === 0x61) { this.tState = FALSE2; } + else { return this.charError(buffer, i); } + }else if (this.tState === FALSE2){ // l + if (buffer[i] === 0x6c) { this.tState = FALSE3; } + else { return this.charError(buffer, i); } + }else if (this.tState === FALSE3){ // s + if (buffer[i] === 0x73) { this.tState = FALSE4; } + else { return this.charError(buffer, i); } + }else if (this.tState === FALSE4){ // e + if (buffer[i] === 0x65) { this.tState = START; this.onToken(FALSE, false); this.offset+= 4; } + else { return this.charError(buffer, i); } + }else if (this.tState === NULL1){ // u + if (buffer[i] === 0x75) { this.tState = NULL2; } + else { return this.charError(buffer, i); } + }else if (this.tState === NULL2){ // l + if (buffer[i] === 0x6c) { this.tState = NULL3; } + else { return this.charError(buffer, i); } + }else if (this.tState === NULL3){ // l + if (buffer[i] === 0x6c) { this.tState = START; this.onToken(NULL, null); this.offset += 3; } + else { return this.charError(buffer, i); } + } + } +}; +proto.onToken = function (token, value) { + // Override this to get events +}; + +proto.parseError = function (token, value) { + this.tState = STOP; + this.onError(new Error("Unexpected " + Parser.toknam(token) + (value ? ("(" + JSON.stringify(value) + ")") : "") + " in state " + Parser.toknam(this.state))); +}; +proto.push = function () { + this.stack.push({value: this.value, key: this.key, mode: this.mode}); +}; +proto.pop = function () { + var value = this.value; + var parent = this.stack.pop(); + this.value = parent.value; + this.key = parent.key; + this.mode = parent.mode; + this.emit(value); + if (!this.mode) { this.state = VALUE; } +}; +proto.emit = function (value) { + if (this.mode) { this.state = COMMA; } + this.onValue(value); +}; +proto.onValue = function (value) { + // Override me +}; +proto.onToken = function (token, value) { + if(this.state === VALUE){ + if(token === STRING || token === NUMBER || token === TRUE || token === FALSE || token === NULL){ + if (this.value) { + this.value[this.key] = value; + } + this.emit(value); + }else if(token === LEFT_BRACE){ + this.push(); + if (this.value) { + this.value = this.value[this.key] = {}; + } else { + this.value = {}; + } + this.key = undefined; + this.state = KEY; + this.mode = OBJECT; + }else if(token === LEFT_BRACKET){ + this.push(); + if (this.value) { + this.value = this.value[this.key] = []; + } else { + this.value = []; + } + this.key = 0; + this.mode = ARRAY; + this.state = VALUE; + }else if(token === RIGHT_BRACE){ + if (this.mode === OBJECT) { + this.pop(); + } else { + return this.parseError(token, value); + } + }else if(token === RIGHT_BRACKET){ + if (this.mode === ARRAY) { + this.pop(); + } else { + return this.parseError(token, value); + } + }else{ + return this.parseError(token, value); + } + }else if(this.state === KEY){ + if (token === STRING) { + this.key = value; + this.state = COLON; + } else if (token === RIGHT_BRACE) { + this.pop(); + } else { + return this.parseError(token, value); + } + }else if(this.state === COLON){ + if (token === COLON) { this.state = VALUE; } + else { return this.parseError(token, value); } + }else if(this.state === COMMA){ + if (token === COMMA) { + if (this.mode === ARRAY) { this.key++; this.state = VALUE; } + else if (this.mode === OBJECT) { this.state = KEY; } + + } else if (token === RIGHT_BRACKET && this.mode === ARRAY || token === RIGHT_BRACE && this.mode === OBJECT) { + this.pop(); + } else { + return this.parseError(token, value); + } + }else{ + return this.parseError(token, value); + } +}; + +Parser.C = C; + +module.exports = Parser; diff --git a/node/node_modules/npm/node_modules/jsonparse/package.json b/node/node_modules/npm/node_modules/jsonparse/package.json new file mode 100644 index 0000000000000000000000000000000000000000..f83fc570f5042028d9bce26b8ad76453f4c01553 --- /dev/null +++ b/node/node_modules/npm/node_modules/jsonparse/package.json @@ -0,0 +1,22 @@ +{ + "name": "jsonparse", + "description": "This is a pure-js JSON streaming parser for node.js", + "tags": ["json", "stream"], + "version": "1.3.1", + "author": "Tim Caswell ", + "repository": { + "type": "git", + "url": "http://github.com/creationix/jsonparse.git" + }, + "devDependencies": { + "tape": "~0.1.1", + "tap": "~0.3.3" + }, + "scripts": { + "test": "tap test/*.js" + }, + "bugs": "http://github.com/creationix/jsonparse/issues", + "engines": ["node >= 0.2.0"], + "license": "MIT", + "main": "jsonparse.js" +} diff --git a/node/node_modules/npm/node_modules/just-diff-apply/LICENSE b/node/node_modules/npm/node_modules/just-diff-apply/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..22d16541e9e69ff1d76022b73536d4c81e4d59b1 --- /dev/null +++ b/node/node_modules/npm/node_modules/just-diff-apply/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 angus croll + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node/node_modules/npm/node_modules/just-diff-apply/index.cjs b/node/node_modules/npm/node_modules/just-diff-apply/index.cjs new file mode 100644 index 0000000000000000000000000000000000000000..579db3ccf88983b24fd5751df6ae1a5c6dfd64ee --- /dev/null +++ b/node/node_modules/npm/node_modules/just-diff-apply/index.cjs @@ -0,0 +1,161 @@ +module.exports = { + diffApply: diffApply, + jsonPatchPathConverter: jsonPatchPathConverter, +}; + +/* + const obj1 = {a: 3, b: 5}; + diffApply(obj1, + [ + { "op": "remove", "path": ['b'] }, + { "op": "replace", "path": ['a'], "value": 4 }, + { "op": "add", "path": ['c'], "value": 5 } + ] + ); + obj1; // {a: 4, c: 5} + + // using converter to apply jsPatch standard paths + // see http://jsonpatch.com + import {diff, jsonPatchPathConverter} from 'just-diff' + const obj2 = {a: 3, b: 5}; + diffApply(obj2, [ + { "op": "remove", "path": '/b' }, + { "op": "replace", "path": '/a', "value": 4 } + { "op": "add", "path": '/c', "value": 5 } + ], jsonPatchPathConverter); + obj2; // {a: 4, c: 5} + + // arrays + const obj3 = {a: 4, b: [1, 2, 3]}; + diffApply(obj3, [ + { "op": "replace", "path": ['a'], "value": 3 } + { "op": "replace", "path": ['b', 2], "value": 4 } + { "op": "add", "path": ['b', 3], "value": 9 } + ]); + obj3; // {a: 3, b: [1, 2, 4, 9]} + + // nested paths + const obj4 = {a: 4, b: {c: 3}}; + diffApply(obj4, [ + { "op": "replace", "path": ['a'], "value": 5 } + { "op": "remove", "path": ['b', 'c']} + { "op": "add", "path": ['b', 'd'], "value": 4 } + ]); + obj4; // {a: 5, b: {d: 4}} +*/ + +var REMOVE = 'remove'; +var REPLACE = 'replace'; +var ADD = 'add'; +var MOVE = 'move'; + +function diffApply(obj, diff, pathConverter) { + if (!obj || typeof obj != 'object') { + throw new Error('base object must be an object or an array'); + } + + if (!Array.isArray(diff)) { + throw new Error('diff must be an array'); + } + + var diffLength = diff.length; + for (var i = 0; i < diffLength; i++) { + var thisDiff = diff[i]; + var subObject = obj; + var thisOp = thisDiff.op; + + var thisPath = transformPath(pathConverter, thisDiff.path); + var thisFromPath = thisDiff.from && transformPath(pathConverter, thisDiff.from); + var toPath, toPathCopy, lastToProp, subToObject, valueToMove; + + if (thisFromPath) { + // MOVE only, "fromPath" is effectively path and "path" is toPath + toPath = thisPath; + thisPath = thisFromPath; + + toPathCopy = toPath.slice(); + lastToProp = toPathCopy.pop(); + prototypeCheck(lastToProp); + if (lastToProp == null) { + return false; + } + + var thisToProp; + while (((thisToProp = toPathCopy.shift())) != null) { + prototypeCheck(thisToProp); + if (!(thisToProp in subToObject)) { + subToObject[thisToProp] = {}; + } + subToObject = subToObject[thisToProp]; + } + } + + var pathCopy = thisPath.slice(); + var lastProp = pathCopy.pop(); + prototypeCheck(lastProp); + if (lastProp == null) { + return false; + } + + var thisProp; + while (((thisProp = pathCopy.shift())) != null) { + prototypeCheck(thisProp); + if (!(thisProp in subObject)) { + subObject[thisProp] = {}; + } + subObject = subObject[thisProp]; + } + if (thisOp === REMOVE || thisOp === REPLACE || thisOp === MOVE) { + var path = thisOp === MOVE ? thisDiff.from : thisDiff.path; + if (!subObject.hasOwnProperty(lastProp)) { + throw new Error(['expected to find property', path, 'in object', obj].join(' ')); + } + } + if (thisOp === REMOVE || thisOp === MOVE) { + if (thisOp === MOVE) { + valueToMove = subObject[lastProp]; + } + Array.isArray(subObject) ? subObject.splice(lastProp, 1) : delete subObject[lastProp]; + } + if (thisOp === REPLACE || thisOp === ADD) { + subObject[lastProp] = thisDiff.value; + } + + if (thisOp === MOVE) { + subObject[lastToProp] = valueToMove; + } + } + return subObject; +} + +function transformPath(pathConverter, thisPath) { + if(pathConverter) { + thisPath = pathConverter(thisPath); + if(!Array.isArray(thisPath)) { + throw new Error([ + 'pathConverter must return an array, returned:', + thisPath, + ].join(' ')); + } + } else { + if(!Array.isArray(thisPath)) { + throw new Error([ + 'diff path', + thisPath, + 'must be an array, consider supplying a path converter'] + .join(' ')); + } + } + return thisPath; +} + +function jsonPatchPathConverter(stringPath) { + return stringPath.split('/').slice(1); +} + +function prototypeCheck(prop) { + // coercion is intentional to catch prop values like `['__proto__']` + if (prop == '__proto__' || prop == 'constructor' || prop == 'prototype') { + throw new Error('setting of prototype values not supported'); + } +} diff --git a/node/node_modules/npm/node_modules/just-diff-apply/index.mjs b/node/node_modules/npm/node_modules/just-diff-apply/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..98f3c7b8a4166019e774b14ae45c50b470bbe9dd --- /dev/null +++ b/node/node_modules/npm/node_modules/just-diff-apply/index.mjs @@ -0,0 +1,158 @@ +/* + const obj1 = {a: 3, b: 5}; + diffApply(obj1, + [ + { "op": "remove", "path": ['b'] }, + { "op": "replace", "path": ['a'], "value": 4 }, + { "op": "add", "path": ['c'], "value": 5 } + ] + ); + obj1; // {a: 4, c: 5} + + // using converter to apply jsPatch standard paths + // see http://jsonpatch.com + import {diff, jsonPatchPathConverter} from 'just-diff' + const obj2 = {a: 3, b: 5}; + diffApply(obj2, [ + { "op": "remove", "path": '/b' }, + { "op": "replace", "path": '/a', "value": 4 } + { "op": "add", "path": '/c', "value": 5 } + ], jsonPatchPathConverter); + obj2; // {a: 4, c: 5} + + // arrays + const obj3 = {a: 4, b: [1, 2, 3]}; + diffApply(obj3, [ + { "op": "replace", "path": ['a'], "value": 3 } + { "op": "replace", "path": ['b', 2], "value": 4 } + { "op": "add", "path": ['b', 3], "value": 9 } + ]); + obj3; // {a: 3, b: [1, 2, 4, 9]} + + // nested paths + const obj4 = {a: 4, b: {c: 3}}; + diffApply(obj4, [ + { "op": "replace", "path": ['a'], "value": 5 } + { "op": "remove", "path": ['b', 'c']} + { "op": "add", "path": ['b', 'd'], "value": 4 } + ]); + obj4; // {a: 5, b: {d: 4}} +*/ + +var REMOVE = 'remove'; +var REPLACE = 'replace'; +var ADD = 'add'; +var MOVE = 'move'; + +function diffApply(obj, diff, pathConverter) { + if (!obj || typeof obj != 'object') { + throw new Error('base object must be an object or an array'); + } + + if (!Array.isArray(diff)) { + throw new Error('diff must be an array'); + } + + var diffLength = diff.length; + for (var i = 0; i < diffLength; i++) { + var thisDiff = diff[i]; + var subObject = obj; + var thisOp = thisDiff.op; + + var thisPath = transformPath(pathConverter, thisDiff.path); + var thisFromPath = thisDiff.from && transformPath(pathConverter, thisDiff.from); + var toPath, toPathCopy, lastToProp, subToObject, valueToMove; + + if (thisFromPath) { + // MOVE only, "fromPath" is effectively path and "path" is toPath + toPath = thisPath; + thisPath = thisFromPath; + + toPathCopy = toPath.slice(); + lastToProp = toPathCopy.pop(); + prototypeCheck(lastToProp); + if (lastToProp == null) { + return false; + } + + var thisToProp; + while (((thisToProp = toPathCopy.shift())) != null) { + prototypeCheck(thisToProp); + if (!(thisToProp in subToObject)) { + subToObject[thisToProp] = {}; + } + subToObject = subToObject[thisToProp]; + } + } + + var pathCopy = thisPath.slice(); + var lastProp = pathCopy.pop(); + prototypeCheck(lastProp); + if (lastProp == null) { + return false; + } + + var thisProp; + while (((thisProp = pathCopy.shift())) != null) { + prototypeCheck(thisProp); + if (!(thisProp in subObject)) { + subObject[thisProp] = {}; + } + subObject = subObject[thisProp]; + } + if (thisOp === REMOVE || thisOp === REPLACE || thisOp === MOVE) { + var path = thisOp === MOVE ? thisDiff.from : thisDiff.path; + if (!subObject.hasOwnProperty(lastProp)) { + throw new Error(['expected to find property', path, 'in object', obj].join(' ')); + } + } + if (thisOp === REMOVE || thisOp === MOVE) { + if (thisOp === MOVE) { + valueToMove = subObject[lastProp]; + } + Array.isArray(subObject) ? subObject.splice(lastProp, 1) : delete subObject[lastProp]; + } + if (thisOp === REPLACE || thisOp === ADD) { + subObject[lastProp] = thisDiff.value; + } + + if (thisOp === MOVE) { + subObject[lastToProp] = valueToMove; + } + } + return subObject; +} + +function transformPath(pathConverter, thisPath) { + if(pathConverter) { + thisPath = pathConverter(thisPath); + if(!Array.isArray(thisPath)) { + throw new Error([ + 'pathConverter must return an array, returned:', + thisPath, + ].join(' ')); + } + } else { + if(!Array.isArray(thisPath)) { + throw new Error([ + 'diff path', + thisPath, + 'must be an array, consider supplying a path converter'] + .join(' ')); + } + } + return thisPath; +} + +function jsonPatchPathConverter(stringPath) { + return stringPath.split('/').slice(1); +} + +function prototypeCheck(prop) { + // coercion is intentional to catch prop values like `['__proto__']` + if (prop == '__proto__' || prop == 'constructor' || prop == 'prototype') { + throw new Error('setting of prototype values not supported'); + } +} + +export {diffApply, jsonPatchPathConverter}; diff --git a/node/node_modules/npm/node_modules/just-diff-apply/package.json b/node/node_modules/npm/node_modules/just-diff-apply/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9bfd98bdbce69da0119fadbdd7bf9297da667599 --- /dev/null +++ b/node/node_modules/npm/node_modules/just-diff-apply/package.json @@ -0,0 +1,34 @@ +{ + "name": "just-diff-apply", + "version": "5.5.0", + "description": "Apply a diff to an object. Optionally supports jsonPatch protocol", + "type": "module", + "exports": { + ".": { + "types": "./index.d.ts", + "require": "./index.cjs", + "import": "./index.mjs" + }, + "./package.json": "./package.json" + }, + "main": "index.cjs", + "types": "index.d.ts", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "build": "rollup -c" + }, + "repository": "https://github.com/angus-c/just", + "keywords": [ + "object", + "diff", + "apply", + "jsonPatch", + "no-dependencies", + "just" + ], + "author": "Angus Croll", + "license": "MIT", + "bugs": { + "url": "https://github.com/angus-c/just/issues" + } +} \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/just-diff-apply/rollup.config.js b/node/node_modules/npm/node_modules/just-diff-apply/rollup.config.js new file mode 100644 index 0000000000000000000000000000000000000000..e34e7a08d8d8b7d26b92443038217882fea975ca --- /dev/null +++ b/node/node_modules/npm/node_modules/just-diff-apply/rollup.config.js @@ -0,0 +1,3 @@ +const createRollupConfig = require('../../config/createRollupConfig'); + +module.exports = createRollupConfig(__dirname); diff --git a/node/node_modules/npm/node_modules/just-diff/LICENSE b/node/node_modules/npm/node_modules/just-diff/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..22d16541e9e69ff1d76022b73536d4c81e4d59b1 --- /dev/null +++ b/node/node_modules/npm/node_modules/just-diff/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 angus croll + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node/node_modules/npm/node_modules/just-diff/index.cjs b/node/node_modules/npm/node_modules/just-diff/index.cjs new file mode 100644 index 0000000000000000000000000000000000000000..30aad025000b9f812491a33c2fc81d44c7a601da --- /dev/null +++ b/node/node_modules/npm/node_modules/just-diff/index.cjs @@ -0,0 +1,230 @@ +module.exports = { + diff: diff, + jsonPatchPathConverter: jsonPatchPathConverter, +}; + +/* + const obj1 = {a: 4, b: 5}; + const obj2 = {a: 3, b: 5}; + const obj3 = {a: 4, c: 5}; + + diff(obj1, obj2); + [ + { "op": "replace", "path": ['a'], "value": 3 } + ] + + diff(obj2, obj3); + [ + { "op": "remove", "path": ['b'] }, + { "op": "replace", "path": ['a'], "value": 4 } + { "op": "add", "path": ['c'], "value": 5 } + ] + + // using converter to generate jsPatch standard paths + // see http://jsonpatch.com + import {diff, jsonPatchPathConverter} from 'just-diff' + diff(obj1, obj2, jsonPatchPathConverter); + [ + { "op": "replace", "path": '/a', "value": 3 } + ] + + diff(obj2, obj3, jsonPatchPathConverter); + [ + { "op": "remove", "path": '/b' }, + { "op": "replace", "path": '/a', "value": 4 } + { "op": "add", "path": '/c', "value": 5 } + ] + + // arrays + const obj4 = {a: 4, b: [1, 2, 3]}; + const obj5 = {a: 3, b: [1, 2, 4]}; + const obj6 = {a: 3, b: [1, 2, 4, 5]}; + + diff(obj4, obj5); + [ + { "op": "replace", "path": ['a'], "value": 3 } + { "op": "replace", "path": ['b', 2], "value": 4 } + ] + + diff(obj5, obj6); + [ + { "op": "add", "path": ['b', 3], "value": 5 } + ] + + // nested paths + const obj7 = {a: 4, b: {c: 3}}; + const obj8 = {a: 4, b: {c: 4}}; + const obj9 = {a: 5, b: {d: 4}}; + + diff(obj7, obj8); + [ + { "op": "replace", "path": ['b', 'c'], "value": 4 } + ] + + diff(obj8, obj9); + [ + { "op": "replace", "path": ['a'], "value": 5 } + { "op": "remove", "path": ['b', 'c']} + { "op": "add", "path": ['b', 'd'], "value": 4 } + ] +*/ + +function diff(obj1, obj2, pathConverter) { + if (!obj1 || typeof obj1 != 'object' || !obj2 || typeof obj2 != 'object') { + throw new Error('both arguments must be objects or arrays'); + } + + pathConverter || + (pathConverter = function(arr) { + return arr; + }); + + function getDiff({obj1, obj2, basePath, basePathForRemoves, diffs}) { + var obj1Keys = Object.keys(obj1); + var obj1KeysLength = obj1Keys.length; + var obj2Keys = Object.keys(obj2); + var obj2KeysLength = obj2Keys.length; + var path; + + var lengthDelta = obj1.length - obj2.length; + + if (trimFromRight(obj1, obj2)) { + for (var i = 0; i < obj1KeysLength; i++) { + var key = Array.isArray(obj1) ? Number(obj1Keys[i]) : obj1Keys[i]; + if (!(key in obj2)) { + path = basePathForRemoves.concat(key); + diffs.remove.push({ + op: 'remove', + path: pathConverter(path), + }); + } + } + + for (var i = 0; i < obj2KeysLength; i++) { + var key = Array.isArray(obj2) ? Number(obj2Keys[i]) : obj2Keys[i]; + pushReplaces({ + key, + obj1, + obj2, + path: basePath.concat(key), + pathForRemoves: basePath.concat(key), + diffs, + }); + } + } else { + // trim from left, objects are both arrays + for (var i = 0; i < lengthDelta; i++) { + path = basePathForRemoves.concat(i); + diffs.remove.push({ + op: 'remove', + path: pathConverter(path), + }); + } + + // now make a copy of obj1 with excess elements left trimmed and see if there any replaces + var obj1Trimmed = obj1.slice(lengthDelta);; + for (var i = 0; i < obj2KeysLength; i++) { + pushReplaces({ + key: i, + obj1: obj1Trimmed, + obj2, + path: basePath.concat(i), + // since list of removes are reversed before presenting result, + // we need to ignore existing parent removes when doing nested removes + pathForRemoves: basePath.concat(i + lengthDelta), + diffs, + }); + } + } + } + + var diffs = {remove: [], replace: [], add: []}; + getDiff({ + obj1, + obj2, + basePath: [], + basePathForRemoves: [], + diffs, + }); + + // reverse removes since we want to maintain indexes + return diffs.remove + .reverse() + .concat(diffs.replace) + .concat(diffs.add); + + function pushReplaces({key, obj1, obj2, path, pathForRemoves, diffs}) { + var obj1AtKey = obj1[key]; + var obj2AtKey = obj2[key]; + + if(!(key in obj1) && (key in obj2)) { + var obj2Value = obj2AtKey; + diffs.add.push({ + op: 'add', + path: pathConverter(path), + value: obj2Value, + }); + } else if(obj1AtKey !== obj2AtKey) { + if(Object(obj1AtKey) !== obj1AtKey || + Object(obj2AtKey) !== obj2AtKey || differentTypes(obj1AtKey, obj2AtKey) + ) { + pushReplace(path, diffs, obj2AtKey); + } else { + if(!Object.keys(obj1AtKey).length && + !Object.keys(obj2AtKey).length && + String(obj1AtKey) != String(obj2AtKey)) { + pushReplace(path, diffs, obj2AtKey); + } else { + getDiff({ + obj1: obj1[key], + obj2: obj2[key], + basePath: path, + basePathForRemoves: pathForRemoves, + diffs}); + } + } + } + } + + function pushReplace(path, diffs, newValue) { + diffs.replace.push({ + op: 'replace', + path: pathConverter(path), + value: newValue, + }); + } +} + +function jsonPatchPathConverter(arrayPath) { + return [''].concat(arrayPath).join('/'); +} + +function differentTypes(a, b) { + return Object.prototype.toString.call(a) != Object.prototype.toString.call(b); +} + +function trimFromRight(obj1, obj2) { + var lengthDelta = obj1.length - obj2.length; + if (Array.isArray(obj1) && Array.isArray(obj2) && lengthDelta > 0) { + var leftMatches = 0; + var rightMatches = 0; + for (var i = 0; i < obj2.length; i++) { + if (String(obj1[i]) === String(obj2[i])) { + leftMatches++; + } else { + break; + } + } + for (var j = obj2.length; j > 0; j--) { + if (String(obj1[j + lengthDelta]) === String(obj2[j])) { + rightMatches++; + } else { + break; + } + } + + // bias to trim right becase it requires less index shifting + return leftMatches >= rightMatches; + } + return true; +} diff --git a/node/node_modules/npm/node_modules/just-diff/index.mjs b/node/node_modules/npm/node_modules/just-diff/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..664adcdc1e1f21e9b4d856cb8ea08c368c92a104 --- /dev/null +++ b/node/node_modules/npm/node_modules/just-diff/index.mjs @@ -0,0 +1,227 @@ +/* + const obj1 = {a: 4, b: 5}; + const obj2 = {a: 3, b: 5}; + const obj3 = {a: 4, c: 5}; + + diff(obj1, obj2); + [ + { "op": "replace", "path": ['a'], "value": 3 } + ] + + diff(obj2, obj3); + [ + { "op": "remove", "path": ['b'] }, + { "op": "replace", "path": ['a'], "value": 4 } + { "op": "add", "path": ['c'], "value": 5 } + ] + + // using converter to generate jsPatch standard paths + // see http://jsonpatch.com + import {diff, jsonPatchPathConverter} from 'just-diff' + diff(obj1, obj2, jsonPatchPathConverter); + [ + { "op": "replace", "path": '/a', "value": 3 } + ] + + diff(obj2, obj3, jsonPatchPathConverter); + [ + { "op": "remove", "path": '/b' }, + { "op": "replace", "path": '/a', "value": 4 } + { "op": "add", "path": '/c', "value": 5 } + ] + + // arrays + const obj4 = {a: 4, b: [1, 2, 3]}; + const obj5 = {a: 3, b: [1, 2, 4]}; + const obj6 = {a: 3, b: [1, 2, 4, 5]}; + + diff(obj4, obj5); + [ + { "op": "replace", "path": ['a'], "value": 3 } + { "op": "replace", "path": ['b', 2], "value": 4 } + ] + + diff(obj5, obj6); + [ + { "op": "add", "path": ['b', 3], "value": 5 } + ] + + // nested paths + const obj7 = {a: 4, b: {c: 3}}; + const obj8 = {a: 4, b: {c: 4}}; + const obj9 = {a: 5, b: {d: 4}}; + + diff(obj7, obj8); + [ + { "op": "replace", "path": ['b', 'c'], "value": 4 } + ] + + diff(obj8, obj9); + [ + { "op": "replace", "path": ['a'], "value": 5 } + { "op": "remove", "path": ['b', 'c']} + { "op": "add", "path": ['b', 'd'], "value": 4 } + ] +*/ + +function diff(obj1, obj2, pathConverter) { + if (!obj1 || typeof obj1 != 'object' || !obj2 || typeof obj2 != 'object') { + throw new Error('both arguments must be objects or arrays'); + } + + pathConverter || + (pathConverter = function(arr) { + return arr; + }); + + function getDiff({obj1, obj2, basePath, basePathForRemoves, diffs}) { + var obj1Keys = Object.keys(obj1); + var obj1KeysLength = obj1Keys.length; + var obj2Keys = Object.keys(obj2); + var obj2KeysLength = obj2Keys.length; + var path; + + var lengthDelta = obj1.length - obj2.length; + + if (trimFromRight(obj1, obj2)) { + for (var i = 0; i < obj1KeysLength; i++) { + var key = Array.isArray(obj1) ? Number(obj1Keys[i]) : obj1Keys[i]; + if (!(key in obj2)) { + path = basePathForRemoves.concat(key); + diffs.remove.push({ + op: 'remove', + path: pathConverter(path), + }); + } + } + + for (var i = 0; i < obj2KeysLength; i++) { + var key = Array.isArray(obj2) ? Number(obj2Keys[i]) : obj2Keys[i]; + pushReplaces({ + key, + obj1, + obj2, + path: basePath.concat(key), + pathForRemoves: basePath.concat(key), + diffs, + }); + } + } else { + // trim from left, objects are both arrays + for (var i = 0; i < lengthDelta; i++) { + path = basePathForRemoves.concat(i); + diffs.remove.push({ + op: 'remove', + path: pathConverter(path), + }); + } + + // now make a copy of obj1 with excess elements left trimmed and see if there any replaces + var obj1Trimmed = obj1.slice(lengthDelta);; + for (var i = 0; i < obj2KeysLength; i++) { + pushReplaces({ + key: i, + obj1: obj1Trimmed, + obj2, + path: basePath.concat(i), + // since list of removes are reversed before presenting result, + // we need to ignore existing parent removes when doing nested removes + pathForRemoves: basePath.concat(i + lengthDelta), + diffs, + }); + } + } + } + + var diffs = {remove: [], replace: [], add: []}; + getDiff({ + obj1, + obj2, + basePath: [], + basePathForRemoves: [], + diffs, + }); + + // reverse removes since we want to maintain indexes + return diffs.remove + .reverse() + .concat(diffs.replace) + .concat(diffs.add); + + function pushReplaces({key, obj1, obj2, path, pathForRemoves, diffs}) { + var obj1AtKey = obj1[key]; + var obj2AtKey = obj2[key]; + + if(!(key in obj1) && (key in obj2)) { + var obj2Value = obj2AtKey; + diffs.add.push({ + op: 'add', + path: pathConverter(path), + value: obj2Value, + }); + } else if(obj1AtKey !== obj2AtKey) { + if(Object(obj1AtKey) !== obj1AtKey || + Object(obj2AtKey) !== obj2AtKey || differentTypes(obj1AtKey, obj2AtKey) + ) { + pushReplace(path, diffs, obj2AtKey); + } else { + if(!Object.keys(obj1AtKey).length && + !Object.keys(obj2AtKey).length && + String(obj1AtKey) != String(obj2AtKey)) { + pushReplace(path, diffs, obj2AtKey); + } else { + getDiff({ + obj1: obj1[key], + obj2: obj2[key], + basePath: path, + basePathForRemoves: pathForRemoves, + diffs}); + } + } + } + } + + function pushReplace(path, diffs, newValue) { + diffs.replace.push({ + op: 'replace', + path: pathConverter(path), + value: newValue, + }); + } +} + +function jsonPatchPathConverter(arrayPath) { + return [''].concat(arrayPath).join('/'); +} + +function differentTypes(a, b) { + return Object.prototype.toString.call(a) != Object.prototype.toString.call(b); +} + +function trimFromRight(obj1, obj2) { + var lengthDelta = obj1.length - obj2.length; + if (Array.isArray(obj1) && Array.isArray(obj2) && lengthDelta > 0) { + var leftMatches = 0; + var rightMatches = 0; + for (var i = 0; i < obj2.length; i++) { + if (String(obj1[i]) === String(obj2[i])) { + leftMatches++; + } else { + break; + } + } + for (var j = obj2.length; j > 0; j--) { + if (String(obj1[j + lengthDelta]) === String(obj2[j])) { + rightMatches++; + } else { + break; + } + } + + // bias to trim right becase it requires less index shifting + return leftMatches >= rightMatches; + } + return true; +} + +export {diff, jsonPatchPathConverter}; diff --git a/node/node_modules/npm/node_modules/just-diff/package.json b/node/node_modules/npm/node_modules/just-diff/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5f29b139395b6887a46a9ee681c118c5bbb531bc --- /dev/null +++ b/node/node_modules/npm/node_modules/just-diff/package.json @@ -0,0 +1,33 @@ +{ + "name": "just-diff", + "version": "6.0.2", + "description": "Return an object representing the diffs between two objects. Supports jsonPatch protocol", + "type": "module", + "exports": { + ".": { + "types": "./index.d.ts", + "require": "./index.cjs", + "import": "./index.mjs" + }, + "./package.json": "./package.json" + }, + "main": "index.cjs", + "types": "index.d.ts", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "build": "rollup -c" + }, + "repository": "https://github.com/angus-c/just", + "keywords": [ + "object", + "diff", + "jsonPatch", + "no-dependencies", + "just" + ], + "author": "Angus Croll", + "license": "MIT", + "bugs": { + "url": "https://github.com/angus-c/just/issues" + } +} \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/just-diff/rollup.config.js b/node/node_modules/npm/node_modules/just-diff/rollup.config.js new file mode 100644 index 0000000000000000000000000000000000000000..e34e7a08d8d8b7d26b92443038217882fea975ca --- /dev/null +++ b/node/node_modules/npm/node_modules/just-diff/rollup.config.js @@ -0,0 +1,3 @@ +const createRollupConfig = require('../../config/createRollupConfig'); + +module.exports = createRollupConfig(__dirname); diff --git a/node/node_modules/npm/node_modules/libnpmaccess/LICENSE b/node/node_modules/npm/node_modules/libnpmaccess/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9550b02fe23064a0c2e388f0c35b795480c39a6c --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmaccess/LICENSE @@ -0,0 +1,13 @@ +Copyright npm, Inc + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/libnpmaccess/README.md b/node/node_modules/npm/node_modules/libnpmaccess/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8fd60a95b576682a2a9aa786a88cd55d820c56be --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmaccess/README.md @@ -0,0 +1,93 @@ +# libnpmaccess + +[![npm version](https://img.shields.io/npm/v/libnpmaccess.svg)](https://npm.im/libnpmaccess) +[![license](https://img.shields.io/npm/l/libnpmaccess.svg)](https://npm.im/libnpmaccess) +[![CI - libnpmaccess](https://github.com/npm/cli/actions/workflows/ci-libnpmaccess.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmaccess.yml) + +[`libnpmaccess`](https://github.com/npm/libnpmaccess) is a Node.js +library that provides programmatic access to the guts of the npm CLI's `npm +access` command. This includes managing account mfa settings, listing +packages and permissions, looking at package collaborators, and defining +package permissions for users, orgs, and teams. + +## Example + +```javascript +const access = require('libnpmaccess') +const opts = { '//registry.npmjs.org/:_authToken: 'npm_token } + +// List all packages @zkat has access to on the npm registry. +console.log(Object.keys(await access.getPackages('zkat', opts))) +``` + +### API + +#### `opts` for all `libnpmaccess` commands + +`libnpmaccess` uses [`npm-registry-fetch`](https://npm.im/npm-registry-fetch). + +All options are passed through directly to that library, so please refer +to [its own `opts` +documentation](https://www.npmjs.com/package/npm-registry-fetch#fetch-options) +for options that can be passed in. + +#### `spec` parameter for all `libnpmaccess` commands + +`spec` must be an [`npm-package-arg`](https://npm.im/npm-package-arg)-compatible +registry spec. + +#### `access.getCollaborators(spec, opts) -> Promise` + +Gets collaborators for a given package + +#### `access.getPackages(user|scope|team, opts) -> Promise` + +Gets all packages for a given user, scope, or team. + +Teams should be in the format `scope:team` or `@scope:team` + +Users and scopes can be in the format `@scope` or `scope` + +#### `access.getVisibility(spec, opts) -> Promise` + +Gets the visibility of a given package + +#### `access.removePermissions(team, spec, opts) -> Promise` + +Removes the access for a given team to a package. + +Teams should be in the format `scope:team` or `@scope:team` + +#### `access.setAccess(package, access, opts) -> Promise` + +Sets access level for package described by `spec`. + +The npm registry accepts the following `access` levels: + +- `public`: package is public +- `private`: package is private + +The npm registry also only allows scoped packages to have their access +level set. + +#### access.setMfa(spec, level, opts) -> Promise` + +Sets the publishing mfa requirements for a given package. Level must be one of the +following: + +- `none`: mfa is not required to publish this package. +- `publish`: mfa is required to publish this package, automation tokens +cannot be used to publish. +- `automation`: mfa is required to publish this package, automation tokens +may also be used for publishing from continuous integration workflows. + +#### access.setPermissions(team, spec, permissions, opts) -> Promise` + +Sets permissions levels for a given team to a package. + +Teams should be in the format `scope:team` or `@scope:team` + +The npm registry accepts the following `permissions`: + +- `read-only`: Read only permissions +- `read-write`: Read and write (aka publish) permissions diff --git a/node/node_modules/npm/node_modules/libnpmaccess/package.json b/node/node_modules/npm/node_modules/libnpmaccess/package.json new file mode 100644 index 0000000000000000000000000000000000000000..8e760c885e03b1df826e6b34242241e272ed87e8 --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmaccess/package.json @@ -0,0 +1,53 @@ +{ + "name": "libnpmaccess", + "version": "10.0.3", + "description": "programmatic library for `npm access` commands", + "author": "GitHub Inc.", + "license": "ISC", + "main": "lib/index.js", + "scripts": { + "lint": "npm run eslint", + "test": "tap", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "posttest": "npm run lint", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.1", + "@npmcli/mock-registry": "^1.0.0", + "@npmcli/template-oss": "4.29.0", + "tap": "^16.3.8" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cli.git", + "directory": "workspaces/libnpmaccess" + }, + "bugs": "https://github.com/npm/libnpmaccess/issues", + "homepage": "https://npmjs.com/package/libnpmaccess", + "dependencies": { + "npm-package-arg": "^13.0.0", + "npm-registry-fetch": "^19.0.0" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "files": [ + "bin/", + "lib/" + ], + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.29.0", + "content": "../../scripts/template-oss/index.js" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node/node_modules/npm/node_modules/libnpmdiff/LICENSE b/node/node_modules/npm/node_modules/libnpmdiff/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..5cd9dc0646a18d99bf3e47e0b036b3c21c963b77 --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmdiff/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) GitHub Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/libnpmdiff/README.md b/node/node_modules/npm/node_modules/libnpmdiff/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6678bdfd5e1949208373742ec6f3f41cc2fad09c --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmdiff/README.md @@ -0,0 +1,102 @@ +# libnpmdiff + +[![npm version](https://img.shields.io/npm/v/libnpmdiff.svg)](https://npm.im/libnpmdiff) +[![license](https://img.shields.io/npm/l/libnpmdiff.svg)](https://npm.im/libnpmdiff) +[![CI - libnpmdiff](https://github.com/npm/cli/actions/workflows/ci-libnpmdiff.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmdiff.yml) +The registry diff lib. + +## Table of Contents + +* [Example](#example) +* [Install](#install) +* [Contributing](#contributing) +* [API](#api) +* [LICENSE](#license) + +## Example + +```js +const libdiff = require('libnpmdiff') + +const patch = await libdiff([ + 'abbrev@1.1.0', + 'abbrev@1.1.1' +]) +console.log( + patch +) +``` + +Returns: + +```patch +diff --git a/package.json b/package.json +index v1.1.0..v1.1.1 100644 +--- a/package.json ++++ b/package.json +@@ -1,6 +1,6 @@ + { + "name": "abbrev", +- "version": "1.1.0", ++ "version": "1.1.1", + "description": "Like ruby's abbrev module, but in js", + "author": "Isaac Z. Schlueter ", + "main": "abbrev.js", + +``` + +## Install + +`$ npm install libnpmdiff` + +### Contributing + +The npm team enthusiastically welcomes contributions and project participation! +There's a bunch of things you can do if you want to contribute! +The [Contributor Guide](https://github.com/npm/cli/blob/latest/CONTRIBUTING.md) outlines the process for community interaction and contribution. +Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear. + +All participants and maintainers in this project are expected to follow the [npm Code of Conduct](https://docs.npmjs.com/policies/conduct), and just generally be excellent to each other. + +Please refer to the [Changelog](CHANGELOG.md) for project history details, too. + +Happy hacking! + +### API + +#### `> libnpmdif([ a, b ], [opts]) -> Promise` + +Fetches the registry tarballs and compare files between a spec `a` and spec `b`. +**npm** spec types are usually described in `@` form but multiple other types are also supported, for more info on valid specs take a look at [`npm-package-arg`](https://github.com/npm/npm-package-arg). + +**Options**: + +- `color `: Should add ANSI colors to string output? + Defaults to `false`. +- `tagVersionPrefix `: What prefix should be used to define version numbers. + Defaults to `v` +- `diffUnified `: How many lines of code to print before/after each diff. + Defaults to `3`. +- `diffFiles >`: If set only prints patches for the files listed in this array (also accepts globs). + Defaults to `undefined`. +- `diffIgnoreAllSpace `: Whether or not should ignore changes in whitespace (very useful to avoid indentation changes extra diff lines). + Defaults to `false`. +- `diffNameOnly `: Prints only file names and no patch diffs. + Defaults to `false`. +- `diffNoPrefix `: If true then skips printing any prefixes in filenames. + Defaults to `false`. +- `diffSrcPrefix `: Prefix to be used in the filenames from `a`. + Defaults to `a/`. +- `diffDstPrefix `: Prefix to be used in the filenames from `b`. + Defaults to `b/`. +- `diffText `: Should treat all files as text and try to print diff for binary files. + Defaults to `false`. +- ...`cache`, `registry`, `where` and other common options accepted by [pacote](https://github.com/npm/pacote#options) + +Returns a `Promise` that fulfills with a `String` containing the resulting patch diffs. + +Throws an error if either `a` or `b` are missing or if trying to diff more than two specs. + +## LICENSE + +[ISC](./LICENSE) diff --git a/node/node_modules/npm/node_modules/libnpmdiff/package.json b/node/node_modules/npm/node_modules/libnpmdiff/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69ea47bade0b8e47dafe931d94a11532f1818dc0 --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmdiff/package.json @@ -0,0 +1,70 @@ +{ + "name": "libnpmdiff", + "version": "8.1.6", + "description": "The registry diff", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cli.git", + "directory": "workspaces/libnpmdiff" + }, + "main": "lib/index.js", + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "keywords": [ + "npm", + "npmcli", + "libnpm", + "cli", + "diff" + ], + "author": "GitHub Inc.", + "contributors": [ + { + "name": "Ruy Adorno", + "url": "https://ruyadorno.com", + "twitter": "ruyadorno" + } + ], + "license": "ISC", + "scripts": { + "lint": "npm run eslint", + "lintfix": "npm run eslint -- --fix", + "test": "tap", + "posttest": "npm run lint", + "snap": "tap", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.1", + "@npmcli/template-oss": "4.29.0", + "tap": "^16.3.8" + }, + "dependencies": { + "@npmcli/arborist": "^9.4.3", + "@npmcli/installed-package-contents": "^4.0.0", + "binary-extensions": "^3.0.0", + "diff": "^8.0.2", + "minimatch": "^10.0.3", + "npm-package-arg": "^13.0.0", + "pacote": "^21.0.2", + "tar": "^7.5.1" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.29.0", + "content": "../../scripts/template-oss/index.js" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node/node_modules/npm/node_modules/libnpmexec/LICENSE b/node/node_modules/npm/node_modules/libnpmexec/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..5cd9dc0646a18d99bf3e47e0b036b3c21c963b77 --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmexec/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) GitHub Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/libnpmexec/README.md b/node/node_modules/npm/node_modules/libnpmexec/README.md new file mode 100644 index 0000000000000000000000000000000000000000..da709ef244081d790a9e667d51d918245786ec91 --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmexec/README.md @@ -0,0 +1,47 @@ +# libnpmexec + +[![npm version](https://img.shields.io/npm/v/libnpmexec.svg)](https://npm.im/libnpmexec) +[![license](https://img.shields.io/npm/l/libnpmexec.svg)](https://npm.im/libnpmexec) +[![CI - libnpmexec](https://github.com/npm/cli/actions/workflows/ci-libnpmexec.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmexec.yml) + +The `npm exec` (`npx`) Programmatic API + +## Install + +`npm install libnpmexec` + +## Usage: + +```js +const libexec = require('libnpmexec') +await libexec({ + args: ['yosay', 'Bom dia!'], + cache: '~/.npm/_cacache', + npxCache: '~/.npm/_npx', + yes: true, +}) +``` + +## API: + +### `libexec(opts)` + +- `opts`: + - `args`: List of pkgs to execute **Array**, defaults to `[]` + - `call`: An alternative command to run when using `packages` option **String**, defaults to empty string. + - `cache`: The path location to where the npm cache folder is placed **String** + - `npxCache`: The path location to where the npx cache folder is placed **String** + - `chalk`: Chalk instance to use for colors? **Required** + - `localBin`: Location to the `node_modules/.bin` folder of the local project to start scanning for bin files **String**, defaults to `./node_modules/.bin`. **libexec** will walk up the directory structure looking for `node_modules/.bin` folders in parent folders that might satisfy the current `arg` and will use that bin if found. + - `locationMsg`: Overrides "at location" message when entering interactive mode **String** + - `globalBin`: Location to the global space bin folder, same as: `$(npm bin -g)` **String**, defaults to empty string. + - `packages`: A list of packages to be used (possibly fetch from the registry) **Array**, defaults to `[]` + - `path`: Location to where to read local project info (`package.json`) **String**, defaults to `.` + - `runPath`: Location to where to execute the script **String**, defaults to `.` + - `scriptShell`: Default shell to be used **String**, defaults to `sh` on POSIX systems, `process.env.ComSpec` OR `cmd` on Windows + - `yes`: Should skip download confirmation prompt when fetching missing packages from the registry? **Boolean** + - `registry`, `cache`, and more options that are forwarded to [@npmcli/arborist](https://github.com/npm/cli/blob/latest/workspaces/arborist/README.md) and [pacote](https://github.com/npm/pacote/#options) **Object** + +## LICENSE + +[ISC](./LICENSE) diff --git a/node/node_modules/npm/node_modules/libnpmexec/package.json b/node/node_modules/npm/node_modules/libnpmexec/package.json new file mode 100644 index 0000000000000000000000000000000000000000..000e4eb6021247c749f5e930a753b3a9817f13ca --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmexec/package.json @@ -0,0 +1,81 @@ +{ + "name": "libnpmexec", + "version": "10.2.6", + "files": [ + "bin/", + "lib/" + ], + "main": "lib/index.js", + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "description": "npm exec (npx) programmatic API", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cli.git", + "directory": "workspaces/libnpmexec" + }, + "keywords": [ + "npm", + "npmcli", + "libnpm", + "cli", + "workspaces", + "libnpmexec" + ], + "author": "GitHub Inc.", + "contributors": [ + { + "name": "Ruy Adorno", + "url": "https://ruyadorno.com", + "twitter": "ruyadorno" + } + ], + "license": "ISC", + "scripts": { + "lint": "npm run eslint", + "posttest": "npm run lint", + "test": "tap", + "snap": "tap", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "tap": { + "files": "test/*.js", + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.1", + "@npmcli/mock-registry": "^1.0.0", + "@npmcli/template-oss": "4.29.0", + "bin-links": "^6.0.0", + "chalk": "^5.2.0", + "just-extend": "^6.2.0", + "just-safe-set": "^4.2.1", + "tap": "^16.3.8" + }, + "dependencies": { + "@gar/promise-retry": "^1.0.0", + "@npmcli/arborist": "^9.4.3", + "@npmcli/package-json": "^7.0.0", + "@npmcli/run-script": "^10.0.0", + "ci-info": "^4.0.0", + "npm-package-arg": "^13.0.0", + "pacote": "^21.0.2", + "proc-log": "^6.0.0", + "read": "^5.0.1", + "semver": "^7.3.7", + "signal-exit": "^4.1.0", + "walk-up-path": "^4.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.29.0", + "content": "../../scripts/template-oss/index.js" + } +} diff --git a/node/node_modules/npm/node_modules/libnpmfund/LICENSE b/node/node_modules/npm/node_modules/libnpmfund/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..b89d1cd0a8aa40e8614240eebadc27798c39f6bb --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmfund/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/libnpmfund/README.md b/node/node_modules/npm/node_modules/libnpmfund/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e80e23f2cb827f7a68fc59e2b6adfb0facd62072 --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmfund/README.md @@ -0,0 +1,131 @@ +# libnpmfund + +[![npm version](https://img.shields.io/npm/v/libnpmfund.svg)](https://npm.im/libnpmfund) +[![license](https://img.shields.io/npm/l/libnpmfund.svg)](https://npm.im/libnpmfund) +[![CI - libnpmfund](https://github.com/npm/cli/actions/workflows/ci-libnpmfund.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmfund.yml) + +[`libnpmfund`](https://github.com/npm/libnpmfund) is a Node.js library for +retrieving **funding** information for packages installed using +[`arborist`](https://github.com/npm/arborist). + +## Table of Contents + +* [Example](#example) +* [Install](#install) +* [Contributing](#contributing) +* [API](#api) +* [LICENSE](#license) + +## Example + +```js +const { read } = require('libnpmfund') + +const fundingInfo = await read() +console.log( + JSON.stringify(fundingInfo, null, 2) +) +// => { + length: 2, + name: 'foo', + version: '1.0.0', + funding: { url: 'https://example.com' }, + dependencies: { + bar: { + version: '1.0.0', + funding: { url: 'http://collective.example.com' } + } + } +} +``` + +## Install + +`$ npm install libnpmfund` + +### Contributing + +The npm team enthusiastically welcomes contributions and project participation! +There's a bunch of things you can do if you want to contribute! The +[Contributor Guide](https://github.com/npm/cli/blob/latest/CONTRIBUTING.md) +outlines the process for community interaction and contribution. Please don't +hesitate to jump in if you'd like to, or even ask us questions if something +isn't clear. + +All participants and maintainers in this project are expected to follow the +[npm Code of Conduct](https://www.npmjs.com/policies/conduct), and just +generally be excellent to each other. + +Please refer to the [Changelog](CHANGELOG.md) for project history details, too. + +Happy hacking! + +### API + +##### `> fund.read([opts]) -> Promise` + +Reads **funding** info from a npm install and returns a promise for a +tree object that only contains packages in which funding info is defined. + +Options: + +- `countOnly`: Uses the tree-traversal logic from **npm fund** but skips over +any obj definition and just returns an obj containing `{ length }` - useful for +things such as printing a `6 packages are looking for funding` msg. +- `workspaces`: `Array` List of workspaces names to filter for, +the result will only include a subset of the resulting tree that includes +only the nodes that are children of the listed workspaces names. +- `path`, `registry` and more [Arborist options](https://github.com/npm/cli/blob/latest/workspaces/arborist/README.md#usage). + +##### `> fund.readTree(tree, [opts]) -> Promise` + +Reads **funding** info from a given install tree and returns a tree object +that only contains packages in which funding info is defined. + +- `tree`: An [`arborist`](https://github.com/npm/cli/blob/latest/workspaces/arborist/README.md) tree to be used, e.g: + +```js +const Arborist = require('@npmcli/arborist') +const { readTree } = require('libnpmfund') + +const arb = new Arborist({ path: process.cwd() }) +const tree = await arb.loadActual() + +return readTree(tree, { countOnly: false }) +``` + +Options: + +- `countOnly`: Uses the tree-traversal logic from **npm fund** but skips over +any obj definition and just returns an obj containing `{ length }` - useful for +things such as printing a `6 packages are looking for funding` msg. + +##### `> fund.normalizeFunding(funding) -> Object` + +From a `funding` ``, retrieves normalized funding objects +containing a `url` property. + +e.g: + +```js +normalizeFunding('http://example.com') +// => { + url: 'http://example.com' +} +``` + +##### `> fund.isValidFunding(funding) -> Boolean` + +Returns `` if `funding` is a valid funding object, e.g: + +```js +isValidFunding({ foo: 'not a valid funding obj' }) +// => false + +isValidFunding('http://example.com') +// => true +``` + +## LICENSE + +[ISC](./LICENSE) diff --git a/node/node_modules/npm/node_modules/libnpmfund/package.json b/node/node_modules/npm/node_modules/libnpmfund/package.json new file mode 100644 index 0000000000000000000000000000000000000000..6d0595d4d6ffe90421ac7fead7c4fd04b22d1371 --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmfund/package.json @@ -0,0 +1,65 @@ +{ + "name": "libnpmfund", + "version": "7.0.20", + "main": "lib/index.js", + "files": [ + "bin/", + "lib/" + ], + "description": "Programmatic API for npm fund", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cli.git", + "directory": "workspaces/libnpmfund" + }, + "keywords": [ + "npm", + "npmcli", + "libnpm", + "cli", + "git", + "fund", + "gitfund" + ], + "author": "GitHub Inc.", + "contributors": [ + { + "name": "Ruy Adorno", + "url": "https://ruyadorno.com", + "twitter": "ruyadorno" + } + ], + "license": "ISC", + "scripts": { + "lint": "npm run eslint", + "lintfix": "npm run eslint -- --fix", + "posttest": "npm run lint", + "test": "tap", + "snap": "tap", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.1", + "@npmcli/template-oss": "4.29.0", + "tap": "^16.3.8" + }, + "dependencies": { + "@npmcli/arborist": "^9.4.3" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.29.0", + "content": "../../scripts/template-oss/index.js" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node/node_modules/npm/node_modules/libnpmorg/LICENSE b/node/node_modules/npm/node_modules/libnpmorg/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9550b02fe23064a0c2e388f0c35b795480c39a6c --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmorg/LICENSE @@ -0,0 +1,13 @@ +Copyright npm, Inc + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/libnpmorg/README.md b/node/node_modules/npm/node_modules/libnpmorg/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fae2531f79f7b71de80d8334b788cb21a2335c40 --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmorg/README.md @@ -0,0 +1,148 @@ +# libnpmorg + +[![npm version](https://img.shields.io/npm/v/libnpmorg.svg)](https://npm.im/libnpmorg) +[![license](https://img.shields.io/npm/l/libnpmorg.svg)](https://npm.im/libnpmorg) +[![CI - libnpmorg](https://github.com/npm/cli/actions/workflows/ci-libnpmorg.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmorg.yml) + +[`libnpmorg`](https://github.com/npm/libnpmorg) is a Node.js library for +programmatically accessing the [npm Org membership +API](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#membership-detail). + +## Table of Contents + +* [Example](#example) +* [Install](#install) +* [Contributing](#contributing) +* [API](#api) + * [hook opts](#opts) + * [`set()`](#set) + * [`rm()`](#rm) + * [`ls()`](#ls) + * [`ls.stream()`](#ls-stream) + +## Example + +```js +const org = require('libnpmorg') + +console.log(await org.ls('myorg', {token: 'deadbeef'})) +=> +Roster { + zkat: 'developer', + iarna: 'admin', + isaacs: 'owner' +} +``` + +## Install + +`$ npm install libnpmorg` + +### API + +#### `opts` for `libnpmorg` commands + +`libnpmorg` uses [`npm-registry-fetch`](https://npm.im/npm-registry-fetch). +All options are passed through directly to that library, so please refer to [its +own `opts` +documentation](https://www.npmjs.com/package/npm-registry-fetch#fetch-options) +for options that can be passed in. + +A couple of options of note for those in a hurry: + +* `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs. +* `opts.otp` - certain operations will require an OTP token to be passed in. If a `libnpmorg` command fails with `err.code === EOTP`, please retry the request with `{otp: <2fa token>}` + +#### `> org.set(org, user, [role], [opts]) -> Promise` + +The returned Promise resolves to a [Membership +Detail](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#membership-detail) +object. + +The `role` is optional and should be one of `admin`, `owner`, or `developer`. +`developer` is the default if no `role` is provided. + +`org` and `user` must be scope names for the org name and user name +respectively. They can optionally be prefixed with `@`. + +See also: [`PUT +/-/org/:scope/user`](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#org-membership-replace) + +##### Example + +```javascript +await org.set('@myorg', '@myuser', 'admin', {token: 'deadbeef'}) +=> +MembershipDetail { + org: { + name: 'myorg', + size: 15 + }, + user: 'myuser', + role: 'admin' +} +``` + +#### `> org.rm(org, user, [opts]) -> Promise` + +The Promise resolves to `null` on success. + +`org` and `user` must be scope names for the org name and user name +respectively. They can optionally be prefixed with `@`. + +See also: [`DELETE +/-/org/:scope/user`](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#org-membership-delete) + +##### Example + +```javascript +await org.rm('myorg', 'myuser', {token: 'deadbeef'}) +``` + +#### `> org.ls(org, [opts]) -> Promise` + +The Promise resolves to a +[Roster](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#roster) +object. + +`org` must be a scope name for an org, and can be optionally prefixed with `@`. + +See also: [`GET +/-/org/:scope/user`](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#org-roster) + +##### Example + +```javascript +await org.ls('myorg', {token: 'deadbeef'}) +=> +Roster { + zkat: 'developer', + iarna: 'admin', + isaacs: 'owner' +} +``` + +#### `> org.ls.stream(org, [opts]) -> Stream` + +Returns a stream of entries for a +[Roster](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#roster), +with each emitted entry in `[key, value]` format. + +`org` must be a scope name for an org, and can be optionally prefixed with `@`. + +The returned stream is a valid `Symbol.asyncIterator`. + +See also: [`GET +/-/org/:scope/user`](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#org-roster) + +##### Example + +```javascript +for await (let [user, role] of org.ls.stream('myorg', {token: 'deadbeef'})) { + console.log(`user: ${user} (${role})`) +} +=> +user: zkat (developer) +user: iarna (admin) +user: isaacs (owner) +``` diff --git a/node/node_modules/npm/node_modules/libnpmorg/package.json b/node/node_modules/npm/node_modules/libnpmorg/package.json new file mode 100644 index 0000000000000000000000000000000000000000..29fd621dadcd7b35b258fb7f968d7edb7ba953be --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmorg/package.json @@ -0,0 +1,62 @@ +{ + "name": "libnpmorg", + "version": "8.0.1", + "description": "Programmatic api for `npm org` commands", + "author": "GitHub Inc.", + "main": "lib/index.js", + "keywords": [ + "libnpm", + "npm", + "package manager", + "api", + "orgs", + "teams" + ], + "license": "ISC", + "scripts": { + "lint": "npm run eslint", + "test": "tap", + "posttest": "npm run lint", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "files": [ + "bin/", + "lib/" + ], + "devDependencies": { + "@npmcli/eslint-config": "^5.0.1", + "@npmcli/template-oss": "4.29.0", + "minipass": "^7.1.1", + "nock": "^13.3.3", + "tap": "^16.3.8" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cli.git", + "directory": "workspaces/libnpmorg" + }, + "bugs": "https://github.com/npm/libnpmorg/issues", + "homepage": "https://npmjs.com/package/libnpmorg", + "dependencies": { + "aproba": "^2.0.0", + "npm-registry-fetch": "^19.0.0" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.29.0", + "content": "../../scripts/template-oss/index.js" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node/node_modules/npm/node_modules/libnpmpack/LICENSE b/node/node_modules/npm/node_modules/libnpmpack/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9550b02fe23064a0c2e388f0c35b795480c39a6c --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmpack/LICENSE @@ -0,0 +1,13 @@ +Copyright npm, Inc + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/libnpmpack/README.md b/node/node_modules/npm/node_modules/libnpmpack/README.md new file mode 100644 index 0000000000000000000000000000000000000000..54428082d83e46d15e8108f067aed24a48acdabd --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmpack/README.md @@ -0,0 +1,55 @@ +# libnpmpack + +[![npm version](https://img.shields.io/npm/v/libnpmpack.svg)](https://npm.im/libnpmpack) +[![license](https://img.shields.io/npm/l/libnpmpack.svg)](https://npm.im/libnpmpack) +[![CI - libnpmpack](https://github.com/npm/cli/actions/workflows/ci-libnpmpack.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmpack.yml) + +[`libnpmpack`](https://github.com/npm/libnpmpack) is a Node.js library for +programmatically packing tarballs from a local directory or from a registry or github spec. If packing from a local source, `libnpmpack` will also run the `prepack` and `postpack` lifecycles. + +## Table of Contents + +* [Example](#example) +* [Install](#install) +* [API](#api) + * [`pack()`](#pack) + +## Example + +```js +const pack = require('libnpmpack') +``` + +## Install + +`$ npm install libnpmpack` + +### API + +#### `> pack(spec, [opts]) -> Promise` + +Packs a tarball from a local directory or from a registry or github spec and returns a Promise that resolves to the tarball data Buffer, with from, resolved, and integrity fields attached. + +If no options are passed, the tarball file will be saved on the same directory from which `pack` was called in. + +`libnpmpack` uses [`pacote`](https://npm.im/pacote). +Most options are passed through directly to that library, so please refer to +[its own `opts` +documentation](https://www.npmjs.com/package/pacote#options) +for options that can be passed in. + +##### Examples + +```javascript +// packs from cwd +const tarball = await pack() + +// packs from a local directory +const localTar = await pack('/Users/claudiahdz/projects/my-cool-pkg') + +// packs from a registry spec +const registryTar = await pack('abbrev@1.0.3') + +// packs from a github spec +const githubTar = await pack('isaacs/rimraf#PR-192') +``` diff --git a/node/node_modules/npm/node_modules/libnpmpack/package.json b/node/node_modules/npm/node_modules/libnpmpack/package.json new file mode 100644 index 0000000000000000000000000000000000000000..da42ee71e05f70edccf373b375a8de475cee4159 --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmpack/package.json @@ -0,0 +1,59 @@ +{ + "name": "libnpmpack", + "version": "9.1.6", + "description": "Programmatic API for the bits behind npm pack", + "author": "GitHub Inc.", + "main": "lib/index.js", + "contributors": [ + "Claudia Hernández " + ], + "files": [ + "bin/", + "lib/" + ], + "license": "ISC", + "scripts": { + "lint": "npm run eslint", + "test": "tap", + "posttest": "npm run lint", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.1", + "@npmcli/template-oss": "4.29.0", + "nock": "^13.3.3", + "spawk": "^1.7.1", + "tap": "^16.3.8" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cli.git", + "directory": "workspaces/libnpmpack" + }, + "bugs": "https://github.com/npm/libnpmpack/issues", + "homepage": "https://npmjs.com/package/libnpmpack", + "dependencies": { + "@npmcli/arborist": "^9.4.3", + "@npmcli/run-script": "^10.0.0", + "npm-package-arg": "^13.0.0", + "pacote": "^21.0.2" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.29.0", + "content": "../../scripts/template-oss/index.js" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node/node_modules/npm/node_modules/libnpmpublish/LICENSE b/node/node_modules/npm/node_modules/libnpmpublish/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9550b02fe23064a0c2e388f0c35b795480c39a6c --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmpublish/LICENSE @@ -0,0 +1,13 @@ +Copyright npm, Inc + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/libnpmpublish/README.md b/node/node_modules/npm/node_modules/libnpmpublish/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cdb5485e1789076e19f5ec255b7164a85f94d7e5 --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmpublish/README.md @@ -0,0 +1,120 @@ +# libnpmpublish + +[![npm version](https://img.shields.io/npm/v/libnpmpublish.svg)](https://npm.im/libnpmpublish) +[![license](https://img.shields.io/npm/l/libnpmpublish.svg)](https://npm.im/libnpmpublish) +[![CI - libnpmpublish](https://github.com/npm/cli/actions/workflows/ci-libnpmpublish.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmpublish.yml) + +[`libnpmpublish`](https://github.com/npm/libnpmpublish) is a Node.js +library for programmatically publishing and unpublishing npm packages. Give +it a manifest as an object and a tarball as a Buffer, and it'll put them on +the registry for you. + +## Table of Contents + +* [Example](#example) +* [Install](#install) +* [API](#api) + * [publish/unpublish opts](#opts) + * [`publish()`](#publish) + * [`unpublish()`](#unpublish) + +## Example + +```js +const { publish, unpublish } = require('libnpmpublish') +``` + +## Install + +`$ npm install libnpmpublish` + +### API + +#### `opts` for `libnpmpublish` commands + +`libnpmpublish` uses +[`npm-registry-fetch`](https://npm.im/npm-registry-fetch). Most options +are passed through directly to that library, so please refer to [its own +`opts` documentation](http://npm.im/npm-registry-fetch#fetch-options) for +options that can be passed in. + +A couple of options of note: + +* `opts.defaultTag` - registers the published package with the given tag, + defaults to `latest`. + +* `opts.access` - tells the registry whether this package should be + published as `public` or `restricted`. Only applies to scoped + packages. Defaults to `public`. + +* `opts.token` - can be passed in and will be used as the authentication + token for the registry. For other ways to pass in auth details, see the + n-r-f docs. + +* `opts.provenance` - when running in a supported CI environment, will trigger + the generation of a signed provenance statement to be published alongside + the package. Mutually exclusive with the `provenanceFile` option. + +* `opts.provenanceFile` - specifies the path to an externally-generated + provenance statement to be published alongside the package. Mutually + exclusive with the `provenance` option. The specified file should be a + [Sigstore Bundle](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) + containing a [DSSE](https://github.com/secure-systems-lab/dsse)-packaged + provenance statement. + +#### `> libpub.publish(manifest, tarData, [opts]) -> Promise` + +Sends the package represented by the `manifest` and `tarData` to the +configured registry. + +`manifest` should be the parsed `package.json` for the package being +published (which can also be the manifest pulled from a packument, a git +repo, tarball, etc.) + +`tarData` is a `Buffer` of the tarball being published. + +If `opts.npmVersion` is passed in, it will be used as the `_npmVersion` +field in the outgoing packument. You may put your own user-agent string in +there to identify your publishes. + +If `opts.algorithms` is passed in, it should be an array of hashing +algorithms to generate `integrity` hashes for. The default is `['sha512']`, +which means you end up with `dist.integrity = 'sha512-deadbeefbadc0ffee'`. +Any algorithm supported by your current node version is allowed -- npm +clients that do not support those algorithms will simply ignore the +unsupported hashes. + +##### Example + +```js +// note that pacote.manifest() and pacote.tarball() can also take +// any spec that npm can install. a folder shown here, since that's +// far and away the most common use case. +const path = '/a/path/to/your/source/code' +const pacote = require('pacote') // see: http://npm.im/pacote +const manifest = await pacote.manifest(path) +const tarData = await pacote.tarball(path) +await libpub.publish(manifest, tarData, { + npmVersion: 'my-pub-script@1.0.2', + token: 'my-auth-token-here' +}, opts) +// Package has been published to the npm registry. +``` + +#### `> libpub.unpublish(spec, [opts]) -> Promise` + +Unpublishes `spec` from the appropriate registry. The registry in question may +have its own limitations on unpublishing. + +`spec` should be either a string, or a valid +[`npm-package-arg`](https://npm.im/npm-package-arg) parsed spec object. For +legacy compatibility reasons, only `tag` and `version` specs will work as +expected. `range` specs will fail silently in most cases. + +##### Example + +```js +await libpub.unpublish('lodash', { token: 'i-am-the-worst'}) +// +// `lodash` has now been unpublished, along with all its versions +``` diff --git a/node/node_modules/npm/node_modules/libnpmpublish/package.json b/node/node_modules/npm/node_modules/libnpmpublish/package.json new file mode 100644 index 0000000000000000000000000000000000000000..a89edcd1207e639536d218f0b71d6ae1cbae2cc3 --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmpublish/package.json @@ -0,0 +1,64 @@ +{ + "name": "libnpmpublish", + "version": "11.1.3", + "description": "Programmatic API for the bits behind npm publish and unpublish", + "author": "GitHub Inc.", + "main": "lib/index.js", + "contributors": [ + "Kat Marchán ", + "Claudia Hernández " + ], + "files": [ + "bin/", + "lib/" + ], + "license": "ISC", + "scripts": { + "lint": "npm run eslint", + "lintfix": "npm run eslint -- --fix", + "test": "tap", + "posttest": "npm run lint", + "postlint": "template-oss-check", + "snap": "tap", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.1", + "@npmcli/mock-globals": "^1.0.0", + "@npmcli/mock-registry": "^1.0.0", + "@npmcli/template-oss": "4.29.0", + "tap": "^16.3.8" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cli.git", + "directory": "workspaces/libnpmpublish" + }, + "bugs": "https://github.com/npm/cli/issues", + "homepage": "https://npmjs.com/package/libnpmpublish", + "dependencies": { + "@npmcli/package-json": "^7.0.0", + "ci-info": "^4.0.0", + "npm-package-arg": "^13.0.0", + "npm-registry-fetch": "^19.0.0", + "proc-log": "^6.0.0", + "semver": "^7.3.7", + "sigstore": "^4.0.0", + "ssri": "^13.0.0" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.29.0", + "content": "../../scripts/template-oss/index.js" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node/node_modules/npm/node_modules/libnpmsearch/LICENSE b/node/node_modules/npm/node_modules/libnpmsearch/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9550b02fe23064a0c2e388f0c35b795480c39a6c --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmsearch/LICENSE @@ -0,0 +1,13 @@ +Copyright npm, Inc + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/libnpmsearch/README.md b/node/node_modules/npm/node_modules/libnpmsearch/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9aac10d5194e4cc507ac834d70cb9fd75b3b034a --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmsearch/README.md @@ -0,0 +1,173 @@ +# libnpmsearch + +[![npm version](https://img.shields.io/npm/v/libnpmsearch.svg)](https://npm.im/libnpmsearch) +[![license](https://img.shields.io/npm/l/libnpmsearch.svg)](https://npm.im/libnpmsearch) +[![CI - libnpmsearch](https://github.com/npm/cli/actions/workflows/ci-libnpmsearch.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmsearch.yml) + +[`libnpmsearch`](https://github.com/npm/libnpmsearch) is a Node.js library for +programmatically accessing the npm search endpoint. It does **not** support +legacy search through `/-/all`. + +## Table of Contents + +* [Example](#example) +* [Install](#install) +* [Contributing](#contributing) +* [API](#api) + * [search opts](#opts) + * [`search()`](#search) + * [`search.stream()`](#search-stream) + +## Example + +```js +const search = require('libnpmsearch') + +console.log(await search('libnpm')) +=> +[ + { + name: 'libnpm', + description: 'programmatic npm API', + ...etc + }, + { + name: 'libnpmsearch', + description: 'Programmatic API for searching in npm and compatible registries', + ...etc + }, + ...more +] +``` + +## Install + +`$ npm install libnpmsearch` + +### API + +#### `opts` for `libnpmsearch` commands + +The following opts are used directly by `libnpmsearch` itself: + +* `opts.limit` - Number of results to limit the query to. Default: 20 +* `opts.from` - Offset number for results. Used with `opts.limit` for pagination. Default: 0 +* `opts.detailed` - If true, returns an object with `package`, `score`, and `searchScore` fields, with `package` being what would usually be returned, and the other two containing details about how that package scored. Useful for UIs. Default: false +* `opts.sortBy` - Used as a shorthand to set `opts.quality`, `opts.maintenance`, and `opts.popularity` with values that prioritize each one. Should be one of `'optimal'`, `'quality'`, `'maintenance'`, or `'popularity'`. Default: `'optimal'` +* `opts.maintenance` - Decimal number between `0` and `1` that defines the weight of `maintenance` metrics when scoring and sorting packages. Default: `0.65` (same as `opts.sortBy: 'optimal'`) +* `opts.popularity` - Decimal number between `0` and `1` that defines the weight of `popularity` metrics when scoring and sorting packages. Default: `0.98` (same as `opts.sortBy: 'optimal'`) +* `opts.quality` - Decimal number between `0` and `1` that defines the weight of `quality` metrics when scoring and sorting packages. Default: `0.5` (same as `opts.sortBy: 'optimal'`) + +`libnpmsearch` uses [`npm-registry-fetch`](https://npm.im/npm-registry-fetch). +Most options are passed through directly to that library, so please refer to +[its own `opts` +documentation](https://www.npmjs.com/package/npm-registry-fetch#fetch-options) +for options that can be passed in. + +A couple of options of note for those in a hurry: + +* `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs. + +#### `> search(query, [opts]) -> Promise` + +`query` must be either a String or an Array of search terms. + +If `opts.limit` is provided, it will be sent to the API to constrain the number +of returned results. You may receive more, or fewer results, at the endpoint's +discretion. + +The returned Promise resolved to an Array of search results with the following +format: + +```js +{ + name: String, + version: SemverString, + description: String || null, + maintainers: [ + { + username: String, + email: String + }, + ...etc + ] || null, + keywords: [String] || null, + date: Date || null +} +``` + +If `opts.limit` is provided, it will be sent to the API to constrain the number +of returned results. You may receive more, or fewer results, at the endpoint's +discretion. + +For streamed results, see [`search.stream`](#search-stream). + +##### Example + +```javascript +await search('libnpm') +=> +[ + { + name: 'libnpm', + description: 'programmatic npm API', + ...etc + }, + { + name: 'libnpmsearch', + description: 'Programmatic API for searching in npm and compatible registries', + ...etc + }, + ...more +] +``` + +#### `> search.stream(query, [opts]) -> Stream` + +`query` must be either a String or an Array of search terms. + +If `opts.limit` is provided, it will be sent to the API to constrain the number +of returned results. You may receive more, or fewer results, at the endpoint's +discretion. + +The returned Stream emits one entry per search result, with each entry having +the following format: + +```js +{ + name: String, + version: SemverString, + description: String || null, + maintainers: [ + { + username: String, + email: String + }, + ...etc + ] || null, + keywords: [String] || null, + date: Date || null +} +``` + +For getting results in one chunk, see [`search`](#search-stream). + +##### Example + +```javascript +search.stream('libnpm').on('data', console.log) +=> +// entry 1 +{ + name: 'libnpm', + description: 'programmatic npm API', + ...etc +} +// entry 2 +{ + name: 'libnpmsearch', + description: 'Programmatic API for searching in npm and compatible registries', + ...etc +} +// etc +``` diff --git a/node/node_modules/npm/node_modules/libnpmsearch/package.json b/node/node_modules/npm/node_modules/libnpmsearch/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d9979e916a9b4003c37fce97f3df334f42375548 --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmsearch/package.json @@ -0,0 +1,58 @@ +{ + "name": "libnpmsearch", + "version": "9.0.1", + "description": "Programmatic API for searching in npm and compatible registries.", + "author": "GitHub Inc.", + "main": "lib/index.js", + "files": [ + "bin/", + "lib/" + ], + "keywords": [ + "npm", + "search", + "api", + "libnpm" + ], + "license": "ISC", + "scripts": { + "posttest": "npm run lint", + "test": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.1", + "@npmcli/template-oss": "4.29.0", + "nock": "^13.3.3", + "tap": "^16.3.8" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cli.git", + "directory": "workspaces/libnpmsearch" + }, + "bugs": "https://github.com/npm/libnpmsearch/issues", + "homepage": "https://npmjs.com/package/libnpmsearch", + "dependencies": { + "npm-registry-fetch": "^19.0.0" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.29.0", + "content": "../../scripts/template-oss/index.js" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node/node_modules/npm/node_modules/libnpmteam/LICENSE b/node/node_modules/npm/node_modules/libnpmteam/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9550b02fe23064a0c2e388f0c35b795480c39a6c --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmteam/LICENSE @@ -0,0 +1,13 @@ +Copyright npm, Inc + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/libnpmteam/README.md b/node/node_modules/npm/node_modules/libnpmteam/README.md new file mode 100644 index 0000000000000000000000000000000000000000..68a6a028d63454f0a499941dcae663d16aa0dddd --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmteam/README.md @@ -0,0 +1,172 @@ +# libnpmteam + +[![npm version](https://img.shields.io/npm/v/libnpmteam.svg)](https://npm.im/libnpmteam) +[![license](https://img.shields.io/npm/l/libnpmteam.svg)](https://npm.im/libnpmteam) +[![CI - libnpmteam](https://github.com/npm/cli/actions/workflows/ci-libnpmteam.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmteam.yml) + +[`libnpmteam`](https://github.com/npm/libnpmteam) is a Node.js +library that provides programmatic access to the guts of the npm CLI's `npm +team` command and its various subcommands. + +## Table of Contents + +* [Installing](#install) +* [Example](#example) +* [API](#api) + * [team opts](#opts) + * [`create()`](#create) + * [`destroy()`](#destroy) + * [`add()`](#add) + * [`rm()`](#rm) + * [`lsTeams()`](#ls-teams) + * [`lsTeams.stream()`](#ls-teams-stream) + * [`lsUsers()`](#ls-users) + * [`lsUsers.stream()`](#ls-users-stream) + +### Install + +`$ npm install libnpmteam` + +### Example + +```javascript +const team = require('libnpmteam') + +// List all teams for the @npm org. +console.log(await team.lsTeams('npm')) +``` + +### API + +#### `opts` for `libnpmteam` commands + +`libnpmteam` uses [`npm-registry-fetch`](https://npm.im/npm-registry-fetch). +All options are passed through directly to that library, so please refer to [its +own `opts` +documentation](https://www.npmjs.com/package/npm-registry-fetch#fetch-options) +for options that can be passed in. + +A couple of options of note for those in a hurry: + +* `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs. +* `opts.otp` - certain operations will require an OTP token to be passed in. If a `libnpmteam` command fails with `err.code === EOTP`, please retry the request with `{otp: <2fa token>}` + +#### `> team.create(team, [opts]) -> Promise` + +Creates a team named `team`. Team names use the format `@:`, with +the `@` being optional. + +Additionally, `opts.description` may be passed in to include a description. + +##### Example + +```javascript +await team.create('@npm:cli', {token: 'myregistrytoken'}) +// The @npm:cli team now exists. +``` + +#### `> team.destroy(team, [opts]) -> Promise` + +Destroys a team named `team`. Team names use the format `@:`, with +the `@` being optional. + +##### Example + +```javascript +await team.destroy('@npm:cli', {token: 'myregistrytoken'}) +// The @npm:cli team has been destroyed. +``` + +#### `> team.add(user, team, [opts]) -> Promise` + +Adds `user` to `team`. + +##### Example + +```javascript +await team.add('zkat', '@npm:cli', {token: 'myregistrytoken'}) +// @zkat now belongs to the @npm:cli team. +``` + +#### `> team.rm(user, team, [opts]) -> Promise` + +Removes `user` from `team`. + +##### Example + +```javascript +await team.rm('zkat', '@npm:cli', {token: 'myregistrytoken'}) +// @zkat is no longer part of the @npm:cli team. +``` + +#### `> team.lsTeams(scope, [opts]) -> Promise` + +Resolves to an array of team names belonging to `scope`. + +##### Example + +```javascript +await team.lsTeams('@npm', {token: 'myregistrytoken'}) +=> +[ + 'npm:cli', + 'npm:web', + 'npm:registry', + 'npm:developers' +] +``` + +#### `> team.lsTeams.stream(scope, [opts]) -> Stream` + +Returns a stream of teams belonging to `scope`. + +For a Promise-based version of these results, see [`team.lsTeams()`](#ls-teams). + +##### Example + +```javascript +for await (let team of team.lsTeams.stream('@npm', {token: 'myregistrytoken'})) { + console.log(team) +} + +// outputs +// npm:cli +// npm:web +// npm:registry +// npm:developers +``` + +#### `> team.lsUsers(team, [opts]) -> Promise` + +Resolves to an array of usernames belonging to `team`. + +For a streamed version of these results, see [`team.lsUsers.stream()`](#ls-users-stream). + +##### Example + +```javascript +await team.lsUsers('@npm:cli', {token: 'myregistrytoken'}) +=> +[ + 'iarna', + 'zkat' +] +``` + +#### `> team.lsUsers.stream(team, [opts]) -> Stream` + +Returns a stream of usernames belonging to `team`. + +For a Promise-based version of these results, see [`team.lsUsers()`](#ls-users). + +##### Example + +```javascript +for await (let user of team.lsUsers.stream('@npm:cli', {token: 'myregistrytoken'})) { + console.log(user) +} + +// outputs +// iarna +// zkat +``` diff --git a/node/node_modules/npm/node_modules/libnpmteam/package.json b/node/node_modules/npm/node_modules/libnpmteam/package.json new file mode 100644 index 0000000000000000000000000000000000000000..deef969783d0b920e37c88e68ed5773164859576 --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmteam/package.json @@ -0,0 +1,52 @@ +{ + "name": "libnpmteam", + "description": "npm Team management APIs", + "version": "8.0.2", + "author": "GitHub Inc.", + "license": "ISC", + "main": "lib/index.js", + "scripts": { + "lint": "npm run eslint", + "test": "tap", + "posttest": "npm run lint", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.1", + "@npmcli/template-oss": "4.29.0", + "nock": "^13.3.3", + "tap": "^16.3.8" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cli.git", + "directory": "workspaces/libnpmteam" + }, + "files": [ + "bin/", + "lib/" + ], + "homepage": "https://npmjs.com/package/libnpmteam", + "dependencies": { + "aproba": "^2.0.0", + "npm-registry-fetch": "^19.0.0" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.29.0", + "content": "../../scripts/template-oss/index.js" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node/node_modules/npm/node_modules/libnpmversion/LICENSE b/node/node_modules/npm/node_modules/libnpmversion/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..235bdd54ec77f257af3e9f5bfece770fa2d6d6a8 --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmversion/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/libnpmversion/README.md b/node/node_modules/npm/node_modules/libnpmversion/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9e368581d076b24c83f556b4f39008829473088a --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmversion/README.md @@ -0,0 +1,163 @@ +# libnpmversion + +[![npm version](https://img.shields.io/npm/v/libnpmversion.svg)](https://npm.im/libnpmversion) +[![license](https://img.shields.io/npm/l/libnpmversion.svg)](https://npm.im/libnpmversion) +[![CI - libnpmversion](https://github.com/npm/cli/actions/workflows/ci-libnpmversion.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmversion.yml) + +Library to do the things that 'npm version' does. + +## USAGE + +```js +const npmVersion = require('libnpmversion') + +// argument can be one of: +// - any semver version string (set to that exact version) +// - 'major', 'minor', 'patch', 'pre{major,minor,patch}' (increment at +// that value) +// - 'from-git' (set to the latest tag in git that looks like semver - +// this skips gitTagVersion, but will still sign if asked) +npmVersion(arg, { + path: '/path/to/my/pkg', // defaults to cwd + + allowSameVersion: false, // allow tagging/etc to the current version + preid: '', // when arg=='pre', define the prerelease string, like 'beta' etc. + tagVersionPrefix: 'v', // tag as 'v1.2.3' when versioning to 1.2.3 + commitHooks: true, // default true, run git commit hooks, default true + gitTagVersion: true, // default true, tag the version + signGitCommit: false, // default false, gpg sign the git commit + signGitTag: false, // default false, gpg sign the git tag + force: false, // push forward recklessly if any problems happen + ignoreScripts: false, // do not run pre/post/version lifecycle scripts + scriptShell: '/bin/bash', // shell to run lifecycle scripts in + message: 'v%s', // message for tag and commit, replace %s with the version +}).then(newVersion => { + console.error('version updated!', newVersion) +}) +``` + +## Description + +Run this in a package directory to bump the version and write the new data +back to `package.json`, `package-lock.json`, and, if present, +`npm-shrinkwrap.json`. + +The `newversion` argument should be a valid semver string, a valid second +argument to [semver.inc](https://github.com/npm/node-semver#functions) (one +of `patch`, `minor`, `major`, `prepatch`, `preminor`, `premajor`, +`prerelease`), or `from-git`. In the second case, the existing version will +be incremented by 1 in the specified field. `from-git` will try to read +the latest git tag, and use that as the new npm version. + +If run in a git repo, it will also create a version commit and tag. This +behavior is controlled by `gitTagVersion` (see below), and can be +disabled by setting `gitTagVersion: false` in the options. +It will fail if the working directory is not clean, unless `force: true` is +set. + +If supplied with a `message` string option, it will +use it as a commit message when creating a version commit. If the +`message` option contains `%s` then that will be replaced with the +resulting version number. + +If the `signGitTag` option is set, then the tag will be signed using +the `-s` flag to git. Note that you must have a default GPG key set up in +your git config for this to work properly. + +If `preversion`, `version`, or `postversion` are in the `scripts` property +of the package.json, they will be executed in the appropriate sequence. + +The exact order of execution is as follows: + +1. Check to make sure the git working directory is clean before we get + started. Your scripts may add files to the commit in future steps. + This step is skipped if the `force` flag is set. +2. Run the `preversion` script. These scripts have access to the old + `version` in package.json. A typical use would be running your full + test suite before deploying. Any files you want added to the commit + should be explicitly added using `git add`. +3. Bump `version` in `package.json` as requested (`patch`, `minor`, + `major`, explicit version number, etc). +4. Run the `version` script. These scripts have access to the new `version` + in package.json (so they can incorporate it into file headers in + generated files for example). Again, scripts should explicitly add + generated files to the commit using `git add`. +5. Commit and tag. +6. Run the `postversion` script. Use it to clean up the file system or + automatically push the commit and/or tag. + +Take the following example: + +```json +{ + "scripts": { + "preversion": "npm test", + "version": "npm run build && git add -A dist", + "postversion": "git push && git push --tags && rm -rf build/temp" + } +} +``` + +This runs all your tests, and proceeds only if they pass. Then runs your +`build` script, and adds everything in the `dist` directory to the commit. +After the commit, it pushes the new commit and tag up to the server, and +deletes the `build/temp` directory. + +## API + +### `npmVersion(newversion, options = {}) -> Promise` + +Do the things. Returns a promise that resolves to the new version if +all is well, or rejects if any errors are encountered. + +### Options + +#### `path` String + +The path to the package being versioned. Defaults to process.cwd(). + +#### `allowSameVersion` Boolean + +Allow setting the version to the current version in package.json. Default +`false`. + +#### `preid` String +When the `newversion` is pre, premajor, preminor, or prepatch, this +defines the prerelease string, like 'beta' etc. + +#### `tagVersionPrefix` String + +The prefix to add to the raw semver string for the tag name. Defaults to +`'v'`. (So, by default it tags as 'v1.2.3' when versioning to 1.2.3.) + +#### `commitHooks` Boolean + +Run git commit hooks. Default true. + +#### `gitTagVersion` Boolean + +Tag the version, default true. + +#### `signGitCommit` Boolean + +GPG sign the git commit. Default `false`. + +#### `signGitTag` Boolean + +GPG sign the git tag. Default `false`. + +#### `force` Boolean + +Push forward recklessly if any problems happen. Default `false`. + +#### `ignoreScripts` Boolean + +Do not run pre/post/version lifecycle scripts. Default `false`. + +#### `scriptShell` String + +Path to the shell, which should execute the lifecycle scripts. Defaults to `/bin/sh` on unix, or `cmd.exe` on windows. + +#### `message` String + +The message for the git commit and annotated git tag that are created. diff --git a/node/node_modules/npm/node_modules/libnpmversion/package.json b/node/node_modules/npm/node_modules/libnpmversion/package.json new file mode 100644 index 0000000000000000000000000000000000000000..c5e9f6e5a55a192a157ef322f8c55fdd9d080192 --- /dev/null +++ b/node/node_modules/npm/node_modules/libnpmversion/package.json @@ -0,0 +1,55 @@ +{ + "name": "libnpmversion", + "version": "8.0.3", + "main": "lib/index.js", + "files": [ + "bin/", + "lib/" + ], + "description": "library to do the things that 'npm version' does", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cli.git", + "directory": "workspaces/libnpmversion" + }, + "author": "GitHub Inc.", + "license": "ISC", + "scripts": { + "lint": "npm run eslint", + "test": "tap", + "posttest": "npm run lint", + "snap": "tap", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "tap": { + "coverage-map": "map.js", + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.1", + "@npmcli/template-oss": "4.29.0", + "require-inject": "^1.4.4", + "tap": "^16.3.8" + }, + "dependencies": { + "@npmcli/git": "^7.0.0", + "@npmcli/run-script": "^10.0.0", + "json-parse-even-better-errors": "^5.0.0", + "proc-log": "^6.0.0", + "semver": "^7.3.7" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.29.0", + "content": "../../scripts/template-oss/index.js" + } +} diff --git a/node/node_modules/npm/node_modules/lru-cache/LICENSE.md b/node/node_modules/npm/node_modules/lru-cache/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..3da8747dc3a48e2da66615e4116cefcfde495d7c --- /dev/null +++ b/node/node_modules/npm/node_modules/lru-cache/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** diff --git a/node/node_modules/npm/node_modules/lru-cache/package.json b/node/node_modules/npm/node_modules/lru-cache/package.json new file mode 100644 index 0000000000000000000000000000000000000000..25b062cec587b29406af2f387bd0b1641ac81974 --- /dev/null +++ b/node/node_modules/npm/node_modules/lru-cache/package.json @@ -0,0 +1,126 @@ +{ + "name": "lru-cache", + "description": "A cache object that deletes the least-recently-used items.", + "version": "11.3.5", + "author": "Isaac Z. Schlueter ", + "keywords": [ + "mru", + "lru", + "cache" + ], + "sideEffects": false, + "scripts": { + "build": "npm run prepare", + "prepare": "tshy && bash scripts/build.sh", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "format": "prettier --write .", + "typedoc": "typedoc --tsconfig ./.tshy/esm.json ./src/*.ts", + "benchmark-results-typedoc": "bash scripts/benchmark-results-typedoc.sh", + "prebenchmark": "npm run prepare", + "benchmark": "make -C benchmark", + "preprofile": "npm run prepare", + "profile": "make -C benchmark profile", + "lint": "oxlint --fix src test", + "postsnap": "npm run lint", + "postlint": "npm run format" + }, + "main": "./dist/commonjs/index.min.js", + "types": "./dist/commonjs/index.d.ts", + "tshy": { + "esmDialects": [ + "node", + "browser" + ], + "exports": { + "./raw": "./src/index.ts", + ".": { + "import": { + "node": { + "types": "./dist/esm/node/index.d.ts", + "default": "./dist/esm/node/index.min.js" + }, + "browser": { + "types": "./dist/esm/browser/index.d.ts", + "default": "./dist/esm/browser/index.min.js" + }, + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + }, + "selfLink": false + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/isaacs/node-lru-cache.git" + }, + "devDependencies": { + "benchmark": "^2.1.4", + "esbuild": "^0.25.9", + "marked": "^4.2.12", + "mkdirp": "^3.0.1", + "oxlint": "^1.58.0", + "oxlint-tsgolint": "^0.19.0", + "prettier": "^3.8.1", + "tap": "^21.6.3", + "tshy": "^4.1.1", + "typedoc": "^0.28.18" + }, + "license": "BlueOak-1.0.0", + "files": [ + "dist" + ], + "engines": { + "node": "20 || >=22" + }, + "exports": { + "./raw": { + "import": { + "node": { + "types": "./dist/esm/node/index.d.ts", + "default": "./dist/esm/node/index.js" + }, + "browser": { + "types": "./dist/esm/browser/index.d.ts", + "default": "./dist/esm/browser/index.js" + }, + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + ".": { + "import": { + "node": { + "types": "./dist/esm/node/index.d.ts", + "default": "./dist/esm/node/index.min.js" + }, + "browser": { + "types": "./dist/esm/browser/index.d.ts", + "default": "./dist/esm/browser/index.min.js" + }, + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + }, + "type": "module", + "module": "./dist/esm/index.min.js" +} diff --git a/node/node_modules/npm/node_modules/make-fetch-happen/LICENSE b/node/node_modules/npm/node_modules/make-fetch-happen/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..092d88efa1f761e68687e5f017a3b26af72cacb7 --- /dev/null +++ b/node/node_modules/npm/node_modules/make-fetch-happen/LICENSE @@ -0,0 +1,16 @@ +ISC License + +Copyright 2017-2022 (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted, provided that the +above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS +ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/make-fetch-happen/package.json b/node/node_modules/npm/node_modules/make-fetch-happen/package.json new file mode 100644 index 0000000000000000000000000000000000000000..10cf57b1108bbe3b5ad2464472ff641f178a5825 --- /dev/null +++ b/node/node_modules/npm/node_modules/make-fetch-happen/package.json @@ -0,0 +1,75 @@ +{ + "name": "make-fetch-happen", + "version": "15.0.5", + "description": "Opinionated, caching, retrying fetch client", + "main": "lib/index.js", + "files": [ + "bin/", + "lib/" + ], + "scripts": { + "test": "tap", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", + "lint": "npm run eslint", + "lintfix": "npm run eslint -- --fix", + "postlint": "template-oss-check", + "snap": "tap", + "template-oss-apply": "template-oss-apply --force" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/make-fetch-happen.git" + }, + "keywords": [ + "http", + "request", + "fetch", + "mean girls", + "caching", + "cache", + "subresource integrity" + ], + "author": "GitHub Inc.", + "license": "ISC", + "dependencies": { + "@gar/promise-retry": "^1.0.0", + "@npmcli/agent": "^4.0.0", + "@npmcli/redact": "^4.0.0", + "cacache": "^20.0.1", + "http-cache-semantics": "^4.1.1", + "minipass": "^7.0.2", + "minipass-fetch": "^5.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^1.0.0", + "proc-log": "^6.0.0", + "ssri": "^13.0.0" + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.25.0", + "nock": "^13.2.4", + "safe-buffer": "^5.2.1", + "standard-version": "^9.3.2", + "tap": "^16.0.0" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "tap": { + "color": 1, + "files": "test/*.js", + "check-coverage": true, + "timeout": 60, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.25.0", + "publish": "true" + } +} diff --git a/node/node_modules/npm/node_modules/minimatch/LICENSE.md b/node/node_modules/npm/node_modules/minimatch/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..44f8c9c53f2b14f75361d957a59154316328b2a7 --- /dev/null +++ b/node/node_modules/npm/node_modules/minimatch/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +**_As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim._** diff --git a/node/node_modules/npm/node_modules/minimatch/package.json b/node/node_modules/npm/node_modules/minimatch/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9ac500a2b4730869e7211406473f9d38022d9f71 --- /dev/null +++ b/node/node_modules/npm/node_modules/minimatch/package.json @@ -0,0 +1,73 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "10.2.5", + "repository": { + "type": "git", + "url": "git@github.com:isaacs/minimatch" + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "files": [ + "dist" + ], + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write .", + "benchmark": "node benchmark/index.js", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts", + "lint": "oxlint --fix src test", + "postsnap": "npm run lint", + "postlint": "npm run format" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "devDependencies": { + "@types/node": "^25.5.0", + "mkdirp": "^3.0.1", + "oxlint": "^1.57.0", + "oxlint-tsgolint": "^0.18.1", + "prettier": "^3.8.1", + "tap": "^21.6.2", + "tshy": "^4.0.0", + "typedoc": "^0.28.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "license": "BlueOak-1.0.0", + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + }, + "selfLink": false + }, + "type": "module", + "module": "./dist/esm/index.js", + "dependencies": { + "brace-expansion": "^5.0.5" + } +} diff --git a/node/node_modules/npm/node_modules/minipass-collect/LICENSE b/node/node_modules/npm/node_modules/minipass-collect/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..838f3b5bec590d5cca68d152e35eb8035271a451 --- /dev/null +++ b/node/node_modules/npm/node_modules/minipass-collect/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2019-2023 Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/minipass-collect/index.js b/node/node_modules/npm/node_modules/minipass-collect/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f1bc3ac937ce04b8f7b7210d2a8d5087e640feba --- /dev/null +++ b/node/node_modules/npm/node_modules/minipass-collect/index.js @@ -0,0 +1,71 @@ +const { Minipass } = require('minipass') +const _data = Symbol('_data') +const _length = Symbol('_length') +class Collect extends Minipass { + constructor (options) { + super(options) + this[_data] = [] + this[_length] = 0 + } + write (chunk, encoding, cb) { + if (typeof encoding === 'function') + cb = encoding, encoding = 'utf8' + + if (!encoding) + encoding = 'utf8' + + const c = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding) + this[_data].push(c) + this[_length] += c.length + if (cb) + cb() + return true + } + end (chunk, encoding, cb) { + if (typeof chunk === 'function') + cb = chunk, chunk = null + if (typeof encoding === 'function') + cb = encoding, encoding = 'utf8' + if (chunk) + this.write(chunk, encoding) + const result = Buffer.concat(this[_data], this[_length]) + super.write(result) + return super.end(cb) + } +} +module.exports = Collect + +// it would be possible to DRY this a bit by doing something like +// this.collector = new Collect() and listening on its data event, +// but it's not much code, and we may as well save the extra obj +class CollectPassThrough extends Minipass { + constructor (options) { + super(options) + this[_data] = [] + this[_length] = 0 + } + write (chunk, encoding, cb) { + if (typeof encoding === 'function') + cb = encoding, encoding = 'utf8' + + if (!encoding) + encoding = 'utf8' + + const c = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding) + this[_data].push(c) + this[_length] += c.length + return super.write(chunk, encoding, cb) + } + end (chunk, encoding, cb) { + if (typeof chunk === 'function') + cb = chunk, chunk = null + if (typeof encoding === 'function') + cb = encoding, encoding = 'utf8' + if (chunk) + this.write(chunk, encoding) + const result = Buffer.concat(this[_data], this[_length]) + this.emit('collect', result) + return super.end(cb) + } +} +module.exports.PassThrough = CollectPassThrough diff --git a/node/node_modules/npm/node_modules/minipass-collect/package.json b/node/node_modules/npm/node_modules/minipass-collect/package.json new file mode 100644 index 0000000000000000000000000000000000000000..dec79ec9a4eb30d8c41e3e131cbfb73e810e898f --- /dev/null +++ b/node/node_modules/npm/node_modules/minipass-collect/package.json @@ -0,0 +1,30 @@ +{ + "name": "minipass-collect", + "version": "2.0.1", + "description": "A Minipass stream that collects all the data into a single chunk", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^16.3.8" + }, + "dependencies": { + "minipass": "^7.0.3" + }, + "files": [ + "index.js" + ], + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "repository": "https://github.com/isaacs/minipass-collect" +} diff --git a/node/node_modules/npm/node_modules/minipass-fetch/LICENSE b/node/node_modules/npm/node_modules/minipass-fetch/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..51c1c3c75ea72c098b39c3fa695c7ea60a118eb0 --- /dev/null +++ b/node/node_modules/npm/node_modules/minipass-fetch/LICENSE @@ -0,0 +1,28 @@ +The MIT License (MIT) + +Copyright (c) Isaac Z. Schlueter and Contributors +Copyright (c) 2016 David Frank + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +Note: This is a derivative work based on "node-fetch" by David Frank, +modified and distributed under the terms of the MIT license above. +https://github.com/bitinn/node-fetch diff --git a/node/node_modules/npm/node_modules/minipass-fetch/package.json b/node/node_modules/npm/node_modules/minipass-fetch/package.json new file mode 100644 index 0000000000000000000000000000000000000000..e87728a3357fed65dee5ec1946d82c4412362082 --- /dev/null +++ b/node/node_modules/npm/node_modules/minipass-fetch/package.json @@ -0,0 +1,70 @@ +{ + "name": "minipass-fetch", + "version": "5.0.2", + "description": "An implementation of window.fetch in Node.js using Minipass streams", + "license": "MIT", + "main": "lib/index.js", + "scripts": { + "test:tls-fixtures": "./test/fixtures/tls/setup.sh", + "test": "tap", + "snap": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "posttest": "npm run lint", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "tap": { + "coverage-map": "map.js", + "check-coverage": true, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "@ungap/url-search-params": "^0.2.2", + "abort-controller": "^3.0.0", + "abortcontroller-polyfill": "~1.7.3", + "form-data": "^4.0.0", + "iconv-lite": "^0.7.2", + "nock": "^13.2.4", + "parted": "^0.1.1", + "string-to-arraybuffer": "^1.0.2", + "tap": "^16.0.0" + }, + "dependencies": { + "minipass": "^7.0.3", + "minipass-sized": "^2.0.0", + "minizlib": "^3.0.1" + }, + "optionalDependencies": { + "iconv-lite": "^0.7.2" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/minipass-fetch.git" + }, + "keywords": [ + "fetch", + "minipass", + "node-fetch", + "window.fetch" + ], + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "author": "GitHub Inc.", + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": "true" + } +} diff --git a/node/node_modules/npm/node_modules/minipass-flush/LICENSE.md b/node/node_modules/npm/node_modules/minipass-flush/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..3da8747dc3a48e2da66615e4116cefcfde495d7c --- /dev/null +++ b/node/node_modules/npm/node_modules/minipass-flush/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** diff --git a/node/node_modules/npm/node_modules/minipass-flush/index.js b/node/node_modules/npm/node_modules/minipass-flush/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4ed0391f2f5f9a46b45299619ee47c60c181f36c --- /dev/null +++ b/node/node_modules/npm/node_modules/minipass-flush/index.js @@ -0,0 +1,39 @@ +const { Minipass } = require('minipass') +const _flush = Symbol('_flush') +const _flushed = Symbol('_flushed') +const _flushing = Symbol('_flushing') +class Flush extends Minipass { + constructor (opt = {}) { + if (typeof opt === 'function') + opt = { flush: opt } + + super(opt) + + // or extend this class and provide a 'flush' method in your subclass + if (typeof opt.flush !== 'function' && typeof this.flush !== 'function') + throw new TypeError('must provide flush function in options') + + this[_flush] = opt.flush || this.flush + } + + emit (ev, ...data) { + if ((ev !== 'end' && ev !== 'finish') || this[_flushed]) + return super.emit(ev, ...data) + + if (this[_flushing]) + return + + this[_flushing] = true + + const afterFlush = er => { + this[_flushed] = true + er ? super.emit('error', er) : super.emit('end') + } + + const ret = this[_flush](afterFlush) + if (ret && ret.then) + ret.then(() => afterFlush(), er => afterFlush(er)) + } +} + +module.exports = Flush diff --git a/node/node_modules/npm/node_modules/minipass-flush/package.json b/node/node_modules/npm/node_modules/minipass-flush/package.json new file mode 100644 index 0000000000000000000000000000000000000000..b270662a0673b3b813d86e3a2f37976181911d42 --- /dev/null +++ b/node/node_modules/npm/node_modules/minipass-flush/package.json @@ -0,0 +1,39 @@ +{ + "name": "minipass-flush", + "version": "1.0.6", + "description": "A Minipass stream that calls a flush function before emitting 'end'", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "BlueOak-1.0.0", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^15.1.6" + }, + "dependencies": { + "minipass": "^7.1.3" + }, + "files": [ + "index.js" + ], + "main": "index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/minipass-flush.git" + }, + "keywords": [ + "minipass", + "flush", + "stream" + ], + "engines": { + "node": ">=16 || 14 >=14.17" + } +} diff --git a/node/node_modules/npm/node_modules/minipass-pipeline/LICENSE b/node/node_modules/npm/node_modules/minipass-pipeline/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..32eb517086ebb24cfe3dd076033211d444186dc9 --- /dev/null +++ b/node/node_modules/npm/node_modules/minipass-pipeline/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/minipass-pipeline/index.js b/node/node_modules/npm/node_modules/minipass-pipeline/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ae5dc455c17ef7c6d2403c55198c792e7c896e15 --- /dev/null +++ b/node/node_modules/npm/node_modules/minipass-pipeline/index.js @@ -0,0 +1,128 @@ +const Minipass = require('minipass') +const EE = require('events') +const isStream = s => s && s instanceof EE && ( + typeof s.pipe === 'function' || // readable + (typeof s.write === 'function' && typeof s.end === 'function') // writable +) + +const _head = Symbol('_head') +const _tail = Symbol('_tail') +const _linkStreams = Symbol('_linkStreams') +const _setHead = Symbol('_setHead') +const _setTail = Symbol('_setTail') +const _onError = Symbol('_onError') +const _onData = Symbol('_onData') +const _onEnd = Symbol('_onEnd') +const _onDrain = Symbol('_onDrain') +const _streams = Symbol('_streams') +class Pipeline extends Minipass { + constructor (opts, ...streams) { + if (isStream(opts)) { + streams.unshift(opts) + opts = {} + } + + super(opts) + this[_streams] = [] + if (streams.length) + this.push(...streams) + } + + [_linkStreams] (streams) { + // reduce takes (left,right), and we return right to make it the + // new left value. + return streams.reduce((src, dest) => { + src.on('error', er => dest.emit('error', er)) + src.pipe(dest) + return dest + }) + } + + push (...streams) { + this[_streams].push(...streams) + if (this[_tail]) + streams.unshift(this[_tail]) + + const linkRet = this[_linkStreams](streams) + + this[_setTail](linkRet) + if (!this[_head]) + this[_setHead](streams[0]) + } + + unshift (...streams) { + this[_streams].unshift(...streams) + if (this[_head]) + streams.push(this[_head]) + + const linkRet = this[_linkStreams](streams) + this[_setHead](streams[0]) + if (!this[_tail]) + this[_setTail](linkRet) + } + + destroy (er) { + // set fire to the whole thing. + this[_streams].forEach(s => + typeof s.destroy === 'function' && s.destroy()) + return super.destroy(er) + } + + // readable interface -> tail + [_setTail] (stream) { + this[_tail] = stream + stream.on('error', er => this[_onError](stream, er)) + stream.on('data', chunk => this[_onData](stream, chunk)) + stream.on('end', () => this[_onEnd](stream)) + stream.on('finish', () => this[_onEnd](stream)) + } + + // errors proxied down the pipeline + // they're considered part of the "read" interface + [_onError] (stream, er) { + if (stream === this[_tail]) + this.emit('error', er) + } + [_onData] (stream, chunk) { + if (stream === this[_tail]) + super.write(chunk) + } + [_onEnd] (stream) { + if (stream === this[_tail]) + super.end() + } + pause () { + super.pause() + return this[_tail] && this[_tail].pause && this[_tail].pause() + } + + // NB: Minipass calls its internal private [RESUME] method during + // pipe drains, to avoid hazards where stream.resume() is overridden. + // Thus, we need to listen to the resume *event*, not override the + // resume() method, and proxy *that* to the tail. + emit (ev, ...args) { + if (ev === 'resume' && this[_tail] && this[_tail].resume) + this[_tail].resume() + return super.emit(ev, ...args) + } + + // writable interface -> head + [_setHead] (stream) { + this[_head] = stream + stream.on('drain', () => this[_onDrain](stream)) + } + [_onDrain] (stream) { + if (stream === this[_head]) + this.emit('drain') + } + write (chunk, enc, cb) { + return this[_head].write(chunk, enc, cb) && + (this.flowing || this.buffer.length === 0) + } + end (chunk, enc, cb) { + this[_head].end(chunk, enc, cb) + return this + } +} + +module.exports = Pipeline diff --git a/node/node_modules/npm/node_modules/minipass-pipeline/package.json b/node/node_modules/npm/node_modules/minipass-pipeline/package.json new file mode 100644 index 0000000000000000000000000000000000000000..f9b1f2ae1a892dcf9b15ac9a78daa5f99bb3d938 --- /dev/null +++ b/node/node_modules/npm/node_modules/minipass-pipeline/package.json @@ -0,0 +1,29 @@ +{ + "name": "minipass-pipeline", + "version": "1.2.4", + "description": "create a pipeline of streams using Minipass", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^14.6.9" + }, + "dependencies": { + "minipass": "^3.0.0" + }, + "files": [ + "index.js" + ], + "engines": { + "node": ">=8" + } +} diff --git a/node/node_modules/npm/node_modules/minipass-sized/LICENSE b/node/node_modules/npm/node_modules/minipass-sized/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..32eb517086ebb24cfe3dd076033211d444186dc9 --- /dev/null +++ b/node/node_modules/npm/node_modules/minipass-sized/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/minipass-sized/package.json b/node/node_modules/npm/node_modules/minipass-sized/package.json new file mode 100644 index 0000000000000000000000000000000000000000..17d68715422eff99bad5898624666c7402a93826 --- /dev/null +++ b/node/node_modules/npm/node_modules/minipass-sized/package.json @@ -0,0 +1,69 @@ +{ + "name": "minipass-sized", + "version": "2.0.0", + "description": "A Minipass stream that raises an error if you get a different number of bytes than expected", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "files": [ + "dist" + ], + "scripts": { + "test": "tap", + "snap": "tap", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "prepare": "tshy", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "format": "prettier --write . --log-level warn", + "typedoc": "typedoc" + }, + "devDependencies": { + "prettier": "^3.7.4", + "tap": "^21.5.0", + "tshy": "^3.1.0", + "typedoc": "^0.28.15" + }, + "dependencies": { + "minipass": "^7.1.2" + }, + "main": "./dist/commonjs/index.js", + "keywords": [ + "minipass", + "size", + "length" + ], + "directories": { + "test": "test" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/minipass-sized.git" + }, + "engines": { + "node": ">=8" + }, + "type": "module", + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js" +} diff --git a/node/node_modules/npm/node_modules/minipass/LICENSE.md b/node/node_modules/npm/node_modules/minipass/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..3da8747dc3a48e2da66615e4116cefcfde495d7c --- /dev/null +++ b/node/node_modules/npm/node_modules/minipass/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** diff --git a/node/node_modules/npm/node_modules/minipass/package.json b/node/node_modules/npm/node_modules/minipass/package.json new file mode 100644 index 0000000000000000000000000000000000000000..254230db113cefb41595c357942df1bb4a90c995 --- /dev/null +++ b/node/node_modules/npm/node_modules/minipass/package.json @@ -0,0 +1,77 @@ +{ + "name": "minipass", + "version": "7.1.3", + "description": "minimal implementation of a PassThrough stream", + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js", + "type": "module", + "tshy": { + "selfLink": false, + "compiler": "tsgo", + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "files": [ + "dist" + ], + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write . --loglevel warn", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "prettier": { + "semi": false, + "printWidth": 75, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "devDependencies": { + "@types/end-of-stream": "^1.4.2", + "@types/node": "^25.2.3", + "end-of-stream": "^1.4.0", + "node-abort-controller": "^3.1.1", + "prettier": "^3.8.1", + "tap": "^21.6.1", + "through2": "^2.0.3", + "tshy": "^3.3.2", + "typedoc": "^0.28.17" + }, + "repository": "https://github.com/isaacs/minipass", + "keywords": [ + "passthrough", + "stream" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } +} diff --git a/node/node_modules/npm/node_modules/minizlib/LICENSE b/node/node_modules/npm/node_modules/minizlib/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..18668003977b9416e306f1b5de942aacf02198bc --- /dev/null +++ b/node/node_modules/npm/node_modules/minizlib/LICENSE @@ -0,0 +1,26 @@ +Minizlib was created by Isaac Z. Schlueter. +It is a derivative work of the Node.js project. + +""" +Copyright (c) 2017-2023 Isaac Z. Schlueter and Contributors +Copyright (c) 2017-2023 Node.js contributors. All rights reserved. +Copyright (c) 2017-2023 Joyent, Inc. and other Node contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +""" diff --git a/node/node_modules/npm/node_modules/minizlib/package.json b/node/node_modules/npm/node_modules/minizlib/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d989285ce2b1bf9b53d7b4b3bd3efe987f5d44b3 --- /dev/null +++ b/node/node_modules/npm/node_modules/minizlib/package.json @@ -0,0 +1,80 @@ +{ + "name": "minizlib", + "version": "3.1.0", + "description": "A small fast zlib stream built on [minipass](http://npm.im/minipass) and Node.js's zlib binding.", + "main": "./dist/commonjs/index.js", + "dependencies": { + "minipass": "^7.1.2" + }, + "scripts": { + "prepare": "tshy", + "pretest": "npm run prepare", + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "format": "prettier --write . --loglevel warn", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/minizlib.git" + }, + "keywords": [ + "zlib", + "gzip", + "gunzip", + "deflate", + "inflate", + "compression", + "zip", + "unzip" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "MIT", + "devDependencies": { + "@types/node": "^24.5.2", + "tap": "^21.1.0", + "tshy": "^3.0.2", + "typedoc": "^0.28.1" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">= 18" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "types": "./dist/commonjs/index.d.ts", + "type": "module", + "prettier": { + "semi": false, + "printWidth": 75, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "module": "./dist/esm/index.js" +} diff --git a/node/node_modules/npm/node_modules/ms/index.js b/node/node_modules/npm/node_modules/ms/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3569375812bbfb3f2a21c3d16beb281b18e21c91 --- /dev/null +++ b/node/node_modules/npm/node_modules/ms/index.js @@ -0,0 +1,162 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function (val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} diff --git a/node/node_modules/npm/node_modules/ms/license.md b/node/node_modules/npm/node_modules/ms/license.md new file mode 100644 index 0000000000000000000000000000000000000000..3ac09b74371419c6dccca0100b8112ac903366d4 --- /dev/null +++ b/node/node_modules/npm/node_modules/ms/license.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 Vercel, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node/node_modules/npm/node_modules/ms/package.json b/node/node_modules/npm/node_modules/ms/package.json new file mode 100644 index 0000000000000000000000000000000000000000..b14dcdcfa90b683d227bdaebb6e5c7332fe933af --- /dev/null +++ b/node/node_modules/npm/node_modules/ms/package.json @@ -0,0 +1,38 @@ +{ + "name": "ms", + "version": "2.1.3", + "description": "Tiny millisecond conversion utility", + "repository": "vercel/ms", + "main": "./index", + "files": [ + "index.js" + ], + "scripts": { + "precommit": "lint-staged", + "lint": "eslint lib/* bin/*", + "test": "mocha tests.js" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } + }, + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, + "license": "MIT", + "devDependencies": { + "eslint": "4.18.2", + "expect.js": "0.3.1", + "husky": "0.14.3", + "lint-staged": "5.0.0", + "mocha": "4.0.1", + "prettier": "2.0.5" + } +} diff --git a/node/node_modules/npm/node_modules/mute-stream/LICENSE b/node/node_modules/npm/node_modules/mute-stream/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..32eb517086ebb24cfe3dd076033211d444186dc9 --- /dev/null +++ b/node/node_modules/npm/node_modules/mute-stream/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/mute-stream/package.json b/node/node_modules/npm/node_modules/mute-stream/package.json new file mode 100644 index 0000000000000000000000000000000000000000..062a2b17519919b465771445d77779939ab918f7 --- /dev/null +++ b/node/node_modules/npm/node_modules/mute-stream/package.json @@ -0,0 +1,54 @@ +{ + "name": "mute-stream", + "version": "3.0.0", + "main": "lib/index.js", + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "tap": "^16.3.0" + }, + "scripts": { + "test": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/mute-stream.git" + }, + "keywords": [ + "mute", + "stream", + "pipe" + ], + "author": "GitHub Inc.", + "license": "ISC", + "description": "Bytes go in, but they don't come out (when muted).", + "files": [ + "bin/", + "lib/" + ], + "tap": { + "statements": 70, + "branches": 60, + "functions": 81, + "lines": 70, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": true + } +} diff --git a/node/node_modules/npm/node_modules/negotiator/HISTORY.md b/node/node_modules/npm/node_modules/negotiator/HISTORY.md new file mode 100644 index 0000000000000000000000000000000000000000..5a4dab835aeaea9119d34a27aed87f4ec8a3d224 --- /dev/null +++ b/node/node_modules/npm/node_modules/negotiator/HISTORY.md @@ -0,0 +1,114 @@ +1.0.0 / 2024-08-31 +================== + + * Drop support for node <18 + * Added an option preferred encodings array #59 + +0.6.3 / 2022-01-22 +================== + + * Revert "Lazy-load modules from main entry point" + +0.6.2 / 2019-04-29 +================== + + * Fix sorting charset, encoding, and language with extra parameters + +0.6.1 / 2016-05-02 +================== + + * perf: improve `Accept` parsing speed + * perf: improve `Accept-Charset` parsing speed + * perf: improve `Accept-Encoding` parsing speed + * perf: improve `Accept-Language` parsing speed + +0.6.0 / 2015-09-29 +================== + + * Fix including type extensions in parameters in `Accept` parsing + * Fix parsing `Accept` parameters with quoted equals + * Fix parsing `Accept` parameters with quoted semicolons + * Lazy-load modules from main entry point + * perf: delay type concatenation until needed + * perf: enable strict mode + * perf: hoist regular expressions + * perf: remove closures getting spec properties + * perf: remove a closure from media type parsing + * perf: remove property delete from media type parsing + +0.5.3 / 2015-05-10 +================== + + * Fix media type parameter matching to be case-insensitive + +0.5.2 / 2015-05-06 +================== + + * Fix comparing media types with quoted values + * Fix splitting media types with quoted commas + +0.5.1 / 2015-02-14 +================== + + * Fix preference sorting to be stable for long acceptable lists + +0.5.0 / 2014-12-18 +================== + + * Fix list return order when large accepted list + * Fix missing identity encoding when q=0 exists + * Remove dynamic building of Negotiator class + +0.4.9 / 2014-10-14 +================== + + * Fix error when media type has invalid parameter + +0.4.8 / 2014-09-28 +================== + + * Fix all negotiations to be case-insensitive + * Stable sort preferences of same quality according to client order + * Support Node.js 0.6 + +0.4.7 / 2014-06-24 +================== + + * Handle invalid provided languages + * Handle invalid provided media types + +0.4.6 / 2014-06-11 +================== + + * Order by specificity when quality is the same + +0.4.5 / 2014-05-29 +================== + + * Fix regression in empty header handling + +0.4.4 / 2014-05-29 +================== + + * Fix behaviors when headers are not present + +0.4.3 / 2014-04-16 +================== + + * Handle slashes on media params correctly + +0.4.2 / 2014-02-28 +================== + + * Fix media type sorting + * Handle media types params strictly + +0.4.1 / 2014-01-16 +================== + + * Use most specific matches + +0.4.0 / 2014-01-09 +================== + + * Remove preferred prefix from methods diff --git a/node/node_modules/npm/node_modules/negotiator/LICENSE b/node/node_modules/npm/node_modules/negotiator/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..94c5262777ae9a6152c27d641308555072a6cc53 --- /dev/null +++ b/node/node_modules/npm/node_modules/negotiator/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2012-2014 Federico Romero +Copyright (c) 2012-2014 Isaac Z. Schlueter +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/negotiator/index.js b/node/node_modules/npm/node_modules/negotiator/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8fdd7f48ad3a635eb13236fec83b0135ac3e1ad9 --- /dev/null +++ b/node/node_modules/npm/node_modules/negotiator/index.js @@ -0,0 +1,83 @@ +/*! + * negotiator + * Copyright(c) 2012 Federico Romero + * Copyright(c) 2012-2014 Isaac Z. Schlueter + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +var preferredCharsets = require('./lib/charset') +var preferredEncodings = require('./lib/encoding') +var preferredLanguages = require('./lib/language') +var preferredMediaTypes = require('./lib/mediaType') + +/** + * Module exports. + * @public + */ + +module.exports = Negotiator; +module.exports.Negotiator = Negotiator; + +/** + * Create a Negotiator instance from a request. + * @param {object} request + * @public + */ + +function Negotiator(request) { + if (!(this instanceof Negotiator)) { + return new Negotiator(request); + } + + this.request = request; +} + +Negotiator.prototype.charset = function charset(available) { + var set = this.charsets(available); + return set && set[0]; +}; + +Negotiator.prototype.charsets = function charsets(available) { + return preferredCharsets(this.request.headers['accept-charset'], available); +}; + +Negotiator.prototype.encoding = function encoding(available, opts) { + var set = this.encodings(available, opts); + return set && set[0]; +}; + +Negotiator.prototype.encodings = function encodings(available, options) { + var opts = options || {}; + return preferredEncodings(this.request.headers['accept-encoding'], available, opts.preferred); +}; + +Negotiator.prototype.language = function language(available) { + var set = this.languages(available); + return set && set[0]; +}; + +Negotiator.prototype.languages = function languages(available) { + return preferredLanguages(this.request.headers['accept-language'], available); +}; + +Negotiator.prototype.mediaType = function mediaType(available) { + var set = this.mediaTypes(available); + return set && set[0]; +}; + +Negotiator.prototype.mediaTypes = function mediaTypes(available) { + return preferredMediaTypes(this.request.headers.accept, available); +}; + +// Backwards compatibility +Negotiator.prototype.preferredCharset = Negotiator.prototype.charset; +Negotiator.prototype.preferredCharsets = Negotiator.prototype.charsets; +Negotiator.prototype.preferredEncoding = Negotiator.prototype.encoding; +Negotiator.prototype.preferredEncodings = Negotiator.prototype.encodings; +Negotiator.prototype.preferredLanguage = Negotiator.prototype.language; +Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages; +Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType; +Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes; diff --git a/node/node_modules/npm/node_modules/negotiator/package.json b/node/node_modules/npm/node_modules/negotiator/package.json new file mode 100644 index 0000000000000000000000000000000000000000..65f257c95816a1167bbae595106f209c3e0d7383 --- /dev/null +++ b/node/node_modules/npm/node_modules/negotiator/package.json @@ -0,0 +1,43 @@ +{ + "name": "negotiator", + "description": "HTTP content negotiation", + "version": "1.0.0", + "contributors": [ + "Douglas Christopher Wilson ", + "Federico Romero ", + "Isaac Z. Schlueter (http://blog.izs.me/)" + ], + "license": "MIT", + "keywords": [ + "http", + "content negotiation", + "accept", + "accept-language", + "accept-encoding", + "accept-charset" + ], + "repository": "jshttp/negotiator", + "devDependencies": { + "eslint": "7.32.0", + "eslint-plugin-markdown": "2.2.1", + "mocha": "9.1.3", + "nyc": "15.1.0" + }, + "files": [ + "lib/", + "HISTORY.md", + "LICENSE", + "index.js", + "README.md" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test:debug": "mocha --reporter spec --check-leaks --inspect --inspect-brk test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/node/node_modules/npm/node_modules/node-gyp/.release-please-manifest.json b/node/node_modules/npm/node_modules/node-gyp/.release-please-manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..94eecaadc9df1ef3910b9dc078fd23ba47a4affb --- /dev/null +++ b/node/node_modules/npm/node_modules/node-gyp/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "12.3.0" +} diff --git a/node/node_modules/npm/node_modules/node-gyp/CHANGELOG.md b/node/node_modules/npm/node_modules/node-gyp/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..16c1f4df76a05b69f5df79f6932a3a6ad624bd04 --- /dev/null +++ b/node/node_modules/npm/node_modules/node-gyp/CHANGELOG.md @@ -0,0 +1,1221 @@ +# Changelog + +## [12.3.0](https://github.com/nodejs/node-gyp/compare/v12.2.0...v12.3.0) (2026-04-21) + + +### Features + +* replace make-fetch-happen with built-in fetch ([#3302](https://github.com/nodejs/node-gyp/issues/3302)) ([393ec2b](https://github.com/nodejs/node-gyp/commit/393ec2be480195b585768eb18ac2d92b858b12db)) +* update gyp-next to v0.22.1 ([#3295](https://github.com/nodejs/node-gyp/issues/3295)) ([f4242fb](https://github.com/nodejs/node-gyp/commit/f4242fb7bf7592d71848bae5c7f8597f2718dc3f)) + + +### Bug Fixes + +* Switch to URL instead of url.resolve ([#3256](https://github.com/nodejs/node-gyp/issues/3256)) ([#3263](https://github.com/nodejs/node-gyp/issues/3263)) ([46d7576](https://github.com/nodejs/node-gyp/commit/46d75768018d10dc4b5693b35cf58f502425cbbe)) + + +### Core + +* **deps-dev:** bump neostandard from 0.12.2 to 0.13.0 ([#3289](https://github.com/nodejs/node-gyp/issues/3289)) ([19da158](https://github.com/nodejs/node-gyp/commit/19da1583b3876dce8c97263b168d9dfef637b76b)) +* improve Add-Type with -IgnoreWarnings ([#3280](https://github.com/nodejs/node-gyp/issues/3280)) ([1381458](https://github.com/nodejs/node-gyp/commit/13814583a476c85a84d5ac902c7ffa310120cb88)) + +## [12.2.0](https://github.com/nodejs/node-gyp/compare/v12.1.0...v12.2.0) (2026-01-26) + + +### Features + +* include built package version in error logs ([#3254](https://github.com/nodejs/node-gyp/issues/3254)) ([ee9cbdd](https://github.com/nodejs/node-gyp/commit/ee9cbdd6e1d40dc7c1cdc5ed6a75432c716eaf3f)) +* update gyp-next to v0.21.1 ([#3273](https://github.com/nodejs/node-gyp/issues/3273)) ([888ff2c](https://github.com/nodejs/node-gyp/commit/888ff2c48a4cf5602013b96b52c6670906976f63)) + + +### Bug Fixes + +* cpu concurrency detection on some platforms ([#3255](https://github.com/nodejs/node-gyp/issues/3255)) ([f15b79a](https://github.com/nodejs/node-gyp/commit/f15b79a03c54cea0f66d940a0d6d839df867a319)), closes [#3191](https://github.com/nodejs/node-gyp/issues/3191) +* python is no longer a valid npm config setting ([#3258](https://github.com/nodejs/node-gyp/issues/3258)) ([c7c678f](https://github.com/nodejs/node-gyp/commit/c7c678f89837d956194f326b01c5a8eb1d745db3)) +* Switch to URL instead of url.parse ([#3256](https://github.com/nodejs/node-gyp/issues/3256)) ([3f81949](https://github.com/nodejs/node-gyp/commit/3f819499d8ce6d46c646466de7b9492bf7bde663)) +* Test Windows on Python 3.14, not 3.13 ([#3262](https://github.com/nodejs/node-gyp/issues/3262)) ([7b4f315](https://github.com/nodejs/node-gyp/commit/7b4f315e4dad880c841d21df641d6dd9b68bf36b)) + + +### Core + +* **deps:** bump actions/checkout from 5 to 6 ([#3248](https://github.com/nodejs/node-gyp/issues/3248)) ([db5385c](https://github.com/nodejs/node-gyp/commit/db5385c5467e5bfb914b9954f0313c46f1f4e10d)) + + +### Doc + +* add a note about changes in gyp folder ([#3259](https://github.com/nodejs/node-gyp/issues/3259)) ([a52bc81](https://github.com/nodejs/node-gyp/commit/a52bc819f44b881854ff798865ad416430e3dce2)) +* correct typos ([#3269](https://github.com/nodejs/node-gyp/issues/3269)) ([0f2bc7d](https://github.com/nodejs/node-gyp/commit/0f2bc7d2e0665b1c7bb03e1cd8653ea330277a70)) +* remove obsolete Microsoft Node.js Guidelines link ([#3268](https://github.com/nodejs/node-gyp/issues/3268)) ([30cda26](https://github.com/nodejs/node-gyp/commit/30cda268730798dc0f67182c8c568d8b8069964e)) +* update Python manual install instructions for Windows ([#3265](https://github.com/nodejs/node-gyp/issues/3265)) ([0407877](https://github.com/nodejs/node-gyp/commit/0407877e3e26d3201f74cf1a9deabbbfc40bdbb7)) + + +### Miscellaneous + +* **deps:** upgrade tar to 7.5.4 to address CVE-2026-23950 ([#3271](https://github.com/nodejs/node-gyp/issues/3271)) ([7bf371c](https://github.com/nodejs/node-gyp/commit/7bf371c4dd7c694232ab3169d02fe8197e1ecc6d)) + +## [12.1.0](https://github.com/nodejs/node-gyp/compare/v12.0.0...v12.1.0) (2025-11-12) + + +### Features + +* Add support for Visual Studio 2026 (18.x) ([69e5fd2](https://github.com/nodejs/node-gyp/commit/69e5fd2c98ac83dad5200a47515b301ccd80d2d3)) +* Support for Visual Studio 2026 (18.x) ([69e5fd2](https://github.com/nodejs/node-gyp/commit/69e5fd2c98ac83dad5200a47515b301ccd80d2d3)) + +## [12.0.0](https://github.com/nodejs/node-gyp/compare/v11.5.0...v12.0.0) (2025-11-10) + + +### ⚠ BREAKING CHANGES + +* align to npm 11 node engine range + +### Features + +* align to npm 11 node engine range ([2f85686](https://github.com/nodejs/node-gyp/commit/2f85686bbe745673350a8f9dbb0e86ee0190f213)) +* update gyp-next to v0.21.0 ([c57cd2e](https://github.com/nodejs/node-gyp/commit/c57cd2e86dc57707475b9f7e676e189f064817de)) + + +### Core + +* **deps:** bump actions/setup-node from 5 to 6 ([ae90e63](https://github.com/nodejs/node-gyp/commit/ae90e632d9fab85f4cd902dc9205ba9dfafaf3bc)) +* **deps:** bump env-paths from 2.2.1 to 3.0.0 ([#3235](https://github.com/nodejs/node-gyp/issues/3235)) ([5fffb2f](https://github.com/nodejs/node-gyp/commit/5fffb2ffee304cc898fdea7a0cd9e41d54c53839)) +* **deps:** bump which from 5.0.0 to 6.0.0 ([#3238](https://github.com/nodejs/node-gyp/issues/3238)) ([eaa8e34](https://github.com/nodejs/node-gyp/commit/eaa8e34cb5a0710bef0602c42e5840b47eb76822)) +* make-fetch-happen@15.0.0 ([e2b9d21](https://github.com/nodejs/node-gyp/commit/e2b9d21bce27c35d18fcb6f8583e386d15ce395c)) +* nopt@9.0.0 ([9bdeaf3](https://github.com/nodejs/node-gyp/commit/9bdeaf307cd7a254946859d306465989fa39dfb2)) +* proc-log@6.0.0 ([dfc68df](https://github.com/nodejs/node-gyp/commit/dfc68dfba3c17deb0bda9a395bb49d8fb9fa5951)) + + +### Miscellaneous + +* increase test timeouts ([#3237](https://github.com/nodejs/node-gyp/issues/3237)) ([3b41971](https://github.com/nodejs/node-gyp/commit/3b41971e2f6b90e02b1d7df592d403b8dfc8fa4d)) +* setup dependabot for npm ([86d65c7](https://github.com/nodejs/node-gyp/commit/86d65c7874eb41eb49c9b8bbf342becac8e57c6f)) +* update devDependencies ([41b0cea](https://github.com/nodejs/node-gyp/commit/41b0cea2f12342a790580cc8f844f075d49e096c)) + +## [11.5.0](https://github.com/nodejs/node-gyp/compare/v11.4.2...v11.5.0) (2025-10-15) + + +### Features + +* update gyp-next to v0.20.5 ([#3222](https://github.com/nodejs/node-gyp/issues/3222)) ([848e950](https://github.com/nodejs/node-gyp/commit/848e950833b90f0b25f346710ee42e9be4797604)) + + +### Bug Fixes + +* **ci:** Run Visual Studio test on Windows 11 on ARM ([#3217](https://github.com/nodejs/node-gyp/issues/3217)) ([8bd3f63](https://github.com/nodejs/node-gyp/commit/8bd3f6354b8bd43262a4d99d58a568beab0459e8)) +* **ci:** Test on Python 3.14 release candidate 3 on Linux and macOS ([#3216](https://github.com/nodejs/node-gyp/issues/3216)) ([085b445](https://github.com/nodejs/node-gyp/commit/085b445d1c00f8f1fc6a6ff80d8a93c6643f11ee)) + + +### Core + +* **deps:** bump actions/github-script from 7 to 8 ([#3213](https://github.com/nodejs/node-gyp/issues/3213)) ([c6b968c](https://github.com/nodejs/node-gyp/commit/c6b968caf7f4e22687fc10716162675b1411f713)) +* **deps:** bump actions/setup-node from 4 to 5 ([#3211](https://github.com/nodejs/node-gyp/issues/3211)) ([921c04d](https://github.com/nodejs/node-gyp/commit/921c04d142549f172d3aeae4097c9e0af05599dd)) +* **deps:** bump actions/setup-python from 5 to 6 ([#3210](https://github.com/nodejs/node-gyp/issues/3210)) ([6b70b05](https://github.com/nodejs/node-gyp/commit/6b70b05ed21cb977214348c97c2b97515c0d08f3)) + +## [11.4.2](https://github.com/nodejs/node-gyp/compare/v11.4.1...v11.4.2) (2025-08-26) + + +### Bug Fixes + +* add adaptation for OpenHarmony platform ([#3207](https://github.com/nodejs/node-gyp/issues/3207)) ([b406532](https://github.com/nodejs/node-gyp/commit/b406532c77659c441c845708ec3ecdf09f013a3b)) + +### Miscellaneous + +* update gyp-next to v0.20.4 ([#3208](https://github.com/nodejs/node-gyp/issues/3208)) ([adc61b1](https://github.com/nodejs/node-gyp/commit/adc61b1458315d9648591e74bf16bbe39511401e)) +* **ci:** Update Node.js version matrix in `tests.yml` ([#3209](https://github.com/nodejs/node-gyp/issues/3209)) ([a4e1da6](https://github.com/nodejs/node-gyp/commit/a4e1da6683a37fde565e1ea50f1fa86fa99a83c7)) +* ruff format Python code ([#3203](https://github.com/nodejs/node-gyp/issues/3203)) ([cb30a53](https://github.com/nodejs/node-gyp/commit/cb30a538eadf49ca0310980ffb0bfdb8fcebf0a4)) + +## [11.4.1](https://github.com/nodejs/node-gyp/compare/v11.4.0...v11.4.1) (2025-08-20) + + +### Miscellaneous + +* **release:** use npm@11 for OIDC publishing ([#3202](https://github.com/nodejs/node-gyp/issues/3202)) ([6b9638a](https://github.com/nodejs/node-gyp/commit/6b9638a0f80352e5bf7c1702e6ef622a6474d44a)), closes [#3201](https://github.com/nodejs/node-gyp/issues/3201) + +## [11.4.0](https://github.com/nodejs/node-gyp/compare/v11.3.0...v11.4.0) (2025-08-19) + + +### Features + +* read from config case-insensitively ([#3198](https://github.com/nodejs/node-gyp/issues/3198)) ([5538e6c](https://github.com/nodejs/node-gyp/commit/5538e6c5d78dffd41e2a588adfa7ea9022150b9d)) +* support reading config from package.json ([#3196](https://github.com/nodejs/node-gyp/issues/3196)) ([1822dff](https://github.com/nodejs/node-gyp/commit/1822dff4f616a30ac3ca72e5946d81389cb8557e)), closes [#3156](https://github.com/nodejs/node-gyp/issues/3156) + + +### Core + +* **deps:** bump actions/checkout from 4 to 5 ([#3193](https://github.com/nodejs/node-gyp/issues/3193)) ([27f5505](https://github.com/nodejs/node-gyp/commit/27f5505ec236551081366bf8a9c13ef5d8e468bf)) + + +### Miscellaneous + +* use npm oicd connection for publishing ([#3197](https://github.com/nodejs/node-gyp/issues/3197)) ([0773615](https://github.com/nodejs/node-gyp/commit/077361502933fcb994ca365c3c07c03177503df2)) + +## [11.3.0](https://github.com/nodejs/node-gyp/compare/v11.2.0...v11.3.0) (2025-07-29) + + +### Features + +* update gyp-next to v0.20.2 ([#3169](https://github.com/nodejs/node-gyp/issues/3169)) ([0e65632](https://github.com/nodejs/node-gyp/commit/0e656322c1e94041331ab3b01bf66c2ef9bd6ead)) + + +### Bug Fixes + +* Correct Visual Studio 2019 test version ([#3153](https://github.com/nodejs/node-gyp/issues/3153)) ([7d883b5](https://github.com/nodejs/node-gyp/commit/7d883b5cf4c26e76065201f85b0be36d5ebdcc0e)) +* Normalize win32 library names ([#3189](https://github.com/nodejs/node-gyp/issues/3189)) ([b81a665](https://github.com/nodejs/node-gyp/commit/b81a665acfb9d88102e8044a8ec8ca74a3e9eccc)) +* use temp dir for tar extraction on all platforms ([#3170](https://github.com/nodejs/node-gyp/issues/3170)) ([b41864f](https://github.com/nodejs/node-gyp/commit/b41864f7c1c60e4a160c1b4dd91558dcaa3f74e4)), closes [#3165](https://github.com/nodejs/node-gyp/issues/3165) + + +### Miscellaneous + +* retry wasi-sdk download in CI ([#3151](https://github.com/nodejs/node-gyp/issues/3151)) ([8f3cd8b](https://github.com/nodejs/node-gyp/commit/8f3cd8b3a157bccd8d7110e7d46a27c2926625cd)) +* Windows 2019 has been removed from GitHub Actions ([#3190](https://github.com/nodejs/node-gyp/issues/3190)) ([3df8789](https://github.com/nodejs/node-gyp/commit/3df8789a9aa73c60707eec8f02f4e926491d6102)) + +## [11.2.0](https://github.com/nodejs/node-gyp/compare/v11.1.0...v11.2.0) (2025-04-01) + + +### Features + +* update gyp-next to v0.20.0 ([#3149](https://github.com/nodejs/node-gyp/issues/3149)) ([80e9c79](https://github.com/nodejs/node-gyp/commit/80e9c795a739c490cfbc85633e63022b36a7c70d)) + + +### Bug Fixes + +* disable msbuild.exe nodeReuse ([#3112](https://github.com/nodejs/node-gyp/issues/3112)) ([0cf16d2](https://github.com/nodejs/node-gyp/commit/0cf16d29fe604266fb47325496287a63075ea532)) +* use maxRetries on fs.rm calls ([#3113](https://github.com/nodejs/node-gyp/issues/3113)) ([a2772a7](https://github.com/nodejs/node-gyp/commit/a2772a76709f939af1e80dd8fe766ca2143aa5bf)) + + +### Tests + +* fix wasm test on Windows ([#3145](https://github.com/nodejs/node-gyp/issues/3145)) ([ee1d6fd](https://github.com/nodejs/node-gyp/commit/ee1d6fd8d83c9dd3eae7df7ec533bb6b39e1a812)) +* use maxRetries with tests too ([#3150](https://github.com/nodejs/node-gyp/issues/3150)) ([0ccbe7e](https://github.com/nodejs/node-gyp/commit/0ccbe7e90afb096b46a7818ba127a4871237952e)) + + +### Doc + +* add ffi-napi to docs/README.md ([#3138](https://github.com/nodejs/node-gyp/issues/3138)) ([4885110](https://github.com/nodejs/node-gyp/commit/48851107ad8c5d2cf18a55e8bd2764f5938e7102)) + + +### Miscellaneous + +* switch to tinyglobby ([#3133](https://github.com/nodejs/node-gyp/issues/3133)) ([c3b3ab0](https://github.com/nodejs/node-gyp/commit/c3b3ab06ee0f092cd5c0646120d57e56d41b79fc)) +* update tinyglobby ([#3136](https://github.com/nodejs/node-gyp/issues/3136)) ([b21cf87](https://github.com/nodejs/node-gyp/commit/b21cf874f58883f3fd4dd07bec3b584fb07e831d)) + +## [11.1.0](https://github.com/nodejs/node-gyp/compare/v11.0.0...v11.1.0) (2025-02-10) + + +### Features + +* update gyp-next to v0.19.1 ([#3122](https://github.com/nodejs/node-gyp/issues/3122)) ([504250e](https://github.com/nodejs/node-gyp/commit/504250e5e3e27c6ef6dcfcaa744b36e1a99c1be8)) + + +### Bug Fixes + +* Find VC.Tools.ARM64 on arm64 machine ([#3075](https://github.com/nodejs/node-gyp/issues/3075)) ([b899fae](https://github.com/nodejs/node-gyp/commit/b899faed56270d3d8496da7576b5750b264c2c21)) +* try libnode.dll first in load_exe_hook ([#2834](https://github.com/nodejs/node-gyp/issues/2834)) ([b9d10a5](https://github.com/nodejs/node-gyp/commit/b9d10a5a37081e2a731937e43eca52c83609e7f5)) + + +### Miscellaneous + +* add gyp-next updater ([#3105](https://github.com/nodejs/node-gyp/issues/3105)) ([e3f9a77](https://github.com/nodejs/node-gyp/commit/e3f9a7756f65a7f4e50799017b3dc51d5bc195b2)) +* Test on Ubuntu-24.04-arm and Node.js v23 ([#3121](https://github.com/nodejs/node-gyp/issues/3121)) ([2530f51](https://github.com/nodejs/node-gyp/commit/2530f51cec3ba595184e5bcb7fe1245e240beb59)) +* Use astral-sh/ruff-action@v3 to run the Python linter ([#3114](https://github.com/nodejs/node-gyp/issues/3114)) ([94448fc](https://github.com/nodejs/node-gyp/commit/94448fcd9f090814bce1c4361471dae199dc2e82)) + +## [11.0.0](https://github.com/nodejs/node-gyp/compare/v10.3.1...v11.0.0) (2024-12-03) + + +### ⚠ BREAKING CHANGES + +* drop node 16 support ([#3102](https://github.com/nodejs/node-gyp/issues/3102)) + +### Features + +* drop node 16 support ([#3102](https://github.com/nodejs/node-gyp/issues/3102)) ([0e6b6f8](https://github.com/nodejs/node-gyp/commit/0e6b6f8bea615cf031d76ecff9102a38e5474c72)) + + +### Miscellaneous + +* migrate from standard to neostandard ([#3103](https://github.com/nodejs/node-gyp/issues/3103)) ([a130178](https://github.com/nodejs/node-gyp/commit/a13017807d0ae7da8fa076b0bcf23153af7c60a6)) + +## [10.3.1](https://github.com/nodejs/node-gyp/compare/v10.3.0...v10.3.1) (2024-12-02) + + +### Miscellaneous + +* fix npm-publish dependencies and add provenance ([#3099](https://github.com/nodejs/node-gyp/issues/3099)) ([6dded88](https://github.com/nodejs/node-gyp/commit/6dded88065872a32f44114e60731ba4b701ec057)) + +## [10.3.0](https://github.com/nodejs/node-gyp/compare/v10.2.0...v10.3.0) (2024-11-29) + + +### Features + +* prohibit compiling with ClangCL on Windows ([#3098](https://github.com/nodejs/node-gyp/issues/3098)) ([88260bf](https://github.com/nodejs/node-gyp/commit/88260bf86aeb4c39959b78104a5edc3dc88d3aef)) + + +### Bug Fixes + +* **ci:** use correct release-please-action domain after organization url was changed ([#3032](https://github.com/nodejs/node-gyp/issues/3032)) ([d1ed3d4](https://github.com/nodejs/node-gyp/commit/d1ed3d4dc3a53b8ccab4093d002e43945bbece0e)) + + +### Miscellaneous + +* add links to Code of Conduct from root file ([#2196](https://github.com/nodejs/node-gyp/issues/2196)) ([d22e2eb](https://github.com/nodejs/node-gyp/commit/d22e2eb080807c6290533a67249c343a7605a989)) +* publish to npm with release-please ([#3051](https://github.com/nodejs/node-gyp/issues/3051)) ([8319847](https://github.com/nodejs/node-gyp/commit/831984736393a3ea8417efec5255f95d53a70785)) + +## [10.2.0](https://github.com/nodejs/node-gyp/compare/v10.1.0...v10.2.0) (2024-07-09) + + +### Features + +* allow VCINSTALLDIR to specify a portable instance ([#3036](https://github.com/nodejs/node-gyp/issues/3036)) ([d38af2e](https://github.com/nodejs/node-gyp/commit/d38af2e0c2a81b12cd221b1f8517fb89e609d62c)) +* **gyp:** update gyp to v0.18.1 ([#3039](https://github.com/nodejs/node-gyp/issues/3039)) ([ea99fea](https://github.com/nodejs/node-gyp/commit/ea99fea83485dc5be04db01df9b2fdbe05319b8e)) +* support `rebuild` and `build` for cross-compiling Node-API module to wasm on Windows ([#2974](https://github.com/nodejs/node-gyp/issues/2974)) ([6318d2b](https://github.com/nodejs/node-gyp/commit/6318d2b210224415ff5932c2863e6cc14d4583dc)) + + +### Core + +* add an arch check to VS 2019 ([#3025](https://github.com/nodejs/node-gyp/issues/3025)) ([323957b](https://github.com/nodejs/node-gyp/commit/323957b74e9586fb3fbfb2acad5040379c778de6)) +* **deps:** bump seanmiddleditch/gha-setup-ninja from 4 to 5 ([#3041](https://github.com/nodejs/node-gyp/issues/3041)) ([10f6730](https://github.com/nodejs/node-gyp/commit/10f6730be660e7a38be8a12111937e37fcf74834)) +* proc-log@4.0.0 ([#3022](https://github.com/nodejs/node-gyp/issues/3022)) ([141aa6b](https://github.com/nodejs/node-gyp/commit/141aa6bf029e6f984be8ea98aaf985e5df894082)) +* tar@6.2.1 ([#3021](https://github.com/nodejs/node-gyp/issues/3021)) ([b22d5ee](https://github.com/nodejs/node-gyp/commit/b22d5eef861892c968052ffc1c71b551f738163b)) + + +### Doc + +* `node-pre-gyp` is no longer maintained ([#3015](https://github.com/nodejs/node-gyp/issues/3015)) ([93186f1](https://github.com/nodejs/node-gyp/commit/93186f10c966b4148fc500e48f8cbffacccdfa3c)) +* add the way to configuring Python dependency for Windows PowerShell ([#2996](https://github.com/nodejs/node-gyp/issues/2996)) ([9fd7936](https://github.com/nodejs/node-gyp/commit/9fd7936f0d7232a8a79e6a7b6cbfb814d9042b13)) +* Installation -- Python >= v3.12 requires `node-gyp` >= v10 ([#3010](https://github.com/nodejs/node-gyp/issues/3010)) ([a6b48fc](https://github.com/nodejs/node-gyp/commit/a6b48fca9993e54d757cd110f6b41f8200d99ca4)) + + +### Miscellaneous + +* fix ruff command ([#3044](https://github.com/nodejs/node-gyp/issues/3044)) ([b3916d5](https://github.com/nodejs/node-gyp/commit/b3916d5b25704a53e89be16b500036a14bdc5060)) + +## [10.1.0](https://github.com/nodejs/node-gyp/compare/v10.0.1...v10.1.0) (2024-03-13) + + +### Features + +* improve visual studio detection ([#2957](https://github.com/nodejs/node-gyp/issues/2957)) ([109e3d4](https://github.com/nodejs/node-gyp/commit/109e3d4245504a7b75c99f578e1203c0ef4b518e)) + + +### Core + +* add support for locally installed headers ([#2964](https://github.com/nodejs/node-gyp/issues/2964)) ([3298731](https://github.com/nodejs/node-gyp/commit/329873141f0d3e3787d3c006801431da04e4ed0c)) +* **deps:** bump actions/setup-python from 4 to 5 ([#2960](https://github.com/nodejs/node-gyp/issues/2960)) ([3f0df7e](https://github.com/nodejs/node-gyp/commit/3f0df7e9334e49e8c7f6fdbbb9e1e6c5a8cca53b)) +* **deps:** bump google-github-actions/release-please-action ([#2961](https://github.com/nodejs/node-gyp/issues/2961)) ([b1f1808](https://github.com/nodejs/node-gyp/commit/b1f1808bfff0d51e6d3eb696ab6a5b89b7b9630c)) +* print Python executable path using UTF-8 ([#2995](https://github.com/nodejs/node-gyp/issues/2995)) ([c472912](https://github.com/nodejs/node-gyp/commit/c4729129daa9bb5204246b857826fb391ac961e1)) +* update supported vs versions ([#2959](https://github.com/nodejs/node-gyp/issues/2959)) ([391cc5b](https://github.com/nodejs/node-gyp/commit/391cc5b9b25cffe0cb2edcba3583414a771b4a15)) + + +### Doc + +* npm is currently v10 ([#2970](https://github.com/nodejs/node-gyp/issues/2970)) ([7705a22](https://github.com/nodejs/node-gyp/commit/7705a22f31a62076e9f8429780a459f4ad71ea4c)) +* remove outdated Node versions from readme ([#2955](https://github.com/nodejs/node-gyp/issues/2955)) ([ae8478e](https://github.com/nodejs/node-gyp/commit/ae8478ec32d9b2fa71b591ac22cdf867ef2e9a7d)) +* remove outdated update engines.node reference in 10.0.0 changelog ([b42e796](https://github.com/nodejs/node-gyp/commit/b42e7966177f006f3d1aab1d27885d8372c8ed01)) + + +### Miscellaneous + +* only run release please on push ([cff9ac2](https://github.com/nodejs/node-gyp/commit/cff9ac2c3083769a383e00bc60b91562f03116e3)) +* upgrade release please action from v2 to v4 ([#2982](https://github.com/nodejs/node-gyp/issues/2982)) ([0035d8e](https://github.com/nodejs/node-gyp/commit/0035d8e9dc98b94f0bc8cd9023a6fa635003703e)) + +### [10.0.1](https://www.github.com/nodejs/node-gyp/compare/v10.0.0...v10.0.1) (2023-11-02) + + +### Bug Fixes + +* use local `util` for `findAccessibleSync()` ([b39e681](https://www.github.com/nodejs/node-gyp/commit/b39e6819aa9e2c45107d6e60a4913ca036ebfbfd)) + + +### Miscellaneous + +* add parallel test logging ([7de1f5f](https://www.github.com/nodejs/node-gyp/commit/7de1f5f32d550d26d48fe4f76aed5866744edcba)) +* lint fixes ([4e0ed99](https://www.github.com/nodejs/node-gyp/commit/4e0ed992566f43abc6e988af091ad07fde04acbf)) +* use platform specific timeouts in tests ([a68586a](https://www.github.com/nodejs/node-gyp/commit/a68586a67d0af238300662cc062422b42820044d)) + +## [10.0.0](https://www.github.com/nodejs/node-gyp/compare/v9.4.0...v10.0.0) (2023-10-28) + + +### ⚠ BREAKING CHANGES + +* use .npmignore file to limit which files are published (#2921) +* the `Gyp` class exported is now created using ECMAScript classes and therefore might have small differences to classes that were previously created with `util.inherits`. +* All internal functions have been coverted to return promises and no longer accept callbacks. This is not a breaking change for users but may be breaking to consumers of `node-gyp` if you are requiring internal functions directly. +* `node-gyp` now supports node `^16.14.0 || >=18.0.0` + +### Features + +* convert all internal functions to async/await ([355622f](https://www.github.com/nodejs/node-gyp/commit/355622f4aac3bd3056b9e03aac5fa2f42a4b3576)) +* convert internal classes from util.inherits to classes ([d52997e](https://www.github.com/nodejs/node-gyp/commit/d52997e975b9da6e0cea3d9b99873e9ddc768679)) +* drop node 14 support ([#2929](https://www.github.com/nodejs/node-gyp/issues/2929)) ([1b3bd34](https://www.github.com/nodejs/node-gyp/commit/1b3bd341b40f384988d03207ce8187e93ba609bc)) +* drop rimraf dependency ([4a50fe3](https://www.github.com/nodejs/node-gyp/commit/4a50fe31574217c4b2a798fc72b19947a64ceea1)) +* **gyp:** update gyp to v0.16.1 ([#2923](https://www.github.com/nodejs/node-gyp/issues/2923)) ([707927c](https://www.github.com/nodejs/node-gyp/commit/707927cd579205ef2b4b17e61c1cce24c056b452)) +* replace npmlog with proc-log ([4a50fe3](https://www.github.com/nodejs/node-gyp/commit/4a50fe31574217c4b2a798fc72b19947a64ceea1)) +* update engines.node to ^14.17.0 || ^16.13.0 || >=18.0.0 ([4a50fe3](https://www.github.com/nodejs/node-gyp/commit/4a50fe31574217c4b2a798fc72b19947a64ceea1)) +* use .npmignore file to limit which files are published ([#2921](https://www.github.com/nodejs/node-gyp/issues/2921)) ([864a979](https://www.github.com/nodejs/node-gyp/commit/864a979930cf0ef5ad64bc887b901fa8955d058f)) + + +### Bug Fixes + +* create Python symlink only during builds, and clean it up after ([#2721](https://www.github.com/nodejs/node-gyp/issues/2721)) ([0f1f667](https://www.github.com/nodejs/node-gyp/commit/0f1f667b737d21905e283df100a2cb639993562a)) +* promisify build command ([4a50fe3](https://www.github.com/nodejs/node-gyp/commit/4a50fe31574217c4b2a798fc72b19947a64ceea1)) +* use fs/promises in favor of fs.promises ([4a50fe3](https://www.github.com/nodejs/node-gyp/commit/4a50fe31574217c4b2a798fc72b19947a64ceea1)) + + +### Tests + +* increase mocha timeout ([#2887](https://www.github.com/nodejs/node-gyp/issues/2887)) ([445c28f](https://www.github.com/nodejs/node-gyp/commit/445c28fabc5fbdf9c3bb3341fb70660a3530f6ad)) +* update expired certs ([#2908](https://www.github.com/nodejs/node-gyp/issues/2908)) ([5746691](https://www.github.com/nodejs/node-gyp/commit/5746691a36f7b37019d4b8d4e9616aec43d20410)) + + +### Doc + +* Add note about Python symlinks (PR 2362) to CHANGELOG.md for 9.1.0 ([#2783](https://www.github.com/nodejs/node-gyp/issues/2783)) ([b3d41ae](https://www.github.com/nodejs/node-gyp/commit/b3d41aeb737ddd54cc292f363abc561dcc0a614e)) +* README.md Do not hardcode the supported versions of Python ([#2880](https://www.github.com/nodejs/node-gyp/issues/2880)) ([bb93b94](https://www.github.com/nodejs/node-gyp/commit/bb93b946a9c74934b59164deb52128cf913c97d5)) +* update applicable GitHub links from master to main ([#2843](https://www.github.com/nodejs/node-gyp/issues/2843)) ([d644ce4](https://www.github.com/nodejs/node-gyp/commit/d644ce48311edf090d0e920ad449e5766c757933)) +* Update windows installation instructions in README.md ([#2882](https://www.github.com/nodejs/node-gyp/issues/2882)) ([c9caa2e](https://www.github.com/nodejs/node-gyp/commit/c9caa2ecf3c7deae68444ce8fabb32d2dca651cd)) + + +### Core + +* find python checks order changed on windows ([#2872](https://www.github.com/nodejs/node-gyp/issues/2872)) ([b030555](https://www.github.com/nodejs/node-gyp/commit/b030555cdb754d9c23906e7e707115cd077bbf76)) +* glob@10.3.10 ([#2926](https://www.github.com/nodejs/node-gyp/issues/2926)) ([4bef1ec](https://www.github.com/nodejs/node-gyp/commit/4bef1ecc7554097d92beb397fbe1a546c5227545)) +* glob@8.0.3 ([4a50fe3](https://www.github.com/nodejs/node-gyp/commit/4a50fe31574217c4b2a798fc72b19947a64ceea1)) +* make-fetch-happen@13.0.0 ([#2927](https://www.github.com/nodejs/node-gyp/issues/2927)) ([059bb6f](https://www.github.com/nodejs/node-gyp/commit/059bb6fd41bb50955a9efbd97887773d60d53221)) +* nopt@^7.0.0 ([4a50fe3](https://www.github.com/nodejs/node-gyp/commit/4a50fe31574217c4b2a798fc72b19947a64ceea1)) +* standard@17.0.0 and fix linting errors ([4a50fe3](https://www.github.com/nodejs/node-gyp/commit/4a50fe31574217c4b2a798fc72b19947a64ceea1)) +* which@3.0.0 ([4a50fe3](https://www.github.com/nodejs/node-gyp/commit/4a50fe31574217c4b2a798fc72b19947a64ceea1)) +* which@4.0.0 ([#2928](https://www.github.com/nodejs/node-gyp/issues/2928)) ([e388255](https://www.github.com/nodejs/node-gyp/commit/e38825531403aabeae7abe58e76867f31b832f36)) + + +### Miscellaneous + +* add check engines script to CI ([#2922](https://www.github.com/nodejs/node-gyp/issues/2922)) ([21a7249](https://www.github.com/nodejs/node-gyp/commit/21a7249b40d8f95e7721e450fd18764adb1648a7)) +* empty commit to add changelog entries from [#2770](https://www.github.com/nodejs/node-gyp/issues/2770) ([4a50fe3](https://www.github.com/nodejs/node-gyp/commit/4a50fe31574217c4b2a798fc72b19947a64ceea1)) +* GitHub Workflows security hardening ([#2740](https://www.github.com/nodejs/node-gyp/issues/2740)) ([26683e9](https://www.github.com/nodejs/node-gyp/commit/26683e993df038fb94d89f2276f3535e4522d79a)) +* misc testing fixes ([#2930](https://www.github.com/nodejs/node-gyp/issues/2930)) ([4e493d4](https://www.github.com/nodejs/node-gyp/commit/4e493d4fb262d12ac52c84979071ccc79e666a1a)) +* run tests after release please PR ([3032e10](https://www.github.com/nodejs/node-gyp/commit/3032e1061cc2b7b49f83c397d385bafddc6b0214)) + +## [9.4.0](https://www.github.com/nodejs/node-gyp/compare/v9.3.1...v9.4.0) (2023-06-12) + + +### Features + +* add support for native windows arm64 build tools ([bb76021](https://www.github.com/nodejs/node-gyp/commit/bb76021d35964d2bb125bc6214286f35ae4e6cad)) +* Upgrade Python linting from flake8 to ruff ([#2815](https://www.github.com/nodejs/node-gyp/issues/2815)) ([fc0ddc6](https://www.github.com/nodejs/node-gyp/commit/fc0ddc6523c62b10e5ca1257500b3ceac01450a7)) + + +### Bug Fixes + +* extract tarball to temp directory on Windows ([#2846](https://www.github.com/nodejs/node-gyp/issues/2846)) ([aaa117c](https://www.github.com/nodejs/node-gyp/commit/aaa117c514430aa2c1e568b95df1b6ed1c1fd3b6)) +* log statement is for devDir not nodedir ([#2840](https://www.github.com/nodejs/node-gyp/issues/2840)) ([55048f8](https://www.github.com/nodejs/node-gyp/commit/55048f8be5707c295fb0876306aded75638a8b63)) + + +### Miscellaneous + +* get update-gyp.py to work with Python >= v3.5 ([#2826](https://www.github.com/nodejs/node-gyp/issues/2826)) ([337e8e6](https://www.github.com/nodejs/node-gyp/commit/337e8e68209bd2481cbb11dacce61234dc5c9419)) + + +### Doc + +* docs/README.md add advise about deprecated node-sass ([#2828](https://www.github.com/nodejs/node-gyp/issues/2828)) ([6f3c2d3](https://www.github.com/nodejs/node-gyp/commit/6f3c2d3c6c0de0dbf8c7245f34c2e0b3eea53812)) +* Update README.md ([#2822](https://www.github.com/nodejs/node-gyp/issues/2822)) ([c7927e2](https://www.github.com/nodejs/node-gyp/commit/c7927e228dfde059c93e08c26b54dd8026144583)) + + +### Tests + +* remove deprecated Node.js and Python ([#2868](https://www.github.com/nodejs/node-gyp/issues/2868)) ([a0b3d1c](https://www.github.com/nodejs/node-gyp/commit/a0b3d1c3afed71a74501476fcbc6ee3fface4d13)) + +### [9.3.1](https://www.github.com/nodejs/node-gyp/compare/v9.3.0...v9.3.1) (2022-12-16) + + +### Bug Fixes + +* increase node 12 support to ^12.13 ([#2771](https://www.github.com/nodejs/node-gyp/issues/2771)) ([888efb9](https://www.github.com/nodejs/node-gyp/commit/888efb9055857afee6a6b54550722cf9ae3ee323)) + + +### Miscellaneous + +* update python test matrix ([#2774](https://www.github.com/nodejs/node-gyp/issues/2774)) ([38f01fa](https://www.github.com/nodejs/node-gyp/commit/38f01fa57d10fdb3db7697121d957bc2e0e96508)) + +## [9.3.0](https://www.github.com/nodejs/node-gyp/compare/v9.2.0...v9.3.0) (2022-10-10) + + +### Features + +* **gyp:** update gyp to v0.14.0 ([#2749](https://www.github.com/nodejs/node-gyp/issues/2749)) ([713b8dc](https://www.github.com/nodejs/node-gyp/commit/713b8dcdbf44532ca9453a127da266386cc737f8)) +* remove support for VS2015 in Node.js >=19 ([#2746](https://www.github.com/nodejs/node-gyp/issues/2746)) ([131d1a4](https://www.github.com/nodejs/node-gyp/commit/131d1a463baf034a04154bcda753a8295f112a34)) +* support IBM Open XL C/C++ on z/OS ([#2743](https://www.github.com/nodejs/node-gyp/issues/2743)) ([7d0c83d](https://www.github.com/nodejs/node-gyp/commit/7d0c83d2a95aca743dff972826d0da26203acfc4)) + +## [9.2.0](https://www.github.com/nodejs/node-gyp/compare/v9.1.0...v9.2.0) (2022-10-02) + + +### Features + +* Add proper support for IBM i ([a26494f](https://www.github.com/nodejs/node-gyp/commit/a26494fbb8883d9ef784503979e115dec3e2791e)) +* **gyp:** update gyp to v0.13.0 ([3e2a532](https://www.github.com/nodejs/node-gyp/commit/3e2a5324f1c24f3a04bca04cf54fe23d5c4d5e50)) + + +### Bug Fixes + +* node.js debugger adds stderr (but exit code is 0) -> shouldn't throw ([#2719](https://www.github.com/nodejs/node-gyp/issues/2719)) ([c379a74](https://www.github.com/nodejs/node-gyp/commit/c379a744c65c7ab07c2c3193d9c7e8f25ae1b05e)) + + +### Core + +* enable support for zoslib on z/OS ([#2600](https://www.github.com/nodejs/node-gyp/issues/2600)) ([83c0a12](https://www.github.com/nodejs/node-gyp/commit/83c0a12bf23b4cbf3125d41f9e2d4201db76c9ae)) + + +### Miscellaneous + +* update dependency - nopt@6.0.0 ([#2707](https://www.github.com/nodejs/node-gyp/issues/2707)) ([8958ecf](https://www.github.com/nodejs/node-gyp/commit/8958ecf2bb719227bbcbf155891c3186ee219a2e)) + +## [9.1.0](https://www.github.com/nodejs/node-gyp/compare/v9.0.0...v9.1.0) (2022-07-13) + + +### Features + +* Update function getSDK() to support Windows 11 SDK ([#2565](https://www.github.com/nodejs/node-gyp/issues/2565)) ([ea8520e](https://www.github.com/nodejs/node-gyp/commit/ea8520e3855374bd15b6d001fe112d58a8d7d737)) + + +### Bug Fixes + +* extend tap timeout length to allow for slow CI ([6f74c76](https://www.github.com/nodejs/node-gyp/commit/6f74c762fe3c19bdd20245cb5c02e2dfa65d9451)) +* new ca & server certs, bundle in .js file and unpack for testing ([147e3d3](https://www.github.com/nodejs/node-gyp/commit/147e3d34f44a97deb7aa507207680cf0f4e662a2)) +* re-label ([#2689](https://www.github.com/nodejs/node-gyp/issues/2689)) ([f0b7863](https://www.github.com/nodejs/node-gyp/commit/f0b7863dadfa365afc173025ae95351aec79abd9)) +* typo on readme ([bf81cd4](https://www.github.com/nodejs/node-gyp/commit/bf81cd452b931dd4dfa82762c23dd530a075d992)) + + +### Doc + +* update docs/README.md with latest version number ([62d2815](https://www.github.com/nodejs/node-gyp/commit/62d28151bf8266a34e1bcceeb25b4e6e2ae5ca5d)) + + +### Core + +* update due to rename of primary branch ([ca1f068](https://www.github.com/nodejs/node-gyp/commit/ca1f0681a5567ca8cd51acebccd37a633f19bc6a)) +* Add Python symlink to path (for non-Windows OSes only) ([#2362](https://github.com/nodejs/node-gyp/pull/2362)) ([b9ddcd5](https://github.com/nodejs/node-gyp/commit/b9ddcd5bbd93b05b03674836b6ebdae2c2e74c8c)) + + +### Tests + +* Try msvs-version: [2016, 2019, 2022] ([#2700](https://www.github.com/nodejs/node-gyp/issues/2700)) ([68b5b5b](https://www.github.com/nodejs/node-gyp/commit/68b5b5be9c94ac20c55e88654ff6f55234d7130a)) +* Upgrade GitHub Actions ([#2623](https://www.github.com/nodejs/node-gyp/issues/2623)) ([245cd5b](https://www.github.com/nodejs/node-gyp/commit/245cd5bbe4441d4f05e88f2fa20a86425419b6af)) +* Upgrade GitHub Actions ([#2701](https://www.github.com/nodejs/node-gyp/issues/2701)) ([1c64ca7](https://www.github.com/nodejs/node-gyp/commit/1c64ca7f4702c6eb43ecd16fbd67b5d939041621)) + +## [9.0.0](https://www.github.com/nodejs/node-gyp/compare/v8.4.1...v9.0.0) (2022-02-24) + + +### ⚠ BREAKING CHANGES + +* increase "engines" to "node" : "^12.22 || ^14.13 || >=16" (#2601) + +### Bug Fixes + +* _ in npm_config_ env variables ([eef4eef](https://www.github.com/nodejs/node-gyp/commit/eef4eefccb13ff6a32db862709ee5b2d4edf7e95)) +* update make-fetch-happen to a minimum of 10.0.3 ([839e414](https://www.github.com/nodejs/node-gyp/commit/839e414b63790c815a4a370d0feee8f24a94d40f)) + + +### Miscellaneous + +* add minimal SECURITY.md ([#2560](https://www.github.com/nodejs/node-gyp/issues/2560)) ([c2a1850](https://www.github.com/nodejs/node-gyp/commit/c2a185056e2e589b520fbc0bcc59c2935cd07ede)) + + +### Doc + +* Add notes/disclaimers for upgrading the copy of node-gyp that npm uses ([#2585](https://www.github.com/nodejs/node-gyp/issues/2585)) ([faf6d48](https://www.github.com/nodejs/node-gyp/commit/faf6d48f8a77c08a313baf9332358c4b1231c73c)) +* Rename and update Common-issues.md --> docs/README.md ([#2567](https://www.github.com/nodejs/node-gyp/issues/2567)) ([2ef5fb8](https://www.github.com/nodejs/node-gyp/commit/2ef5fb86277c4d81baffc0b9f642a8d86be1bfa5)) +* rephrase explanation of which node-gyp is used by npm ([#2587](https://www.github.com/nodejs/node-gyp/issues/2587)) ([a2f2988](https://www.github.com/nodejs/node-gyp/commit/a2f298870692022302fa27a1d42363c4a72df407)) +* title match content ([#2574](https://www.github.com/nodejs/node-gyp/issues/2574)) ([6e8f93b](https://www.github.com/nodejs/node-gyp/commit/6e8f93be0443f2649d4effa7bc773a9da06a33b4)) +* Update Python versions ([#2571](https://www.github.com/nodejs/node-gyp/issues/2571)) ([e069f13](https://www.github.com/nodejs/node-gyp/commit/e069f13658a8bfb5fd60f74708cf8be0856d92e3)) + + +### Core + +* add lib.target as path for searching libnode on z/OS ([1d499dd](https://www.github.com/nodejs/node-gyp/commit/1d499dd5606f39de2d34fa822fd0fa5ce17fbd06)) +* increase "engines" to "node" : "^12.22 || ^14.13 || >=16" ([#2601](https://www.github.com/nodejs/node-gyp/issues/2601)) ([6562f92](https://www.github.com/nodejs/node-gyp/commit/6562f92a6f2e67aeae081ddf5272ff117f1fab07)) +* make-fetch-happen@10.0.1 ([78f6660](https://www.github.com/nodejs/node-gyp/commit/78f66604e0df480d4f36a8fa4f3618c046a6fbdc)) + +### [8.4.1](https://www.github.com/nodejs/node-gyp/compare/v8.4.0...v8.4.1) (2021-11-19) + + +### Bug Fixes + +* windows command missing space ([#2553](https://www.github.com/nodejs/node-gyp/issues/2553)) ([cc37b88](https://www.github.com/nodejs/node-gyp/commit/cc37b880690706d3c5d04d5a68c76c392a0a23ed)) + + +### Doc + +* fix typo in powershell node-gyp update ([787cf7f](https://www.github.com/nodejs/node-gyp/commit/787cf7f8e5ddd5039e02b64ace6b7b15e06fe0a4)) + + +### Core + +* npmlog@6.0.0 ([8083f6b](https://www.github.com/nodejs/node-gyp/commit/8083f6b855bd7f3326af04c5f5269fc28d7f2508)) + +## [8.4.0](https://www.github.com/nodejs/node-gyp/compare/v8.3.0...v8.4.0) (2021-11-05) + + +### Features + +* build with config.gypi from node headers ([a27dc08](https://www.github.com/nodejs/node-gyp/commit/a27dc08696911c6d81e76cc228697243069103c1)) +* support vs2022 ([#2533](https://www.github.com/nodejs/node-gyp/issues/2533)) ([5a00387](https://www.github.com/nodejs/node-gyp/commit/5a00387e5f8018264a1822f6c4d5dbf425f21cf6)) + +## [8.3.0](https://www.github.com/nodejs/node-gyp/compare/v8.2.0...v8.3.0) (2021-10-11) + + +### Features + +* **gyp:** update gyp to v0.10.0 ([#2521](https://www.github.com/nodejs/node-gyp/issues/2521)) ([5585792](https://www.github.com/nodejs/node-gyp/commit/5585792922a97f0629f143c560efd74470eae87f)) + + +### Tests + +* Python 3.10 was release on Oct. 4th ([#2504](https://www.github.com/nodejs/node-gyp/issues/2504)) ([0a67dcd](https://www.github.com/nodejs/node-gyp/commit/0a67dcd1307f3560495219253241eafcbf4e2a69)) + + +### Miscellaneous + +* **deps:** bump make-fetch-happen from 8.0.14 to 9.1.0 ([b05b4fe](https://www.github.com/nodejs/node-gyp/commit/b05b4fe9891f718f40edf547e9b50e982826d48a)) +* refactor the creation of config.gypi file ([f2ad87f](https://www.github.com/nodejs/node-gyp/commit/f2ad87ff65f98ad66daa7225ad59d99b759a2b07)) + +## [8.2.0](https://www.github.com/nodejs/node-gyp/compare/v8.1.0...v8.2.0) (2021-08-23) + + +### Features + +* **gyp:** update gyp to v0.9.6 ([#2481](https://www.github.com/nodejs/node-gyp/issues/2481)) ([ed9a9ed](https://www.github.com/nodejs/node-gyp/commit/ed9a9ed653a17c84afa3c327161992d0da7d0cea)) + + +### Bug Fixes + +* add error arg back into catch block for older Node.js users ([5cde818](https://www.github.com/nodejs/node-gyp/commit/5cde818aac715477e9e9747966bb6b4c4ed070a8)) +* change default gyp update message ([#2420](https://www.github.com/nodejs/node-gyp/issues/2420)) ([cfd12ff](https://www.github.com/nodejs/node-gyp/commit/cfd12ff3bb0eb4525173413ef6a94b3cd8398cad)) +* doc how to update node-gyp independently from npm ([c8c0af7](https://www.github.com/nodejs/node-gyp/commit/c8c0af72e78141a02b5da4cd4d704838333a90bd)) +* missing spaces ([f0882b1](https://www.github.com/nodejs/node-gyp/commit/f0882b1264b2fa701adbc81a3be0b3cba80e333d)) + + +### Core + +* deep-copy process.config during configure ([#2368](https://www.github.com/nodejs/node-gyp/issues/2368)) ([5f1a06c](https://www.github.com/nodejs/node-gyp/commit/5f1a06c50f3b0c3d292f64948f85a004cfcc5c87)) + + +### Miscellaneous + +* **deps:** bump tar from 6.1.0 to 6.1.2 ([#2474](https://www.github.com/nodejs/node-gyp/issues/2474)) ([ec15a3e](https://www.github.com/nodejs/node-gyp/commit/ec15a3e5012004172713c11eebcc9d852d32d380)) +* fix typos discovered by codespell ([#2442](https://www.github.com/nodejs/node-gyp/issues/2442)) ([2d0ce55](https://www.github.com/nodejs/node-gyp/commit/2d0ce5595e232a3fc7c562cdf39efb77e2312cc1)) +* GitHub Actions Test on node: [12.x, 14.x, 16.x] ([#2439](https://www.github.com/nodejs/node-gyp/issues/2439)) ([b7bccdb](https://www.github.com/nodejs/node-gyp/commit/b7bccdb527d93b0bb0ce99713f083ce2985fe85c)) + + +### Doc + +* correct link to "binding.gyp files out in the wild" ([#2483](https://www.github.com/nodejs/node-gyp/issues/2483)) ([660dd7b](https://www.github.com/nodejs/node-gyp/commit/660dd7b2a822c184be8027b300e68be67b366772)) +* **wiki:** Add a link to the node-midi binding.gyp file. ([b354711](https://www.github.com/nodejs/node-gyp/commit/b3547115f6e356358138310e857c7f1ec627a8a7)) +* **wiki:** add bcrypt ([e199cfa](https://www.github.com/nodejs/node-gyp/commit/e199cfa8fc6161492d2a6ade2190510d0ebf7c0f)) +* **wiki:** Add helpful information ([4eda827](https://www.github.com/nodejs/node-gyp/commit/4eda8275c03dae6d2f5c40f3c1dbe930d84b0f2b)) +* **wiki:** Add node-canvas ([13a9553](https://www.github.com/nodejs/node-gyp/commit/13a955317b39caf98fd1f412d8d3f41599e979fd)) +* **wiki:** Add node-openvg-canvas and node-openvg. ([61f709e](https://www.github.com/nodejs/node-gyp/commit/61f709ec4d9f256a6467e9ff84430a48eeb629d1)) +* **wiki:** add one more example ([77f3632](https://www.github.com/nodejs/node-gyp/commit/77f363272930d3d4d24fd3973be22e6237128fcc)) +* **wiki:** add topcube, node-osmium, and node-osrm ([1a75d2b](https://www.github.com/nodejs/node-gyp/commit/1a75d2bf2f562ba50846893a516e111cfbb50885)) +* **wiki:** Added details for properly fixing ([3d4d9d5](https://www.github.com/nodejs/node-gyp/commit/3d4d9d52d6b5b49de06bb0bb5b68e2686d2b7ebd)) +* **wiki:** Added Ghostscript4JS ([bf4bed1](https://www.github.com/nodejs/node-gyp/commit/bf4bed1b96a7d22fba6f97f4552ad09f32ac3737)) +* **wiki:** added levelup ([1575bce](https://www.github.com/nodejs/node-gyp/commit/1575bce3a53db628bfb023fd6f3258fdf98c3195)) +* **wiki:** Added nk-mysql (nodamysql) ([5b4f2d0](https://www.github.com/nodejs/node-gyp/commit/5b4f2d0e1d5d3eadfd03aaf9c1668340f76c4bea)) +* **wiki:** Added nk-xrm-installer .gyp references, including .py scripts for providing complete reference to examples of fetching source via http, extracting, and moving files (as opposed to copying) ([ceb3088](https://www.github.com/nodejs/node-gyp/commit/ceb30885b74f6789374ef52267b84767be93ebe4)) +* **wiki:** Added tip about resolving frustrating LNK1181 error ([e64798d](https://www.github.com/nodejs/node-gyp/commit/e64798de8cac6031ad598a86d7599e81b4d20b17)) +* **wiki:** ADDED: Node.js binding to OpenCV ([e2dc777](https://www.github.com/nodejs/node-gyp/commit/e2dc77730b09d7ee8682d7713a7603a2d7aacabd)) +* **wiki:** Adding link to node-cryptopp's gyp file ([875adbe](https://www.github.com/nodejs/node-gyp/commit/875adbe2a4669fa5f2be0250ffbf98fb55e800fd)) +* **wiki:** Adding the sharp library to the list ([9dce0e4](https://www.github.com/nodejs/node-gyp/commit/9dce0e41650c3fa973e6135a79632d022c662a1d)) +* **wiki:** Adds node-fann ([23e3d48](https://www.github.com/nodejs/node-gyp/commit/23e3d485ed894ba7c631e9c062f5e366b50c416c)) +* **wiki:** Adds node-inotify and v8-profiler ([b6e542f](https://www.github.com/nodejs/node-gyp/commit/b6e542f644dbbfe22b88524ec500696e06ee4af7)) +* **wiki:** Bumping Python version from 2.3 to 2.7 as per the node-gyp readme ([55ebd6e](https://www.github.com/nodejs/node-gyp/commit/55ebd6ebacde975bf84f7bf4d8c66e64cc7cd0da)) +* **wiki:** C++ build tools version upgraded ([5b899b7](https://www.github.com/nodejs/node-gyp/commit/5b899b70db729c392ced7c98e8e17590c6499fc3)) +* **wiki:** change bcrypt url to binding.gyp file ([e11bdd8](https://www.github.com/nodejs/node-gyp/commit/e11bdd84de6144492d3eb327d67cbf2d62da1a76)) +* **wiki:** Clarification + direct link to VS2010 ([531c724](https://www.github.com/nodejs/node-gyp/commit/531c724561d947b5d870de8d52dd8c3c51c5ec2d)) +* **wiki:** Correcting the link to node-osmium ([fae7516](https://www.github.com/nodejs/node-gyp/commit/fae7516a1d2829b6e234eaded74fb112ebd79a05)) +* **wiki:** Created "binding.gyp" files out in the wild (markdown) ([d4fd143](https://www.github.com/nodejs/node-gyp/commit/d4fd14355bbe57f229f082f47bb2b3670868203f)) +* **wiki:** Created Common issues (markdown) ([a38299e](https://www.github.com/nodejs/node-gyp/commit/a38299ea340ceb0e732c6dc6a1b4760257644839)) +* **wiki:** Created Error: "pre" versions of node cannot be installed (markdown) ([98bc80d](https://www.github.com/nodejs/node-gyp/commit/98bc80d7a62ba70c881f3c39d94f804322e57852)) +* **wiki:** Created Linking to OpenSSL (markdown) ([c46d00d](https://www.github.com/nodejs/node-gyp/commit/c46d00d83bac5173dea8bbbb175a1a7de74fdaca)) +* **wiki:** Created Updating npm's bundled node gyp (markdown) ([e0ac8d1](https://www.github.com/nodejs/node-gyp/commit/e0ac8d15af46aadd1c220599e63199b154a514e6)) +* **wiki:** Created use of undeclared identifier 'TypedArray' (markdown) ([65ba711](https://www.github.com/nodejs/node-gyp/commit/65ba71139e9b7f64ac823e575ee9dbf17d937ce4)) +* **wiki:** Created Visual Studio 2010 Setup (markdown) ([5b80e83](https://www.github.com/nodejs/node-gyp/commit/5b80e834c8f79dda9fb2770a876ff3cf649c06f3)) +* **wiki:** Created Visual studio 2012 setup (markdown) ([becef31](https://www.github.com/nodejs/node-gyp/commit/becef316b6c46a33e783667720ee074a0141d1a5)) +* **wiki:** Destroyed Visual Studio 2010 Setup (markdown) ([93423b4](https://www.github.com/nodejs/node-gyp/commit/93423b43606de9664aeb79635825f5e9941ec9bc)) +* **wiki:** Destroyed Visual studio 2012 setup (markdown) ([3601508](https://www.github.com/nodejs/node-gyp/commit/3601508bb10fa05da0ddc7e70d57e4b4dd679657)) +* **wiki:** Different commands for Windows npm v6 vs. v7 ([0fce46b](https://www.github.com/nodejs/node-gyp/commit/0fce46b53340c85e8091cde347d5ed23a443c82f)) +* **wiki:** Drop in favor of ([9285ff6](https://www.github.com/nodejs/node-gyp/commit/9285ff6e451c52c070a05f05f0a9602621d91d53)) +* **wiki:** Explicit link to Visual C++ 2010 Express ([378c363](https://www.github.com/nodejs/node-gyp/commit/378c3632f02c096ed819ec8f2611c65bef0c0554)) +* **wiki:** fix link to gyp file used to build libsqlite3 ([54db8d7](https://www.github.com/nodejs/node-gyp/commit/54db8d7ac33e3f98220960b5d86cfa18a75b53cb)) +* **wiki:** Fix link to node-zipfile ([92e49a8](https://www.github.com/nodejs/node-gyp/commit/92e49a858ed69cb4847a26a5676ab56ef5e2de33)) +* **wiki:** fixed node-serialport link ([954ee53](https://www.github.com/nodejs/node-gyp/commit/954ee530b3972d1db591fce32368e4e31b5a25d8)) +* **wiki:** I highly missing it in common issue as every windows biggner face that issue ([d617fae](https://www.github.com/nodejs/node-gyp/commit/d617faee29c40871ca5c8f93efd0ce929a40d541)) +* **wiki:** if ouns that the -h did not help. I founs on github that there was support for visual studio 2015, while i couldn't install node-red beacuse it kept telling me the key 2015 was missing. looking in he gyp python code i found the local file was bot up t dat with the github repo. updating took several efforts before i tried to drop the -g option. ([408b72f](https://www.github.com/nodejs/node-gyp/commit/408b72f561329408daeb17834436e381406efcc8)) +* **wiki:** If permissions error, please try and then the command. ([ee8e1c1](https://www.github.com/nodejs/node-gyp/commit/ee8e1c1e5334096d58e0d6bca6c006f2ee9c88cb)) +* **wiki:** Improve Unix instructions ([c3e5487](https://www.github.com/nodejs/node-gyp/commit/c3e548736645b535ea5bce613d74ca3e98598243)) +* **wiki:** link to docs/ from README ([b52e487](https://www.github.com/nodejs/node-gyp/commit/b52e487eac1eb421573d1e67114a242eeff45a00)) +* **wiki:** Lower case L ([3aa2c6b](https://www.github.com/nodejs/node-gyp/commit/3aa2c6bdb07971b87505e32e32548d75264bd19f)) +* **wiki:** Make changes discussed in https://github.com/nodejs/node-gyp/issues/2416 ([1dcad87](https://www.github.com/nodejs/node-gyp/commit/1dcad873539027511a5f0243baf770ea90f6f4e2)) +* **wiki:** move wiki docs into doc/ ([f0a4835](https://www.github.com/nodejs/node-gyp/commit/f0a48355d86534ec3bdabcdb3ce3340fa2e17f39)) +* **wiki:** node-sass in the wild ([d310a73](https://www.github.com/nodejs/node-gyp/commit/d310a73d64d0065050377baac7047472f7424a1b)) +* **wiki:** node-srs was a 404 ([bbca21a](https://www.github.com/nodejs/node-gyp/commit/bbca21a1e1ede4c473aff365ca71989a5bda7b57)) +* **wiki:** Note: VS2010 seems to be no longer available! VS2013 or nothing! ([7b5dcaf](https://www.github.com/nodejs/node-gyp/commit/7b5dcafafccdceae4b8f2b53ac9081a694b6ade8)) +* **wiki:** safer doc names, remove unnecessary TypedArray doc ([161c235](https://www.github.com/nodejs/node-gyp/commit/161c2353ef5b562f4acfb2fd77608fcbd0800fc0)) +* **wiki:** sorry, forgot to mention a specific windows version. ([d69dffc](https://www.github.com/nodejs/node-gyp/commit/d69dffc16c2b1e3c60dcb5d1c35a49270ba22a35)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([7444b47](https://www.github.com/nodejs/node-gyp/commit/7444b47a7caac1e14d1da474a7fcfcf88d328017)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([d766b74](https://www.github.com/nodejs/node-gyp/commit/d766b7427851e6c2edc02e2504a7be9be7e330c0)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([d319b0e](https://www.github.com/nodejs/node-gyp/commit/d319b0e98c7085de8e51bc5595eba4264b99a7d5)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([3c6692d](https://www.github.com/nodejs/node-gyp/commit/3c6692d538f0ce973869aa237118b7d2483feccd)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([93392d5](https://www.github.com/nodejs/node-gyp/commit/93392d559ce6f250b9c7fe8177e6c88603809dc1)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([8841158](https://www.github.com/nodejs/node-gyp/commit/88411588f300e9b7c00fe516ecd977a1feeeb15c)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([81bfa1f](https://www.github.com/nodejs/node-gyp/commit/81bfa1f1b63d522a9f8a9ae9ca0c7ae90fe75140)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([d1cd237](https://www.github.com/nodejs/node-gyp/commit/d1cd237bad06fa507adb354b9e2181a14dc63d24)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([3de9e17](https://www.github.com/nodejs/node-gyp/commit/3de9e17e0b8a387eafe7bd18d0ec1e3191d118e8)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([a9b7096](https://www.github.com/nodejs/node-gyp/commit/a9b70968fb956eab3b95672048b94350e1565ca3)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([3236069](https://www.github.com/nodejs/node-gyp/commit/3236069689e7e0eb15b324fce74ab58158956f98)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([1462755](https://www.github.com/nodejs/node-gyp/commit/14627556966e5d513bdb8e5208f0e1300f68991f)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([7ab1337](https://www.github.com/nodejs/node-gyp/commit/7ab133752a6c402bb96dcd3d671d73e03e9487ad)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([640895d](https://www.github.com/nodejs/node-gyp/commit/640895d36b7448c646a3b850c1e159106f83c724)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([ced8c96](https://www.github.com/nodejs/node-gyp/commit/ced8c968457f285ab8989c291d28173d7730833c)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([27b883a](https://www.github.com/nodejs/node-gyp/commit/27b883a350ad0db6b9130d7b996f35855ec34c7a)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([d29fb13](https://www.github.com/nodejs/node-gyp/commit/d29fb134f1c4b9dd729ba95f2979e69e0934809f)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([2765891](https://www.github.com/nodejs/node-gyp/commit/27658913e6220cf0371b4b73e25a0e4ab11108a1)) +* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([dc97766](https://www.github.com/nodejs/node-gyp/commit/dc9776648d432bca6775c176641f16da14522d4c)) +* **wiki:** Updated Error: "pre" versions of node cannot be installed (markdown) ([e9f8b33](https://www.github.com/nodejs/node-gyp/commit/e9f8b33d1f87d04f22cb09a814d7c55d0fa38446)) +* **wiki:** Updated Home (markdown) ([3407109](https://www.github.com/nodejs/node-gyp/commit/3407109325cf7ba1e925656b9eb75feffab0557c)) +* **wiki:** Updated Home (markdown) ([6e392bc](https://www.github.com/nodejs/node-gyp/commit/6e392bcdd3dd1691773e6e16e1dffc35931b81e0)) +* **wiki:** Updated Home (markdown) ([65efe32](https://www.github.com/nodejs/node-gyp/commit/65efe32ccb8d446ce569453364f922dd9d27c945)) +* **wiki:** Updated Home (markdown) ([ea28f09](https://www.github.com/nodejs/node-gyp/commit/ea28f0947af91fa638be355143f5df89d2e431c8)) +* **wiki:** Updated Home (markdown) ([0e37ff4](https://www.github.com/nodejs/node-gyp/commit/0e37ff48b306c12149661b375895741d3d710da7)) +* **wiki:** Updated Home (markdown) ([b398ef4](https://www.github.com/nodejs/node-gyp/commit/b398ef46f660d2b1506508550dadfb4c35639e4b)) +* **wiki:** Updated Linking to OpenSSL (markdown) ([8919028](https://www.github.com/nodejs/node-gyp/commit/8919028921fd304f08044098434f0dc6071fb7cf)) +* **wiki:** Updated Linking to OpenSSL (markdown) ([c00eb77](https://www.github.com/nodejs/node-gyp/commit/c00eb778fc7dc27e4dab3a9219035ea20458b33b)) +* **wiki:** Updated node-levelup to node-leveldown (broken links) ([59668bb](https://www.github.com/nodejs/node-gyp/commit/59668bb0b904feccf3c09afa2fd37378c77af967)) +* **wiki:** Updated Updating npm's bundled node gyp (markdown) ([d314854](https://www.github.com/nodejs/node-gyp/commit/d31485415ef69d46effa6090c95698341965de1b)) +* **wiki:** Updated Updating npm's bundled node gyp (markdown) ([11858b0](https://www.github.com/nodejs/node-gyp/commit/11858b0655d1eee00c62ad628e719d4378803d14)) +* **wiki:** Updated Updating npm's bundled node gyp (markdown) ([33561e9](https://www.github.com/nodejs/node-gyp/commit/33561e9cbf5f4eb46111318503c77df2c6eb484a)) +* **wiki:** Updated Updating npm's bundled node gyp (markdown) ([4a7f2d0](https://www.github.com/nodejs/node-gyp/commit/4a7f2d0d869a65c99a78504976567017edadf657)) +* **wiki:** Updated Updating npm's bundled node gyp (markdown) ([979a706](https://www.github.com/nodejs/node-gyp/commit/979a7063b950c088a7f4896fc3a48e1d00dfd231)) +* **wiki:** Updated Updating npm's bundled node gyp (markdown) ([e50e04d](https://www.github.com/nodejs/node-gyp/commit/e50e04d7b6a3754ea0aa11fe8cef491b3bc5bdd4)) + +## [8.1.0](https://www.github.com/nodejs/node-gyp/compare/v8.0.0...v8.1.0) (2021-05-28) + + +### Features + +* **gyp:** update gyp to v0.9.1 ([#2402](https://www.github.com/nodejs/node-gyp/issues/2402)) ([814b1b0](https://www.github.com/nodejs/node-gyp/commit/814b1b0eda102afb9fc87e81638a9cf5b650bb10)) + + +### Miscellaneous + +* add `release-please-action` for automated releases ([#2395](https://www.github.com/nodejs/node-gyp/issues/2395)) ([07e9d7c](https://www.github.com/nodejs/node-gyp/commit/07e9d7c7ee80ba119ea760c635f72fd8e7efe198)) + + +### Core + +* fail gracefully if we can't find the username ([#2375](https://www.github.com/nodejs/node-gyp/issues/2375)) ([fca4795](https://www.github.com/nodejs/node-gyp/commit/fca4795512c67dc8420aaa0d913b5b89a4b147f3)) +* log as yes/no whether build dir was created ([#2370](https://www.github.com/nodejs/node-gyp/issues/2370)) ([245dee5](https://www.github.com/nodejs/node-gyp/commit/245dee5b62581309946872ae253226ea3a42c0e3)) + + +### Doc + +* fix v8.0.0 release date ([4b83c3d](https://www.github.com/nodejs/node-gyp/commit/4b83c3de7300457919d53f26d96ea9ad6f6bedd8)) +* remove redundant version info ([#2403](https://www.github.com/nodejs/node-gyp/issues/2403)) ([1423670](https://www.github.com/nodejs/node-gyp/commit/14236709de64b100a424396b91a5115639daa0ef)) +* Update README.md Visual Studio Community page polski to auto ([#2371](https://www.github.com/nodejs/node-gyp/issues/2371)) ([1b4697a](https://www.github.com/nodejs/node-gyp/commit/1b4697abf69ef574a48faf832a7098f4c6c224a5)) + +## v8.0.0 2021-04-03 + +* [[`0d8a6f1b19`](https://github.com/nodejs/node-gyp/commit/0d8a6f1b19)] - **ci**: update actions/setup-node to v2 (#2302) (Sora Morimoto) [#2302](https://github.com/nodejs/node-gyp/pull/2302) +* [[`15a5c7d45b`](https://github.com/nodejs/node-gyp/commit/15a5c7d45b)] - **ci**: migrate deprecated grammar (#2285) (Jiawen Geng) [#2285](https://github.com/nodejs/node-gyp/pull/2285) +* [[`06ddde27f9`](https://github.com/nodejs/node-gyp/commit/06ddde27f9)] - **deps**: sync mutual dependencies with npm (DeeDeeG) [#2348](https://github.com/nodejs/node-gyp/pull/2348) +* [[`a5fd1f41e3`](https://github.com/nodejs/node-gyp/commit/a5fd1f41e3)] - **doc**: add downloads badge (#2352) (Jiawen Geng) [#2352](https://github.com/nodejs/node-gyp/pull/2352) +* [[`cc1cbce056`](https://github.com/nodejs/node-gyp/commit/cc1cbce056)] - **doc**: update macOS\_Catalina.md (#2293) (iMrLopez) [#2293](https://github.com/nodejs/node-gyp/pull/2293) +* [[`6287118fc4`](https://github.com/nodejs/node-gyp/commit/6287118fc4)] - **doc**: updated README.md to copy easily (#2281) (மனோஜ்குமார் பழனிச்சாமி) [#2281](https://github.com/nodejs/node-gyp/pull/2281) +* [[`66c0f04467`](https://github.com/nodejs/node-gyp/commit/66c0f04467)] - **doc**: add missing `sudo` to Catalina doc (Karl Horky) [#2244](https://github.com/nodejs/node-gyp/pull/2244) +* [[`0da2e0140d`](https://github.com/nodejs/node-gyp/commit/0da2e0140d)] - **gyp**: update gyp to v0.8.1 (#2355) (DeeDeeG) [#2355](https://github.com/nodejs/node-gyp/pull/2355) +* [[`0093ec8646`](https://github.com/nodejs/node-gyp/commit/0093ec8646)] - **gyp**: Improve our flake8 linting tests (Christian Clauss) [#2356](https://github.com/nodejs/node-gyp/pull/2356) +* [[`a78b584236`](https://github.com/nodejs/node-gyp/commit/a78b584236)] - **(SEMVER-MAJOR)** **gyp**: remove support for Python 2 (#2300) (Christian Clauss) [#2300](https://github.com/nodejs/node-gyp/pull/2300) +* [[`c3c510d89e`](https://github.com/nodejs/node-gyp/commit/c3c510d89e)] - **gyp**: update gyp to v0.8.0 (#2318) (Christian Clauss) [#2318](https://github.com/nodejs/node-gyp/pull/2318) +* [[`9e1397c52e`](https://github.com/nodejs/node-gyp/commit/9e1397c52e)] - **(SEMVER-MAJOR)** **gyp**: update gyp to v0.7.0 (#2284) (Jiawen Geng) [#2284](https://github.com/nodejs/node-gyp/pull/2284) +* [[`1bd18f3e77`](https://github.com/nodejs/node-gyp/commit/1bd18f3e77)] - **(SEMVER-MAJOR)** **lib**: drop Python 2 support in find-python.js (#2333) (DeeDeeG) [#2333](https://github.com/nodejs/node-gyp/pull/2333) +* [[`e81602ef55`](https://github.com/nodejs/node-gyp/commit/e81602ef55)] - **(SEMVER-MAJOR)** **lib**: migrate requests to fetch (#2220) (Matias Lopez) [#2220](https://github.com/nodejs/node-gyp/pull/2220) +* [[`392b7760b4`](https://github.com/nodejs/node-gyp/commit/392b7760b4)] - **lib**: avoid changing process.config (#2322) (Michaël Zasso) [#2322](https://github.com/nodejs/node-gyp/pull/2322) + +## v7.1.2 2020-10-17 + +* [[`096e3aded5`](https://github.com/nodejs/node-gyp/commit/096e3aded5)] - **gyp**: update gyp to 0.6.2 (Myles Borins) [#2241](https://github.com/nodejs/node-gyp/pull/2241) +* [[`54f97cd243`](https://github.com/nodejs/node-gyp/commit/54f97cd243)] - **doc**: add cmd to reset `xcode-select` to initial state (Valera Rozuvan) [#2235](https://github.com/nodejs/node-gyp/pull/2235) + +## v7.1.1 2020-10-15 + +This release restores the location of shared library builds to the pre-v7 +location. In v7.0.0 until this release, shared library outputs were placed +in a lib.target subdirectory inside the build/{Release,Debug} directory for +builds using `make` (Linux, etc.). This is inconsistent with macOS (Xcode) +behavior and previous node-gyp behavior so has been reverted. +We consider this a bug-fix rather than semver-major change. + +* [[`18bf2d1d38`](https://github.com/nodejs/node-gyp/commit/18bf2d1d38)] - **deps**: update deps to match npm@7 (Rod Vagg) [#2240](https://github.com/nodejs/node-gyp/pull/2240) +* [[`ee6a837cb7`](https://github.com/nodejs/node-gyp/commit/ee6a837cb7)] - **gyp**: update gyp to 0.6.1 (Rod Vagg) [#2238](https://github.com/nodejs/node-gyp/pull/2238) +* [[`3e7f8ccafc`](https://github.com/nodejs/node-gyp/commit/3e7f8ccafc)] - **lib**: better log message when ps fails (Martin Midtgaard) [#2229](https://github.com/nodejs/node-gyp/pull/2229) +* [[`7fb314339f`](https://github.com/nodejs/node-gyp/commit/7fb314339f)] - **test**: GitHub Actions: Test on Python 3.9 (Christian Clauss) [#2230](https://github.com/nodejs/node-gyp/pull/2230) +* [[`754996b9ec`](https://github.com/nodejs/node-gyp/commit/754996b9ec)] - **doc**: replace status badges with new Actions badge (Rod Vagg) [#2218](https://github.com/nodejs/node-gyp/pull/2218) +* [[`2317dc400c`](https://github.com/nodejs/node-gyp/commit/2317dc400c)] - **ci**: switch to GitHub Actions (Shelley Vohr) [#2210](https://github.com/nodejs/node-gyp/pull/2210) +* [[`2cca9b74f7`](https://github.com/nodejs/node-gyp/commit/2cca9b74f7)] - **doc**: drop the --production flag for installing windows-build-tools (DeeDeeG) [#2206](https://github.com/nodejs/node-gyp/pull/2206) + +## v7.1.0 2020-08-12 + +* [[`aaf33c3029`](https://github.com/nodejs/node-gyp/commit/aaf33c3029)] - **build**: add update-gyp script (Samuel Attard) [#2167](https://github.com/nodejs/node-gyp/pull/2167) +* * [[`3baa4e4172`](https://github.com/nodejs/node-gyp/commit/3baa4e4172)] - **(SEMVER-MINOR)** **gyp**: update gyp to 0.4.0 (Samuel Attard) [#2165](https://github.com/nodejs/node-gyp/pull/2165) +* * [[`f461d56c53`](https://github.com/nodejs/node-gyp/commit/f461d56c53)] - **(SEMVER-MINOR)** **build**: support apple silicon (arm64 darwin) builds (Samuel Attard) [#2165](https://github.com/nodejs/node-gyp/pull/2165) +* * [[`ee6fa7d3bc`](https://github.com/nodejs/node-gyp/commit/ee6fa7d3bc)] - **docs**: note that node-gyp@7 should solve Catalina CLT issues (Rod Vagg) [#2156](https://github.com/nodejs/node-gyp/pull/2156) +* * [[`4fc8ff179d`](https://github.com/nodejs/node-gyp/commit/4fc8ff179d)] - **doc**: silence curl for macOS Catalina acid test (Chia Wei Ong) [#2150](https://github.com/nodejs/node-gyp/pull/2150) +* * [[`7857cb2eb1`](https://github.com/nodejs/node-gyp/commit/7857cb2eb1)] - **deps**: increase "engines" to "node" : "\>= 10.12.0" (DeeDeeG) [#2153](https://github.com/nodejs/node-gyp/pull/2153) + +## v7.0.0 2020-06-03 + +* [[`e18a61afc1`](https://github.com/nodejs/node-gyp/commit/e18a61afc1)] - **build**: shrink bloated addon binaries on windows (Shelley Vohr) [#2060](https://github.com/nodejs/node-gyp/pull/2060) +* [[`4937722cf5`](https://github.com/nodejs/node-gyp/commit/4937722cf5)] - **(SEMVER-MAJOR)** **deps**: replace mkdirp with {recursive} mkdir (Rod Vagg) [#2123](https://github.com/nodejs/node-gyp/pull/2123) +* [[`d45438a047`](https://github.com/nodejs/node-gyp/commit/d45438a047)] - **(SEMVER-MAJOR)** **deps**: update deps, match to npm@7 (Rod Vagg) [#2126](https://github.com/nodejs/node-gyp/pull/2126) +* [[`ba4f34b7d6`](https://github.com/nodejs/node-gyp/commit/ba4f34b7d6)] - **doc**: update catalina xcode clt download link (Dario Vladovic) [#2133](https://github.com/nodejs/node-gyp/pull/2133) +* [[`f7bfce96ed`](https://github.com/nodejs/node-gyp/commit/f7bfce96ed)] - **doc**: update acid test and introduce curl|bash test script (Dario Vladovic) [#2105](https://github.com/nodejs/node-gyp/pull/2105) +* [[`e529f3309d`](https://github.com/nodejs/node-gyp/commit/e529f3309d)] - **doc**: update README to reflect upgrade to gyp-next (Ujjwal Sharma) [#2092](https://github.com/nodejs/node-gyp/pull/2092) +* [[`9aed6286a3`](https://github.com/nodejs/node-gyp/commit/9aed6286a3)] - **doc**: give more attention to Catalina issues doc (Matheus Marchini) [#2134](https://github.com/nodejs/node-gyp/pull/2134) +* [[`963f2a7b48`](https://github.com/nodejs/node-gyp/commit/963f2a7b48)] - **doc**: improve Catalina discoverability for search engines (Matheus Marchini) [#2135](https://github.com/nodejs/node-gyp/pull/2135) +* [[`7b75af349b`](https://github.com/nodejs/node-gyp/commit/7b75af349b)] - **doc**: add macOS Catalina software update info (Karl Horky) [#2078](https://github.com/nodejs/node-gyp/pull/2078) +* [[`4f23c7bee2`](https://github.com/nodejs/node-gyp/commit/4f23c7bee2)] - **doc**: update link to the code of conduct (#2073) (Michaël Zasso) [#2073](https://github.com/nodejs/node-gyp/pull/2073) +* [[`473cfa283f`](https://github.com/nodejs/node-gyp/commit/473cfa283f)] - **doc**: note in README that Python 3.8 is supported (#2072) (Michaël Zasso) [#2072](https://github.com/nodejs/node-gyp/pull/2072) +* [[`e7402b4a7c`](https://github.com/nodejs/node-gyp/commit/e7402b4a7c)] - **doc**: update catalina xcode cli tools download link (#2044) (Dario Vladović) [#2044](https://github.com/nodejs/node-gyp/pull/2044) +* [[`35de45984f`](https://github.com/nodejs/node-gyp/commit/35de45984f)] - **doc**: update catalina xcode cli tools download link; formatting (Jonathan Hult) [#2034](https://github.com/nodejs/node-gyp/pull/2034) +* [[`48642191f5`](https://github.com/nodejs/node-gyp/commit/48642191f5)] - **doc**: add download link for Command Line Tools for Xcode (Przemysław Bitkowski) [#2029](https://github.com/nodejs/node-gyp/pull/2029) +* [[`ae5b150051`](https://github.com/nodejs/node-gyp/commit/ae5b150051)] - **doc**: Catalina suggestion: remove /Library/Developer/CommandLineTools (Christian Clauss) [#2022](https://github.com/nodejs/node-gyp/pull/2022) +* [[`d1dea13fe4`](https://github.com/nodejs/node-gyp/commit/d1dea13fe4)] - **doc**: fix changelog 6.1.0 release year to be 2020 (Quentin Vernot) [#2021](https://github.com/nodejs/node-gyp/pull/2021) +* [[`6356117b08`](https://github.com/nodejs/node-gyp/commit/6356117b08)] - **doc, bin**: stop suggesting opening node-gyp issues (Bartosz Sosnowski) [#2096](https://github.com/nodejs/node-gyp/pull/2096) +* [[`a6b76a8b48`](https://github.com/nodejs/node-gyp/commit/a6b76a8b48)] - **gyp**: update gyp to 0.2.1 (Ujjwal Sharma) [#2092](https://github.com/nodejs/node-gyp/pull/2092) +* [[`ebc34ec823`](https://github.com/nodejs/node-gyp/commit/ebc34ec823)] - **gyp**: update gyp to 0.2.0 (Ujjwal Sharma) [#2092](https://github.com/nodejs/node-gyp/pull/2092) +* [[`972780bde7`](https://github.com/nodejs/node-gyp/commit/972780bde7)] - **(SEMVER-MAJOR)** **gyp**: sync code base with nodejs repo (#1975) (Michaël Zasso) [#1975](https://github.com/nodejs/node-gyp/pull/1975) +* [[`c255ffbf6a`](https://github.com/nodejs/node-gyp/commit/c255ffbf6a)] - **lib**: drop "-2" flag for "py.exe" launcher (DeeDeeG) [#2131](https://github.com/nodejs/node-gyp/pull/2131) +* [[`1f7e1e93b5`](https://github.com/nodejs/node-gyp/commit/1f7e1e93b5)] - **lib**: ignore VS instances that cause COMExceptions (Andrew Casey) [#2018](https://github.com/nodejs/node-gyp/pull/2018) +* [[`741ab096d5`](https://github.com/nodejs/node-gyp/commit/741ab096d5)] - **test**: remove support for EOL versions of Node.js (Shelley Vohr) +* [[`ca86ef2539`](https://github.com/nodejs/node-gyp/commit/ca86ef2539)] - **test**: bump actions/checkout from v1 to v2 (BSKY) [#2063](https://github.com/nodejs/node-gyp/pull/2063) + +## v6.1.0 2020-01-08 + +* [[`9a7dd16b76`](https://github.com/nodejs/node-gyp/commit/9a7dd16b76)] - **doc**: remove backticks from Python version list (Rod Vagg) [#2011](https://github.com/nodejs/node-gyp/pull/2011) +* [[`26cd6eaea6`](https://github.com/nodejs/node-gyp/commit/26cd6eaea6)] - **doc**: add GitHub Actions badge (#1994) (Rod Vagg) [#1994](https://github.com/nodejs/node-gyp/pull/1994) +* [[`312c12ef4f`](https://github.com/nodejs/node-gyp/commit/312c12ef4f)] - **doc**: update macOS\_Catalina.md (#1992) (James Home) [#1992](https://github.com/nodejs/node-gyp/pull/1992) +* [[`f7b6b6b77b`](https://github.com/nodejs/node-gyp/commit/f7b6b6b77b)] - **doc**: fix typo in README.md (#1985) (Suraneti Rodsuwan) [#1985](https://github.com/nodejs/node-gyp/pull/1985) +* [[`6b8f2652dd`](https://github.com/nodejs/node-gyp/commit/6b8f2652dd)] - **doc**: add travis badge (Rod Vagg) [#1971](https://github.com/nodejs/node-gyp/pull/1971) +* [[`20aa0b44f7`](https://github.com/nodejs/node-gyp/commit/20aa0b44f7)] - **doc**: macOS Catalina add two commands (Christian Clauss) [#1962](https://github.com/nodejs/node-gyp/pull/1962) +* [[`14f2a07a39`](https://github.com/nodejs/node-gyp/commit/14f2a07a39)] - **gyp**: list(dict) so we can del dict(key) while iterating (Christian Clauss) [#2009](https://github.com/nodejs/node-gyp/pull/2009) +* [[`f242ce4d2c`](https://github.com/nodejs/node-gyp/commit/f242ce4d2c)] - **lib**: compatibility with semver ≥ 7 (`new` for semver.Range) (Xavier Guimard) [#2006](https://github.com/nodejs/node-gyp/pull/2006) +* [[`3bcba2a01a`](https://github.com/nodejs/node-gyp/commit/3bcba2a01a)] - **(SEMVER-MINOR)** **lib**: noproxy support, match proxy detection to `request` (Matias Lopez) [#1978](https://github.com/nodejs/node-gyp/pull/1978) +* [[`470cc2178e`](https://github.com/nodejs/node-gyp/commit/470cc2178e)] - **test**: remove old docker test harness (#1993) (Rod Vagg) [#1993](https://github.com/nodejs/node-gyp/pull/1993) +* [[`31ecc8421d`](https://github.com/nodejs/node-gyp/commit/31ecc8421d)] - **test**: add Windows to GitHub Actions testing (#1996) (Christian Clauss) [#1996](https://github.com/nodejs/node-gyp/pull/1996) +* [[`5a729e86ee`](https://github.com/nodejs/node-gyp/commit/5a729e86ee)] - **test**: fix typo in header download test (#2001) (Richard Lau) [#2001](https://github.com/nodejs/node-gyp/pull/2001) +* [[`345c70e56d`](https://github.com/nodejs/node-gyp/commit/345c70e56d)] - **test**: direct python invocation & simpler pyenv (Matias Lopez) [#1979](https://github.com/nodejs/node-gyp/pull/1979) +* [[`d6a7e0e1fb`](https://github.com/nodejs/node-gyp/commit/d6a7e0e1fb)] - **test**: fix macOS Travis on Python 2.7 & 3.7 (Christian Clauss) [#1979](https://github.com/nodejs/node-gyp/pull/1979) +* [[`5a64e9bd32`](https://github.com/nodejs/node-gyp/commit/5a64e9bd32)] - **test**: initial Github Actions with Ubuntu & macOS (Christian Clauss) [#1985](https://github.com/nodejs/node-gyp/pull/1985) +* [[`04da736d38`](https://github.com/nodejs/node-gyp/commit/04da736d38)] - **test**: fix Python unittests (cclauss) [#1961](https://github.com/nodejs/node-gyp/pull/1961) +* [[`0670e5189d`](https://github.com/nodejs/node-gyp/commit/0670e5189d)] - **test**: add header download test (Rod Vagg) [#1796](https://github.com/nodejs/node-gyp/pull/1796) +* [[`c506a6a150`](https://github.com/nodejs/node-gyp/commit/c506a6a150)] - **test**: configure proper devDir for invoking configure() (Rod Vagg) [#1796](https://github.com/nodejs/node-gyp/pull/1796) + +## v6.0.1 2019-11-01 + +* [[`8ec2e681d5`](https://github.com/nodejs/node-gyp/commit/8ec2e681d5)] - **doc**: add macOS\_Catalina.md document (cclauss) [#1940](https://github.com/nodejs/node-gyp/pull/1940) +* [[`1b11be63cc`](https://github.com/nodejs/node-gyp/commit/1b11be63cc)] - **gyp**: python3 fixes: utf8 decode, use of 'None' in eval (Wilfried Goesgens) [#1925](https://github.com/nodejs/node-gyp/pull/1925) +* [[`c0282daa48`](https://github.com/nodejs/node-gyp/commit/c0282daa48)] - **gyp**: iteritems() -\> items() in compile\_commands\_json.py (cclauss) [#1947](https://github.com/nodejs/node-gyp/pull/1947) +* [[`d8e09a1b6a`](https://github.com/nodejs/node-gyp/commit/d8e09a1b6a)] - **gyp**: make cmake python3 compatible (gengjiawen) [#1944](https://github.com/nodejs/node-gyp/pull/1944) +* [[`9c0f3404f0`](https://github.com/nodejs/node-gyp/commit/9c0f3404f0)] - **gyp**: fix TypeError in XcodeVersion() (Christian Clauss) [#1939](https://github.com/nodejs/node-gyp/pull/1939) +* [[`bb2eb72a3f`](https://github.com/nodejs/node-gyp/commit/bb2eb72a3f)] - **gyp**: finish decode stdout on Python 3 (Christian Clauss) [#1937](https://github.com/nodejs/node-gyp/pull/1937) +* [[`f0693413d9`](https://github.com/nodejs/node-gyp/commit/f0693413d9)] - **src,win**: allow 403 errors for arm64 node.lib (Richard Lau) [#1934](https://github.com/nodejs/node-gyp/pull/1934) +* [[`c60c22de58`](https://github.com/nodejs/node-gyp/commit/c60c22de58)] - **deps**: update deps to roughly match current npm@6 (Rod Vagg) [#1920](https://github.com/nodejs/node-gyp/pull/1920) +* [[`b91718eefc`](https://github.com/nodejs/node-gyp/commit/b91718eefc)] - **test**: upgrade Linux Travis CI to Python 3.8 (Christian Clauss) [#1923](https://github.com/nodejs/node-gyp/pull/1923) +* [[`3538a317b6`](https://github.com/nodejs/node-gyp/commit/3538a317b6)] - **doc**: adjustments to the README.md for new users (Dan Pike) [#1919](https://github.com/nodejs/node-gyp/pull/1919) +* [[`4fff8458c0`](https://github.com/nodejs/node-gyp/commit/4fff8458c0)] - **travis**: ignore failed `brew upgrade npm`, update xcode (Christian Clauss) [#1932](https://github.com/nodejs/node-gyp/pull/1932) +* [[`60e4488f08`](https://github.com/nodejs/node-gyp/commit/60e4488f08)] - **build**: avoid bare exceptions in xcode\_emulation.py (Christian Clauss) [#1932](https://github.com/nodejs/node-gyp/pull/1932) +* [[`032db2a2d0`](https://github.com/nodejs/node-gyp/commit/032db2a2d0)] - **lib,install**: always download SHA sums on Windows (Sam Hughes) [#1926](https://github.com/nodejs/node-gyp/pull/1926) +* [[`5a83630c33`](https://github.com/nodejs/node-gyp/commit/5a83630c33)] - **travis**: add Windows + Python 3.8 to the mix (Rod Vagg) [#1921](https://github.com/nodejs/node-gyp/pull/1921) + +## v6.0.0 2019-10-04 + +* [[`dd0e97ef0b`](https://github.com/nodejs/node-gyp/commit/dd0e97ef0b)] - **(SEMVER-MAJOR)** **lib**: try to find `python` after `python3` (Sam Roberts) [#1907](https://github.com/nodejs/node-gyp/pull/1907) +* [[`f60ed47d14`](https://github.com/nodejs/node-gyp/commit/f60ed47d14)] - **travis**: add Python 3.5 and 3.6 tests on Linux (Christian Clauss) [#1903](https://github.com/nodejs/node-gyp/pull/1903) +* [[`c763ca1838`](https://github.com/nodejs/node-gyp/commit/c763ca1838)] - **(SEMVER-MAJOR)** **doc**: Declare that node-gyp is Python 3 compatible (cclauss) [#1811](https://github.com/nodejs/node-gyp/pull/1811) +* [[`3d1c60ab81`](https://github.com/nodejs/node-gyp/commit/3d1c60ab81)] - **(SEMVER-MAJOR)** **lib**: accept Python 3 by default (João Reis) [#1844](https://github.com/nodejs/node-gyp/pull/1844) +* [[`c6e3b65a23`](https://github.com/nodejs/node-gyp/commit/c6e3b65a23)] - **(SEMVER-MAJOR)** **lib**: raise the minimum Python version from 2.6 to 2.7 (cclauss) [#1818](https://github.com/nodejs/node-gyp/pull/1818) + +## v5.1.1 2020-05-25 + +* [[`bdd3a79abe`](https://github.com/nodejs/node-gyp/commit/bdd3a79abe)] - **build**: shrink bloated addon binaries on windows (Shelley Vohr) [#2060](https://github.com/nodejs/node-gyp/pull/2060) +* [[`1f2ba75bc0`](https://github.com/nodejs/node-gyp/commit/1f2ba75bc0)] - **doc**: add macOS Catalina software update info (Karl Horky) [#2078](https://github.com/nodejs/node-gyp/pull/2078) +* [[`c106d915f5`](https://github.com/nodejs/node-gyp/commit/c106d915f5)] - **doc**: update catalina xcode cli tools download link (#2044) (Dario Vladović) [#2044](https://github.com/nodejs/node-gyp/pull/2044) +* [[`9a6fea92e2`](https://github.com/nodejs/node-gyp/commit/9a6fea92e2)] - **doc**: update catalina xcode cli tools download link; formatting (Jonathan Hult) [#2034](https://github.com/nodejs/node-gyp/pull/2034) +* [[`59b0b1add8`](https://github.com/nodejs/node-gyp/commit/59b0b1add8)] - **doc**: add download link for Command Line Tools for Xcode (Przemysław Bitkowski) [#2029](https://github.com/nodejs/node-gyp/pull/2029) +* [[`bb8d0e7b10`](https://github.com/nodejs/node-gyp/commit/bb8d0e7b10)] - **doc**: Catalina suggestion: remove /Library/Developer/CommandLineTools (Christian Clauss) [#2022](https://github.com/nodejs/node-gyp/pull/2022) +* [[`fb2e80d4e3`](https://github.com/nodejs/node-gyp/commit/fb2e80d4e3)] - **doc**: update link to the code of conduct (#2073) (Michaël Zasso) [#2073](https://github.com/nodejs/node-gyp/pull/2073) +* [[`251d9c885c`](https://github.com/nodejs/node-gyp/commit/251d9c885c)] - **doc**: note in README that Python 3.8 is supported (#2072) (Michaël Zasso) [#2072](https://github.com/nodejs/node-gyp/pull/2072) +* [[`2b6fc3c8d6`](https://github.com/nodejs/node-gyp/commit/2b6fc3c8d6)] - **doc, bin**: stop suggesting opening node-gyp issues (Bartosz Sosnowski) [#2096](https://github.com/nodejs/node-gyp/pull/2096) +* [[`a876ae58ad`](https://github.com/nodejs/node-gyp/commit/a876ae58ad)] - **test**: bump actions/checkout from v1 to v2 (BSKY) [#2063](https://github.com/nodejs/node-gyp/pull/2063) + +## v5.1.0 2020-02-05 + +* [[`f37a8b40d0`](https://github.com/nodejs/node-gyp/commit/f37a8b40d0)] - **doc**: add GitHub Actions badge (#1994) (Rod Vagg) [#1994](https://github.com/nodejs/node-gyp/pull/1994) +* [[`cb3f6aae5e`](https://github.com/nodejs/node-gyp/commit/cb3f6aae5e)] - **doc**: update macOS\_Catalina.md (#1992) (James Home) [#1992](https://github.com/nodejs/node-gyp/pull/1992) +* [[`0607596a4c`](https://github.com/nodejs/node-gyp/commit/0607596a4c)] - **doc**: fix typo in README.md (#1985) (Suraneti Rodsuwan) [#1985](https://github.com/nodejs/node-gyp/pull/1985) +* [[`0d5a415a14`](https://github.com/nodejs/node-gyp/commit/0d5a415a14)] - **doc**: add travis badge (Rod Vagg) [#1971](https://github.com/nodejs/node-gyp/pull/1971) +* [[`103740cd95`](https://github.com/nodejs/node-gyp/commit/103740cd95)] - **gyp**: list(dict) so we can del dict(key) while iterating (Christian Clauss) [#2009](https://github.com/nodejs/node-gyp/pull/2009) +* [[`278dcddbdd`](https://github.com/nodejs/node-gyp/commit/278dcddbdd)] - **lib**: ignore VS instances that cause COMExceptions (Andrew Casey) [#2018](https://github.com/nodejs/node-gyp/pull/2018) +* [[`1694907bbf`](https://github.com/nodejs/node-gyp/commit/1694907bbf)] - **lib**: compatibility with semver ≥ 7 (`new` for semver.Range) (Xavier Guimard) [#2006](https://github.com/nodejs/node-gyp/pull/2006) +* [[`a3f1143514`](https://github.com/nodejs/node-gyp/commit/a3f1143514)] - **(SEMVER-MINOR)** **lib**: noproxy support, match proxy detection to `request` (Matias Lopez) [#1978](https://github.com/nodejs/node-gyp/pull/1978) +* [[`52365819c7`](https://github.com/nodejs/node-gyp/commit/52365819c7)] - **test**: remove old docker test harness (#1993) (Rod Vagg) [#1993](https://github.com/nodejs/node-gyp/pull/1993) +* [[`bc509c511d`](https://github.com/nodejs/node-gyp/commit/bc509c511d)] - **test**: add Windows to GitHub Actions testing (#1996) (Christian Clauss) [#1996](https://github.com/nodejs/node-gyp/pull/1996) +* [[`91ee26dd48`](https://github.com/nodejs/node-gyp/commit/91ee26dd48)] - **test**: fix typo in header download test (#2001) (Richard Lau) [#2001](https://github.com/nodejs/node-gyp/pull/2001) +* [[`0923f344c9`](https://github.com/nodejs/node-gyp/commit/0923f344c9)] - **test**: direct python invocation & simpler pyenv (Matias Lopez) [#1979](https://github.com/nodejs/node-gyp/pull/1979) +* [[`32c8744b34`](https://github.com/nodejs/node-gyp/commit/32c8744b34)] - **test**: fix macOS Travis on Python 2.7 & 3.7 (Christian Clauss) [#1979](https://github.com/nodejs/node-gyp/pull/1979) +* [[`fd4b1351e4`](https://github.com/nodejs/node-gyp/commit/fd4b1351e4)] - **test**: initial Github Actions with Ubuntu & macOS (Christian Clauss) [#1985](https://github.com/nodejs/node-gyp/pull/1985) + +## v5.0.7 2019-12-16 + +Republish of v5.0.6 with unnecessary tarball removed from pack file. + +## v5.0.6 2019-12-16 + +* [[`cdec00286f`](https://github.com/nodejs/node-gyp/commit/cdec00286f)] - **doc**: adjustments to the README.md for new users (Dan Pike) [#1919](https://github.com/nodejs/node-gyp/pull/1919) +* [[`b7c8233ef2`](https://github.com/nodejs/node-gyp/commit/b7c8233ef2)] - **test**: fix Python unittests (cclauss) [#1961](https://github.com/nodejs/node-gyp/pull/1961) +* [[`e12b00ab0a`](https://github.com/nodejs/node-gyp/commit/e12b00ab0a)] - **doc**: macOS Catalina add two commands (Christian Clauss) [#1962](https://github.com/nodejs/node-gyp/pull/1962) +* [[`70b9890c0d`](https://github.com/nodejs/node-gyp/commit/70b9890c0d)] - **test**: add header download test (Rod Vagg) [#1796](https://github.com/nodejs/node-gyp/pull/1796) +* [[`4029fa8629`](https://github.com/nodejs/node-gyp/commit/4029fa8629)] - **test**: configure proper devDir for invoking configure() (Rod Vagg) [#1796](https://github.com/nodejs/node-gyp/pull/1796) +* [[`fe8b02cc8b`](https://github.com/nodejs/node-gyp/commit/fe8b02cc8b)] - **doc**: add macOS\_Catalina.md document (cclauss) [#1940](https://github.com/nodejs/node-gyp/pull/1940) +* [[`8ea47ce365`](https://github.com/nodejs/node-gyp/commit/8ea47ce365)] - **gyp**: python3 fixes: utf8 decode, use of 'None' in eval (Wilfried Goesgens) [#1925](https://github.com/nodejs/node-gyp/pull/1925) +* [[`c7229716ba`](https://github.com/nodejs/node-gyp/commit/c7229716ba)] - **gyp**: iteritems() -\> items() in compile\_commands\_json.py (cclauss) [#1947](https://github.com/nodejs/node-gyp/pull/1947) +* [[`2a18b2a0f8`](https://github.com/nodejs/node-gyp/commit/2a18b2a0f8)] - **gyp**: make cmake python3 compatible (gengjiawen) [#1944](https://github.com/nodejs/node-gyp/pull/1944) +* [[`70f391e844`](https://github.com/nodejs/node-gyp/commit/70f391e844)] - **gyp**: fix TypeError in XcodeVersion() (Christian Clauss) [#1939](https://github.com/nodejs/node-gyp/pull/1939) +* [[`9f4f0fa34e`](https://github.com/nodejs/node-gyp/commit/9f4f0fa34e)] - **gyp**: finish decode stdout on Python 3 (Christian Clauss) [#1937](https://github.com/nodejs/node-gyp/pull/1937) +* [[`7cf507906d`](https://github.com/nodejs/node-gyp/commit/7cf507906d)] - **src,win**: allow 403 errors for arm64 node.lib (Richard Lau) [#1934](https://github.com/nodejs/node-gyp/pull/1934) +* [[`ad0d182c01`](https://github.com/nodejs/node-gyp/commit/ad0d182c01)] - **deps**: update deps to roughly match current npm@6 (Rod Vagg) [#1920](https://github.com/nodejs/node-gyp/pull/1920) +* [[`1553081ed6`](https://github.com/nodejs/node-gyp/commit/1553081ed6)] - **test**: upgrade Linux Travis CI to Python 3.8 (Christian Clauss) [#1923](https://github.com/nodejs/node-gyp/pull/1923) +* [[`0705cae9aa`](https://github.com/nodejs/node-gyp/commit/0705cae9aa)] - **travis**: ignore failed `brew upgrade npm`, update xcode (Christian Clauss) [#1932](https://github.com/nodejs/node-gyp/pull/1932) +* [[`7bfdb6f5bf`](https://github.com/nodejs/node-gyp/commit/7bfdb6f5bf)] - **build**: avoid bare exceptions in xcode\_emulation.py (Christian Clauss) [#1932](https://github.com/nodejs/node-gyp/pull/1932) +* [[`7edf7658fa`](https://github.com/nodejs/node-gyp/commit/7edf7658fa)] - **lib,install**: always download SHA sums on Windows (Sam Hughes) [#1926](https://github.com/nodejs/node-gyp/pull/1926) +* [[`69056d04fe`](https://github.com/nodejs/node-gyp/commit/69056d04fe)] - **travis**: add Windows + Python 3.8 to the mix (Rod Vagg) [#1921](https://github.com/nodejs/node-gyp/pull/1921) + +## v5.0.5 2019-10-04 + +* [[`3891391746`](https://github.com/nodejs/node-gyp/commit/3891391746)] - **doc**: reconcile README with Python 3 compat changes (Rod Vagg) [#1911](https://github.com/nodejs/node-gyp/pull/1911) +* [[`07f81f1920`](https://github.com/nodejs/node-gyp/commit/07f81f1920)] - **lib**: accept Python 3 after Python 2 (Sam Roberts) [#1910](https://github.com/nodejs/node-gyp/pull/1910) +* [[`04ce59f4a2`](https://github.com/nodejs/node-gyp/commit/04ce59f4a2)] - **doc**: clarify Python configuration, etc (Sam Roberts) [#1908](https://github.com/nodejs/node-gyp/pull/1908) +* [[`01c46ee3df`](https://github.com/nodejs/node-gyp/commit/01c46ee3df)] - **gyp**: add \_\_lt\_\_ to MSVSSolutionEntry (João Reis) [#1904](https://github.com/nodejs/node-gyp/pull/1904) +* [[`735d961b99`](https://github.com/nodejs/node-gyp/commit/735d961b99)] - **win**: support VS 2017 Desktop Express (João Reis) [#1902](https://github.com/nodejs/node-gyp/pull/1902) +* [[`3834156a92`](https://github.com/nodejs/node-gyp/commit/3834156a92)] - **test**: add Python 3.5 and 3.6 tests on Linux (cclauss) [#1909](https://github.com/nodejs/node-gyp/pull/1909) +* [[`1196e990d8`](https://github.com/nodejs/node-gyp/commit/1196e990d8)] - **src**: update to standard@14 (Rod Vagg) [#1899](https://github.com/nodejs/node-gyp/pull/1899) +* [[`53ee7dfe89`](https://github.com/nodejs/node-gyp/commit/53ee7dfe89)] - **gyp**: fix undefined name: cflags --\> ldflags (Christian Clauss) [#1901](https://github.com/nodejs/node-gyp/pull/1901) +* [[`5871dcf6c9`](https://github.com/nodejs/node-gyp/commit/5871dcf6c9)] - **src,win**: add support for fetching arm64 node.lib (Richard Townsend) [#1875](https://github.com/nodejs/node-gyp/pull/1875) + +## v5.0.4 2019-09-27 + +* [[`1236869ffc`](https://github.com/nodejs/node-gyp/commit/1236869ffc)] - **gyp**: modify XcodeVersion() to convert "4.2" to "0420" and "10.0" to "1000" (Christian Clauss) [#1895](https://github.com/nodejs/node-gyp/pull/1895) +* [[`36638afe48`](https://github.com/nodejs/node-gyp/commit/36638afe48)] - **gyp**: more decode stdout on Python 3 (cclauss) [#1894](https://github.com/nodejs/node-gyp/pull/1894) +* [[`f753c167c5`](https://github.com/nodejs/node-gyp/commit/f753c167c5)] - **gyp**: decode stdout on Python 3 (cclauss) [#1890](https://github.com/nodejs/node-gyp/pull/1890) +* [[`60a4083523`](https://github.com/nodejs/node-gyp/commit/60a4083523)] - **doc**: update xcode install instructions to match Node's BUILDING (Nhan Khong) [#1884](https://github.com/nodejs/node-gyp/pull/1884) +* [[`19dbc9ac32`](https://github.com/nodejs/node-gyp/commit/19dbc9ac32)] - **deps**: update tar to 4.4.12 (Matheus Marchini) [#1889](https://github.com/nodejs/node-gyp/pull/1889) +* [[`5f3ed92181`](https://github.com/nodejs/node-gyp/commit/5f3ed92181)] - **bin**: fix the usage instructions (Halit Ogunc) [#1888](https://github.com/nodejs/node-gyp/pull/1888) +* [[`aab118edf1`](https://github.com/nodejs/node-gyp/commit/aab118edf1)] - **lib**: adding keep-alive header to download requests (Milad Farazmand) [#1863](https://github.com/nodejs/node-gyp/pull/1863) +* [[`1186e89326`](https://github.com/nodejs/node-gyp/commit/1186e89326)] - **lib**: ignore non-critical os.userInfo() failures (Rod Vagg) [#1835](https://github.com/nodejs/node-gyp/pull/1835) +* [[`785e527c3d`](https://github.com/nodejs/node-gyp/commit/785e527c3d)] - **doc**: fix missing argument for setting python path (lagorsse) [#1802](https://github.com/nodejs/node-gyp/pull/1802) +* [[`a97615196c`](https://github.com/nodejs/node-gyp/commit/a97615196c)] - **gyp**: rm semicolons (Python != JavaScript) (MattIPv4) [#1858](https://github.com/nodejs/node-gyp/pull/1858) +* [[`06019bac24`](https://github.com/nodejs/node-gyp/commit/06019bac24)] - **gyp**: assorted typo fixes (XhmikosR) [#1853](https://github.com/nodejs/node-gyp/pull/1853) +* [[`3f4972c1ca`](https://github.com/nodejs/node-gyp/commit/3f4972c1ca)] - **gyp**: use "is" when comparing to None (Vladyslav Burzakovskyy) [#1860](https://github.com/nodejs/node-gyp/pull/1860) +* [[`1cb4708073`](https://github.com/nodejs/node-gyp/commit/1cb4708073)] - **src,win**: improve unmanaged handling (Peter Sabath) [#1852](https://github.com/nodejs/node-gyp/pull/1852) +* [[`5553cd910e`](https://github.com/nodejs/node-gyp/commit/5553cd910e)] - **gyp**: improve Windows+Cygwin compatibility (Jose Quijada) [#1817](https://github.com/nodejs/node-gyp/pull/1817) +* [[`8bcb1fbb43`](https://github.com/nodejs/node-gyp/commit/8bcb1fbb43)] - **gyp**: Python 3 Windows fixes (João Reis) [#1843](https://github.com/nodejs/node-gyp/pull/1843) +* [[`2e24d0a326`](https://github.com/nodejs/node-gyp/commit/2e24d0a326)] - **test**: accept Python 3 in test-find-python.js (João Reis) [#1843](https://github.com/nodejs/node-gyp/pull/1843) +* [[`1267b4dc1c`](https://github.com/nodejs/node-gyp/commit/1267b4dc1c)] - **build**: add test run Python 3.7 on macOS (Christian Clauss) [#1843](https://github.com/nodejs/node-gyp/pull/1843) +* [[`da1b031aa3`](https://github.com/nodejs/node-gyp/commit/da1b031aa3)] - **build**: import StringIO on Python 2 and Python 3 (Christian Clauss) [#1836](https://github.com/nodejs/node-gyp/pull/1836) +* [[`fa0ed4aa42`](https://github.com/nodejs/node-gyp/commit/fa0ed4aa42)] - **build**: more Python 3 compat, replace compile with ast (cclauss) [#1820](https://github.com/nodejs/node-gyp/pull/1820) +* [[`18d5c7c9d0`](https://github.com/nodejs/node-gyp/commit/18d5c7c9d0)] - **win,src**: update win\_delay\_load\_hook.cc to work with /clr (Ivan Petrovic) [#1819](https://github.com/nodejs/node-gyp/pull/1819) + +## v5.0.3 2019-07-17 + +* [[`66ad305775`](https://github.com/nodejs/node-gyp/commit/66ad305775)] - **python**: accept Python 3 conditionally (João Reis) [#1815](https://github.com/nodejs/node-gyp/pull/1815) +* [[`7e7fce3fed`](https://github.com/nodejs/node-gyp/commit/7e7fce3fed)] - **python**: move Python detection to its own file (João Reis) [#1815](https://github.com/nodejs/node-gyp/pull/1815) +* [[`e40c99e283`](https://github.com/nodejs/node-gyp/commit/e40c99e283)] - **src**: implement standard.js linting (Rod Vagg) [#1794](https://github.com/nodejs/node-gyp/pull/1794) +* [[`bb92c761a9`](https://github.com/nodejs/node-gyp/commit/bb92c761a9)] - **test**: add Node.js 6 on Windows to Travis CI (João Reis) [#1812](https://github.com/nodejs/node-gyp/pull/1812) +* [[`7fd924079f`](https://github.com/nodejs/node-gyp/commit/7fd924079f)] - **test**: increase tap timeout (João Reis) [#1812](https://github.com/nodejs/node-gyp/pull/1812) +* [[`7e8127068f`](https://github.com/nodejs/node-gyp/commit/7e8127068f)] - **test**: cover supported node versions with travis (Rod Vagg) [#1809](https://github.com/nodejs/node-gyp/pull/1809) +* [[`24109148df`](https://github.com/nodejs/node-gyp/commit/24109148df)] - **test**: downgrade to tap@^12 for continued Node 6 support (Rod Vagg) [#1808](https://github.com/nodejs/node-gyp/pull/1808) +* [[`656117cc4a`](https://github.com/nodejs/node-gyp/commit/656117cc4a)] - **win**: make VS path match case-insensitive (João Reis) [#1806](https://github.com/nodejs/node-gyp/pull/1806) + +## v5.0.2 2019-06-27 + +* [[`2761afbf73`](https://github.com/nodejs/node-gyp/commit/2761afbf73)] - **build,test**: add duplicate symbol test (Gabriel Schulhof) [#1689](https://github.com/nodejs/node-gyp/pull/1689) +* [[`82f129d6de`](https://github.com/nodejs/node-gyp/commit/82f129d6de)] - **gyp**: replace optparse to argparse (KiYugadgeter) [#1591](https://github.com/nodejs/node-gyp/pull/1591) +* [[`afaaa29c61`](https://github.com/nodejs/node-gyp/commit/afaaa29c61)] - **gyp**: remove from \_\_future\_\_ import with\_statement (cclauss) [#1799](https://github.com/nodejs/node-gyp/pull/1799) +* [[`a991f633d6`](https://github.com/nodejs/node-gyp/commit/a991f633d6)] - **gyp**: fix the remaining Python 3 issues (cclauss) [#1793](https://github.com/nodejs/node-gyp/pull/1793) +* [[`f952b08f84`](https://github.com/nodejs/node-gyp/commit/f952b08f84)] - **gyp**: move from \_\_future\_\_ import to the top of the file (cclauss) [#1789](https://github.com/nodejs/node-gyp/pull/1789) +* [[`4f4a677dfa`](https://github.com/nodejs/node-gyp/commit/4f4a677dfa)] - **gyp**: use different default compiler for z/OS (Shuowang (Wayne) Zhang) [#1768](https://github.com/nodejs/node-gyp/pull/1768) +* [[`03683f09d6`](https://github.com/nodejs/node-gyp/commit/03683f09d6)] - **lib**: code de-duplication (Pavel Medvedev) [#965](https://github.com/nodejs/node-gyp/pull/965) +* [[`611bc3c89f`](https://github.com/nodejs/node-gyp/commit/611bc3c89f)] - **lib**: add .json suffix for explicit require (Rod Vagg) [#1787](https://github.com/nodejs/node-gyp/pull/1787) +* [[`d3478d7b0b`](https://github.com/nodejs/node-gyp/commit/d3478d7b0b)] - **meta**: add to .gitignore (Refael Ackermann) [#1573](https://github.com/nodejs/node-gyp/pull/1573) +* [[`7a9a038e9e`](https://github.com/nodejs/node-gyp/commit/7a9a038e9e)] - **test**: add parallel test runs on macOS and Windows (cclauss) [#1800](https://github.com/nodejs/node-gyp/pull/1800) +* [[`7dd7f2b2a2`](https://github.com/nodejs/node-gyp/commit/7dd7f2b2a2)] - **test**: fix Python syntax error in test-adding.js (cclauss) [#1793](https://github.com/nodejs/node-gyp/pull/1793) +* [[`395f843de0`](https://github.com/nodejs/node-gyp/commit/395f843de0)] - **test**: replace self-signed cert with 'localhost' (Rod Vagg) [#1795](https://github.com/nodejs/node-gyp/pull/1795) +* [[`a52c6eb9e8`](https://github.com/nodejs/node-gyp/commit/a52c6eb9e8)] - **test**: migrate from tape to tap (Rod Vagg) [#1795](https://github.com/nodejs/node-gyp/pull/1795) +* [[`ec2eb44a30`](https://github.com/nodejs/node-gyp/commit/ec2eb44a30)] - **test**: use Nan in duplicate\_symbols (Gabriel Schulhof) [#1689](https://github.com/nodejs/node-gyp/pull/1689) +* [[`1597c84aad`](https://github.com/nodejs/node-gyp/commit/1597c84aad)] - **test**: use Travis CI to run tests on every pull request (cclauss) [#1752](https://github.com/nodejs/node-gyp/pull/1752) +* [[`dd9bf929ac`](https://github.com/nodejs/node-gyp/commit/dd9bf929ac)] - **zos**: update compiler options (Shuowang (Wayne) Zhang) [#1768](https://github.com/nodejs/node-gyp/pull/1768) + +## v5.0.1 2019-06-20 + +* [[`e3861722ed`](https://github.com/nodejs/node-gyp/commit/e3861722ed)] - **doc**: document --jobs max (David Sanders) [#1770](https://github.com/nodejs/node-gyp/pull/1770) +* [[`1cfdb28886`](https://github.com/nodejs/node-gyp/commit/1cfdb28886)] - **lib**: reintroduce support for iojs file naming for releases \>= 1 && \< 4 (Samuel Attard) [#1777](https://github.com/nodejs/node-gyp/pull/1777) + +## v5.0.0 2019-06-13 + +* [[`8a83972743`](https://github.com/nodejs/node-gyp/commit/8a83972743)] - **(SEMVER-MAJOR)** **bin**: follow XDG OS conventions for storing data (Selwyn) [#1570](https://github.com/nodejs/node-gyp/pull/1570) +* [[`9e46872ea3`](https://github.com/nodejs/node-gyp/commit/9e46872ea3)] - **bin,lib**: remove extra comments/lines/spaces (Jon Moss) [#1508](https://github.com/nodejs/node-gyp/pull/1508) +* [[`8098ebdeb4`](https://github.com/nodejs/node-gyp/commit/8098ebdeb4)] - **deps**: replace `osenv` dependency with native `os` (Selwyn) +* [[`f83b457e03`](https://github.com/nodejs/node-gyp/commit/f83b457e03)] - **deps**: bump request to 2.8.7, fixes heok/hawk issues (Rohit Hazra) [#1492](https://github.com/nodejs/node-gyp/pull/1492) +* [[`323cee7323`](https://github.com/nodejs/node-gyp/commit/323cee7323)] - **deps**: pin `request` version range (Refael Ackermann) [#1300](https://github.com/nodejs/node-gyp/pull/1300) +* [[`c515912d08`](https://github.com/nodejs/node-gyp/commit/c515912d08)] - **doc**: improve issue template (Bartosz Sosnowski) [#1618](https://github.com/nodejs/node-gyp/pull/1618) +* [[`cca2d66727`](https://github.com/nodejs/node-gyp/commit/cca2d66727)] - **doc**: python info needs own header (Taylor D. Lee) [#1245](https://github.com/nodejs/node-gyp/pull/1245) +* [[`3e64c780f5`](https://github.com/nodejs/node-gyp/commit/3e64c780f5)] - **doc**: lint README.md (Jon Moss) [#1498](https://github.com/nodejs/node-gyp/pull/1498) +* [[`a20faedc91`](https://github.com/nodejs/node-gyp/commit/a20faedc91)] - **(SEMVER-MAJOR)** **gyp**: enable MARMASM items only on new VS versions (João Reis) [#1762](https://github.com/nodejs/node-gyp/pull/1762) +* [[`721eb691cf`](https://github.com/nodejs/node-gyp/commit/721eb691cf)] - **gyp**: teach MSVS generator about MARMASM Items (Jon Kunkee) [#1679](https://github.com/nodejs/node-gyp/pull/1679) +* [[`91744bfecc`](https://github.com/nodejs/node-gyp/commit/91744bfecc)] - **gyp**: add support for Windows on Arm (Richard Townsend) [#1739](https://github.com/nodejs/node-gyp/pull/1739) +* [[`a6e0a6c7ed`](https://github.com/nodejs/node-gyp/commit/a6e0a6c7ed)] - **gyp**: move compile\_commands\_json (Paul Maréchal) [#1661](https://github.com/nodejs/node-gyp/pull/1661) +* [[`92e8b52cee`](https://github.com/nodejs/node-gyp/commit/92e8b52cee)] - **gyp**: fix target --\> self.target (cclauss) +* [[`febdfa2137`](https://github.com/nodejs/node-gyp/commit/febdfa2137)] - **gyp**: fix sntex error (cclauss) [#1333](https://github.com/nodejs/node-gyp/pull/1333) +* [[`588d333c14`](https://github.com/nodejs/node-gyp/commit/588d333c14)] - **gyp**: \_winreg module was renamed to winreg in Python 3. (Craig Rodrigues) +* [[`98226d198c`](https://github.com/nodejs/node-gyp/commit/98226d198c)] - **gyp**: replace basestring with str, but only on Python 3. (Craig Rodrigues) +* [[`7535e4478e`](https://github.com/nodejs/node-gyp/commit/7535e4478e)] - **gyp**: replace deprecated functions (Craig Rodrigues) +* [[`2040cd21cc`](https://github.com/nodejs/node-gyp/commit/2040cd21cc)] - **gyp**: use print as a function, as specified in PEP 3105. (Craig Rodrigues) +* [[`abef93ded5`](https://github.com/nodejs/node-gyp/commit/abef93ded5)] - **gyp**: get ready for python 3 (cclauss) +* [[`43031fadcb`](https://github.com/nodejs/node-gyp/commit/43031fadcb)] - **python**: clean-up detection (João Reis) [#1582](https://github.com/nodejs/node-gyp/pull/1582) +* [[`49ab79d221`](https://github.com/nodejs/node-gyp/commit/49ab79d221)] - **python**: more informative error (Refael Ackermann) [#1269](https://github.com/nodejs/node-gyp/pull/1269) +* [[`997bc3c748`](https://github.com/nodejs/node-gyp/commit/997bc3c748)] - **readme**: add ARM64 info to MSVC setup instructions (Jon Kunkee) [#1655](https://github.com/nodejs/node-gyp/pull/1655) +* [[`788e767179`](https://github.com/nodejs/node-gyp/commit/788e767179)] - **test**: remove unused variable (João Reis) +* [[`6f5a408934`](https://github.com/nodejs/node-gyp/commit/6f5a408934)] - **tools**: fix usage of inherited -fPIC and -fPIE (Jens) [#1340](https://github.com/nodejs/node-gyp/pull/1340) +* [[`0efb8fb34b`](https://github.com/nodejs/node-gyp/commit/0efb8fb34b)] - **(SEMVER-MAJOR)** **win**: support running in VS Command Prompt (João Reis) [#1762](https://github.com/nodejs/node-gyp/pull/1762) +* [[`360ddbdf3a`](https://github.com/nodejs/node-gyp/commit/360ddbdf3a)] - **(SEMVER-MAJOR)** **win**: add support for Visual Studio 2019 (João Reis) [#1762](https://github.com/nodejs/node-gyp/pull/1762) +* [[`8f43f68275`](https://github.com/nodejs/node-gyp/commit/8f43f68275)] - **(SEMVER-MAJOR)** **win**: detect all VS versions in node-gyp (João Reis) [#1762](https://github.com/nodejs/node-gyp/pull/1762) +* [[`7fe4095974`](https://github.com/nodejs/node-gyp/commit/7fe4095974)] - **(SEMVER-MAJOR)** **win**: generic Visual Studio 2017 detection (João Reis) [#1762](https://github.com/nodejs/node-gyp/pull/1762) +* [[`7a71d68bce`](https://github.com/nodejs/node-gyp/commit/7a71d68bce)] - **win**: use msbuild from the configure stage (Bartosz Sosnowski) [#1654](https://github.com/nodejs/node-gyp/pull/1654) +* [[`d3b21220a0`](https://github.com/nodejs/node-gyp/commit/d3b21220a0)] - **win**: fix delay-load hook for electron 4 (Andy Dill) +* [[`81f3a92338`](https://github.com/nodejs/node-gyp/commit/81f3a92338)] - Update list of Node.js versions to test against. (Ben Noordhuis) [#1670](https://github.com/nodejs/node-gyp/pull/1670) +* [[`4748f6ab75`](https://github.com/nodejs/node-gyp/commit/4748f6ab75)] - Remove deprecated compatibility code. (Ben Noordhuis) [#1670](https://github.com/nodejs/node-gyp/pull/1670) +* [[`45e3221fd4`](https://github.com/nodejs/node-gyp/commit/45e3221fd4)] - Remove an outdated workaround for Python 2.4 (cclauss) [#1650](https://github.com/nodejs/node-gyp/pull/1650) +* [[`721dc7d314`](https://github.com/nodejs/node-gyp/commit/721dc7d314)] - Add ARM64 to MSBuild /Platform logic (Jon Kunkee) [#1655](https://github.com/nodejs/node-gyp/pull/1655) +* [[`a5b7410497`](https://github.com/nodejs/node-gyp/commit/a5b7410497)] - Add ESLint no-unused-vars rule (Jon Moss) [#1497](https://github.com/nodejs/node-gyp/pull/1497) + +## v4.0.0 2019-04-24 + +* [[`ceed5cbe10`](https://github.com/nodejs/node-gyp/commit/ceed5cbe10)] - **deps**: updated tar package version to 4.4.8 (Pobegaylo Maksim) [#1713](https://github.com/nodejs/node-gyp/pull/1713) +* [[`374519e066`](https://github.com/nodejs/node-gyp/commit/374519e066)] - **(SEMVER-MAJOR)** Upgrade to tar v3 (isaacs) [#1212](https://github.com/nodejs/node-gyp/pull/1212) +* [[`e6699d13cd`](https://github.com/nodejs/node-gyp/commit/e6699d13cd)] - **test**: fix addon test for Node.js 12 and V8 7.4 (Richard Lau) [#1705](https://github.com/nodejs/node-gyp/pull/1705) +* [[`0c6bf530a0`](https://github.com/nodejs/node-gyp/commit/0c6bf530a0)] - **lib**: use print() for python version detection (GreenAddress) [#1534](https://github.com/nodejs/node-gyp/pull/1534) + +## v3.8.0 2018-08-09 + +* [[`c5929cb4fe`](https://github.com/nodejs/node-gyp/commit/c5929cb4fe)] - **doc**: update Xcode preferences tab name. (Ivan Daniluk) [#1330](https://github.com/nodejs/node-gyp/pull/1330) +* [[`8b488da8b9`](https://github.com/nodejs/node-gyp/commit/8b488da8b9)] - **doc**: update link to commit guidelines (Jonas Hermsmeier) [#1456](https://github.com/nodejs/node-gyp/pull/1456) +* [[`b4fe8c16f9`](https://github.com/nodejs/node-gyp/commit/b4fe8c16f9)] - **doc**: fix visual studio links (Bartosz Sosnowski) [#1490](https://github.com/nodejs/node-gyp/pull/1490) +* [[`536759c7e9`](https://github.com/nodejs/node-gyp/commit/536759c7e9)] - **configure**: use sys.version\_info to get python version (Yang Guo) [#1504](https://github.com/nodejs/node-gyp/pull/1504) +* [[`94c39c604e`](https://github.com/nodejs/node-gyp/commit/94c39c604e)] - **gyp**: fix ninja build failure (GYP patch) (Daniel Bevenius) [nodejs/node#12484](https://github.com/nodejs/node/pull/12484) +* [[`e8ea74e0fa`](https://github.com/nodejs/node-gyp/commit/e8ea74e0fa)] - **tools**: patch gyp to avoid xcrun errors (Ujjwal Sharma) [nodejs/node#21520](https://github.com/nodejs/node/pull/21520) +* [[`ea9aff44f2`](https://github.com/nodejs/node-gyp/commit/ea9aff44f2)] - **tools**: fix "the the" typos in comments (Masashi Hirano) [nodejs/node#20716](https://github.com/nodejs/node/pull/20716) +* [[`207e5aa4fd`](https://github.com/nodejs/node-gyp/commit/207e5aa4fd)] - **gyp**: implement LD/LDXX for ninja and FIPS (Sam Roberts) +* [[`b416c5f4b7`](https://github.com/nodejs/node-gyp/commit/b416c5f4b7)] - **gyp**: enable cctest to use objects (gyp part) (Daniel Bevenius) [nodejs/node#12450](https://github.com/nodejs/node/pull/12450) +* [[`40692d016b`](https://github.com/nodejs/node-gyp/commit/40692d016b)] - **gyp**: add compile\_commands.json gyp generator (Ben Noordhuis) [nodejs/node#12450](https://github.com/nodejs/node/pull/12450) +* [[`fc3c4e2b10`](https://github.com/nodejs/node-gyp/commit/fc3c4e2b10)] - **gyp**: float gyp patch for long filenames (Anna Henningsen) [nodejs/node#7963](https://github.com/nodejs/node/pull/7963) +* [[`8aedbfdef6`](https://github.com/nodejs/node-gyp/commit/8aedbfdef6)] - **gyp**: backport GYP fix to fix AIX shared suffix (Stewart Addison) +* [[`6cd84b84fc`](https://github.com/nodejs/node-gyp/commit/6cd84b84fc)] - **test**: formatting and minor fixes for execFileSync replacement (Rod Vagg) [#1521](https://github.com/nodejs/node-gyp/pull/1521) +* [[`60e421363f`](https://github.com/nodejs/node-gyp/commit/60e421363f)] - **test**: added test/processExecSync.js for when execFileSync is not available. (Rohit Hazra) [#1492](https://github.com/nodejs/node-gyp/pull/1492) +* [[`969447c5bd`](https://github.com/nodejs/node-gyp/commit/969447c5bd)] - **deps**: bump request to 2.8.7, fixes heok/hawk issues (Rohit Hazra) [#1492](https://github.com/nodejs/node-gyp/pull/1492) +* [[`340403ccfe`](https://github.com/nodejs/node-gyp/commit/340403ccfe)] - **win**: improve parsing of SDK version (Alessandro Vergani) [#1516](https://github.com/nodejs/node-gyp/pull/1516) + +## v3.7.0 2018-06-08 + +* [[`84cea7b30d`](https://github.com/nodejs/node-gyp/commit/84cea7b30d)] - Remove unused gyp test scripts. (Ben Noordhuis) [#1458](https://github.com/nodejs/node-gyp/pull/1458) +* [[`0540e4ec63`](https://github.com/nodejs/node-gyp/commit/0540e4ec63)] - **gyp**: escape spaces in filenames in make generator (Jeff Senn) [#1436](https://github.com/nodejs/node-gyp/pull/1436) +* [[`88fc6fa0ec`](https://github.com/nodejs/node-gyp/commit/88fc6fa0ec)] - Drop dependency on minimatch. (Brian Woodward) [#1158](https://github.com/nodejs/node-gyp/pull/1158) +* [[`1e203c5148`](https://github.com/nodejs/node-gyp/commit/1e203c5148)] - Fix include path when pointing to Node.js source (Richard Lau) [#1055](https://github.com/nodejs/node-gyp/pull/1055) +* [[`53d8cb967c`](https://github.com/nodejs/node-gyp/commit/53d8cb967c)] - Prefix build targets with /t: on Windows (Natalie Wolfe) [#1164](https://github.com/nodejs/node-gyp/pull/1164) +* [[`53a5f8ff38`](https://github.com/nodejs/node-gyp/commit/53a5f8ff38)] - **gyp**: add support for .mm files to msvs generator (Julien Racle) [#1167](https://github.com/nodejs/node-gyp/pull/1167) +* [[`dd8561e528`](https://github.com/nodejs/node-gyp/commit/dd8561e528)] - **zos**: don't use universal-new-lines mode (John Barboza) [#1451](https://github.com/nodejs/node-gyp/pull/1451) +* [[`e5a69010ed`](https://github.com/nodejs/node-gyp/commit/e5a69010ed)] - **zos**: add search locations for libnode.x (John Barboza) [#1451](https://github.com/nodejs/node-gyp/pull/1451) +* [[`79febace53`](https://github.com/nodejs/node-gyp/commit/79febace53)] - **doc**: update macOS information in README (Josh Parnham) [#1323](https://github.com/nodejs/node-gyp/pull/1323) +* [[`9425448945`](https://github.com/nodejs/node-gyp/commit/9425448945)] - **gyp**: don't print xcodebuild not found errors (Gibson Fahnestock) [#1370](https://github.com/nodejs/node-gyp/pull/1370) +* [[`6f1286f5b2`](https://github.com/nodejs/node-gyp/commit/6f1286f5b2)] - Fix infinite install loop. (Ben Noordhuis) [#1384](https://github.com/nodejs/node-gyp/pull/1384) +* [[`2580b9139e`](https://github.com/nodejs/node-gyp/commit/2580b9139e)] - Update `--nodedir` description in README. (Ben Noordhuis) [#1372](https://github.com/nodejs/node-gyp/pull/1372) +* [[`a61360391a`](https://github.com/nodejs/node-gyp/commit/a61360391a)] - Update README with another way to install on windows (JeffAtDeere) [#1352](https://github.com/nodejs/node-gyp/pull/1352) +* [[`47496bf6dc`](https://github.com/nodejs/node-gyp/commit/47496bf6dc)] - Fix IndexError when parsing GYP files. (Ben Noordhuis) [#1267](https://github.com/nodejs/node-gyp/pull/1267) +* [[`b2024dee7b`](https://github.com/nodejs/node-gyp/commit/b2024dee7b)] - **zos**: support platform (John Barboza) [#1276](https://github.com/nodejs/node-gyp/pull/1276) +* [[`90d86512f4`](https://github.com/nodejs/node-gyp/commit/90d86512f4)] - **win**: run PS with `-NoProfile` (Refael Ackermann) [#1292](https://github.com/nodejs/node-gyp/pull/1292) +* [[`2da5f86ef7`](https://github.com/nodejs/node-gyp/commit/2da5f86ef7)] - **doc**: add github PR and Issue templates (Gibson Fahnestock) [#1228](https://github.com/nodejs/node-gyp/pull/1228) +* [[`a46a770d68`](https://github.com/nodejs/node-gyp/commit/a46a770d68)] - **doc**: update proposed DCO and CoC (Mikeal Rogers) [#1229](https://github.com/nodejs/node-gyp/pull/1229) +* [[`7e803d58e0`](https://github.com/nodejs/node-gyp/commit/7e803d58e0)] - **doc**: headerify the Install instructions (Nick Schonning) [#1225](https://github.com/nodejs/node-gyp/pull/1225) +* [[`f27599193a`](https://github.com/nodejs/node-gyp/commit/f27599193a)] - **gyp**: update xml string encoding conversion (Liu Chao) [#1203](https://github.com/nodejs/node-gyp/pull/1203) +* [[`0a07e481f7`](https://github.com/nodejs/node-gyp/commit/0a07e481f7)] - **configure**: don't set ensure if tarball is set (Gibson Fahnestock) [#1220](https://github.com/nodejs/node-gyp/pull/1220) + +## v3.6.3 2018-06-08 + +* [[`90cd2e8da9`](https://github.com/nodejs/node-gyp/commit/90cd2e8da9)] - **gyp**: fix regex to match multi-digit versions (Jonas Hermsmeier) [#1455](https://github.com/nodejs/node-gyp/pull/1455) +* [[`7900122337`](https://github.com/nodejs/node-gyp/commit/7900122337)] - deps: pin `request` version range (Refael Ackerman) [#1300](https://github.com/nodejs/node-gyp/pull/1300) + +## v3.6.2 2017-06-01 + +* [[`72afdd62cd`](https://github.com/nodejs/node-gyp/commit/72afdd62cd)] - **build**: rename copyNodeLib() to doBuild() (Liu Chao) [#1206](https://github.com/nodejs/node-gyp/pull/1206) +* [[`bad903ac70`](https://github.com/nodejs/node-gyp/commit/bad903ac70)] - **win**: more robust parsing of SDK version (Refael Ackermann) [#1198](https://github.com/nodejs/node-gyp/pull/1198) +* [[`241752f381`](https://github.com/nodejs/node-gyp/commit/241752f381)] - Log dist-url. (Ben Noordhuis) [#1170](https://github.com/nodejs/node-gyp/pull/1170) +* [[`386746c7d1`](https://github.com/nodejs/node-gyp/commit/386746c7d1)] - **configure**: use full path in node_lib_file GYP var (Pavel Medvedev) [#964](https://github.com/nodejs/node-gyp/pull/964) +* [[`0913b2dd99`](https://github.com/nodejs/node-gyp/commit/0913b2dd99)] - **build, win**: use target_arch to link with node.lib (Pavel Medvedev) [#964](https://github.com/nodejs/node-gyp/pull/964) +* [[`c307b302f7`](https://github.com/nodejs/node-gyp/commit/c307b302f7)] - **doc**: blorb about setting `npm_config_OPTION_NAME` (Refael Ackermann) [#1185](https://github.com/nodejs/node-gyp/pull/1185) + +## v3.6.1 2017-04-30 + +* [[`49801716c2`](https://github.com/nodejs/node-gyp/commit/49801716c2)] - **test**: fix test-find-python on v0.10.x buildbot. (Ben Noordhuis) [#1172](https://github.com/nodejs/node-gyp/pull/1172) +* [[`a83a3801fc`](https://github.com/nodejs/node-gyp/commit/a83a3801fc)] - **test**: fix test/test-configure-python on AIX (Richard Lau) [#1131](https://github.com/nodejs/node-gyp/pull/1131) +* [[`8a767145c9`](https://github.com/nodejs/node-gyp/commit/8a767145c9)] - **gyp**: Revert quote_cmd workaround (Kunal Pathak) [#1153](https://github.com/nodejs/node-gyp/pull/1153) +* [[`c09cf7671e`](https://github.com/nodejs/node-gyp/commit/c09cf7671e)] - **doc**: add a note for using `configure` on Windows (Vse Mozhet Byt) [#1152](https://github.com/nodejs/node-gyp/pull/1152) +* [[`da9cb5f411`](https://github.com/nodejs/node-gyp/commit/da9cb5f411)] - Delete superfluous .patch files. (Ben Noordhuis) [#1122](https://github.com/nodejs/node-gyp/pull/1122) + +## v3.6.0 2017-03-16 + +* [[`ae141e1906`](https://github.com/nodejs/node-gyp/commit/ae141e1906)] - **win**: find and setup for VS2017 (Refael Ackermann) [#1130](https://github.com/nodejs/node-gyp/pull/1130) +* [[`ec5fc36a80`](https://github.com/nodejs/node-gyp/commit/ec5fc36a80)] - Add support to build node.js with chakracore for ARM. (Kunal Pathak) [#873](https://github.com/nodejs/node-gyp/pull/873) +* [[`a04ea3051a`](https://github.com/nodejs/node-gyp/commit/a04ea3051a)] - Add support to build node.js with chakracore. (Kunal Pathak) [#873](https://github.com/nodejs/node-gyp/pull/873) +* [[`93d7fa83c8`](https://github.com/nodejs/node-gyp/commit/93d7fa83c8)] - Upgrade semver dependency. (Ben Noordhuis) [#1107](https://github.com/nodejs/node-gyp/pull/1107) +* [[`ff9a6fadfd`](https://github.com/nodejs/node-gyp/commit/ff9a6fadfd)] - Update link of gyp as Google code is shutting down (Peter Dave Hello) [#1061](https://github.com/nodejs/node-gyp/pull/1061) + +## v3.5.0 2017-01-10 + +* [[`762d19a39e`](https://github.com/nodejs/node-gyp/commit/762d19a39e)] - \[doc\] merge History.md and CHANGELOG.md (Rod Vagg) +* [[`80fc5c3d31`](https://github.com/nodejs/node-gyp/commit/80fc5c3d31)] - Fix deprecated dependency warning (Simone Primarosa) [#1069](https://github.com/nodejs/node-gyp/pull/1069) +* [[`05c44944fd`](https://github.com/nodejs/node-gyp/commit/05c44944fd)] - Open the build file with universal-newlines mode (Guy Margalit) [#1053](https://github.com/nodejs/node-gyp/pull/1053) +* [[`37ae7be114`](https://github.com/nodejs/node-gyp/commit/37ae7be114)] - Try python launcher when stock python is python 3. (Ben Noordhuis) [#992](https://github.com/nodejs/node-gyp/pull/992) +* [[`e3778d9907`](https://github.com/nodejs/node-gyp/commit/e3778d9907)] - Add lots of findPython() tests. (Ben Noordhuis) [#992](https://github.com/nodejs/node-gyp/pull/992) +* [[`afc766adf6`](https://github.com/nodejs/node-gyp/commit/afc766adf6)] - Unset executable bit for .bat files (Pavel Medvedev) [#969](https://github.com/nodejs/node-gyp/pull/969) +* [[`ddac348991`](https://github.com/nodejs/node-gyp/commit/ddac348991)] - Use push on PYTHONPATH and add tests (Michael Hart) [#990](https://github.com/nodejs/node-gyp/pull/990) +* [[`b182a19042`](https://github.com/nodejs/node-gyp/commit/b182a19042)] - ***Revert*** "add "path-array" dep" (Michael Hart) [#990](https://github.com/nodejs/node-gyp/pull/990) +* [[`7c08b85c5a`](https://github.com/nodejs/node-gyp/commit/7c08b85c5a)] - ***Revert*** "**configure**: use "path-array" for PYTHONPATH" (Michael Hart) [#990](https://github.com/nodejs/node-gyp/pull/990) +* [[`9c8d275526`](https://github.com/nodejs/node-gyp/commit/9c8d275526)] - Add --devdir flag. (Ben Noordhuis) [#916](https://github.com/nodejs/node-gyp/pull/916) +* [[`f6eab1f9e4`](https://github.com/nodejs/node-gyp/commit/f6eab1f9e4)] - **doc**: add windows-build-tools to readme (Felix Rieseberg) [#970](https://github.com/nodejs/node-gyp/pull/970) + +## v3.4.0 2016-06-28 + +* [[`ce5fd04e94`](https://github.com/nodejs/node-gyp/commit/ce5fd04e94)] - **deps**: update minimatch version (delphiactual) [#961](https://github.com/nodejs/node-gyp/pull/961) +* [[`77383ddd85`](https://github.com/nodejs/node-gyp/commit/77383ddd85)] - Replace fs.accessSync call to fs.statSync (Richard Lau) [#955](https://github.com/nodejs/node-gyp/pull/955) +* [[`0dba4bda57`](https://github.com/nodejs/node-gyp/commit/0dba4bda57)] - **test**: add simple addon test (Richard Lau) [#955](https://github.com/nodejs/node-gyp/pull/955) +* [[`c4344b3889`](https://github.com/nodejs/node-gyp/commit/c4344b3889)] - **doc**: add --target option to README (Gibson Fahnestock) [#958](https://github.com/nodejs/node-gyp/pull/958) +* [[`cc778e9215`](https://github.com/nodejs/node-gyp/commit/cc778e9215)] - Override BUILDING_UV_SHARED, BUILDING_V8_SHARED. (Ben Noordhuis) [#915](https://github.com/nodejs/node-gyp/pull/915) +* [[`af35b2ad32`](https://github.com/nodejs/node-gyp/commit/af35b2ad32)] - Move VC++ Build Tools to Build Tools landing page. (Andrew Pardoe) [#953](https://github.com/nodejs/node-gyp/pull/953) +* [[`f31482e226`](https://github.com/nodejs/node-gyp/commit/f31482e226)] - **win**: work around __pfnDliNotifyHook2 type change (Alexis Campailla) [#952](https://github.com/nodejs/node-gyp/pull/952) +* [[`3df8222fa5`](https://github.com/nodejs/node-gyp/commit/3df8222fa5)] - Allow for npmlog@3.x (Rebecca Turner) [#950](https://github.com/nodejs/node-gyp/pull/950) +* [[`a4fa07b390`](https://github.com/nodejs/node-gyp/commit/a4fa07b390)] - More verbose error on locating msbuild.exe failure. (Mateusz Jaworski) [#930](https://github.com/nodejs/node-gyp/pull/930) +* [[`4ee31329e0`](https://github.com/nodejs/node-gyp/commit/4ee31329e0)] - **doc**: add command options to README.md (Gibson Fahnestock) [#937](https://github.com/nodejs/node-gyp/pull/937) +* [[`c8c7ca86b9`](https://github.com/nodejs/node-gyp/commit/c8c7ca86b9)] - Add --silent option for zero output. (Gibson Fahnestock) [#937](https://github.com/nodejs/node-gyp/pull/937) +* [[`ac29d23a7c`](https://github.com/nodejs/node-gyp/commit/ac29d23a7c)] - Upgrade to glob@7.0.3. (Ben Noordhuis) [#943](https://github.com/nodejs/node-gyp/pull/943) +* [[`15fd56be3d`](https://github.com/nodejs/node-gyp/commit/15fd56be3d)] - Enable V8 deprecation warnings for native modules (Matt Loring) [#920](https://github.com/nodejs/node-gyp/pull/920) +* [[`7f1c1b960c`](https://github.com/nodejs/node-gyp/commit/7f1c1b960c)] - **gyp**: improvements for android generator (Robert Chiras) [#935](https://github.com/nodejs/node-gyp/pull/935) +* [[`088082766c`](https://github.com/nodejs/node-gyp/commit/088082766c)] - Update Windows install instructions (Sara Itani) [#867](https://github.com/nodejs/node-gyp/pull/867) +* [[`625c1515f9`](https://github.com/nodejs/node-gyp/commit/625c1515f9)] - **gyp**: inherit CC/CXX for CC/CXX.host (Johan Bergström) [#908](https://github.com/nodejs/node-gyp/pull/908) +* [[`3bcb1720e4`](https://github.com/nodejs/node-gyp/commit/3bcb1720e4)] - Add support for the Python launcher on Windows (Patrick Westerhoff) [#894](https://github.com/nodejs/node-gyp/pull/894 + +## v3.3.1 2016-03-04 + +* [[`a981ef847a`](https://github.com/nodejs/node-gyp/commit/a981ef847a)] - **gyp**: fix android generator (Robert Chiras) [#889](https://github.com/nodejs/node-gyp/pull/889) + +## v3.3.0 2016-02-16 + +* [[`818d854a4d`](https://github.com/nodejs/node-gyp/commit/818d854a4d)] - Introduce NODEJS_ORG_MIRROR and IOJS_ORG_MIRROR (Rod Vagg) [#878](https://github.com/nodejs/node-gyp/pull/878) +* [[`d1e4cc4b62`](https://github.com/nodejs/node-gyp/commit/d1e4cc4b62)] - **(SEMVER-MINOR)** Download headers tarball for ~0.12.10 || ~0.10.42 (Rod Vagg) [#877](https://github.com/nodejs/node-gyp/pull/877) +* [[`6e28ad1bea`](https://github.com/nodejs/node-gyp/commit/6e28ad1bea)] - Allow for npmlog@2.x (Rebecca Turner) [#861](https://github.com/nodejs/node-gyp/pull/861) +* [[`07371e5812`](https://github.com/nodejs/node-gyp/commit/07371e5812)] - Use -fPIC for NetBSD. (Marcin Cieślak) [#856](https://github.com/nodejs/node-gyp/pull/856) +* [[`8c4b0ffa50`](https://github.com/nodejs/node-gyp/commit/8c4b0ffa50)] - **(SEMVER-MINOR)** Add --cafile command line option. (Ben Noordhuis) [#837](https://github.com/nodejs/node-gyp/pull/837) +* [[`b3ad43498e`](https://github.com/nodejs/node-gyp/commit/b3ad43498e)] - **(SEMVER-MINOR)** Make download() function testable. (Ben Noordhuis) [#837](https://github.com/nodejs/node-gyp/pull/837) + +## v3.2.1 2015-12-03 + +* [[`ab89b477c4`](https://github.com/nodejs/node-gyp/commit/ab89b477c4)] - Upgrade gyp to b3cef02. (Ben Noordhuis) [#831](https://github.com/nodejs/node-gyp/pull/831) +* [[`90078ecb17`](https://github.com/nodejs/node-gyp/commit/90078ecb17)] - Define WIN32_LEAN_AND_MEAN conditionally. (Ben Noordhuis) [#824](https://github.com/nodejs/node-gyp/pull/824) + +## v3.2.0 2015-11-25 + +* [[`268f1ca4c7`](https://github.com/nodejs/node-gyp/commit/268f1ca4c7)] - Use result of `which` when searching for python. (Refael Ackermann) [#668](https://github.com/nodejs/node-gyp/pull/668) +* [[`817ed9bd78`](https://github.com/nodejs/node-gyp/commit/817ed9bd78)] - Add test for python executable search logic. (Ben Noordhuis) [#756](https://github.com/nodejs/node-gyp/pull/756) +* [[`0e2dfda1f3`](https://github.com/nodejs/node-gyp/commit/0e2dfda1f3)] - Fix test/test-options when run through `npm test`. (Ben Noordhuis) [#755](https://github.com/nodejs/node-gyp/pull/755) +* [[`9bfa0876b4`](https://github.com/nodejs/node-gyp/commit/9bfa0876b4)] - Add support for AIX (Michael Dawson) [#753](https://github.com/nodejs/node-gyp/pull/753) +* [[`a8d441a0a2`](https://github.com/nodejs/node-gyp/commit/a8d441a0a2)] - Update README for Windows 10 support. (Jason Williams) [#766](https://github.com/nodejs/node-gyp/pull/766) +* [[`d1d6015276`](https://github.com/nodejs/node-gyp/commit/d1d6015276)] - Update broken links and switch to HTTPS. (andrew morton) + +## v3.1.0 2015-11-14 + +* [[`9049241f91`](https://github.com/nodejs/node-gyp/commit/9049241f91)] - **gyp**: don't use links at all, just copy the files instead (Nathan Zadoks) +* [[`8ef90348d1`](https://github.com/nodejs/node-gyp/commit/8ef90348d1)] - **gyp**: apply https://codereview.chromium.org/11361103/ (Nathan Rajlich) +* [[`a2ed0df84e`](https://github.com/nodejs/node-gyp/commit/a2ed0df84e)] - **gyp**: always install into $PRODUCT_DIR (Nathan Rajlich) +* [[`cc8b2fa83e`](https://github.com/nodejs/node-gyp/commit/cc8b2fa83e)] - Update gyp to b3cef02. (Imran Iqbal) [#781](https://github.com/nodejs/node-gyp/pull/781) +* [[`f5d86eb84e`](https://github.com/nodejs/node-gyp/commit/f5d86eb84e)] - Update to tar@2.0.0. (Edgar Muentes) [#797](https://github.com/nodejs/node-gyp/pull/797) +* [[`2ac7de02c4`](https://github.com/nodejs/node-gyp/commit/2ac7de02c4)] - Fix infinite loop with zero-length options. (Ben Noordhuis) [#745](https://github.com/nodejs/node-gyp/pull/745) +* [[`101bed639b`](https://github.com/nodejs/node-gyp/commit/101bed639b)] - This platform value came from debian package, and now the value (Jérémy Lal) [#738](https://github.com/nodejs/node-gyp/pull/738) + +## v3.0.3 2015-09-14 + +* [[`ad827cda30`](https://github.com/nodejs/node-gyp/commit/ad827cda30)] - tarballUrl global and && when checking for iojs (Lars-Magnus Skog) [#729](https://github.com/nodejs/node-gyp/pull/729) + +## v3.0.2 2015-09-12 + +* [[`6e8c3bf3c6`](https://github.com/nodejs/node-gyp/commit/6e8c3bf3c6)] - add back support for passing additional cmdline args (Rod Vagg) [#723](https://github.com/nodejs/node-gyp/pull/723) +* [[`ff82f2f3b9`](https://github.com/nodejs/node-gyp/commit/ff82f2f3b9)] - fixed broken link in docs to Visual Studio 2013 download (simon-p-r) [#722](https://github.com/nodejs/node-gyp/pull/722) + +## v3.0.1 2015-09-08 + +* [[`846337e36b`](https://github.com/nodejs/node-gyp/commit/846337e36b)] - normalise versions for target == this comparison (Rod Vagg) [#716](https://github.com/nodejs/node-gyp/pull/716) + +## v3.0.0 2015-09-08 + +* [[`9720d0373c`](https://github.com/nodejs/node-gyp/commit/9720d0373c)] - remove node_modules from tree (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) +* [[`6dcf220db7`](https://github.com/nodejs/node-gyp/commit/6dcf220db7)] - test version major directly, don't use semver.satisfies() (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) +* [[`938dd18d1c`](https://github.com/nodejs/node-gyp/commit/938dd18d1c)] - refactor for clarity, fix dist-url, add env var dist-url functionality (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) +* [[`9e9df66a06`](https://github.com/nodejs/node-gyp/commit/9e9df66a06)] - use process.release, make aware of io.js & node v4 differences (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) +* [[`1ea7ed01f4`](https://github.com/nodejs/node-gyp/commit/1ea7ed01f4)] - **deps**: update graceful-fs dependency to the latest (Sakthipriyan Vairamani) [#714](https://github.com/nodejs/node-gyp/pull/714) +* [[`0fbc387b35`](https://github.com/nodejs/node-gyp/commit/0fbc387b35)] - Update repository URLs. (Ben Noordhuis) [#715](https://github.com/nodejs/node-gyp/pull/715) +* [[`bbedb8868b`](https://github.com/nodejs/node-gyp/commit/bbedb8868b)] - **(SEMVER-MAJOR)** **win**: enable delay-load hook by default (Jeremiah Senkpiel) [#708](https://github.com/nodejs/node-gyp/pull/708) +* [[`85ed107565`](https://github.com/nodejs/node-gyp/commit/85ed107565)] - Merge pull request #664 from othiym23/othiym23/allow-semver-5 (Nathan Rajlich) +* [[`0c720d234c`](https://github.com/nodejs/node-gyp/commit/0c720d234c)] - allow semver@5 (Forrest L Norvell) + +## 2.0.2 / 2015-07-14 + + * Use HTTPS for dist url (#656, @SonicHedgehog) + * Merge pull request #648 from nevosegal/master + * Merge pull request #650 from magic890/patch-1 + * Updated Installation section on README + * Updated link to gyp user documentation + * Fix download error message spelling (#643, @tomxtobin) + * Merge pull request #637 from lygstate/master + * Set NODE_GYP_DIR for addon.gypi to setting absolute path for + src/win_delay_load_hook.c, and fixes of the long relative path issue on Win32. + Fixes #636 (#637, @lygstate). + +## 2.0.1 / 2015-05-28 + + * configure: try/catch the semver range.test() call + * README: update for visual studio 2013 (#510, @samccone) + +## 2.0.0 / 2015-05-24 + + * configure: check for python2 executable by default, fallback to python + * configure: don't clobber existing $PYTHONPATH + * configure: use "path-array" for PYTHONPATH + * gyp: fix for non-acsii userprofile name on Windows + * gyp: always install into $PRODUCT_DIR + * gyp: apply https://codereview.chromium.org/11361103/ + * gyp: don't use links at all, just copy the files instead + * gyp: update gyp to e1c8fcf7 + * Updated README.md with updated Windows build info + * Show URL when a download fails + * package: add a "license" field + * move HMODULE m declaration to top + * Only add "-undefined dynamic_lookup" to loadable_module targets + * win: optionally allow node.exe/iojs.exe to be renamed + * Avoid downloading shasums if using tarPath + * Add target name preprocessor define: `NODE_GYP_MODULE_NAME` + * Show better error message in case of bad network settings diff --git a/node/node_modules/npm/node_modules/node-gyp/CODE_OF_CONDUCT.md b/node/node_modules/npm/node_modules/node-gyp/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000000000000000000000000000000000..85389116b40c47c73b69316d03b8ae774c398a83 --- /dev/null +++ b/node/node_modules/npm/node_modules/node-gyp/CODE_OF_CONDUCT.md @@ -0,0 +1,4 @@ +# Code of Conduct + +* [Node.js Code of Conduct](https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md) +* [Node.js Moderation Policy](https://github.com/nodejs/admin/blob/master/Moderation-Policy.md) diff --git a/node/node_modules/npm/node_modules/node-gyp/CONTRIBUTING.md b/node/node_modules/npm/node_modules/node-gyp/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..2c9510302759fcd7e1ddbfb3c76e42e726a2378a --- /dev/null +++ b/node/node_modules/npm/node_modules/node-gyp/CONTRIBUTING.md @@ -0,0 +1,44 @@ +# Contributing to node-gyp + +## Making changes to gyp-next + +Changes in the subfolder `gyp/` should be submitted to the +[`gyp-next`][] repository first. The `gyp/` folder is regularly +synced from [`gyp-next`][] with GitHub Actions workflow +[`update-gyp-next.yml`](.github/workflows/update-gyp-next.yml), +and any changes in this folder would be overridden by the workflow. + +## Code of Conduct + +Please read the +[Code of Conduct](https://github.com/nodejs/admin/blob/main/CODE_OF_CONDUCT.md) +which explains the minimum behavior expectations for node-gyp contributors. + + +## Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +* (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +[`gyp-next`]: https://github.com/nodejs/gyp-next diff --git a/node/node_modules/npm/node_modules/node-gyp/LICENSE b/node/node_modules/npm/node_modules/node-gyp/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..142bd0982d70fc09598660023aac7cb3f7ac8755 --- /dev/null +++ b/node/node_modules/npm/node_modules/node-gyp/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2012 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/node-gyp/README.md b/node/node_modules/npm/node_modules/node-gyp/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3f678fdca7574c7275be426b6a2d5a544c3cef4b --- /dev/null +++ b/node/node_modules/npm/node_modules/node-gyp/README.md @@ -0,0 +1,290 @@ +# `node-gyp` - Node.js native addon build tool + +[![Build Status](https://github.com/nodejs/node-gyp/workflows/Tests/badge.svg?branch=main)](https://github.com/nodejs/node-gyp/actions?query=workflow%3ATests+branch%3Amain) +![npm](https://img.shields.io/npm/dm/node-gyp) + +`node-gyp` is a cross-platform command-line tool written in Node.js for +compiling native addon modules for Node.js. It contains a vendored copy of the +[gyp-next](https://github.com/nodejs/gyp-next) project that was previously used +by the Chromium team and extended to support the development of Node.js native +addons. + +Note that `node-gyp` is _not_ used to build Node.js itself. + +All current and LTS target versions of Node.js are supported. Depending on what version of Node.js is actually installed on your system +`node-gyp` downloads the necessary development files or headers for the target version. List of stable Node.js versions can be found on [Node.js website](https://nodejs.org/en/about/previous-releases). + +## Features + + * The same build commands work on any of the supported platforms + * Supports the targeting of different versions of Node.js + +## Installation + +> [!Important] +> Python >= v3.12 requires `node-gyp` >= v10 + +You can install `node-gyp` using `npm`: + +``` bash +npm install -g node-gyp +``` + +Depending on your operating system, you will need to install: + +### On Unix + + * [A supported version of Python](https://devguide.python.org/versions/) + * `make` + * A proper C/C++ compiler toolchain, like [GCC](https://gcc.gnu.org) + +### On macOS + + * [A supported version of Python](https://devguide.python.org/versions/) + * `Xcode Command Line Tools` which will install `clang`, `clang++`, and `make`. + * Install the `Xcode Command Line Tools` standalone by running `xcode-select --install`. -- OR -- + * Alternatively, if you already have the [full Xcode installed](https://developer.apple.com/xcode/download/), you can install the Command Line Tools under the menu `Xcode -> Open Developer Tool -> More Developer Tools...`. + + +### On Windows + +Install tools with [Chocolatey](https://chocolatey.org): +``` bash +choco install python visualstudio2022-workload-vctools -y +``` + +Or install and configure Python and Visual Studio tools manually: + + * Follow the instructions in [Using Python on Windows](https://docs.python.org/3/using/windows.html) to install + the current [version of Python](https://www.python.org/downloads/). + + * Install Visual C++ Build Environment: For Visual Studio 2019 or later, use the `Desktop development with C++` workload from [Visual Studio Community](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community). For a version older than Visual Studio 2019, install [Visual Studio Build Tools](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools) with the `Visual C++ build tools` option. + + To target native ARM64 Node.js on Windows on ARM, add the components "Visual C++ compilers and libraries for ARM64" and "Visual C++ ATL for ARM64". + + To use the native ARM64 C++ compiler on Windows on ARM, ensure that you have Visual Studio 2022 [17.4 or later](https://devblogs.microsoft.com/visualstudio/arm64-visual-studio-is-officially-here/) installed. + +It's advised to install the following PowerShell module: [VSSetup](https://github.com/microsoft/vssetup.powershell) using `Install-Module VSSetup -Scope CurrentUser`. +This will make Visual Studio detection logic use a more flexible and accessible method, avoiding PowerShell's `ConstrainedLanguage` mode. + +### Configuring Python Dependency + +`node-gyp` requires that you have installed a [supported version of Python](https://devguide.python.org/versions/). +If you have multiple versions of Python installed, you can identify which version +`node-gyp` should use in one of the following ways: + +1. by setting the `--python` command-line option, e.g.: + +``` bash +node-gyp --python /path/to/executable/python +``` + +2. If `node-gyp` is called by way of `npm`, *and* you have multiple versions of +Python installed, then you can set the `npm_config_python` environment variable +to the appropriate path: +``` bash +export npm_config_python=/path/to/executable/python +``` +    Or on Windows: +```console +py --list-paths # To see the installed Python versions +set npm_config_python=C:\path\to\python.exe # CMD +$Env:npm_config_python="C:\path\to\python.exe" # PowerShell +``` + +3. If the `PYTHON` environment variable is set to the path of a Python executable, +then that version will be used if it is a supported version. + +4. If the `NODE_GYP_FORCE_PYTHON` environment variable is set to the path of a +Python executable, it will be used instead of any of the other configured or +built-in Python search paths. If it's not a compatible version, no further +searching will be done. + +### Build for Third Party Node.js Runtimes + +When building modules for third-party Node.js runtimes like Electron, which have +different build configurations from the official Node.js distribution, you +should use `--dist-url` or `--nodedir` flags to specify the headers of the +runtime to build for. + +Also when `--dist-url` or `--nodedir` flags are passed, node-gyp will use the +`config.gypi` shipped in the headers distribution to generate build +configurations, which is different from the default mode that would use the +`process.config` object of the running Node.js instance. + +Some old versions of Electron shipped malformed `config.gypi` in their headers +distributions, and you might need to pass `--force-process-config` to node-gyp +to work around configuration errors. + +## How to Use + +To compile your native addon first go to its root directory: + +``` bash +cd my_node_addon +``` + +The next step is to generate the appropriate project build files for the current +platform. Use `configure` for that: + +``` bash +node-gyp configure +``` + +Auto-detection fails for Visual C++ Build Tools 2015, so `--msvs_version=2015` +needs to be added (not needed when run by npm as configured above): +``` bash +node-gyp configure --msvs_version=2015 +``` + +__Note__: The `configure` step looks for a `binding.gyp` file in the current +directory to process. See below for instructions on creating a `binding.gyp` file. + +Now you will have either a `Makefile` (on Unix platforms) or a `vcxproj` file +(on Windows) in the `build/` directory. Next, invoke the `build` command: + +``` bash +node-gyp build +``` + +Now you have your compiled `.node` bindings file! The compiled bindings end up +in `build/Debug/` or `build/Release/`, depending on the build mode. At this point, +you can require the `.node` file with Node.js and run your tests! + +__Note:__ To create a _Debug_ build of the bindings file, pass the `--debug` (or +`-d`) switch when running either the `configure`, `build` or `rebuild` commands. + +## The `binding.gyp` file + +A `binding.gyp` file describes the configuration to build your module, in a +JSON-like format. This file gets placed in the root of your package, alongside +`package.json`. + +A barebones `gyp` file appropriate for building a Node.js addon could look like: + +```python +{ + "targets": [ + { + "target_name": "binding", + "sources": [ "src/binding.cc" ] + } + ] +} +``` + +## Further reading + +The **[docs](./docs/)** directory contains additional documentation on specific node-gyp topics that may be useful if you are experiencing problems installing or building addons using node-gyp. + +Some additional resources for Node.js native addons and writing `gyp` configuration files: + + * ["Going Native" a nodeschool.io tutorial](http://nodeschool.io/#goingnative) + * ["Hello World" node addon example](https://github.com/nodejs/node/tree/main/test/addons/hello-world) + * [gyp user documentation](https://gyp.gsrc.io/docs/UserDocumentation.md) + * [gyp input format reference](https://gyp.gsrc.io/docs/InputFormatReference.md) + * [*"binding.gyp" files out in the wild* wiki page](./docs/binding.gyp-files-in-the-wild.md) + +## Commands + +`node-gyp` responds to the following commands: + +| **Command** | **Description** +|:--------------|:--------------------------------------------------------------- +| `help` | Shows the help dialog +| `build` | Invokes `make`/`msbuild.exe` and builds the native addon +| `clean` | Removes the `build` directory if it exists +| `configure` | Generates project build files for the current platform +| `rebuild` | Runs `clean`, `configure` and `build` all in a row +| `install` | Installs Node.js header files for the given version +| `list` | Lists the currently installed Node.js header versions +| `remove` | Removes the Node.js header files for the given version + + +## Command Options + +`node-gyp` accepts the following command options: + +| **Command** | **Description** +|:----------------------------------|:------------------------------------------ +| `-j n`, `--jobs n` | Run `make` in parallel. The value `max` will use all available CPU cores +| `--target=v6.2.1` | Node.js version to build for (default is `process.version`) +| `--silly`, `--loglevel=silly` | Log all progress to console +| `--verbose`, `--loglevel=verbose` | Log most progress to console +| `--silent`, `--loglevel=silent` | Don't log anything to console +| `debug`, `--debug` | Make Debug build (default is `Release`) +| `--release`, `--no-debug` | Make Release build +| `-C $dir`, `--directory=$dir` | Run command in different directory +| `--make=$make` | Override `make` command (e.g. `gmake`) +| `--thin=yes` | Enable thin static libraries +| `--arch=$arch` | Set target architecture (e.g. ia32) +| `--tarball=$path` | Get headers from a local tarball +| `--devdir=$path` | SDK download directory (default is OS cache directory) +| `--ensure` | Don't reinstall headers if already present +| `--dist-url=$url` | Download header tarball from custom URL +| `--proxy=$url` | Set HTTP(S) proxy for downloading header tarball +| `--noproxy=$urls` | Set urls to ignore proxies when downloading header tarball +| `--cafile=$cafile` | Override default CA chain (to download tarball) +| `--nodedir=$path` | Set the path to the node source code +| `--python=$path` | Set path to the Python binary +| `--msvs_version=$version` | Set Visual Studio version (Windows only) +| `--solution=$solution` | Set Visual Studio Solution version (Windows only) +| `--force-process-config` | Force using runtime's `process.config` object to generate `config.gypi` file + +## Configuration + +### package.json + +Use the `config` object in your package.json with each key in the form `node_gyp_OPTION_NAME`. Any of the command +options listed above can be set (dashes in option names should be replaced by underscores). + +For example, to set `devdir` equal to `/tmp/.gyp`, your package.json would contain this: + +```json +{ + "config": { + "node_gyp_devdir": "/tmp/.gyp" + } +} +``` + +### Environment variables + +Use the form `npm_package_config_node_gyp_OPTION_NAME` for any of the command options listed +above (dashes in option names should be replaced by underscores). + +For example, to set `devdir` equal to `/tmp/.gyp`, you would: + +Run this on Unix: + +```bash +export npm_package_config_node_gyp_devdir=/tmp/.gyp +``` + +Or this on Windows: + +```console +set npm_package_config_node_gyp_devdir=c:\temp\.gyp +``` + +Note that in versions of npm before v11 it was possible to use the prefix `npm_config_` for +environment variables. This was deprecated in npm@11 and will be removed in npm@12 so it +is recommended to convert your environment variables to the above format. + +### `npm` configuration for npm versions before v9 + +Use the form `OPTION_NAME` for any of the command options listed above. + +For example, to set `devdir` equal to `/tmp/.gyp`, you would run: + +```bash +npm config set [--global] devdir /tmp/.gyp +``` + +**Note:** Configuration set via `npm` will only be used when `node-gyp` +is run via `npm`, not when `node-gyp` is run directly. + +## License + +`node-gyp` is available under the MIT license. See the [LICENSE +file](LICENSE) for details. diff --git a/node/node_modules/npm/node_modules/node-gyp/SECURITY.md b/node/node_modules/npm/node_modules/node-gyp/SECURITY.md new file mode 100644 index 0000000000000000000000000000000000000000..d1de8977ed61a71ef7f4117f557a0187c389bf55 --- /dev/null +++ b/node/node_modules/npm/node_modules/node-gyp/SECURITY.md @@ -0,0 +1,2 @@ +If you believe you have found a security issue in the software in this +repository, please consult https://github.com/nodejs/node/blob/HEAD/SECURITY.md. \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/node-gyp/addon.gypi b/node/node_modules/npm/node_modules/node-gyp/addon.gypi new file mode 100644 index 0000000000000000000000000000000000000000..323db50fc43b24bb0924701f6475d0b869ec61b2 --- /dev/null +++ b/node/node_modules/npm/node_modules/node-gyp/addon.gypi @@ -0,0 +1,204 @@ +{ + 'variables' : { + 'node_engine_include_dir%': 'deps/v8/include', + 'node_host_binary%': 'node', + 'node_with_ltcg%': 'true', + }, + 'target_defaults': { + 'type': 'loadable_module', + 'win_delay_load_hook': 'true', + 'product_prefix': '', + + 'conditions': [ + [ 'node_engine=="chakracore"', { + 'variables': { + 'node_engine_include_dir%': 'deps/chakrashim/include' + }, + }] + ], + + 'include_dirs': [ + '<(node_root_dir)/include/node', + '<(node_root_dir)/src', + '<(node_root_dir)/deps/openssl/config', + '<(node_root_dir)/deps/openssl/openssl/include', + '<(node_root_dir)/deps/uv/include', + '<(node_root_dir)/deps/zlib', + '<(node_root_dir)/<(node_engine_include_dir)' + ], + 'defines!': [ + 'BUILDING_UV_SHARED=1', # Inherited from common.gypi. + 'BUILDING_V8_SHARED=1', # Inherited from common.gypi. + ], + 'defines': [ + 'NODE_GYP_MODULE_NAME=>(_target_name)', + 'USING_UV_SHARED=1', + 'USING_V8_SHARED=1', + # Warn when using deprecated V8 APIs. + 'V8_DEPRECATION_WARNINGS=1' + ], + + 'target_conditions': [ + ['_type=="loadable_module"', { + 'product_extension': 'node', + 'defines': [ + 'BUILDING_NODE_EXTENSION' + ], + 'xcode_settings': { + 'OTHER_LDFLAGS': [ + '-undefined dynamic_lookup' + ], + }, + }], + + ['_type=="static_library"', { + # set to `1` to *disable* the -T thin archive 'ld' flag. + # older linkers don't support this flag. + 'standalone_static_library': '<(standalone_static_library)' + }], + + ['_type!="executable"', { + 'conditions': [ + [ 'OS=="android"', { + 'cflags!': [ '-fPIE' ], + }] + ] + }], + + ['_win_delay_load_hook=="true"', { + # If the addon specifies `'win_delay_load_hook': 'true'` in its + # binding.gyp, link a delay-load hook into the DLL. This hook ensures + # that the addon will work regardless of whether the node/iojs binary + # is named node.exe, iojs.exe, or something else. + 'conditions': [ + [ 'OS=="win"', { + 'defines': [ 'HOST_BINARY=\"<(node_host_binary)<(EXECUTABLE_SUFFIX)\"', ], + 'sources': [ + '<(node_gyp_dir)/src/win_delay_load_hook.cc', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'DelayLoadDLLs': [ '<(node_host_binary)<(EXECUTABLE_SUFFIX)' ], + # Don't print a linker warning when no imports from either .exe + # are used. + 'AdditionalOptions': [ '/ignore:4199' ], + }, + }, + }], + ], + }], + ], + + 'conditions': [ + [ 'OS=="mac"', { + 'defines': [ + '_DARWIN_USE_64_BIT_INODE=1' + ], + 'xcode_settings': { + 'DYLIB_INSTALL_NAME_BASE': '@rpath' + }, + }], + [ 'OS=="aix"', { + 'ldflags': [ + '-Wl,-bimport:<(node_exp_file)' + ], + }], + [ 'OS=="os400"', { + 'ldflags': [ + '-Wl,-bimport:<(node_exp_file)' + ], + }], + [ 'OS=="zos"', { + 'conditions': [ + [ '"' + # needs to have dll-interface to be used by + # clients of class 'node::ObjectWrap' + 4251 + ], + }, { + # OS!="win" + 'defines': [ + '_LARGEFILE_SOURCE', + '_FILE_OFFSET_BITS=64' + ], + }], + [ 'OS in "freebsd openbsd netbsd solaris android openharmony" or \ + (OS=="linux" and target_arch!="ia32")', { + 'cflags': [ '-fPIC' ], + }], + ] + } +} diff --git a/node/node_modules/npm/node_modules/node-gyp/eslint.config.js b/node/node_modules/npm/node_modules/node-gyp/eslint.config.js new file mode 100644 index 0000000000000000000000000000000000000000..07acc4240ce706d0e8334e42e86d841af0336e94 --- /dev/null +++ b/node/node_modules/npm/node_modules/node-gyp/eslint.config.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('neostandard')({}) diff --git a/node/node_modules/npm/node_modules/node-gyp/macOS_Catalina_acid_test.sh b/node/node_modules/npm/node_modules/node-gyp/macOS_Catalina_acid_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..9efd62a574d6c5fb8ae87b20be43c09e7a0af951 --- /dev/null +++ b/node/node_modules/npm/node_modules/node-gyp/macOS_Catalina_acid_test.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +pkgs=( + "com.apple.pkg.DeveloperToolsCLILeo" # standalone + "com.apple.pkg.DeveloperToolsCLI" # from XCode + "com.apple.pkg.CLTools_Executables" # Mavericks +) + +for pkg in "${pkgs[@]}"; do + output=$(/usr/sbin/pkgutil --pkg-info "$pkg" 2>/dev/null) + if [ "$output" ]; then + version=$(echo "$output" | grep 'version' | cut -d' ' -f2) + break + fi +done + +if [ "$version" ]; then + echo "Command Line Tools version: $version" +else + echo >&2 'Command Line Tools not found' +fi diff --git a/node/node_modules/npm/node_modules/node-gyp/package.json b/node/node_modules/npm/node_modules/node-gyp/package.json new file mode 100644 index 0000000000000000000000000000000000000000..0a39417a6c4090cf1ced5abfbc4795d785ff0e69 --- /dev/null +++ b/node/node_modules/npm/node_modules/node-gyp/package.json @@ -0,0 +1,52 @@ +{ + "name": "node-gyp", + "description": "Node.js native addon build tool", + "license": "MIT", + "keywords": [ + "native", + "addon", + "module", + "c", + "c++", + "bindings", + "gyp" + ], + "version": "12.3.0", + "installVersion": 11, + "author": "Nathan Rajlich (http://tootallnate.net)", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/node-gyp.git" + }, + "preferGlobal": true, + "bin": "./bin/node-gyp.js", + "main": "./lib/node-gyp.js", + "dependencies": { + "env-paths": "^2.2.0", + "exponential-backoff": "^3.1.1", + "graceful-fs": "^4.2.6", + "nopt": "^9.0.0", + "proc-log": "^6.0.0", + "semver": "^7.3.5", + "tar": "^7.5.4", + "tinyglobby": "^0.2.12", + "undici": "^6.25.0", + "which": "^6.0.0" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "devDependencies": { + "bindings": "^1.5.0", + "cross-env": "^10.1.0", + "eslint": "^9.39.1", + "mocha": "^11.7.5", + "nan": "^2.23.1", + "neostandard": "^0.13.0", + "require-inject": "^1.4.4" + }, + "scripts": { + "lint": "eslint \"*/*.js\" \"test/**/*.js\" \".github/**/*.js\"", + "test": "cross-env NODE_GYP_NULL_LOGGER=true mocha --timeout 30000 test/test-download.js test/test-*" + } +} diff --git a/node/node_modules/npm/node_modules/node-gyp/release-please-config.json b/node/node_modules/npm/node_modules/node-gyp/release-please-config.json new file mode 100644 index 0000000000000000000000000000000000000000..45964552901115e4de6d944d40e9e65a0bab587f --- /dev/null +++ b/node/node_modules/npm/node_modules/node-gyp/release-please-config.json @@ -0,0 +1,40 @@ +{ + "packages": { + ".": { + "include-component-in-tag": false, + "release-type": "node", + "changelog-sections": [ + { "type": "feat", "section": "Features", "hidden": false }, + { "type": "fix", "section": "Bug Fixes", "hidden": false }, + { "type": "bin", "section": "Core", "hidden": false }, + { "type": "gyp", "section": "Core", "hidden": false }, + { "type": "lib", "section": "Core", "hidden": false }, + { "type": "src", "section": "Core", "hidden": false }, + { "type": "test", "section": "Tests", "hidden": false }, + { "type": "build", "section": "Core", "hidden": false }, + { "type": "clean", "section": "Core", "hidden": false }, + { "type": "configure", "section": "Core", "hidden": false }, + { "type": "install", "section": "Core", "hidden": false }, + { "type": "list", "section": "Core", "hidden": false }, + { "type": "rebuild", "section": "Core", "hidden": false }, + { "type": "remove", "section": "Core", "hidden": false }, + { "type": "deps", "section": "Core", "hidden": false }, + { "type": "python", "section": "Core", "hidden": false }, + { "type": "lin", "section": "Core", "hidden": false }, + { "type": "linux", "section": "Core", "hidden": false }, + { "type": "mac", "section": "Core", "hidden": false }, + { "type": "macos", "section": "Core", "hidden": false }, + { "type": "win", "section": "Core", "hidden": false }, + { "type": "windows", "section": "Core", "hidden": false }, + { "type": "zos", "section": "Core", "hidden": false }, + { "type": "doc", "section": "Doc", "hidden": false }, + { "type": "docs", "section": "Doc", "hidden": false }, + { "type": "readme", "section": "Doc", "hidden": false }, + { "type": "chore", "section": "Miscellaneous", "hidden": false }, + { "type": "refactor", "section": "Miscellaneous", "hidden": false }, + { "type": "ci", "section": "Miscellaneous", "hidden": false }, + { "type": "meta", "section": "Miscellaneous", "hidden": false } + ] + } + } +} diff --git a/node/node_modules/npm/node_modules/nopt/LICENSE b/node/node_modules/npm/node_modules/nopt/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..32eb517086ebb24cfe3dd076033211d444186dc9 --- /dev/null +++ b/node/node_modules/npm/node_modules/nopt/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/nopt/README.md b/node/node_modules/npm/node_modules/nopt/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ab4cc228d15db4004beedf1d282a9e56a5840f9d --- /dev/null +++ b/node/node_modules/npm/node_modules/nopt/README.md @@ -0,0 +1,214 @@ +If you want to write an option parser, and have it be good, there are +two ways to do it. The Right Way, and the Wrong Way. + +The Wrong Way is to sit down and write an option parser. We've all done +that. + +The Right Way is to write some complex configurable program with so many +options that you hit the limit of your frustration just trying to +manage them all, and defer it with duct-tape solutions until you see +exactly to the core of the problem, and finally snap and write an +awesome option parser. + +If you want to write an option parser, don't write an option parser. +Write a package manager, or a source control system, or a service +restarter, or an operating system. You probably won't end up with a +good one of those, but if you don't give up, and you are relentless and +diligent enough in your procrastination, you may just end up with a very +nice option parser. + +## USAGE + +```javascript +// my-program.js +var nopt = require("nopt") + , Stream = require("stream").Stream + , path = require("path") + , knownOpts = { "foo" : [String, null] + , "bar" : [Stream, Number] + , "baz" : path + , "bloo" : [ "big", "medium", "small" ] + , "flag" : Boolean + , "pick" : Boolean + , "many1" : [String, Array] + , "many2" : [path, Array] + } + , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] + , "b7" : ["--bar", "7"] + , "m" : ["--bloo", "medium"] + , "p" : ["--pick"] + , "f" : ["--flag"] + } + // everything is optional. + // knownOpts and shorthands default to {} + // arg list defaults to process.argv + // slice defaults to 2 + , parsed = nopt(knownOpts, shortHands, process.argv, 2) +console.log(parsed) +``` + +This would give you support for any of the following: + +```console +$ node my-program.js --foo "blerp" --no-flag +{ "foo" : "blerp", "flag" : false } + +$ node my-program.js ---bar 7 --foo "Mr. Hand" --flag +{ bar: 7, foo: "Mr. Hand", flag: true } + +$ node my-program.js --foo "blerp" -f -----p +{ foo: "blerp", flag: true, pick: true } + +$ node my-program.js -fp --foofoo +{ foo: "Mr. Foo", flag: true, pick: true } + +$ node my-program.js --foofoo -- -fp # -- stops the flag parsing. +{ foo: "Mr. Foo", argv: { remain: ["-fp"] } } + +$ node my-program.js --blatzk -fp # unknown opts are ok. +{ blatzk: true, flag: true, pick: true } + +$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value +{ blatzk: 1000, flag: true, pick: true } + +$ node my-program.js --no-blatzk -fp # unless they start with "no-" +{ blatzk: false, flag: true, pick: true } + +$ node my-program.js --baz b/a/z # known paths are resolved. +{ baz: "/Users/isaacs/b/a/z" } + +# if Array is one of the types, then it can take many +# values, and will always be an array. The other types provided +# specify what types are allowed in the list. + +$ node my-program.js --many1 5 --many1 null --many1 foo +{ many1: ["5", "null", "foo"] } + +$ node my-program.js --many2 foo --many2 bar +{ many2: ["/path/to/foo", "path/to/bar"] } +``` + +Read the tests at the bottom of `lib/nopt.js` for more examples of +what this puppy can do. + +## Types + +The following types are supported, and defined on `nopt.typeDefs` + +* String: A normal string. No parsing is done. +* path: A file system path. Gets resolved against cwd if not absolute. +* url: A url. If it doesn't parse, it isn't accepted. +* Number: Must be numeric. +* Date: Must parse as a date. If it does, and `Date` is one of the options, + then it will return a Date object, not a string. +* Boolean: Must be either `true` or `false`. If an option is a boolean, + then it does not need a value, and its presence will imply `true` as + the value. To negate boolean flags, do `--no-whatever` or `--whatever + false` +* NaN: Means that the option is strictly not allowed. Any value will + fail. +* Stream: An object matching the "Stream" class in node. Valuable + for use when validating programmatically. (npm uses this to let you + supply any WriteStream on the `outfd` and `logfd` config options.) +* Array: If `Array` is specified as one of the types, then the value + will be parsed as a list of options. This means that multiple values + can be specified, and that the value will always be an array. + +If a type is an array of values not on this list, then those are +considered valid values. For instance, in the example above, the +`--bloo` option can only be one of `"big"`, `"medium"`, or `"small"`, +and any other value will be rejected. + +When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be +interpreted as their JavaScript equivalents. + +You can also mix types and values, or multiple types, in a list. For +instance `{ blah: [Number, null] }` would allow a value to be set to +either a Number or null. When types are ordered, this implies a +preference, and the first type that can be used to properly interpret +the value will be used. + +To define a new type, add it to `nopt.typeDefs`. Each item in that +hash is an object with a `type` member and a `validate` method. The +`type` member is an object that matches what goes in the type list. The +`validate` method is a function that gets called with `validate(data, +key, val)`. Validate methods should assign `data[key]` to the valid +value of `val` if it can be handled properly, or return boolean +`false` if it cannot. + +You can also call `nopt.clean(data, types, typeDefs)` to clean up a +config object and remove its invalid properties. + +## Error Handling + +By default nopt logs debug messages if `DEBUG_NOPT` or `NOPT_DEBUG` are set in the environment. + +You can assign the following methods to `nopt` for a more granular notification of invalid, unknown, and expanding options: + +`nopt.invalidHandler(key, value, type, data)` - Called when a value is invalid for its option. +`nopt.unknownHandler(key, next)` - Called when an option is found that has no configuration. In certain situations the next option on the command line will be parsed on its own instead of as part of the unknown option. In this case `next` will contain that option. +`nopt.abbrevHandler(short, long)` - Called when an option is automatically translated via abbreviations. + +You can also set any of these to `false` to disable the debugging messages that they generate. + +## Abbreviations + +Yes, they are supported. If you define options like this: + +```javascript +{ "foolhardyelephants" : Boolean +, "pileofmonkeys" : Boolean } +``` + +Then this will work: + +```bash +node program.js --foolhar --pil +node program.js --no-f --pileofmon +# etc. +``` + +## Shorthands + +Shorthands are a hash of shorter option names to a snippet of args that +they expand to. + +If multiple one-character shorthands are all combined, and the +combination does not unambiguously match any other option or shorthand, +then they will be broken up into their constituent parts. For example: + +```json +{ "s" : ["--loglevel", "silent"] +, "g" : "--global" +, "f" : "--force" +, "p" : "--parseable" +, "l" : "--long" +} +``` + +```bash +npm ls -sgflp +# just like doing this: +npm ls --loglevel silent --global --force --long --parseable +``` + +## The Rest of the args + +The config object returned by nopt is given a special member called +`argv`, which is an object with the following fields: + +* `remain`: The remaining args after all the parsing has occurred. +* `original`: The args as they originally appeared. +* `cooked`: The args after flags and shorthands are expanded. + +## Slicing + +Node programs are called with more or less the exact argv as it appears +in C land, after the v8 and node-specific options have been plucked off. +As such, `argv[0]` is always `node` and `argv[1]` is always the +JavaScript program being run. + +That's usually not very useful to you. So they're sliced off by +default. If you want them, then you can pass in `0` as the last +argument, or any other number that you'd like to slice off the start of +the list. diff --git a/node/node_modules/npm/node_modules/nopt/package.json b/node/node_modules/npm/node_modules/nopt/package.json new file mode 100644 index 0000000000000000000000000000000000000000..060f61ccc21fe0636d3cff388ee6c8452d227bdd --- /dev/null +++ b/node/node_modules/npm/node_modules/nopt/package.json @@ -0,0 +1,52 @@ +{ + "name": "nopt", + "version": "9.0.0", + "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", + "author": "GitHub Inc.", + "main": "lib/nopt.js", + "scripts": { + "test": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/nopt.git" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "license": "ISC", + "dependencies": { + "abbrev": "^4.0.0" + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "tap": "^16.3.0" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "windowsCI": false, + "version": "4.27.1", + "publish": true + } +} diff --git a/node/node_modules/npm/node_modules/npm-audit-report/LICENSE b/node/node_modules/npm/node_modules/npm-audit-report/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..70afbdaa31d47c3016859724e15011b292cc7b3a --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-audit-report/LICENSE @@ -0,0 +1,16 @@ +ISC License + +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted, provided that the +above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS +ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/npm-audit-report/package.json b/node/node_modules/npm/node_modules/npm-audit-report/package.json new file mode 100644 index 0000000000000000000000000000000000000000..825e787178d72fd8c1406875d03fb078283c16a7 --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-audit-report/package.json @@ -0,0 +1,62 @@ +{ + "name": "npm-audit-report", + "version": "7.0.0", + "description": "Given a response from the npm security api, render it into a variety of security reports", + "main": "lib/index.js", + "scripts": { + "test": "tap", + "snap": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "tap": { + "check-coverage": true, + "coverage-map": "map.js", + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "keywords": [ + "npm", + "security", + "report", + "audit" + ], + "author": "GitHub Inc.", + "license": "ISC", + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "chalk": "^5.2.0", + "tap": "^16.0.0" + }, + "directories": { + "lib": "lib", + "test": "test" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/npm-audit-report.git" + }, + "bugs": { + "url": "https://github.com/npm/npm-audit-report/issues" + }, + "homepage": "https://github.com/npm/npm-audit-report#readme", + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": true + } +} diff --git a/node/node_modules/npm/node_modules/npm-bundled/LICENSE b/node/node_modules/npm/node_modules/npm-bundled/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..215e9f0de625433a71e86b99d9ad3d74d25e7e2e --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-bundled/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm, Inc. and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/npm-bundled/package.json b/node/node_modules/npm/node_modules/npm-bundled/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1f581b1898b9bf66e85c9af324879e850ac0d37c --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-bundled/package.json @@ -0,0 +1,49 @@ +{ + "name": "npm-bundled", + "version": "5.0.0", + "description": "list things in node_modules that are bundledDependencies, or transitive dependencies thereof", + "main": "lib/index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/npm-bundled.git" + }, + "author": "GitHub Inc.", + "license": "ISC", + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "mutate-fs": "^2.1.1", + "tap": "^16.3.0" + }, + "scripts": { + "test": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "files": [ + "bin/", + "lib/" + ], + "dependencies": { + "npm-normalize-package-bin": "^5.0.0" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": true + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node/node_modules/npm/node_modules/npm-install-checks/LICENSE b/node/node_modules/npm/node_modules/npm-install-checks/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9f403583152976aa6dff820c9c9883931167b532 --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-install-checks/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Robert Kowalski and Isaac Z. Schlueter ("Authors") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node/node_modules/npm/node_modules/npm-install-checks/package.json b/node/node_modules/npm/node_modules/npm-install-checks/package.json new file mode 100644 index 0000000000000000000000000000000000000000..72d887eda35d0e1efb76272a991af2fa635b6a7c --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-install-checks/package.json @@ -0,0 +1,52 @@ +{ + "name": "npm-install-checks", + "version": "8.0.0", + "description": "Check the engines and platform fields in package.json", + "main": "lib/index.js", + "dependencies": { + "semver": "^7.1.1" + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "tap": "^16.0.1" + }, + "scripts": { + "test": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/npm-install-checks.git" + }, + "keywords": [ + "npm,", + "install" + ], + "license": "BSD-2-Clause", + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "author": "GitHub Inc.", + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": "true" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node/node_modules/npm/node_modules/npm-normalize-package-bin/LICENSE b/node/node_modules/npm/node_modules/npm-normalize-package-bin/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..3d4e2b4fb62e71b5d7251a510e16c4c8d7c0b287 --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-normalize-package-bin/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/npm-normalize-package-bin/package.json b/node/node_modules/npm/node_modules/npm-normalize-package-bin/package.json new file mode 100644 index 0000000000000000000000000000000000000000..271f3c65620d899632aeb32dac6a938697dc1902 --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-normalize-package-bin/package.json @@ -0,0 +1,45 @@ +{ + "name": "npm-normalize-package-bin", + "version": "5.0.0", + "description": "Turn any flavor of allowable package.json bin into a normalized object", + "main": "lib/index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/npm-normalize-package-bin.git" + }, + "author": "GitHub Inc.", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "tap": "^16.3.0" + }, + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": "true" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node/node_modules/npm/node_modules/npm-package-arg/LICENSE b/node/node_modules/npm/node_modules/npm-package-arg/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..3d4e2b4fb62e71b5d7251a510e16c4c8d7c0b287 --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-package-arg/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/npm-package-arg/package.json b/node/node_modules/npm/node_modules/npm-package-arg/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d60d3344f006d40522dc9deacea3a0416b79e784 --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-package-arg/package.json @@ -0,0 +1,60 @@ +{ + "name": "npm-package-arg", + "version": "13.0.2", + "description": "Parse the things that can be arguments to `npm install`", + "main": "./lib/npa.js", + "directories": { + "test": "test" + }, + "files": [ + "bin/", + "lib/" + ], + "dependencies": { + "hosted-git-info": "^9.0.0", + "proc-log": "^6.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^7.0.0" + }, + "devDependencies": { + "@npmcli/eslint-config": "^6.0.0", + "@npmcli/template-oss": "4.28.0", + "tap": "^16.0.1" + }, + "scripts": { + "test": "tap", + "snap": "tap", + "npmclilint": "npmcli-lint", + "lint": "npm run eslint", + "lintfix": "npm run eslint -- --fix", + "posttest": "npm run lint", + "postsnap": "npm run lintfix --", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/npm-package-arg.git" + }, + "author": "GitHub Inc.", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/npm-package-arg/issues" + }, + "homepage": "https://github.com/npm/npm-package-arg", + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.28.0", + "publish": true + } +} diff --git a/node/node_modules/npm/node_modules/npm-packlist/LICENSE b/node/node_modules/npm/node_modules/npm-packlist/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..32eb517086ebb24cfe3dd076033211d444186dc9 --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-packlist/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/npm-packlist/package.json b/node/node_modules/npm/node_modules/npm-packlist/package.json new file mode 100644 index 0000000000000000000000000000000000000000..286d9483d20716754b1f77ec915109a5eecaeb02 --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-packlist/package.json @@ -0,0 +1,62 @@ +{ + "name": "npm-packlist", + "version": "10.0.4", + "description": "Get a list of the files to add from a folder into an npm package", + "directories": { + "test": "test" + }, + "main": "lib/index.js", + "dependencies": { + "ignore-walk": "^8.0.0", + "proc-log": "^6.0.0" + }, + "author": "GitHub Inc.", + "license": "ISC", + "files": [ + "bin/", + "lib/" + ], + "devDependencies": { + "@npmcli/arborist": "^9.0.0", + "@npmcli/eslint-config": "^6.0.0", + "@npmcli/template-oss": "4.29.0", + "mutate-fs": "^2.1.1", + "tap": "^16.0.1" + }, + "scripts": { + "test": "tap", + "posttest": "npm run lint", + "snap": "tap", + "postsnap": "npm run lintfix --", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", + "lint": "npm run eslint", + "lintfix": "npm run eslint -- --fix", + "npmclilint": "npmcli-lint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/npm-packlist.git" + }, + "tap": { + "test-env": [ + "LC_ALL=sk" + ], + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ], + "files": [ + "test/*.js" + ] + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.29.0", + "publish": true + } +} diff --git a/node/node_modules/npm/node_modules/npm-pick-manifest/LICENSE.md b/node/node_modules/npm/node_modules/npm-pick-manifest/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..70afbdaa31d47c3016859724e15011b292cc7b3a --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-pick-manifest/LICENSE.md @@ -0,0 +1,16 @@ +ISC License + +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted, provided that the +above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS +ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/npm-pick-manifest/package.json b/node/node_modules/npm/node_modules/npm-pick-manifest/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2bbb16575e60444132ef01da1b8a34b72b191eb0 --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-pick-manifest/package.json @@ -0,0 +1,58 @@ +{ + "name": "npm-pick-manifest", + "version": "11.0.3", + "description": "Resolves a matching manifest from a package metadata document according to standard npm semver resolution rules.", + "main": "./lib", + "files": [ + "bin/", + "lib/" + ], + "scripts": { + "coverage": "tap", + "lint": "npm run eslint", + "test": "tap", + "posttest": "npm run lint", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/npm-pick-manifest.git" + }, + "keywords": [ + "npm", + "semver", + "package manager" + ], + "author": "GitHub Inc.", + "license": "ISC", + "dependencies": { + "npm-install-checks": "^8.0.0", + "npm-normalize-package-bin": "^5.0.0", + "npm-package-arg": "^13.0.0", + "semver": "^7.3.5" + }, + "devDependencies": { + "@npmcli/eslint-config": "^6.0.0", + "@npmcli/template-oss": "4.27.1", + "tap": "^16.0.1" + }, + "tap": { + "check-coverage": true, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": true + } +} diff --git a/node/node_modules/npm/node_modules/npm-profile/LICENSE.md b/node/node_modules/npm/node_modules/npm-profile/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..8fcffd65391b81f9986edf305f1b956327799d03 --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-profile/LICENSE.md @@ -0,0 +1,20 @@ + + +ISC License + +Copyright npm, Inc. + +Permission to use, copy, modify, and/or distribute this +software for any purpose with or without fee is hereby +granted, provided that the above copyright notice and this +permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO +EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/npm-profile/package.json b/node/node_modules/npm/node_modules/npm-profile/package.json new file mode 100644 index 0000000000000000000000000000000000000000..6fdf304d9daaa37029d2c1aa1d17a1e90c7f61b2 --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-profile/package.json @@ -0,0 +1,52 @@ +{ + "name": "npm-profile", + "version": "12.0.1", + "description": "Library for updating an npmjs.com profile", + "keywords": [], + "author": "GitHub Inc.", + "license": "ISC", + "dependencies": { + "npm-registry-fetch": "^19.0.0", + "proc-log": "^6.0.0" + }, + "main": "./lib/index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/npm-profile.git" + }, + "files": [ + "bin/", + "lib/" + ], + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "nock": "^13.5.6", + "tap": "^16.0.1" + }, + "scripts": { + "posttest": "npm run lint", + "test": "tap", + "snap": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "tap": { + "check-coverage": true, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": true + } +} diff --git a/node/node_modules/npm/node_modules/npm-registry-fetch/LICENSE.md b/node/node_modules/npm/node_modules/npm-registry-fetch/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..8fcffd65391b81f9986edf305f1b956327799d03 --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-registry-fetch/LICENSE.md @@ -0,0 +1,20 @@ + + +ISC License + +Copyright npm, Inc. + +Permission to use, copy, modify, and/or distribute this +software for any purpose with or without fee is hereby +granted, provided that the above copyright notice and this +permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO +EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/npm-registry-fetch/package.json b/node/node_modules/npm/node_modules/npm-registry-fetch/package.json new file mode 100644 index 0000000000000000000000000000000000000000..a2b51ae1bec5cdc77089864229329892c9c8350f --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-registry-fetch/package.json @@ -0,0 +1,68 @@ +{ + "name": "npm-registry-fetch", + "version": "19.1.1", + "description": "Fetch-based http client for use with npm registry APIs", + "main": "lib", + "files": [ + "bin/", + "lib/" + ], + "scripts": { + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", + "lint": "npm run eslint", + "lintfix": "npm run eslint -- --fix", + "test": "tap", + "posttest": "npm run lint", + "npmclilint": "npmcli-lint", + "postsnap": "npm run lintfix --", + "postlint": "template-oss-check", + "snap": "tap", + "template-oss-apply": "template-oss-apply --force" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/npm-registry-fetch.git" + }, + "keywords": [ + "npm", + "registry", + "fetch" + ], + "author": "GitHub Inc.", + "license": "ISC", + "dependencies": { + "@npmcli/redact": "^4.0.0", + "jsonparse": "^1.3.1", + "make-fetch-happen": "^15.0.0", + "minipass": "^7.0.2", + "minipass-fetch": "^5.0.0", + "minizlib": "^3.0.1", + "npm-package-arg": "^13.0.0", + "proc-log": "^6.0.0" + }, + "devDependencies": { + "@npmcli/eslint-config": "^6.0.0", + "@npmcli/template-oss": "4.28.0", + "cacache": "^20.0.0", + "nock": "^13.2.4", + "require-inject": "^1.4.4", + "ssri": "^13.0.0", + "tap": "^16.0.1" + }, + "tap": { + "check-coverage": true, + "test-ignore": "test[\\\\/](util|cache)[\\\\/]", + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.28.0", + "publish": "true" + } +} diff --git a/node/node_modules/npm/node_modules/npm-user-validate/LICENSE b/node/node_modules/npm/node_modules/npm-user-validate/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a8b7a939a088f467f4b68ce42dbb06cad06429ce --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-user-validate/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Robert Kowalski +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/npm-user-validate/package.json b/node/node_modules/npm/node_modules/npm-user-validate/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1351f0c5a1ffa5d1938ff3f19eaa12a1b0949a96 --- /dev/null +++ b/node/node_modules/npm/node_modules/npm-user-validate/package.json @@ -0,0 +1,50 @@ +{ + "name": "npm-user-validate", + "version": "4.0.0", + "description": "User validations for npm", + "main": "lib/index.js", + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "tap": "^16.3.2" + }, + "scripts": { + "test": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/npm-user-validate.git" + }, + "keywords": [ + "npm", + "validation", + "registry" + ], + "author": "GitHub Inc.", + "license": "BSD-2-Clause", + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": true + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node/node_modules/npm/node_modules/p-map/index.js b/node/node_modules/npm/node_modules/p-map/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b1d43a293c4184b14b7cb6553b1f8cf146d6c033 --- /dev/null +++ b/node/node_modules/npm/node_modules/p-map/index.js @@ -0,0 +1,283 @@ +export default async function pMap( + iterable, + mapper, + { + concurrency = Number.POSITIVE_INFINITY, + stopOnError = true, + signal, + } = {}, +) { + return new Promise((resolve_, reject_) => { + if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) { + throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`); + } + + if (typeof mapper !== 'function') { + throw new TypeError('Mapper function is required'); + } + + if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) { + throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`); + } + + const result = []; + const errors = []; + const skippedIndexesMap = new Map(); + let isRejected = false; + let isResolved = false; + let isIterableDone = false; + let resolvingCount = 0; + let currentIndex = 0; + const iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator](); + + const signalListener = () => { + reject(signal.reason); + }; + + const cleanup = () => { + signal?.removeEventListener('abort', signalListener); + }; + + const resolve = value => { + resolve_(value); + cleanup(); + }; + + const reject = reason => { + isRejected = true; + isResolved = true; + reject_(reason); + cleanup(); + }; + + if (signal) { + if (signal.aborted) { + reject(signal.reason); + } + + signal.addEventListener('abort', signalListener, {once: true}); + } + + const next = async () => { + if (isResolved) { + return; + } + + const nextItem = await iterator.next(); + + const index = currentIndex; + currentIndex++; + + // Note: `iterator.next()` can be called many times in parallel. + // This can cause multiple calls to this `next()` function to + // receive a `nextItem` with `done === true`. + // The shutdown logic that rejects/resolves must be protected + // so it runs only one time as the `skippedIndex` logic is + // non-idempotent. + if (nextItem.done) { + isIterableDone = true; + + if (resolvingCount === 0 && !isResolved) { + if (!stopOnError && errors.length > 0) { + reject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message + return; + } + + isResolved = true; + + if (skippedIndexesMap.size === 0) { + resolve(result); + return; + } + + const pureResult = []; + + // Support multiple `pMapSkip`'s. + for (const [index, value] of result.entries()) { + if (skippedIndexesMap.get(index) === pMapSkip) { + continue; + } + + pureResult.push(value); + } + + resolve(pureResult); + } + + return; + } + + resolvingCount++; + + // Intentionally detached + (async () => { + try { + const element = await nextItem.value; + + if (isResolved) { + return; + } + + const value = await mapper(element, index); + + // Use Map to stage the index of the element. + if (value === pMapSkip) { + skippedIndexesMap.set(index, value); + } + + result[index] = value; + + resolvingCount--; + await next(); + } catch (error) { + if (stopOnError) { + reject(error); + } else { + errors.push(error); + resolvingCount--; + + // In that case we can't really continue regardless of `stopOnError` state + // since an iterable is likely to continue throwing after it throws once. + // If we continue calling `next()` indefinitely we will likely end up + // in an infinite loop of failed iteration. + try { + await next(); + } catch (error) { + reject(error); + } + } + } + })(); + }; + + // Create the concurrent runners in a detached (non-awaited) + // promise. We need this so we can await the `next()` calls + // to stop creating runners before hitting the concurrency limit + // if the iterable has already been marked as done. + // NOTE: We *must* do this for async iterators otherwise we'll spin up + // infinite `next()` calls by default and never start the event loop. + (async () => { + for (let index = 0; index < concurrency; index++) { + try { + // eslint-disable-next-line no-await-in-loop + await next(); + } catch (error) { + reject(error); + break; + } + + if (isIterableDone || isRejected) { + break; + } + } + })(); + }); +} + +export function pMapIterable( + iterable, + mapper, + { + concurrency = Number.POSITIVE_INFINITY, + backpressure = concurrency, + } = {}, +) { + if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) { + throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`); + } + + if (typeof mapper !== 'function') { + throw new TypeError('Mapper function is required'); + } + + if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) { + throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`); + } + + if (!((Number.isSafeInteger(backpressure) && backpressure >= concurrency) || backpressure === Number.POSITIVE_INFINITY)) { + throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${concurrency}) and up or \`Infinity\`, got \`${backpressure}\` (${typeof backpressure})`); + } + + return { + async * [Symbol.asyncIterator]() { + const iterator = iterable[Symbol.asyncIterator] === undefined ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator](); + + const promises = []; + let pendingPromisesCount = 0; + let isDone = false; + let index = 0; + + function trySpawn() { + if (isDone || !(pendingPromisesCount < concurrency && promises.length < backpressure)) { + return; + } + + pendingPromisesCount++; + + const promise = (async () => { + const {done, value} = await iterator.next(); + + if (done) { + pendingPromisesCount--; + return {done: true}; + } + + // Spawn if still below concurrency and backpressure limit + trySpawn(); + + try { + const returnValue = await mapper(await value, index++); + + pendingPromisesCount--; + + if (returnValue === pMapSkip) { + const index = promises.indexOf(promise); + + if (index > 0) { + promises.splice(index, 1); + } + } + + // Spawn if still below backpressure limit and just dropped below concurrency limit + trySpawn(); + + return {done: false, value: returnValue}; + } catch (error) { + pendingPromisesCount--; + isDone = true; + return {error}; + } + })(); + + promises.push(promise); + } + + trySpawn(); + + while (promises.length > 0) { + const {error, done, value} = await promises[0]; // eslint-disable-line no-await-in-loop + + promises.shift(); + + if (error) { + throw error; + } + + if (done) { + return; + } + + // Spawn if just dropped below backpressure limit and below the concurrency limit + trySpawn(); + + if (value === pMapSkip) { + continue; + } + + yield value; + } + }, + }; +} + +export const pMapSkip = Symbol('skip'); diff --git a/node/node_modules/npm/node_modules/p-map/license b/node/node_modules/npm/node_modules/p-map/license new file mode 100644 index 0000000000000000000000000000000000000000..0f2d6cdf18ca059e54ad911b1debe1a08a708b84 --- /dev/null +++ b/node/node_modules/npm/node_modules/p-map/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/p-map/package.json b/node/node_modules/npm/node_modules/p-map/package.json new file mode 100644 index 0000000000000000000000000000000000000000..0a0d9cd0a941c72c18264b76d74c47b1a65d61d2 --- /dev/null +++ b/node/node_modules/npm/node_modules/p-map/package.json @@ -0,0 +1,57 @@ +{ + "name": "p-map", + "version": "7.0.4", + "description": "Map over promises concurrently", + "license": "MIT", + "repository": "sindresorhus/p-map", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": { + "types": "./index.d.ts", + "default": "./index.js" + }, + "sideEffects": false, + "engines": { + "node": ">=18" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "promise", + "map", + "resolved", + "wait", + "collection", + "iterable", + "iterator", + "race", + "fulfilled", + "async", + "await", + "promises", + "concurrently", + "concurrency", + "parallel", + "bluebird" + ], + "devDependencies": { + "ava": "^5.2.0", + "chalk": "^5.3.0", + "delay": "^6.0.0", + "in-range": "^3.0.0", + "random-int": "^3.0.0", + "time-span": "^5.1.0", + "tsd": "^0.29.0", + "xo": "^0.56.0" + } +} diff --git a/node/node_modules/npm/node_modules/pacote/LICENSE b/node/node_modules/npm/node_modules/pacote/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..648d9ab9bb1dcf2d07fc593dbf7f86e448843f2f --- /dev/null +++ b/node/node_modules/npm/node_modules/pacote/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter, Kat Marchán, npm, Inc., and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/pacote/README.md b/node/node_modules/npm/node_modules/pacote/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b396936e9ae5d6d6fbcb82f0f700ce19d70e7563 --- /dev/null +++ b/node/node_modules/npm/node_modules/pacote/README.md @@ -0,0 +1,251 @@ +# pacote + +Fetches package manifests and tarballs from the npm registry. + +## USAGE + +```js +const pacote = require('pacote') + +// get a package manifest +pacote.manifest('foo@1.x').then(manifest => console.log('got it', manifest)) + +// extract a package into a folder +pacote.extract('github:npm/cli', 'some/path', options) + .then(({from, resolved, integrity}) => { + console.log('extracted!', from, resolved, integrity) + }) + +pacote.tarball('https://server.com/package.tgz').then(data => { + console.log('got ' + data.length + ' bytes of tarball data') +}) +``` + +`pacote` works with any kind of package specifier that npm can install. +If you can pass it to the npm CLI, you can pass it to pacote. +(In fact, that's exactly what the npm CLI does.) + +Anything that you can do with one kind of package, you can do with another. + +Data that isn't relevant (like a packument for a tarball) will be simulated. + +`prepare` scripts will be run when generating tarballs from `git` and `directory` locations, to simulate what _would_ be published to the registry, so that you get a working package instead of just raw source code that might need to be transpiled. + +## CLI + +This module exports a command line interface that can do most of what is described below. Run `pacote -h` to learn more. + +``` +Pacote - The JavaScript Package Handler, v10.1.1 + +Usage: + + pacote resolve + Resolve a specifier and output the fully resolved target + Returns integrity and from if '--long' flag is set. + + pacote manifest + Fetch a manifest and print to stdout + + pacote packument + Fetch a full packument and print to stdout + + pacote tarball [] + Fetch a package tarball and save to + If is missing or '-', the tarball will be streamed to stdout. + + pacote extract + Extract a package to the destination folder. + +Configuration values all match the names of configs passed to npm, or +options passed to Pacote. Additional flags for this executable: + + --long Print an object from 'resolve', including integrity and spec. + --json Print result objects as JSON rather than node's default. + (This is the default if stdout is not a TTY.) + --help -h Print this helpful text. + +For example '--cache=/path/to/folder' will use that folder as the cache. +``` + +## API + +The `spec` refers to any kind of [package specifier](npm.im/npm-package-arg) that npm can install. + +See below for valid `opts` values. + +* `pacote.resolve(spec, opts)` Resolve a specifier like `foo@latest` or `github:user/project` all the way to a tarball url, tarball file, or git repo with commit hash. + +* `pacote.extract(spec, dest, opts)` Extract a package's tarball into a destination folder. + Returns a promise that resolves to the `{from,resolved,integrity}` of the extracted package. + +* `pacote.manifest(spec, opts)` Fetch (or simulate) a package's manifest (basically, the `package.json` file, plus a bit of metadata). + See below for more on manifests and packuments. + Returns a Promise that resolves to the manifest object. + +* `pacote.packument(spec, opts)` Fetch (or simulate) a package's packument (basically, the top-level package document listing all the manifests that the registry returns). + See below for more on manifests and packuments. + Returns a Promise that resolves to the packument object. + +* `pacote.tarball(spec, opts)` Get a package tarball data as a buffer in + memory. + Returns a Promise that resolves to the tarball data Buffer, with `from`, `resolved`, and `integrity` fields attached. + +* `pacote.tarball.file(spec, dest, opts)` Save a package tarball data to a file on disk. + Returns a Promise that resolves to `{from,integrity,resolved}` of the fetched tarball. + +* `pacote.tarball.stream(spec, streamHandler, opts)` Fetch a tarball and make the stream available to the `streamHandler` function. + + This is mostly an internal function, but it is exposed because it does provide some functionality that may be difficult to achieve otherwise. + + The `streamHandler` function MUST return a Promise that resolves when the stream (and all associated work) is ended, or rejects if the stream + has an error. + + The `streamHandler` function MAY be called multiple times, as Pacote retries requests in some scenarios, such as cache corruption or retriable network failures. + +### Options + +Options are passed to +[`npm-registry-fetch`](http://npm.im/npm-registry-fetch) and [`cacache`](http://npm.im/cacache), so in addition to these, anything for those modules can be given to pacote as well. + +Options object is cloned, and mutated along the way to add integrity, resolved, and other properties, as they are determined. + +* `cache` Where to store cache entries and temp files. + Passed to [`cacache`](http://npm.im/cacache). + Defaults to the same cache directory that npm will use by default, based on platform and environment. +* `where` Base folder for resolving relative `file:` dependencies. +* `resolved` Shortcut for looking up resolved values. Should be specified if known. +* `integrity` Expected integrity of fetched package tarball. + If specified, tarballs with mismatched integrity values will raise an `EINTEGRITY` error. +* `umask` Permission mode mask for extracted files and directories. + Defaults to `0o22`. + See "Extracted File Modes" below. +* `fmode` Minimum permission mode for extracted files. + Defaults to `0o666`. + See "Extracted File Modes" below. +* `dmode` Minimum permission mode for extracted directories. + Defaults to `0o777`. + See "Extracted File Modes" below. +* `preferOnline` Prefer to revalidate cache entries, even when it would not be strictly necessary. + Defaults to `false`. +* `before` When picking a manifest from a packument, only consider packages published before the specified date. + Defaults to `null`. +* `defaultTag` The default `dist-tag` to use when choosing a manifest from a packument. + Defaults to `latest`. +* `registry` The npm registry to use by default. + Defaults to `https://registry.npmjs.org/`. +* `fullMetadata` Fetch the full metadata from the registry for packuments, including information not strictly required for installation (author, description, etc.). + Defaults to `true` when `before` is set, since the version publish time is part of the extended packument metadata. + Otherwise defaults to `false`. +* `fullReadJson` Use the slower `read-package-json` package insted of `read-package-json-fast` in order to include extra fields like "readme" in the manifest. + Defaults to `false`. +* `packumentCache` For registry packuments only, you may provide a `Map` object which will be used to cache packument requests between pacote calls. + This allows you to easily avoid hitting the registry multiple times (even just to validate the cache) for a given packument, since it is unlikely to change in the span of a single command. +* `verifySignatures` A boolean that will make pacote verify the integrity signature of a manifest, if present. + There must be a configured `_keys` entry in the config that is scoped to the registry the manifest is being fetched from. +* `verifyAttestations` A boolean that will make pacote verify Sigstore attestations, if present. + There must be a configured `_keys` entry in the config that is scoped to the registry the manifest is being fetched from. +* `tufCache` Where to store metadata/target files when retrieving the package attestation key material via TUF. + Defaults to the same cache directory that npm will use by default, based on platform and environment. +* `allowGit` Whether or not to allow data to be fetched from a git spec. + Possible values are `all`, `none`, or `root`. + Defaults to `all`. + `all` means git is allowed + `none` means git is not allowed + `root` means that git is only allowed if fetching from a root context. + Context for whether or not the package being fetched is `root` is set via the `_isRoot` option. +* `allowRemote` Whether or not to allow data to be fetched from remote specs. + Possible values and defaults are the same as `allowGit` +* `allowFile` Whether or not to allow data to be fetched from file specs. + Possible values and defaults are the same as `allowGit` +* `allowDirectory` Whether or not to allow data to be fetched from directory specs. + Possible values and defaults are the same as `allowGit` +* `allowRegistry` Whether or not to allow data to be fetched from registry specs. This includes `version`, `range`, `tag`, and `alias`. +* `_isRoot` Whether or not the package being fetched is in a root context. + Defaults to `false`, + For `npm` itself this means a package that is defined in the local project or workspace package.json, or a package that is being fetched for another command like `npm view`. This informs the `allowX` options to let them know the context of the current request. + +For more info on spec types (i.e. git, remote) see [npm-package-arg](npm.im/npm-package-arg) + +### Advanced API + +Each different type of fetcher is exposed for more advanced usage such as using helper methods from this classes: + +* `DirFetcher` +* `FileFetcher` +* `GitFetcher` +* `RegistryFetcher` +* `RemoteFetcher` + +## Extracted File Modes + +Files are extracted with a mode matching the following formula: + +``` +( (tarball entry mode value) | (minimum mode option) ) ~ (umask) +``` + +This is in order to prevent unreadable files or unlistable directories from cluttering a project's `node_modules` folder, even if the package tarball specifies that the file should be inaccessible. + +It also prevents files from being group- or world-writable without explicit opt-in by the user, because all file and directory modes are masked against the `umask` value. + +So, a file which is `0o771` in the tarball, using the default `fmode` of `0o666` and `umask` of `0o22`, will result in a file mode of `0o755`: + +``` +(0o771 | 0o666) => 0o777 +(0o777 ~ 0o22) => 0o755 +``` + +In almost every case, the defaults are appropriate. +To respect exactly what is in the package tarball (even if this makes an unusable system), set both `dmode` and `fmode` options to `0`. +Otherwise, the `umask` config should be used in most cases where file mode modifications are required, and this functions more or less the same as the `umask` value in most Unix systems. + +## Extracted File Ownership + +When running as `root` on Unix systems, all extracted files and folders will have their owning `uid` and `gid` values set to match the ownership of the containing folder. + +This prevents `root`-owned files showing up in a project's `node_modules` folder when a user runs `sudo npm install`. + +## Manifests + +A `manifest` is similar to a `package.json` file. +However, it has a few pieces of extra metadata, and sometimes lacks metadata that is inessential to package installation. + +In addition to the common `package.json` fields, manifests include: + +* `manifest._resolved` The tarball url or file path where the package artifact can be found. +* `manifest._from` A normalized form of the spec passed in as an argument. +* `manifest._integrity` The integrity value for the package artifact. +* `manifest._id` The canonical spec of this package version: name@version. +* `manifest.dist` Registry manifests (those included in a packument) have a `dist` object. + Only `tarball` is required, though at least one of `shasum` or `integrity` is almost always present. + + * `tarball` The url to the associated package artifact. + (Copied by Pacote to `manifest._resolved`.) + * `integrity` The integrity SRI string for the artifact. + This may not be present for older packages on the npm registry. + (Copied by Pacote to `manifest._integrity`.) + * `shasum` Legacy integrity value. Hexadecimal-encoded sha1 hash. + (Converted to an SRI string and copied by Pacote to `manifest._integrity` when `dist.integrity` is not present.) + * `fileCount` Number of files in the tarball. + * `unpackedSize` Size on disk of the package when unpacked. + * `signatures` Signatures of the shasum. + Includes the keyid that correlates to a [`key from the npm registry`](https://registry.npmjs.org/-/npm/v1/keys) + +## Packuments + +A packument is the top-level package document that lists the set of manifests for available versions for a package. + +When a packument is fetched with `accept: application/vnd.npm.install-v1+json` in the HTTP headers, only the most minimum necessary metadata is returned. +Additional metadata is returned when fetched with only `accept: application/json`. + +For Pacote's purposes, the following fields are relevant: + +* `versions` An object where each key is a version, and each value is the manifest for that version. +* `dist-tags` An object mapping dist-tags to version numbers. + This is how `foo@latest` gets turned into `foo@1.2.3`. +* `time` In the full packument, an object mapping version numbers to publication times, for the `opts.before` functionality. + +Pacote adds the following field, regardless of the accept header: + +* `_contentLength` The size of the packument. diff --git a/node/node_modules/npm/node_modules/pacote/package.json b/node/node_modules/npm/node_modules/pacote/package.json new file mode 100644 index 0000000000000000000000000000000000000000..4a0c98e5c5cb1e7beed494ad5905d4dda7958683 --- /dev/null +++ b/node/node_modules/npm/node_modules/pacote/package.json @@ -0,0 +1,80 @@ +{ + "name": "pacote", + "version": "21.5.0", + "description": "JavaScript package downloader", + "author": "GitHub Inc.", + "bin": { + "pacote": "bin/index.js" + }, + "license": "ISC", + "main": "lib/index.js", + "scripts": { + "test": "tap", + "snap": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "posttest": "npm run lint", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "tap": { + "timeout": 300, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "devDependencies": { + "@npmcli/arborist": "^9.0.2", + "@npmcli/eslint-config": "^6.0.0", + "@npmcli/template-oss": "4.29.0", + "hosted-git-info": "^9.0.0", + "mutate-fs": "^2.1.1", + "nock": "^13.2.4", + "npm-registry-mock": "^1.3.2", + "rimraf": "^6.0.1", + "tap": "^16.0.1" + }, + "files": [ + "bin/", + "lib/" + ], + "keywords": [ + "packages", + "npm", + "git" + ], + "dependencies": { + "@gar/promise-retry": "^1.0.0", + "@npmcli/git": "^7.0.0", + "@npmcli/installed-package-contents": "^4.0.0", + "@npmcli/package-json": "^7.0.0", + "@npmcli/promise-spawn": "^9.0.0", + "@npmcli/run-script": "^10.0.0", + "cacache": "^20.0.0", + "fs-minipass": "^3.0.0", + "minipass": "^7.0.2", + "npm-package-arg": "^13.0.0", + "npm-packlist": "^10.0.1", + "npm-pick-manifest": "^11.0.1", + "npm-registry-fetch": "^19.0.0", + "proc-log": "^6.0.0", + "sigstore": "^4.0.0", + "ssri": "^13.0.0", + "tar": "^7.4.3" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/pacote.git" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.29.0", + "windowsCI": false, + "publish": "true" + } +} diff --git a/node/node_modules/npm/node_modules/parse-conflict-json/LICENSE.md b/node/node_modules/npm/node_modules/parse-conflict-json/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..8fcffd65391b81f9986edf305f1b956327799d03 --- /dev/null +++ b/node/node_modules/npm/node_modules/parse-conflict-json/LICENSE.md @@ -0,0 +1,20 @@ + + +ISC License + +Copyright npm, Inc. + +Permission to use, copy, modify, and/or distribute this +software for any purpose with or without fee is hereby +granted, provided that the above copyright notice and this +permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO +EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/parse-conflict-json/package.json b/node/node_modules/npm/node_modules/parse-conflict-json/package.json new file mode 100644 index 0000000000000000000000000000000000000000..7239c495f3a6bd53f13d4c2545c5a55446d809a5 --- /dev/null +++ b/node/node_modules/npm/node_modules/parse-conflict-json/package.json @@ -0,0 +1,51 @@ +{ + "name": "parse-conflict-json", + "version": "5.0.1", + "description": "Parse a JSON string that has git merge conflicts, resolving if possible", + "author": "GitHub Inc.", + "license": "ISC", + "main": "lib", + "scripts": { + "test": "tap", + "snap": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "posttest": "npm run lint", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "tap": { + "check-coverage": true, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "tap": "^16.0.1" + }, + "dependencies": { + "json-parse-even-better-errors": "^5.0.0", + "just-diff": "^6.0.0", + "just-diff-apply": "^5.2.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/parse-conflict-json.git" + }, + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": true + } +} diff --git a/node/node_modules/npm/node_modules/path-scurry/LICENSE.md b/node/node_modules/npm/node_modules/path-scurry/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..3da8747dc3a48e2da66615e4116cefcfde495d7c --- /dev/null +++ b/node/node_modules/npm/node_modules/path-scurry/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** diff --git a/node/node_modules/npm/node_modules/path-scurry/package.json b/node/node_modules/npm/node_modules/path-scurry/package.json new file mode 100644 index 0000000000000000000000000000000000000000..b59c2b6a6b9f5fbb8c27d7853358a8c621f0da76 --- /dev/null +++ b/node/node_modules/npm/node_modules/path-scurry/package.json @@ -0,0 +1,72 @@ +{ + "name": "path-scurry", + "version": "2.0.2", + "description": "walk paths fast and efficiently", + "author": "Isaac Z. Schlueter (https://blog.izs.me)", + "main": "./dist/commonjs/index.js", + "type": "module", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "files": [ + "dist" + ], + "license": "BlueOak-1.0.0", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write . --log-level warn", + "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts", + "bench": "bash ./scripts/bench.sh" + }, + "devDependencies": { + "@nodelib/fs.walk": "^3.0.1", + "@types/node": "^25.3.0", + "mkdirp": "^3.0.0", + "prettier": "^3.3.2", + "rimraf": "^6.1.3", + "tap": "^21.6.1", + "ts-node": "^10.9.2", + "tshy": "^3.3.2", + "typedoc": "^0.28.17" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/path-scurry" + }, + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "tshy": { + "selfLink": false, + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js" +} diff --git a/node/node_modules/npm/node_modules/postcss-selector-parser/API.md b/node/node_modules/npm/node_modules/postcss-selector-parser/API.md new file mode 100644 index 0000000000000000000000000000000000000000..1c29ec8cbb3ffe4ae0215b0b265b7cded9ca655d --- /dev/null +++ b/node/node_modules/npm/node_modules/postcss-selector-parser/API.md @@ -0,0 +1,874 @@ +# API Documentation + +*Please use only this documented API when working with the parser. Methods +not documented here are subject to change at any point.* + +## `parser` function + +This is the module's main entry point. + +```js +const parser = require('postcss-selector-parser'); +``` + +### `parser([transform], [options])` + +Creates a new `processor` instance + +```js +const processor = parser(); +``` + +Or, with optional transform function + +```js +const transform = selectors => { + selectors.walkUniversals(selector => { + selector.remove(); + }); +}; + +const processor = parser(transform) + +// Example +const result = processor.processSync('*.class'); +// => .class +``` + +[See processor documentation](#processor) + +Arguments: + +* `transform (function)`: Provide a function to work with the parsed AST. +* `options (object)`: Provide default options for all calls on the returned `Processor`. + +### `parser.attribute([props])` + +Creates a new attribute selector. + +```js +parser.attribute({attribute: 'href'}); +// => [href] +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.className([props])` + +Creates a new class selector. + +```js +parser.className({value: 'button'}); +// => .button +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.combinator([props])` + +Creates a new selector combinator. + +```js +parser.combinator({value: '+'}); +// => + +``` + +Arguments: + +* `props (object)`: The new node's properties. + +Notes: +* **Descendant Combinators** The value of descendant combinators created by the + parser always just a single space (`" "`). For descendant selectors with no + comments, additional space is now stored in `node.spaces.before`. Depending + on the location of comments, additional spaces may be stored in + `node.raws.spaces.before`, `node.raws.spaces.after`, or `node.raws.value`. +* **Named Combinators** Although, nonstandard and unlikely to ever become a standard, + named combinators like `/deep/` and `/for/` are parsed as combinators. The + `node.value` is name after being unescaped and normalized as lowercase. The + original value for the combinator name is stored in `node.raws.value`. + + +### `parser.comment([props])` + +Creates a new comment. + +```js +parser.comment({value: '/* Affirmative, Dave. I read you. */'}); +// => /* Affirmative, Dave. I read you. */ +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.id([props])` + +Creates a new id selector. + +```js +parser.id({value: 'search'}); +// => #search +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.nesting([props])` + +Creates a new nesting selector. + +```js +parser.nesting(); +// => & +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.pseudo([props])` + +Creates a new pseudo selector. + +```js +parser.pseudo({value: '::before'}); +// => ::before +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.root([props])` + +Creates a new root node. + +```js +parser.root(); +// => (empty) +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.selector([props])` + +Creates a new selector node. + +```js +parser.selector(); +// => (empty) +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.string([props])` + +Creates a new string node. + +```js +parser.string(); +// => (empty) +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.tag([props])` + +Creates a new tag selector. + +```js +parser.tag({value: 'button'}); +// => button +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.universal([props])` + +Creates a new universal selector. + +```js +parser.universal(); +// => * +``` + +Arguments: + +* `props (object)`: The new node's properties. + +## Node types + +### `node.type` + +A string representation of the selector type. It can be one of the following; +`attribute`, `class`, `combinator`, `comment`, `id`, `nesting`, `pseudo`, +`root`, `selector`, `string`, `tag`, or `universal`. Note that for convenience, +these constants are exposed on the main `parser` as uppercased keys. So for +example you can get `id` by querying `parser.ID`. + +```js +parser.attribute({attribute: 'href'}).type; +// => 'attribute' +``` + +### `node.parent` + +Returns the parent node. + +```js +root.nodes[0].parent === root; +``` + +### `node.toString()`, `String(node)`, or `'' + node` + +Returns a string representation of the node. + +```js +const id = parser.id({value: 'search'}); +console.log(String(id)); +// => #search +``` + +### `node.next()` & `node.prev()` + +Returns the next/previous child of the parent node. + +```js +const next = id.next(); +if (next && next.type !== 'combinator') { + throw new Error('Qualified IDs are not allowed!'); +} +``` + +### `node.replaceWith(node[,...nodeN])` + +Replace a node with another. + +```js +const attr = selectors.first.first; +const className = parser.className({value: 'test'}); +attr.replaceWith(className); +``` + +Arguments: + +* `node`: The node to substitute the original with. +... +* `nodeN`: The node to substitute the original with. + +### `node.remove()` + +Removes the node from its parent node. + +```js +if (node.type === 'id') { + node.remove(); +} +``` + +### `node.clone([opts])` + +Returns a copy of a node, detached from any parent containers that the +original might have had. + +```js +const cloned = node.clone(); +``` + +### `node.isAtPosition(line, column)` + +Return a `boolean` indicating whether this node includes the character at the +position of the given line and column. Returns `undefined` if the nodes lack +sufficient source metadata to determine the position. + +Arguments: + +* `line`: 1-index based line number relative to the start of the selector. +* `column`: 1-index based column number relative to the start of the selector. + +### `node.spaces` + +Extra whitespaces around the node will be moved into `node.spaces.before` and +`node.spaces.after`. So for example, these spaces will be moved as they have +no semantic meaning: + +```css + h1 , h2 {} +``` + +For descendent selectors, the value is always a single space. + +```css +h1 h2 {} +``` + +Additional whitespace is found in either the `node.spaces.before` and `node.spaces.after` depending on the presence of comments or other whitespace characters. If the actual whitespace does not start or end with a single space, the node's raw value is set to the actual space(s) found in the source. + +### `node.source` + +An object describing the node's start/end, line/column source position. + +Within the following CSS, the `.bar` class node ... + +```css +.foo, + .bar {} +``` + +... will contain the following `source` object. + +```js +source: { + start: { + line: 2, + column: 3 + }, + end: { + line: 2, + column: 6 + } +} +``` + +### `node.sourceIndex` + +The zero-based index of the node within the original source string. + +Within the following CSS, the `.baz` class node will have a `sourceIndex` of `12`. + +```css +.foo, .bar, .baz {} +``` + +## Container types + +The `root`, `selector`, and `pseudo` nodes have some helper methods for working +with their children. + +### `container.nodes` + +An array of the container's children. + +```js +// Input: h1 h2 +selectors.at(0).nodes.length // => 3 +selectors.at(0).nodes[0].value // => 'h1' +selectors.at(0).nodes[1].value // => ' ' +``` + +### `container.first` & `container.last` + +The first/last child of the container. + +```js +selector.first === selector.nodes[0]; +selector.last === selector.nodes[selector.nodes.length - 1]; +``` + +### `container.at(index)` + +Returns the node at position `index`. + +```js +selector.at(0) === selector.first; +selector.at(0) === selector.nodes[0]; +``` + +Arguments: + +* `index`: The index of the node to return. + +### `container.atPosition(line, column)` + +Returns the node at the source position `line` and `column`. + +```js +// Input: :not(.foo),\n#foo > :matches(ol, ul) +selector.atPosition(1, 1); // => :not(.foo) +selector.atPosition(2, 1); // => \n#foo +``` + +Arguments: + +* `line`: The line number of the node to return. +* `column`: The column number of the node to return. + +### `container.index(node)` + +Return the index of the node within its container. + +```js +selector.index(selector.nodes[2]) // => 2 +``` + +Arguments: + +* `node`: A node within the current container. + +### `container.length` + +Proxy to the length of the container's nodes. + +```js +container.length === container.nodes.length +``` + +### `container` Array iterators + +The container class provides proxies to certain Array methods; these are: + +* `container.map === container.nodes.map` +* `container.reduce === container.nodes.reduce` +* `container.every === container.nodes.every` +* `container.some === container.nodes.some` +* `container.filter === container.nodes.filter` +* `container.sort === container.nodes.sort` + +Note that these methods only work on a container's immediate children; recursive +iteration is provided by `container.walk`. + +### `container.each(callback)` + +Iterate the container's immediate children, calling `callback` for each child. +You may return `false` within the callback to break the iteration. + +```js +let className; +selectors.each((selector, index) => { + if (selector.type === 'class') { + className = selector.value; + return false; + } +}); +``` + +Note that unlike `Array#forEach()`, this iterator is safe to use whilst adding +or removing nodes from the container. + +Arguments: + +* `callback (function)`: A function to call for each node, which receives `node` + and `index` arguments. + +### `container.walk(callback)` + +Like `container#each`, but will also iterate child nodes as long as they are +`container` types. + +```js +selectors.walk((selector, index) => { + // all nodes +}); +``` + +Arguments: + +* `callback (function)`: A function to call for each node, which receives `node` + and `index` arguments. + +This iterator is safe to use whilst mutating `container.nodes`, +like `container#each`. + +### `container.walk` proxies + +The container class provides proxy methods for iterating over types of nodes, +so that it is easier to write modules that target specific selectors. Those +methods are: + +* `container.walkAttributes` +* `container.walkClasses` +* `container.walkCombinators` +* `container.walkComments` +* `container.walkIds` +* `container.walkNesting` +* `container.walkPseudos` +* `container.walkTags` +* `container.walkUniversals` + +### `container.split(callback)` + +This method allows you to split a group of nodes by returning `true` from +a callback. It returns an array of arrays, where each inner array corresponds +to the groups that you created via the callback. + +```js +// (input) => h1 h2>>h3 +const list = selectors.first.split(selector => { + return selector.type === 'combinator'; +}); + +// (node values) => [['h1', ' '], ['h2', '>>'], ['h3']] +``` + +Arguments: + +* `callback (function)`: A function to call for each node, which receives `node` + as an argument. + +### `container.prepend(node)` & `container.append(node)` + +Add a node to the start/end of the container. Note that doing so will set +the parent property of the node to this container. + +```js +const id = parser.id({value: 'search'}); +selector.append(id); +``` + +Arguments: + +* `node`: The node to add. + +### `container.insertBefore(old, new[, ...newNodes])` & `container.insertAfter(old, new[, ...newNodes])` + +Add a node before or after an existing node in a container: + +```js +selectors.walk(selector => { + if (selector.type !== 'class') { + const className = parser.className({value: 'theme-name'}); + selector.parent.insertAfter(selector, className); + } +}); +``` + +Arguments: + +* `old`: The existing node in the container. +* `new`: The new node to add before/after the existing node. + +### `container.removeChild(node)` + +Remove the node from the container. Note that you can also use +`node.remove()` if you would like to remove just a single node. + +```js +selector.length // => 2 +selector.remove(id) +selector.length // => 1; +id.parent // undefined +``` + +Arguments: + +* `node`: The node to remove. + +### `container.removeAll()` or `container.empty()` + +Remove all children from the container. + +```js +selector.removeAll(); +selector.length // => 0 +``` + +## Root nodes + +A root node represents a comma separated list of selectors. Indeed, all +a root's `toString()` method does is join its selector children with a ','. +Other than this, it has no special functionality and acts like a container. + +### `root.trailingComma` + +This will be set to `true` if the input has a trailing comma, in order to +support parsing of legacy CSS hacks. + +## Selector nodes + +A selector node represents a single complex selector. For example, this +selector string `h1 h2 h3, [href] > p`, is represented as two selector nodes. +It has no special functionality of its own. + +## Pseudo nodes + +A pseudo selector extends a container node; if it has any parameters of its +own (such as `h1:not(h2, h3)`), they will be its children. Note that the pseudo +`value` will always contain the colons preceding the pseudo identifier. This +is so that both `:before` and `::before` are properly represented in the AST. + +## Attribute nodes + +### `attribute.quoted` + +Returns `true` if the attribute's value is wrapped in quotation marks, false if it is not. +Remains `undefined` if there is no attribute value. + +```css +[href=foo] /* false */ +[href='foo'] /* true */ +[href="foo"] /* true */ +[href] /* undefined */ +``` + +### `attribute.qualifiedAttribute` + +Returns the attribute name qualified with the namespace if one is given. + +### `attribute.offsetOf(part)` + + Returns the offset of the attribute part specified relative to the + start of the node of the output string. This is useful in raising + error messages about a specific part of the attribute, especially + in combination with `attribute.sourceIndex`. + + Returns `-1` if the name is invalid or the value doesn't exist in this + attribute. + + The legal values for `part` are: + + * `"ns"` - alias for "namespace" + * `"namespace"` - the namespace if it exists. + * `"attribute"` - the attribute name + * `"attributeNS"` - the start of the attribute or its namespace + * `"operator"` - the match operator of the attribute + * `"value"` - The value (string or identifier) + * `"insensitive"` - the case insensitivity flag + +### `attribute.raws.unquoted` + +Returns the unquoted content of the attribute's value. +Remains `undefined` if there is no attribute value. + +```css +[href=foo] /* foo */ +[href='foo'] /* foo */ +[href="foo"] /* foo */ +[href] /* undefined */ +``` + +### `attribute.spaces` + +Like `node.spaces` with the `before` and `after` values containing the spaces +around the element, the parts of the attribute can also have spaces before +and after them. The for each of `attribute`, `operator`, `value` and +`insensitive` there is corresponding property of the same nam in +`node.spaces` that has an optional `before` or `after` string containing only +whitespace. + +Note that corresponding values in `attributes.raws.spaces` contain values +including any comments. If set, these values will override the +`attribute.spaces` value. Take care to remove them if changing +`attribute.spaces`. + +### `attribute.raws` + +The raws object stores comments and other information necessary to re-render +the node exactly as it was in the source. + +If a comment is embedded within the identifiers for the `namespace`, `attribute` +or `value` then a property is placed in the raws for that value containing the full source of the propery including comments. + +If a comment is embedded within the space between parts of the attribute +then the raw for that space is set accordingly. + +Setting an attribute's property `raws` value to be deleted. + +For now, changing the spaces required also updating or removing any of the +raws values that override them. + +Example: `[ /*before*/ href /* after-attr */ = /* after-operator */ te/*inside-value*/st/* wow */ /*omg*/i/*bbq*/ /*whodoesthis*/]` would parse as: + +```js +{ + attribute: "href", + operator: "=", + value: "test", + spaces: { + before: '', + after: '', + attribute: { before: ' ', after: ' ' }, + operator: { after: ' ' }, + value: { after: ' ' }, + insensitive: { after: ' ' } + }, + raws: { + spaces: { + attribute: { before: ' /*before*/ ', after: ' /* after-attr */ ' }, + operator: { after: ' /* after-operator */ ' }, + value: { after: '/* wow */ /*omg*/' }, + insensitive: { after: '/*bbq*/ /*whodoesthis*/' } + }, + unquoted: 'test', + value: 'te/*inside-value*/st' + } +} +``` + +## `Processor` + +### `ProcessorOptions` + +* `lossless` - When `true`, whitespace is preserved. Defaults to `true`. +* `updateSelector` - When `true`, if any processor methods are passed a postcss + `Rule` node instead of a string, then that Rule's selector is updated + with the results of the processing. Defaults to `true`. + +### `process|processSync(selectors, [options])` + +Processes the `selectors`, returning a string from the result of processing. + +Note: when the `updateSelector` option is set, the rule's selector +will be updated with the resulting string. + +**Example:** + +```js +const parser = require("postcss-selector-parser"); +const processor = parser(); + +let result = processor.processSync(' .class'); +console.log(result); +// => .class + +// Asynchronous operation +let promise = processor.process(' .class').then(result => { + console.log(result) + // => .class +}); + +// To have the parser normalize whitespace values, utilize the options +result = processor.processSync(' .class ', {lossless: false}); +console.log(result); +// => .class + +// For better syntax errors, pass a PostCSS Rule node. +const postcss = require('postcss'); +rule = postcss.rule({selector: ' #foo > a, .class '}); +processor.process(rule, {lossless: false, updateSelector: true}).then(result => { + console.log(result); + // => #foo>a,.class + console.log("rule:", rule.selector); + // => rule: #foo>a,.class +}) +``` + +Arguments: + +* `selectors (string|postcss.Rule)`: Either a selector string or a PostCSS Rule + node. +* `[options] (object)`: Process options + + +### `ast|astSync(selectors, [options])` + +Like `process()` and `processSync()` but after +processing the `selectors` these methods return the `Root` node of the result +instead of a string. + +Note: when the `updateSelector` option is set, the rule's selector +will be updated with the resulting string. + +### `transform|transformSync(selectors, [options])` + +Like `process()` and `processSync()` but after +processing the `selectors` these methods return the value returned by the +processor callback. + +Note: when the `updateSelector` option is set, the rule's selector +will be updated with the resulting string. + +### Error Handling Within Selector Processors + +The root node passed to the selector processor callback +has a method `error(message, options)` that returns an +error object. This method should always be used to raise +errors relating to the syntax of selectors. The options +to this method are passed to postcss's error constructor +([documentation](http://postcss.org/api/#container-error)). + +#### Async Error Example + +```js +let processor = (root) => { + return new Promise((resolve, reject) => { + root.walkClasses((classNode) => { + if (/^(.*)[-_]/.test(classNode.value)) { + let msg = "classes may not have underscores or dashes in them"; + reject(root.error(msg, { + index: classNode.sourceIndex + RegExp.$1.length + 1, + word: classNode.value + })); + } + }); + resolve(); + }); +}; + +const postcss = require("postcss"); +const parser = require("postcss-selector-parser"); +const selectorProcessor = parser(processor); +const plugin = postcss.plugin('classValidator', (options) => { + return (root) => { + let promises = []; + root.walkRules(rule => { + promises.push(selectorProcessor.process(rule)); + }); + return Promise.all(promises); + }; +}); +postcss(plugin()).process(` +.foo-bar { + color: red; +} +`.trim(), {from: 'test.css'}).catch((e) => console.error(e.toString())); + +// CssSyntaxError: classValidator: ./test.css:1:5: classes may not have underscores or dashes in them +// +// > 1 | .foo-bar { +// | ^ +// 2 | color: red; +// 3 | } +``` + +#### Synchronous Error Example + +```js +let processor = (root) => { + root.walkClasses((classNode) => { + if (/.*[-_]/.test(classNode.value)) { + let msg = "classes may not have underscores or dashes in them"; + throw root.error(msg, { + index: classNode.sourceIndex, + word: classNode.value + }); + } + }); +}; + +const postcss = require("postcss"); +const parser = require("postcss-selector-parser"); +const selectorProcessor = parser(processor); +const plugin = postcss.plugin('classValidator', (options) => { + return (root) => { + root.walkRules(rule => { + selectorProcessor.processSync(rule); + }); + }; +}); +postcss(plugin()).process(` +.foo-bar { + color: red; +} +`.trim(), {from: 'test.css'}).catch((e) => console.error(e.toString())); + +// CssSyntaxError: classValidator: ./test.css:1:5: classes may not have underscores or dashes in them +// +// > 1 | .foo-bar { +// | ^ +// 2 | color: red; +// 3 | } +``` diff --git a/node/node_modules/npm/node_modules/postcss-selector-parser/LICENSE-MIT b/node/node_modules/npm/node_modules/postcss-selector-parser/LICENSE-MIT new file mode 100644 index 0000000000000000000000000000000000000000..44ebe1f3e755909298a832364bc8ef8d11dffa46 --- /dev/null +++ b/node/node_modules/npm/node_modules/postcss-selector-parser/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) Ben Briggs (http://beneb.info) + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/postcss-selector-parser/package.json b/node/node_modules/npm/node_modules/postcss-selector-parser/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d9eefe9a9bb6b7b9164eb8e6861435c0ecfb11f5 --- /dev/null +++ b/node/node_modules/npm/node_modules/postcss-selector-parser/package.json @@ -0,0 +1,81 @@ +{ + "name": "postcss-selector-parser", + "version": "7.1.1", + "devDependencies": { + "@babel/cli": "^7.11.6", + "@babel/core": "^7.11.6", + "@babel/eslint-parser": "^7.11.5", + "@babel/eslint-plugin": "^7.11.5", + "@babel/plugin-proposal-class-properties": "^7.10.4", + "@babel/preset-env": "^7.11.5", + "@babel/register": "^7.11.5", + "ava": "^5.1.0", + "babel-plugin-add-module-exports": "^1.0.4", + "coveralls-next": "^4.2.1", + "del-cli": "^5.0.0", + "eslint": "^8.28.0", + "eslint-plugin-import": "^2.26.0", + "glob": "^8.0.3", + "minimist": "^1.2.5", + "nyc": "^15.1.0", + "postcss": "^8.4.31", + "semver": "^7.3.2", + "typescript": "^4.0.3" + }, + "main": "dist/index.js", + "types": "postcss-selector-parser.d.ts", + "files": [ + "API.md", + "CHANGELOG.md", + "LICENSE-MIT", + "dist", + "postcss-selector-parser.d.ts", + "!**/__tests__" + ], + "scripts": { + "typecheck": "tsc --noEmit --strict postcss-selector-parser.d.ts postcss-selector-parser.test.ts", + "pretest": "eslint src && npm run typecheck", + "prepare": "del-cli dist && BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/", + "lintfix": "eslint --fix src", + "report": "nyc report --reporter=html", + "test": "nyc ava src/__tests__/*.mjs", + "test:node22": "nyc ava src/__tests__/*.mjs --node-arguments=--no-experimental-detect-module", + "testone": "ava" + }, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "license": "MIT", + "engines": { + "node": ">=4" + }, + "homepage": "https://github.com/postcss/postcss-selector-parser", + "contributors": [ + { + "name": "Ben Briggs", + "email": "beneb.info@gmail.com", + "url": "http://beneb.info" + }, + { + "name": "Chris Eppstein", + "email": "chris@eppsteins.net", + "url": "http://twitter.com/chriseppstein" + } + ], + "repository": "postcss/postcss-selector-parser", + "ava": { + "require": [ + "@babel/register" + ], + "concurrency": 5, + "timeout": "25s", + "nodeArguments": [] + }, + "nyc": { + "exclude": [ + "node_modules", + "**/__tests__" + ] + } +} diff --git a/node/node_modules/npm/node_modules/proc-log/LICENSE b/node/node_modules/npm/node_modules/proc-log/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..8ef4fb9397abcc0f18dfaa12e8cc3d898163d538 --- /dev/null +++ b/node/node_modules/npm/node_modules/proc-log/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) GitHub, Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/proc-log/package.json b/node/node_modules/npm/node_modules/proc-log/package.json new file mode 100644 index 0000000000000000000000000000000000000000..b2ec249b77a676f891a5fb57888f01d64c99ee0d --- /dev/null +++ b/node/node_modules/npm/node_modules/proc-log/package.json @@ -0,0 +1,46 @@ +{ + "name": "proc-log", + "version": "6.1.0", + "files": [ + "bin/", + "lib/" + ], + "main": "lib/index.js", + "description": "just emit 'log' events on the process object", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/proc-log.git" + }, + "author": "GitHub Inc.", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "posttest": "npm run lint", + "postsnap": "eslint index.js test/*.js --fix", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "devDependencies": { + "@npmcli/eslint-config": "^6.0.0", + "@npmcli/template-oss": "4.28.1", + "tap": "^16.0.1" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.28.1", + "publish": true + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node/node_modules/npm/node_modules/proggy/LICENSE b/node/node_modules/npm/node_modules/proggy/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..8ef4fb9397abcc0f18dfaa12e8cc3d898163d538 --- /dev/null +++ b/node/node_modules/npm/node_modules/proggy/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) GitHub, Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/proggy/package.json b/node/node_modules/npm/node_modules/proggy/package.json new file mode 100644 index 0000000000000000000000000000000000000000..64fda5f7ce1027bfa348b12cb6ddfc221887ab0b --- /dev/null +++ b/node/node_modules/npm/node_modules/proggy/package.json @@ -0,0 +1,50 @@ +{ + "name": "proggy", + "version": "4.0.0", + "files": [ + "bin/", + "lib/" + ], + "main": "lib/index.js", + "description": "Progress bar updates at a distance", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/proggy.git" + }, + "author": "GitHub Inc.", + "license": "ISC", + "scripts": { + "test": "tap", + "posttest": "npm run lint", + "snap": "tap", + "postsnap": "eslint lib test --fix", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "chalk": "^4.1.2", + "cli-progress": "^3.10.0", + "npmlog": "^7.0.0", + "tap": "^16.0.1" + }, + "tap": { + "coverage-map": "map.js", + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": true + } +} diff --git a/node/node_modules/npm/node_modules/promise-all-reject-late/LICENSE b/node/node_modules/npm/node_modules/promise-all-reject-late/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..235bdd54ec77f257af3e9f5bfece770fa2d6d6a8 --- /dev/null +++ b/node/node_modules/npm/node_modules/promise-all-reject-late/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/promise-all-reject-late/index.js b/node/node_modules/npm/node_modules/promise-all-reject-late/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0ebcaac5d4345c5417ce4e41d22a4b968bee29af --- /dev/null +++ b/node/node_modules/npm/node_modules/promise-all-reject-late/index.js @@ -0,0 +1,27 @@ +const allSettled = + Promise.allSettled ? promises => Promise.allSettled(promises) + : promises => { + const reflections = [] + for (let i = 0; i < promises.length; i++) { + reflections[i] = Promise.resolve(promises[i]).then(value => ({ + status: 'fulfilled', + value, + }), reason => ({ + status: 'rejected', + reason, + })) + } + return Promise.all(reflections) + } + +module.exports = promises => allSettled(promises).then(results => { + let er = null + const ret = new Array(results.length) + results.forEach((result, i) => { + if (result.status === 'rejected') + throw result.reason + else + ret[i] = result.value + }) + return ret +}) diff --git a/node/node_modules/npm/node_modules/promise-all-reject-late/package.json b/node/node_modules/npm/node_modules/promise-all-reject-late/package.json new file mode 100644 index 0000000000000000000000000000000000000000..55659d8fcfddceef90fd26d5ac126f2519c4483c --- /dev/null +++ b/node/node_modules/npm/node_modules/promise-all-reject-late/package.json @@ -0,0 +1,22 @@ +{ + "name": "promise-all-reject-late", + "version": "1.0.1", + "description": "Like Promise.all, but save rejections until all promises are resolved", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^14.10.5" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } +} diff --git a/node/node_modules/npm/node_modules/promise-call-limit/LICENSE b/node/node_modules/npm/node_modules/promise-call-limit/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..235bdd54ec77f257af3e9f5bfece770fa2d6d6a8 --- /dev/null +++ b/node/node_modules/npm/node_modules/promise-call-limit/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/promise-call-limit/package.json b/node/node_modules/npm/node_modules/promise-call-limit/package.json new file mode 100644 index 0000000000000000000000000000000000000000..f56924ae5808a3636fab76d0ea2d856131844b78 --- /dev/null +++ b/node/node_modules/npm/node_modules/promise-call-limit/package.json @@ -0,0 +1,68 @@ +{ + "name": "promise-call-limit", + "version": "3.0.2", + "files": [ + "dist" + ], + "description": "Call an array of promise-returning functions, restricting concurrency to a specified limit.", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/promise-call-limit" + }, + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "prepare": "tshy", + "pretest": "npm run prepare", + "snap": "tap", + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "format": "prettier --write . --log-level warn --cache" + }, + "devDependencies": { + "prettier": "^3.3.3", + "tap": "^21.0.1", + "tshy": "^3.0.2", + "typedoc": "^0.26.6" + }, + "prettier": { + "experimentalTernaries": true, + "semi": false, + "printWidth": 70, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "type": "module", + "module": "./dist/esm/index.js" +} diff --git a/node/node_modules/npm/node_modules/promzard/LICENSE b/node/node_modules/npm/node_modules/promzard/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..235bdd54ec77f257af3e9f5bfece770fa2d6d6a8 --- /dev/null +++ b/node/node_modules/npm/node_modules/promzard/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/promzard/package.json b/node/node_modules/npm/node_modules/promzard/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9567e984bdb6388edb1b758525ec654a402c1db4 --- /dev/null +++ b/node/node_modules/npm/node_modules/promzard/package.json @@ -0,0 +1,50 @@ +{ + "author": "GitHub Inc.", + "name": "promzard", + "description": "prompting wizardly", + "version": "3.0.1", + "repository": { + "url": "git+https://github.com/npm/promzard.git", + "type": "git" + }, + "dependencies": { + "read": "^5.0.0" + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "tap": "^16.3.0" + }, + "main": "lib/index.js", + "scripts": { + "test": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "license": "ISC", + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": true + }, + "tap": { + "jobs": 1, + "test-ignore": "fixtures/", + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node/node_modules/npm/node_modules/qrcode-terminal/.travis.yml b/node/node_modules/npm/node_modules/qrcode-terminal/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..e02e6b49f6fcbb26c83100fab0040595905e3d7b --- /dev/null +++ b/node/node_modules/npm/node_modules/qrcode-terminal/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - "0.10" diff --git a/node/node_modules/npm/node_modules/qrcode-terminal/LICENSE b/node/node_modules/npm/node_modules/qrcode-terminal/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0160d70bf229d2177cf1a501007801f032552a7d --- /dev/null +++ b/node/node_modules/npm/node_modules/qrcode-terminal/LICENSE @@ -0,0 +1,222 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +============================================================== +This product also include the following software: +============================================================== + + QRCode for JavaScript + + Copyright (c) 2009 Kazuhiko Arase + + URL: http://www.d-project.com/ + + Licensed under the MIT license: + http://www.opensource.org/licenses/mit-license.php + + The word "QR Code" is registered trademark of + DENSO WAVE INCORPORATED + http://www.denso-wave.com/qrcode/faqpatent-e.html + +Located in ./vendor/QRCode +- project has been modified to work in Node and some refactoring was done for code cleanup diff --git a/node/node_modules/npm/node_modules/qrcode-terminal/README.md b/node/node_modules/npm/node_modules/qrcode-terminal/README.md new file mode 100644 index 0000000000000000000000000000000000000000..25bea8f4dd450460829ea2a679954b8cf2ff7119 --- /dev/null +++ b/node/node_modules/npm/node_modules/qrcode-terminal/README.md @@ -0,0 +1,82 @@ +# QRCode Terminal Edition [![Build Status][travis-ci-img]][travis-ci-url] + +> Going where no QRCode has gone before. + +![Basic Example][basic-example-img] + +# Node Library + +## Install + +Can be installed with: + + $ npm install qrcode-terminal + +and used: + + var qrcode = require('qrcode-terminal'); + +## Usage + +To display some data to the terminal just call: + + qrcode.generate('This will be a QRCode, eh!'); + +You can even specify the error level (default is 'L'): + + qrcode.setErrorLevel('Q'); + qrcode.generate('This will be a QRCode with error level Q!'); + +If you don't want to display to the terminal but just want to string you can provide a callback: + + qrcode.generate('http://github.com', function (qrcode) { + console.log(qrcode); + }); + +If you want to display small output, provide `opts` with `small`: + + qrcode.generate('This will be a small QRCode, eh!', {small: true}); + + qrcode.generate('This will be a small QRCode, eh!', {small: true}, function (qrcode) { + console.log(qrcode) + }); + +# Command-Line + +## Install + + $ npm install -g qrcode-terminal + +## Usage + + $ qrcode-terminal --help + $ qrcode-terminal 'http://github.com' + $ echo 'http://github.com' | qrcode-terminal + +# Support + +- OS X +- Linux +- Windows + +# Server-side + +[node-qrcode][node-qrcode-url] is a popular server-side QRCode generator that +renders to a `canvas` object. + +# Developing + +To setup the development envrionment run `npm install` + +To run tests run `npm test` + +# Contributers + + Gord Tanner + Micheal Brooks + +[travis-ci-img]: https://travis-ci.org/gtanner/qrcode-terminal.png +[travis-ci-url]: https://travis-ci.org/gtanner/qrcode-terminal +[basic-example-img]: https://raw.github.com/gtanner/qrcode-terminal/master/example/basic.png +[node-qrcode-url]: https://github.com/soldair/node-qrcode + diff --git a/node/node_modules/npm/node_modules/qrcode-terminal/package.json b/node/node_modules/npm/node_modules/qrcode-terminal/package.json new file mode 100644 index 0000000000000000000000000000000000000000..8e70c986803bc5b3283d85c68e3314961640e888 --- /dev/null +++ b/node/node_modules/npm/node_modules/qrcode-terminal/package.json @@ -0,0 +1,37 @@ +{ + "name": "qrcode-terminal", + "keywords": ["ansi", "ascii", "qrcode", "console"], + "version" : "0.12.0", + "description" : "QRCodes, in the terminal", + "homepage": "https://github.com/gtanner/qrcode-terminal", + "repository": { + "type": "git", + "url": "https://github.com/gtanner/qrcode-terminal" + }, + "contributors": [{ + "name": "Gord Tanner", + "email": "gtanner@gmail.com", + "url": "http://github.com/gtanner" + }, { + "name": "Michael Brooks", + "email": "mikeywbrooks@gmail.com", + "url": "http://github.com/mwbrooks" + }], + "licenses": [{ + "type": "Apache 2.0" + }], + "main": "./lib/main", + "bin": { + "qrcode-terminal": "./bin/qrcode-terminal.js" + }, + "preferGlobal": false, + "devDependencies": { + "sinon": "*", + "mocha": "*", + "expect.js": "*", + "jshint": "*" + }, + "scripts": { + "test": "./node_modules/jshint/bin/jshint lib vendor && node example/basic.js && ./node_modules/mocha/bin/mocha -R nyan" + } +} diff --git a/node/node_modules/npm/node_modules/read-cmd-shim/LICENSE b/node/node_modules/npm/node_modules/read-cmd-shim/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c8633408954df9cb0f8a816496a7a863353a1d04 --- /dev/null +++ b/node/node_modules/npm/node_modules/read-cmd-shim/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/node/node_modules/npm/node_modules/read-cmd-shim/package.json b/node/node_modules/npm/node_modules/read-cmd-shim/package.json new file mode 100644 index 0000000000000000000000000000000000000000..bfeade26da51b080283143062a91e5a61aa591e4 --- /dev/null +++ b/node/node_modules/npm/node_modules/read-cmd-shim/package.json @@ -0,0 +1,48 @@ +{ + "name": "read-cmd-shim", + "version": "6.0.0", + "description": "Figure out what a cmd-shim is pointing at. This acts as the equivalent of fs.readlink.", + "main": "lib/index.js", + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "cmd-shim": "^7.0.0", + "tap": "^16.0.1" + }, + "scripts": { + "test": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "tap": { + "check-coverage": true, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/read-cmd-shim.git" + }, + "license": "ISC", + "homepage": "https://github.com/npm/read-cmd-shim#readme", + "files": [ + "bin/", + "lib/" + ], + "author": "GitHub Inc.", + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": true + } +} diff --git a/node/node_modules/npm/node_modules/read/LICENSE b/node/node_modules/npm/node_modules/read/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..32eb517086ebb24cfe3dd076033211d444186dc9 --- /dev/null +++ b/node/node_modules/npm/node_modules/read/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/read/package.json b/node/node_modules/npm/node_modules/read/package.json new file mode 100644 index 0000000000000000000000000000000000000000..201166e2c6c54e209556b826113361b7c739a819 --- /dev/null +++ b/node/node_modules/npm/node_modules/read/package.json @@ -0,0 +1,88 @@ +{ + "name": "read", + "version": "5.0.1", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/read.d.ts", + "default": "./dist/esm/read.js" + }, + "require": { + "types": "./dist/commonjs/read.d.ts", + "default": "./dist/commonjs/read.js" + } + } + }, + "type": "module", + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/read.ts" + } + }, + "dependencies": { + "mute-stream": "^3.0.0" + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "@types/mute-stream": "^0.0.4", + "@types/tap": "^15.0.11", + "@typescript-eslint/parser": "^8.0.1", + "c8": "^10.1.2", + "eslint-import-resolver-typescript": "^4.3.2", + "tap": "^16.3.9", + "ts-node": "^10.9.1", + "tshy": "^3.0.2", + "typescript": "^5.2.2" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "author": "GitHub Inc.", + "description": "read(1) for node programs", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/read.git" + }, + "license": "ISC", + "scripts": { + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "c8 tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "snap": "c8 tap", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": true, + "typescript": true + }, + "main": "./dist/commonjs/read.js", + "types": "./dist/commonjs/read.d.ts", + "tap": { + "coverage": false, + "node-arg": [ + "--no-warnings", + "--loader", + "ts-node/esm" + ], + "ts": false, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "files": [ + "dist/" + ], + "module": "./dist/esm/read.js" +} diff --git a/node/node_modules/npm/node_modules/safer-buffer/LICENSE b/node/node_modules/npm/node_modules/safer-buffer/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..6360ade698694e5dd05ee8da7f606b1fbe6f09ea --- /dev/null +++ b/node/node_modules/npm/node_modules/safer-buffer/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Nikita Skovoroda + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node/node_modules/npm/node_modules/safer-buffer/Porting-Buffer.md b/node/node_modules/npm/node_modules/safer-buffer/Porting-Buffer.md new file mode 100644 index 0000000000000000000000000000000000000000..dc95b69686404c4978b08130870bff48d266971f --- /dev/null +++ b/node/node_modules/npm/node_modules/safer-buffer/Porting-Buffer.md @@ -0,0 +1,268 @@ +# Porting to the Buffer.from/Buffer.alloc API + + +## Overview + +- [Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x.](#variant-1) (*recommended*) +- [Variant 2: Use a polyfill](#variant-2) +- [Variant 3: manual detection, with safeguards](#variant-3) + +### Finding problematic bits of code using grep + +Just run `grep -nrE '[^a-zA-Z](Slow)?Buffer\s*\(' --exclude-dir node_modules`. + +It will find all the potentially unsafe places in your own code (with some considerably unlikely +exceptions). + +### Finding problematic bits of code using Node.js 8 + +If you’re using Node.js ≥ 8.0.0 (which is recommended), Node.js exposes multiple options that help with finding the relevant pieces of code: + +- `--trace-warnings` will make Node.js show a stack trace for this warning and other warnings that are printed by Node.js. +- `--trace-deprecation` does the same thing, but only for deprecation warnings. +- `--pending-deprecation` will show more types of deprecation warnings. In particular, it will show the `Buffer()` deprecation warning, even on Node.js 8. + +You can set these flags using an environment variable: + +```console +$ export NODE_OPTIONS='--trace-warnings --pending-deprecation' +$ cat example.js +'use strict'; +const foo = new Buffer('foo'); +$ node example.js +(node:7147) [DEP0005] DeprecationWarning: The Buffer() and new Buffer() constructors are not recommended for use due to security and usability concerns. Please use the new Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() construction methods instead. + at showFlaggedDeprecation (buffer.js:127:13) + at new Buffer (buffer.js:148:3) + at Object. (/path/to/example.js:2:13) + [... more stack trace lines ...] +``` + +### Finding problematic bits of code using linters + +Eslint rules [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) +or +[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) +also find calls to deprecated `Buffer()` API. Those rules are included in some pre-sets. + +There is a drawback, though, that it doesn't always +[work correctly](https://github.com/chalker/safer-buffer#why-not-safe-buffer) when `Buffer` is +overriden e.g. with a polyfill, so recommended is a combination of this and some other method +described above. + + +## Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x. + +This is the recommended solution nowadays that would imply only minimal overhead. + +The Node.js 5.x release line has been unsupported since July 2016, and the Node.js 4.x release line reaches its End of Life in April 2018 (→ [Schedule](https://github.com/nodejs/Release#release-schedule)). This means that these versions of Node.js will *not* receive any updates, even in case of security issues, so using these release lines should be avoided, if at all possible. + +What you would do in this case is to convert all `new Buffer()` or `Buffer()` calls to use `Buffer.alloc()` or `Buffer.from()`, in the following way: + +- For `new Buffer(number)`, replace it with `Buffer.alloc(number)`. +- For `new Buffer(string)` (or `new Buffer(string, encoding)`), replace it with `Buffer.from(string)` (or `Buffer.from(string, encoding)`). +- For all other combinations of arguments (these are much rarer), also replace `new Buffer(...arguments)` with `Buffer.from(...arguments)`. + +Note that `Buffer.alloc()` is also _faster_ on the current Node.js versions than +`new Buffer(size).fill(0)`, which is what you would otherwise need to ensure zero-filling. + +Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) +or +[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) +is recommended to avoid accidential unsafe Buffer API usage. + +There is also a [JSCodeshift codemod](https://github.com/joyeecheung/node-dep-codemod#dep005) +for automatically migrating Buffer constructors to `Buffer.alloc()` or `Buffer.from()`. +Note that it currently only works with cases where the arguments are literals or where the +constructor is invoked with two arguments. + +_If you currently support those older Node.js versions and dropping them would be a semver-major change +for you, or if you support older branches of your packages, consider using [Variant 2](#variant-2) +or [Variant 3](#variant-3) on older branches, so people using those older branches will also receive +the fix. That way, you will eradicate potential issues caused by unguarded Buffer API usage and +your users will not observe a runtime deprecation warning when running your code on Node.js 10._ + + +## Variant 2: Use a polyfill + +Utilize [safer-buffer](https://www.npmjs.com/package/safer-buffer) as a polyfill to support older +Node.js versions. + +You would take exacly the same steps as in [Variant 1](#variant-1), but with a polyfill +`const Buffer = require('safer-buffer').Buffer` in all files where you use the new `Buffer` api. + +Make sure that you do not use old `new Buffer` API — in any files where the line above is added, +using old `new Buffer()` API will _throw_. It will be easy to notice that in CI, though. + +Alternatively, you could use [buffer-from](https://www.npmjs.com/package/buffer-from) and/or +[buffer-alloc](https://www.npmjs.com/package/buffer-alloc) [ponyfills](https://ponyfill.com/) — +those are great, the only downsides being 4 deps in the tree and slightly more code changes to +migrate off them (as you would be using e.g. `Buffer.from` under a different name). If you need only +`Buffer.from` polyfilled — `buffer-from` alone which comes with no extra dependencies. + +_Alternatively, you could use [safe-buffer](https://www.npmjs.com/package/safe-buffer) — it also +provides a polyfill, but takes a different approach which has +[it's drawbacks](https://github.com/chalker/safer-buffer#why-not-safe-buffer). It will allow you +to also use the older `new Buffer()` API in your code, though — but that's arguably a benefit, as +it is problematic, can cause issues in your code, and will start emitting runtime deprecation +warnings starting with Node.js 10._ + +Note that in either case, it is important that you also remove all calls to the old Buffer +API manually — just throwing in `safe-buffer` doesn't fix the problem by itself, it just provides +a polyfill for the new API. I have seen people doing that mistake. + +Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) +or +[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) +is recommended. + +_Don't forget to drop the polyfill usage once you drop support for Node.js < 4.5.0._ + + +## Variant 3 — manual detection, with safeguards + +This is useful if you create Buffer instances in only a few places (e.g. one), or you have your own +wrapper around them. + +### Buffer(0) + +This special case for creating empty buffers can be safely replaced with `Buffer.concat([])`, which +returns the same result all the way down to Node.js 0.8.x. + +### Buffer(notNumber) + +Before: + +```js +var buf = new Buffer(notNumber, encoding); +``` + +After: + +```js +var buf; +if (Buffer.from && Buffer.from !== Uint8Array.from) { + buf = Buffer.from(notNumber, encoding); +} else { + if (typeof notNumber === 'number') + throw new Error('The "size" argument must be of type number.'); + buf = new Buffer(notNumber, encoding); +} +``` + +`encoding` is optional. + +Note that the `typeof notNumber` before `new Buffer` is required (for cases when `notNumber` argument is not +hard-coded) and _is not caused by the deprecation of Buffer constructor_ — it's exactly _why_ the +Buffer constructor is deprecated. Ecosystem packages lacking this type-check caused numereous +security issues — situations when unsanitized user input could end up in the `Buffer(arg)` create +problems ranging from DoS to leaking sensitive information to the attacker from the process memory. + +When `notNumber` argument is hardcoded (e.g. literal `"abc"` or `[0,1,2]`), the `typeof` check can +be omitted. + +Also note that using TypeScript does not fix this problem for you — when libs written in +`TypeScript` are used from JS, or when user input ends up there — it behaves exactly as pure JS, as +all type checks are translation-time only and are not present in the actual JS code which TS +compiles to. + +### Buffer(number) + +For Node.js 0.10.x (and below) support: + +```js +var buf; +if (Buffer.alloc) { + buf = Buffer.alloc(number); +} else { + buf = new Buffer(number); + buf.fill(0); +} +``` + +Otherwise (Node.js ≥ 0.12.x): + +```js +const buf = Buffer.alloc ? Buffer.alloc(number) : new Buffer(number).fill(0); +``` + +## Regarding Buffer.allocUnsafe + +Be extra cautious when using `Buffer.allocUnsafe`: + * Don't use it if you don't have a good reason to + * e.g. you probably won't ever see a performance difference for small buffers, in fact, those + might be even faster with `Buffer.alloc()`, + * if your code is not in the hot code path — you also probably won't notice a difference, + * keep in mind that zero-filling minimizes the potential risks. + * If you use it, make sure that you never return the buffer in a partially-filled state, + * if you are writing to it sequentially — always truncate it to the actuall written length + +Errors in handling buffers allocated with `Buffer.allocUnsafe` could result in various issues, +ranged from undefined behaviour of your code to sensitive data (user input, passwords, certs) +leaking to the remote attacker. + +_Note that the same applies to `new Buffer` usage without zero-filling, depending on the Node.js +version (and lacking type checks also adds DoS to the list of potential problems)._ + + +## FAQ + + +### What is wrong with the `Buffer` constructor? + +The `Buffer` constructor could be used to create a buffer in many different ways: + +- `new Buffer(42)` creates a `Buffer` of 42 bytes. Before Node.js 8, this buffer contained + *arbitrary memory* for performance reasons, which could include anything ranging from + program source code to passwords and encryption keys. +- `new Buffer('abc')` creates a `Buffer` that contains the UTF-8-encoded version of + the string `'abc'`. A second argument could specify another encoding: For example, + `new Buffer(string, 'base64')` could be used to convert a Base64 string into the original + sequence of bytes that it represents. +- There are several other combinations of arguments. + +This meant that, in code like `var buffer = new Buffer(foo);`, *it is not possible to tell +what exactly the contents of the generated buffer are* without knowing the type of `foo`. + +Sometimes, the value of `foo` comes from an external source. For example, this function +could be exposed as a service on a web server, converting a UTF-8 string into its Base64 form: + +``` +function stringToBase64(req, res) { + // The request body should have the format of `{ string: 'foobar' }` + const rawBytes = new Buffer(req.body.string) + const encoded = rawBytes.toString('base64') + res.end({ encoded: encoded }) +} +``` + +Note that this code does *not* validate the type of `req.body.string`: + +- `req.body.string` is expected to be a string. If this is the case, all goes well. +- `req.body.string` is controlled by the client that sends the request. +- If `req.body.string` is the *number* `50`, the `rawBytes` would be 50 bytes: + - Before Node.js 8, the content would be uninitialized + - After Node.js 8, the content would be `50` bytes with the value `0` + +Because of the missing type check, an attacker could intentionally send a number +as part of the request. Using this, they can either: + +- Read uninitialized memory. This **will** leak passwords, encryption keys and other + kinds of sensitive information. (Information leak) +- Force the program to allocate a large amount of memory. For example, when specifying + `500000000` as the input value, each request will allocate 500MB of memory. + This can be used to either exhaust the memory available of a program completely + and make it crash, or slow it down significantly. (Denial of Service) + +Both of these scenarios are considered serious security issues in a real-world +web server context. + +when using `Buffer.from(req.body.string)` instead, passing a number will always +throw an exception instead, giving a controlled behaviour that can always be +handled by the program. + + +### The `Buffer()` constructor has been deprecated for a while. Is this really an issue? + +Surveys of code in the `npm` ecosystem have shown that the `Buffer()` constructor is still +widely used. This includes new code, and overall usage of such code has actually been +*increasing*. diff --git a/node/node_modules/npm/node_modules/safer-buffer/dangerous.js b/node/node_modules/npm/node_modules/safer-buffer/dangerous.js new file mode 100644 index 0000000000000000000000000000000000000000..780ba27077805fcbc02135d2eec2e17aa6f317bd --- /dev/null +++ b/node/node_modules/npm/node_modules/safer-buffer/dangerous.js @@ -0,0 +1,58 @@ +/* eslint-disable node/no-deprecated-api */ + +'use strict' + +var buffer = require('buffer') +var Buffer = buffer.Buffer +var safer = require('./safer.js') +var Safer = safer.Buffer + +var dangerous = {} + +var key + +for (key in safer) { + if (!safer.hasOwnProperty(key)) continue + dangerous[key] = safer[key] +} + +var Dangereous = dangerous.Buffer = {} + +// Copy Safer API +for (key in Safer) { + if (!Safer.hasOwnProperty(key)) continue + Dangereous[key] = Safer[key] +} + +// Copy those missing unsafe methods, if they are present +for (key in Buffer) { + if (!Buffer.hasOwnProperty(key)) continue + if (Dangereous.hasOwnProperty(key)) continue + Dangereous[key] = Buffer[key] +} + +if (!Dangereous.allocUnsafe) { + Dangereous.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) + } + if (size < 0 || size >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + return Buffer(size) + } +} + +if (!Dangereous.allocUnsafeSlow) { + Dangereous.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) + } + if (size < 0 || size >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + return buffer.SlowBuffer(size) + } +} + +module.exports = dangerous diff --git a/node/node_modules/npm/node_modules/safer-buffer/package.json b/node/node_modules/npm/node_modules/safer-buffer/package.json new file mode 100644 index 0000000000000000000000000000000000000000..e2e21c2fbda1b631f2a821a4c355f93a12d240cb --- /dev/null +++ b/node/node_modules/npm/node_modules/safer-buffer/package.json @@ -0,0 +1,34 @@ +{ + "name": "safer-buffer", + "version": "2.1.2", + "description": "Modern Buffer API polyfill without footguns", + "main": "safer.js", + "scripts": { + "browserify-test": "browserify --external tape tests.js > browserify-tests.js && tape browserify-tests.js", + "test": "standard && tape tests.js" + }, + "author": { + "name": "Nikita Skovoroda", + "email": "chalkerx@gmail.com", + "url": "https://github.com/ChALkeR" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/ChALkeR/safer-buffer.git" + }, + "bugs": { + "url": "https://github.com/ChALkeR/safer-buffer/issues" + }, + "devDependencies": { + "standard": "^11.0.1", + "tape": "^4.9.0" + }, + "files": [ + "Porting-Buffer.md", + "Readme.md", + "tests.js", + "dangerous.js", + "safer.js" + ] +} diff --git a/node/node_modules/npm/node_modules/safer-buffer/safer.js b/node/node_modules/npm/node_modules/safer-buffer/safer.js new file mode 100644 index 0000000000000000000000000000000000000000..9c5228087dfb3ed24bc9f3f737b1c92c0870c25e --- /dev/null +++ b/node/node_modules/npm/node_modules/safer-buffer/safer.js @@ -0,0 +1,77 @@ +/* eslint-disable node/no-deprecated-api */ + +'use strict' + +var buffer = require('buffer') +var Buffer = buffer.Buffer + +var safer = {} + +var key + +for (key in buffer) { + if (!buffer.hasOwnProperty(key)) continue + if (key === 'SlowBuffer' || key === 'Buffer') continue + safer[key] = buffer[key] +} + +var Safer = safer.Buffer = {} +for (key in Buffer) { + if (!Buffer.hasOwnProperty(key)) continue + if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue + Safer[key] = Buffer[key] +} + +safer.Buffer.prototype = Buffer.prototype + +if (!Safer.from || Safer.from === Uint8Array.from) { + Safer.from = function (value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) + } + if (value && typeof value.length === 'undefined') { + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) + } + return Buffer(value, encodingOrOffset, length) + } +} + +if (!Safer.alloc) { + Safer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) + } + if (size < 0 || size >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + var buf = Buffer(size) + if (!fill || fill.length === 0) { + buf.fill(0) + } else if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + return buf + } +} + +if (!safer.kStringMaxLength) { + try { + safer.kStringMaxLength = process.binding('buffer').kStringMaxLength + } catch (e) { + // we can't determine kStringMaxLength in environments where process.binding + // is unsupported, so let's not set it + } +} + +if (!safer.constants) { + safer.constants = { + MAX_LENGTH: safer.kMaxLength + } + if (safer.kStringMaxLength) { + safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength + } +} + +module.exports = safer diff --git a/node/node_modules/npm/node_modules/safer-buffer/tests.js b/node/node_modules/npm/node_modules/safer-buffer/tests.js new file mode 100644 index 0000000000000000000000000000000000000000..959e5c6dbccf05b08d86f0ee6933564937328a4e --- /dev/null +++ b/node/node_modules/npm/node_modules/safer-buffer/tests.js @@ -0,0 +1,406 @@ +/* eslint-disable node/no-deprecated-api */ + +'use strict' + +var test = require('tape') + +var buffer = require('buffer') + +var index = require('./') +var safer = require('./safer') +var dangerous = require('./dangerous') + +/* Inheritance tests */ + +test('Default is Safer', function (t) { + t.equal(index, safer) + t.notEqual(safer, dangerous) + t.notEqual(index, dangerous) + t.end() +}) + +test('Is not a function', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(typeof impl, 'object') + t.equal(typeof impl.Buffer, 'object') + }); + [buffer].forEach(function (impl) { + t.equal(typeof impl, 'object') + t.equal(typeof impl.Buffer, 'function') + }) + t.end() +}) + +test('Constructor throws', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.throws(function () { impl.Buffer() }) + t.throws(function () { impl.Buffer(0) }) + t.throws(function () { impl.Buffer('a') }) + t.throws(function () { impl.Buffer('a', 'utf-8') }) + t.throws(function () { return new impl.Buffer() }) + t.throws(function () { return new impl.Buffer(0) }) + t.throws(function () { return new impl.Buffer('a') }) + t.throws(function () { return new impl.Buffer('a', 'utf-8') }) + }) + t.end() +}) + +test('Safe methods exist', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(typeof impl.Buffer.alloc, 'function', 'alloc') + t.equal(typeof impl.Buffer.from, 'function', 'from') + }) + t.end() +}) + +test('Unsafe methods exist only in Dangerous', function (t) { + [index, safer].forEach(function (impl) { + t.equal(typeof impl.Buffer.allocUnsafe, 'undefined') + t.equal(typeof impl.Buffer.allocUnsafeSlow, 'undefined') + }); + [dangerous].forEach(function (impl) { + t.equal(typeof impl.Buffer.allocUnsafe, 'function') + t.equal(typeof impl.Buffer.allocUnsafeSlow, 'function') + }) + t.end() +}) + +test('Generic methods/properties are defined and equal', function (t) { + ['poolSize', 'isBuffer', 'concat', 'byteLength'].forEach(function (method) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], buffer.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +test('Built-in buffer static methods/properties are inherited', function (t) { + Object.keys(buffer).forEach(function (method) { + if (method === 'SlowBuffer' || method === 'Buffer') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl[method], buffer[method], method) + t.notEqual(typeof impl[method], 'undefined', method) + }) + }) + t.end() +}) + +test('Built-in Buffer static methods/properties are inherited', function (t) { + Object.keys(buffer.Buffer).forEach(function (method) { + if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], buffer.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +test('.prototype property of Buffer is inherited', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer.prototype, buffer.Buffer.prototype, 'prototype') + t.notEqual(typeof impl.Buffer.prototype, 'undefined', 'prototype') + }) + t.end() +}) + +test('All Safer methods are present in Dangerous', function (t) { + Object.keys(safer).forEach(function (method) { + if (method === 'Buffer') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl[method], safer[method], method) + if (method !== 'kStringMaxLength') { + t.notEqual(typeof impl[method], 'undefined', method) + } + }) + }) + Object.keys(safer.Buffer).forEach(function (method) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], safer.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +test('Safe methods from Dangerous methods are present in Safer', function (t) { + Object.keys(dangerous).forEach(function (method) { + if (method === 'Buffer') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl[method], dangerous[method], method) + if (method !== 'kStringMaxLength') { + t.notEqual(typeof impl[method], 'undefined', method) + } + }) + }) + Object.keys(dangerous.Buffer).forEach(function (method) { + if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], dangerous.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +/* Behaviour tests */ + +test('Methods return Buffers', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 10))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 'a'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10, 'x'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(9, 'ab'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(''))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string', 'utf-8'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([0, 42, 3]))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(new Uint8Array([0, 42, 3])))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([]))) + }); + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](0))) + t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](10))) + }) + t.end() +}) + +test('Constructor is buffer.Buffer', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer.alloc(0).constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(0, 10).constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(0, 'a').constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(10).constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(10, 'x').constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(9, 'ab').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('string').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('string', 'utf-8').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').constructor, buffer.Buffer) + t.equal(impl.Buffer.from([0, 42, 3]).constructor, buffer.Buffer) + t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).constructor, buffer.Buffer) + t.equal(impl.Buffer.from([]).constructor, buffer.Buffer) + }); + [0, 10, 100].forEach(function (arg) { + t.equal(dangerous.Buffer.allocUnsafe(arg).constructor, buffer.Buffer) + t.equal(dangerous.Buffer.allocUnsafeSlow(arg).constructor, buffer.SlowBuffer(0).constructor) + }) + t.end() +}) + +test('Invalid calls throw', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.throws(function () { impl.Buffer.from(0) }) + t.throws(function () { impl.Buffer.from(10) }) + t.throws(function () { impl.Buffer.from(10, 'utf-8') }) + t.throws(function () { impl.Buffer.from('string', 'invalid encoding') }) + t.throws(function () { impl.Buffer.from(-10) }) + t.throws(function () { impl.Buffer.from(1e90) }) + t.throws(function () { impl.Buffer.from(Infinity) }) + t.throws(function () { impl.Buffer.from(-Infinity) }) + t.throws(function () { impl.Buffer.from(NaN) }) + t.throws(function () { impl.Buffer.from(null) }) + t.throws(function () { impl.Buffer.from(undefined) }) + t.throws(function () { impl.Buffer.from() }) + t.throws(function () { impl.Buffer.from({}) }) + t.throws(function () { impl.Buffer.alloc('') }) + t.throws(function () { impl.Buffer.alloc('string') }) + t.throws(function () { impl.Buffer.alloc('string', 'utf-8') }) + t.throws(function () { impl.Buffer.alloc('b25ldHdvdGhyZWU=', 'base64') }) + t.throws(function () { impl.Buffer.alloc(-10) }) + t.throws(function () { impl.Buffer.alloc(1e90) }) + t.throws(function () { impl.Buffer.alloc(2 * (1 << 30)) }) + t.throws(function () { impl.Buffer.alloc(Infinity) }) + t.throws(function () { impl.Buffer.alloc(-Infinity) }) + t.throws(function () { impl.Buffer.alloc(null) }) + t.throws(function () { impl.Buffer.alloc(undefined) }) + t.throws(function () { impl.Buffer.alloc() }) + t.throws(function () { impl.Buffer.alloc([]) }) + t.throws(function () { impl.Buffer.alloc([0, 42, 3]) }) + t.throws(function () { impl.Buffer.alloc({}) }) + }); + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + t.throws(function () { dangerous.Buffer[method]('') }) + t.throws(function () { dangerous.Buffer[method]('string') }) + t.throws(function () { dangerous.Buffer[method]('string', 'utf-8') }) + t.throws(function () { dangerous.Buffer[method](2 * (1 << 30)) }) + t.throws(function () { dangerous.Buffer[method](Infinity) }) + if (dangerous.Buffer[method] === buffer.Buffer.allocUnsafe) { + t.skip('Skipping, older impl of allocUnsafe coerced negative sizes to 0') + } else { + t.throws(function () { dangerous.Buffer[method](-10) }) + t.throws(function () { dangerous.Buffer[method](-1e90) }) + t.throws(function () { dangerous.Buffer[method](-Infinity) }) + } + t.throws(function () { dangerous.Buffer[method](null) }) + t.throws(function () { dangerous.Buffer[method](undefined) }) + t.throws(function () { dangerous.Buffer[method]() }) + t.throws(function () { dangerous.Buffer[method]([]) }) + t.throws(function () { dangerous.Buffer[method]([0, 42, 3]) }) + t.throws(function () { dangerous.Buffer[method]({}) }) + }) + t.end() +}) + +test('Buffers have appropriate lengths', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer.alloc(0).length, 0) + t.equal(impl.Buffer.alloc(10).length, 10) + t.equal(impl.Buffer.from('').length, 0) + t.equal(impl.Buffer.from('string').length, 6) + t.equal(impl.Buffer.from('string', 'utf-8').length, 6) + t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').length, 11) + t.equal(impl.Buffer.from([0, 42, 3]).length, 3) + t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).length, 3) + t.equal(impl.Buffer.from([]).length, 0) + }); + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + t.equal(dangerous.Buffer[method](0).length, 0) + t.equal(dangerous.Buffer[method](10).length, 10) + }) + t.end() +}) + +test('Buffers have appropriate lengths (2)', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true; + [ safer.Buffer.alloc, + dangerous.Buffer.allocUnsafe, + dangerous.Buffer.allocUnsafeSlow + ].forEach(function (method) { + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 1e5) + var buf = method(length) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + } + }) + t.ok(ok) + t.end() +}) + +test('.alloc(size) is zero-filled and has correct length', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var buf = index.Buffer.alloc(length) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + var j + for (j = 0; j < length; j++) { + if (buf[j] !== 0) ok = false + } + buf.fill(1) + for (j = 0; j < length; j++) { + if (buf[j] !== 1) ok = false + } + } + t.ok(ok) + t.end() +}) + +test('.allocUnsafe / .allocUnsafeSlow are fillable and have correct lengths', function (t) { + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var buf = dangerous.Buffer[method](length) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + buf.fill(0, 0, length) + var j + for (j = 0; j < length; j++) { + if (buf[j] !== 0) ok = false + } + buf.fill(1, 0, length) + for (j = 0; j < length; j++) { + if (buf[j] !== 1) ok = false + } + } + t.ok(ok, method) + }) + t.end() +}) + +test('.alloc(size, fill) is `fill`-filled', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var fill = Math.round(Math.random() * 255) + var buf = index.Buffer.alloc(length, fill) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + for (var j = 0; j < length; j++) { + if (buf[j] !== fill) ok = false + } + } + t.ok(ok) + t.end() +}) + +test('.alloc(size, fill) is `fill`-filled', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var fill = Math.round(Math.random() * 255) + var buf = index.Buffer.alloc(length, fill) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + for (var j = 0; j < length; j++) { + if (buf[j] !== fill) ok = false + } + } + t.ok(ok) + t.deepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 97)) + t.notDeepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 98)) + + var tmp = new buffer.Buffer(2) + tmp.fill('ok') + if (tmp[1] === tmp[0]) { + // Outdated Node.js + t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('ooooo')) + } else { + t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('okoko')) + } + t.notDeepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('kokok')) + + t.end() +}) + +test('safer.Buffer.from returns results same as Buffer constructor', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.deepEqual(impl.Buffer.from(''), new buffer.Buffer('')) + t.deepEqual(impl.Buffer.from('string'), new buffer.Buffer('string')) + t.deepEqual(impl.Buffer.from('string', 'utf-8'), new buffer.Buffer('string', 'utf-8')) + t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), new buffer.Buffer('b25ldHdvdGhyZWU=', 'base64')) + t.deepEqual(impl.Buffer.from([0, 42, 3]), new buffer.Buffer([0, 42, 3])) + t.deepEqual(impl.Buffer.from(new Uint8Array([0, 42, 3])), new buffer.Buffer(new Uint8Array([0, 42, 3]))) + t.deepEqual(impl.Buffer.from([]), new buffer.Buffer([])) + }) + t.end() +}) + +test('safer.Buffer.from returns consistent results', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.deepEqual(impl.Buffer.from(''), impl.Buffer.alloc(0)) + t.deepEqual(impl.Buffer.from([]), impl.Buffer.alloc(0)) + t.deepEqual(impl.Buffer.from(new Uint8Array([])), impl.Buffer.alloc(0)) + t.deepEqual(impl.Buffer.from('string', 'utf-8'), impl.Buffer.from('string')) + t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from([115, 116, 114, 105, 110, 103])) + t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from(impl.Buffer.from('string'))) + t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), impl.Buffer.from('onetwothree')) + t.notDeepEqual(impl.Buffer.from('b25ldHdvdGhyZWU='), impl.Buffer.from('onetwothree')) + }) + t.end() +}) diff --git a/node/node_modules/npm/node_modules/semver/LICENSE b/node/node_modules/npm/node_modules/semver/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..32eb517086ebb24cfe3dd076033211d444186dc9 --- /dev/null +++ b/node/node_modules/npm/node_modules/semver/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/semver/README.md b/node/node_modules/npm/node_modules/semver/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c11caf8d4e66f5b401c67303f5575260b375353d --- /dev/null +++ b/node/node_modules/npm/node_modules/semver/README.md @@ -0,0 +1,664 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Install + +```bash +npm install semver +```` + +## Usage + +As a node module: + +```js +const semver = require('semver') + +semver.valid('1.2.3') // '1.2.3' +semver.valid('a.b.c') // null +semver.clean(' =v1.2.3 ') // '1.2.3' +semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true +semver.gt('1.2.3', '9.8.7') // false +semver.lt('1.2.3', '9.8.7') // true +semver.minVersion('>=1.0.0') // '1.0.0' +semver.valid(semver.coerce('v2')) // '2.0.0' +semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' +``` + +You can also just load the module for the function that you care about if +you'd like to minimize your footprint. + +```js +// load the whole API at once in a single object +const semver = require('semver') + +// or just load the bits you need +// all of them listed here, just pick and choose what you want + +// classes +const SemVer = require('semver/classes/semver') +const Comparator = require('semver/classes/comparator') +const Range = require('semver/classes/range') + +// functions for working with versions +const semverParse = require('semver/functions/parse') +const semverValid = require('semver/functions/valid') +const semverClean = require('semver/functions/clean') +const semverInc = require('semver/functions/inc') +const semverDiff = require('semver/functions/diff') +const semverMajor = require('semver/functions/major') +const semverMinor = require('semver/functions/minor') +const semverPatch = require('semver/functions/patch') +const semverPrerelease = require('semver/functions/prerelease') +const semverCompare = require('semver/functions/compare') +const semverRcompare = require('semver/functions/rcompare') +const semverCompareLoose = require('semver/functions/compare-loose') +const semverCompareBuild = require('semver/functions/compare-build') +const semverSort = require('semver/functions/sort') +const semverRsort = require('semver/functions/rsort') + +// low-level comparators between versions +const semverGt = require('semver/functions/gt') +const semverLt = require('semver/functions/lt') +const semverEq = require('semver/functions/eq') +const semverNeq = require('semver/functions/neq') +const semverGte = require('semver/functions/gte') +const semverLte = require('semver/functions/lte') +const semverCmp = require('semver/functions/cmp') +const semverCoerce = require('semver/functions/coerce') + +// working with ranges +const semverSatisfies = require('semver/functions/satisfies') +const semverMaxSatisfying = require('semver/ranges/max-satisfying') +const semverMinSatisfying = require('semver/ranges/min-satisfying') +const semverToComparators = require('semver/ranges/to-comparators') +const semverMinVersion = require('semver/ranges/min-version') +const semverValidRange = require('semver/ranges/valid') +const semverOutside = require('semver/ranges/outside') +const semverGtr = require('semver/ranges/gtr') +const semverLtr = require('semver/ranges/ltr') +const semverIntersects = require('semver/ranges/intersects') +const semverSimplifyRange = require('semver/ranges/simplify') +const semverRangeSubset = require('semver/ranges/subset') +``` + +As a command-line utility: + +``` +$ semver -h + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, prerelease, or release. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-n <0|1|false> + Base number for prerelease identifier (default: 0). + Use false to omit the number altogether. + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +--rtl + Coerce version strings right to left + +--ltr + Coerce version strings left to right (default) + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them. +``` + +## Versions + +A "version" is described by the `v2.0.0` specification found at +. + +A leading `"="` or `"v"` character is stripped off and ignored. +Support for stripping a leading "v" is kept for compatibility with `v1.0.0` of the SemVer +specification but should not be used anymore. + +## Ranges + +A `version range` is a set of `comparators` that specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. The comparator `>1` is equivalent to `>=2.0.0` and +would match the versions `2.0.0` and `3.1.0`, but not the versions +`1.0.1` or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. +Version `3.4.5` *would* satisfy the range because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose of this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range-matching +semantics. + +Second, a user who has opted into using a prerelease version has +indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +Note that this behavior can be suppressed (treating all prerelease +versions as if they were normal versions, for range-matching) +by setting the `includePrerelease` flag on the options +object to any +[functions](https://github.com/npm/node-semver#functions) that do +range matching. + +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta') +// '1.2.4-beta.0' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```bash +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + +To get out of the prerelease phase, use the `release` option: + +```bash +$ semver 1.2.4-beta.1 -i release +1.2.4 +``` + +#### Prerelease Identifier Base + +The method `.inc` takes an optional parameter 'identifierBase' string +that will let you let your prerelease number as zero-based or one-based. +Set to `false` to omit the prerelease number altogether. +If you do not specify this parameter, it will default to zero-based. + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta', '1') +// '1.2.4-beta.1' +``` + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta', false) +// '1.2.4-beta' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta -n 1 +1.2.4-beta.1 +``` + +```bash +$ semver 1.2.3 -i prerelease --preid beta -n false +1.2.4-beta +``` + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless + `includePrerelease` is specified, in which case any version at all + satisfies) +* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `""` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero element in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0-0` +* `^0.2.3` := `>=0.2.3 <0.3.0-0` +* `^0.0.3` := `>=0.0.3 <0.0.4-0` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0-0` +* `^0.0.x` := `>=0.0.0 <0.1.0-0` +* `^0.0` := `>=0.0.0 <0.1.0-0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0-0` +* `^0.x` := `>=0.0.0 <1.0.0-0` + +### Range Grammar + +Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors: + +```bnf +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ +``` + +## Functions + +All methods and classes take a final `options` object argument. All +options in this object are `false` by default. The options supported +are: + +- `loose`: Be more forgiving about not-quite-valid semver strings. + (Any resulting output will always be 100% strict compliant, of + course.) For backwards compatibility reasons, if the `options` + argument is a boolean value instead of an object, it is interpreted + to be the `loose` param. +- `includePrerelease`: Set to suppress the [default + behavior](https://github.com/npm/node-semver#prerelease-tags) of + excluding prerelease tagged versions from ranges unless they are + explicitly opted into. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* `valid(v)`: Return the parsed version, or null if it's not valid. +* `inc(v, releaseType, options, identifier, identifierBase)`: + Return the version incremented by the release + type (`major`, `premajor`, `minor`, `preminor`, `patch`, + `prepatch`, `prerelease`, or `release`), or null if it's not valid + * `premajor` in one call will bump the version up to the next major + version and down to a prerelease of that major version. + `preminor`, and `prepatch` work the same way. + * If called from a non-prerelease version, `prerelease` will work the + same as `prepatch`. It increments the patch version and then makes a + prerelease. If the input version is already a prerelease it simply + increments it. + * `release` will remove any prerelease part of the version. + * `identifier` can be used to prefix `premajor`, `preminor`, + `prepatch`, or `prerelease` version increments. `identifierBase` + is the base to be used for the `prerelease` identifier. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` +* `major(v)`: Return the major version number. +* `minor(v)`: Return the minor version number. +* `patch(v)`: Return the patch version number. +* `intersects(r1, r2, loose)`: Return true if the two supplied ranges + or comparators intersect. +* `parse(v)`: Attempt to parse a string as a semantic version, returning either + a `SemVer` object or `null`. + +### Comparison + +* `gt(v1, v2)`: `v1 > v2` +* `gte(v1, v2)`: `v1 >= v2` +* `lt(v1, v2)`: `v1 < v2` +* `lte(v1, v2)`: `v1 <= v2` +* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, + even if they're not the same string. You already know how to + compare strings. +* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. +* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `rcompare(v1, v2)`: The reverse of `compare`. Sorts an array of versions + in descending order when passed to `Array.sort()`. +* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions + are equal. Sorts in ascending order if passed to `Array.sort()`. +* `compareLoose(v1, v2)`: Short for `compare(v1, v2, { loose: true })`. +* `diff(v1, v2)`: Returns the difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. + +### Sorting + +* `sort(versions)`: Returns a sorted array of versions based on the `compareBuild` + function. +* `rsort(versions)`: The reverse of `sort`. Returns an array of versions based on + the `compareBuild` function in descending order. + +### Comparators + +* `intersects(comparator)`: Return true if the comparators intersect + +### Ranges + +* `validRange(range)`: Return the valid range or null if it's not valid. +* `satisfies(version, range)`: Return true if the version satisfies the + range. +* `maxSatisfying(versions, range)`: Return the highest version in the list + that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. +* `minVersion(range)`: Return the lowest version that can match + the given range. +* `gtr(version, range)`: Return `true` if the version is greater than all the + versions possible in the range. +* `ltr(version, range)`: Return `true` if the version is less than all the + versions possible in the range. +* `outside(version, range, hilo)`: Return true if the version is outside + the bounds of the range in either the high or low direction. The + `hilo` argument must be either the string `'>'` or `'<'`. (This is + the function called by `gtr` and `ltr`.) +* `intersects(range)`: Return true if any of the range comparators intersect. +* `simplifyRange(versions, range)`: Return a "simplified" range that + matches the same items in the `versions` list as the range specified. Note + that it does *not* guarantee that it would match the same versions in all + cases, only for the set of versions provided. This is useful when + generating ranges by joining together multiple versions with `||` + programmatically, to provide the user with something a bit more + ergonomic. If the provided range is shorter in string-length than the + generated range, then that is returned. +* `subset(subRange, superRange)`: Return `true` if the `subRange` range is + entirely contained by the `superRange` range. + +Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, *or* satisfy a range! For +example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` +until `2.0.0`, so version `1.2.10` would not be greater than the +range (because `2.0.1` satisfies, which is higher), nor less than the +range (since `1.2.8` satisfies, which is lower), and it also does not +satisfy the range. + +If you want to know if a version satisfies or does not satisfy a +range, use the `satisfies(version, range)` function. + +### Coercion + +* `coerce(version, options)`: Coerces a string to semver if possible + +This aims to provide a very forgiving translation of a non-semver string to +semver. It looks for the first digit in a string and consumes all +remaining characters which satisfy at least a partial semver (e.g., `1`, +`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer +versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All +surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes +`3.4.0`). Only text which lacks digits will fail coercion (`version one` +is not valid). The maximum length for any semver component considered for +coercion is 16 characters; longer components will be ignored +(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any +semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value +components are invalid (`9999999999999999.4.7.4` is likely invalid). + +If the `options.rtl` flag is set, then `coerce` will return the right-most +coercible tuple that does not share an ending index with a longer coercible +tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not +`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of +any other overlapping SemVer tuple. + +If the `options.includePrerelease` flag is set, then the `coerce` result will contain +prerelease and build parts of a version. For example, `1.2.3.4-rc.1+rev.2` +will preserve prerelease `rc.1` and build `rev.2` in the result. + +### Clean + +* `clean(version)`: Clean a string to be a valid semver if possible + +This will return a cleaned and trimmed semver version. If the provided +version is not valid a null will be returned. This does not work for +ranges. + +ex. +* `s.clean(' = v 2.1.5foo')`: `null` +* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean(' = v 2.1.5-foo')`: `null` +* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean('=v2.1.5')`: `'2.1.5'` +* `s.clean(' =v2.1.5')`: `'2.1.5'` +* `s.clean(' 2.1.5 ')`: `'2.1.5'` +* `s.clean('~1.0.0')`: `null` + +## Constants + +As a convenience, helper constants are exported to provide information about what `node-semver` supports: + +### `RELEASE_TYPES` + +- major +- premajor +- minor +- preminor +- patch +- prepatch +- prerelease + +``` +const semver = require('semver'); + +if (semver.RELEASE_TYPES.includes(arbitraryUserInput)) { + console.log('This is a valid release type!'); +} else { + console.warn('This is NOT a valid release type!'); +} +``` + +### `SEMVER_SPEC_VERSION` + +2.0.0 + +``` +const semver = require('semver'); + +console.log('We are currently using the semver specification version:', semver.SEMVER_SPEC_VERSION); +``` + +## Exported Modules + + + +You may pull in just the part of this semver utility that you need if you +are sensitive to packing and tree-shaking concerns. The main +`require('semver')` export uses getter functions to lazily load the parts +of the API that are used. + +The following modules are available: + +* `require('semver')` +* `require('semver/classes')` +* `require('semver/classes/comparator')` +* `require('semver/classes/range')` +* `require('semver/classes/semver')` +* `require('semver/functions/clean')` +* `require('semver/functions/cmp')` +* `require('semver/functions/coerce')` +* `require('semver/functions/compare')` +* `require('semver/functions/compare-build')` +* `require('semver/functions/compare-loose')` +* `require('semver/functions/diff')` +* `require('semver/functions/eq')` +* `require('semver/functions/gt')` +* `require('semver/functions/gte')` +* `require('semver/functions/inc')` +* `require('semver/functions/lt')` +* `require('semver/functions/lte')` +* `require('semver/functions/major')` +* `require('semver/functions/minor')` +* `require('semver/functions/neq')` +* `require('semver/functions/parse')` +* `require('semver/functions/patch')` +* `require('semver/functions/prerelease')` +* `require('semver/functions/rcompare')` +* `require('semver/functions/rsort')` +* `require('semver/functions/satisfies')` +* `require('semver/functions/sort')` +* `require('semver/functions/valid')` +* `require('semver/ranges/gtr')` +* `require('semver/ranges/intersects')` +* `require('semver/ranges/ltr')` +* `require('semver/ranges/max-satisfying')` +* `require('semver/ranges/min-satisfying')` +* `require('semver/ranges/min-version')` +* `require('semver/ranges/outside')` +* `require('semver/ranges/simplify')` +* `require('semver/ranges/subset')` +* `require('semver/ranges/to-comparators')` +* `require('semver/ranges/valid')` diff --git a/node/node_modules/npm/node_modules/semver/index.js b/node/node_modules/npm/node_modules/semver/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9e104429954de81c1966470c363d6e4aa3324eaf --- /dev/null +++ b/node/node_modules/npm/node_modules/semver/index.js @@ -0,0 +1,91 @@ +'use strict' + +// just pre-load all the stuff that index.js lazily exports +const internalRe = require('./internal/re') +const constants = require('./internal/constants') +const SemVer = require('./classes/semver') +const identifiers = require('./internal/identifiers') +const parse = require('./functions/parse') +const valid = require('./functions/valid') +const clean = require('./functions/clean') +const inc = require('./functions/inc') +const diff = require('./functions/diff') +const major = require('./functions/major') +const minor = require('./functions/minor') +const patch = require('./functions/patch') +const prerelease = require('./functions/prerelease') +const compare = require('./functions/compare') +const rcompare = require('./functions/rcompare') +const compareLoose = require('./functions/compare-loose') +const compareBuild = require('./functions/compare-build') +const sort = require('./functions/sort') +const rsort = require('./functions/rsort') +const gt = require('./functions/gt') +const lt = require('./functions/lt') +const eq = require('./functions/eq') +const neq = require('./functions/neq') +const gte = require('./functions/gte') +const lte = require('./functions/lte') +const cmp = require('./functions/cmp') +const coerce = require('./functions/coerce') +const Comparator = require('./classes/comparator') +const Range = require('./classes/range') +const satisfies = require('./functions/satisfies') +const toComparators = require('./ranges/to-comparators') +const maxSatisfying = require('./ranges/max-satisfying') +const minSatisfying = require('./ranges/min-satisfying') +const minVersion = require('./ranges/min-version') +const validRange = require('./ranges/valid') +const outside = require('./ranges/outside') +const gtr = require('./ranges/gtr') +const ltr = require('./ranges/ltr') +const intersects = require('./ranges/intersects') +const simplifyRange = require('./ranges/simplify') +const subset = require('./ranges/subset') +module.exports = { + parse, + valid, + clean, + inc, + diff, + major, + minor, + patch, + prerelease, + compare, + rcompare, + compareLoose, + compareBuild, + sort, + rsort, + gt, + lt, + eq, + neq, + gte, + lte, + cmp, + coerce, + Comparator, + Range, + satisfies, + toComparators, + maxSatisfying, + minSatisfying, + minVersion, + validRange, + outside, + gtr, + ltr, + intersects, + simplifyRange, + subset, + SemVer, + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, + RELEASE_TYPES: constants.RELEASE_TYPES, + compareIdentifiers: identifiers.compareIdentifiers, + rcompareIdentifiers: identifiers.rcompareIdentifiers, +} diff --git a/node/node_modules/npm/node_modules/semver/package.json b/node/node_modules/npm/node_modules/semver/package.json new file mode 100644 index 0000000000000000000000000000000000000000..4e7d147726043fe5fe161cb9ce5511b61a3acc5c --- /dev/null +++ b/node/node_modules/npm/node_modules/semver/package.json @@ -0,0 +1,78 @@ +{ + "name": "semver", + "version": "7.7.4", + "description": "The semantic version parser used by npm.", + "main": "index.js", + "scripts": { + "test": "tap", + "snap": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "posttest": "npm run lint", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "devDependencies": { + "@npmcli/eslint-config": "^6.0.0", + "@npmcli/template-oss": "4.29.0", + "benchmark": "^2.1.4", + "tap": "^16.0.0" + }, + "license": "ISC", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/node-semver.git" + }, + "bin": { + "semver": "bin/semver.js" + }, + "files": [ + "bin/", + "lib/", + "classes/", + "functions/", + "internal/", + "ranges/", + "index.js", + "preload.js", + "range.bnf" + ], + "tap": { + "timeout": 30, + "coverage-map": "map.js", + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "engines": { + "node": ">=10" + }, + "author": "GitHub Inc.", + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.29.0", + "engines": ">=10", + "distPaths": [ + "classes/", + "functions/", + "internal/", + "ranges/", + "index.js", + "preload.js", + "range.bnf" + ], + "allowPaths": [ + "/classes/", + "/functions/", + "/internal/", + "/ranges/", + "/index.js", + "/preload.js", + "/range.bnf", + "/benchmarks" + ], + "publish": "true" + } +} diff --git a/node/node_modules/npm/node_modules/semver/preload.js b/node/node_modules/npm/node_modules/semver/preload.js new file mode 100644 index 0000000000000000000000000000000000000000..06452d731a9cad89edbb3492b386945a5d2f2fe9 --- /dev/null +++ b/node/node_modules/npm/node_modules/semver/preload.js @@ -0,0 +1,4 @@ +'use strict' + +// XXX remove in v8 or beyond +module.exports = require('./index.js') diff --git a/node/node_modules/npm/node_modules/semver/range.bnf b/node/node_modules/npm/node_modules/semver/range.bnf new file mode 100644 index 0000000000000000000000000000000000000000..5cdca758ba1feab58f7e6efe69dd4c325ef4f933 --- /dev/null +++ b/node/node_modules/npm/node_modules/semver/range.bnf @@ -0,0 +1,16 @@ +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | [1-9] ( [0-9] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ diff --git a/node/node_modules/npm/node_modules/signal-exit/LICENSE.txt b/node/node_modules/npm/node_modules/signal-exit/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..57d38652ec5497abada98147c8aee2bc733f3f93 --- /dev/null +++ b/node/node_modules/npm/node_modules/signal-exit/LICENSE.txt @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) 2015-2023 Benjamin Coe, Isaac Z. Schlueter, and Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/signal-exit/package.json b/node/node_modules/npm/node_modules/signal-exit/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5ffdeb4b66785b01dc907aefd54d5f44214618a1 --- /dev/null +++ b/node/node_modules/npm/node_modules/signal-exit/package.json @@ -0,0 +1,106 @@ +{ + "name": "signal-exit", + "version": "4.1.0", + "description": "when you want to fire an event no matter how a process exits.", + "main": "./dist/cjs/index.js", + "module": "./dist/mjs/index.js", + "browser": "./dist/mjs/browser.js", + "types": "./dist/mjs/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/mjs/index.d.ts", + "default": "./dist/mjs/index.js" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.js" + } + }, + "./signals": { + "import": { + "types": "./dist/mjs/signals.d.ts", + "default": "./dist/mjs/signals.js" + }, + "require": { + "types": "./dist/cjs/signals.d.ts", + "default": "./dist/cjs/signals.js" + } + }, + "./browser": { + "import": { + "types": "./dist/mjs/browser.d.ts", + "default": "./dist/mjs/browser.js" + }, + "require": { + "types": "./dist/cjs/browser.d.ts", + "default": "./dist/cjs/browser.js" + } + } + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=14" + }, + "repository": { + "type": "git", + "url": "https://github.com/tapjs/signal-exit.git" + }, + "keywords": [ + "signal", + "exit" + ], + "author": "Ben Coe ", + "license": "ISC", + "devDependencies": { + "@types/cross-spawn": "^6.0.2", + "@types/node": "^18.15.11", + "@types/signal-exit": "^3.0.1", + "@types/tap": "^15.0.8", + "c8": "^7.13.0", + "prettier": "^2.8.6", + "tap": "^16.3.4", + "ts-node": "^10.9.1", + "typedoc": "^0.23.28", + "typescript": "^5.0.2" + }, + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "preprepare": "rm -rf dist", + "prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json && bash ./scripts/fixup.sh", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "c8 tap", + "snap": "c8 tap", + "format": "prettier --write . --loglevel warn", + "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts" + }, + "prettier": { + "semi": false, + "printWidth": 75, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "tap": { + "coverage": false, + "jobs": 1, + "node-arg": [ + "--no-warnings", + "--loader", + "ts-node/esm" + ], + "ts": false + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } +} diff --git a/node/node_modules/npm/node_modules/sigstore/LICENSE b/node/node_modules/npm/node_modules/sigstore/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c97e828593dac9f587741a6346aa5f398be39a44 --- /dev/null +++ b/node/node_modules/npm/node_modules/sigstore/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2023 The Sigstore Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node/node_modules/npm/node_modules/sigstore/package.json b/node/node_modules/npm/node_modules/sigstore/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5c177ba8b90b164d1254e520ed149a65ba2ad462 --- /dev/null +++ b/node/node_modules/npm/node_modules/sigstore/package.json @@ -0,0 +1,47 @@ +{ + "name": "sigstore", + "version": "4.1.0", + "description": "code-signing for npm packages", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "clean": "shx rm -rf dist *.tsbuildinfo", + "build": "tsc --build", + "test": "jest" + }, + "files": [ + "dist", + "store" + ], + "author": "bdehamer@github.com", + "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "git+https://github.com/sigstore/sigstore-js.git" + }, + "bugs": { + "url": "https://github.com/sigstore/sigstore-js/issues" + }, + "homepage": "https://github.com/sigstore/sigstore-js/tree/main/packages/client#readme", + "publishConfig": { + "provenance": true + }, + "devDependencies": { + "@sigstore/rekor-types": "^4.0.0", + "@sigstore/jest": "^0.0.0", + "@sigstore/mock": "^0.11.0", + "@tufjs/repo-mock": "^4.0.0", + "@types/make-fetch-happen": "^10.0.4" + }, + "dependencies": { + "@sigstore/bundle": "^4.0.0", + "@sigstore/core": "^3.1.0", + "@sigstore/protobuf-specs": "^0.5.0", + "@sigstore/sign": "^4.1.0", + "@sigstore/tuf": "^4.0.1", + "@sigstore/verify": "^3.1.0" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + } +} diff --git a/node/node_modules/npm/node_modules/smart-buffer/LICENSE b/node/node_modules/npm/node_modules/smart-buffer/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..59d0863316f3bf0f2375e6419c53401b019fd5fb --- /dev/null +++ b/node/node_modules/npm/node_modules/smart-buffer/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013-2017 Josh Glazebrook + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/smart-buffer/package.json b/node/node_modules/npm/node_modules/smart-buffer/package.json new file mode 100644 index 0000000000000000000000000000000000000000..70a55eb57c5a368086fdcfccefaa5a4748957eb0 --- /dev/null +++ b/node/node_modules/npm/node_modules/smart-buffer/package.json @@ -0,0 +1,79 @@ +{ + "name": "smart-buffer", + "version": "4.2.0", + "description": "smart-buffer is a Buffer wrapper that adds automatic read & write offset tracking, string operations, data insertions, and more.", + "main": "build/smartbuffer.js", + "contributors": ["syvita"], + "homepage": "https://github.com/JoshGlazebrook/smart-buffer/", + "repository": { + "type": "git", + "url": "https://github.com/JoshGlazebrook/smart-buffer.git" + }, + "bugs": { + "url": "https://github.com/JoshGlazebrook/smart-buffer/issues" + }, + "keywords": [ + "buffer", + "smart", + "packet", + "serialize", + "network", + "cursor", + "simple" + ], + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "author": "Josh Glazebrook", + "license": "MIT", + "readmeFilename": "README.md", + "devDependencies": { + "@types/chai": "4.1.7", + "@types/mocha": "5.2.7", + "@types/node": "^12.0.0", + "chai": "4.2.0", + "coveralls": "3.0.5", + "istanbul": "^0.4.5", + "mocha": "6.2.0", + "mocha-lcov-reporter": "^1.3.0", + "nyc": "14.1.1", + "source-map-support": "0.5.12", + "ts-node": "8.3.0", + "tslint": "5.18.0", + "typescript": "^3.2.1" + }, + "typings": "typings/smartbuffer.d.ts", + "dependencies": {}, + "scripts": { + "prepublish": "npm install -g typescript && npm run build", + "test": "NODE_ENV=test mocha --recursive --require ts-node/register test/**/*.ts", + "coverage": "NODE_ENV=test nyc npm test", + "coveralls": "NODE_ENV=test nyc npm test && nyc report --reporter=text-lcov | coveralls", + "lint": "tslint --type-check --project tsconfig.json 'src/**/*.ts'", + "build": "tsc -p ./" + }, + "nyc": { + "extension": [ + ".ts", + ".tsx" + ], + "include": [ + "src/*.ts", + "src/**/*.ts" + ], + "exclude": [ + "**.*.d.ts", + "node_modules", + "typings" + ], + "require": [ + "ts-node/register" + ], + "reporter": [ + "json", + "html" + ], + "all": true + } +} diff --git a/node/node_modules/npm/node_modules/socks-proxy-agent/LICENSE b/node/node_modules/npm/node_modules/socks-proxy-agent/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..614e769385ba807ca65acb9f19090eb02d6548fc --- /dev/null +++ b/node/node_modules/npm/node_modules/socks-proxy-agent/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2013 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/socks-proxy-agent/package.json b/node/node_modules/npm/node_modules/socks-proxy-agent/package.json new file mode 100644 index 0000000000000000000000000000000000000000..82dd89836b75291036bf3670784ce5cdeb535931 --- /dev/null +++ b/node/node_modules/npm/node_modules/socks-proxy-agent/package.json @@ -0,0 +1,142 @@ +{ + "name": "socks-proxy-agent", + "version": "8.0.5", + "description": "A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], + "author": { + "email": "nathan@tootallnate.net", + "name": "Nathan Rajlich", + "url": "http://n8.io/" + }, + "contributors": [ + { + "name": "Kiko Beats", + "email": "josefrancisco.verdu@gmail.com" + }, + { + "name": "Josh Glazebrook", + "email": "josh@joshglazebrook.com" + }, + { + "name": "talmobi", + "email": "talmobi@users.noreply.github.com" + }, + { + "name": "Indospace.io", + "email": "justin@indospace.io" + }, + { + "name": "Kilian von Pflugk", + "email": "github@jumoog.io" + }, + { + "name": "Kyle", + "email": "admin@hk1229.cn" + }, + { + "name": "Matheus Fernandes", + "email": "matheus.frndes@gmail.com" + }, + { + "name": "Ricky Miller", + "email": "richardkazuomiller@gmail.com" + }, + { + "name": "Shantanu Sharma", + "email": "shantanu34@outlook.com" + }, + { + "name": "Tim Perry", + "email": "pimterry@gmail.com" + }, + { + "name": "Vadim Baryshev", + "email": "vadimbaryshev@gmail.com" + }, + { + "name": "jigu", + "email": "luo1257857309@gmail.com" + }, + { + "name": "Alba Mendez", + "email": "me@jmendeth.com" + }, + { + "name": "Дмитрий Гуденков", + "email": "Dimangud@rambler.ru" + }, + { + "name": "Andrei Bitca", + "email": "63638922+andrei-bitca-dc@users.noreply.github.com" + }, + { + "name": "Andrew Casey", + "email": "amcasey@users.noreply.github.com" + }, + { + "name": "Brandon Ros", + "email": "brandonros1@gmail.com" + }, + { + "name": "Dang Duy Thanh", + "email": "thanhdd.it@gmail.com" + }, + { + "name": "Dimitar Nestorov", + "email": "8790386+dimitarnestorov@users.noreply.github.com" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/TooTallNate/proxy-agents.git", + "directory": "packages/socks-proxy-agent" + }, + "keywords": [ + "agent", + "http", + "https", + "proxy", + "socks", + "socks4", + "socks4a", + "socks5", + "socks5h" + ], + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "devDependencies": { + "@types/async-retry": "^1.4.5", + "@types/debug": "^4.1.7", + "@types/dns2": "^2.0.3", + "@types/jest": "^29.5.1", + "@types/node": "^14.18.45", + "async-listen": "^3.0.0", + "async-retry": "^1.3.3", + "cacheable-lookup": "^6.1.0", + "dns2": "^2.1.0", + "jest": "^29.5.0", + "socksv5": "github:TooTallNate/socksv5#fix/dstSock-close-event", + "ts-jest": "^29.1.0", + "typescript": "^5.0.4", + "proxy": "2.2.0", + "tsconfig": "0.0.0" + }, + "engines": { + "node": ">= 14" + }, + "license": "MIT", + "scripts": { + "build": "tsc", + "test": "jest --env node --verbose --bail test/test.ts", + "test-e2e": "jest --env node --verbose --bail test/e2e.test.ts", + "lint": "eslint . --ext .ts", + "pack": "node ../../scripts/pack.mjs" + } +} \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/socks/LICENSE b/node/node_modules/npm/node_modules/socks/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c770283d879bfa492a861bb77c81bfb8b65d391d --- /dev/null +++ b/node/node_modules/npm/node_modules/socks/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013 Josh Glazebrook + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/socks/package.json b/node/node_modules/npm/node_modules/socks/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3f964c29ce863b28137769f9fa1b2aff5e2e56e0 --- /dev/null +++ b/node/node_modules/npm/node_modules/socks/package.json @@ -0,0 +1,58 @@ +{ + "name": "socks", + "private": false, + "version": "2.8.7", + "description": "Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality.", + "main": "build/index.js", + "typings": "typings/index.d.ts", + "homepage": "https://github.com/JoshGlazebrook/socks/", + "repository": { + "type": "git", + "url": "https://github.com/JoshGlazebrook/socks.git" + }, + "bugs": { + "url": "https://github.com/JoshGlazebrook/socks/issues" + }, + "keywords": [ + "socks", + "proxy", + "tor", + "socks 4", + "socks 5", + "socks4", + "socks5" + ], + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + }, + "author": "Josh Glazebrook", + "contributors": [ + "castorw" + ], + "license": "MIT", + "readmeFilename": "README.md", + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "^20.11.17", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", + "eslint": "^8.20.0", + "mocha": "^10.0.0", + "prettier": "^3.2.5", + "ts-node": "^10.9.1", + "typescript": "^5.3.3" + }, + "dependencies": { + "ip-address": "^10.0.1", + "smart-buffer": "^4.2.0" + }, + "scripts": { + "prepublish": "npm install -g typescript && npm run build", + "test": "NODE_ENV=test mocha --recursive --require ts-node/register test/**/*.ts", + "prettier": "prettier --write ./src/**/*.ts --config .prettierrc.yaml", + "lint": "eslint 'src/**/*.ts'", + "build": "rm -rf build typings && prettier --write ./src/**/*.ts --config .prettierrc.yaml && tsc -p .", + "build-raw": "rm -rf build typings && tsc -p ." + } +} diff --git a/node/node_modules/npm/node_modules/spdx-exceptions/deprecated.json b/node/node_modules/npm/node_modules/spdx-exceptions/deprecated.json new file mode 100644 index 0000000000000000000000000000000000000000..7692a3de8288115169ae898661e3ba1a0cb6ef39 --- /dev/null +++ b/node/node_modules/npm/node_modules/spdx-exceptions/deprecated.json @@ -0,0 +1,3 @@ +[ + "Nokia-Qt-exception-1.1" +] diff --git a/node/node_modules/npm/node_modules/spdx-exceptions/index.json b/node/node_modules/npm/node_modules/spdx-exceptions/index.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6fc828434da57f69727eafe40f872dde1910c9 --- /dev/null +++ b/node/node_modules/npm/node_modules/spdx-exceptions/index.json @@ -0,0 +1,68 @@ +[ + "389-exception", + "Asterisk-exception", + "Autoconf-exception-2.0", + "Autoconf-exception-3.0", + "Autoconf-exception-generic", + "Autoconf-exception-generic-3.0", + "Autoconf-exception-macro", + "Bison-exception-1.24", + "Bison-exception-2.2", + "Bootloader-exception", + "Classpath-exception-2.0", + "CLISP-exception-2.0", + "cryptsetup-OpenSSL-exception", + "DigiRule-FOSS-exception", + "eCos-exception-2.0", + "Fawkes-Runtime-exception", + "FLTK-exception", + "fmt-exception", + "Font-exception-2.0", + "freertos-exception-2.0", + "GCC-exception-2.0", + "GCC-exception-2.0-note", + "GCC-exception-3.1", + "Gmsh-exception", + "GNAT-exception", + "GNOME-examples-exception", + "GNU-compiler-exception", + "gnu-javamail-exception", + "GPL-3.0-interface-exception", + "GPL-3.0-linking-exception", + "GPL-3.0-linking-source-exception", + "GPL-CC-1.0", + "GStreamer-exception-2005", + "GStreamer-exception-2008", + "i2p-gpl-java-exception", + "KiCad-libraries-exception", + "LGPL-3.0-linking-exception", + "libpri-OpenH323-exception", + "Libtool-exception", + "Linux-syscall-note", + "LLGPL", + "LLVM-exception", + "LZMA-exception", + "mif-exception", + "OCaml-LGPL-linking-exception", + "OCCT-exception-1.0", + "OpenJDK-assembly-exception-1.0", + "openvpn-openssl-exception", + "PS-or-PDF-font-exception-20170817", + "QPL-1.0-INRIA-2004-exception", + "Qt-GPL-exception-1.0", + "Qt-LGPL-exception-1.1", + "Qwt-exception-1.0", + "SANE-exception", + "SHL-2.0", + "SHL-2.1", + "stunnel-exception", + "SWI-exception", + "Swift-exception", + "Texinfo-exception", + "u-boot-exception-2.0", + "UBDL-exception", + "Universal-FOSS-exception-1.0", + "vsftpd-openssl-exception", + "WxWindows-exception-3.1", + "x11vnc-openssl-exception" +] diff --git a/node/node_modules/npm/node_modules/spdx-exceptions/package.json b/node/node_modules/npm/node_modules/spdx-exceptions/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1df4240bef345a0ec793adda620cb5a3d4e4d245 --- /dev/null +++ b/node/node_modules/npm/node_modules/spdx-exceptions/package.json @@ -0,0 +1,19 @@ +{ + "name": "spdx-exceptions", + "description": "list of SPDX standard license exceptions", + "version": "2.5.0", + "author": "The Linux Foundation", + "contributors": [ + "Kyle E. Mitchell (https://kemitchell.com/)" + ], + "license": "CC-BY-3.0", + "repository": "kemitchell/spdx-exceptions.json", + "files": [ + "index.json", + "deprecated.json" + ], + "scripts": { + "build": "node build.js", + "latest": "node latest.js" + } +} diff --git a/node/node_modules/npm/node_modules/spdx-expression-parse/AUTHORS b/node/node_modules/npm/node_modules/spdx-expression-parse/AUTHORS new file mode 100644 index 0000000000000000000000000000000000000000..c720ac4f0c366487ee14422695c1667c57a18eab --- /dev/null +++ b/node/node_modules/npm/node_modules/spdx-expression-parse/AUTHORS @@ -0,0 +1,4 @@ +C. Scott Ananian (http://cscott.net) +Kyle E. Mitchell (https://kemitchell.com) +Shinnosuke Watanabe +Antoine Motet diff --git a/node/node_modules/npm/node_modules/spdx-expression-parse/LICENSE b/node/node_modules/npm/node_modules/spdx-expression-parse/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..100ec0c95f1d87e0ea5bb933af2ba95574914ea6 --- /dev/null +++ b/node/node_modules/npm/node_modules/spdx-expression-parse/LICENSE @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2015 Kyle E. Mitchell & other authors listed in AUTHORS + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/spdx-expression-parse/index.js b/node/node_modules/npm/node_modules/spdx-expression-parse/index.js new file mode 100644 index 0000000000000000000000000000000000000000..fcc05b1e743438d9578bd9acdce35933446ad820 --- /dev/null +++ b/node/node_modules/npm/node_modules/spdx-expression-parse/index.js @@ -0,0 +1,8 @@ +'use strict' + +var scan = require('./scan') +var parse = require('./parse') + +module.exports = function (source) { + return parse(scan(source)) +} diff --git a/node/node_modules/npm/node_modules/spdx-expression-parse/package.json b/node/node_modules/npm/node_modules/spdx-expression-parse/package.json new file mode 100644 index 0000000000000000000000000000000000000000..45cbc3dc62dbc69ff283ca04f6dd3f3d201c592b --- /dev/null +++ b/node/node_modules/npm/node_modules/spdx-expression-parse/package.json @@ -0,0 +1,39 @@ +{ + "name": "spdx-expression-parse", + "description": "parse SPDX license expressions", + "version": "4.0.0", + "author": "Kyle E. Mitchell (https://kemitchell.com)", + "files": [ + "AUTHORS", + "index.js", + "parse.js", + "scan.js" + ], + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + }, + "devDependencies": { + "defence-cli": "^3.0.1", + "replace-require-self": "^1.0.0", + "standard": "^14.1.0" + }, + "keywords": [ + "SPDX", + "law", + "legal", + "license", + "metadata", + "package", + "package.json", + "standards" + ], + "license": "MIT", + "repository": "jslicense/spdx-expression-parse.js", + "scripts": { + "lint": "standard", + "test:readme": "defence -i javascript README.md | replace-require-self | node", + "test:suite": "node test.js", + "test": "npm run test:suite && npm run test:readme" + } +} diff --git a/node/node_modules/npm/node_modules/spdx-expression-parse/parse.js b/node/node_modules/npm/node_modules/spdx-expression-parse/parse.js new file mode 100644 index 0000000000000000000000000000000000000000..3b5b52bb28257f1ffe5df1a49360d0a9701c4a29 --- /dev/null +++ b/node/node_modules/npm/node_modules/spdx-expression-parse/parse.js @@ -0,0 +1,138 @@ +'use strict' + +// The ABNF grammar in the spec is totally ambiguous. +// +// This parser follows the operator precedence defined in the +// `Order of Precedence and Parentheses` section. + +module.exports = function (tokens) { + var index = 0 + + function hasMore () { + return index < tokens.length + } + + function token () { + return hasMore() ? tokens[index] : null + } + + function next () { + if (!hasMore()) { + throw new Error() + } + index++ + } + + function parseOperator (operator) { + var t = token() + if (t && t.type === 'OPERATOR' && operator === t.string) { + next() + return t.string + } + } + + function parseWith () { + if (parseOperator('WITH')) { + var t = token() + if (t && t.type === 'EXCEPTION') { + next() + return t.string + } + throw new Error('Expected exception after `WITH`') + } + } + + function parseLicenseRef () { + // TODO: Actually, everything is concatenated into one string + // for backward-compatibility but it could be better to return + // a nice structure. + var begin = index + var string = '' + var t = token() + if (t.type === 'DOCUMENTREF') { + next() + string += 'DocumentRef-' + t.string + ':' + if (!parseOperator(':')) { + throw new Error('Expected `:` after `DocumentRef-...`') + } + } + t = token() + if (t.type === 'LICENSEREF') { + next() + string += 'LicenseRef-' + t.string + return { license: string } + } + index = begin + } + + function parseLicense () { + var t = token() + if (t && t.type === 'LICENSE') { + next() + var node = { license: t.string } + if (parseOperator('+')) { + node.plus = true + } + var exception = parseWith() + if (exception) { + node.exception = exception + } + return node + } + } + + function parseParenthesizedExpression () { + var left = parseOperator('(') + if (!left) { + return + } + + var expr = parseExpression() + + if (!parseOperator(')')) { + throw new Error('Expected `)`') + } + + return expr + } + + function parseAtom () { + return ( + parseParenthesizedExpression() || + parseLicenseRef() || + parseLicense() + ) + } + + function makeBinaryOpParser (operator, nextParser) { + return function parseBinaryOp () { + var left = nextParser() + if (!left) { + return + } + + if (!parseOperator(operator)) { + return left + } + + var right = parseBinaryOp() + if (!right) { + throw new Error('Expected expression') + } + return { + left: left, + conjunction: operator.toLowerCase(), + right: right + } + } + } + + var parseAnd = makeBinaryOpParser('AND', parseAtom) + var parseExpression = makeBinaryOpParser('OR', parseAnd) + + var node = parseExpression() + if (!node || hasMore()) { + throw new Error('Syntax error') + } + return node +} diff --git a/node/node_modules/npm/node_modules/spdx-expression-parse/scan.js b/node/node_modules/npm/node_modules/spdx-expression-parse/scan.js new file mode 100644 index 0000000000000000000000000000000000000000..2be9d2cb0acb21584687e7fa3df4572ed7b14812 --- /dev/null +++ b/node/node_modules/npm/node_modules/spdx-expression-parse/scan.js @@ -0,0 +1,131 @@ +'use strict' + +var licenses = [] + .concat(require('spdx-license-ids')) + .concat(require('spdx-license-ids/deprecated')) +var exceptions = require('spdx-exceptions') + +module.exports = function (source) { + var index = 0 + + function hasMore () { + return index < source.length + } + + // `value` can be a regexp or a string. + // If it is recognized, the matching source string is returned and + // the index is incremented. Otherwise `undefined` is returned. + function read (value) { + if (value instanceof RegExp) { + var chars = source.slice(index) + var match = chars.match(value) + if (match) { + index += match[0].length + return match[0] + } + } else { + if (source.indexOf(value, index) === index) { + index += value.length + return value + } + } + } + + function skipWhitespace () { + read(/[ ]*/) + } + + function operator () { + var string + var possibilities = [/^WITH/i, /^AND/i, /^OR/i, '(', ')', ':', '+'] + for (var i = 0; i < possibilities.length; i++) { + string = read(possibilities[i]) + if (string) { + break + } + } + + if (string === '+' && index > 1 && source[index - 2] === ' ') { + throw new Error('Space before `+`') + } + + return string && { + type: 'OPERATOR', + string: string.toUpperCase() + } + } + + function idstring () { + return read(/[A-Za-z0-9-.]+/) + } + + function expectIdstring () { + var string = idstring() + if (!string) { + throw new Error('Expected idstring at offset ' + index) + } + return string + } + + function documentRef () { + if (read('DocumentRef-')) { + var string = expectIdstring() + return { type: 'DOCUMENTREF', string: string } + } + } + + function licenseRef () { + if (read('LicenseRef-')) { + var string = expectIdstring() + return { type: 'LICENSEREF', string: string } + } + } + + function identifier () { + var begin = index + var string = idstring() + + if (licenses.indexOf(string) !== -1) { + return { + type: 'LICENSE', + string: string + } + } else if (exceptions.indexOf(string) !== -1) { + return { + type: 'EXCEPTION', + string: string + } + } + + index = begin + } + + // Tries to read the next token. Returns `undefined` if no token is + // recognized. + function parseToken () { + // Ordering matters + return ( + operator() || + documentRef() || + licenseRef() || + identifier() + ) + } + + var tokens = [] + while (hasMore()) { + skipWhitespace() + if (!hasMore()) { + break + } + + var token = parseToken() + if (!token) { + throw new Error('Unexpected `' + source[index] + + '` at offset ' + index) + } + + tokens.push(token) + } + return tokens +} diff --git a/node/node_modules/npm/node_modules/spdx-license-ids/deprecated.json b/node/node_modules/npm/node_modules/spdx-license-ids/deprecated.json new file mode 100644 index 0000000000000000000000000000000000000000..ddfd013218a4672497e7460cb4dfd9557e6f378b --- /dev/null +++ b/node/node_modules/npm/node_modules/spdx-license-ids/deprecated.json @@ -0,0 +1,28 @@ +[ + "AGPL-1.0", + "AGPL-3.0", + "BSD-2-Clause-FreeBSD", + "BSD-2-Clause-NetBSD", + "GFDL-1.1", + "GFDL-1.2", + "GFDL-1.3", + "GPL-1.0", + "GPL-2.0", + "GPL-2.0-with-GCC-exception", + "GPL-2.0-with-autoconf-exception", + "GPL-2.0-with-bison-exception", + "GPL-2.0-with-classpath-exception", + "GPL-2.0-with-font-exception", + "GPL-3.0", + "GPL-3.0-with-GCC-exception", + "GPL-3.0-with-autoconf-exception", + "LGPL-2.0", + "LGPL-2.1", + "LGPL-3.0", + "Net-SNMP", + "Nunit", + "StandardML-NJ", + "bzip2-1.0.5", + "eCos-2.0", + "wxWindows" +] diff --git a/node/node_modules/npm/node_modules/spdx-license-ids/index.json b/node/node_modules/npm/node_modules/spdx-license-ids/index.json new file mode 100644 index 0000000000000000000000000000000000000000..38a002914b71339172833eb030a74beebac29d7b --- /dev/null +++ b/node/node_modules/npm/node_modules/spdx-license-ids/index.json @@ -0,0 +1,697 @@ +[ + "0BSD", + "3D-Slicer-1.0", + "AAL", + "ADSL", + "AFL-1.1", + "AFL-1.2", + "AFL-2.0", + "AFL-2.1", + "AFL-3.0", + "AGPL-1.0-only", + "AGPL-1.0-or-later", + "AGPL-3.0-only", + "AGPL-3.0-or-later", + "ALGLIB-Documentation", + "AMD-newlib", + "AMDPLPA", + "AML", + "AML-glslang", + "AMPAS", + "ANTLR-PD", + "ANTLR-PD-fallback", + "APAFML", + "APL-1.0", + "APSL-1.0", + "APSL-1.1", + "APSL-1.2", + "APSL-2.0", + "ASWF-Digital-Assets-1.0", + "ASWF-Digital-Assets-1.1", + "Abstyles", + "AdaCore-doc", + "Adobe-2006", + "Adobe-Display-PostScript", + "Adobe-Glyph", + "Adobe-Utopia", + "Advanced-Cryptics-Dictionary", + "Afmparse", + "Aladdin", + "Apache-1.0", + "Apache-1.1", + "Apache-2.0", + "App-s2p", + "Arphic-1999", + "Artistic-1.0", + "Artistic-1.0-Perl", + "Artistic-1.0-cl8", + "Artistic-2.0", + "Artistic-dist", + "Aspell-RU", + "BOLA-1.1", + "BSD-1-Clause", + "BSD-2-Clause", + "BSD-2-Clause-Darwin", + "BSD-2-Clause-Patent", + "BSD-2-Clause-Views", + "BSD-2-Clause-first-lines", + "BSD-2-Clause-pkgconf-disclaimer", + "BSD-3-Clause", + "BSD-3-Clause-Attribution", + "BSD-3-Clause-Clear", + "BSD-3-Clause-HP", + "BSD-3-Clause-LBNL", + "BSD-3-Clause-Modification", + "BSD-3-Clause-No-Military-License", + "BSD-3-Clause-No-Nuclear-License", + "BSD-3-Clause-No-Nuclear-License-2014", + "BSD-3-Clause-No-Nuclear-Warranty", + "BSD-3-Clause-Open-MPI", + "BSD-3-Clause-Sun", + "BSD-3-Clause-Tso", + "BSD-3-Clause-acpica", + "BSD-3-Clause-flex", + "BSD-4-Clause", + "BSD-4-Clause-Shortened", + "BSD-4-Clause-UC", + "BSD-4.3RENO", + "BSD-4.3TAHOE", + "BSD-Advertising-Acknowledgement", + "BSD-Attribution-HPND-disclaimer", + "BSD-Inferno-Nettverk", + "BSD-Mark-Modifications", + "BSD-Protection", + "BSD-Source-Code", + "BSD-Source-beginning-file", + "BSD-Systemics", + "BSD-Systemics-W3Works", + "BSL-1.0", + "BUSL-1.1", + "Baekmuk", + "Bahyph", + "Barr", + "Beerware", + "BitTorrent-1.0", + "BitTorrent-1.1", + "Bitstream-Charter", + "Bitstream-Vera", + "BlueOak-1.0.0", + "Boehm-GC", + "Boehm-GC-without-fee", + "Borceux", + "Brian-Gladman-2-Clause", + "Brian-Gladman-3-Clause", + "Buddy", + "C-UDA-1.0", + "CAL-1.0", + "CAL-1.0-Combined-Work-Exception", + "CAPEC-tou", + "CATOSL-1.1", + "CC-BY-1.0", + "CC-BY-2.0", + "CC-BY-2.5", + "CC-BY-2.5-AU", + "CC-BY-3.0", + "CC-BY-3.0-AT", + "CC-BY-3.0-AU", + "CC-BY-3.0-DE", + "CC-BY-3.0-IGO", + "CC-BY-3.0-NL", + "CC-BY-3.0-US", + "CC-BY-4.0", + "CC-BY-NC-1.0", + "CC-BY-NC-2.0", + "CC-BY-NC-2.5", + "CC-BY-NC-3.0", + "CC-BY-NC-3.0-DE", + "CC-BY-NC-4.0", + "CC-BY-NC-ND-1.0", + "CC-BY-NC-ND-2.0", + "CC-BY-NC-ND-2.5", + "CC-BY-NC-ND-3.0", + "CC-BY-NC-ND-3.0-DE", + "CC-BY-NC-ND-3.0-IGO", + "CC-BY-NC-ND-4.0", + "CC-BY-NC-SA-1.0", + "CC-BY-NC-SA-2.0", + "CC-BY-NC-SA-2.0-DE", + "CC-BY-NC-SA-2.0-FR", + "CC-BY-NC-SA-2.0-UK", + "CC-BY-NC-SA-2.5", + "CC-BY-NC-SA-3.0", + "CC-BY-NC-SA-3.0-DE", + "CC-BY-NC-SA-3.0-IGO", + "CC-BY-NC-SA-4.0", + "CC-BY-ND-1.0", + "CC-BY-ND-2.0", + "CC-BY-ND-2.5", + "CC-BY-ND-3.0", + "CC-BY-ND-3.0-DE", + "CC-BY-ND-4.0", + "CC-BY-SA-1.0", + "CC-BY-SA-2.0", + "CC-BY-SA-2.0-UK", + "CC-BY-SA-2.1-JP", + "CC-BY-SA-2.5", + "CC-BY-SA-3.0", + "CC-BY-SA-3.0-AT", + "CC-BY-SA-3.0-DE", + "CC-BY-SA-3.0-IGO", + "CC-BY-SA-4.0", + "CC-PDDC", + "CC-PDM-1.0", + "CC-SA-1.0", + "CC0-1.0", + "CDDL-1.0", + "CDDL-1.1", + "CDL-1.0", + "CDLA-Permissive-1.0", + "CDLA-Permissive-2.0", + "CDLA-Sharing-1.0", + "CECILL-1.0", + "CECILL-1.1", + "CECILL-2.0", + "CECILL-2.1", + "CECILL-B", + "CECILL-C", + "CERN-OHL-1.1", + "CERN-OHL-1.2", + "CERN-OHL-P-2.0", + "CERN-OHL-S-2.0", + "CERN-OHL-W-2.0", + "CFITSIO", + "CMU-Mach", + "CMU-Mach-nodoc", + "CNRI-Jython", + "CNRI-Python", + "CNRI-Python-GPL-Compatible", + "COIL-1.0", + "CPAL-1.0", + "CPL-1.0", + "CPOL-1.02", + "CUA-OPL-1.0", + "Caldera", + "Caldera-no-preamble", + "Catharon", + "ClArtistic", + "Clips", + "Community-Spec-1.0", + "Condor-1.1", + "Cornell-Lossless-JPEG", + "Cronyx", + "Crossword", + "CryptoSwift", + "CrystalStacker", + "Cube", + "D-FSL-1.0", + "DEC-3-Clause", + "DL-DE-BY-2.0", + "DL-DE-ZERO-2.0", + "DOC", + "DRL-1.0", + "DRL-1.1", + "DSDP", + "DocBook-DTD", + "DocBook-Schema", + "DocBook-Stylesheet", + "DocBook-XML", + "Dotseqn", + "ECL-1.0", + "ECL-2.0", + "EFL-1.0", + "EFL-2.0", + "EPICS", + "EPL-1.0", + "EPL-2.0", + "ESA-PL-permissive-2.4", + "ESA-PL-strong-copyleft-2.4", + "ESA-PL-weak-copyleft-2.4", + "EUDatagrid", + "EUPL-1.0", + "EUPL-1.1", + "EUPL-1.2", + "Elastic-2.0", + "Entessa", + "ErlPL-1.1", + "Eurosym", + "FBM", + "FDK-AAC", + "FSFAP", + "FSFAP-no-warranty-disclaimer", + "FSFUL", + "FSFULLR", + "FSFULLRSD", + "FSFULLRWD", + "FSL-1.1-ALv2", + "FSL-1.1-MIT", + "FTL", + "Fair", + "Ferguson-Twofish", + "Frameworx-1.0", + "FreeBSD-DOC", + "FreeImage", + "Furuseth", + "GCR-docs", + "GD", + "GFDL-1.1-invariants-only", + "GFDL-1.1-invariants-or-later", + "GFDL-1.1-no-invariants-only", + "GFDL-1.1-no-invariants-or-later", + "GFDL-1.1-only", + "GFDL-1.1-or-later", + "GFDL-1.2-invariants-only", + "GFDL-1.2-invariants-or-later", + "GFDL-1.2-no-invariants-only", + "GFDL-1.2-no-invariants-or-later", + "GFDL-1.2-only", + "GFDL-1.2-or-later", + "GFDL-1.3-invariants-only", + "GFDL-1.3-invariants-or-later", + "GFDL-1.3-no-invariants-only", + "GFDL-1.3-no-invariants-or-later", + "GFDL-1.3-only", + "GFDL-1.3-or-later", + "GL2PS", + "GLWTPL", + "GPL-1.0-only", + "GPL-1.0-or-later", + "GPL-2.0-only", + "GPL-2.0-or-later", + "GPL-3.0-only", + "GPL-3.0-or-later", + "Game-Programming-Gems", + "Giftware", + "Glide", + "Glulxe", + "Graphics-Gems", + "Gutmann", + "HDF5", + "HIDAPI", + "HP-1986", + "HP-1989", + "HPND", + "HPND-DEC", + "HPND-Fenneberg-Livingston", + "HPND-INRIA-IMAG", + "HPND-Intel", + "HPND-Kevlin-Henney", + "HPND-MIT-disclaimer", + "HPND-Markus-Kuhn", + "HPND-Netrek", + "HPND-Pbmplus", + "HPND-SMC", + "HPND-UC", + "HPND-UC-export-US", + "HPND-doc", + "HPND-doc-sell", + "HPND-export-US", + "HPND-export-US-acknowledgement", + "HPND-export-US-modify", + "HPND-export2-US", + "HPND-merchantability-variant", + "HPND-sell-MIT-disclaimer-xserver", + "HPND-sell-regexpr", + "HPND-sell-variant", + "HPND-sell-variant-MIT-disclaimer", + "HPND-sell-variant-MIT-disclaimer-rev", + "HPND-sell-variant-critical-systems", + "HTMLTIDY", + "HaskellReport", + "Hippocratic-2.1", + "IBM-pibs", + "ICU", + "IEC-Code-Components-EULA", + "IJG", + "IJG-short", + "IPA", + "IPL-1.0", + "ISC", + "ISC-Veillard", + "ISO-permission", + "ImageMagick", + "Imlib2", + "Info-ZIP", + "Inner-Net-2.0", + "InnoSetup", + "Intel", + "Intel-ACPI", + "Interbase-1.0", + "JPL-image", + "JPNIC", + "JSON", + "Jam", + "JasPer-2.0", + "Kastrup", + "Kazlib", + "Knuth-CTAN", + "LAL-1.2", + "LAL-1.3", + "LGPL-2.0-only", + "LGPL-2.0-or-later", + "LGPL-2.1-only", + "LGPL-2.1-or-later", + "LGPL-3.0-only", + "LGPL-3.0-or-later", + "LGPLLR", + "LOOP", + "LPD-document", + "LPL-1.0", + "LPL-1.02", + "LPPL-1.0", + "LPPL-1.1", + "LPPL-1.2", + "LPPL-1.3a", + "LPPL-1.3c", + "LZMA-SDK-9.11-to-9.20", + "LZMA-SDK-9.22", + "Latex2e", + "Latex2e-translated-notice", + "Leptonica", + "LiLiQ-P-1.1", + "LiLiQ-R-1.1", + "LiLiQ-Rplus-1.1", + "Libpng", + "Linux-OpenIB", + "Linux-man-pages-1-para", + "Linux-man-pages-copyleft", + "Linux-man-pages-copyleft-2-para", + "Linux-man-pages-copyleft-var", + "Lucida-Bitmap-Fonts", + "MIPS", + "MIT", + "MIT-0", + "MIT-CMU", + "MIT-Click", + "MIT-Festival", + "MIT-Khronos-old", + "MIT-Modern-Variant", + "MIT-STK", + "MIT-Wu", + "MIT-advertising", + "MIT-enna", + "MIT-feh", + "MIT-open-group", + "MIT-testregex", + "MITNFA", + "MMIXware", + "MMPL-1.0.1", + "MPEG-SSG", + "MPL-1.0", + "MPL-1.1", + "MPL-2.0", + "MPL-2.0-no-copyleft-exception", + "MS-LPL", + "MS-PL", + "MS-RL", + "MTLL", + "Mackerras-3-Clause", + "Mackerras-3-Clause-acknowledgment", + "MakeIndex", + "Martin-Birgmeier", + "McPhee-slideshow", + "Minpack", + "MirOS", + "Motosoto", + "MulanPSL-1.0", + "MulanPSL-2.0", + "Multics", + "Mup", + "NAIST-2003", + "NASA-1.3", + "NBPL-1.0", + "NCBI-PD", + "NCGL-UK-2.0", + "NCL", + "NCSA", + "NGPL", + "NICTA-1.0", + "NIST-PD", + "NIST-PD-TNT", + "NIST-PD-fallback", + "NIST-Software", + "NLOD-1.0", + "NLOD-2.0", + "NLPL", + "NOSL", + "NPL-1.0", + "NPL-1.1", + "NPOSL-3.0", + "NRL", + "NTIA-PD", + "NTP", + "NTP-0", + "Naumen", + "NetCDF", + "Newsletr", + "Nokia", + "Noweb", + "O-UDA-1.0", + "OAR", + "OCCT-PL", + "OCLC-2.0", + "ODC-By-1.0", + "ODbL-1.0", + "OFFIS", + "OFL-1.0", + "OFL-1.0-RFN", + "OFL-1.0-no-RFN", + "OFL-1.1", + "OFL-1.1-RFN", + "OFL-1.1-no-RFN", + "OGC-1.0", + "OGDL-Taiwan-1.0", + "OGL-Canada-2.0", + "OGL-UK-1.0", + "OGL-UK-2.0", + "OGL-UK-3.0", + "OGTSL", + "OLDAP-1.1", + "OLDAP-1.2", + "OLDAP-1.3", + "OLDAP-1.4", + "OLDAP-2.0", + "OLDAP-2.0.1", + "OLDAP-2.1", + "OLDAP-2.2", + "OLDAP-2.2.1", + "OLDAP-2.2.2", + "OLDAP-2.3", + "OLDAP-2.4", + "OLDAP-2.5", + "OLDAP-2.6", + "OLDAP-2.7", + "OLDAP-2.8", + "OLFL-1.3", + "OML", + "OPL-1.0", + "OPL-UK-3.0", + "OPUBL-1.0", + "OSC-1.0", + "OSET-PL-2.1", + "OSL-1.0", + "OSL-1.1", + "OSL-2.0", + "OSL-2.1", + "OSL-3.0", + "OSSP", + "OpenMDW-1.0", + "OpenPBS-2.3", + "OpenSSL", + "OpenSSL-standalone", + "OpenVision", + "PADL", + "PDDL-1.0", + "PHP-3.0", + "PHP-3.01", + "PPL", + "PSF-2.0", + "ParaType-Free-Font-1.3", + "Parity-6.0.0", + "Parity-7.0.0", + "Pixar", + "Plexus", + "PolyForm-Noncommercial-1.0.0", + "PolyForm-Small-Business-1.0.0", + "PostgreSQL", + "Python-2.0", + "Python-2.0.1", + "QPL-1.0", + "QPL-1.0-INRIA-2004", + "Qhull", + "RHeCos-1.1", + "RPL-1.1", + "RPL-1.5", + "RPSL-1.0", + "RSA-MD", + "RSCPL", + "Rdisc", + "Ruby", + "Ruby-pty", + "SAX-PD", + "SAX-PD-2.0", + "SCEA", + "SGI-B-1.0", + "SGI-B-1.1", + "SGI-B-2.0", + "SGI-OpenGL", + "SGMLUG-PM", + "SGP4", + "SHL-0.5", + "SHL-0.51", + "SISSL", + "SISSL-1.2", + "SL", + "SMAIL-GPL", + "SMLNJ", + "SMPPL", + "SNIA", + "SOFA", + "SPL-1.0", + "SSH-OpenSSH", + "SSH-short", + "SSLeay-standalone", + "SSPL-1.0", + "SUL-1.0", + "SWL", + "Saxpath", + "SchemeReport", + "Sendmail", + "Sendmail-8.23", + "Sendmail-Open-Source-1.1", + "SimPL-2.0", + "Sleepycat", + "Soundex", + "Spencer-86", + "Spencer-94", + "Spencer-99", + "SugarCRM-1.1.3", + "Sun-PPP", + "Sun-PPP-2000", + "SunPro", + "Symlinks", + "TAPR-OHL-1.0", + "TCL", + "TCP-wrappers", + "TGPPL-1.0", + "TMate", + "TORQUE-1.1", + "TOSL", + "TPDL", + "TPL-1.0", + "TTWL", + "TTYP0", + "TU-Berlin-1.0", + "TU-Berlin-2.0", + "TekHVC", + "TermReadKey", + "ThirdEye", + "TrustedQSL", + "UCAR", + "UCL-1.0", + "UMich-Merit", + "UPL-1.0", + "URT-RLE", + "Ubuntu-font-1.0", + "UnRAR", + "Unicode-3.0", + "Unicode-DFS-2015", + "Unicode-DFS-2016", + "Unicode-TOU", + "UnixCrypt", + "Unlicense", + "Unlicense-libtelnet", + "Unlicense-libwhirlpool", + "VOSTROM", + "VSL-1.0", + "Vim", + "Vixie-Cron", + "W3C", + "W3C-19980720", + "W3C-20150513", + "WTFNMFPL", + "WTFPL", + "Watcom-1.0", + "Widget-Workshop", + "WordNet", + "Wsuipa", + "X11", + "X11-distribute-modifications-variant", + "X11-no-permit-persons", + "X11-swapped", + "XFree86-1.1", + "XSkat", + "Xdebug-1.03", + "Xerox", + "Xfig", + "Xnet", + "YPL-1.0", + "YPL-1.1", + "ZPL-1.1", + "ZPL-2.0", + "ZPL-2.1", + "Zed", + "Zeeff", + "Zend-2.0", + "Zimbra-1.3", + "Zimbra-1.4", + "Zlib", + "any-OSI", + "any-OSI-perl-modules", + "bcrypt-Solar-Designer", + "blessing", + "bzip2-1.0.6", + "check-cvs", + "checkmk", + "copyleft-next-0.3.0", + "copyleft-next-0.3.1", + "curl", + "cve-tou", + "diffmark", + "dtoa", + "dvipdfm", + "eGenix", + "etalab-2.0", + "fwlw", + "gSOAP-1.3b", + "generic-xts", + "gnuplot", + "gtkbook", + "hdparm", + "hyphen-bulgarian", + "iMatix", + "jove", + "libpng-1.6.35", + "libpng-2.0", + "libselinux-1.0", + "libtiff", + "libutil-David-Nugent", + "lsof", + "magaz", + "mailprio", + "man2html", + "metamail", + "mpi-permissive", + "mpich2", + "mplus", + "ngrep", + "pkgconf", + "pnmstitch", + "psfrag", + "psutils", + "python-ldap", + "radvd", + "snprintf", + "softSurfer", + "ssh-keyscan", + "swrule", + "threeparttable", + "ulem", + "w3m", + "wwl", + "xinetd", + "xkeyboard-config-Zinoviev", + "xlock", + "xpp", + "xzoom", + "zlib-acknowledgement" +] diff --git a/node/node_modules/npm/node_modules/spdx-license-ids/package.json b/node/node_modules/npm/node_modules/spdx-license-ids/package.json new file mode 100644 index 0000000000000000000000000000000000000000..ea7ee7a394425193ec2408efc9a6f2183cc68ab9 --- /dev/null +++ b/node/node_modules/npm/node_modules/spdx-license-ids/package.json @@ -0,0 +1,29 @@ +{ + "name": "spdx-license-ids", + "version": "3.0.23", + "description": "A list of SPDX license identifiers", + "repository": "jslicense/spdx-license-ids", + "author": "Shinnosuke Watanabe (https://github.com/shinnn)", + "license": "CC0-1.0", + "scripts": { + "build": "node build.js", + "latest": "node latest.js", + "pretest": "npm run build", + "test": "node test.js" + }, + "files": [ + "deprecated.json", + "index.json" + ], + "keywords": [ + "spdx", + "license", + "licenses", + "id", + "identifier", + "identifiers", + "json", + "array", + "oss" + ] +} diff --git a/node/node_modules/npm/node_modules/ssri/LICENSE.md b/node/node_modules/npm/node_modules/ssri/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..d649f62d4db399b02e001aa9588117aacb242c03 --- /dev/null +++ b/node/node_modules/npm/node_modules/ssri/LICENSE.md @@ -0,0 +1,16 @@ +ISC License + +Copyright 2021 (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted, provided that the +above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS +ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/ssri/package.json b/node/node_modules/npm/node_modules/ssri/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d9831a302dacf60a3f9d59cde3b2a8bc43cb4ddc --- /dev/null +++ b/node/node_modules/npm/node_modules/ssri/package.json @@ -0,0 +1,66 @@ +{ + "name": "ssri", + "version": "13.0.1", + "description": "Standard Subresource Integrity library -- parses, serializes, generates, and verifies integrity metadata according to the SRI spec.", + "main": "lib/index.js", + "files": [ + "bin/", + "lib/" + ], + "scripts": { + "prerelease": "npm t", + "postrelease": "npm publish", + "posttest": "npm run lint", + "test": "node --test './test/**/*.js'", + "coverage": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "snap": "node --test --test-update-snapshots './test/**/*.js'", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", + "test:node20": "node --test test", + "test:cover": "node --test --experimental-test-coverage --test-timeout=3000 --test-coverage-lines=100 --test-coverage-functions=100 --test-coverage-branches=100 './test/**/*.js'" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/ssri.git" + }, + "keywords": [ + "w3c", + "web", + "security", + "integrity", + "checksum", + "hashing", + "subresource integrity", + "sri", + "sri hash", + "sri string", + "sri generator", + "html" + ], + "author": "GitHub Inc.", + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "devDependencies": { + "@npmcli/eslint-config": "^6.0.0", + "@npmcli/template-oss": "4.28.1", + "benchmark": "^2.1.4" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.28.1", + "publish": "true", + "allowPaths": [ + "benchmarks/" + ], + "testRunner": "node:test", + "latestVersion": 24 + } +} diff --git a/node/node_modules/npm/node_modules/supports-color/browser.js b/node/node_modules/npm/node_modules/supports-color/browser.js new file mode 100644 index 0000000000000000000000000000000000000000..04666c566b61ac912264d3584e4f72ad52a79c27 --- /dev/null +++ b/node/node_modules/npm/node_modules/supports-color/browser.js @@ -0,0 +1,35 @@ +/* eslint-env browser */ +/* eslint-disable n/no-unsupported-features/node-builtins */ + +const level = (() => { + if (!('navigator' in globalThis)) { + return 0; + } + + if (globalThis.navigator.userAgentData) { + const brand = navigator.userAgentData.brands.find(({brand}) => brand === 'Chromium'); + if (brand?.version > 93) { + return 3; + } + } + + if (/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)) { + return 1; + } + + return 0; +})(); + +const colorSupport = level !== 0 && { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3, +}; + +const supportsColor = { + stdout: colorSupport, + stderr: colorSupport, +}; + +export default supportsColor; diff --git a/node/node_modules/npm/node_modules/supports-color/index.js b/node/node_modules/npm/node_modules/supports-color/index.js new file mode 100644 index 0000000000000000000000000000000000000000..cba8188ece3a616288ef92c5d2db6055e103aa71 --- /dev/null +++ b/node/node_modules/npm/node_modules/supports-color/index.js @@ -0,0 +1,202 @@ +import process from 'node:process'; +import os from 'node:os'; +import tty from 'node:tty'; + +// From: https://github.com/sindresorhus/has-flag/blob/main/index.js +/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) { +function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) { + const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf('--'); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); +} + +const {env} = process; + +let flagForceColor; +if ( + hasFlag('no-color') + || hasFlag('no-colors') + || hasFlag('color=false') + || hasFlag('color=never') +) { + flagForceColor = 0; +} else if ( + hasFlag('color') + || hasFlag('colors') + || hasFlag('color=true') + || hasFlag('color=always') +) { + flagForceColor = 1; +} + +function envForceColor() { + if (!('FORCE_COLOR' in env)) { + return; + } + + if (env.FORCE_COLOR === 'true') { + return 1; + } + + if (env.FORCE_COLOR === 'false') { + return 0; + } + + if (env.FORCE_COLOR.length === 0) { + return 1; + } + + const level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3); + + if (![0, 1, 2, 3].includes(level)) { + return; + } + + return level; +} + +function translateLevel(level) { + if (level === 0) { + return false; + } + + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3, + }; +} + +function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) { + const noFlagForceColor = envForceColor(); + if (noFlagForceColor !== undefined) { + flagForceColor = noFlagForceColor; + } + + const forceColor = sniffFlags ? flagForceColor : noFlagForceColor; + + if (forceColor === 0) { + return 0; + } + + if (sniffFlags) { + if (hasFlag('color=16m') + || hasFlag('color=full') + || hasFlag('color=truecolor')) { + return 3; + } + + if (hasFlag('color=256')) { + return 2; + } + } + + // Check for Azure DevOps pipelines. + // Has to be above the `!streamIsTTY` check. + if ('TF_BUILD' in env && 'AGENT_NAME' in env) { + return 1; + } + + if (haveStream && !streamIsTTY && forceColor === undefined) { + return 0; + } + + const min = forceColor || 0; + + if (env.TERM === 'dumb') { + return min; + } + + if (process.platform === 'win32') { + // Windows 10 build 10586 is the first Windows release that supports 256 colors. + // Windows 10 build 14931 is the first release that supports 16m/TrueColor. + const osRelease = os.release().split('.'); + if ( + Number(osRelease[0]) >= 10 + && Number(osRelease[2]) >= 10_586 + ) { + return Number(osRelease[2]) >= 14_931 ? 3 : 2; + } + + return 1; + } + + if ('CI' in env) { + if (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) { + return 3; + } + + if (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + return 1; + } + + return min; + } + + if ('TEAMCITY_VERSION' in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + + if (env.COLORTERM === 'truecolor') { + return 3; + } + + if (env.TERM === 'xterm-kitty') { + return 3; + } + + if (env.TERM === 'xterm-ghostty') { + return 3; + } + + if (env.TERM === 'wezterm') { + return 3; + } + + if ('TERM_PROGRAM' in env) { + const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); + + switch (env.TERM_PROGRAM) { + case 'iTerm.app': { + return version >= 3 ? 3 : 2; + } + + case 'Apple_Terminal': { + return 2; + } + // No default + } + } + + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + + if ('COLORTERM' in env) { + return 1; + } + + return min; +} + +export function createSupportsColor(stream, options = {}) { + const level = _supportsColor(stream, { + streamIsTTY: stream && stream.isTTY, + ...options, + }); + + return translateLevel(level); +} + +const supportsColor = { + stdout: createSupportsColor({isTTY: tty.isatty(1)}), + stderr: createSupportsColor({isTTY: tty.isatty(2)}), +}; + +export default supportsColor; diff --git a/node/node_modules/npm/node_modules/supports-color/license b/node/node_modules/npm/node_modules/supports-color/license new file mode 100644 index 0000000000000000000000000000000000000000..0f2d6cdf18ca059e54ad911b1debe1a08a708b84 --- /dev/null +++ b/node/node_modules/npm/node_modules/supports-color/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/supports-color/package.json b/node/node_modules/npm/node_modules/supports-color/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9b5c50f68711b56f419687e57d21f06a1ae15fe6 --- /dev/null +++ b/node/node_modules/npm/node_modules/supports-color/package.json @@ -0,0 +1,64 @@ +{ + "name": "supports-color", + "version": "10.2.2", + "description": "Detect whether a terminal supports color", + "license": "MIT", + "repository": "chalk/supports-color", + "funding": "https://github.com/chalk/supports-color?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": { + "types": "./index.d.ts", + "node": "./index.js", + "default": "./browser.js" + }, + "sideEffects": false, + "engines": { + "node": ">=18" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts", + "browser.js", + "browser.d.ts" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect", + "truecolor", + "16m" + ], + "devDependencies": { + "@types/node": "^22.10.2", + "ava": "^6.2.0", + "tsd": "^0.31.2", + "xo": "^0.60.0" + }, + "ava": { + "serial": true, + "workerThreads": false + } +} diff --git a/node/node_modules/npm/node_modules/tar/LICENSE.md b/node/node_modules/npm/node_modules/tar/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..3da8747dc3a48e2da66615e4116cefcfde495d7c --- /dev/null +++ b/node/node_modules/npm/node_modules/tar/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** diff --git a/node/node_modules/npm/node_modules/tar/package.json b/node/node_modules/npm/node_modules/tar/package.json new file mode 100644 index 0000000000000000000000000000000000000000..cb1ae009d9cf550650e182a88e99e6e7d5dfdaf3 --- /dev/null +++ b/node/node_modules/npm/node_modules/tar/package.json @@ -0,0 +1,297 @@ +{ + "author": "Isaac Z. Schlueter", + "name": "tar", + "description": "tar for node", + "version": "7.5.13", + "repository": { + "type": "git", + "url": "https://github.com/isaacs/node-tar.git" + }, + "scripts": { + "genparse": "node scripts/generate-parse-fixtures.js", + "snap": "tap", + "test": "tap", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "prepare": "tshy && bash scripts/build.sh", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "format": "prettier --write . --log-level warn", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts", + "lint": "oxlint --fix src test", + "postsnap": "npm run lint", + "postlint": "npm run format" + }, + "dependencies": { + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.1.0", + "yallist": "^5.0.0" + }, + "devDependencies": { + "@types/node": "^25.5.0", + "chmodr": "^2.0.2", + "end-of-stream": "^1.4.3", + "esbuild": "^0.27.4", + "events-to-array": "^2.0.3", + "mutate-fs": "^2.1.1", + "nock": "^13.5.4", + "oxlint": "^1.56.0", + "oxlint-tsgolint": "^0.17.0", + "prettier": "^3.8.1", + "rimraf": "^6.1.2", + "tap": "^21.6.2", + "tshy": "^3.3.2", + "typedoc": "^0.28.17" + }, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + }, + "files": [ + "dist" + ], + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + }, + "./raw": "./src/index.ts", + "./c": "./src/create.ts", + "./create": "./src/create.ts", + "./replace": "./src/create.ts", + "./r": "./src/create.ts", + "./list": "./src/list.ts", + "./t": "./src/list.ts", + "./update": "./src/update.ts", + "./u": "./src/update.ts", + "./extract": "./src/extract.ts", + "./x": "./src/extract.ts", + "./pack": "./src/pack.ts", + "./unpack": "./src/unpack.ts", + "./parse": "./src/parse.ts", + "./read-entry": "./src/read-entry.ts", + "./write-entry": "./src/write-entry.ts", + "./header": "./src/header.ts", + "./pax": "./src/pax.ts", + "./types": "./src/types.ts" + } + }, + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + }, + "./raw": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + "./c": { + "import": { + "types": "./dist/esm/create.d.ts", + "default": "./dist/esm/create.js" + }, + "require": { + "types": "./dist/commonjs/create.d.ts", + "default": "./dist/commonjs/create.js" + } + }, + "./create": { + "import": { + "types": "./dist/esm/create.d.ts", + "default": "./dist/esm/create.js" + }, + "require": { + "types": "./dist/commonjs/create.d.ts", + "default": "./dist/commonjs/create.js" + } + }, + "./replace": { + "import": { + "types": "./dist/esm/create.d.ts", + "default": "./dist/esm/create.js" + }, + "require": { + "types": "./dist/commonjs/create.d.ts", + "default": "./dist/commonjs/create.js" + } + }, + "./r": { + "import": { + "types": "./dist/esm/create.d.ts", + "default": "./dist/esm/create.js" + }, + "require": { + "types": "./dist/commonjs/create.d.ts", + "default": "./dist/commonjs/create.js" + } + }, + "./list": { + "import": { + "types": "./dist/esm/list.d.ts", + "default": "./dist/esm/list.js" + }, + "require": { + "types": "./dist/commonjs/list.d.ts", + "default": "./dist/commonjs/list.js" + } + }, + "./t": { + "import": { + "types": "./dist/esm/list.d.ts", + "default": "./dist/esm/list.js" + }, + "require": { + "types": "./dist/commonjs/list.d.ts", + "default": "./dist/commonjs/list.js" + } + }, + "./update": { + "import": { + "types": "./dist/esm/update.d.ts", + "default": "./dist/esm/update.js" + }, + "require": { + "types": "./dist/commonjs/update.d.ts", + "default": "./dist/commonjs/update.js" + } + }, + "./u": { + "import": { + "types": "./dist/esm/update.d.ts", + "default": "./dist/esm/update.js" + }, + "require": { + "types": "./dist/commonjs/update.d.ts", + "default": "./dist/commonjs/update.js" + } + }, + "./extract": { + "import": { + "types": "./dist/esm/extract.d.ts", + "default": "./dist/esm/extract.js" + }, + "require": { + "types": "./dist/commonjs/extract.d.ts", + "default": "./dist/commonjs/extract.js" + } + }, + "./x": { + "import": { + "types": "./dist/esm/extract.d.ts", + "default": "./dist/esm/extract.js" + }, + "require": { + "types": "./dist/commonjs/extract.d.ts", + "default": "./dist/commonjs/extract.js" + } + }, + "./pack": { + "import": { + "types": "./dist/esm/pack.d.ts", + "default": "./dist/esm/pack.js" + }, + "require": { + "types": "./dist/commonjs/pack.d.ts", + "default": "./dist/commonjs/pack.js" + } + }, + "./unpack": { + "import": { + "types": "./dist/esm/unpack.d.ts", + "default": "./dist/esm/unpack.js" + }, + "require": { + "types": "./dist/commonjs/unpack.d.ts", + "default": "./dist/commonjs/unpack.js" + } + }, + "./parse": { + "import": { + "types": "./dist/esm/parse.d.ts", + "default": "./dist/esm/parse.js" + }, + "require": { + "types": "./dist/commonjs/parse.d.ts", + "default": "./dist/commonjs/parse.js" + } + }, + "./read-entry": { + "import": { + "types": "./dist/esm/read-entry.d.ts", + "default": "./dist/esm/read-entry.js" + }, + "require": { + "types": "./dist/commonjs/read-entry.d.ts", + "default": "./dist/commonjs/read-entry.js" + } + }, + "./write-entry": { + "import": { + "types": "./dist/esm/write-entry.d.ts", + "default": "./dist/esm/write-entry.js" + }, + "require": { + "types": "./dist/commonjs/write-entry.d.ts", + "default": "./dist/commonjs/write-entry.js" + } + }, + "./header": { + "import": { + "types": "./dist/esm/header.d.ts", + "default": "./dist/esm/header.js" + }, + "require": { + "types": "./dist/commonjs/header.d.ts", + "default": "./dist/commonjs/header.js" + } + }, + "./pax": { + "import": { + "types": "./dist/esm/pax.d.ts", + "default": "./dist/esm/pax.js" + }, + "require": { + "types": "./dist/commonjs/pax.d.ts", + "default": "./dist/commonjs/pax.js" + } + }, + "./types": { + "import": { + "types": "./dist/esm/types.d.ts", + "default": "./dist/esm/types.js" + }, + "require": { + "types": "./dist/commonjs/types.d.ts", + "default": "./dist/commonjs/types.js" + } + } + }, + "type": "module", + "main": "./dist/commonjs/index.min.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.min.js" +} diff --git a/node/node_modules/npm/node_modules/text-table/LICENSE b/node/node_modules/npm/node_modules/text-table/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c477f448849a0dc6110f443cda7b3968a77cf24a --- /dev/null +++ b/node/node_modules/npm/node_modules/text-table/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/text-table/index.js b/node/node_modules/npm/node_modules/text-table/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d0f26b5658e478caa59f4378f81d6c5db082b9ce --- /dev/null +++ b/node/node_modules/npm/node_modules/text-table/index.js @@ -0,0 +1,86 @@ +module.exports = function (rows_, opts) { + if (!opts) opts = {}; + var hsep = opts.hsep === undefined ? ' ' : opts.hsep; + var align = opts.align || []; + var stringLength = opts.stringLength + || function (s) { return String(s).length; } + ; + + var dotsizes = reduce(rows_, function (acc, row) { + forEach(row, function (c, ix) { + var n = dotindex(c); + if (!acc[ix] || n > acc[ix]) acc[ix] = n; + }); + return acc; + }, []); + + var rows = map(rows_, function (row) { + return map(row, function (c_, ix) { + var c = String(c_); + if (align[ix] === '.') { + var index = dotindex(c); + var size = dotsizes[ix] + (/\./.test(c) ? 1 : 2) + - (stringLength(c) - index) + ; + return c + Array(size).join(' '); + } + else return c; + }); + }); + + var sizes = reduce(rows, function (acc, row) { + forEach(row, function (c, ix) { + var n = stringLength(c); + if (!acc[ix] || n > acc[ix]) acc[ix] = n; + }); + return acc; + }, []); + + return map(rows, function (row) { + return map(row, function (c, ix) { + var n = (sizes[ix] - stringLength(c)) || 0; + var s = Array(Math.max(n + 1, 1)).join(' '); + if (align[ix] === 'r' || align[ix] === '.') { + return s + c; + } + if (align[ix] === 'c') { + return Array(Math.ceil(n / 2 + 1)).join(' ') + + c + Array(Math.floor(n / 2 + 1)).join(' ') + ; + } + + return c + s; + }).join(hsep).replace(/\s+$/, ''); + }).join('\n'); +}; + +function dotindex (c) { + var m = /\.[^.]*$/.exec(c); + return m ? m.index + 1 : c.length; +} + +function reduce (xs, f, init) { + if (xs.reduce) return xs.reduce(f, init); + var i = 0; + var acc = arguments.length >= 3 ? init : xs[i++]; + for (; i < xs.length; i++) { + f(acc, xs[i], i); + } + return acc; +} + +function forEach (xs, f) { + if (xs.forEach) return xs.forEach(f); + for (var i = 0; i < xs.length; i++) { + f.call(xs, xs[i], i); + } +} + +function map (xs, f) { + if (xs.map) return xs.map(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + res.push(f.call(xs, xs[i], i)); + } + return res; +} diff --git a/node/node_modules/npm/node_modules/text-table/package.json b/node/node_modules/npm/node_modules/text-table/package.json new file mode 100644 index 0000000000000000000000000000000000000000..0d9b0941e057d51c3ba7c18847e9665aeb133183 --- /dev/null +++ b/node/node_modules/npm/node_modules/text-table/package.json @@ -0,0 +1,44 @@ +{ + "name": "text-table", + "version": "0.2.0", + "description": "borderless text tables with alignment", + "main": "index.js", + "devDependencies": { + "tap": "~0.4.0", + "tape": "~1.0.2", + "cli-color": "~0.2.3" + }, + "scripts": { + "test": "tap test/*.js" + }, + "testling" : { + "files" : "test/*.js", + "browsers" : [ + "ie/6..latest", + "chrome/20..latest", + "firefox/10..latest", + "safari/latest", + "opera/11.0..latest", + "iphone/6", "ipad/6" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/text-table.git" + }, + "homepage": "https://github.com/substack/text-table", + "keywords": [ + "text", + "table", + "align", + "ascii", + "rows", + "tabular" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT" +} diff --git a/node/node_modules/npm/node_modules/tiny-relative-date/LICENSE.md b/node/node_modules/npm/node_modules/tiny-relative-date/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..59e3a84f564c96ccb8e503e9a91e74d6100a8d45 --- /dev/null +++ b/node/node_modules/npm/node_modules/tiny-relative-date/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Joseph Wynn + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node/node_modules/npm/node_modules/tiny-relative-date/package.json b/node/node_modules/npm/node_modules/tiny-relative-date/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5e76331122ed8e4269ad9647454f46475e65883f --- /dev/null +++ b/node/node_modules/npm/node_modules/tiny-relative-date/package.json @@ -0,0 +1,39 @@ +{ + "name": "tiny-relative-date", + "version": "2.0.2", + "description": "Tiny function that provides relative, human-readable dates.", + "main": "lib/index.js", + "module": "src/index.js", + "scripts": { + "build": "babel src -d lib && cp src/*.d.ts lib/", + "test": "npm run eslint && npm run jasmine", + "eslint": "eslint --fix src/**/*.js spec/*.js", + "jasmine": "TZ=UTC jasmine", + "prepublish": "npm run build" + }, + "files": [ + "lib/", + "src/", + "translations/" + ], + "license": "MIT", + "author": "Joseph Wynn (https://wildlyinaccurate.com/)", + "repository": { + "type": "git", + "url": "https://github.com/wildlyinaccurate/relative-date.git" + }, + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-preset-es2015": "^6.24.1", + "babel-register": "^6.26.0", + "eslint": "^4.19.1", + "eslint-config-standard": "^11.0.0", + "eslint-plugin-import": "^2.11.0", + "eslint-plugin-node": "^6.0.1", + "eslint-plugin-promise": "^3.7.0", + "eslint-plugin-standard": "^3.0.1", + "jasmine": "^3.1.0", + "jasmine-spec-reporter": "^4.2.1" + } +} diff --git a/node/node_modules/npm/node_modules/tinyglobby/LICENSE b/node/node_modules/npm/node_modules/tinyglobby/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d3a2c265a6a6718f654965a02e6fbe1e5f1b2571 --- /dev/null +++ b/node/node_modules/npm/node_modules/tinyglobby/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Madeline Gurriarán + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node/node_modules/npm/node_modules/tinyglobby/package.json b/node/node_modules/npm/node_modules/tinyglobby/package.json new file mode 100644 index 0000000000000000000000000000000000000000..f163f9b85feb090d7d34f7d54b662a92663e4357 --- /dev/null +++ b/node/node_modules/npm/node_modules/tinyglobby/package.json @@ -0,0 +1,73 @@ +{ + "name": "tinyglobby", + "version": "0.2.16", + "description": "A fast and minimal alternative to globby and fast-glob", + "type": "module", + "main": "./dist/index.cjs", + "module": "./dist/index.mjs", + "types": "./dist/index.d.cts", + "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "./package.json": "./package.json" + }, + "sideEffects": false, + "files": [ + "dist" + ], + "author": "Superchupu", + "license": "MIT", + "keywords": [ + "glob", + "patterns", + "fast", + "implementation" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/SuperchupuDev/tinyglobby.git" + }, + "bugs": { + "url": "https://github.com/SuperchupuDev/tinyglobby/issues" + }, + "homepage": "https://superchupu.dev/tinyglobby", + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + }, + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "devDependencies": { + "@biomejs/biome": "^2.4.10", + "@types/node": "^25.5.2", + "@types/picomatch": "^4.0.3", + "fast-glob": "^3.3.3", + "fs-fixture": "^2.13.0", + "glob": "^13.0.6", + "tinybench": "^6.0.0", + "tsdown": "^0.21.7", + "typescript": "^6.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "publishConfig": { + "provenance": true + }, + "scripts": { + "bench": "node benchmark/bench.ts", + "bench:setup": "node benchmark/setup.ts", + "build": "tsdown", + "check": "biome check", + "check:fix": "biome check --write --unsafe", + "format": "biome format --write", + "lint": "biome lint", + "test": "node --test \"test/**/*.ts\"", + "test:coverage": "node --test --experimental-test-coverage \"test/**/*.ts\"", + "test:only": "node --test --test-only \"test/**/*.ts\"", + "typecheck": "tsc --noEmit" + } +} \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/treeverse/LICENSE b/node/node_modules/npm/node_modules/treeverse/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..215e9f0de625433a71e86b99d9ad3d74d25e7e2e --- /dev/null +++ b/node/node_modules/npm/node_modules/treeverse/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm, Inc. and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/treeverse/package.json b/node/node_modules/npm/node_modules/treeverse/package.json new file mode 100644 index 0000000000000000000000000000000000000000..f0e7e7e3470e17e8e720895bc3431dfc6ea446e7 --- /dev/null +++ b/node/node_modules/npm/node_modules/treeverse/package.json @@ -0,0 +1,51 @@ +{ + "name": "treeverse", + "version": "3.0.0", + "description": "Walk any kind of tree structure depth- or breadth-first. Supports promises and advanced map-reduce operations with a very small API.", + "author": "GitHub Inc.", + "license": "ISC", + "repository": { + "type": "git", + "url": "https://github.com/npm/treeverse.git" + }, + "scripts": { + "test": "tap", + "snap": "tap", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "posttest": "npm run lint" + }, + "tap": { + "100": true, + "coverage-map": "test/coverage-map.js", + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "devDependencies": { + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "4.5.1", + "tap": "^16.0.1" + }, + "files": [ + "bin/", + "lib/" + ], + "main": "lib/index.js", + "keywords": [ + "tree", + "traversal", + "depth first search", + "breadth first search" + ], + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.5.1" + } +} diff --git a/node/node_modules/npm/node_modules/tuf-js/LICENSE b/node/node_modules/npm/node_modules/tuf-js/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..11c163edcb07e5d8d0e69ea19f34a1549da502c6 --- /dev/null +++ b/node/node_modules/npm/node_modules/tuf-js/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 GitHub and the TUF Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node/node_modules/npm/node_modules/tuf-js/package.json b/node/node_modules/npm/node_modules/tuf-js/package.json new file mode 100644 index 0000000000000000000000000000000000000000..0c5c393583a7a42e11282fda818e1cc83f85c0c7 --- /dev/null +++ b/node/node_modules/npm/node_modules/tuf-js/package.json @@ -0,0 +1,43 @@ +{ + "name": "tuf-js", + "version": "4.1.0", + "description": "JavaScript implementation of The Update Framework (TUF)", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc --build tsconfig.build.json", + "clean": "rm -rf dist && rm tsconfig.build.tsbuildinfo", + "test": "jest" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/theupdateframework/tuf-js.git" + }, + "files": [ + "dist" + ], + "keywords": [ + "tuf", + "security", + "update" + ], + "author": "bdehamer@github.com", + "license": "MIT", + "bugs": { + "url": "https://github.com/theupdateframework/tuf-js/issues" + }, + "homepage": "https://github.com/theupdateframework/tuf-js/tree/main/packages/client#readme", + "devDependencies": { + "@tufjs/repo-mock": "4.0.1", + "@types/debug": "^4.1.12", + "@types/make-fetch-happen": "^10.0.4" + }, + "dependencies": { + "@tufjs/models": "4.1.0", + "debug": "^4.4.3", + "make-fetch-happen": "^15.0.1" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + } +} diff --git a/node/node_modules/npm/node_modules/undici/LICENSE b/node/node_modules/npm/node_modules/undici/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..ed9636516b56ea2770226b893e70773d609ca876 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Matteo Collina and Undici contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node/node_modules/npm/node_modules/undici/index-fetch.js b/node/node_modules/npm/node_modules/undici/index-fetch.js new file mode 100644 index 0000000000000000000000000000000000000000..a588eddd894d7ef7e0aebd9daba35e85490dd1d4 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/index-fetch.js @@ -0,0 +1,35 @@ +'use strict' + +const { getGlobalDispatcher, setGlobalDispatcher } = require('./lib/global') +const EnvHttpProxyAgent = require('./lib/dispatcher/env-http-proxy-agent') +const fetchImpl = require('./lib/web/fetch').fetch + +module.exports.fetch = function fetch (resource, init = undefined) { + return fetchImpl(resource, init).catch((err) => { + if (err && typeof err === 'object') { + Error.captureStackTrace(err) + } + throw err + }) +} +module.exports.FormData = require('./lib/web/fetch/formdata').FormData +module.exports.Headers = require('./lib/web/fetch/headers').Headers +module.exports.Response = require('./lib/web/fetch/response').Response +module.exports.Request = require('./lib/web/fetch/request').Request + +const { CloseEvent, ErrorEvent, MessageEvent, createFastMessageEvent } = require('./lib/web/websocket/events') +module.exports.WebSocket = require('./lib/web/websocket/websocket').WebSocket +module.exports.CloseEvent = CloseEvent +module.exports.ErrorEvent = ErrorEvent +module.exports.MessageEvent = MessageEvent +module.exports.createFastMessageEvent = createFastMessageEvent + +module.exports.EventSource = require('./lib/web/eventsource/eventsource').EventSource + +const api = require('./lib/api') +const Dispatcher = require('./lib/dispatcher/dispatcher') +Object.assign(Dispatcher.prototype, api) +// Expose the fetch implementation to be enabled in Node.js core via a flag +module.exports.EnvHttpProxyAgent = EnvHttpProxyAgent +module.exports.getGlobalDispatcher = getGlobalDispatcher +module.exports.setGlobalDispatcher = setGlobalDispatcher diff --git a/node/node_modules/npm/node_modules/undici/index.js b/node/node_modules/npm/node_modules/undici/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c7aac3036d3d3c6bae4264bd8a976d14f9ac67ce --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/index.js @@ -0,0 +1,169 @@ +'use strict' + +const Client = require('./lib/dispatcher/client') +const Dispatcher = require('./lib/dispatcher/dispatcher') +const Pool = require('./lib/dispatcher/pool') +const BalancedPool = require('./lib/dispatcher/balanced-pool') +const Agent = require('./lib/dispatcher/agent') +const ProxyAgent = require('./lib/dispatcher/proxy-agent') +const EnvHttpProxyAgent = require('./lib/dispatcher/env-http-proxy-agent') +const RetryAgent = require('./lib/dispatcher/retry-agent') +const errors = require('./lib/core/errors') +const util = require('./lib/core/util') +const { InvalidArgumentError } = errors +const api = require('./lib/api') +const buildConnector = require('./lib/core/connect') +const MockClient = require('./lib/mock/mock-client') +const MockAgent = require('./lib/mock/mock-agent') +const MockPool = require('./lib/mock/mock-pool') +const mockErrors = require('./lib/mock/mock-errors') +const RetryHandler = require('./lib/handler/retry-handler') +const { getGlobalDispatcher, setGlobalDispatcher } = require('./lib/global') +const DecoratorHandler = require('./lib/handler/decorator-handler') +const RedirectHandler = require('./lib/handler/redirect-handler') +const createRedirectInterceptor = require('./lib/interceptor/redirect-interceptor') + +Object.assign(Dispatcher.prototype, api) + +module.exports.Dispatcher = Dispatcher +module.exports.Client = Client +module.exports.Pool = Pool +module.exports.BalancedPool = BalancedPool +module.exports.Agent = Agent +module.exports.ProxyAgent = ProxyAgent +module.exports.EnvHttpProxyAgent = EnvHttpProxyAgent +module.exports.RetryAgent = RetryAgent +module.exports.RetryHandler = RetryHandler + +module.exports.DecoratorHandler = DecoratorHandler +module.exports.RedirectHandler = RedirectHandler +module.exports.createRedirectInterceptor = createRedirectInterceptor +module.exports.interceptors = { + redirect: require('./lib/interceptor/redirect'), + retry: require('./lib/interceptor/retry'), + dump: require('./lib/interceptor/dump'), + dns: require('./lib/interceptor/dns') +} + +module.exports.buildConnector = buildConnector +module.exports.errors = errors +module.exports.util = { + parseHeaders: util.parseHeaders, + headerNameToString: util.headerNameToString +} + +function makeDispatcher (fn) { + return (url, opts, handler) => { + if (typeof opts === 'function') { + handler = opts + opts = null + } + + if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) { + throw new InvalidArgumentError('invalid url') + } + + if (opts != null && typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + if (opts && opts.path != null) { + if (typeof opts.path !== 'string') { + throw new InvalidArgumentError('invalid opts.path') + } + + let path = opts.path + if (!opts.path.startsWith('/')) { + path = `/${path}` + } + + url = new URL(util.parseOrigin(url).origin + path) + } else { + if (!opts) { + opts = typeof url === 'object' ? url : {} + } + + url = util.parseURL(url) + } + + const { agent, dispatcher = getGlobalDispatcher() } = opts + + if (agent) { + throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?') + } + + return fn.call(dispatcher, { + ...opts, + origin: url.origin, + path: url.search ? `${url.pathname}${url.search}` : url.pathname, + method: opts.method || (opts.body ? 'PUT' : 'GET') + }, handler) + } +} + +module.exports.setGlobalDispatcher = setGlobalDispatcher +module.exports.getGlobalDispatcher = getGlobalDispatcher + +const fetchImpl = require('./lib/web/fetch').fetch +module.exports.fetch = async function fetch (init, options = undefined) { + try { + return await fetchImpl(init, options) + } catch (err) { + if (err && typeof err === 'object') { + Error.captureStackTrace(err) + } + + throw err + } +} +module.exports.Headers = require('./lib/web/fetch/headers').Headers +module.exports.Response = require('./lib/web/fetch/response').Response +module.exports.Request = require('./lib/web/fetch/request').Request +module.exports.FormData = require('./lib/web/fetch/formdata').FormData +module.exports.File = globalThis.File ?? require('node:buffer').File +module.exports.FileReader = require('./lib/web/fileapi/filereader').FileReader + +const { setGlobalOrigin, getGlobalOrigin } = require('./lib/web/fetch/global') + +module.exports.setGlobalOrigin = setGlobalOrigin +module.exports.getGlobalOrigin = getGlobalOrigin + +const { CacheStorage } = require('./lib/web/cache/cachestorage') +const { kConstruct } = require('./lib/web/cache/symbols') + +// Cache & CacheStorage are tightly coupled with fetch. Even if it may run +// in an older version of Node, it doesn't have any use without fetch. +module.exports.caches = new CacheStorage(kConstruct) + +const { deleteCookie, getCookies, getSetCookies, setCookie } = require('./lib/web/cookies') + +module.exports.deleteCookie = deleteCookie +module.exports.getCookies = getCookies +module.exports.getSetCookies = getSetCookies +module.exports.setCookie = setCookie + +const { parseMIMEType, serializeAMimeType } = require('./lib/web/fetch/data-url') + +module.exports.parseMIMEType = parseMIMEType +module.exports.serializeAMimeType = serializeAMimeType + +const { CloseEvent, ErrorEvent, MessageEvent } = require('./lib/web/websocket/events') +module.exports.WebSocket = require('./lib/web/websocket/websocket').WebSocket +module.exports.CloseEvent = CloseEvent +module.exports.ErrorEvent = ErrorEvent +module.exports.MessageEvent = MessageEvent + +module.exports.request = makeDispatcher(api.request) +module.exports.stream = makeDispatcher(api.stream) +module.exports.pipeline = makeDispatcher(api.pipeline) +module.exports.connect = makeDispatcher(api.connect) +module.exports.upgrade = makeDispatcher(api.upgrade) + +module.exports.MockClient = MockClient +module.exports.MockPool = MockPool +module.exports.MockAgent = MockAgent +module.exports.mockErrors = mockErrors + +const { EventSource } = require('./lib/web/eventsource/eventsource') + +module.exports.EventSource = EventSource diff --git a/node/node_modules/npm/node_modules/undici/lib/api/abort-signal.js b/node/node_modules/npm/node_modules/undici/lib/api/abort-signal.js new file mode 100644 index 0000000000000000000000000000000000000000..ad09c98a4a769de59c8a4aa6ec7214094bd8c502 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/api/abort-signal.js @@ -0,0 +1,57 @@ +const { addAbortListener } = require('../core/util') +const { RequestAbortedError } = require('../core/errors') + +const kListener = Symbol('kListener') +const kSignal = Symbol('kSignal') + +function abort (self) { + if (self.abort) { + self.abort(self[kSignal]?.reason) + } else { + self.reason = self[kSignal]?.reason ?? new RequestAbortedError() + } + removeSignal(self) +} + +function addSignal (self, signal) { + self.reason = null + + self[kSignal] = null + self[kListener] = null + + if (!signal) { + return + } + + if (signal.aborted) { + abort(self) + return + } + + self[kSignal] = signal + self[kListener] = () => { + abort(self) + } + + addAbortListener(self[kSignal], self[kListener]) +} + +function removeSignal (self) { + if (!self[kSignal]) { + return + } + + if ('removeEventListener' in self[kSignal]) { + self[kSignal].removeEventListener('abort', self[kListener]) + } else { + self[kSignal].removeListener('abort', self[kListener]) + } + + self[kSignal] = null + self[kListener] = null +} + +module.exports = { + addSignal, + removeSignal +} diff --git a/node/node_modules/npm/node_modules/undici/lib/api/api-connect.js b/node/node_modules/npm/node_modules/undici/lib/api/api-connect.js new file mode 100644 index 0000000000000000000000000000000000000000..257292a0bda90917969c5821da96a5fadf253a23 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/api/api-connect.js @@ -0,0 +1,108 @@ +'use strict' + +const assert = require('node:assert') +const { AsyncResource } = require('node:async_hooks') +const { InvalidArgumentError, SocketError } = require('../core/errors') +const util = require('../core/util') +const { addSignal, removeSignal } = require('./abort-signal') + +class ConnectHandler extends AsyncResource { + constructor (opts, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + const { signal, opaque, responseHeaders } = opts + + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } + + super('UNDICI_CONNECT') + + this.opaque = opaque || null + this.responseHeaders = responseHeaders || null + this.callback = callback + this.abort = null + + addSignal(this, signal) + } + + onConnect (abort, context) { + if (this.reason) { + abort(this.reason) + return + } + + assert(this.callback) + + this.abort = abort + this.context = context + } + + onHeaders () { + throw new SocketError('bad connect', null) + } + + onUpgrade (statusCode, rawHeaders, socket) { + const { callback, opaque, context } = this + + removeSignal(this) + + this.callback = null + + let headers = rawHeaders + // Indicates is an HTTP2Session + if (headers != null) { + headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + } + + this.runInAsyncScope(callback, null, null, { + statusCode, + headers, + socket, + opaque, + context + }) + } + + onError (err) { + const { callback, opaque } = this + + removeSignal(this) + + if (callback) { + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) + }) + } + } +} + +function connect (opts, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + connect.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + + try { + const connectHandler = new ConnectHandler(opts, callback) + this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler) + } catch (err) { + if (typeof callback !== 'function') { + throw err + } + const opaque = opts?.opaque + queueMicrotask(() => callback(err, { opaque })) + } +} + +module.exports = connect diff --git a/node/node_modules/npm/node_modules/undici/lib/api/api-pipeline.js b/node/node_modules/npm/node_modules/undici/lib/api/api-pipeline.js new file mode 100644 index 0000000000000000000000000000000000000000..60fc53170881648fc326ffa7ac35a0c72d6d5fe6 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/api/api-pipeline.js @@ -0,0 +1,251 @@ +'use strict' + +const { + Readable, + Duplex, + PassThrough +} = require('node:stream') +const { + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError +} = require('../core/errors') +const util = require('../core/util') +const { AsyncResource } = require('node:async_hooks') +const { addSignal, removeSignal } = require('./abort-signal') +const assert = require('node:assert') + +const kResume = Symbol('resume') + +class PipelineRequest extends Readable { + constructor () { + super({ autoDestroy: true }) + + this[kResume] = null + } + + _read () { + const { [kResume]: resume } = this + + if (resume) { + this[kResume] = null + resume() + } + } + + _destroy (err, callback) { + this._read() + + callback(err) + } +} + +class PipelineResponse extends Readable { + constructor (resume) { + super({ autoDestroy: true }) + this[kResume] = resume + } + + _read () { + this[kResume]() + } + + _destroy (err, callback) { + if (!err && !this._readableState.endEmitted) { + err = new RequestAbortedError() + } + + callback(err) + } +} + +class PipelineHandler extends AsyncResource { + constructor (opts, handler) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + if (typeof handler !== 'function') { + throw new InvalidArgumentError('invalid handler') + } + + const { signal, method, opaque, onInfo, responseHeaders } = opts + + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } + + if (method === 'CONNECT') { + throw new InvalidArgumentError('invalid method') + } + + if (onInfo && typeof onInfo !== 'function') { + throw new InvalidArgumentError('invalid onInfo callback') + } + + super('UNDICI_PIPELINE') + + this.opaque = opaque || null + this.responseHeaders = responseHeaders || null + this.handler = handler + this.abort = null + this.context = null + this.onInfo = onInfo || null + + this.req = new PipelineRequest().on('error', util.nop) + + this.ret = new Duplex({ + readableObjectMode: opts.objectMode, + autoDestroy: true, + read: () => { + const { body } = this + + if (body?.resume) { + body.resume() + } + }, + write: (chunk, encoding, callback) => { + const { req } = this + + if (req.push(chunk, encoding) || req._readableState.destroyed) { + callback() + } else { + req[kResume] = callback + } + }, + destroy: (err, callback) => { + const { body, req, res, ret, abort } = this + + if (!err && !ret._readableState.endEmitted) { + err = new RequestAbortedError() + } + + if (abort && err) { + abort() + } + + util.destroy(body, err) + util.destroy(req, err) + util.destroy(res, err) + + removeSignal(this) + + callback(err) + } + }).on('prefinish', () => { + const { req } = this + + // Node < 15 does not call _final in same tick. + req.push(null) + }) + + this.res = null + + addSignal(this, signal) + } + + onConnect (abort, context) { + const { ret, res } = this + + if (this.reason) { + abort(this.reason) + return + } + + assert(!res, 'pipeline cannot be retried') + assert(!ret.destroyed) + + this.abort = abort + this.context = context + } + + onHeaders (statusCode, rawHeaders, resume) { + const { opaque, handler, context } = this + + if (statusCode < 200) { + if (this.onInfo) { + const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + this.onInfo({ statusCode, headers }) + } + return + } + + this.res = new PipelineResponse(resume) + + let body + try { + this.handler = null + const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + body = this.runInAsyncScope(handler, null, { + statusCode, + headers, + opaque, + body: this.res, + context + }) + } catch (err) { + this.res.on('error', util.nop) + throw err + } + + if (!body || typeof body.on !== 'function') { + throw new InvalidReturnValueError('expected Readable') + } + + body + .on('data', (chunk) => { + const { ret, body } = this + + if (!ret.push(chunk) && body.pause) { + body.pause() + } + }) + .on('error', (err) => { + const { ret } = this + + util.destroy(ret, err) + }) + .on('end', () => { + const { ret } = this + + ret.push(null) + }) + .on('close', () => { + const { ret } = this + + if (!ret._readableState.ended) { + util.destroy(ret, new RequestAbortedError()) + } + }) + + this.body = body + } + + onData (chunk) { + const { res } = this + return res.push(chunk) + } + + onComplete (trailers) { + const { res } = this + res.push(null) + } + + onError (err) { + const { ret } = this + this.handler = null + util.destroy(ret, err) + } +} + +function pipeline (opts, handler) { + try { + const pipelineHandler = new PipelineHandler(opts, handler) + this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler) + return pipelineHandler.ret + } catch (err) { + return new PassThrough().destroy(err) + } +} + +module.exports = pipeline diff --git a/node/node_modules/npm/node_modules/undici/lib/api/api-request.js b/node/node_modules/npm/node_modules/undici/lib/api/api-request.js new file mode 100644 index 0000000000000000000000000000000000000000..8f52b5dd269b56ede245f6f081eb68d70de62259 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/api/api-request.js @@ -0,0 +1,214 @@ +'use strict' + +const assert = require('node:assert') +const { Readable } = require('./readable') +const { InvalidArgumentError, RequestAbortedError } = require('../core/errors') +const util = require('../core/util') +const { getResolveErrorBodyCallback } = require('./util') +const { AsyncResource } = require('node:async_hooks') + +class RequestHandler extends AsyncResource { + constructor (opts, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts + + try { + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) { + throw new InvalidArgumentError('invalid highWaterMark') + } + + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } + + if (method === 'CONNECT') { + throw new InvalidArgumentError('invalid method') + } + + if (onInfo && typeof onInfo !== 'function') { + throw new InvalidArgumentError('invalid onInfo callback') + } + + super('UNDICI_REQUEST') + } catch (err) { + if (util.isStream(body)) { + util.destroy(body.on('error', util.nop), err) + } + throw err + } + + this.method = method + this.responseHeaders = responseHeaders || null + this.opaque = opaque || null + this.callback = callback + this.res = null + this.abort = null + this.body = body + this.trailers = {} + this.context = null + this.onInfo = onInfo || null + this.throwOnError = throwOnError + this.highWaterMark = highWaterMark + this.signal = signal + this.reason = null + this.removeAbortListener = null + + if (util.isStream(body)) { + body.on('error', (err) => { + this.onError(err) + }) + } + + if (this.signal) { + if (this.signal.aborted) { + this.reason = this.signal.reason ?? new RequestAbortedError() + } else { + this.removeAbortListener = util.addAbortListener(this.signal, () => { + this.reason = this.signal.reason ?? new RequestAbortedError() + if (this.res) { + util.destroy(this.res.on('error', util.nop), this.reason) + } else if (this.abort) { + this.abort(this.reason) + } + + if (this.removeAbortListener) { + this.res?.off('close', this.removeAbortListener) + this.removeAbortListener() + this.removeAbortListener = null + } + }) + } + } + } + + onConnect (abort, context) { + if (this.reason) { + abort(this.reason) + return + } + + assert(this.callback) + + this.abort = abort + this.context = context + } + + onHeaders (statusCode, rawHeaders, resume, statusMessage) { + const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this + + const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + + if (statusCode < 200) { + if (this.onInfo) { + this.onInfo({ statusCode, headers }) + } + return + } + + const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers + const contentType = parsedHeaders['content-type'] + const contentLength = parsedHeaders['content-length'] + const res = new Readable({ + resume, + abort, + contentType, + contentLength: this.method !== 'HEAD' && contentLength + ? Number(contentLength) + : null, + highWaterMark + }) + + if (this.removeAbortListener) { + res.on('close', this.removeAbortListener) + } + + this.callback = null + this.res = res + if (callback !== null) { + if (this.throwOnError && statusCode >= 400) { + this.runInAsyncScope(getResolveErrorBodyCallback, null, + { callback, body: res, contentType, statusCode, statusMessage, headers } + ) + } else { + this.runInAsyncScope(callback, null, null, { + statusCode, + headers, + trailers: this.trailers, + opaque, + body: res, + context + }) + } + } + } + + onData (chunk) { + return this.res.push(chunk) + } + + onComplete (trailers) { + util.parseHeaders(trailers, this.trailers) + this.res.push(null) + } + + onError (err) { + const { res, callback, body, opaque } = this + + if (callback) { + // TODO: Does this need queueMicrotask? + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) + }) + } + + if (res) { + this.res = null + // Ensure all queued handlers are invoked before destroying res. + queueMicrotask(() => { + util.destroy(res, err) + }) + } + + if (body) { + this.body = null + util.destroy(body, err) + } + + if (this.removeAbortListener) { + res?.off('close', this.removeAbortListener) + this.removeAbortListener() + this.removeAbortListener = null + } + } +} + +function request (opts, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + request.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + + try { + this.dispatch(opts, new RequestHandler(opts, callback)) + } catch (err) { + if (typeof callback !== 'function') { + throw err + } + const opaque = opts?.opaque + queueMicrotask(() => callback(err, { opaque })) + } +} + +module.exports = request +module.exports.RequestHandler = RequestHandler diff --git a/node/node_modules/npm/node_modules/undici/lib/api/api-stream.js b/node/node_modules/npm/node_modules/undici/lib/api/api-stream.js new file mode 100644 index 0000000000000000000000000000000000000000..5e3d97323c59ffb4fac05ed4f7e3aab13fc4dfd4 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/api/api-stream.js @@ -0,0 +1,220 @@ +'use strict' + +const assert = require('node:assert') +const { finished, PassThrough } = require('node:stream') +const { InvalidArgumentError, InvalidReturnValueError } = require('../core/errors') +const util = require('../core/util') +const { getResolveErrorBodyCallback } = require('./util') +const { AsyncResource } = require('node:async_hooks') +const { addSignal, removeSignal } = require('./abort-signal') + +class StreamHandler extends AsyncResource { + constructor (opts, factory, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts + + try { + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + if (typeof factory !== 'function') { + throw new InvalidArgumentError('invalid factory') + } + + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } + + if (method === 'CONNECT') { + throw new InvalidArgumentError('invalid method') + } + + if (onInfo && typeof onInfo !== 'function') { + throw new InvalidArgumentError('invalid onInfo callback') + } + + super('UNDICI_STREAM') + } catch (err) { + if (util.isStream(body)) { + util.destroy(body.on('error', util.nop), err) + } + throw err + } + + this.responseHeaders = responseHeaders || null + this.opaque = opaque || null + this.factory = factory + this.callback = callback + this.res = null + this.abort = null + this.context = null + this.trailers = null + this.body = body + this.onInfo = onInfo || null + this.throwOnError = throwOnError || false + + if (util.isStream(body)) { + body.on('error', (err) => { + this.onError(err) + }) + } + + addSignal(this, signal) + } + + onConnect (abort, context) { + if (this.reason) { + abort(this.reason) + return + } + + assert(this.callback) + + this.abort = abort + this.context = context + } + + onHeaders (statusCode, rawHeaders, resume, statusMessage) { + const { factory, opaque, context, callback, responseHeaders } = this + + const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + + if (statusCode < 200) { + if (this.onInfo) { + this.onInfo({ statusCode, headers }) + } + return + } + + this.factory = null + + let res + + if (this.throwOnError && statusCode >= 400) { + const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers + const contentType = parsedHeaders['content-type'] + res = new PassThrough() + + this.callback = null + this.runInAsyncScope(getResolveErrorBodyCallback, null, + { callback, body: res, contentType, statusCode, statusMessage, headers } + ) + } else { + if (factory === null) { + return + } + + res = this.runInAsyncScope(factory, null, { + statusCode, + headers, + opaque, + context + }) + + if ( + !res || + typeof res.write !== 'function' || + typeof res.end !== 'function' || + typeof res.on !== 'function' + ) { + throw new InvalidReturnValueError('expected Writable') + } + + // TODO: Avoid finished. It registers an unnecessary amount of listeners. + finished(res, { readable: false }, (err) => { + const { callback, res, opaque, trailers, abort } = this + + this.res = null + if (err || !res.readable) { + util.destroy(res, err) + } + + this.callback = null + this.runInAsyncScope(callback, null, err || null, { opaque, trailers }) + + if (err) { + abort() + } + }) + } + + res.on('drain', resume) + + this.res = res + + const needDrain = res.writableNeedDrain !== undefined + ? res.writableNeedDrain + : res._writableState?.needDrain + + return needDrain !== true + } + + onData (chunk) { + const { res } = this + + return res ? res.write(chunk) : true + } + + onComplete (trailers) { + const { res } = this + + removeSignal(this) + + if (!res) { + return + } + + this.trailers = util.parseHeaders(trailers) + + res.end() + } + + onError (err) { + const { res, callback, opaque, body } = this + + removeSignal(this) + + this.factory = null + + if (res) { + this.res = null + util.destroy(res, err) + } else if (callback) { + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) + }) + } + + if (body) { + this.body = null + util.destroy(body, err) + } + } +} + +function stream (opts, factory, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + stream.call(this, opts, factory, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + + try { + this.dispatch(opts, new StreamHandler(opts, factory, callback)) + } catch (err) { + if (typeof callback !== 'function') { + throw err + } + const opaque = opts?.opaque + queueMicrotask(() => callback(err, { opaque })) + } +} + +module.exports = stream diff --git a/node/node_modules/npm/node_modules/undici/lib/api/api-upgrade.js b/node/node_modules/npm/node_modules/undici/lib/api/api-upgrade.js new file mode 100644 index 0000000000000000000000000000000000000000..5530cb868f060d3c61dc40400d6770dafdfae96d --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/api/api-upgrade.js @@ -0,0 +1,108 @@ +'use strict' + +const { InvalidArgumentError, SocketError } = require('../core/errors') +const { AsyncResource } = require('node:async_hooks') +const util = require('../core/util') +const { addSignal, removeSignal } = require('./abort-signal') +const assert = require('node:assert') + +class UpgradeHandler extends AsyncResource { + constructor (opts, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + const { signal, opaque, responseHeaders } = opts + + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } + + super('UNDICI_UPGRADE') + + this.responseHeaders = responseHeaders || null + this.opaque = opaque || null + this.callback = callback + this.abort = null + this.context = null + + addSignal(this, signal) + } + + onConnect (abort, context) { + if (this.reason) { + abort(this.reason) + return + } + + assert(this.callback) + + this.abort = abort + this.context = null + } + + onHeaders () { + throw new SocketError('bad upgrade', null) + } + + onUpgrade (statusCode, rawHeaders, socket) { + assert(statusCode === 101) + + const { callback, opaque, context } = this + + removeSignal(this) + + this.callback = null + const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + this.runInAsyncScope(callback, null, null, { + headers, + socket, + opaque, + context + }) + } + + onError (err) { + const { callback, opaque } = this + + removeSignal(this) + + if (callback) { + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) + }) + } + } +} + +function upgrade (opts, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + upgrade.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + + try { + const upgradeHandler = new UpgradeHandler(opts, callback) + this.dispatch({ + ...opts, + method: opts.method || 'GET', + upgrade: opts.protocol || 'Websocket' + }, upgradeHandler) + } catch (err) { + if (typeof callback !== 'function') { + throw err + } + const opaque = opts?.opaque + queueMicrotask(() => callback(err, { opaque })) + } +} + +module.exports = upgrade diff --git a/node/node_modules/npm/node_modules/undici/lib/api/index.js b/node/node_modules/npm/node_modules/undici/lib/api/index.js new file mode 100644 index 0000000000000000000000000000000000000000..73e28580720ae4e098157f451f38a47cb14b17d7 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/api/index.js @@ -0,0 +1,7 @@ +'use strict' + +module.exports.request = require('./api-request') +module.exports.stream = require('./api-stream') +module.exports.pipeline = require('./api-pipeline') +module.exports.upgrade = require('./api-upgrade') +module.exports.connect = require('./api-connect') diff --git a/node/node_modules/npm/node_modules/undici/lib/api/readable.js b/node/node_modules/npm/node_modules/undici/lib/api/readable.js new file mode 100644 index 0000000000000000000000000000000000000000..6df7828d55e61a1ac5ab4e595ccb4a7e164a08f6 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/api/readable.js @@ -0,0 +1,385 @@ +// Ported from https://github.com/nodejs/undici/pull/907 + +'use strict' + +const assert = require('node:assert') +const { Readable } = require('node:stream') +const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require('../core/errors') +const util = require('../core/util') +const { ReadableStreamFrom } = require('../core/util') + +const kConsume = Symbol('kConsume') +const kReading = Symbol('kReading') +const kBody = Symbol('kBody') +const kAbort = Symbol('kAbort') +const kContentType = Symbol('kContentType') +const kContentLength = Symbol('kContentLength') + +const noop = () => {} + +class BodyReadable extends Readable { + constructor ({ + resume, + abort, + contentType = '', + contentLength, + highWaterMark = 64 * 1024 // Same as nodejs fs streams. + }) { + super({ + autoDestroy: true, + read: resume, + highWaterMark + }) + + this._readableState.dataEmitted = false + + this[kAbort] = abort + this[kConsume] = null + this[kBody] = null + this[kContentType] = contentType + this[kContentLength] = contentLength + + // Is stream being consumed through Readable API? + // This is an optimization so that we avoid checking + // for 'data' and 'readable' listeners in the hot path + // inside push(). + this[kReading] = false + } + + destroy (err) { + if (!err && !this._readableState.endEmitted) { + err = new RequestAbortedError() + } + + if (err) { + this[kAbort]() + } + + return super.destroy(err) + } + + _destroy (err, callback) { + // Workaround for Node "bug". If the stream is destroyed in same + // tick as it is created, then a user who is waiting for a + // promise (i.e micro tick) for installing a 'error' listener will + // never get a chance and will always encounter an unhandled exception. + if (!this[kReading]) { + setImmediate(() => { + callback(err) + }) + } else { + callback(err) + } + } + + on (ev, ...args) { + if (ev === 'data' || ev === 'readable') { + this[kReading] = true + } + return super.on(ev, ...args) + } + + addListener (ev, ...args) { + return this.on(ev, ...args) + } + + off (ev, ...args) { + const ret = super.off(ev, ...args) + if (ev === 'data' || ev === 'readable') { + this[kReading] = ( + this.listenerCount('data') > 0 || + this.listenerCount('readable') > 0 + ) + } + return ret + } + + removeListener (ev, ...args) { + return this.off(ev, ...args) + } + + push (chunk) { + if (this[kConsume] && chunk !== null) { + consumePush(this[kConsume], chunk) + return this[kReading] ? super.push(chunk) : true + } + return super.push(chunk) + } + + // https://fetch.spec.whatwg.org/#dom-body-text + async text () { + return consume(this, 'text') + } + + // https://fetch.spec.whatwg.org/#dom-body-json + async json () { + return consume(this, 'json') + } + + // https://fetch.spec.whatwg.org/#dom-body-blob + async blob () { + return consume(this, 'blob') + } + + // https://fetch.spec.whatwg.org/#dom-body-bytes + async bytes () { + return consume(this, 'bytes') + } + + // https://fetch.spec.whatwg.org/#dom-body-arraybuffer + async arrayBuffer () { + return consume(this, 'arrayBuffer') + } + + // https://fetch.spec.whatwg.org/#dom-body-formdata + async formData () { + // TODO: Implement. + throw new NotSupportedError() + } + + // https://fetch.spec.whatwg.org/#dom-body-bodyused + get bodyUsed () { + return util.isDisturbed(this) + } + + // https://fetch.spec.whatwg.org/#dom-body-body + get body () { + if (!this[kBody]) { + this[kBody] = ReadableStreamFrom(this) + if (this[kConsume]) { + // TODO: Is this the best way to force a lock? + this[kBody].getReader() // Ensure stream is locked. + assert(this[kBody].locked) + } + } + return this[kBody] + } + + async dump (opts) { + let limit = Number.isFinite(opts?.limit) ? opts.limit : 128 * 1024 + const signal = opts?.signal + + if (signal != null && (typeof signal !== 'object' || !('aborted' in signal))) { + throw new InvalidArgumentError('signal must be an AbortSignal') + } + + signal?.throwIfAborted() + + if (this._readableState.closeEmitted) { + return null + } + + return await new Promise((resolve, reject) => { + if (this[kContentLength] > limit) { + this.destroy(new AbortError()) + } + + const onAbort = () => { + this.destroy(signal.reason ?? new AbortError()) + } + signal?.addEventListener('abort', onAbort) + + this + .on('close', function () { + signal?.removeEventListener('abort', onAbort) + if (signal?.aborted) { + reject(signal.reason ?? new AbortError()) + } else { + resolve(null) + } + }) + .on('error', noop) + .on('data', function (chunk) { + limit -= chunk.length + if (limit <= 0) { + this.destroy() + } + }) + .resume() + }) + } +} + +// https://streams.spec.whatwg.org/#readablestream-locked +function isLocked (self) { + // Consume is an implicit lock. + return (self[kBody] && self[kBody].locked === true) || self[kConsume] +} + +// https://fetch.spec.whatwg.org/#body-unusable +function isUnusable (self) { + return util.isDisturbed(self) || isLocked(self) +} + +async function consume (stream, type) { + assert(!stream[kConsume]) + + return new Promise((resolve, reject) => { + if (isUnusable(stream)) { + const rState = stream._readableState + if (rState.destroyed && rState.closeEmitted === false) { + stream + .on('error', err => { + reject(err) + }) + .on('close', () => { + reject(new TypeError('unusable')) + }) + } else { + reject(rState.errored ?? new TypeError('unusable')) + } + } else { + queueMicrotask(() => { + stream[kConsume] = { + type, + stream, + resolve, + reject, + length: 0, + body: [] + } + + stream + .on('error', function (err) { + consumeFinish(this[kConsume], err) + }) + .on('close', function () { + if (this[kConsume].body !== null) { + consumeFinish(this[kConsume], new RequestAbortedError()) + } + }) + + consumeStart(stream[kConsume]) + }) + } + }) +} + +function consumeStart (consume) { + if (consume.body === null) { + return + } + + const { _readableState: state } = consume.stream + + if (state.bufferIndex) { + const start = state.bufferIndex + const end = state.buffer.length + for (let n = start; n < end; n++) { + consumePush(consume, state.buffer[n]) + } + } else { + for (const chunk of state.buffer) { + consumePush(consume, chunk) + } + } + + if (state.endEmitted) { + consumeEnd(this[kConsume]) + } else { + consume.stream.on('end', function () { + consumeEnd(this[kConsume]) + }) + } + + consume.stream.resume() + + while (consume.stream.read() != null) { + // Loop + } +} + +/** + * @param {Buffer[]} chunks + * @param {number} length + */ +function chunksDecode (chunks, length) { + if (chunks.length === 0 || length === 0) { + return '' + } + const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length) + const bufferLength = buffer.length + + // Skip BOM. + const start = + bufferLength > 2 && + buffer[0] === 0xef && + buffer[1] === 0xbb && + buffer[2] === 0xbf + ? 3 + : 0 + return buffer.utf8Slice(start, bufferLength) +} + +/** + * @param {Buffer[]} chunks + * @param {number} length + * @returns {Uint8Array} + */ +function chunksConcat (chunks, length) { + if (chunks.length === 0 || length === 0) { + return new Uint8Array(0) + } + if (chunks.length === 1) { + // fast-path + return new Uint8Array(chunks[0]) + } + const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer) + + let offset = 0 + for (let i = 0; i < chunks.length; ++i) { + const chunk = chunks[i] + buffer.set(chunk, offset) + offset += chunk.length + } + + return buffer +} + +function consumeEnd (consume) { + const { type, body, resolve, stream, length } = consume + + try { + if (type === 'text') { + resolve(chunksDecode(body, length)) + } else if (type === 'json') { + resolve(JSON.parse(chunksDecode(body, length))) + } else if (type === 'arrayBuffer') { + resolve(chunksConcat(body, length).buffer) + } else if (type === 'blob') { + resolve(new Blob(body, { type: stream[kContentType] })) + } else if (type === 'bytes') { + resolve(chunksConcat(body, length)) + } + + consumeFinish(consume) + } catch (err) { + stream.destroy(err) + } +} + +function consumePush (consume, chunk) { + consume.length += chunk.length + consume.body.push(chunk) +} + +function consumeFinish (consume, err) { + if (consume.body === null) { + return + } + + if (err) { + consume.reject(err) + } else { + consume.resolve() + } + + consume.type = null + consume.stream = null + consume.resolve = null + consume.reject = null + consume.length = 0 + consume.body = null +} + +module.exports = { Readable: BodyReadable, chunksDecode } diff --git a/node/node_modules/npm/node_modules/undici/lib/api/util.js b/node/node_modules/npm/node_modules/undici/lib/api/util.js new file mode 100644 index 0000000000000000000000000000000000000000..2181d3c8d194e4d02bf772c7de031a1a227ad04a --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/api/util.js @@ -0,0 +1,93 @@ +const assert = require('node:assert') +const { + ResponseStatusCodeError +} = require('../core/errors') + +const { chunksDecode } = require('./readable') +const CHUNK_LIMIT = 128 * 1024 + +async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) { + assert(body) + + let chunks = [] + let length = 0 + + try { + for await (const chunk of body) { + chunks.push(chunk) + length += chunk.length + if (length > CHUNK_LIMIT) { + chunks = [] + length = 0 + break + } + } + } catch { + chunks = [] + length = 0 + // Do nothing.... + } + + const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}` + + if (statusCode === 204 || !contentType || !length) { + queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers))) + return + } + + const stackTraceLimit = Error.stackTraceLimit + Error.stackTraceLimit = 0 + let payload + + try { + if (isContentTypeApplicationJson(contentType)) { + payload = JSON.parse(chunksDecode(chunks, length)) + } else if (isContentTypeText(contentType)) { + payload = chunksDecode(chunks, length) + } + } catch { + // process in a callback to avoid throwing in the microtask queue + } finally { + Error.stackTraceLimit = stackTraceLimit + } + queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers, payload))) +} + +const isContentTypeApplicationJson = (contentType) => { + return ( + contentType.length > 15 && + contentType[11] === '/' && + contentType[0] === 'a' && + contentType[1] === 'p' && + contentType[2] === 'p' && + contentType[3] === 'l' && + contentType[4] === 'i' && + contentType[5] === 'c' && + contentType[6] === 'a' && + contentType[7] === 't' && + contentType[8] === 'i' && + contentType[9] === 'o' && + contentType[10] === 'n' && + contentType[12] === 'j' && + contentType[13] === 's' && + contentType[14] === 'o' && + contentType[15] === 'n' + ) +} + +const isContentTypeText = (contentType) => { + return ( + contentType.length > 4 && + contentType[4] === '/' && + contentType[0] === 't' && + contentType[1] === 'e' && + contentType[2] === 'x' && + contentType[3] === 't' + ) +} + +module.exports = { + getResolveErrorBodyCallback, + isContentTypeApplicationJson, + isContentTypeText +} diff --git a/node/node_modules/npm/node_modules/undici/lib/core/connect.js b/node/node_modules/npm/node_modules/undici/lib/core/connect.js new file mode 100644 index 0000000000000000000000000000000000000000..be21f4e7fe2fcacac824ce0b639c4a79c6b516ad --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/core/connect.js @@ -0,0 +1,240 @@ +'use strict' + +const net = require('node:net') +const assert = require('node:assert') +const util = require('./util') +const { InvalidArgumentError, ConnectTimeoutError } = require('./errors') +const timers = require('../util/timers') + +function noop () {} + +let tls // include tls conditionally since it is not always available + +// TODO: session re-use does not wait for the first +// connection to resolve the session and might therefore +// resolve the same servername multiple times even when +// re-use is enabled. + +let SessionCache +// FIXME: remove workaround when the Node bug is fixed +// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308 +if (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) { + SessionCache = class WeakSessionCache { + constructor (maxCachedSessions) { + this._maxCachedSessions = maxCachedSessions + this._sessionCache = new Map() + this._sessionRegistry = new global.FinalizationRegistry((key) => { + if (this._sessionCache.size < this._maxCachedSessions) { + return + } + + const ref = this._sessionCache.get(key) + if (ref !== undefined && ref.deref() === undefined) { + this._sessionCache.delete(key) + } + }) + } + + get (sessionKey) { + const ref = this._sessionCache.get(sessionKey) + return ref ? ref.deref() : null + } + + set (sessionKey, session) { + if (this._maxCachedSessions === 0) { + return + } + + this._sessionCache.set(sessionKey, new WeakRef(session)) + this._sessionRegistry.register(session, sessionKey) + } + } +} else { + SessionCache = class SimpleSessionCache { + constructor (maxCachedSessions) { + this._maxCachedSessions = maxCachedSessions + this._sessionCache = new Map() + } + + get (sessionKey) { + return this._sessionCache.get(sessionKey) + } + + set (sessionKey, session) { + if (this._maxCachedSessions === 0) { + return + } + + if (this._sessionCache.size >= this._maxCachedSessions) { + // remove the oldest session + const { value: oldestKey } = this._sessionCache.keys().next() + this._sessionCache.delete(oldestKey) + } + + this._sessionCache.set(sessionKey, session) + } + } +} + +function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) { + if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { + throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero') + } + + const options = { path: socketPath, ...opts } + const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions) + timeout = timeout == null ? 10e3 : timeout + allowH2 = allowH2 != null ? allowH2 : false + return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) { + let socket + if (protocol === 'https:') { + if (!tls) { + tls = require('node:tls') + } + servername = servername || options.servername || util.getServerName(host) || null + + const sessionKey = servername || hostname + assert(sessionKey) + + const session = customSession || sessionCache.get(sessionKey) || null + + port = port || 443 + + socket = tls.connect({ + highWaterMark: 16384, // TLS in node can't have bigger HWM anyway... + ...options, + servername, + session, + localAddress, + // TODO(HTTP/2): Add support for h2c + ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'], + socket: httpSocket, // upgrade socket connection + port, + host: hostname + }) + + socket + .on('session', function (session) { + // TODO (fix): Can a session become invalid once established? Don't think so? + sessionCache.set(sessionKey, session) + }) + } else { + assert(!httpSocket, 'httpSocket can only be sent on TLS update') + + port = port || 80 + + socket = net.connect({ + highWaterMark: 64 * 1024, // Same as nodejs fs streams. + ...options, + localAddress, + port, + host: hostname + }) + } + + // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket + if (options.keepAlive == null || options.keepAlive) { + const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay + socket.setKeepAlive(true, keepAliveInitialDelay) + } + + const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), { timeout, hostname, port }) + + socket + .setNoDelay(true) + .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () { + queueMicrotask(clearConnectTimeout) + + if (callback) { + const cb = callback + callback = null + cb(null, this) + } + }) + .on('error', function (err) { + queueMicrotask(clearConnectTimeout) + + if (callback) { + const cb = callback + callback = null + cb(err) + } + }) + + return socket + } +} + +/** + * @param {WeakRef} socketWeakRef + * @param {object} opts + * @param {number} opts.timeout + * @param {string} opts.hostname + * @param {number} opts.port + * @returns {() => void} + */ +const setupConnectTimeout = process.platform === 'win32' + ? (socketWeakRef, opts) => { + if (!opts.timeout) { + return noop + } + + let s1 = null + let s2 = null + const fastTimer = timers.setFastTimeout(() => { + // setImmediate is added to make sure that we prioritize socket error events over timeouts + s1 = setImmediate(() => { + // Windows needs an extra setImmediate probably due to implementation differences in the socket logic + s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts)) + }) + }, opts.timeout) + return () => { + timers.clearFastTimeout(fastTimer) + clearImmediate(s1) + clearImmediate(s2) + } + } + : (socketWeakRef, opts) => { + if (!opts.timeout) { + return noop + } + + let s1 = null + const fastTimer = timers.setFastTimeout(() => { + // setImmediate is added to make sure that we prioritize socket error events over timeouts + s1 = setImmediate(() => { + onConnectTimeout(socketWeakRef.deref(), opts) + }) + }, opts.timeout) + return () => { + timers.clearFastTimeout(fastTimer) + clearImmediate(s1) + } + } + +/** + * @param {net.Socket} socket + * @param {object} opts + * @param {number} opts.timeout + * @param {string} opts.hostname + * @param {number} opts.port + */ +function onConnectTimeout (socket, opts) { + // The socket could be already garbage collected + if (socket == null) { + return + } + + let message = 'Connect Timeout Error' + if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) { + message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(', ')},` + } else { + message += ` (attempted address: ${opts.hostname}:${opts.port},` + } + + message += ` timeout: ${opts.timeout}ms)` + + util.destroy(socket, new ConnectTimeoutError(message)) +} + +module.exports = buildConnector diff --git a/node/node_modules/npm/node_modules/undici/lib/core/constants.js b/node/node_modules/npm/node_modules/undici/lib/core/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..3214b91213c70ef0631d1dd4829cd4c752ca9162 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/core/constants.js @@ -0,0 +1,118 @@ +'use strict' + +/** @type {Record} */ +const headerNameLowerCasedRecord = {} + +// https://developer.mozilla.org/docs/Web/HTTP/Headers +const wellknownHeaderNames = [ + 'Accept', + 'Accept-Encoding', + 'Accept-Language', + 'Accept-Ranges', + 'Access-Control-Allow-Credentials', + 'Access-Control-Allow-Headers', + 'Access-Control-Allow-Methods', + 'Access-Control-Allow-Origin', + 'Access-Control-Expose-Headers', + 'Access-Control-Max-Age', + 'Access-Control-Request-Headers', + 'Access-Control-Request-Method', + 'Age', + 'Allow', + 'Alt-Svc', + 'Alt-Used', + 'Authorization', + 'Cache-Control', + 'Clear-Site-Data', + 'Connection', + 'Content-Disposition', + 'Content-Encoding', + 'Content-Language', + 'Content-Length', + 'Content-Location', + 'Content-Range', + 'Content-Security-Policy', + 'Content-Security-Policy-Report-Only', + 'Content-Type', + 'Cookie', + 'Cross-Origin-Embedder-Policy', + 'Cross-Origin-Opener-Policy', + 'Cross-Origin-Resource-Policy', + 'Date', + 'Device-Memory', + 'Downlink', + 'ECT', + 'ETag', + 'Expect', + 'Expect-CT', + 'Expires', + 'Forwarded', + 'From', + 'Host', + 'If-Match', + 'If-Modified-Since', + 'If-None-Match', + 'If-Range', + 'If-Unmodified-Since', + 'Keep-Alive', + 'Last-Modified', + 'Link', + 'Location', + 'Max-Forwards', + 'Origin', + 'Permissions-Policy', + 'Pragma', + 'Proxy-Authenticate', + 'Proxy-Authorization', + 'RTT', + 'Range', + 'Referer', + 'Referrer-Policy', + 'Refresh', + 'Retry-After', + 'Sec-WebSocket-Accept', + 'Sec-WebSocket-Extensions', + 'Sec-WebSocket-Key', + 'Sec-WebSocket-Protocol', + 'Sec-WebSocket-Version', + 'Server', + 'Server-Timing', + 'Service-Worker-Allowed', + 'Service-Worker-Navigation-Preload', + 'Set-Cookie', + 'SourceMap', + 'Strict-Transport-Security', + 'Supports-Loading-Mode', + 'TE', + 'Timing-Allow-Origin', + 'Trailer', + 'Transfer-Encoding', + 'Upgrade', + 'Upgrade-Insecure-Requests', + 'User-Agent', + 'Vary', + 'Via', + 'WWW-Authenticate', + 'X-Content-Type-Options', + 'X-DNS-Prefetch-Control', + 'X-Frame-Options', + 'X-Permitted-Cross-Domain-Policies', + 'X-Powered-By', + 'X-Requested-With', + 'X-XSS-Protection' +] + +for (let i = 0; i < wellknownHeaderNames.length; ++i) { + const key = wellknownHeaderNames[i] + const lowerCasedKey = key.toLowerCase() + headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] = + lowerCasedKey +} + +// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`. +Object.setPrototypeOf(headerNameLowerCasedRecord, null) + +module.exports = { + wellknownHeaderNames, + headerNameLowerCasedRecord +} diff --git a/node/node_modules/npm/node_modules/undici/lib/core/diagnostics.js b/node/node_modules/npm/node_modules/undici/lib/core/diagnostics.js new file mode 100644 index 0000000000000000000000000000000000000000..f52e87b9730a38dfb9002f1176b74c067bbc6ae8 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/core/diagnostics.js @@ -0,0 +1,202 @@ +'use strict' +const diagnosticsChannel = require('node:diagnostics_channel') +const util = require('node:util') + +const undiciDebugLog = util.debuglog('undici') +const fetchDebuglog = util.debuglog('fetch') +const websocketDebuglog = util.debuglog('websocket') +let isClientSet = false +const channels = { + // Client + beforeConnect: diagnosticsChannel.channel('undici:client:beforeConnect'), + connected: diagnosticsChannel.channel('undici:client:connected'), + connectError: diagnosticsChannel.channel('undici:client:connectError'), + sendHeaders: diagnosticsChannel.channel('undici:client:sendHeaders'), + // Request + create: diagnosticsChannel.channel('undici:request:create'), + bodySent: diagnosticsChannel.channel('undici:request:bodySent'), + headers: diagnosticsChannel.channel('undici:request:headers'), + trailers: diagnosticsChannel.channel('undici:request:trailers'), + error: diagnosticsChannel.channel('undici:request:error'), + // WebSocket + open: diagnosticsChannel.channel('undici:websocket:open'), + close: diagnosticsChannel.channel('undici:websocket:close'), + socketError: diagnosticsChannel.channel('undici:websocket:socket_error'), + ping: diagnosticsChannel.channel('undici:websocket:ping'), + pong: diagnosticsChannel.channel('undici:websocket:pong') +} + +if (undiciDebugLog.enabled || fetchDebuglog.enabled) { + const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog + + // Track all Client events + diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => { + const { + connectParams: { version, protocol, port, host } + } = evt + debuglog( + 'connecting to %s using %s%s', + `${host}${port ? `:${port}` : ''}`, + protocol, + version + ) + }) + + diagnosticsChannel.channel('undici:client:connected').subscribe(evt => { + const { + connectParams: { version, protocol, port, host } + } = evt + debuglog( + 'connected to %s using %s%s', + `${host}${port ? `:${port}` : ''}`, + protocol, + version + ) + }) + + diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => { + const { + connectParams: { version, protocol, port, host }, + error + } = evt + debuglog( + 'connection to %s using %s%s errored - %s', + `${host}${port ? `:${port}` : ''}`, + protocol, + version, + error.message + ) + }) + + diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => { + const { + request: { method, path, origin } + } = evt + debuglog('sending request to %s %s/%s', method, origin, path) + }) + + // Track Request events + diagnosticsChannel.channel('undici:request:headers').subscribe(evt => { + const { + request: { method, path, origin }, + response: { statusCode } + } = evt + debuglog( + 'received response to %s %s/%s - HTTP %d', + method, + origin, + path, + statusCode + ) + }) + + diagnosticsChannel.channel('undici:request:trailers').subscribe(evt => { + const { + request: { method, path, origin } + } = evt + debuglog('trailers received from %s %s/%s', method, origin, path) + }) + + diagnosticsChannel.channel('undici:request:error').subscribe(evt => { + const { + request: { method, path, origin }, + error + } = evt + debuglog( + 'request to %s %s/%s errored - %s', + method, + origin, + path, + error.message + ) + }) + + isClientSet = true +} + +if (websocketDebuglog.enabled) { + if (!isClientSet) { + const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog + diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => { + const { + connectParams: { version, protocol, port, host } + } = evt + debuglog( + 'connecting to %s%s using %s%s', + host, + port ? `:${port}` : '', + protocol, + version + ) + }) + + diagnosticsChannel.channel('undici:client:connected').subscribe(evt => { + const { + connectParams: { version, protocol, port, host } + } = evt + debuglog( + 'connected to %s%s using %s%s', + host, + port ? `:${port}` : '', + protocol, + version + ) + }) + + diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => { + const { + connectParams: { version, protocol, port, host }, + error + } = evt + debuglog( + 'connection to %s%s using %s%s errored - %s', + host, + port ? `:${port}` : '', + protocol, + version, + error.message + ) + }) + + diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => { + const { + request: { method, path, origin } + } = evt + debuglog('sending request to %s %s/%s', method, origin, path) + }) + } + + // Track all WebSocket events + diagnosticsChannel.channel('undici:websocket:open').subscribe(evt => { + const { + address: { address, port } + } = evt + websocketDebuglog('connection opened %s%s', address, port ? `:${port}` : '') + }) + + diagnosticsChannel.channel('undici:websocket:close').subscribe(evt => { + const { websocket, code, reason } = evt + websocketDebuglog( + 'closed connection to %s - %s %s', + websocket.url, + code, + reason + ) + }) + + diagnosticsChannel.channel('undici:websocket:socket_error').subscribe(err => { + websocketDebuglog('connection errored - %s', err.message) + }) + + diagnosticsChannel.channel('undici:websocket:ping').subscribe(evt => { + websocketDebuglog('ping received') + }) + + diagnosticsChannel.channel('undici:websocket:pong').subscribe(evt => { + websocketDebuglog('pong received') + }) +} + +module.exports = { + channels +} diff --git a/node/node_modules/npm/node_modules/undici/lib/core/errors.js b/node/node_modules/npm/node_modules/undici/lib/core/errors.js new file mode 100644 index 0000000000000000000000000000000000000000..ca1fa3a72452d064b13463412776c50e5041e666 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/core/errors.js @@ -0,0 +1,425 @@ +'use strict' + +const kUndiciError = Symbol.for('undici.error.UND_ERR') +class UndiciError extends Error { + constructor (message) { + super(message) + this.name = 'UndiciError' + this.code = 'UND_ERR' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kUndiciError] === true + } + + [kUndiciError] = true +} + +const kConnectTimeoutError = Symbol.for('undici.error.UND_ERR_CONNECT_TIMEOUT') +class ConnectTimeoutError extends UndiciError { + constructor (message) { + super(message) + this.name = 'ConnectTimeoutError' + this.message = message || 'Connect Timeout Error' + this.code = 'UND_ERR_CONNECT_TIMEOUT' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kConnectTimeoutError] === true + } + + [kConnectTimeoutError] = true +} + +const kHeadersTimeoutError = Symbol.for('undici.error.UND_ERR_HEADERS_TIMEOUT') +class HeadersTimeoutError extends UndiciError { + constructor (message) { + super(message) + this.name = 'HeadersTimeoutError' + this.message = message || 'Headers Timeout Error' + this.code = 'UND_ERR_HEADERS_TIMEOUT' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kHeadersTimeoutError] === true + } + + [kHeadersTimeoutError] = true +} + +const kHeadersOverflowError = Symbol.for('undici.error.UND_ERR_HEADERS_OVERFLOW') +class HeadersOverflowError extends UndiciError { + constructor (message) { + super(message) + this.name = 'HeadersOverflowError' + this.message = message || 'Headers Overflow Error' + this.code = 'UND_ERR_HEADERS_OVERFLOW' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kHeadersOverflowError] === true + } + + [kHeadersOverflowError] = true +} + +const kBodyTimeoutError = Symbol.for('undici.error.UND_ERR_BODY_TIMEOUT') +class BodyTimeoutError extends UndiciError { + constructor (message) { + super(message) + this.name = 'BodyTimeoutError' + this.message = message || 'Body Timeout Error' + this.code = 'UND_ERR_BODY_TIMEOUT' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kBodyTimeoutError] === true + } + + [kBodyTimeoutError] = true +} + +const kResponseStatusCodeError = Symbol.for('undici.error.UND_ERR_RESPONSE_STATUS_CODE') +class ResponseStatusCodeError extends UndiciError { + constructor (message, statusCode, headers, body) { + super(message) + this.name = 'ResponseStatusCodeError' + this.message = message || 'Response Status Code Error' + this.code = 'UND_ERR_RESPONSE_STATUS_CODE' + this.body = body + this.status = statusCode + this.statusCode = statusCode + this.headers = headers + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kResponseStatusCodeError] === true + } + + [kResponseStatusCodeError] = true +} + +const kInvalidArgumentError = Symbol.for('undici.error.UND_ERR_INVALID_ARG') +class InvalidArgumentError extends UndiciError { + constructor (message) { + super(message) + this.name = 'InvalidArgumentError' + this.message = message || 'Invalid Argument Error' + this.code = 'UND_ERR_INVALID_ARG' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kInvalidArgumentError] === true + } + + [kInvalidArgumentError] = true +} + +const kInvalidReturnValueError = Symbol.for('undici.error.UND_ERR_INVALID_RETURN_VALUE') +class InvalidReturnValueError extends UndiciError { + constructor (message) { + super(message) + this.name = 'InvalidReturnValueError' + this.message = message || 'Invalid Return Value Error' + this.code = 'UND_ERR_INVALID_RETURN_VALUE' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kInvalidReturnValueError] === true + } + + [kInvalidReturnValueError] = true +} + +const kAbortError = Symbol.for('undici.error.UND_ERR_ABORT') +class AbortError extends UndiciError { + constructor (message) { + super(message) + this.name = 'AbortError' + this.message = message || 'The operation was aborted' + this.code = 'UND_ERR_ABORT' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kAbortError] === true + } + + [kAbortError] = true +} + +const kRequestAbortedError = Symbol.for('undici.error.UND_ERR_ABORTED') +class RequestAbortedError extends AbortError { + constructor (message) { + super(message) + this.name = 'AbortError' + this.message = message || 'Request aborted' + this.code = 'UND_ERR_ABORTED' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kRequestAbortedError] === true + } + + [kRequestAbortedError] = true +} + +const kInformationalError = Symbol.for('undici.error.UND_ERR_INFO') +class InformationalError extends UndiciError { + constructor (message) { + super(message) + this.name = 'InformationalError' + this.message = message || 'Request information' + this.code = 'UND_ERR_INFO' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kInformationalError] === true + } + + [kInformationalError] = true +} + +const kRequestContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH') +class RequestContentLengthMismatchError extends UndiciError { + constructor (message) { + super(message) + this.name = 'RequestContentLengthMismatchError' + this.message = message || 'Request body length does not match content-length header' + this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kRequestContentLengthMismatchError] === true + } + + [kRequestContentLengthMismatchError] = true +} + +const kResponseContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH') +class ResponseContentLengthMismatchError extends UndiciError { + constructor (message) { + super(message) + this.name = 'ResponseContentLengthMismatchError' + this.message = message || 'Response body length does not match content-length header' + this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kResponseContentLengthMismatchError] === true + } + + [kResponseContentLengthMismatchError] = true +} + +const kClientDestroyedError = Symbol.for('undici.error.UND_ERR_DESTROYED') +class ClientDestroyedError extends UndiciError { + constructor (message) { + super(message) + this.name = 'ClientDestroyedError' + this.message = message || 'The client is destroyed' + this.code = 'UND_ERR_DESTROYED' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kClientDestroyedError] === true + } + + [kClientDestroyedError] = true +} + +const kClientClosedError = Symbol.for('undici.error.UND_ERR_CLOSED') +class ClientClosedError extends UndiciError { + constructor (message) { + super(message) + this.name = 'ClientClosedError' + this.message = message || 'The client is closed' + this.code = 'UND_ERR_CLOSED' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kClientClosedError] === true + } + + [kClientClosedError] = true +} + +const kSocketError = Symbol.for('undici.error.UND_ERR_SOCKET') +class SocketError extends UndiciError { + constructor (message, socket) { + super(message) + this.name = 'SocketError' + this.message = message || 'Socket error' + this.code = 'UND_ERR_SOCKET' + this.socket = socket + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kSocketError] === true + } + + [kSocketError] = true +} + +const kNotSupportedError = Symbol.for('undici.error.UND_ERR_NOT_SUPPORTED') +class NotSupportedError extends UndiciError { + constructor (message) { + super(message) + this.name = 'NotSupportedError' + this.message = message || 'Not supported error' + this.code = 'UND_ERR_NOT_SUPPORTED' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kNotSupportedError] === true + } + + [kNotSupportedError] = true +} + +const kBalancedPoolMissingUpstreamError = Symbol.for('undici.error.UND_ERR_BPL_MISSING_UPSTREAM') +class BalancedPoolMissingUpstreamError extends UndiciError { + constructor (message) { + super(message) + this.name = 'MissingUpstreamError' + this.message = message || 'No upstream has been added to the BalancedPool' + this.code = 'UND_ERR_BPL_MISSING_UPSTREAM' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kBalancedPoolMissingUpstreamError] === true + } + + [kBalancedPoolMissingUpstreamError] = true +} + +const kHTTPParserError = Symbol.for('undici.error.UND_ERR_HTTP_PARSER') +class HTTPParserError extends Error { + constructor (message, code, data) { + super(message) + this.name = 'HTTPParserError' + this.code = code ? `HPE_${code}` : undefined + this.data = data ? data.toString() : undefined + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kHTTPParserError] === true + } + + [kHTTPParserError] = true +} + +const kResponseExceededMaxSizeError = Symbol.for('undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE') +class ResponseExceededMaxSizeError extends UndiciError { + constructor (message) { + super(message) + this.name = 'ResponseExceededMaxSizeError' + this.message = message || 'Response content exceeded max size' + this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kResponseExceededMaxSizeError] === true + } + + [kResponseExceededMaxSizeError] = true +} + +const kRequestRetryError = Symbol.for('undici.error.UND_ERR_REQ_RETRY') +class RequestRetryError extends UndiciError { + constructor (message, code, { headers, data }) { + super(message) + this.name = 'RequestRetryError' + this.message = message || 'Request retry error' + this.code = 'UND_ERR_REQ_RETRY' + this.statusCode = code + this.data = data + this.headers = headers + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kRequestRetryError] === true + } + + [kRequestRetryError] = true +} + +const kResponseError = Symbol.for('undici.error.UND_ERR_RESPONSE') +class ResponseError extends UndiciError { + constructor (message, code, { headers, data }) { + super(message) + this.name = 'ResponseError' + this.message = message || 'Response error' + this.code = 'UND_ERR_RESPONSE' + this.statusCode = code + this.data = data + this.headers = headers + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kResponseError] === true + } + + [kResponseError] = true +} + +const kSecureProxyConnectionError = Symbol.for('undici.error.UND_ERR_PRX_TLS') +class SecureProxyConnectionError extends UndiciError { + constructor (cause, message, options) { + super(message, { cause, ...(options ?? {}) }) + this.name = 'SecureProxyConnectionError' + this.message = message || 'Secure Proxy Connection failed' + this.code = 'UND_ERR_PRX_TLS' + this.cause = cause + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kSecureProxyConnectionError] === true + } + + [kSecureProxyConnectionError] = true +} + +const kMessageSizeExceededError = Symbol.for('undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED') +class MessageSizeExceededError extends UndiciError { + constructor (message) { + super(message) + this.name = 'MessageSizeExceededError' + this.message = message || 'Max decompressed message size exceeded' + this.code = 'UND_ERR_WS_MESSAGE_SIZE_EXCEEDED' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kMessageSizeExceededError] === true + } + + get [kMessageSizeExceededError] () { + return true + } +} + +module.exports = { + AbortError, + HTTPParserError, + UndiciError, + HeadersTimeoutError, + HeadersOverflowError, + BodyTimeoutError, + RequestContentLengthMismatchError, + ConnectTimeoutError, + ResponseStatusCodeError, + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError, + ClientDestroyedError, + ClientClosedError, + InformationalError, + SocketError, + NotSupportedError, + ResponseContentLengthMismatchError, + BalancedPoolMissingUpstreamError, + ResponseExceededMaxSizeError, + RequestRetryError, + ResponseError, + SecureProxyConnectionError, + MessageSizeExceededError +} diff --git a/node/node_modules/npm/node_modules/undici/lib/core/request.js b/node/node_modules/npm/node_modules/undici/lib/core/request.js new file mode 100644 index 0000000000000000000000000000000000000000..287552e6db3e61a53b14b529508ec8d287d80bee --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/core/request.js @@ -0,0 +1,405 @@ +'use strict' + +const { + InvalidArgumentError, + NotSupportedError +} = require('./errors') +const assert = require('node:assert') +const { + isValidHTTPToken, + isValidHeaderValue, + isStream, + destroy, + isBuffer, + isFormDataLike, + isIterable, + isBlobLike, + buildURL, + validateHandler, + getServerName, + normalizedMethodRecords +} = require('./util') +const { channels } = require('./diagnostics.js') +const { headerNameLowerCasedRecord } = require('./constants') + +// Verifies that a given path is valid does not contain control chars \x00 to \x20 +const invalidPathRegex = /[^\u0021-\u00ff]/ + +const kHandler = Symbol('handler') + +class Request { + constructor (origin, { + path, + method, + body, + headers, + query, + idempotent, + blocking, + upgrade, + headersTimeout, + bodyTimeout, + reset, + throwOnError, + expectContinue, + servername + }, handler) { + if (typeof path !== 'string') { + throw new InvalidArgumentError('path must be a string') + } else if ( + path[0] !== '/' && + !(path.startsWith('http://') || path.startsWith('https://')) && + method !== 'CONNECT' + ) { + throw new InvalidArgumentError('path must be an absolute URL or start with a slash') + } else if (invalidPathRegex.test(path)) { + throw new InvalidArgumentError('invalid request path') + } + + if (typeof method !== 'string') { + throw new InvalidArgumentError('method must be a string') + } else if (normalizedMethodRecords[method] === undefined && !isValidHTTPToken(method)) { + throw new InvalidArgumentError('invalid request method') + } + + if (upgrade && typeof upgrade !== 'string') { + throw new InvalidArgumentError('upgrade must be a string') + } + + if (upgrade && !isValidHeaderValue(upgrade)) { + throw new InvalidArgumentError('invalid upgrade header') + } + + if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) { + throw new InvalidArgumentError('invalid headersTimeout') + } + + if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) { + throw new InvalidArgumentError('invalid bodyTimeout') + } + + if (reset != null && typeof reset !== 'boolean') { + throw new InvalidArgumentError('invalid reset') + } + + if (expectContinue != null && typeof expectContinue !== 'boolean') { + throw new InvalidArgumentError('invalid expectContinue') + } + + this.headersTimeout = headersTimeout + + this.bodyTimeout = bodyTimeout + + this.throwOnError = throwOnError === true + + this.method = method + + this.abort = null + + if (body == null) { + this.body = null + } else if (isStream(body)) { + this.body = body + + const rState = this.body._readableState + if (!rState || !rState.autoDestroy) { + this.endHandler = function autoDestroy () { + destroy(this) + } + this.body.on('end', this.endHandler) + } + + this.errorHandler = err => { + if (this.abort) { + this.abort(err) + } else { + this.error = err + } + } + this.body.on('error', this.errorHandler) + } else if (isBuffer(body)) { + this.body = body.byteLength ? body : null + } else if (ArrayBuffer.isView(body)) { + this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null + } else if (body instanceof ArrayBuffer) { + this.body = body.byteLength ? Buffer.from(body) : null + } else if (typeof body === 'string') { + this.body = body.length ? Buffer.from(body) : null + } else if (isFormDataLike(body) || isIterable(body) || isBlobLike(body)) { + this.body = body + } else { + throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable') + } + + this.completed = false + + this.aborted = false + + this.upgrade = upgrade || null + + this.path = query ? buildURL(path, query) : path + + this.origin = origin + + this.idempotent = idempotent == null + ? method === 'HEAD' || method === 'GET' + : idempotent + + this.blocking = blocking == null ? false : blocking + + this.reset = reset == null ? null : reset + + this.host = null + + this.contentLength = null + + this.contentType = null + + this.headers = [] + + // Only for H2 + this.expectContinue = expectContinue != null ? expectContinue : false + + if (Array.isArray(headers)) { + if (headers.length % 2 !== 0) { + throw new InvalidArgumentError('headers array must be even') + } + for (let i = 0; i < headers.length; i += 2) { + processHeader(this, headers[i], headers[i + 1]) + } + } else if (headers && typeof headers === 'object') { + if (headers[Symbol.iterator]) { + for (const header of headers) { + if (!Array.isArray(header) || header.length !== 2) { + throw new InvalidArgumentError('headers must be in key-value pair format') + } + processHeader(this, header[0], header[1]) + } + } else { + const keys = Object.keys(headers) + for (let i = 0; i < keys.length; ++i) { + processHeader(this, keys[i], headers[keys[i]]) + } + } + } else if (headers != null) { + throw new InvalidArgumentError('headers must be an object or an array') + } + + validateHandler(handler, method, upgrade) + + this.servername = servername || getServerName(this.host) + + this[kHandler] = handler + + if (channels.create.hasSubscribers) { + channels.create.publish({ request: this }) + } + } + + onBodySent (chunk) { + if (this[kHandler].onBodySent) { + try { + return this[kHandler].onBodySent(chunk) + } catch (err) { + this.abort(err) + } + } + } + + onRequestSent () { + if (channels.bodySent.hasSubscribers) { + channels.bodySent.publish({ request: this }) + } + + if (this[kHandler].onRequestSent) { + try { + return this[kHandler].onRequestSent() + } catch (err) { + this.abort(err) + } + } + } + + onConnect (abort) { + assert(!this.aborted) + assert(!this.completed) + + if (this.error) { + abort(this.error) + } else { + this.abort = abort + return this[kHandler].onConnect(abort) + } + } + + onResponseStarted () { + return this[kHandler].onResponseStarted?.() + } + + onHeaders (statusCode, headers, resume, statusText) { + assert(!this.aborted) + assert(!this.completed) + + if (channels.headers.hasSubscribers) { + channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }) + } + + try { + return this[kHandler].onHeaders(statusCode, headers, resume, statusText) + } catch (err) { + this.abort(err) + } + } + + onData (chunk) { + assert(!this.aborted) + assert(!this.completed) + + try { + return this[kHandler].onData(chunk) + } catch (err) { + this.abort(err) + return false + } + } + + onUpgrade (statusCode, headers, socket) { + assert(!this.aborted) + assert(!this.completed) + + return this[kHandler].onUpgrade(statusCode, headers, socket) + } + + onComplete (trailers) { + this.onFinally() + + assert(!this.aborted) + + this.completed = true + if (channels.trailers.hasSubscribers) { + channels.trailers.publish({ request: this, trailers }) + } + + try { + return this[kHandler].onComplete(trailers) + } catch (err) { + // TODO (fix): This might be a bad idea? + this.onError(err) + } + } + + onError (error) { + this.onFinally() + + if (channels.error.hasSubscribers) { + channels.error.publish({ request: this, error }) + } + + if (this.aborted) { + return + } + this.aborted = true + + return this[kHandler].onError(error) + } + + onFinally () { + if (this.errorHandler) { + this.body.off('error', this.errorHandler) + this.errorHandler = null + } + + if (this.endHandler) { + this.body.off('end', this.endHandler) + this.endHandler = null + } + } + + addHeader (key, value) { + processHeader(this, key, value) + return this + } +} + +function processHeader (request, key, val) { + if (val && (typeof val === 'object' && !Array.isArray(val))) { + throw new InvalidArgumentError(`invalid ${key} header`) + } else if (val === undefined) { + return + } + + let headerName = headerNameLowerCasedRecord[key] + + if (headerName === undefined) { + headerName = key.toLowerCase() + if (headerNameLowerCasedRecord[headerName] === undefined && !isValidHTTPToken(headerName)) { + throw new InvalidArgumentError('invalid header key') + } + } + + if (Array.isArray(val)) { + const arr = [] + for (let i = 0; i < val.length; i++) { + if (typeof val[i] === 'string') { + if (!isValidHeaderValue(val[i])) { + throw new InvalidArgumentError(`invalid ${key} header`) + } + arr.push(val[i]) + } else if (val[i] === null) { + arr.push('') + } else if (typeof val[i] === 'object') { + throw new InvalidArgumentError(`invalid ${key} header`) + } else { + arr.push(`${val[i]}`) + } + } + val = arr + } else if (typeof val === 'string') { + if (!isValidHeaderValue(val)) { + throw new InvalidArgumentError(`invalid ${key} header`) + } + } else if (val === null) { + val = '' + } else { + val = `${val}` + } + + if (headerName === 'host') { + if (request.host !== null) { + throw new InvalidArgumentError('duplicate host header') + } + if (typeof val !== 'string') { + throw new InvalidArgumentError('invalid host header') + } + // Consumed by Client + request.host = val + } else if (headerName === 'content-length') { + if (request.contentLength !== null) { + throw new InvalidArgumentError('duplicate content-length header') + } + request.contentLength = parseInt(val, 10) + if (!Number.isFinite(request.contentLength)) { + throw new InvalidArgumentError('invalid content-length header') + } + } else if (request.contentType === null && headerName === 'content-type') { + request.contentType = val + request.headers.push(key, val) + } else if (headerName === 'transfer-encoding' || headerName === 'keep-alive' || headerName === 'upgrade') { + throw new InvalidArgumentError(`invalid ${headerName} header`) + } else if (headerName === 'connection') { + const value = typeof val === 'string' ? val.toLowerCase() : null + if (value !== 'close' && value !== 'keep-alive') { + throw new InvalidArgumentError('invalid connection header') + } + + if (value === 'close') { + request.reset = true + } + } else if (headerName === 'expect') { + throw new NotSupportedError('expect header not supported') + } else { + request.headers.push(key, val) + } +} + +module.exports = Request diff --git a/node/node_modules/npm/node_modules/undici/lib/core/symbols.js b/node/node_modules/npm/node_modules/undici/lib/core/symbols.js new file mode 100644 index 0000000000000000000000000000000000000000..2cd3656d68c239b45d21425e4d787aa4bcff22d2 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/core/symbols.js @@ -0,0 +1,67 @@ +module.exports = { + kClose: Symbol('close'), + kDestroy: Symbol('destroy'), + kDispatch: Symbol('dispatch'), + kUrl: Symbol('url'), + kWriting: Symbol('writing'), + kResuming: Symbol('resuming'), + kQueue: Symbol('queue'), + kConnect: Symbol('connect'), + kConnecting: Symbol('connecting'), + kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'), + kKeepAliveMaxTimeout: Symbol('max keep alive timeout'), + kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'), + kKeepAliveTimeoutValue: Symbol('keep alive timeout'), + kKeepAlive: Symbol('keep alive'), + kHeadersTimeout: Symbol('headers timeout'), + kBodyTimeout: Symbol('body timeout'), + kServerName: Symbol('server name'), + kLocalAddress: Symbol('local address'), + kHost: Symbol('host'), + kNoRef: Symbol('no ref'), + kBodyUsed: Symbol('used'), + kBody: Symbol('abstracted request body'), + kRunning: Symbol('running'), + kBlocking: Symbol('blocking'), + kPending: Symbol('pending'), + kSize: Symbol('size'), + kBusy: Symbol('busy'), + kQueued: Symbol('queued'), + kFree: Symbol('free'), + kConnected: Symbol('connected'), + kClosed: Symbol('closed'), + kNeedDrain: Symbol('need drain'), + kReset: Symbol('reset'), + kDestroyed: Symbol.for('nodejs.stream.destroyed'), + kResume: Symbol('resume'), + kOnError: Symbol('on error'), + kMaxHeadersSize: Symbol('max headers size'), + kRunningIdx: Symbol('running index'), + kPendingIdx: Symbol('pending index'), + kError: Symbol('error'), + kClients: Symbol('clients'), + kClient: Symbol('client'), + kParser: Symbol('parser'), + kOnDestroyed: Symbol('destroy callbacks'), + kPipelining: Symbol('pipelining'), + kSocket: Symbol('socket'), + kHostHeader: Symbol('host header'), + kConnector: Symbol('connector'), + kStrictContentLength: Symbol('strict content length'), + kMaxRedirections: Symbol('maxRedirections'), + kMaxRequests: Symbol('maxRequestsPerClient'), + kProxy: Symbol('proxy agent options'), + kCounter: Symbol('socket request counter'), + kInterceptors: Symbol('dispatch interceptors'), + kMaxResponseSize: Symbol('max response size'), + kHTTP2Session: Symbol('http2Session'), + kHTTP2SessionState: Symbol('http2Session state'), + kRetryHandlerDefaultRetry: Symbol('retry agent default retry'), + kConstruct: Symbol('constructable'), + kListeners: Symbol('listeners'), + kHTTPContext: Symbol('http context'), + kMaxConcurrentStreams: Symbol('max concurrent streams'), + kNoProxyAgent: Symbol('no proxy agent'), + kHttpProxyAgent: Symbol('http proxy agent'), + kHttpsProxyAgent: Symbol('https proxy agent') +} diff --git a/node/node_modules/npm/node_modules/undici/lib/core/tree.js b/node/node_modules/npm/node_modules/undici/lib/core/tree.js new file mode 100644 index 0000000000000000000000000000000000000000..e77af030c4e88f3297c61151a1f1bda75160dfa2 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/core/tree.js @@ -0,0 +1,152 @@ +'use strict' + +const { + wellknownHeaderNames, + headerNameLowerCasedRecord +} = require('./constants') + +class TstNode { + /** @type {any} */ + value = null + /** @type {null | TstNode} */ + left = null + /** @type {null | TstNode} */ + middle = null + /** @type {null | TstNode} */ + right = null + /** @type {number} */ + code + /** + * @param {string} key + * @param {any} value + * @param {number} index + */ + constructor (key, value, index) { + if (index === undefined || index >= key.length) { + throw new TypeError('Unreachable') + } + const code = this.code = key.charCodeAt(index) + // check code is ascii string + if (code > 0x7F) { + throw new TypeError('key must be ascii string') + } + if (key.length !== ++index) { + this.middle = new TstNode(key, value, index) + } else { + this.value = value + } + } + + /** + * @param {string} key + * @param {any} value + */ + add (key, value) { + const length = key.length + if (length === 0) { + throw new TypeError('Unreachable') + } + let index = 0 + let node = this + while (true) { + const code = key.charCodeAt(index) + // check code is ascii string + if (code > 0x7F) { + throw new TypeError('key must be ascii string') + } + if (node.code === code) { + if (length === ++index) { + node.value = value + break + } else if (node.middle !== null) { + node = node.middle + } else { + node.middle = new TstNode(key, value, index) + break + } + } else if (node.code < code) { + if (node.left !== null) { + node = node.left + } else { + node.left = new TstNode(key, value, index) + break + } + } else if (node.right !== null) { + node = node.right + } else { + node.right = new TstNode(key, value, index) + break + } + } + } + + /** + * @param {Uint8Array} key + * @return {TstNode | null} + */ + search (key) { + const keylength = key.length + let index = 0 + let node = this + while (node !== null && index < keylength) { + let code = key[index] + // A-Z + // First check if it is bigger than 0x5a. + // Lowercase letters have higher char codes than uppercase ones. + // Also we assume that headers will mostly contain lowercase characters. + if (code <= 0x5a && code >= 0x41) { + // Lowercase for uppercase. + code |= 32 + } + while (node !== null) { + if (code === node.code) { + if (keylength === ++index) { + // Returns Node since it is the last key. + return node + } + node = node.middle + break + } + node = node.code < code ? node.left : node.right + } + } + return null + } +} + +class TernarySearchTree { + /** @type {TstNode | null} */ + node = null + + /** + * @param {string} key + * @param {any} value + * */ + insert (key, value) { + if (this.node === null) { + this.node = new TstNode(key, value, 0) + } else { + this.node.add(key, value) + } + } + + /** + * @param {Uint8Array} key + * @return {any} + */ + lookup (key) { + return this.node?.search(key)?.value ?? null + } +} + +const tree = new TernarySearchTree() + +for (let i = 0; i < wellknownHeaderNames.length; ++i) { + const key = headerNameLowerCasedRecord[wellknownHeaderNames[i]] + tree.insert(key, key) +} + +module.exports = { + TernarySearchTree, + tree +} diff --git a/node/node_modules/npm/node_modules/undici/lib/core/util.js b/node/node_modules/npm/node_modules/undici/lib/core/util.js new file mode 100644 index 0000000000000000000000000000000000000000..51a67ce55efadcc8da2c5991b7f47cb3e89eadae --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/core/util.js @@ -0,0 +1,719 @@ +'use strict' + +const assert = require('node:assert') +const { kDestroyed, kBodyUsed, kListeners, kBody } = require('./symbols') +const { IncomingMessage } = require('node:http') +const stream = require('node:stream') +const net = require('node:net') +const { Blob } = require('node:buffer') +const nodeUtil = require('node:util') +const { stringify } = require('node:querystring') +const { EventEmitter: EE } = require('node:events') +const { InvalidArgumentError } = require('./errors') +const { headerNameLowerCasedRecord } = require('./constants') +const { tree } = require('./tree') + +const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v)) + +class BodyAsyncIterable { + constructor (body) { + this[kBody] = body + this[kBodyUsed] = false + } + + async * [Symbol.asyncIterator] () { + assert(!this[kBodyUsed], 'disturbed') + this[kBodyUsed] = true + yield * this[kBody] + } +} + +function wrapRequestBody (body) { + if (isStream(body)) { + // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp + // so that it can be dispatched again? + // TODO (fix): Do we need 100-expect support to provide a way to do this properly? + if (bodyLength(body) === 0) { + body + .on('data', function () { + assert(false) + }) + } + + if (typeof body.readableDidRead !== 'boolean') { + body[kBodyUsed] = false + EE.prototype.on.call(body, 'data', function () { + this[kBodyUsed] = true + }) + } + + return body + } else if (body && typeof body.pipeTo === 'function') { + // TODO (fix): We can't access ReadableStream internal state + // to determine whether or not it has been disturbed. This is just + // a workaround. + return new BodyAsyncIterable(body) + } else if ( + body && + typeof body !== 'string' && + !ArrayBuffer.isView(body) && + isIterable(body) + ) { + // TODO: Should we allow re-using iterable if !this.opts.idempotent + // or through some other flag? + return new BodyAsyncIterable(body) + } else { + return body + } +} + +function nop () {} + +function isStream (obj) { + return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function' +} + +// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License) +function isBlobLike (object) { + if (object === null) { + return false + } else if (object instanceof Blob) { + return true + } else if (typeof object !== 'object') { + return false + } else { + const sTag = object[Symbol.toStringTag] + + return (sTag === 'Blob' || sTag === 'File') && ( + ('stream' in object && typeof object.stream === 'function') || + ('arrayBuffer' in object && typeof object.arrayBuffer === 'function') + ) + } +} + +function buildURL (url, queryParams) { + if (url.includes('?') || url.includes('#')) { + throw new Error('Query params cannot be passed when url already contains "?" or "#".') + } + + const stringified = stringify(queryParams) + + if (stringified) { + url += '?' + stringified + } + + return url +} + +function isValidPort (port) { + const value = parseInt(port, 10) + return ( + value === Number(port) && + value >= 0 && + value <= 65535 + ) +} + +function isHttpOrHttpsPrefixed (value) { + return ( + value != null && + value[0] === 'h' && + value[1] === 't' && + value[2] === 't' && + value[3] === 'p' && + ( + value[4] === ':' || + ( + value[4] === 's' && + value[5] === ':' + ) + ) + ) +} + +function parseURL (url) { + if (typeof url === 'string') { + url = new URL(url) + + if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { + throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.') + } + + return url + } + + if (!url || typeof url !== 'object') { + throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.') + } + + if (!(url instanceof URL)) { + if (url.port != null && url.port !== '' && isValidPort(url.port) === false) { + throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.') + } + + if (url.path != null && typeof url.path !== 'string') { + throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.') + } + + if (url.pathname != null && typeof url.pathname !== 'string') { + throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.') + } + + if (url.hostname != null && typeof url.hostname !== 'string') { + throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.') + } + + if (url.origin != null && typeof url.origin !== 'string') { + throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.') + } + + if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { + throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.') + } + + const port = url.port != null + ? url.port + : (url.protocol === 'https:' ? 443 : 80) + let origin = url.origin != null + ? url.origin + : `${url.protocol || ''}//${url.hostname || ''}:${port}` + let path = url.path != null + ? url.path + : `${url.pathname || ''}${url.search || ''}` + + if (origin[origin.length - 1] === '/') { + origin = origin.slice(0, origin.length - 1) + } + + if (path && path[0] !== '/') { + path = `/${path}` + } + // new URL(path, origin) is unsafe when `path` contains an absolute URL + // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL: + // If first parameter is a relative URL, second param is required, and will be used as the base URL. + // If first parameter is an absolute URL, a given second param will be ignored. + return new URL(`${origin}${path}`) + } + + if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { + throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.') + } + + return url +} + +function parseOrigin (url) { + url = parseURL(url) + + if (url.pathname !== '/' || url.search || url.hash) { + throw new InvalidArgumentError('invalid url') + } + + return url +} + +function getHostname (host) { + if (host[0] === '[') { + const idx = host.indexOf(']') + + assert(idx !== -1) + return host.substring(1, idx) + } + + const idx = host.indexOf(':') + if (idx === -1) return host + + return host.substring(0, idx) +} + +// IP addresses are not valid server names per RFC6066 +// > Currently, the only server names supported are DNS hostnames +function getServerName (host) { + if (!host) { + return null + } + + assert(typeof host === 'string') + + const servername = getHostname(host) + if (net.isIP(servername)) { + return '' + } + + return servername +} + +function deepClone (obj) { + return JSON.parse(JSON.stringify(obj)) +} + +function isAsyncIterable (obj) { + return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function') +} + +function isIterable (obj) { + return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function')) +} + +function bodyLength (body) { + if (body == null) { + return 0 + } else if (isStream(body)) { + const state = body._readableState + return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length) + ? state.length + : null + } else if (isBlobLike(body)) { + return body.size != null ? body.size : null + } else if (isBuffer(body)) { + return body.byteLength + } + + return null +} + +function isDestroyed (body) { + return body && !!(body.destroyed || body[kDestroyed] || (stream.isDestroyed?.(body))) +} + +function destroy (stream, err) { + if (stream == null || !isStream(stream) || isDestroyed(stream)) { + return + } + + if (typeof stream.destroy === 'function') { + if (Object.getPrototypeOf(stream).constructor === IncomingMessage) { + // See: https://github.com/nodejs/node/pull/38505/files + stream.socket = null + } + + stream.destroy(err) + } else if (err) { + queueMicrotask(() => { + stream.emit('error', err) + }) + } + + if (stream.destroyed !== true) { + stream[kDestroyed] = true + } +} + +const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/ +function parseKeepAliveTimeout (val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR) + return m ? parseInt(m[1], 10) * 1000 : null +} + +/** + * Retrieves a header name and returns its lowercase value. + * @param {string | Buffer} value Header name + * @returns {string} + */ +function headerNameToString (value) { + return typeof value === 'string' + ? headerNameLowerCasedRecord[value] ?? value.toLowerCase() + : tree.lookup(value) ?? value.toString('latin1').toLowerCase() +} + +/** + * Receive the buffer as a string and return its lowercase value. + * @param {Buffer} value Header name + * @returns {string} + */ +function bufferToLowerCasedHeaderName (value) { + return tree.lookup(value) ?? value.toString('latin1').toLowerCase() +} + +/** + * @param {Record | (Buffer | string | (Buffer | string)[])[]} headers + * @param {Record} [obj] + * @returns {Record} + */ +function parseHeaders (headers, obj) { + if (obj === undefined) obj = {} + for (let i = 0; i < headers.length; i += 2) { + const key = headerNameToString(headers[i]) + let val = obj[key] + + if (val) { + if (typeof val === 'string') { + val = [val] + obj[key] = val + } + val.push(headers[i + 1].toString('utf8')) + } else { + const headersValue = headers[i + 1] + if (typeof headersValue === 'string') { + obj[key] = headersValue + } else { + obj[key] = Array.isArray(headersValue) ? headersValue.map(x => x.toString('utf8')) : headersValue.toString('utf8') + } + } + } + + // See https://github.com/nodejs/node/pull/46528 + if ('content-length' in obj && 'content-disposition' in obj) { + obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1') + } + + return obj +} + +function parseRawHeaders (headers) { + const len = headers.length + const ret = new Array(len) + + let hasContentLength = false + let contentDispositionIdx = -1 + let key + let val + let kLen = 0 + + for (let n = 0; n < headers.length; n += 2) { + key = headers[n] + val = headers[n + 1] + + typeof key !== 'string' && (key = key.toString()) + typeof val !== 'string' && (val = val.toString('utf8')) + + kLen = key.length + if (kLen === 14 && key[7] === '-' && (key === 'content-length' || key.toLowerCase() === 'content-length')) { + hasContentLength = true + } else if (kLen === 19 && key[7] === '-' && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) { + contentDispositionIdx = n + 1 + } + ret[n] = key + ret[n + 1] = val + } + + // See https://github.com/nodejs/node/pull/46528 + if (hasContentLength && contentDispositionIdx !== -1) { + ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1') + } + + return ret +} + +function isBuffer (buffer) { + // See, https://github.com/mcollina/undici/pull/319 + return buffer instanceof Uint8Array || Buffer.isBuffer(buffer) +} + +function validateHandler (handler, method, upgrade) { + if (!handler || typeof handler !== 'object') { + throw new InvalidArgumentError('handler must be an object') + } + + if (typeof handler.onConnect !== 'function') { + throw new InvalidArgumentError('invalid onConnect method') + } + + if (typeof handler.onError !== 'function') { + throw new InvalidArgumentError('invalid onError method') + } + + if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) { + throw new InvalidArgumentError('invalid onBodySent method') + } + + if (upgrade || method === 'CONNECT') { + if (typeof handler.onUpgrade !== 'function') { + throw new InvalidArgumentError('invalid onUpgrade method') + } + } else { + if (typeof handler.onHeaders !== 'function') { + throw new InvalidArgumentError('invalid onHeaders method') + } + + if (typeof handler.onData !== 'function') { + throw new InvalidArgumentError('invalid onData method') + } + + if (typeof handler.onComplete !== 'function') { + throw new InvalidArgumentError('invalid onComplete method') + } + } +} + +// A body is disturbed if it has been read from and it cannot +// be re-used without losing state or data. +function isDisturbed (body) { + // TODO (fix): Why is body[kBodyUsed] needed? + return !!(body && (stream.isDisturbed(body) || body[kBodyUsed])) +} + +function isErrored (body) { + return !!(body && stream.isErrored(body)) +} + +function isReadable (body) { + return !!(body && stream.isReadable(body)) +} + +function getSocketInfo (socket) { + return { + localAddress: socket.localAddress, + localPort: socket.localPort, + remoteAddress: socket.remoteAddress, + remotePort: socket.remotePort, + remoteFamily: socket.remoteFamily, + timeout: socket.timeout, + bytesWritten: socket.bytesWritten, + bytesRead: socket.bytesRead + } +} + +/** @type {globalThis['ReadableStream']} */ +function ReadableStreamFrom (iterable) { + // We cannot use ReadableStream.from here because it does not return a byte stream. + + let iterator + return new ReadableStream( + { + async start () { + iterator = iterable[Symbol.asyncIterator]() + }, + async pull (controller) { + const { done, value } = await iterator.next() + if (done) { + queueMicrotask(() => { + controller.close() + controller.byobRequest?.respond(0) + }) + } else { + const buf = Buffer.isBuffer(value) ? value : Buffer.from(value) + if (buf.byteLength) { + controller.enqueue(new Uint8Array(buf)) + } + } + return controller.desiredSize > 0 + }, + async cancel (reason) { + await iterator.return() + }, + type: 'bytes' + } + ) +} + +// The chunk should be a FormData instance and contains +// all the required methods. +function isFormDataLike (object) { + return ( + object && + typeof object === 'object' && + typeof object.append === 'function' && + typeof object.delete === 'function' && + typeof object.get === 'function' && + typeof object.getAll === 'function' && + typeof object.has === 'function' && + typeof object.set === 'function' && + object[Symbol.toStringTag] === 'FormData' + ) +} + +function addAbortListener (signal, listener) { + if ('addEventListener' in signal) { + signal.addEventListener('abort', listener, { once: true }) + return () => signal.removeEventListener('abort', listener) + } + signal.addListener('abort', listener) + return () => signal.removeListener('abort', listener) +} + +const hasToWellFormed = typeof String.prototype.toWellFormed === 'function' +const hasIsWellFormed = typeof String.prototype.isWellFormed === 'function' + +/** + * @param {string} val + */ +function toUSVString (val) { + return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil.toUSVString(val) +} + +/** + * @param {string} val + */ +// TODO: move this to webidl +function isUSVString (val) { + return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString(val) === `${val}` +} + +/** + * @see https://tools.ietf.org/html/rfc7230#section-3.2.6 + * @param {number} c + */ +function isTokenCharCode (c) { + switch (c) { + case 0x22: + case 0x28: + case 0x29: + case 0x2c: + case 0x2f: + case 0x3a: + case 0x3b: + case 0x3c: + case 0x3d: + case 0x3e: + case 0x3f: + case 0x40: + case 0x5b: + case 0x5c: + case 0x5d: + case 0x7b: + case 0x7d: + // DQUOTE and "(),/:;<=>?@[\]{}" + return false + default: + // VCHAR %x21-7E + return c >= 0x21 && c <= 0x7e + } +} + +/** + * @param {string} characters + */ +function isValidHTTPToken (characters) { + if (characters.length === 0) { + return false + } + for (let i = 0; i < characters.length; ++i) { + if (!isTokenCharCode(characters.charCodeAt(i))) { + return false + } + } + return true +} + +// headerCharRegex have been lifted from +// https://github.com/nodejs/node/blob/main/lib/_http_common.js + +/** + * Matches if val contains an invalid field-vchar + * field-value = *( field-content / obs-fold ) + * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] + * field-vchar = VCHAR / obs-text + */ +const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/ + +/** + * @param {string} characters + */ +function isValidHeaderValue (characters) { + return !headerCharRegex.test(characters) +} + +// Parsed accordingly to RFC 9110 +// https://www.rfc-editor.org/rfc/rfc9110#field.content-range +function parseRangeHeader (range) { + if (range == null || range === '') return { start: 0, end: null, size: null } + + const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null + return m + ? { + start: parseInt(m[1]), + end: m[2] ? parseInt(m[2]) : null, + size: m[3] ? parseInt(m[3]) : null + } + : null +} + +function addListener (obj, name, listener) { + const listeners = (obj[kListeners] ??= []) + listeners.push([name, listener]) + obj.on(name, listener) + return obj +} + +function removeAllListeners (obj) { + for (const [name, listener] of obj[kListeners] ?? []) { + obj.removeListener(name, listener) + } + obj[kListeners] = null +} + +function errorRequest (client, request, err) { + try { + request.onError(err) + assert(request.aborted) + } catch (err) { + client.emit('error', err) + } +} + +const kEnumerableProperty = Object.create(null) +kEnumerableProperty.enumerable = true + +const normalizedMethodRecordsBase = { + delete: 'DELETE', + DELETE: 'DELETE', + get: 'GET', + GET: 'GET', + head: 'HEAD', + HEAD: 'HEAD', + options: 'OPTIONS', + OPTIONS: 'OPTIONS', + post: 'POST', + POST: 'POST', + put: 'PUT', + PUT: 'PUT' +} + +const normalizedMethodRecords = { + ...normalizedMethodRecordsBase, + patch: 'patch', + PATCH: 'PATCH' +} + +// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`. +Object.setPrototypeOf(normalizedMethodRecordsBase, null) +Object.setPrototypeOf(normalizedMethodRecords, null) + +module.exports = { + kEnumerableProperty, + nop, + isDisturbed, + isErrored, + isReadable, + toUSVString, + isUSVString, + isBlobLike, + parseOrigin, + parseURL, + getServerName, + isStream, + isIterable, + isAsyncIterable, + isDestroyed, + headerNameToString, + bufferToLowerCasedHeaderName, + addListener, + removeAllListeners, + errorRequest, + parseRawHeaders, + parseHeaders, + parseKeepAliveTimeout, + destroy, + bodyLength, + deepClone, + ReadableStreamFrom, + isBuffer, + validateHandler, + getSocketInfo, + isFormDataLike, + buildURL, + addAbortListener, + isValidHTTPToken, + isValidHeaderValue, + isTokenCharCode, + parseRangeHeader, + normalizedMethodRecordsBase, + normalizedMethodRecords, + isValidPort, + isHttpOrHttpsPrefixed, + nodeMajor, + nodeMinor, + safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'], + wrapRequestBody +} diff --git a/node/node_modules/npm/node_modules/undici/lib/dispatcher/agent.js b/node/node_modules/npm/node_modules/undici/lib/dispatcher/agent.js new file mode 100644 index 0000000000000000000000000000000000000000..f9efab254db77c06490da07132607e789d35a7b9 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/dispatcher/agent.js @@ -0,0 +1,130 @@ +'use strict' + +const { InvalidArgumentError } = require('../core/errors') +const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require('../core/symbols') +const DispatcherBase = require('./dispatcher-base') +const Pool = require('./pool') +const Client = require('./client') +const util = require('../core/util') +const createRedirectInterceptor = require('../interceptor/redirect-interceptor') + +const kOnConnect = Symbol('onConnect') +const kOnDisconnect = Symbol('onDisconnect') +const kOnConnectionError = Symbol('onConnectionError') +const kMaxRedirections = Symbol('maxRedirections') +const kOnDrain = Symbol('onDrain') +const kFactory = Symbol('factory') +const kOptions = Symbol('options') + +function defaultFactory (origin, opts) { + return opts && opts.connections === 1 + ? new Client(origin, opts) + : new Pool(origin, opts) +} + +class Agent extends DispatcherBase { + constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { + + if (typeof factory !== 'function') { + throw new InvalidArgumentError('factory must be a function.') + } + + if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { + throw new InvalidArgumentError('connect must be a function or an object') + } + + if (!Number.isInteger(maxRedirections) || maxRedirections < 0) { + throw new InvalidArgumentError('maxRedirections must be a positive number') + } + + super(options) + + if (connect && typeof connect !== 'function') { + connect = { ...connect } + } + + this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent) + ? options.interceptors.Agent + : [createRedirectInterceptor({ maxRedirections })] + + this[kOptions] = { ...util.deepClone(options), connect } + this[kOptions].interceptors = options.interceptors + ? { ...options.interceptors } + : undefined + this[kMaxRedirections] = maxRedirections + this[kFactory] = factory + this[kClients] = new Map() + + this[kOnDrain] = (origin, targets) => { + this.emit('drain', origin, [this, ...targets]) + } + + this[kOnConnect] = (origin, targets) => { + this.emit('connect', origin, [this, ...targets]) + } + + this[kOnDisconnect] = (origin, targets, err) => { + this.emit('disconnect', origin, [this, ...targets], err) + } + + this[kOnConnectionError] = (origin, targets, err) => { + this.emit('connectionError', origin, [this, ...targets], err) + } + } + + get [kRunning] () { + let ret = 0 + for (const client of this[kClients].values()) { + ret += client[kRunning] + } + return ret + } + + [kDispatch] (opts, handler) { + let key + if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) { + key = String(opts.origin) + } else { + throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.') + } + + let dispatcher = this[kClients].get(key) + + if (!dispatcher) { + dispatcher = this[kFactory](opts.origin, this[kOptions]) + .on('drain', this[kOnDrain]) + .on('connect', this[kOnConnect]) + .on('disconnect', this[kOnDisconnect]) + .on('connectionError', this[kOnConnectionError]) + + // This introduces a tiny memory leak, as dispatchers are never removed from the map. + // TODO(mcollina): remove te timer when the client/pool do not have any more + // active connections. + this[kClients].set(key, dispatcher) + } + + return dispatcher.dispatch(opts, handler) + } + + async [kClose] () { + const closePromises = [] + for (const client of this[kClients].values()) { + closePromises.push(client.close()) + } + this[kClients].clear() + + await Promise.all(closePromises) + } + + async [kDestroy] (err) { + const destroyPromises = [] + for (const client of this[kClients].values()) { + destroyPromises.push(client.destroy(err)) + } + this[kClients].clear() + + await Promise.all(destroyPromises) + } +} + +module.exports = Agent diff --git a/node/node_modules/npm/node_modules/undici/lib/dispatcher/balanced-pool.js b/node/node_modules/npm/node_modules/undici/lib/dispatcher/balanced-pool.js new file mode 100644 index 0000000000000000000000000000000000000000..770b620aa9ebbe8495cc06f46c2f398f2b4635cb --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/dispatcher/balanced-pool.js @@ -0,0 +1,209 @@ +'use strict' + +const { + BalancedPoolMissingUpstreamError, + InvalidArgumentError +} = require('../core/errors') +const { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kRemoveClient, + kGetDispatcher +} = require('./pool-base') +const Pool = require('./pool') +const { kUrl, kInterceptors } = require('../core/symbols') +const { parseOrigin } = require('../core/util') +const kFactory = Symbol('factory') + +const kOptions = Symbol('options') +const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor') +const kCurrentWeight = Symbol('kCurrentWeight') +const kIndex = Symbol('kIndex') +const kWeight = Symbol('kWeight') +const kMaxWeightPerServer = Symbol('kMaxWeightPerServer') +const kErrorPenalty = Symbol('kErrorPenalty') + +/** + * Calculate the greatest common divisor of two numbers by + * using the Euclidean algorithm. + * + * @param {number} a + * @param {number} b + * @returns {number} + */ +function getGreatestCommonDivisor (a, b) { + if (a === 0) return b + + while (b !== 0) { + const t = b + b = a % b + a = t + } + return a +} + +function defaultFactory (origin, opts) { + return new Pool(origin, opts) +} + +class BalancedPool extends PoolBase { + constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) { + super() + + this[kOptions] = opts + this[kIndex] = -1 + this[kCurrentWeight] = 0 + + this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100 + this[kErrorPenalty] = this[kOptions].errorPenalty || 15 + + if (!Array.isArray(upstreams)) { + upstreams = [upstreams] + } + + if (typeof factory !== 'function') { + throw new InvalidArgumentError('factory must be a function.') + } + + this[kInterceptors] = opts.interceptors?.BalancedPool && Array.isArray(opts.interceptors.BalancedPool) + ? opts.interceptors.BalancedPool + : [] + this[kFactory] = factory + + for (const upstream of upstreams) { + this.addUpstream(upstream) + } + this._updateBalancedPoolStats() + } + + addUpstream (upstream) { + const upstreamOrigin = parseOrigin(upstream).origin + + if (this[kClients].find((pool) => ( + pool[kUrl].origin === upstreamOrigin && + pool.closed !== true && + pool.destroyed !== true + ))) { + return this + } + const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions])) + + this[kAddClient](pool) + pool.on('connect', () => { + pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty]) + }) + + pool.on('connectionError', () => { + pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]) + this._updateBalancedPoolStats() + }) + + pool.on('disconnect', (...args) => { + const err = args[2] + if (err && err.code === 'UND_ERR_SOCKET') { + // decrease the weight of the pool. + pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]) + this._updateBalancedPoolStats() + } + }) + + for (const client of this[kClients]) { + client[kWeight] = this[kMaxWeightPerServer] + } + + this._updateBalancedPoolStats() + + return this + } + + _updateBalancedPoolStats () { + let result = 0 + for (let i = 0; i < this[kClients].length; i++) { + result = getGreatestCommonDivisor(this[kClients][i][kWeight], result) + } + + this[kGreatestCommonDivisor] = result + } + + removeUpstream (upstream) { + const upstreamOrigin = parseOrigin(upstream).origin + + const pool = this[kClients].find((pool) => ( + pool[kUrl].origin === upstreamOrigin && + pool.closed !== true && + pool.destroyed !== true + )) + + if (pool) { + this[kRemoveClient](pool) + } + + return this + } + + get upstreams () { + return this[kClients] + .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true) + .map((p) => p[kUrl].origin) + } + + [kGetDispatcher] () { + // We validate that pools is greater than 0, + // otherwise we would have to wait until an upstream + // is added, which might never happen. + if (this[kClients].length === 0) { + throw new BalancedPoolMissingUpstreamError() + } + + const dispatcher = this[kClients].find(dispatcher => ( + !dispatcher[kNeedDrain] && + dispatcher.closed !== true && + dispatcher.destroyed !== true + )) + + if (!dispatcher) { + return + } + + const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true) + + if (allClientsBusy) { + return + } + + let counter = 0 + + let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain]) + + while (counter++ < this[kClients].length) { + this[kIndex] = (this[kIndex] + 1) % this[kClients].length + const pool = this[kClients][this[kIndex]] + + // find pool index with the largest weight + if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) { + maxWeightIndex = this[kIndex] + } + + // decrease the current weight every `this[kClients].length`. + if (this[kIndex] === 0) { + // Set the current weight to the next lower weight. + this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor] + + if (this[kCurrentWeight] <= 0) { + this[kCurrentWeight] = this[kMaxWeightPerServer] + } + } + if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) { + return pool + } + } + + this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight] + this[kIndex] = maxWeightIndex + return this[kClients][maxWeightIndex] + } +} + +module.exports = BalancedPool diff --git a/node/node_modules/npm/node_modules/undici/lib/dispatcher/client-h1.js b/node/node_modules/npm/node_modules/undici/lib/dispatcher/client-h1.js new file mode 100644 index 0000000000000000000000000000000000000000..4f0c3c3fff359aa63960aeb0228e5779839638dd --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/dispatcher/client-h1.js @@ -0,0 +1,1370 @@ +'use strict' + +/* global WebAssembly */ + +const assert = require('node:assert') +const util = require('../core/util.js') +const { channels } = require('../core/diagnostics.js') +const timers = require('../util/timers.js') +const { + RequestContentLengthMismatchError, + ResponseContentLengthMismatchError, + RequestAbortedError, + HeadersTimeoutError, + HeadersOverflowError, + SocketError, + InformationalError, + BodyTimeoutError, + HTTPParserError, + ResponseExceededMaxSizeError +} = require('../core/errors.js') +const { + kUrl, + kReset, + kClient, + kParser, + kBlocking, + kRunning, + kPending, + kSize, + kWriting, + kQueue, + kNoRef, + kKeepAliveDefaultTimeout, + kHostHeader, + kPendingIdx, + kRunningIdx, + kError, + kPipelining, + kSocket, + kKeepAliveTimeoutValue, + kMaxHeadersSize, + kKeepAliveMaxTimeout, + kKeepAliveTimeoutThreshold, + kHeadersTimeout, + kBodyTimeout, + kStrictContentLength, + kMaxRequests, + kCounter, + kMaxResponseSize, + kOnError, + kResume, + kHTTPContext +} = require('../core/symbols.js') + +const constants = require('../llhttp/constants.js') +const EMPTY_BUF = Buffer.alloc(0) +const FastBuffer = Buffer[Symbol.species] +const addListener = util.addListener +const removeAllListeners = util.removeAllListeners + +let extractBody + +async function lazyllhttp () { + const llhttpWasmData = process.env.JEST_WORKER_ID ? require('../llhttp/llhttp-wasm.js') : undefined + + let mod + try { + mod = await WebAssembly.compile(require('../llhttp/llhttp_simd-wasm.js')) + } catch (e) { + /* istanbul ignore next */ + + // We could check if the error was caused by the simd option not + // being enabled, but the occurring of this other error + // * https://github.com/emscripten-core/emscripten/issues/11495 + // got me to remove that check to avoid breaking Node 12. + mod = await WebAssembly.compile(llhttpWasmData || require('../llhttp/llhttp-wasm.js')) + } + + return await WebAssembly.instantiate(mod, { + env: { + /* eslint-disable camelcase */ + + wasm_on_url: (p, at, len) => { + /* istanbul ignore next */ + return 0 + }, + wasm_on_status: (p, at, len) => { + assert(currentParser.ptr === p) + const start = at - currentBufferPtr + currentBufferRef.byteOffset + return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 + }, + wasm_on_message_begin: (p) => { + assert(currentParser.ptr === p) + return currentParser.onMessageBegin() || 0 + }, + wasm_on_header_field: (p, at, len) => { + assert(currentParser.ptr === p) + const start = at - currentBufferPtr + currentBufferRef.byteOffset + return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 + }, + wasm_on_header_value: (p, at, len) => { + assert(currentParser.ptr === p) + const start = at - currentBufferPtr + currentBufferRef.byteOffset + return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 + }, + wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => { + assert(currentParser.ptr === p) + return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0 + }, + wasm_on_body: (p, at, len) => { + assert(currentParser.ptr === p) + const start = at - currentBufferPtr + currentBufferRef.byteOffset + return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 + }, + wasm_on_message_complete: (p) => { + assert(currentParser.ptr === p) + return currentParser.onMessageComplete() || 0 + } + + /* eslint-enable camelcase */ + } + }) +} + +let llhttpInstance = null +let llhttpPromise = lazyllhttp() +llhttpPromise.catch() + +let currentParser = null +let currentBufferRef = null +let currentBufferSize = 0 +let currentBufferPtr = null + +const USE_NATIVE_TIMER = 0 +const USE_FAST_TIMER = 1 + +// Use fast timers for headers and body to take eventual event loop +// latency into account. +const TIMEOUT_HEADERS = 2 | USE_FAST_TIMER +const TIMEOUT_BODY = 4 | USE_FAST_TIMER + +// Use native timers to ignore event loop latency for keep-alive +// handling. +const TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER + +class Parser { + constructor (client, socket, { exports }) { + assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0) + + this.llhttp = exports + this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE) + this.client = client + this.socket = socket + this.timeout = null + this.timeoutValue = null + this.timeoutType = null + this.statusCode = null + this.statusText = '' + this.upgrade = false + this.headers = [] + this.headersSize = 0 + this.headersMaxSize = client[kMaxHeadersSize] + this.shouldKeepAlive = false + this.paused = false + this.resume = this.resume.bind(this) + + this.bytesRead = 0 + + this.keepAlive = '' + this.contentLength = '' + this.connection = '' + this.maxResponseSize = client[kMaxResponseSize] + } + + setTimeout (delay, type) { + // If the existing timer and the new timer are of different timer type + // (fast or native) or have different delay, we need to clear the existing + // timer and set a new one. + if ( + delay !== this.timeoutValue || + (type & USE_FAST_TIMER) ^ (this.timeoutType & USE_FAST_TIMER) + ) { + // If a timeout is already set, clear it with clearTimeout of the fast + // timer implementation, as it can clear fast and native timers. + if (this.timeout) { + timers.clearTimeout(this.timeout) + this.timeout = null + } + + if (delay) { + if (type & USE_FAST_TIMER) { + this.timeout = timers.setFastTimeout(onParserTimeout, delay, new WeakRef(this)) + } else { + this.timeout = setTimeout(onParserTimeout, delay, new WeakRef(this)) + this.timeout.unref() + } + } + + this.timeoutValue = delay + } else if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) { + this.timeout.refresh() + } + } + + this.timeoutType = type + } + + resume () { + if (this.socket.destroyed || !this.paused) { + return + } + + assert(this.ptr != null) + assert(currentParser == null) + + this.llhttp.llhttp_resume(this.ptr) + + assert(this.timeoutType === TIMEOUT_BODY) + if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) { + this.timeout.refresh() + } + } + + this.paused = false + this.execute(this.socket.read() || EMPTY_BUF) // Flush parser. + this.readMore() + } + + readMore () { + while (!this.paused && this.ptr) { + const chunk = this.socket.read() + if (chunk === null) { + break + } + this.execute(chunk) + } + } + + execute (data) { + assert(this.ptr != null) + assert(currentParser == null) + assert(!this.paused) + + const { socket, llhttp } = this + + if (data.length > currentBufferSize) { + if (currentBufferPtr) { + llhttp.free(currentBufferPtr) + } + currentBufferSize = Math.ceil(data.length / 4096) * 4096 + currentBufferPtr = llhttp.malloc(currentBufferSize) + } + + new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data) + + // Call `execute` on the wasm parser. + // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data, + // and finally the length of bytes to parse. + // The return value is an error code or `constants.ERROR.OK`. + try { + let ret + + try { + currentBufferRef = data + currentParser = this + ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length) + /* eslint-disable-next-line no-useless-catch */ + } catch (err) { + /* istanbul ignore next: difficult to make a test case for */ + throw err + } finally { + currentParser = null + currentBufferRef = null + } + + const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr + + if (ret === constants.ERROR.PAUSED_UPGRADE) { + this.onUpgrade(data.slice(offset)) + } else if (ret === constants.ERROR.PAUSED) { + this.paused = true + socket.unshift(data.slice(offset)) + } else if (ret !== constants.ERROR.OK) { + const ptr = llhttp.llhttp_get_error_reason(this.ptr) + let message = '' + /* istanbul ignore else: difficult to make a test case for */ + if (ptr) { + const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) + message = + 'Response does not match the HTTP/1.1 protocol (' + + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + + ')' + } + throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)) + } + } catch (err) { + util.destroy(socket, err) + } + } + + destroy () { + assert(this.ptr != null) + assert(currentParser == null) + + this.llhttp.llhttp_free(this.ptr) + this.ptr = null + + this.timeout && timers.clearTimeout(this.timeout) + this.timeout = null + this.timeoutValue = null + this.timeoutType = null + + this.paused = false + } + + onStatus (buf) { + this.statusText = buf.toString() + } + + onMessageBegin () { + const { socket, client } = this + + /* istanbul ignore next: difficult to make a test case for */ + if (socket.destroyed) { + return -1 + } + + const request = client[kQueue][client[kRunningIdx]] + if (!request) { + return -1 + } + request.onResponseStarted() + } + + onHeaderField (buf) { + const len = this.headers.length + + if ((len & 1) === 0) { + this.headers.push(buf) + } else { + this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]) + } + + this.trackHeader(buf.length) + } + + onHeaderValue (buf) { + let len = this.headers.length + + if ((len & 1) === 1) { + this.headers.push(buf) + len += 1 + } else { + this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]) + } + + const key = this.headers[len - 2] + if (key.length === 10) { + const headerName = util.bufferToLowerCasedHeaderName(key) + if (headerName === 'keep-alive') { + this.keepAlive += buf.toString() + } else if (headerName === 'connection') { + this.connection += buf.toString() + } + } else if (key.length === 14 && util.bufferToLowerCasedHeaderName(key) === 'content-length') { + this.contentLength += buf.toString() + } + + this.trackHeader(buf.length) + } + + trackHeader (len) { + this.headersSize += len + if (this.headersSize >= this.headersMaxSize) { + util.destroy(this.socket, new HeadersOverflowError()) + } + } + + onUpgrade (head) { + const { upgrade, client, socket, headers, statusCode } = this + + assert(upgrade) + assert(client[kSocket] === socket) + assert(!socket.destroyed) + assert(!this.paused) + assert((headers.length & 1) === 0) + + const request = client[kQueue][client[kRunningIdx]] + assert(request) + assert(request.upgrade || request.method === 'CONNECT') + + this.statusCode = null + this.statusText = '' + this.shouldKeepAlive = null + + this.headers = [] + this.headersSize = 0 + + socket.unshift(head) + + socket[kParser].destroy() + socket[kParser] = null + + socket[kClient] = null + socket[kError] = null + + removeAllListeners(socket) + + client[kSocket] = null + client[kHTTPContext] = null // TODO (fix): This is hacky... + client[kQueue][client[kRunningIdx]++] = null + client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade')) + + try { + request.onUpgrade(statusCode, headers, socket) + } catch (err) { + util.destroy(socket, err) + } + + client[kResume]() + } + + onHeadersComplete (statusCode, upgrade, shouldKeepAlive) { + const { client, socket, headers, statusText } = this + + /* istanbul ignore next: difficult to make a test case for */ + if (socket.destroyed) { + return -1 + } + + const request = client[kQueue][client[kRunningIdx]] + + /* istanbul ignore next: difficult to make a test case for */ + if (!request) { + return -1 + } + + assert(!this.upgrade) + assert(this.statusCode < 200) + + if (statusCode === 100) { + util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) + return -1 + } + + /* this can only happen if server is misbehaving */ + if (upgrade && !request.upgrade) { + util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket))) + return -1 + } + + assert(this.timeoutType === TIMEOUT_HEADERS) + + this.statusCode = statusCode + this.shouldKeepAlive = ( + shouldKeepAlive || + // Override llhttp value which does not allow keepAlive for HEAD. + (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive') + ) + + if (this.statusCode >= 200) { + const bodyTimeout = request.bodyTimeout != null + ? request.bodyTimeout + : client[kBodyTimeout] + this.setTimeout(bodyTimeout, TIMEOUT_BODY) + } else if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) { + this.timeout.refresh() + } + } + + if (request.method === 'CONNECT') { + assert(client[kRunning] === 1) + this.upgrade = true + return 2 + } + + if (upgrade) { + assert(client[kRunning] === 1) + this.upgrade = true + return 2 + } + + assert((this.headers.length & 1) === 0) + this.headers = [] + this.headersSize = 0 + + if (this.shouldKeepAlive && client[kPipelining]) { + const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null + + if (keepAliveTimeout != null) { + const timeout = Math.min( + keepAliveTimeout - client[kKeepAliveTimeoutThreshold], + client[kKeepAliveMaxTimeout] + ) + if (timeout <= 0) { + socket[kReset] = true + } else { + client[kKeepAliveTimeoutValue] = timeout + } + } else { + client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout] + } + } else { + // Stop more requests from being dispatched. + socket[kReset] = true + } + + const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false + + if (request.aborted) { + return -1 + } + + if (request.method === 'HEAD') { + return 1 + } + + if (statusCode < 200) { + return 1 + } + + if (socket[kBlocking]) { + socket[kBlocking] = false + client[kResume]() + } + + return pause ? constants.ERROR.PAUSED : 0 + } + + onBody (buf) { + const { client, socket, statusCode, maxResponseSize } = this + + if (socket.destroyed) { + return -1 + } + + const request = client[kQueue][client[kRunningIdx]] + assert(request) + + assert(this.timeoutType === TIMEOUT_BODY) + if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) { + this.timeout.refresh() + } + } + + assert(statusCode >= 200) + + if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { + util.destroy(socket, new ResponseExceededMaxSizeError()) + return -1 + } + + this.bytesRead += buf.length + + if (request.onData(buf) === false) { + return constants.ERROR.PAUSED + } + } + + onMessageComplete () { + const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this + + if (socket.destroyed && (!statusCode || shouldKeepAlive)) { + return -1 + } + + if (upgrade) { + return + } + + assert(statusCode >= 100) + assert((this.headers.length & 1) === 0) + + const request = client[kQueue][client[kRunningIdx]] + assert(request) + + this.statusCode = null + this.statusText = '' + this.bytesRead = 0 + this.contentLength = '' + this.keepAlive = '' + this.connection = '' + + this.headers = [] + this.headersSize = 0 + + if (statusCode < 200) { + return + } + + /* istanbul ignore next: should be handled by llhttp? */ + if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) { + util.destroy(socket, new ResponseContentLengthMismatchError()) + return -1 + } + + request.onComplete(headers) + + client[kQueue][client[kRunningIdx]++] = null + + if (socket[kWriting]) { + assert(client[kRunning] === 0) + // Response completed before request. + util.destroy(socket, new InformationalError('reset')) + return constants.ERROR.PAUSED + } else if (!shouldKeepAlive) { + util.destroy(socket, new InformationalError('reset')) + return constants.ERROR.PAUSED + } else if (socket[kReset] && client[kRunning] === 0) { + // Destroy socket once all requests have completed. + // The request at the tail of the pipeline is the one + // that requested reset and no further requests should + // have been queued since then. + util.destroy(socket, new InformationalError('reset')) + return constants.ERROR.PAUSED + } else if (client[kPipelining] == null || client[kPipelining] === 1) { + // We must wait a full event loop cycle to reuse this socket to make sure + // that non-spec compliant servers are not closing the connection even if they + // said they won't. + setImmediate(() => client[kResume]()) + } else { + client[kResume]() + } + } +} + +function onParserTimeout (parser) { + const { socket, timeoutType, client, paused } = parser.deref() + + /* istanbul ignore else */ + if (timeoutType === TIMEOUT_HEADERS) { + if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { + assert(!paused, 'cannot be paused while waiting for headers') + util.destroy(socket, new HeadersTimeoutError()) + } + } else if (timeoutType === TIMEOUT_BODY) { + if (!paused) { + util.destroy(socket, new BodyTimeoutError()) + } + } else if (timeoutType === TIMEOUT_KEEP_ALIVE) { + assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]) + util.destroy(socket, new InformationalError('socket idle timeout')) + } +} + +async function connectH1 (client, socket) { + client[kSocket] = socket + + if (!llhttpInstance) { + llhttpInstance = await llhttpPromise + llhttpPromise = null + } + + socket[kNoRef] = false + socket[kWriting] = false + socket[kReset] = false + socket[kBlocking] = false + socket[kParser] = new Parser(client, socket, llhttpInstance) + + addListener(socket, 'error', function (err) { + assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID') + + const parser = this[kParser] + + // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded + // to the user. + if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) { + // We treat all incoming data so for as a valid response. + parser.onMessageComplete() + return + } + + this[kError] = err + + this[kClient][kOnError](err) + }) + addListener(socket, 'readable', function () { + const parser = this[kParser] + + if (parser) { + parser.readMore() + } + }) + addListener(socket, 'end', function () { + const parser = this[kParser] + + if (parser.statusCode && !parser.shouldKeepAlive) { + // We treat all incoming data so far as a valid response. + parser.onMessageComplete() + return + } + + util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this))) + }) + addListener(socket, 'close', function () { + const client = this[kClient] + const parser = this[kParser] + + if (parser) { + if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { + // We treat all incoming data so far as a valid response. + parser.onMessageComplete() + } + + this[kParser].destroy() + this[kParser] = null + } + + const err = this[kError] || new SocketError('closed', util.getSocketInfo(this)) + + client[kSocket] = null + client[kHTTPContext] = null // TODO (fix): This is hacky... + + if (client.destroyed) { + assert(client[kPending] === 0) + + // Fail entire queue. + const requests = client[kQueue].splice(client[kRunningIdx]) + for (let i = 0; i < requests.length; i++) { + const request = requests[i] + util.errorRequest(client, request, err) + } + } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') { + // Fail head of pipeline. + const request = client[kQueue][client[kRunningIdx]] + client[kQueue][client[kRunningIdx]++] = null + + util.errorRequest(client, request, err) + } + + client[kPendingIdx] = client[kRunningIdx] + + assert(client[kRunning] === 0) + + client.emit('disconnect', client[kUrl], [client], err) + + client[kResume]() + }) + + let closed = false + socket.on('close', () => { + closed = true + }) + + return { + version: 'h1', + defaultPipelining: 1, + write (...args) { + return writeH1(client, ...args) + }, + resume () { + resumeH1(client) + }, + destroy (err, callback) { + if (closed) { + queueMicrotask(callback) + } else { + socket.destroy(err).on('close', callback) + } + }, + get destroyed () { + return socket.destroyed + }, + busy (request) { + if (socket[kWriting] || socket[kReset] || socket[kBlocking]) { + return true + } + + if (request) { + if (client[kRunning] > 0 && !request.idempotent) { + // Non-idempotent request cannot be retried. + // Ensure that no other requests are inflight and + // could cause failure. + return true + } + + if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) { + // Don't dispatch an upgrade until all preceding requests have completed. + // A misbehaving server might upgrade the connection before all pipelined + // request has completed. + return true + } + + if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 && + (util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) { + // Request with stream or iterator body can error while other requests + // are inflight and indirectly error those as well. + // Ensure this doesn't happen by waiting for inflight + // to complete before dispatching. + + // Request with stream or iterator body cannot be retried. + // Ensure that no other requests are inflight and + // could cause failure. + return true + } + } + + return false + } + } +} + +function resumeH1 (client) { + const socket = client[kSocket] + + if (socket && !socket.destroyed) { + if (client[kSize] === 0) { + if (!socket[kNoRef] && socket.unref) { + socket.unref() + socket[kNoRef] = true + } + } else if (socket[kNoRef] && socket.ref) { + socket.ref() + socket[kNoRef] = false + } + + if (client[kSize] === 0) { + if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) { + socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE) + } + } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) { + if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) { + const request = client[kQueue][client[kRunningIdx]] + const headersTimeout = request.headersTimeout != null + ? request.headersTimeout + : client[kHeadersTimeout] + socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS) + } + } + } +} + +// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2 +function shouldSendContentLength (method) { + return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT' +} + +function writeH1 (client, request) { + const { method, path, host, upgrade, blocking, reset } = request + + let { body, headers, contentLength } = request + + // https://tools.ietf.org/html/rfc7231#section-4.3.1 + // https://tools.ietf.org/html/rfc7231#section-4.3.2 + // https://tools.ietf.org/html/rfc7231#section-4.3.5 + + // Sending a payload body on a request that does not + // expect it can cause undefined behavior on some + // servers and corrupt connection state. Do not + // re-use the connection for further requests. + + const expectsPayload = ( + method === 'PUT' || + method === 'POST' || + method === 'PATCH' || + method === 'QUERY' || + method === 'PROPFIND' || + method === 'PROPPATCH' + ) + + if (util.isFormDataLike(body)) { + if (!extractBody) { + extractBody = require('../web/fetch/body.js').extractBody + } + + const [bodyStream, contentType] = extractBody(body) + if (request.contentType == null) { + headers.push('content-type', contentType) + } + body = bodyStream.stream + contentLength = bodyStream.length + } else if (util.isBlobLike(body) && request.contentType == null && body.type) { + headers.push('content-type', body.type) + } + + if (body && typeof body.read === 'function') { + // Try to read EOF in order to get length. + body.read(0) + } + + const bodyLength = util.bodyLength(body) + + contentLength = bodyLength ?? contentLength + + if (contentLength === null) { + contentLength = request.contentLength + } + + if (contentLength === 0 && !expectsPayload) { + // https://tools.ietf.org/html/rfc7230#section-3.3.2 + // A user agent SHOULD NOT send a Content-Length header field when + // the request message does not contain a payload body and the method + // semantics do not anticipate such a body. + + contentLength = null + } + + // https://github.com/nodejs/undici/issues/2046 + // A user agent may send a Content-Length header with 0 value, this should be allowed. + if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) { + if (client[kStrictContentLength]) { + util.errorRequest(client, request, new RequestContentLengthMismatchError()) + return false + } + + process.emitWarning(new RequestContentLengthMismatchError()) + } + + const socket = client[kSocket] + + const abort = (err) => { + if (request.aborted || request.completed) { + return + } + + util.errorRequest(client, request, err || new RequestAbortedError()) + + util.destroy(body) + util.destroy(socket, new InformationalError('aborted')) + } + + try { + request.onConnect(abort) + } catch (err) { + util.errorRequest(client, request, err) + } + + if (request.aborted) { + return false + } + + if (method === 'HEAD') { + // https://github.com/mcollina/undici/issues/258 + // Close after a HEAD request to interop with misbehaving servers + // that may send a body in the response. + + socket[kReset] = true + } + + if (upgrade || method === 'CONNECT') { + // On CONNECT or upgrade, block pipeline from dispatching further + // requests on this connection. + + socket[kReset] = true + } + + if (reset != null) { + socket[kReset] = reset + } + + if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) { + socket[kReset] = true + } + + if (blocking) { + socket[kBlocking] = true + } + + let header = `${method} ${path} HTTP/1.1\r\n` + + if (typeof host === 'string') { + header += `host: ${host}\r\n` + } else { + header += client[kHostHeader] + } + + if (upgrade) { + header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n` + } else if (client[kPipelining] && !socket[kReset]) { + header += 'connection: keep-alive\r\n' + } else { + header += 'connection: close\r\n' + } + + if (Array.isArray(headers)) { + for (let n = 0; n < headers.length; n += 2) { + const key = headers[n + 0] + const val = headers[n + 1] + + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { + header += `${key}: ${val[i]}\r\n` + } + } else { + header += `${key}: ${val}\r\n` + } + } + } + + if (channels.sendHeaders.hasSubscribers) { + channels.sendHeaders.publish({ request, headers: header, socket }) + } + + /* istanbul ignore else: assertion */ + if (!body || bodyLength === 0) { + writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload) + } else if (util.isBuffer(body)) { + writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload) + } else if (util.isBlobLike(body)) { + if (typeof body.stream === 'function') { + writeIterable(abort, body.stream(), client, request, socket, contentLength, header, expectsPayload) + } else { + writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload) + } + } else if (util.isStream(body)) { + writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload) + } else if (util.isIterable(body)) { + writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload) + } else { + assert(false) + } + + return true +} + +function writeStream (abort, body, client, request, socket, contentLength, header, expectsPayload) { + assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined') + + let finished = false + + const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header }) + + const onData = function (chunk) { + if (finished) { + return + } + + try { + if (!writer.write(chunk) && this.pause) { + this.pause() + } + } catch (err) { + util.destroy(this, err) + } + } + const onDrain = function () { + if (finished) { + return + } + + if (body.resume) { + body.resume() + } + } + const onClose = function () { + // 'close' might be emitted *before* 'error' for + // broken streams. Wait a tick to avoid this case. + queueMicrotask(() => { + // It's only safe to remove 'error' listener after + // 'close'. + body.removeListener('error', onFinished) + }) + + if (!finished) { + const err = new RequestAbortedError() + queueMicrotask(() => onFinished(err)) + } + } + const onFinished = function (err) { + if (finished) { + return + } + + finished = true + + assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1)) + + socket + .off('drain', onDrain) + .off('error', onFinished) + + body + .removeListener('data', onData) + .removeListener('end', onFinished) + .removeListener('close', onClose) + + if (!err) { + try { + writer.end() + } catch (er) { + err = er + } + } + + writer.destroy(err) + + if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) { + util.destroy(body, err) + } else { + util.destroy(body) + } + } + + body + .on('data', onData) + .on('end', onFinished) + .on('error', onFinished) + .on('close', onClose) + + if (body.resume) { + body.resume() + } + + socket + .on('drain', onDrain) + .on('error', onFinished) + + if (body.errorEmitted ?? body.errored) { + setImmediate(() => onFinished(body.errored)) + } else if (body.endEmitted ?? body.readableEnded) { + setImmediate(() => onFinished(null)) + } + + if (body.closeEmitted ?? body.closed) { + setImmediate(onClose) + } +} + +function writeBuffer (abort, body, client, request, socket, contentLength, header, expectsPayload) { + try { + if (!body) { + if (contentLength === 0) { + socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1') + } else { + assert(contentLength === null, 'no body must not have content length') + socket.write(`${header}\r\n`, 'latin1') + } + } else if (util.isBuffer(body)) { + assert(contentLength === body.byteLength, 'buffer body must have content length') + + socket.cork() + socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') + socket.write(body) + socket.uncork() + request.onBodySent(body) + + if (!expectsPayload && request.reset !== false) { + socket[kReset] = true + } + } + request.onRequestSent() + + client[kResume]() + } catch (err) { + abort(err) + } +} + +async function writeBlob (abort, body, client, request, socket, contentLength, header, expectsPayload) { + assert(contentLength === body.size, 'blob body must have content length') + + try { + if (contentLength != null && contentLength !== body.size) { + throw new RequestContentLengthMismatchError() + } + + const buffer = Buffer.from(await body.arrayBuffer()) + + socket.cork() + socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') + socket.write(buffer) + socket.uncork() + + request.onBodySent(buffer) + request.onRequestSent() + + if (!expectsPayload && request.reset !== false) { + socket[kReset] = true + } + + client[kResume]() + } catch (err) { + abort(err) + } +} + +async function writeIterable (abort, body, client, request, socket, contentLength, header, expectsPayload) { + assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined') + + let callback = null + function onDrain () { + if (callback) { + const cb = callback + callback = null + cb() + } + } + + const waitForDrain = () => new Promise((resolve, reject) => { + assert(callback === null) + + if (socket[kError]) { + reject(socket[kError]) + } else { + callback = resolve + } + }) + + socket + .on('close', onDrain) + .on('drain', onDrain) + + const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header }) + try { + // It's up to the user to somehow abort the async iterable. + for await (const chunk of body) { + if (socket[kError]) { + throw socket[kError] + } + + if (!writer.write(chunk)) { + await waitForDrain() + } + } + + writer.end() + } catch (err) { + writer.destroy(err) + } finally { + socket + .off('close', onDrain) + .off('drain', onDrain) + } +} + +class AsyncWriter { + constructor ({ abort, socket, request, contentLength, client, expectsPayload, header }) { + this.socket = socket + this.request = request + this.contentLength = contentLength + this.client = client + this.bytesWritten = 0 + this.expectsPayload = expectsPayload + this.header = header + this.abort = abort + + socket[kWriting] = true + } + + write (chunk) { + const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this + + if (socket[kError]) { + throw socket[kError] + } + + if (socket.destroyed) { + return false + } + + const len = Buffer.byteLength(chunk) + if (!len) { + return true + } + + // We should defer writing chunks. + if (contentLength !== null && bytesWritten + len > contentLength) { + if (client[kStrictContentLength]) { + throw new RequestContentLengthMismatchError() + } + + process.emitWarning(new RequestContentLengthMismatchError()) + } + + socket.cork() + + if (bytesWritten === 0) { + if (!expectsPayload && request.reset !== false) { + socket[kReset] = true + } + + if (contentLength === null) { + socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1') + } else { + socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') + } + } + + if (contentLength === null) { + socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1') + } + + this.bytesWritten += len + + const ret = socket.write(chunk) + + socket.uncork() + + request.onBodySent(chunk) + + if (!ret) { + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { + // istanbul ignore else: only for jest + if (socket[kParser].timeout.refresh) { + socket[kParser].timeout.refresh() + } + } + } + + return ret + } + + end () { + const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this + request.onRequestSent() + + socket[kWriting] = false + + if (socket[kError]) { + throw socket[kError] + } + + if (socket.destroyed) { + return + } + + if (bytesWritten === 0) { + if (expectsPayload) { + // https://tools.ietf.org/html/rfc7230#section-3.3.2 + // A user agent SHOULD send a Content-Length in a request message when + // no Transfer-Encoding is sent and the request method defines a meaning + // for an enclosed payload body. + + socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1') + } else { + socket.write(`${header}\r\n`, 'latin1') + } + } else if (contentLength === null) { + socket.write('\r\n0\r\n\r\n', 'latin1') + } + + if (contentLength !== null && bytesWritten !== contentLength) { + if (client[kStrictContentLength]) { + throw new RequestContentLengthMismatchError() + } else { + process.emitWarning(new RequestContentLengthMismatchError()) + } + } + + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { + // istanbul ignore else: only for jest + if (socket[kParser].timeout.refresh) { + socket[kParser].timeout.refresh() + } + } + + client[kResume]() + } + + destroy (err) { + const { socket, client, abort } = this + + socket[kWriting] = false + + if (err) { + assert(client[kRunning] <= 1, 'pipeline should only contain this request') + abort(err) + } + } +} + +module.exports = connectH1 diff --git a/node/node_modules/npm/node_modules/undici/lib/dispatcher/client-h2.js b/node/node_modules/npm/node_modules/undici/lib/dispatcher/client-h2.js new file mode 100644 index 0000000000000000000000000000000000000000..6aa02130c439635c855136686a3a073bf5b2b468 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/dispatcher/client-h2.js @@ -0,0 +1,744 @@ +'use strict' + +const assert = require('node:assert') +const { pipeline } = require('node:stream') +const util = require('../core/util.js') +const { + RequestContentLengthMismatchError, + RequestAbortedError, + SocketError, + InformationalError +} = require('../core/errors.js') +const { + kUrl, + kReset, + kClient, + kRunning, + kPending, + kQueue, + kPendingIdx, + kRunningIdx, + kError, + kSocket, + kStrictContentLength, + kOnError, + kMaxConcurrentStreams, + kHTTP2Session, + kResume, + kSize, + kHTTPContext +} = require('../core/symbols.js') + +const kOpenStreams = Symbol('open streams') + +let extractBody + +// Experimental +let h2ExperimentalWarned = false + +/** @type {import('http2')} */ +let http2 +try { + http2 = require('node:http2') +} catch { + // @ts-ignore + http2 = { constants: {} } +} + +const { + constants: { + HTTP2_HEADER_AUTHORITY, + HTTP2_HEADER_METHOD, + HTTP2_HEADER_PATH, + HTTP2_HEADER_SCHEME, + HTTP2_HEADER_CONTENT_LENGTH, + HTTP2_HEADER_EXPECT, + HTTP2_HEADER_STATUS + } +} = http2 + +function parseH2Headers (headers) { + const result = [] + + for (const [name, value] of Object.entries(headers)) { + // h2 may concat the header value by array + // e.g. Set-Cookie + if (Array.isArray(value)) { + for (const subvalue of value) { + // we need to provide each header value of header name + // because the headers handler expect name-value pair + result.push(Buffer.from(name), Buffer.from(subvalue)) + } + } else { + result.push(Buffer.from(name), Buffer.from(value)) + } + } + + return result +} + +async function connectH2 (client, socket) { + client[kSocket] = socket + + if (!h2ExperimentalWarned) { + h2ExperimentalWarned = true + process.emitWarning('H2 support is experimental, expect them to change at any time.', { + code: 'UNDICI-H2' + }) + } + + const session = http2.connect(client[kUrl], { + createConnection: () => socket, + peerMaxConcurrentStreams: client[kMaxConcurrentStreams] + }) + + session[kOpenStreams] = 0 + session[kClient] = client + session[kSocket] = socket + + util.addListener(session, 'error', onHttp2SessionError) + util.addListener(session, 'frameError', onHttp2FrameError) + util.addListener(session, 'end', onHttp2SessionEnd) + util.addListener(session, 'goaway', onHTTP2GoAway) + util.addListener(session, 'close', function () { + const { [kClient]: client } = this + const { [kSocket]: socket } = client + + const err = this[kSocket][kError] || this[kError] || new SocketError('closed', util.getSocketInfo(socket)) + + client[kHTTP2Session] = null + + if (client.destroyed) { + assert(client[kPending] === 0) + + // Fail entire queue. + const requests = client[kQueue].splice(client[kRunningIdx]) + for (let i = 0; i < requests.length; i++) { + const request = requests[i] + util.errorRequest(client, request, err) + } + } + }) + + session.unref() + + client[kHTTP2Session] = session + socket[kHTTP2Session] = session + + util.addListener(socket, 'error', function (err) { + assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID') + + this[kError] = err + + this[kClient][kOnError](err) + }) + + util.addListener(socket, 'end', function () { + util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this))) + }) + + util.addListener(socket, 'close', function () { + const err = this[kError] || new SocketError('closed', util.getSocketInfo(this)) + + client[kSocket] = null + + if (this[kHTTP2Session] != null) { + this[kHTTP2Session].destroy(err) + } + + client[kPendingIdx] = client[kRunningIdx] + + assert(client[kRunning] === 0) + + client.emit('disconnect', client[kUrl], [client], err) + + client[kResume]() + }) + + let closed = false + socket.on('close', () => { + closed = true + }) + + return { + version: 'h2', + defaultPipelining: Infinity, + write (...args) { + return writeH2(client, ...args) + }, + resume () { + resumeH2(client) + }, + destroy (err, callback) { + if (closed) { + queueMicrotask(callback) + } else { + // Destroying the socket will trigger the session close + socket.destroy(err).on('close', callback) + } + }, + get destroyed () { + return socket.destroyed + }, + busy () { + return false + } + } +} + +function resumeH2 (client) { + const socket = client[kSocket] + + if (socket?.destroyed === false) { + if (client[kSize] === 0 && client[kMaxConcurrentStreams] === 0) { + socket.unref() + client[kHTTP2Session].unref() + } else { + socket.ref() + client[kHTTP2Session].ref() + } + } +} + +function onHttp2SessionError (err) { + assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID') + + this[kSocket][kError] = err + this[kClient][kOnError](err) +} + +function onHttp2FrameError (type, code, id) { + if (id === 0) { + const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`) + this[kSocket][kError] = err + this[kClient][kOnError](err) + } +} + +function onHttp2SessionEnd () { + const err = new SocketError('other side closed', util.getSocketInfo(this[kSocket])) + this.destroy(err) + util.destroy(this[kSocket], err) +} + +/** + * This is the root cause of #3011 + * We need to handle GOAWAY frames properly, and trigger the session close + * along with the socket right away + */ +function onHTTP2GoAway (code) { + // We cannot recover, so best to close the session and the socket + const err = this[kError] || new SocketError(`HTTP/2: "GOAWAY" frame received with code ${code}`, util.getSocketInfo(this)) + const client = this[kClient] + + client[kSocket] = null + client[kHTTPContext] = null + + if (this[kHTTP2Session] != null) { + this[kHTTP2Session].destroy(err) + this[kHTTP2Session] = null + } + + util.destroy(this[kSocket], err) + + // Fail head of pipeline. + if (client[kRunningIdx] < client[kQueue].length) { + const request = client[kQueue][client[kRunningIdx]] + client[kQueue][client[kRunningIdx]++] = null + util.errorRequest(client, request, err) + client[kPendingIdx] = client[kRunningIdx] + } + + assert(client[kRunning] === 0) + + client.emit('disconnect', client[kUrl], [client], err) + + client[kResume]() +} + +// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2 +function shouldSendContentLength (method) { + return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT' +} + +function writeH2 (client, request) { + const session = client[kHTTP2Session] + const { method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request + let { body } = request + + if (upgrade) { + util.errorRequest(client, request, new Error('Upgrade not supported for H2')) + return false + } + + const headers = {} + for (let n = 0; n < reqHeaders.length; n += 2) { + const key = reqHeaders[n + 0] + const val = reqHeaders[n + 1] + + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { + if (headers[key]) { + headers[key] += `,${val[i]}` + } else { + headers[key] = val[i] + } + } + } else { + headers[key] = val + } + } + + /** @type {import('node:http2').ClientHttp2Stream} */ + let stream + + const { hostname, port } = client[kUrl] + + headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ''}` + headers[HTTP2_HEADER_METHOD] = method + + const abort = (err) => { + if (request.aborted || request.completed) { + return + } + + err = err || new RequestAbortedError() + + util.errorRequest(client, request, err) + + if (stream != null) { + util.destroy(stream, err) + } + + // We do not destroy the socket as we can continue using the session + // the stream get's destroyed and the session remains to create new streams + util.destroy(body, err) + client[kQueue][client[kRunningIdx]++] = null + client[kResume]() + } + + try { + // We are already connected, streams are pending. + // We can call on connect, and wait for abort + request.onConnect(abort) + } catch (err) { + util.errorRequest(client, request, err) + } + + if (request.aborted) { + return false + } + + if (method === 'CONNECT') { + session.ref() + // We are already connected, streams are pending, first request + // will create a new stream. We trigger a request to create the stream and wait until + // `ready` event is triggered + // We disabled endStream to allow the user to write to the stream + stream = session.request(headers, { endStream: false, signal }) + + if (stream.id && !stream.pending) { + request.onUpgrade(null, null, stream) + ++session[kOpenStreams] + client[kQueue][client[kRunningIdx]++] = null + } else { + stream.once('ready', () => { + request.onUpgrade(null, null, stream) + ++session[kOpenStreams] + client[kQueue][client[kRunningIdx]++] = null + }) + } + + stream.once('close', () => { + session[kOpenStreams] -= 1 + if (session[kOpenStreams] === 0) session.unref() + }) + + return true + } + + // https://tools.ietf.org/html/rfc7540#section-8.3 + // :path and :scheme headers must be omitted when sending CONNECT + + headers[HTTP2_HEADER_PATH] = path + headers[HTTP2_HEADER_SCHEME] = 'https' + + // https://tools.ietf.org/html/rfc7231#section-4.3.1 + // https://tools.ietf.org/html/rfc7231#section-4.3.2 + // https://tools.ietf.org/html/rfc7231#section-4.3.5 + + // Sending a payload body on a request that does not + // expect it can cause undefined behavior on some + // servers and corrupt connection state. Do not + // re-use the connection for further requests. + + const expectsPayload = ( + method === 'PUT' || + method === 'POST' || + method === 'PATCH' + ) + + if (body && typeof body.read === 'function') { + // Try to read EOF in order to get length. + body.read(0) + } + + let contentLength = util.bodyLength(body) + + if (util.isFormDataLike(body)) { + extractBody ??= require('../web/fetch/body.js').extractBody + + const [bodyStream, contentType] = extractBody(body) + headers['content-type'] = contentType + + body = bodyStream.stream + contentLength = bodyStream.length + } + + if (contentLength == null) { + contentLength = request.contentLength + } + + if (contentLength === 0 || !expectsPayload) { + // https://tools.ietf.org/html/rfc7230#section-3.3.2 + // A user agent SHOULD NOT send a Content-Length header field when + // the request message does not contain a payload body and the method + // semantics do not anticipate such a body. + + contentLength = null + } + + // https://github.com/nodejs/undici/issues/2046 + // A user agent may send a Content-Length header with 0 value, this should be allowed. + if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) { + if (client[kStrictContentLength]) { + util.errorRequest(client, request, new RequestContentLengthMismatchError()) + return false + } + + process.emitWarning(new RequestContentLengthMismatchError()) + } + + if (contentLength != null) { + assert(body, 'no body must not have content length') + headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}` + } + + session.ref() + + const shouldEndStream = method === 'GET' || method === 'HEAD' || body === null + if (expectContinue) { + headers[HTTP2_HEADER_EXPECT] = '100-continue' + stream = session.request(headers, { endStream: shouldEndStream, signal }) + + stream.once('continue', writeBodyH2) + } else { + stream = session.request(headers, { + endStream: shouldEndStream, + signal + }) + writeBodyH2() + } + + // Increment counter as we have new streams open + ++session[kOpenStreams] + + stream.once('response', headers => { + const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers + request.onResponseStarted() + + // Due to the stream nature, it is possible we face a race condition + // where the stream has been assigned, but the request has been aborted + // the request remains in-flight and headers hasn't been received yet + // for those scenarios, best effort is to destroy the stream immediately + // as there's no value to keep it open. + if (request.aborted) { + const err = new RequestAbortedError() + util.errorRequest(client, request, err) + util.destroy(stream, err) + return + } + + if (request.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), '') === false) { + stream.pause() + } + + stream.on('data', (chunk) => { + if (request.onData(chunk) === false) { + stream.pause() + } + }) + }) + + stream.once('end', () => { + // When state is null, it means we haven't consumed body and the stream still do not have + // a state. + // Present specially when using pipeline or stream + if (stream.state?.state == null || stream.state.state < 6) { + request.onComplete([]) + } + + if (session[kOpenStreams] === 0) { + // Stream is closed or half-closed-remote (6), decrement counter and cleanup + // It does not have sense to continue working with the stream as we do not + // have yet RST_STREAM support on client-side + + session.unref() + } + + abort(new InformationalError('HTTP/2: stream half-closed (remote)')) + client[kQueue][client[kRunningIdx]++] = null + client[kPendingIdx] = client[kRunningIdx] + client[kResume]() + }) + + stream.once('close', () => { + session[kOpenStreams] -= 1 + if (session[kOpenStreams] === 0) { + session.unref() + } + }) + + stream.once('error', function (err) { + abort(err) + }) + + stream.once('frameError', (type, code) => { + abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)) + }) + + // stream.on('aborted', () => { + // // TODO(HTTP/2): Support aborted + // }) + + // stream.on('timeout', () => { + // // TODO(HTTP/2): Support timeout + // }) + + // stream.on('push', headers => { + // // TODO(HTTP/2): Support push + // }) + + // stream.on('trailers', headers => { + // // TODO(HTTP/2): Support trailers + // }) + + return true + + function writeBodyH2 () { + /* istanbul ignore else: assertion */ + if (!body || contentLength === 0) { + writeBuffer( + abort, + stream, + null, + client, + request, + client[kSocket], + contentLength, + expectsPayload + ) + } else if (util.isBuffer(body)) { + writeBuffer( + abort, + stream, + body, + client, + request, + client[kSocket], + contentLength, + expectsPayload + ) + } else if (util.isBlobLike(body)) { + if (typeof body.stream === 'function') { + writeIterable( + abort, + stream, + body.stream(), + client, + request, + client[kSocket], + contentLength, + expectsPayload + ) + } else { + writeBlob( + abort, + stream, + body, + client, + request, + client[kSocket], + contentLength, + expectsPayload + ) + } + } else if (util.isStream(body)) { + writeStream( + abort, + client[kSocket], + expectsPayload, + stream, + body, + client, + request, + contentLength + ) + } else if (util.isIterable(body)) { + writeIterable( + abort, + stream, + body, + client, + request, + client[kSocket], + contentLength, + expectsPayload + ) + } else { + assert(false) + } + } +} + +function writeBuffer (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { + try { + if (body != null && util.isBuffer(body)) { + assert(contentLength === body.byteLength, 'buffer body must have content length') + h2stream.cork() + h2stream.write(body) + h2stream.uncork() + h2stream.end() + + request.onBodySent(body) + } + + if (!expectsPayload) { + socket[kReset] = true + } + + request.onRequestSent() + client[kResume]() + } catch (error) { + abort(error) + } +} + +function writeStream (abort, socket, expectsPayload, h2stream, body, client, request, contentLength) { + assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined') + + // For HTTP/2, is enough to pipe the stream + const pipe = pipeline( + body, + h2stream, + (err) => { + if (err) { + util.destroy(pipe, err) + abort(err) + } else { + util.removeAllListeners(pipe) + request.onRequestSent() + + if (!expectsPayload) { + socket[kReset] = true + } + + client[kResume]() + } + } + ) + + util.addListener(pipe, 'data', onPipeData) + + function onPipeData (chunk) { + request.onBodySent(chunk) + } +} + +async function writeBlob (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { + assert(contentLength === body.size, 'blob body must have content length') + + try { + if (contentLength != null && contentLength !== body.size) { + throw new RequestContentLengthMismatchError() + } + + const buffer = Buffer.from(await body.arrayBuffer()) + + h2stream.cork() + h2stream.write(buffer) + h2stream.uncork() + h2stream.end() + + request.onBodySent(buffer) + request.onRequestSent() + + if (!expectsPayload) { + socket[kReset] = true + } + + client[kResume]() + } catch (err) { + abort(err) + } +} + +async function writeIterable (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { + assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined') + + let callback = null + function onDrain () { + if (callback) { + const cb = callback + callback = null + cb() + } + } + + const waitForDrain = () => new Promise((resolve, reject) => { + assert(callback === null) + + if (socket[kError]) { + reject(socket[kError]) + } else { + callback = resolve + } + }) + + h2stream + .on('close', onDrain) + .on('drain', onDrain) + + try { + // It's up to the user to somehow abort the async iterable. + for await (const chunk of body) { + if (socket[kError]) { + throw socket[kError] + } + + const res = h2stream.write(chunk) + request.onBodySent(chunk) + if (!res) { + await waitForDrain() + } + } + + h2stream.end() + + request.onRequestSent() + + if (!expectsPayload) { + socket[kReset] = true + } + + client[kResume]() + } catch (err) { + abort(err) + } finally { + h2stream + .off('close', onDrain) + .off('drain', onDrain) + } +} + +module.exports = connectH2 diff --git a/node/node_modules/npm/node_modules/undici/lib/dispatcher/client.js b/node/node_modules/npm/node_modules/undici/lib/dispatcher/client.js new file mode 100644 index 0000000000000000000000000000000000000000..822f059fbd5d46cabf8209b9f8d1d59766afdc88 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/dispatcher/client.js @@ -0,0 +1,623 @@ +// @ts-check + +'use strict' + +const assert = require('node:assert') +const net = require('node:net') +const http = require('node:http') +const util = require('../core/util.js') +const { channels } = require('../core/diagnostics.js') +const Request = require('../core/request.js') +const DispatcherBase = require('./dispatcher-base') +const { + InvalidArgumentError, + InformationalError, + ClientDestroyedError +} = require('../core/errors.js') +const buildConnector = require('../core/connect.js') +const { + kUrl, + kServerName, + kClient, + kBusy, + kConnect, + kResuming, + kRunning, + kPending, + kSize, + kQueue, + kConnected, + kConnecting, + kNeedDrain, + kKeepAliveDefaultTimeout, + kHostHeader, + kPendingIdx, + kRunningIdx, + kError, + kPipelining, + kKeepAliveTimeoutValue, + kMaxHeadersSize, + kKeepAliveMaxTimeout, + kKeepAliveTimeoutThreshold, + kHeadersTimeout, + kBodyTimeout, + kStrictContentLength, + kConnector, + kMaxRedirections, + kMaxRequests, + kCounter, + kClose, + kDestroy, + kDispatch, + kInterceptors, + kLocalAddress, + kMaxResponseSize, + kOnError, + kHTTPContext, + kMaxConcurrentStreams, + kResume +} = require('../core/symbols.js') +const connectH1 = require('./client-h1.js') +const connectH2 = require('./client-h2.js') +let deprecatedInterceptorWarned = false + +const kClosedResolve = Symbol('kClosedResolve') + +const noop = () => {} + +function getPipelining (client) { + return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1 +} + +/** + * @type {import('../../types/client.js').default} + */ +class Client extends DispatcherBase { + /** + * + * @param {string|URL} url + * @param {import('../../types/client.js').Client.Options} options + */ + constructor (url, { + interceptors, + maxHeaderSize, + headersTimeout, + socketTimeout, + requestTimeout, + connectTimeout, + bodyTimeout, + idleTimeout, + keepAlive, + keepAliveTimeout, + maxKeepAliveTimeout, + keepAliveMaxTimeout, + keepAliveTimeoutThreshold, + socketPath, + pipelining, + tls, + strictContentLength, + maxCachedSessions, + maxRedirections, + connect, + maxRequestsPerClient, + localAddress, + maxResponseSize, + autoSelectFamily, + autoSelectFamilyAttemptTimeout, + // h2 + maxConcurrentStreams, + allowH2, + webSocket + } = {}) { + super({ webSocket }) + + if (keepAlive !== undefined) { + throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead') + } + + if (socketTimeout !== undefined) { + throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead') + } + + if (requestTimeout !== undefined) { + throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead') + } + + if (idleTimeout !== undefined) { + throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead') + } + + if (maxKeepAliveTimeout !== undefined) { + throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead') + } + + if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) { + throw new InvalidArgumentError('invalid maxHeaderSize') + } + + if (socketPath != null && typeof socketPath !== 'string') { + throw new InvalidArgumentError('invalid socketPath') + } + + if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) { + throw new InvalidArgumentError('invalid connectTimeout') + } + + if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) { + throw new InvalidArgumentError('invalid keepAliveTimeout') + } + + if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) { + throw new InvalidArgumentError('invalid keepAliveMaxTimeout') + } + + if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) { + throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold') + } + + if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) { + throw new InvalidArgumentError('headersTimeout must be a positive integer or zero') + } + + if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) { + throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero') + } + + if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { + throw new InvalidArgumentError('connect must be a function or an object') + } + + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { + throw new InvalidArgumentError('maxRedirections must be a positive number') + } + + if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) { + throw new InvalidArgumentError('maxRequestsPerClient must be a positive number') + } + + if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) { + throw new InvalidArgumentError('localAddress must be valid string IP address') + } + + if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) { + throw new InvalidArgumentError('maxResponseSize must be a positive number') + } + + if ( + autoSelectFamilyAttemptTimeout != null && + (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1) + ) { + throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number') + } + + // h2 + if (allowH2 != null && typeof allowH2 !== 'boolean') { + throw new InvalidArgumentError('allowH2 must be a valid boolean value') + } + + if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) { + throw new InvalidArgumentError('maxConcurrentStreams must be a positive integer, greater than 0') + } + + if (typeof connect !== 'function') { + connect = buildConnector({ + ...tls, + maxCachedSessions, + allowH2, + socketPath, + timeout: connectTimeout, + ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), + ...connect + }) + } + + if (interceptors?.Client && Array.isArray(interceptors.Client)) { + this[kInterceptors] = interceptors.Client + if (!deprecatedInterceptorWarned) { + deprecatedInterceptorWarned = true + process.emitWarning('Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.', { + code: 'UNDICI-CLIENT-INTERCEPTOR-DEPRECATED' + }) + } + } else { + this[kInterceptors] = [createRedirectInterceptor({ maxRedirections })] + } + + this[kUrl] = util.parseOrigin(url) + this[kConnector] = connect + this[kPipelining] = pipelining != null ? pipelining : 1 + this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize + this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout + this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout + this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold + this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout] + this[kServerName] = null + this[kLocalAddress] = localAddress != null ? localAddress : null + this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming + this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming + this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n` + this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3 + this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3 + this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength + this[kMaxRedirections] = maxRedirections + this[kMaxRequests] = maxRequestsPerClient + this[kClosedResolve] = null + this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1 + this[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server + this[kHTTPContext] = null + + // kQueue is built up of 3 sections separated by + // the kRunningIdx and kPendingIdx indices. + // | complete | running | pending | + // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length + // kRunningIdx points to the first running element. + // kPendingIdx points to the first pending element. + // This implements a fast queue with an amortized + // time of O(1). + + this[kQueue] = [] + this[kRunningIdx] = 0 + this[kPendingIdx] = 0 + + this[kResume] = (sync) => resume(this, sync) + this[kOnError] = (err) => onError(this, err) + } + + get pipelining () { + return this[kPipelining] + } + + set pipelining (value) { + this[kPipelining] = value + this[kResume](true) + } + + get [kPending] () { + return this[kQueue].length - this[kPendingIdx] + } + + get [kRunning] () { + return this[kPendingIdx] - this[kRunningIdx] + } + + get [kSize] () { + return this[kQueue].length - this[kRunningIdx] + } + + get [kConnected] () { + return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed + } + + get [kBusy] () { + return Boolean( + this[kHTTPContext]?.busy(null) || + (this[kSize] >= (getPipelining(this) || 1)) || + this[kPending] > 0 + ) + } + + /* istanbul ignore: only used for test */ + [kConnect] (cb) { + connect(this) + this.once('connect', cb) + } + + [kDispatch] (opts, handler) { + const origin = opts.origin || this[kUrl].origin + const request = new Request(origin, opts, handler) + + this[kQueue].push(request) + if (this[kResuming]) { + // Do nothing. + } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) { + // Wait a tick in case stream/iterator is ended in the same tick. + this[kResuming] = 1 + queueMicrotask(() => resume(this)) + } else { + this[kResume](true) + } + + if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) { + this[kNeedDrain] = 2 + } + + return this[kNeedDrain] < 2 + } + + async [kClose] () { + // TODO: for H2 we need to gracefully flush the remaining enqueued + // request and close each stream. + return new Promise((resolve) => { + if (this[kSize]) { + this[kClosedResolve] = resolve + } else { + resolve(null) + } + }) + } + + async [kDestroy] (err) { + return new Promise((resolve) => { + const requests = this[kQueue].splice(this[kPendingIdx]) + for (let i = 0; i < requests.length; i++) { + const request = requests[i] + util.errorRequest(this, request, err) + } + + const callback = () => { + if (this[kClosedResolve]) { + // TODO (fix): Should we error here with ClientDestroyedError? + this[kClosedResolve]() + this[kClosedResolve] = null + } + resolve(null) + } + + if (this[kHTTPContext]) { + this[kHTTPContext].destroy(err, callback) + this[kHTTPContext] = null + } else { + queueMicrotask(callback) + } + + this[kResume]() + }) + } +} + +const createRedirectInterceptor = require('../interceptor/redirect-interceptor.js') + +function onError (client, err) { + if ( + client[kRunning] === 0 && + err.code !== 'UND_ERR_INFO' && + err.code !== 'UND_ERR_SOCKET' + ) { + // Error is not caused by running request and not a recoverable + // socket error. + + assert(client[kPendingIdx] === client[kRunningIdx]) + + const requests = client[kQueue].splice(client[kRunningIdx]) + + for (let i = 0; i < requests.length; i++) { + const request = requests[i] + util.errorRequest(client, request, err) + } + assert(client[kSize] === 0) + } +} + +/** + * @param {Client} client + * @returns + */ +async function connect (client) { + assert(!client[kConnecting]) + assert(!client[kHTTPContext]) + + let { host, hostname, protocol, port } = client[kUrl] + + // Resolve ipv6 + if (hostname[0] === '[') { + const idx = hostname.indexOf(']') + + assert(idx !== -1) + const ip = hostname.substring(1, idx) + + assert(net.isIP(ip)) + hostname = ip + } + + client[kConnecting] = true + + if (channels.beforeConnect.hasSubscribers) { + channels.beforeConnect.publish({ + connectParams: { + host, + hostname, + protocol, + port, + version: client[kHTTPContext]?.version, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector] + }) + } + + try { + const socket = await new Promise((resolve, reject) => { + client[kConnector]({ + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, (err, socket) => { + if (err) { + reject(err) + } else { + resolve(socket) + } + }) + }) + + if (client.destroyed) { + util.destroy(socket.on('error', noop), new ClientDestroyedError()) + return + } + + assert(socket) + + try { + client[kHTTPContext] = socket.alpnProtocol === 'h2' + ? await connectH2(client, socket) + : await connectH1(client, socket) + } catch (err) { + socket.destroy().on('error', noop) + throw err + } + + client[kConnecting] = false + + socket[kCounter] = 0 + socket[kMaxRequests] = client[kMaxRequests] + socket[kClient] = client + socket[kError] = null + + if (channels.connected.hasSubscribers) { + channels.connected.publish({ + connectParams: { + host, + hostname, + protocol, + port, + version: client[kHTTPContext]?.version, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector], + socket + }) + } + client.emit('connect', client[kUrl], [client]) + } catch (err) { + if (client.destroyed) { + return + } + + client[kConnecting] = false + + if (channels.connectError.hasSubscribers) { + channels.connectError.publish({ + connectParams: { + host, + hostname, + protocol, + port, + version: client[kHTTPContext]?.version, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector], + error: err + }) + } + + if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') { + assert(client[kRunning] === 0) + while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { + const request = client[kQueue][client[kPendingIdx]++] + util.errorRequest(client, request, err) + } + } else { + onError(client, err) + } + + client.emit('connectionError', client[kUrl], [client], err) + } + + client[kResume]() +} + +function emitDrain (client) { + client[kNeedDrain] = 0 + client.emit('drain', client[kUrl], [client]) +} + +function resume (client, sync) { + if (client[kResuming] === 2) { + return + } + + client[kResuming] = 2 + + _resume(client, sync) + client[kResuming] = 0 + + if (client[kRunningIdx] > 256) { + client[kQueue].splice(0, client[kRunningIdx]) + client[kPendingIdx] -= client[kRunningIdx] + client[kRunningIdx] = 0 + } +} + +function _resume (client, sync) { + while (true) { + if (client.destroyed) { + assert(client[kPending] === 0) + return + } + + if (client[kClosedResolve] && !client[kSize]) { + client[kClosedResolve]() + client[kClosedResolve] = null + return + } + + if (client[kHTTPContext]) { + client[kHTTPContext].resume() + } + + if (client[kBusy]) { + client[kNeedDrain] = 2 + } else if (client[kNeedDrain] === 2) { + if (sync) { + client[kNeedDrain] = 1 + queueMicrotask(() => emitDrain(client)) + } else { + emitDrain(client) + } + continue + } + + if (client[kPending] === 0) { + return + } + + if (client[kRunning] >= (getPipelining(client) || 1)) { + return + } + + const request = client[kQueue][client[kPendingIdx]] + + if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) { + if (client[kRunning] > 0) { + return + } + + client[kServerName] = request.servername + client[kHTTPContext]?.destroy(new InformationalError('servername changed'), () => { + client[kHTTPContext] = null + resume(client) + }) + } + + if (client[kConnecting]) { + return + } + + if (!client[kHTTPContext]) { + connect(client) + return + } + + if (client[kHTTPContext].destroyed) { + return + } + + if (client[kHTTPContext].busy(request)) { + return + } + + if (!request.aborted && client[kHTTPContext].write(request)) { + client[kPendingIdx]++ + } else { + client[kQueue].splice(client[kPendingIdx], 1) + } + } +} + +module.exports = Client diff --git a/node/node_modules/npm/node_modules/undici/lib/dispatcher/dispatcher-base.js b/node/node_modules/npm/node_modules/undici/lib/dispatcher/dispatcher-base.js new file mode 100644 index 0000000000000000000000000000000000000000..180d8425c3396e7b9a9cd6a0115c9a37e25bda4f --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/dispatcher/dispatcher-base.js @@ -0,0 +1,198 @@ +'use strict' + +const Dispatcher = require('./dispatcher') +const { + ClientDestroyedError, + ClientClosedError, + InvalidArgumentError +} = require('../core/errors') +const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = require('../core/symbols') + +const kOnDestroyed = Symbol('onDestroyed') +const kOnClosed = Symbol('onClosed') +const kInterceptedDispatch = Symbol('Intercepted Dispatch') +const kWebSocketOptions = Symbol('webSocketOptions') + +class DispatcherBase extends Dispatcher { + constructor (opts) { + super() + + this[kDestroyed] = false + this[kOnDestroyed] = null + this[kClosed] = false + this[kOnClosed] = [] + this[kWebSocketOptions] = opts?.webSocket ?? {} + } + + get webSocketOptions () { + return { + maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024 + } + } + + get destroyed () { + return this[kDestroyed] + } + + get closed () { + return this[kClosed] + } + + get interceptors () { + return this[kInterceptors] + } + + set interceptors (newInterceptors) { + if (newInterceptors) { + for (let i = newInterceptors.length - 1; i >= 0; i--) { + const interceptor = this[kInterceptors][i] + if (typeof interceptor !== 'function') { + throw new InvalidArgumentError('interceptor must be an function') + } + } + } + + this[kInterceptors] = newInterceptors + } + + close (callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + this.close((err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + if (this[kDestroyed]) { + queueMicrotask(() => callback(new ClientDestroyedError(), null)) + return + } + + if (this[kClosed]) { + if (this[kOnClosed]) { + this[kOnClosed].push(callback) + } else { + queueMicrotask(() => callback(null, null)) + } + return + } + + this[kClosed] = true + this[kOnClosed].push(callback) + + const onClosed = () => { + const callbacks = this[kOnClosed] + this[kOnClosed] = null + for (let i = 0; i < callbacks.length; i++) { + callbacks[i](null, null) + } + } + + // Should not error. + this[kClose]() + .then(() => this.destroy()) + .then(() => { + queueMicrotask(onClosed) + }) + } + + destroy (err, callback) { + if (typeof err === 'function') { + callback = err + err = null + } + + if (callback === undefined) { + return new Promise((resolve, reject) => { + this.destroy(err, (err, data) => { + return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data) + }) + }) + } + + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + if (this[kDestroyed]) { + if (this[kOnDestroyed]) { + this[kOnDestroyed].push(callback) + } else { + queueMicrotask(() => callback(null, null)) + } + return + } + + if (!err) { + err = new ClientDestroyedError() + } + + this[kDestroyed] = true + this[kOnDestroyed] = this[kOnDestroyed] || [] + this[kOnDestroyed].push(callback) + + const onDestroyed = () => { + const callbacks = this[kOnDestroyed] + this[kOnDestroyed] = null + for (let i = 0; i < callbacks.length; i++) { + callbacks[i](null, null) + } + } + + // Should not error. + this[kDestroy](err).then(() => { + queueMicrotask(onDestroyed) + }) + } + + [kInterceptedDispatch] (opts, handler) { + if (!this[kInterceptors] || this[kInterceptors].length === 0) { + this[kInterceptedDispatch] = this[kDispatch] + return this[kDispatch](opts, handler) + } + + let dispatch = this[kDispatch].bind(this) + for (let i = this[kInterceptors].length - 1; i >= 0; i--) { + dispatch = this[kInterceptors][i](dispatch) + } + this[kInterceptedDispatch] = dispatch + return dispatch(opts, handler) + } + + dispatch (opts, handler) { + if (!handler || typeof handler !== 'object') { + throw new InvalidArgumentError('handler must be an object') + } + + try { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('opts must be an object.') + } + + if (this[kDestroyed] || this[kOnDestroyed]) { + throw new ClientDestroyedError() + } + + if (this[kClosed]) { + throw new ClientClosedError() + } + + return this[kInterceptedDispatch](opts, handler) + } catch (err) { + if (typeof handler.onError !== 'function') { + throw new InvalidArgumentError('invalid onError method') + } + + handler.onError(err) + + return false + } + } +} + +module.exports = DispatcherBase diff --git a/node/node_modules/npm/node_modules/undici/lib/dispatcher/dispatcher.js b/node/node_modules/npm/node_modules/undici/lib/dispatcher/dispatcher.js new file mode 100644 index 0000000000000000000000000000000000000000..ccd38129cf9e138c6679605cf335a8b5efad8e07 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/dispatcher/dispatcher.js @@ -0,0 +1,65 @@ +'use strict' +const EventEmitter = require('node:events') + +class Dispatcher extends EventEmitter { + dispatch () { + throw new Error('not implemented') + } + + close () { + throw new Error('not implemented') + } + + destroy () { + throw new Error('not implemented') + } + + compose (...args) { + // So we handle [interceptor1, interceptor2] or interceptor1, interceptor2, ... + const interceptors = Array.isArray(args[0]) ? args[0] : args + let dispatch = this.dispatch.bind(this) + + for (const interceptor of interceptors) { + if (interceptor == null) { + continue + } + + if (typeof interceptor !== 'function') { + throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`) + } + + dispatch = interceptor(dispatch) + + if (dispatch == null || typeof dispatch !== 'function' || dispatch.length !== 2) { + throw new TypeError('invalid interceptor') + } + } + + return new ComposedDispatcher(this, dispatch) + } +} + +class ComposedDispatcher extends Dispatcher { + #dispatcher = null + #dispatch = null + + constructor (dispatcher, dispatch) { + super() + this.#dispatcher = dispatcher + this.#dispatch = dispatch + } + + dispatch (...args) { + this.#dispatch(...args) + } + + close (...args) { + return this.#dispatcher.close(...args) + } + + destroy (...args) { + return this.#dispatcher.destroy(...args) + } +} + +module.exports = Dispatcher diff --git a/node/node_modules/npm/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js b/node/node_modules/npm/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js new file mode 100644 index 0000000000000000000000000000000000000000..3175f56239dc70d7ca3f4c31013ad57f786af754 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js @@ -0,0 +1,160 @@ +'use strict' + +const DispatcherBase = require('./dispatcher-base') +const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require('../core/symbols') +const ProxyAgent = require('./proxy-agent') +const Agent = require('./agent') + +const DEFAULT_PORTS = { + 'http:': 80, + 'https:': 443 +} + +let experimentalWarned = false + +class EnvHttpProxyAgent extends DispatcherBase { + #noProxyValue = null + #noProxyEntries = null + #opts = null + + constructor (opts = {}) { + super() + this.#opts = opts + + if (!experimentalWarned) { + experimentalWarned = true + process.emitWarning('EnvHttpProxyAgent is experimental, expect them to change at any time.', { + code: 'UNDICI-EHPA' + }) + } + + const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts + + this[kNoProxyAgent] = new Agent(agentOpts) + + const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY + if (HTTP_PROXY) { + this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY }) + } else { + this[kHttpProxyAgent] = this[kNoProxyAgent] + } + + const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY + if (HTTPS_PROXY) { + this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY }) + } else { + this[kHttpsProxyAgent] = this[kHttpProxyAgent] + } + + this.#parseNoProxy() + } + + [kDispatch] (opts, handler) { + const url = new URL(opts.origin) + const agent = this.#getProxyAgentForUrl(url) + return agent.dispatch(opts, handler) + } + + async [kClose] () { + await this[kNoProxyAgent].close() + if (!this[kHttpProxyAgent][kClosed]) { + await this[kHttpProxyAgent].close() + } + if (!this[kHttpsProxyAgent][kClosed]) { + await this[kHttpsProxyAgent].close() + } + } + + async [kDestroy] (err) { + await this[kNoProxyAgent].destroy(err) + if (!this[kHttpProxyAgent][kDestroyed]) { + await this[kHttpProxyAgent].destroy(err) + } + if (!this[kHttpsProxyAgent][kDestroyed]) { + await this[kHttpsProxyAgent].destroy(err) + } + } + + #getProxyAgentForUrl (url) { + let { protocol, host: hostname, port } = url + + // Stripping ports in this way instead of using parsedUrl.hostname to make + // sure that the brackets around IPv6 addresses are kept. + hostname = hostname.replace(/:\d*$/, '').toLowerCase() + port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0 + if (!this.#shouldProxy(hostname, port)) { + return this[kNoProxyAgent] + } + if (protocol === 'https:') { + return this[kHttpsProxyAgent] + } + return this[kHttpProxyAgent] + } + + #shouldProxy (hostname, port) { + if (this.#noProxyChanged) { + this.#parseNoProxy() + } + + if (this.#noProxyEntries.length === 0) { + return true // Always proxy if NO_PROXY is not set or empty. + } + if (this.#noProxyValue === '*') { + return false // Never proxy if wildcard is set. + } + + for (let i = 0; i < this.#noProxyEntries.length; i++) { + const entry = this.#noProxyEntries[i] + if (entry.port && entry.port !== port) { + continue // Skip if ports don't match. + } + if (!/^[.*]/.test(entry.hostname)) { + // No wildcards, so don't proxy only if there is not an exact match. + if (hostname === entry.hostname) { + return false + } + } else { + // Don't proxy if the hostname ends with the no_proxy host. + if (hostname.endsWith(entry.hostname.replace(/^\*/, ''))) { + return false + } + } + } + + return true + } + + #parseNoProxy () { + const noProxyValue = this.#opts.noProxy ?? this.#noProxyEnv + const noProxySplit = noProxyValue.split(/[,\s]/) + const noProxyEntries = [] + + for (let i = 0; i < noProxySplit.length; i++) { + const entry = noProxySplit[i] + if (!entry) { + continue + } + const parsed = entry.match(/^(.+):(\d+)$/) + noProxyEntries.push({ + hostname: (parsed ? parsed[1] : entry).toLowerCase(), + port: parsed ? Number.parseInt(parsed[2], 10) : 0 + }) + } + + this.#noProxyValue = noProxyValue + this.#noProxyEntries = noProxyEntries + } + + get #noProxyChanged () { + if (this.#opts.noProxy !== undefined) { + return false + } + return this.#noProxyValue !== this.#noProxyEnv + } + + get #noProxyEnv () { + return process.env.no_proxy ?? process.env.NO_PROXY ?? '' + } +} + +module.exports = EnvHttpProxyAgent diff --git a/node/node_modules/npm/node_modules/undici/lib/dispatcher/fixed-queue.js b/node/node_modules/npm/node_modules/undici/lib/dispatcher/fixed-queue.js new file mode 100644 index 0000000000000000000000000000000000000000..034d0aba64ae76050281d18d5deeaa7286ca33b0 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/dispatcher/fixed-queue.js @@ -0,0 +1,117 @@ +/* eslint-disable */ + +'use strict' + +// Extracted from node/lib/internal/fixed_queue.js + +// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two. +const kSize = 2048; +const kMask = kSize - 1; + +// The FixedQueue is implemented as a singly-linked list of fixed-size +// circular buffers. It looks something like this: +// +// head tail +// | | +// v v +// +-----------+ <-----\ +-----------+ <------\ +-----------+ +// | [null] | \----- | next | \------- | next | +// +-----------+ +-----------+ +-----------+ +// | item | <-- bottom | item | <-- bottom | [empty] | +// | item | | item | | [empty] | +// | item | | item | | [empty] | +// | item | | item | | [empty] | +// | item | | item | bottom --> | item | +// | item | | item | | item | +// | ... | | ... | | ... | +// | item | | item | | item | +// | item | | item | | item | +// | [empty] | <-- top | item | | item | +// | [empty] | | item | | item | +// | [empty] | | [empty] | <-- top top --> | [empty] | +// +-----------+ +-----------+ +-----------+ +// +// Or, if there is only one circular buffer, it looks something +// like either of these: +// +// head tail head tail +// | | | | +// v v v v +// +-----------+ +-----------+ +// | [null] | | [null] | +// +-----------+ +-----------+ +// | [empty] | | item | +// | [empty] | | item | +// | item | <-- bottom top --> | [empty] | +// | item | | [empty] | +// | [empty] | <-- top bottom --> | item | +// | [empty] | | item | +// +-----------+ +-----------+ +// +// Adding a value means moving `top` forward by one, removing means +// moving `bottom` forward by one. After reaching the end, the queue +// wraps around. +// +// When `top === bottom` the current queue is empty and when +// `top + 1 === bottom` it's full. This wastes a single space of storage +// but allows much quicker checks. + +class FixedCircularBuffer { + constructor() { + this.bottom = 0; + this.top = 0; + this.list = new Array(kSize); + this.next = null; + } + + isEmpty() { + return this.top === this.bottom; + } + + isFull() { + return ((this.top + 1) & kMask) === this.bottom; + } + + push(data) { + this.list[this.top] = data; + this.top = (this.top + 1) & kMask; + } + + shift() { + const nextItem = this.list[this.bottom]; + if (nextItem === undefined) + return null; + this.list[this.bottom] = undefined; + this.bottom = (this.bottom + 1) & kMask; + return nextItem; + } +} + +module.exports = class FixedQueue { + constructor() { + this.head = this.tail = new FixedCircularBuffer(); + } + + isEmpty() { + return this.head.isEmpty(); + } + + push(data) { + if (this.head.isFull()) { + // Head is full: Creates a new queue, sets the old queue's `.next` to it, + // and sets it as the new main queue. + this.head = this.head.next = new FixedCircularBuffer(); + } + this.head.push(data); + } + + shift() { + const tail = this.tail; + const next = tail.shift(); + if (tail.isEmpty() && tail.next !== null) { + // If there is another queue, it forms the new tail. + this.tail = tail.next; + } + return next; + } +}; diff --git a/node/node_modules/npm/node_modules/undici/lib/dispatcher/pool-base.js b/node/node_modules/npm/node_modules/undici/lib/dispatcher/pool-base.js new file mode 100644 index 0000000000000000000000000000000000000000..dcb9301d3d5bb6ca8001e13df22389db34372417 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/dispatcher/pool-base.js @@ -0,0 +1,194 @@ +'use strict' + +const DispatcherBase = require('./dispatcher-base') +const FixedQueue = require('./fixed-queue') +const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require('../core/symbols') +const PoolStats = require('./pool-stats') + +const kClients = Symbol('clients') +const kNeedDrain = Symbol('needDrain') +const kQueue = Symbol('queue') +const kClosedResolve = Symbol('closed resolve') +const kOnDrain = Symbol('onDrain') +const kOnConnect = Symbol('onConnect') +const kOnDisconnect = Symbol('onDisconnect') +const kOnConnectionError = Symbol('onConnectionError') +const kGetDispatcher = Symbol('get dispatcher') +const kAddClient = Symbol('add client') +const kRemoveClient = Symbol('remove client') +const kStats = Symbol('stats') + +class PoolBase extends DispatcherBase { + constructor (opts) { + super(opts) + + this[kQueue] = new FixedQueue() + this[kClients] = [] + this[kQueued] = 0 + + const pool = this + + this[kOnDrain] = function onDrain (origin, targets) { + const queue = pool[kQueue] + + let needDrain = false + + while (!needDrain) { + const item = queue.shift() + if (!item) { + break + } + pool[kQueued]-- + needDrain = !this.dispatch(item.opts, item.handler) + } + + this[kNeedDrain] = needDrain + + if (!this[kNeedDrain] && pool[kNeedDrain]) { + pool[kNeedDrain] = false + pool.emit('drain', origin, [pool, ...targets]) + } + + if (pool[kClosedResolve] && queue.isEmpty()) { + Promise + .all(pool[kClients].map(c => c.close())) + .then(pool[kClosedResolve]) + } + } + + this[kOnConnect] = (origin, targets) => { + pool.emit('connect', origin, [pool, ...targets]) + } + + this[kOnDisconnect] = (origin, targets, err) => { + pool.emit('disconnect', origin, [pool, ...targets], err) + } + + this[kOnConnectionError] = (origin, targets, err) => { + pool.emit('connectionError', origin, [pool, ...targets], err) + } + + this[kStats] = new PoolStats(this) + } + + get [kBusy] () { + return this[kNeedDrain] + } + + get [kConnected] () { + return this[kClients].filter(client => client[kConnected]).length + } + + get [kFree] () { + return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length + } + + get [kPending] () { + let ret = this[kQueued] + for (const { [kPending]: pending } of this[kClients]) { + ret += pending + } + return ret + } + + get [kRunning] () { + let ret = 0 + for (const { [kRunning]: running } of this[kClients]) { + ret += running + } + return ret + } + + get [kSize] () { + let ret = this[kQueued] + for (const { [kSize]: size } of this[kClients]) { + ret += size + } + return ret + } + + get stats () { + return this[kStats] + } + + async [kClose] () { + if (this[kQueue].isEmpty()) { + await Promise.all(this[kClients].map(c => c.close())) + } else { + await new Promise((resolve) => { + this[kClosedResolve] = resolve + }) + } + } + + async [kDestroy] (err) { + while (true) { + const item = this[kQueue].shift() + if (!item) { + break + } + item.handler.onError(err) + } + + await Promise.all(this[kClients].map(c => c.destroy(err))) + } + + [kDispatch] (opts, handler) { + const dispatcher = this[kGetDispatcher]() + + if (!dispatcher) { + this[kNeedDrain] = true + this[kQueue].push({ opts, handler }) + this[kQueued]++ + } else if (!dispatcher.dispatch(opts, handler)) { + dispatcher[kNeedDrain] = true + this[kNeedDrain] = !this[kGetDispatcher]() + } + + return !this[kNeedDrain] + } + + [kAddClient] (client) { + client + .on('drain', this[kOnDrain]) + .on('connect', this[kOnConnect]) + .on('disconnect', this[kOnDisconnect]) + .on('connectionError', this[kOnConnectionError]) + + this[kClients].push(client) + + if (this[kNeedDrain]) { + queueMicrotask(() => { + if (this[kNeedDrain]) { + this[kOnDrain](client[kUrl], [this, client]) + } + }) + } + + return this + } + + [kRemoveClient] (client) { + client.close(() => { + const idx = this[kClients].indexOf(client) + if (idx !== -1) { + this[kClients].splice(idx, 1) + } + }) + + this[kNeedDrain] = this[kClients].some(dispatcher => ( + !dispatcher[kNeedDrain] && + dispatcher.closed !== true && + dispatcher.destroyed !== true + )) + } +} + +module.exports = { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kRemoveClient, + kGetDispatcher +} diff --git a/node/node_modules/npm/node_modules/undici/lib/dispatcher/pool-stats.js b/node/node_modules/npm/node_modules/undici/lib/dispatcher/pool-stats.js new file mode 100644 index 0000000000000000000000000000000000000000..36c7eeb5b9e555cd2d3050c910be33f5960f277a --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/dispatcher/pool-stats.js @@ -0,0 +1,34 @@ +const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require('../core/symbols') +const kPool = Symbol('pool') + +class PoolStats { + constructor (pool) { + this[kPool] = pool + } + + get connected () { + return this[kPool][kConnected] + } + + get free () { + return this[kPool][kFree] + } + + get pending () { + return this[kPool][kPending] + } + + get queued () { + return this[kPool][kQueued] + } + + get running () { + return this[kPool][kRunning] + } + + get size () { + return this[kPool][kSize] + } +} + +module.exports = PoolStats diff --git a/node/node_modules/npm/node_modules/undici/lib/dispatcher/pool.js b/node/node_modules/npm/node_modules/undici/lib/dispatcher/pool.js new file mode 100644 index 0000000000000000000000000000000000000000..02bf855a356459283408c861d01aaa3d2e0eed56 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/dispatcher/pool.js @@ -0,0 +1,107 @@ +'use strict' + +const { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kGetDispatcher +} = require('./pool-base') +const Client = require('./client') +const { + InvalidArgumentError +} = require('../core/errors') +const util = require('../core/util') +const { kUrl, kInterceptors } = require('../core/symbols') +const buildConnector = require('../core/connect') + +const kOptions = Symbol('options') +const kConnections = Symbol('connections') +const kFactory = Symbol('factory') + +function defaultFactory (origin, opts) { + return new Client(origin, opts) +} + +class Pool extends PoolBase { + constructor (origin, { + connections, + factory = defaultFactory, + connect, + connectTimeout, + tls, + maxCachedSessions, + socketPath, + autoSelectFamily, + autoSelectFamilyAttemptTimeout, + allowH2, + ...options + } = {}) { + if (connections != null && (!Number.isFinite(connections) || connections < 0)) { + throw new InvalidArgumentError('invalid connections') + } + + if (typeof factory !== 'function') { + throw new InvalidArgumentError('factory must be a function.') + } + + if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { + throw new InvalidArgumentError('connect must be a function or an object') + } + + if (typeof connect !== 'function') { + connect = buildConnector({ + ...tls, + maxCachedSessions, + allowH2, + socketPath, + timeout: connectTimeout, + ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), + ...connect + }) + } + + super(options) + + this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool) + ? options.interceptors.Pool + : [] + this[kConnections] = connections || null + this[kUrl] = util.parseOrigin(origin) + this[kOptions] = { ...util.deepClone(options), connect, allowH2 } + this[kOptions].interceptors = options.interceptors + ? { ...options.interceptors } + : undefined + this[kFactory] = factory + + this.on('connectionError', (origin, targets, error) => { + // If a connection error occurs, we remove the client from the pool, + // and emit a connectionError event. They will not be re-used. + // Fixes https://github.com/nodejs/undici/issues/3895 + for (const target of targets) { + // Do not use kRemoveClient here, as it will close the client, + // but the client cannot be closed in this state. + const idx = this[kClients].indexOf(target) + if (idx !== -1) { + this[kClients].splice(idx, 1) + } + } + }) + } + + [kGetDispatcher] () { + for (const client of this[kClients]) { + if (!client[kNeedDrain]) { + return client + } + } + + if (!this[kConnections] || this[kClients].length < this[kConnections]) { + const dispatcher = this[kFactory](this[kUrl], this[kOptions]) + this[kAddClient](dispatcher) + return dispatcher + } + } +} + +module.exports = Pool diff --git a/node/node_modules/npm/node_modules/undici/lib/dispatcher/proxy-agent.js b/node/node_modules/npm/node_modules/undici/lib/dispatcher/proxy-agent.js new file mode 100644 index 0000000000000000000000000000000000000000..f9de62c562c03435fda0118da5d15e02d09bcc77 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/dispatcher/proxy-agent.js @@ -0,0 +1,274 @@ +'use strict' + +const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = require('../core/symbols') +const { URL } = require('node:url') +const Agent = require('./agent') +const Pool = require('./pool') +const DispatcherBase = require('./dispatcher-base') +const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require('../core/errors') +const buildConnector = require('../core/connect') +const Client = require('./client') + +const kAgent = Symbol('proxy agent') +const kClient = Symbol('proxy client') +const kProxyHeaders = Symbol('proxy headers') +const kRequestTls = Symbol('request tls settings') +const kProxyTls = Symbol('proxy tls settings') +const kConnectEndpoint = Symbol('connect endpoint function') +const kTunnelProxy = Symbol('tunnel proxy') + +function defaultProtocolPort (protocol) { + return protocol === 'https:' ? 443 : 80 +} + +function defaultFactory (origin, opts) { + return new Pool(origin, opts) +} + +const noop = () => {} + +function defaultAgentFactory (origin, opts) { + if (opts.connections === 1) { + return new Client(origin, opts) + } + return new Pool(origin, opts) +} + +class Http1ProxyWrapper extends DispatcherBase { + #client + + constructor (proxyUrl, { headers = {}, connect, factory }) { + super() + if (!proxyUrl) { + throw new InvalidArgumentError('Proxy URL is mandatory') + } + + this[kProxyHeaders] = headers + if (factory) { + this.#client = factory(proxyUrl, { connect }) + } else { + this.#client = new Client(proxyUrl, { connect }) + } + } + + [kDispatch] (opts, handler) { + const onHeaders = handler.onHeaders + handler.onHeaders = function (statusCode, data, resume) { + if (statusCode === 407) { + if (typeof handler.onError === 'function') { + handler.onError(new InvalidArgumentError('Proxy Authentication Required (407)')) + } + return + } + if (onHeaders) onHeaders.call(this, statusCode, data, resume) + } + + // Rewrite request as an HTTP1 Proxy request, without tunneling. + const { + origin, + path = '/', + headers = {} + } = opts + + opts.path = origin + path + + if (!('host' in headers) && !('Host' in headers)) { + const { host } = new URL(origin) + headers.host = host + } + opts.headers = { ...this[kProxyHeaders], ...headers } + + return this.#client[kDispatch](opts, handler) + } + + async [kClose] () { + return this.#client.close() + } + + async [kDestroy] (err) { + return this.#client.destroy(err) + } +} + +class ProxyAgent extends DispatcherBase { + constructor (opts) { + super() + + if (!opts || (typeof opts === 'object' && !(opts instanceof URL) && !opts.uri)) { + throw new InvalidArgumentError('Proxy uri is mandatory') + } + + const { clientFactory = defaultFactory } = opts + if (typeof clientFactory !== 'function') { + throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.') + } + + const { proxyTunnel = true } = opts + + const url = this.#getUrl(opts) + const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url + + this[kProxy] = { uri: href, protocol } + this[kInterceptors] = opts.interceptors?.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent) + ? opts.interceptors.ProxyAgent + : [] + this[kRequestTls] = opts.requestTls + this[kProxyTls] = opts.proxyTls + this[kProxyHeaders] = opts.headers || {} + this[kTunnelProxy] = proxyTunnel + + if (opts.auth && opts.token) { + throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token') + } else if (opts.auth) { + /* @deprecated in favour of opts.token */ + this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}` + } else if (opts.token) { + this[kProxyHeaders]['proxy-authorization'] = opts.token + } else if (username && password) { + this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}` + } + + const connect = buildConnector({ ...opts.proxyTls }) + this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }) + + const agentFactory = opts.factory || defaultAgentFactory + const factory = (origin, options) => { + const { protocol } = new URL(origin) + if (!this[kTunnelProxy] && protocol === 'http:' && this[kProxy].protocol === 'http:') { + return new Http1ProxyWrapper(this[kProxy].uri, { + headers: this[kProxyHeaders], + connect, + factory: agentFactory + }) + } + return agentFactory(origin, options) + } + this[kClient] = clientFactory(url, { connect }) + this[kAgent] = new Agent({ + ...opts, + factory, + connect: async (opts, callback) => { + let requestedPath = opts.host + if (!opts.port) { + requestedPath += `:${defaultProtocolPort(opts.protocol)}` + } + try { + const { socket, statusCode } = await this[kClient].connect({ + origin, + port, + path: requestedPath, + signal: opts.signal, + headers: { + ...this[kProxyHeaders], + host: opts.host + }, + servername: this[kProxyTls]?.servername || proxyHostname + }) + if (statusCode !== 200) { + socket.on('error', noop).destroy() + callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`)) + } + if (opts.protocol !== 'https:') { + callback(null, socket) + return + } + let servername + if (this[kRequestTls]) { + servername = this[kRequestTls].servername + } else { + servername = opts.servername + } + this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback) + } catch (err) { + if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') { + // Throw a custom error to avoid loop in client.js#connect + callback(new SecureProxyConnectionError(err)) + } else { + callback(err) + } + } + } + }) + } + + dispatch (opts, handler) { + const headers = buildHeaders(opts.headers) + throwIfProxyAuthIsSent(headers) + + if (headers && !('host' in headers) && !('Host' in headers)) { + const { host } = new URL(opts.origin) + headers.host = host + } + + return this[kAgent].dispatch( + { + ...opts, + headers + }, + handler + ) + } + + /** + * @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts + * @returns {URL} + */ + #getUrl (opts) { + if (typeof opts === 'string') { + return new URL(opts) + } else if (opts instanceof URL) { + return opts + } else { + return new URL(opts.uri) + } + } + + async [kClose] () { + await this[kAgent].close() + await this[kClient].close() + } + + async [kDestroy] () { + await this[kAgent].destroy() + await this[kClient].destroy() + } +} + +/** + * @param {string[] | Record} headers + * @returns {Record} + */ +function buildHeaders (headers) { + // When using undici.fetch, the headers list is stored + // as an array. + if (Array.isArray(headers)) { + /** @type {Record} */ + const headersPair = {} + + for (let i = 0; i < headers.length; i += 2) { + headersPair[headers[i]] = headers[i + 1] + } + + return headersPair + } + + return headers +} + +/** + * @param {Record} headers + * + * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers + * Nevertheless, it was changed and to avoid a security vulnerability by end users + * this check was created. + * It should be removed in the next major version for performance reasons + */ +function throwIfProxyAuthIsSent (headers) { + const existProxyAuth = headers && Object.keys(headers) + .find((key) => key.toLowerCase() === 'proxy-authorization') + if (existProxyAuth) { + throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor') + } +} + +module.exports = ProxyAgent diff --git a/node/node_modules/npm/node_modules/undici/lib/dispatcher/retry-agent.js b/node/node_modules/npm/node_modules/undici/lib/dispatcher/retry-agent.js new file mode 100644 index 0000000000000000000000000000000000000000..bb289a5511960e36958715ad4de84ffc6a68fd66 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/dispatcher/retry-agent.js @@ -0,0 +1,35 @@ +'use strict' + +const Dispatcher = require('./dispatcher') +const RetryHandler = require('../handler/retry-handler') + +class RetryAgent extends Dispatcher { + #agent = null + #options = null + constructor (agent, options = {}) { + super(options) + this.#agent = agent + this.#options = options + } + + dispatch (opts, handler) { + const retry = new RetryHandler({ + ...opts, + retryOptions: this.#options + }, { + dispatch: this.#agent.dispatch.bind(this.#agent), + handler + }) + return this.#agent.dispatch(opts, retry) + } + + close () { + return this.#agent.close() + } + + destroy () { + return this.#agent.destroy() + } +} + +module.exports = RetryAgent diff --git a/node/node_modules/npm/node_modules/undici/lib/global.js b/node/node_modules/npm/node_modules/undici/lib/global.js new file mode 100644 index 0000000000000000000000000000000000000000..9d05258eaea50faa39ec3aa1998aa0270801d813 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/global.js @@ -0,0 +1,32 @@ +'use strict' + +// We include a version number for the Dispatcher API. In case of breaking changes, +// this version number must be increased to avoid conflicts. +const globalDispatcher = Symbol.for('undici.globalDispatcher.1') +const { InvalidArgumentError } = require('./core/errors') +const Agent = require('./dispatcher/agent') + +if (getGlobalDispatcher() === undefined) { + setGlobalDispatcher(new Agent()) +} + +function setGlobalDispatcher (agent) { + if (!agent || typeof agent.dispatch !== 'function') { + throw new InvalidArgumentError('Argument agent must implement Agent') + } + Object.defineProperty(globalThis, globalDispatcher, { + value: agent, + writable: true, + enumerable: false, + configurable: false + }) +} + +function getGlobalDispatcher () { + return globalThis[globalDispatcher] +} + +module.exports = { + setGlobalDispatcher, + getGlobalDispatcher +} diff --git a/node/node_modules/npm/node_modules/undici/lib/handler/decorator-handler.js b/node/node_modules/npm/node_modules/undici/lib/handler/decorator-handler.js new file mode 100644 index 0000000000000000000000000000000000000000..5297e266296f0477028e43e5bcfe38ee499182f6 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/handler/decorator-handler.js @@ -0,0 +1,44 @@ +'use strict' + +module.exports = class DecoratorHandler { + #handler + + constructor (handler) { + if (typeof handler !== 'object' || handler === null) { + throw new TypeError('handler must be an object') + } + this.#handler = handler + } + + onConnect (...args) { + return this.#handler.onConnect?.(...args) + } + + onError (...args) { + return this.#handler.onError?.(...args) + } + + onUpgrade (...args) { + return this.#handler.onUpgrade?.(...args) + } + + onResponseStarted (...args) { + return this.#handler.onResponseStarted?.(...args) + } + + onHeaders (...args) { + return this.#handler.onHeaders?.(...args) + } + + onData (...args) { + return this.#handler.onData?.(...args) + } + + onComplete (...args) { + return this.#handler.onComplete?.(...args) + } + + onBodySent (...args) { + return this.#handler.onBodySent?.(...args) + } +} diff --git a/node/node_modules/npm/node_modules/undici/lib/handler/redirect-handler.js b/node/node_modules/npm/node_modules/undici/lib/handler/redirect-handler.js new file mode 100644 index 0000000000000000000000000000000000000000..e571f8e8918744def8131973a103f524006fde64 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/handler/redirect-handler.js @@ -0,0 +1,232 @@ +'use strict' + +const util = require('../core/util') +const { kBodyUsed } = require('../core/symbols') +const assert = require('node:assert') +const { InvalidArgumentError } = require('../core/errors') +const EE = require('node:events') + +const redirectableStatusCodes = [300, 301, 302, 303, 307, 308] + +const kBody = Symbol('body') + +class BodyAsyncIterable { + constructor (body) { + this[kBody] = body + this[kBodyUsed] = false + } + + async * [Symbol.asyncIterator] () { + assert(!this[kBodyUsed], 'disturbed') + this[kBodyUsed] = true + yield * this[kBody] + } +} + +class RedirectHandler { + constructor (dispatch, maxRedirections, opts, handler) { + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { + throw new InvalidArgumentError('maxRedirections must be a positive number') + } + + util.validateHandler(handler, opts.method, opts.upgrade) + + this.dispatch = dispatch + this.location = null + this.abort = null + this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy + this.maxRedirections = maxRedirections + this.handler = handler + this.history = [] + this.redirectionLimitReached = false + + if (util.isStream(this.opts.body)) { + // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp + // so that it can be dispatched again? + // TODO (fix): Do we need 100-expect support to provide a way to do this properly? + if (util.bodyLength(this.opts.body) === 0) { + this.opts.body + .on('data', function () { + assert(false) + }) + } + + if (typeof this.opts.body.readableDidRead !== 'boolean') { + this.opts.body[kBodyUsed] = false + EE.prototype.on.call(this.opts.body, 'data', function () { + this[kBodyUsed] = true + }) + } + } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') { + // TODO (fix): We can't access ReadableStream internal state + // to determine whether or not it has been disturbed. This is just + // a workaround. + this.opts.body = new BodyAsyncIterable(this.opts.body) + } else if ( + this.opts.body && + typeof this.opts.body !== 'string' && + !ArrayBuffer.isView(this.opts.body) && + util.isIterable(this.opts.body) + ) { + // TODO: Should we allow re-using iterable if !this.opts.idempotent + // or through some other flag? + this.opts.body = new BodyAsyncIterable(this.opts.body) + } + } + + onConnect (abort) { + this.abort = abort + this.handler.onConnect(abort, { history: this.history }) + } + + onUpgrade (statusCode, headers, socket) { + this.handler.onUpgrade(statusCode, headers, socket) + } + + onError (error) { + this.handler.onError(error) + } + + onHeaders (statusCode, headers, resume, statusText) { + this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) + ? null + : parseLocation(statusCode, headers) + + if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) { + if (this.request) { + this.request.abort(new Error('max redirects')) + } + + this.redirectionLimitReached = true + this.abort(new Error('max redirects')) + return + } + + if (this.opts.origin) { + this.history.push(new URL(this.opts.path, this.opts.origin)) + } + + if (!this.location) { + return this.handler.onHeaders(statusCode, headers, resume, statusText) + } + + const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))) + const path = search ? `${pathname}${search}` : pathname + + // Remove headers referring to the original URL. + // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers. + // https://tools.ietf.org/html/rfc7231#section-6.4 + this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin) + this.opts.path = path + this.opts.origin = origin + this.opts.maxRedirections = 0 + this.opts.query = null + + // https://tools.ietf.org/html/rfc7231#section-6.4.4 + // In case of HTTP 303, always replace method to be either HEAD or GET + if (statusCode === 303 && this.opts.method !== 'HEAD') { + this.opts.method = 'GET' + this.opts.body = null + } + } + + onData (chunk) { + if (this.location) { + /* + https://tools.ietf.org/html/rfc7231#section-6.4 + + TLDR: undici always ignores 3xx response bodies. + + Redirection is used to serve the requested resource from another URL, so it is assumes that + no body is generated (and thus can be ignored). Even though generating a body is not prohibited. + + For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually + (which means it's optional and not mandated) contain just an hyperlink to the value of + the Location response header, so the body can be ignored safely. + + For status 300, which is "Multiple Choices", the spec mentions both generating a Location + response header AND a response body with the other possible location to follow. + Since the spec explicitly chooses not to specify a format for such body and leave it to + servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it. + */ + } else { + return this.handler.onData(chunk) + } + } + + onComplete (trailers) { + if (this.location) { + /* + https://tools.ietf.org/html/rfc7231#section-6.4 + + TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections + and neither are useful if present. + + See comment on onData method above for more detailed information. + */ + + this.location = null + this.abort = null + + this.dispatch(this.opts, this) + } else { + this.handler.onComplete(trailers) + } + } + + onBodySent (chunk) { + if (this.handler.onBodySent) { + this.handler.onBodySent(chunk) + } + } +} + +function parseLocation (statusCode, headers) { + if (redirectableStatusCodes.indexOf(statusCode) === -1) { + return null + } + + for (let i = 0; i < headers.length; i += 2) { + if (headers[i].length === 8 && util.headerNameToString(headers[i]) === 'location') { + return headers[i + 1] + } + } +} + +// https://tools.ietf.org/html/rfc7231#section-6.4.4 +function shouldRemoveHeader (header, removeContent, unknownOrigin) { + if (header.length === 4) { + return util.headerNameToString(header) === 'host' + } + if (removeContent && util.headerNameToString(header).startsWith('content-')) { + return true + } + if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) { + const name = util.headerNameToString(header) + return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization' + } + return false +} + +// https://tools.ietf.org/html/rfc7231#section-6.4 +function cleanRequestHeaders (headers, removeContent, unknownOrigin) { + const ret = [] + if (Array.isArray(headers)) { + for (let i = 0; i < headers.length; i += 2) { + if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) { + ret.push(headers[i], headers[i + 1]) + } + } + } else if (headers && typeof headers === 'object') { + for (const key of Object.keys(headers)) { + if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) { + ret.push(key, headers[key]) + } + } + } else { + assert(headers == null, 'headers must be an object or an array') + } + return ret +} + +module.exports = RedirectHandler diff --git a/node/node_modules/npm/node_modules/undici/lib/handler/retry-handler.js b/node/node_modules/npm/node_modules/undici/lib/handler/retry-handler.js new file mode 100644 index 0000000000000000000000000000000000000000..40471104904ca12ec493154a21165bb4ba0465bc --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/handler/retry-handler.js @@ -0,0 +1,374 @@ +'use strict' +const assert = require('node:assert') + +const { kRetryHandlerDefaultRetry } = require('../core/symbols') +const { RequestRetryError } = require('../core/errors') +const { + isDisturbed, + parseHeaders, + parseRangeHeader, + wrapRequestBody +} = require('../core/util') + +function calculateRetryAfterHeader (retryAfter) { + const current = Date.now() + return new Date(retryAfter).getTime() - current +} + +class RetryHandler { + constructor (opts, handlers) { + const { retryOptions, ...dispatchOpts } = opts + const { + // Retry scoped + retry: retryFn, + maxRetries, + maxTimeout, + minTimeout, + timeoutFactor, + // Response scoped + methods, + errorCodes, + retryAfter, + statusCodes + } = retryOptions ?? {} + + this.dispatch = handlers.dispatch + this.handler = handlers.handler + this.opts = { ...dispatchOpts, body: wrapRequestBody(opts.body) } + this.abort = null + this.aborted = false + this.retryOpts = { + retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry], + retryAfter: retryAfter ?? true, + maxTimeout: maxTimeout ?? 30 * 1000, // 30s, + minTimeout: minTimeout ?? 500, // .5s + timeoutFactor: timeoutFactor ?? 2, + maxRetries: maxRetries ?? 5, + // What errors we should retry + methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'], + // Indicates which errors to retry + statusCodes: statusCodes ?? [500, 502, 503, 504, 429], + // List of errors to retry + errorCodes: errorCodes ?? [ + 'ECONNRESET', + 'ECONNREFUSED', + 'ENOTFOUND', + 'ENETDOWN', + 'ENETUNREACH', + 'EHOSTDOWN', + 'EHOSTUNREACH', + 'EPIPE', + 'UND_ERR_SOCKET' + ] + } + + this.retryCount = 0 + this.retryCountCheckpoint = 0 + this.start = 0 + this.end = null + this.etag = null + this.resume = null + + // Handle possible onConnect duplication + this.handler.onConnect(reason => { + this.aborted = true + if (this.abort) { + this.abort(reason) + } else { + this.reason = reason + } + }) + } + + onRequestSent () { + if (this.handler.onRequestSent) { + this.handler.onRequestSent() + } + } + + onUpgrade (statusCode, headers, socket) { + if (this.handler.onUpgrade) { + this.handler.onUpgrade(statusCode, headers, socket) + } + } + + onConnect (abort) { + if (this.aborted) { + abort(this.reason) + } else { + this.abort = abort + } + } + + onBodySent (chunk) { + if (this.handler.onBodySent) return this.handler.onBodySent(chunk) + } + + static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) { + const { statusCode, code, headers } = err + const { method, retryOptions } = opts + const { + maxRetries, + minTimeout, + maxTimeout, + timeoutFactor, + statusCodes, + errorCodes, + methods + } = retryOptions + const { counter } = state + + // Any code that is not a Undici's originated and allowed to retry + if (code && code !== 'UND_ERR_REQ_RETRY' && !errorCodes.includes(code)) { + cb(err) + return + } + + // If a set of method are provided and the current method is not in the list + if (Array.isArray(methods) && !methods.includes(method)) { + cb(err) + return + } + + // If a set of status code are provided and the current status code is not in the list + if ( + statusCode != null && + Array.isArray(statusCodes) && + !statusCodes.includes(statusCode) + ) { + cb(err) + return + } + + // If we reached the max number of retries + if (counter > maxRetries) { + cb(err) + return + } + + let retryAfterHeader = headers?.['retry-after'] + if (retryAfterHeader) { + retryAfterHeader = Number(retryAfterHeader) + retryAfterHeader = Number.isNaN(retryAfterHeader) + ? calculateRetryAfterHeader(retryAfterHeader) + : retryAfterHeader * 1e3 // Retry-After is in seconds + } + + const retryTimeout = + retryAfterHeader > 0 + ? Math.min(retryAfterHeader, maxTimeout) + : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout) + + setTimeout(() => cb(null), retryTimeout) + } + + onHeaders (statusCode, rawHeaders, resume, statusMessage) { + const headers = parseHeaders(rawHeaders) + + this.retryCount += 1 + + if (statusCode >= 300) { + if (this.retryOpts.statusCodes.includes(statusCode) === false) { + return this.handler.onHeaders( + statusCode, + rawHeaders, + resume, + statusMessage + ) + } else { + this.abort( + new RequestRetryError('Request failed', statusCode, { + headers, + data: { + count: this.retryCount + } + }) + ) + return false + } + } + + // Checkpoint for resume from where we left it + if (this.resume != null) { + this.resume = null + + // Only Partial Content 206 supposed to provide Content-Range, + // any other status code that partially consumed the payload + // should not be retry because it would result in downstream + // wrongly concatanete multiple responses. + if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) { + this.abort( + new RequestRetryError('server does not support the range header and the payload was partially consumed', statusCode, { + headers, + data: { count: this.retryCount } + }) + ) + return false + } + + const contentRange = parseRangeHeader(headers['content-range']) + // If no content range + if (!contentRange) { + this.abort( + new RequestRetryError('Content-Range mismatch', statusCode, { + headers, + data: { count: this.retryCount } + }) + ) + return false + } + + // Let's start with a weak etag check + if (this.etag != null && this.etag !== headers.etag) { + this.abort( + new RequestRetryError('ETag mismatch', statusCode, { + headers, + data: { count: this.retryCount } + }) + ) + return false + } + + const { start, size, end = size - 1 } = contentRange + + assert(this.start === start, 'content-range mismatch') + assert(this.end == null || this.end === end, 'content-range mismatch') + + this.resume = resume + return true + } + + if (this.end == null) { + if (statusCode === 206) { + // First time we receive 206 + const range = parseRangeHeader(headers['content-range']) + + if (range == null) { + return this.handler.onHeaders( + statusCode, + rawHeaders, + resume, + statusMessage + ) + } + + const { start, size, end = size - 1 } = range + assert( + start != null && Number.isFinite(start), + 'content-range mismatch' + ) + assert(end != null && Number.isFinite(end), 'invalid content-length') + + this.start = start + this.end = end + } + + // We make our best to checkpoint the body for further range headers + if (this.end == null) { + const contentLength = headers['content-length'] + this.end = contentLength != null ? Number(contentLength) - 1 : null + } + + assert(Number.isFinite(this.start)) + assert( + this.end == null || Number.isFinite(this.end), + 'invalid content-length' + ) + + this.resume = resume + this.etag = headers.etag != null ? headers.etag : null + + // Weak etags are not useful for comparison nor cache + // for instance not safe to assume if the response is byte-per-byte + // equal + if (this.etag != null && this.etag.startsWith('W/')) { + this.etag = null + } + + return this.handler.onHeaders( + statusCode, + rawHeaders, + resume, + statusMessage + ) + } + + const err = new RequestRetryError('Request failed', statusCode, { + headers, + data: { count: this.retryCount } + }) + + this.abort(err) + + return false + } + + onData (chunk) { + this.start += chunk.length + + return this.handler.onData(chunk) + } + + onComplete (rawTrailers) { + this.retryCount = 0 + return this.handler.onComplete(rawTrailers) + } + + onError (err) { + if (this.aborted || isDisturbed(this.opts.body)) { + return this.handler.onError(err) + } + + // We reconcile in case of a mix between network errors + // and server error response + if (this.retryCount - this.retryCountCheckpoint > 0) { + // We count the difference between the last checkpoint and the current retry count + this.retryCount = + this.retryCountCheckpoint + + (this.retryCount - this.retryCountCheckpoint) + } else { + this.retryCount += 1 + } + + this.retryOpts.retry( + err, + { + state: { counter: this.retryCount }, + opts: { retryOptions: this.retryOpts, ...this.opts } + }, + onRetry.bind(this) + ) + + function onRetry (err) { + if (err != null || this.aborted || isDisturbed(this.opts.body)) { + return this.handler.onError(err) + } + + if (this.start !== 0) { + const headers = { range: `bytes=${this.start}-${this.end ?? ''}` } + + // Weak etag check - weak etags will make comparison algorithms never match + if (this.etag != null) { + headers['if-match'] = this.etag + } + + this.opts = { + ...this.opts, + headers: { + ...this.opts.headers, + ...headers + } + } + } + + try { + this.retryCountCheckpoint = this.retryCount + this.dispatch(this.opts, this) + } catch (err) { + this.handler.onError(err) + } + } + } +} + +module.exports = RetryHandler diff --git a/node/node_modules/npm/node_modules/undici/lib/interceptor/dns.js b/node/node_modules/npm/node_modules/undici/lib/interceptor/dns.js new file mode 100644 index 0000000000000000000000000000000000000000..9042fc7a12bed45f74dba385754360d4a38168d3 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/interceptor/dns.js @@ -0,0 +1,375 @@ +'use strict' +const { isIP } = require('node:net') +const { lookup } = require('node:dns') +const DecoratorHandler = require('../handler/decorator-handler') +const { InvalidArgumentError, InformationalError } = require('../core/errors') +const maxInt = Math.pow(2, 31) - 1 + +class DNSInstance { + #maxTTL = 0 + #maxItems = 0 + #records = new Map() + dualStack = true + affinity = null + lookup = null + pick = null + + constructor (opts) { + this.#maxTTL = opts.maxTTL + this.#maxItems = opts.maxItems + this.dualStack = opts.dualStack + this.affinity = opts.affinity + this.lookup = opts.lookup ?? this.#defaultLookup + this.pick = opts.pick ?? this.#defaultPick + } + + get full () { + return this.#records.size === this.#maxItems + } + + runLookup (origin, opts, cb) { + const ips = this.#records.get(origin.hostname) + + // If full, we just return the origin + if (ips == null && this.full) { + cb(null, origin.origin) + return + } + + const newOpts = { + affinity: this.affinity, + dualStack: this.dualStack, + lookup: this.lookup, + pick: this.pick, + ...opts.dns, + maxTTL: this.#maxTTL, + maxItems: this.#maxItems + } + + // If no IPs we lookup + if (ips == null) { + this.lookup(origin, newOpts, (err, addresses) => { + if (err || addresses == null || addresses.length === 0) { + cb(err ?? new InformationalError('No DNS entries found')) + return + } + + this.setRecords(origin, addresses) + const records = this.#records.get(origin.hostname) + + const ip = this.pick( + origin, + records, + newOpts.affinity + ) + + let port + if (typeof ip.port === 'number') { + port = `:${ip.port}` + } else if (origin.port !== '') { + port = `:${origin.port}` + } else { + port = '' + } + + cb( + null, + `${origin.protocol}//${ + ip.family === 6 ? `[${ip.address}]` : ip.address + }${port}` + ) + }) + } else { + // If there's IPs we pick + const ip = this.pick( + origin, + ips, + newOpts.affinity + ) + + // If no IPs we lookup - deleting old records + if (ip == null) { + this.#records.delete(origin.hostname) + this.runLookup(origin, opts, cb) + return + } + + let port + if (typeof ip.port === 'number') { + port = `:${ip.port}` + } else if (origin.port !== '') { + port = `:${origin.port}` + } else { + port = '' + } + + cb( + null, + `${origin.protocol}//${ + ip.family === 6 ? `[${ip.address}]` : ip.address + }${port}` + ) + } + } + + #defaultLookup (origin, opts, cb) { + lookup( + origin.hostname, + { + all: true, + family: this.dualStack === false ? this.affinity : 0, + order: 'ipv4first' + }, + (err, addresses) => { + if (err) { + return cb(err) + } + + const results = new Map() + + for (const addr of addresses) { + // On linux we found duplicates, we attempt to remove them with + // the latest record + results.set(`${addr.address}:${addr.family}`, addr) + } + + cb(null, results.values()) + } + ) + } + + #defaultPick (origin, hostnameRecords, affinity) { + let ip = null + const { records, offset } = hostnameRecords + + let family + if (this.dualStack) { + if (affinity == null) { + // Balance between ip families + if (offset == null || offset === maxInt) { + hostnameRecords.offset = 0 + affinity = 4 + } else { + hostnameRecords.offset++ + affinity = (hostnameRecords.offset & 1) === 1 ? 6 : 4 + } + } + + if (records[affinity] != null && records[affinity].ips.length > 0) { + family = records[affinity] + } else { + family = records[affinity === 4 ? 6 : 4] + } + } else { + family = records[affinity] + } + + // If no IPs we return null + if (family == null || family.ips.length === 0) { + return ip + } + + if (family.offset == null || family.offset === maxInt) { + family.offset = 0 + } else { + family.offset++ + } + + const position = family.offset % family.ips.length + ip = family.ips[position] ?? null + + if (ip == null) { + return ip + } + + if (Date.now() - ip.timestamp > ip.ttl) { // record TTL is already in ms + // We delete expired records + // It is possible that they have different TTL, so we manage them individually + family.ips.splice(position, 1) + return this.pick(origin, hostnameRecords, affinity) + } + + return ip + } + + setRecords (origin, addresses) { + const timestamp = Date.now() + const records = { records: { 4: null, 6: null } } + for (const record of addresses) { + record.timestamp = timestamp + if (typeof record.ttl === 'number') { + // The record TTL is expected to be in ms + record.ttl = Math.min(record.ttl, this.#maxTTL) + } else { + record.ttl = this.#maxTTL + } + + const familyRecords = records.records[record.family] ?? { ips: [] } + + familyRecords.ips.push(record) + records.records[record.family] = familyRecords + } + + this.#records.set(origin.hostname, records) + } + + getHandler (meta, opts) { + return new DNSDispatchHandler(this, meta, opts) + } +} + +class DNSDispatchHandler extends DecoratorHandler { + #state = null + #opts = null + #dispatch = null + #handler = null + #origin = null + + constructor (state, { origin, handler, dispatch }, opts) { + super(handler) + this.#origin = origin + this.#handler = handler + this.#opts = { ...opts } + this.#state = state + this.#dispatch = dispatch + } + + onError (err) { + switch (err.code) { + case 'ETIMEDOUT': + case 'ECONNREFUSED': { + if (this.#state.dualStack) { + // We delete the record and retry + this.#state.runLookup(this.#origin, this.#opts, (err, newOrigin) => { + if (err) { + return this.#handler.onError(err) + } + + const dispatchOpts = { + ...this.#opts, + origin: newOrigin + } + + this.#dispatch(dispatchOpts, this) + }) + + // if dual-stack disabled, we error out + return + } + + this.#handler.onError(err) + return + } + case 'ENOTFOUND': + this.#state.deleteRecord(this.#origin) + // eslint-disable-next-line no-fallthrough + default: + this.#handler.onError(err) + break + } + } +} + +module.exports = interceptorOpts => { + if ( + interceptorOpts?.maxTTL != null && + (typeof interceptorOpts?.maxTTL !== 'number' || interceptorOpts?.maxTTL < 0) + ) { + throw new InvalidArgumentError('Invalid maxTTL. Must be a positive number') + } + + if ( + interceptorOpts?.maxItems != null && + (typeof interceptorOpts?.maxItems !== 'number' || + interceptorOpts?.maxItems < 1) + ) { + throw new InvalidArgumentError( + 'Invalid maxItems. Must be a positive number and greater than zero' + ) + } + + if ( + interceptorOpts?.affinity != null && + interceptorOpts?.affinity !== 4 && + interceptorOpts?.affinity !== 6 + ) { + throw new InvalidArgumentError('Invalid affinity. Must be either 4 or 6') + } + + if ( + interceptorOpts?.dualStack != null && + typeof interceptorOpts?.dualStack !== 'boolean' + ) { + throw new InvalidArgumentError('Invalid dualStack. Must be a boolean') + } + + if ( + interceptorOpts?.lookup != null && + typeof interceptorOpts?.lookup !== 'function' + ) { + throw new InvalidArgumentError('Invalid lookup. Must be a function') + } + + if ( + interceptorOpts?.pick != null && + typeof interceptorOpts?.pick !== 'function' + ) { + throw new InvalidArgumentError('Invalid pick. Must be a function') + } + + const dualStack = interceptorOpts?.dualStack ?? true + let affinity + if (dualStack) { + affinity = interceptorOpts?.affinity ?? null + } else { + affinity = interceptorOpts?.affinity ?? 4 + } + + const opts = { + maxTTL: interceptorOpts?.maxTTL ?? 10e3, // Expressed in ms + lookup: interceptorOpts?.lookup ?? null, + pick: interceptorOpts?.pick ?? null, + dualStack, + affinity, + maxItems: interceptorOpts?.maxItems ?? Infinity + } + + const instance = new DNSInstance(opts) + + return dispatch => { + return function dnsInterceptor (origDispatchOpts, handler) { + const origin = + origDispatchOpts.origin.constructor === URL + ? origDispatchOpts.origin + : new URL(origDispatchOpts.origin) + + if (isIP(origin.hostname) !== 0) { + return dispatch(origDispatchOpts, handler) + } + + instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => { + if (err) { + return handler.onError(err) + } + + let dispatchOpts = null + dispatchOpts = { + ...origDispatchOpts, + servername: origin.hostname, // For SNI on TLS + origin: newOrigin, + headers: { + host: origin.hostname, + ...origDispatchOpts.headers + } + } + + dispatch( + dispatchOpts, + instance.getHandler({ origin, dispatch, handler }, origDispatchOpts) + ) + }) + + return true + } + } +} diff --git a/node/node_modules/npm/node_modules/undici/lib/interceptor/dump.js b/node/node_modules/npm/node_modules/undici/lib/interceptor/dump.js new file mode 100644 index 0000000000000000000000000000000000000000..f4e3c7b6e04e244ba04bfee938eed2c68386382a --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/interceptor/dump.js @@ -0,0 +1,123 @@ +'use strict' + +const util = require('../core/util') +const { InvalidArgumentError, RequestAbortedError } = require('../core/errors') +const DecoratorHandler = require('../handler/decorator-handler') + +class DumpHandler extends DecoratorHandler { + #maxSize = 1024 * 1024 + #abort = null + #dumped = false + #aborted = false + #size = 0 + #reason = null + #handler = null + + constructor ({ maxSize }, handler) { + super(handler) + + if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) { + throw new InvalidArgumentError('maxSize must be a number greater than 0') + } + + this.#maxSize = maxSize ?? this.#maxSize + this.#handler = handler + } + + onConnect (abort) { + this.#abort = abort + + this.#handler.onConnect(this.#customAbort.bind(this)) + } + + #customAbort (reason) { + this.#aborted = true + this.#reason = reason + } + + // TODO: will require adjustment after new hooks are out + onHeaders (statusCode, rawHeaders, resume, statusMessage) { + const headers = util.parseHeaders(rawHeaders) + const contentLength = headers['content-length'] + + if (contentLength != null && contentLength > this.#maxSize) { + throw new RequestAbortedError( + `Response size (${contentLength}) larger than maxSize (${ + this.#maxSize + })` + ) + } + + if (this.#aborted) { + return true + } + + return this.#handler.onHeaders( + statusCode, + rawHeaders, + resume, + statusMessage + ) + } + + onError (err) { + if (this.#dumped) { + return + } + + err = this.#reason ?? err + + this.#handler.onError(err) + } + + onData (chunk) { + this.#size = this.#size + chunk.length + + if (this.#size >= this.#maxSize) { + this.#dumped = true + + if (this.#aborted) { + this.#handler.onError(this.#reason) + } else { + this.#handler.onComplete([]) + } + } + + return true + } + + onComplete (trailers) { + if (this.#dumped) { + return + } + + if (this.#aborted) { + this.#handler.onError(this.reason) + return + } + + this.#handler.onComplete(trailers) + } +} + +function createDumpInterceptor ( + { maxSize: defaultMaxSize } = { + maxSize: 1024 * 1024 + } +) { + return dispatch => { + return function Intercept (opts, handler) { + const { dumpMaxSize = defaultMaxSize } = + opts + + const dumpHandler = new DumpHandler( + { maxSize: dumpMaxSize }, + handler + ) + + return dispatch(opts, dumpHandler) + } + } +} + +module.exports = createDumpInterceptor diff --git a/node/node_modules/npm/node_modules/undici/lib/interceptor/redirect-interceptor.js b/node/node_modules/npm/node_modules/undici/lib/interceptor/redirect-interceptor.js new file mode 100644 index 0000000000000000000000000000000000000000..82394b750caf5c1f9dbcfcc0675313b1b4c1baae --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/interceptor/redirect-interceptor.js @@ -0,0 +1,21 @@ +'use strict' + +const RedirectHandler = require('../handler/redirect-handler') + +function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) { + return (dispatch) => { + return function Intercept (opts, handler) { + const { maxRedirections = defaultMaxRedirections } = opts + + if (!maxRedirections) { + return dispatch(opts, handler) + } + + const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler) + opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting. + return dispatch(opts, redirectHandler) + } + } +} + +module.exports = createRedirectInterceptor diff --git a/node/node_modules/npm/node_modules/undici/lib/interceptor/redirect.js b/node/node_modules/npm/node_modules/undici/lib/interceptor/redirect.js new file mode 100644 index 0000000000000000000000000000000000000000..c96f5212101cc09aba9a8aaccc076b76e97554c0 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/interceptor/redirect.js @@ -0,0 +1,24 @@ +'use strict' +const RedirectHandler = require('../handler/redirect-handler') + +module.exports = opts => { + const globalMaxRedirections = opts?.maxRedirections + return dispatch => { + return function redirectInterceptor (opts, handler) { + const { maxRedirections = globalMaxRedirections, ...baseOpts } = opts + + if (!maxRedirections) { + return dispatch(opts, handler) + } + + const redirectHandler = new RedirectHandler( + dispatch, + maxRedirections, + opts, + handler + ) + + return dispatch(baseOpts, redirectHandler) + } + } +} diff --git a/node/node_modules/npm/node_modules/undici/lib/interceptor/response-error.js b/node/node_modules/npm/node_modules/undici/lib/interceptor/response-error.js new file mode 100644 index 0000000000000000000000000000000000000000..95c7584c814d8bef702202c324e3c03e1e4ecbd9 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/interceptor/response-error.js @@ -0,0 +1,86 @@ +'use strict' + +const { parseHeaders } = require('../core/util') +const DecoratorHandler = require('../handler/decorator-handler') +const { ResponseError } = require('../core/errors') + +class Handler extends DecoratorHandler { + #handler + #statusCode + #contentType + #decoder + #headers + #body + + constructor (opts, { handler }) { + super(handler) + this.#handler = handler + } + + onConnect (abort) { + this.#statusCode = 0 + this.#contentType = null + this.#decoder = null + this.#headers = null + this.#body = '' + + return this.#handler.onConnect(abort) + } + + onHeaders (statusCode, rawHeaders, resume, statusMessage, headers = parseHeaders(rawHeaders)) { + this.#statusCode = statusCode + this.#headers = headers + this.#contentType = headers['content-type'] + + if (this.#statusCode < 400) { + return this.#handler.onHeaders(statusCode, rawHeaders, resume, statusMessage, headers) + } + + if (this.#contentType === 'application/json' || this.#contentType === 'text/plain') { + this.#decoder = new TextDecoder('utf-8') + } + } + + onData (chunk) { + if (this.#statusCode < 400) { + return this.#handler.onData(chunk) + } + + this.#body += this.#decoder?.decode(chunk, { stream: true }) ?? '' + } + + onComplete (rawTrailers) { + if (this.#statusCode >= 400) { + this.#body += this.#decoder?.decode(undefined, { stream: false }) ?? '' + + if (this.#contentType === 'application/json') { + try { + this.#body = JSON.parse(this.#body) + } catch { + // Do nothing... + } + } + + let err + const stackTraceLimit = Error.stackTraceLimit + Error.stackTraceLimit = 0 + try { + err = new ResponseError('Response Error', this.#statusCode, this.#headers, this.#body) + } finally { + Error.stackTraceLimit = stackTraceLimit + } + + this.#handler.onError(err) + } else { + this.#handler.onComplete(rawTrailers) + } + } + + onError (err) { + this.#handler.onError(err) + } +} + +module.exports = (dispatch) => (opts, handler) => opts.throwOnError + ? dispatch(opts, new Handler(opts, { handler })) + : dispatch(opts, handler) diff --git a/node/node_modules/npm/node_modules/undici/lib/interceptor/retry.js b/node/node_modules/npm/node_modules/undici/lib/interceptor/retry.js new file mode 100644 index 0000000000000000000000000000000000000000..35e7e481981b3b1395920886a4032c3902b10373 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/interceptor/retry.js @@ -0,0 +1,19 @@ +'use strict' +const RetryHandler = require('../handler/retry-handler') + +module.exports = globalOpts => { + return dispatch => { + return function retryInterceptor (opts, handler) { + return dispatch( + opts, + new RetryHandler( + { ...opts, retryOptions: { ...globalOpts, ...opts.retryOptions } }, + { + handler, + dispatch + } + ) + ) + } + } +} diff --git a/node/node_modules/npm/node_modules/undici/lib/llhttp/constants.js b/node/node_modules/npm/node_modules/undici/lib/llhttp/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..93655c92b7e2cf002ce836a42f83b9a2481a81c4 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/llhttp/constants.js @@ -0,0 +1,278 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; +const utils_1 = require("./utils"); +// C headers +var ERROR; +(function (ERROR) { + ERROR[ERROR["OK"] = 0] = "OK"; + ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL"; + ERROR[ERROR["STRICT"] = 2] = "STRICT"; + ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED"; + ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH"; + ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION"; + ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD"; + ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL"; + ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT"; + ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION"; + ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN"; + ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH"; + ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE"; + ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS"; + ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE"; + ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING"; + ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN"; + ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE"; + ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE"; + ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER"; + ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE"; + ERROR[ERROR["PAUSED"] = 21] = "PAUSED"; + ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE"; + ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE"; + ERROR[ERROR["USER"] = 24] = "USER"; +})(ERROR = exports.ERROR || (exports.ERROR = {})); +var TYPE; +(function (TYPE) { + TYPE[TYPE["BOTH"] = 0] = "BOTH"; + TYPE[TYPE["REQUEST"] = 1] = "REQUEST"; + TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE"; +})(TYPE = exports.TYPE || (exports.TYPE = {})); +var FLAGS; +(function (FLAGS) { + FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE"; + FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE"; + FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE"; + FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED"; + FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE"; + FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH"; + FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY"; + FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING"; + // 1 << 8 is unused + FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING"; +})(FLAGS = exports.FLAGS || (exports.FLAGS = {})); +var LENIENT_FLAGS; +(function (LENIENT_FLAGS) { + LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS"; + LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH"; + LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE"; +})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {})); +var METHODS; +(function (METHODS) { + METHODS[METHODS["DELETE"] = 0] = "DELETE"; + METHODS[METHODS["GET"] = 1] = "GET"; + METHODS[METHODS["HEAD"] = 2] = "HEAD"; + METHODS[METHODS["POST"] = 3] = "POST"; + METHODS[METHODS["PUT"] = 4] = "PUT"; + /* pathological */ + METHODS[METHODS["CONNECT"] = 5] = "CONNECT"; + METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS"; + METHODS[METHODS["TRACE"] = 7] = "TRACE"; + /* WebDAV */ + METHODS[METHODS["COPY"] = 8] = "COPY"; + METHODS[METHODS["LOCK"] = 9] = "LOCK"; + METHODS[METHODS["MKCOL"] = 10] = "MKCOL"; + METHODS[METHODS["MOVE"] = 11] = "MOVE"; + METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND"; + METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH"; + METHODS[METHODS["SEARCH"] = 14] = "SEARCH"; + METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK"; + METHODS[METHODS["BIND"] = 16] = "BIND"; + METHODS[METHODS["REBIND"] = 17] = "REBIND"; + METHODS[METHODS["UNBIND"] = 18] = "UNBIND"; + METHODS[METHODS["ACL"] = 19] = "ACL"; + /* subversion */ + METHODS[METHODS["REPORT"] = 20] = "REPORT"; + METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY"; + METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT"; + METHODS[METHODS["MERGE"] = 23] = "MERGE"; + /* upnp */ + METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH"; + METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY"; + METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE"; + METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE"; + /* RFC-5789 */ + METHODS[METHODS["PATCH"] = 28] = "PATCH"; + METHODS[METHODS["PURGE"] = 29] = "PURGE"; + /* CalDAV */ + METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR"; + /* RFC-2068, section 19.6.1.2 */ + METHODS[METHODS["LINK"] = 31] = "LINK"; + METHODS[METHODS["UNLINK"] = 32] = "UNLINK"; + /* icecast */ + METHODS[METHODS["SOURCE"] = 33] = "SOURCE"; + /* RFC-7540, section 11.6 */ + METHODS[METHODS["PRI"] = 34] = "PRI"; + /* RFC-2326 RTSP */ + METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE"; + METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE"; + METHODS[METHODS["SETUP"] = 37] = "SETUP"; + METHODS[METHODS["PLAY"] = 38] = "PLAY"; + METHODS[METHODS["PAUSE"] = 39] = "PAUSE"; + METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN"; + METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER"; + METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER"; + METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT"; + METHODS[METHODS["RECORD"] = 44] = "RECORD"; + /* RAOP */ + METHODS[METHODS["FLUSH"] = 45] = "FLUSH"; +})(METHODS = exports.METHODS || (exports.METHODS = {})); +exports.METHODS_HTTP = [ + METHODS.DELETE, + METHODS.GET, + METHODS.HEAD, + METHODS.POST, + METHODS.PUT, + METHODS.CONNECT, + METHODS.OPTIONS, + METHODS.TRACE, + METHODS.COPY, + METHODS.LOCK, + METHODS.MKCOL, + METHODS.MOVE, + METHODS.PROPFIND, + METHODS.PROPPATCH, + METHODS.SEARCH, + METHODS.UNLOCK, + METHODS.BIND, + METHODS.REBIND, + METHODS.UNBIND, + METHODS.ACL, + METHODS.REPORT, + METHODS.MKACTIVITY, + METHODS.CHECKOUT, + METHODS.MERGE, + METHODS['M-SEARCH'], + METHODS.NOTIFY, + METHODS.SUBSCRIBE, + METHODS.UNSUBSCRIBE, + METHODS.PATCH, + METHODS.PURGE, + METHODS.MKCALENDAR, + METHODS.LINK, + METHODS.UNLINK, + METHODS.PRI, + // TODO(indutny): should we allow it with HTTP? + METHODS.SOURCE, +]; +exports.METHODS_ICE = [ + METHODS.SOURCE, +]; +exports.METHODS_RTSP = [ + METHODS.OPTIONS, + METHODS.DESCRIBE, + METHODS.ANNOUNCE, + METHODS.SETUP, + METHODS.PLAY, + METHODS.PAUSE, + METHODS.TEARDOWN, + METHODS.GET_PARAMETER, + METHODS.SET_PARAMETER, + METHODS.REDIRECT, + METHODS.RECORD, + METHODS.FLUSH, + // For AirPlay + METHODS.GET, + METHODS.POST, +]; +exports.METHOD_MAP = utils_1.enumToMap(METHODS); +exports.H_METHOD_MAP = {}; +Object.keys(exports.METHOD_MAP).forEach((key) => { + if (/^H/.test(key)) { + exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key]; + } +}); +var FINISH; +(function (FINISH) { + FINISH[FINISH["SAFE"] = 0] = "SAFE"; + FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB"; + FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE"; +})(FINISH = exports.FINISH || (exports.FINISH = {})); +exports.ALPHA = []; +for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) { + // Upper case + exports.ALPHA.push(String.fromCharCode(i)); + // Lower case + exports.ALPHA.push(String.fromCharCode(i + 0x20)); +} +exports.NUM_MAP = { + 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, + 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, +}; +exports.HEX_MAP = { + 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, + 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, + A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF, + a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf, +}; +exports.NUM = [ + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', +]; +exports.ALPHANUM = exports.ALPHA.concat(exports.NUM); +exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')']; +exports.USERINFO_CHARS = exports.ALPHANUM + .concat(exports.MARK) + .concat(['%', ';', ':', '&', '=', '+', '$', ',']); +// TODO(indutny): use RFC +exports.STRICT_URL_CHAR = [ + '!', '"', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + ':', ';', '<', '=', '>', + '@', '[', '\\', ']', '^', '_', + '`', + '{', '|', '}', '~', +].concat(exports.ALPHANUM); +exports.URL_CHAR = exports.STRICT_URL_CHAR + .concat(['\t', '\f']); +// All characters with 0x80 bit set to 1 +for (let i = 0x80; i <= 0xff; i++) { + exports.URL_CHAR.push(i); +} +exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']); +/* Tokens as defined by rfc 2616. Also lowercases them. + * token = 1* + * separators = "(" | ")" | "<" | ">" | "@" + * | "," | ";" | ":" | "\" | <"> + * | "/" | "[" | "]" | "?" | "=" + * | "{" | "}" | SP | HT + */ +exports.STRICT_TOKEN = [ + '!', '#', '$', '%', '&', '\'', + '*', '+', '-', '.', + '^', '_', '`', + '|', '~', +].concat(exports.ALPHANUM); +exports.TOKEN = exports.STRICT_TOKEN.concat([' ']); +/* + * Verify that a char is a valid visible (printable) US-ASCII + * character or %x80-FF + */ +exports.HEADER_CHARS = ['\t']; +for (let i = 32; i <= 255; i++) { + if (i !== 127) { + exports.HEADER_CHARS.push(i); + } +} +// ',' = \x44 +exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44); +exports.MAJOR = exports.NUM_MAP; +exports.MINOR = exports.MAJOR; +var HEADER_STATE; +(function (HEADER_STATE) { + HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL"; + HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION"; + HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH"; + HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING"; + HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE"; + HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE"; + HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE"; + HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE"; + HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED"; +})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {})); +exports.SPECIAL_HEADERS = { + 'connection': HEADER_STATE.CONNECTION, + 'content-length': HEADER_STATE.CONTENT_LENGTH, + 'proxy-connection': HEADER_STATE.CONNECTION, + 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING, + 'upgrade': HEADER_STATE.UPGRADE, +}; +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/undici/lib/llhttp/llhttp-wasm.js b/node/node_modules/npm/node_modules/undici/lib/llhttp/llhttp-wasm.js new file mode 100644 index 0000000000000000000000000000000000000000..1234beb83570cdb93c38770e62398d524f8e757d --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/llhttp/llhttp-wasm.js @@ -0,0 +1,5 @@ +'use strict' + +const { Buffer } = require('node:buffer') + +module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK07MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtXACAAQRhqQgA3AwAgAEIANwMAIABBOGpCADcDACAAQTBqQgA3AwAgAEEoakIANwMAIABBIGpCADcDACAAQRBqQgA3AwAgAEEIakIANwMAIABB3QE2AhwLBgAgABAyC5otAQt/IwBBEGsiCiQAQaTQACgCACIJRQRAQeTTACgCACIFRQRAQfDTAEJ/NwIAQejTAEKAgISAgIDAADcCAEHk0wAgCkEIakFwcUHYqtWqBXMiBTYCAEH40wBBADYCAEHI0wBBADYCAAtBzNMAQYDUBDYCAEGc0ABBgNQENgIAQbDQACAFNgIAQazQAEF/NgIAQdDTAEGArAM2AgADQCABQcjQAGogAUG80ABqIgI2AgAgAiABQbTQAGoiAzYCACABQcDQAGogAzYCACABQdDQAGogAUHE0ABqIgM2AgAgAyACNgIAIAFB2NAAaiABQczQAGoiAjYCACACIAM2AgAgAUHU0ABqIAI2AgAgAUEgaiIBQYACRw0AC0GM1ARBwasDNgIAQajQAEH00wAoAgA2AgBBmNAAQcCrAzYCAEGk0ABBiNQENgIAQcz/B0E4NgIAQYjUBCEJCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFNBEBBjNAAKAIAIgZBECAAQRNqQXBxIABBC0kbIgRBA3YiAHYiAUEDcQRAAkAgAUEBcSAAckEBcyICQQN0IgBBtNAAaiIBIABBvNAAaigCACIAKAIIIgNGBEBBjNAAIAZBfiACd3E2AgAMAQsgASADNgIIIAMgATYCDAsgAEEIaiEBIAAgAkEDdCICQQNyNgIEIAAgAmoiACAAKAIEQQFyNgIEDBELQZTQACgCACIIIARPDQEgAQRAAkBBAiAAdCICQQAgAmtyIAEgAHRxaCIAQQN0IgJBtNAAaiIBIAJBvNAAaigCACICKAIIIgNGBEBBjNAAIAZBfiAAd3EiBjYCAAwBCyABIAM2AgggAyABNgIMCyACIARBA3I2AgQgAEEDdCIAIARrIQUgACACaiAFNgIAIAIgBGoiBCAFQQFyNgIEIAgEQCAIQXhxQbTQAGohAEGg0AAoAgAhAwJ/QQEgCEEDdnQiASAGcUUEQEGM0AAgASAGcjYCACAADAELIAAoAggLIgEgAzYCDCAAIAM2AgggAyAANgIMIAMgATYCCAsgAkEIaiEBQaDQACAENgIAQZTQACAFNgIADBELQZDQACgCACILRQ0BIAtoQQJ0QbzSAGooAgAiACgCBEF4cSAEayEFIAAhAgNAAkAgAigCECIBRQRAIAJBFGooAgAiAUUNAQsgASgCBEF4cSAEayIDIAVJIQIgAyAFIAIbIQUgASAAIAIbIQAgASECDAELCyAAKAIYIQkgACgCDCIDIABHBEBBnNAAKAIAGiADIAAoAggiATYCCCABIAM2AgwMEAsgAEEUaiICKAIAIgFFBEAgACgCECIBRQ0DIABBEGohAgsDQCACIQcgASIDQRRqIgIoAgAiAQ0AIANBEGohAiADKAIQIgENAAsgB0EANgIADA8LQX8hBCAAQb9/Sw0AIABBE2oiAUFwcSEEQZDQACgCACIIRQ0AQQAgBGshBQJAAkACQAJ/QQAgBEGAAkkNABpBHyAEQf///wdLDQAaIARBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmoLIgZBAnRBvNIAaigCACICRQRAQQAhAUEAIQMMAQtBACEBIARBGSAGQQF2a0EAIAZBH0cbdCEAQQAhAwNAAkAgAigCBEF4cSAEayIHIAVPDQAgAiEDIAciBQ0AQQAhBSACIQEMAwsgASACQRRqKAIAIgcgByACIABBHXZBBHFqQRBqKAIAIgJGGyABIAcbIQEgAEEBdCEAIAINAAsLIAEgA3JFBEBBACEDQQIgBnQiAEEAIABrciAIcSIARQ0DIABoQQJ0QbzSAGooAgAhAQsgAUUNAQsDQCABKAIEQXhxIARrIgIgBUkhACACIAUgABshBSABIAMgABshAyABKAIQIgAEfyAABSABQRRqKAIACyIBDQALCyADRQ0AIAVBlNAAKAIAIARrTw0AIAMoAhghByADIAMoAgwiAEcEQEGc0AAoAgAaIAAgAygCCCIBNgIIIAEgADYCDAwOCyADQRRqIgIoAgAiAUUEQCADKAIQIgFFDQMgA0EQaiECCwNAIAIhBiABIgBBFGoiAigCACIBDQAgAEEQaiECIAAoAhAiAQ0ACyAGQQA2AgAMDQtBlNAAKAIAIgMgBE8EQEGg0AAoAgAhAQJAIAMgBGsiAkEQTwRAIAEgBGoiACACQQFyNgIEIAEgA2ogAjYCACABIARBA3I2AgQMAQsgASADQQNyNgIEIAEgA2oiACAAKAIEQQFyNgIEQQAhAEEAIQILQZTQACACNgIAQaDQACAANgIAIAFBCGohAQwPC0GY0AAoAgAiAyAESwRAIAQgCWoiACADIARrIgFBAXI2AgRBpNAAIAA2AgBBmNAAIAE2AgAgCSAEQQNyNgIEIAlBCGohAQwPC0EAIQEgBAJ/QeTTACgCAARAQezTACgCAAwBC0Hw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBDGpBcHFB2KrVqgVzNgIAQfjTAEEANgIAQcjTAEEANgIAQYCABAsiACAEQccAaiIFaiIGQQAgAGsiB3EiAk8EQEH80wBBMDYCAAwPCwJAQcTTACgCACIBRQ0AQbzTACgCACIIIAJqIQAgACABTSAAIAhLcQ0AQQAhAUH80wBBMDYCAAwPC0HI0wAtAABBBHENBAJAAkAgCQRAQczTACEBA0AgASgCACIAIAlNBEAgACABKAIEaiAJSw0DCyABKAIIIgENAAsLQQAQMyIAQX9GDQUgAiEGQejTACgCACIBQQFrIgMgAHEEQCACIABrIAAgA2pBACABa3FqIQYLIAQgBk8NBSAGQf7///8HSw0FQcTTACgCACIDBEBBvNMAKAIAIgcgBmohASABIAdNDQYgASADSw0GCyAGEDMiASAARw0BDAcLIAYgA2sgB3EiBkH+////B0sNBCAGEDMhACAAIAEoAgAgASgCBGpGDQMgACEBCwJAIAYgBEHIAGpPDQAgAUF/Rg0AQezTACgCACIAIAUgBmtqQQAgAGtxIgBB/v///wdLBEAgASEADAcLIAAQM0F/RwRAIAAgBmohBiABIQAMBwtBACAGaxAzGgwECyABIgBBf0cNBQwDC0EAIQMMDAtBACEADAoLIABBf0cNAgtByNMAQcjTACgCAEEEcjYCAAsgAkH+////B0sNASACEDMhAEEAEDMhASAAQX9GDQEgAUF/Rg0BIAAgAU8NASABIABrIgYgBEE4ak0NAQtBvNMAQbzTACgCACAGaiIBNgIAQcDTACgCACABSQRAQcDTACABNgIACwJAAkACQEGk0AAoAgAiAgRAQczTACEBA0AgACABKAIAIgMgASgCBCIFakYNAiABKAIIIgENAAsMAgtBnNAAKAIAIgFBAEcgACABT3FFBEBBnNAAIAA2AgALQQAhAUHQ0wAgBjYCAEHM0wAgADYCAEGs0ABBfzYCAEGw0ABB5NMAKAIANgIAQdjTAEEANgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBeCAAa0EPcSIBIABqIgIgBkE4ayIDIAFrIgFBAXI2AgRBqNAAQfTTACgCADYCAEGY0AAgATYCAEGk0AAgAjYCACAAIANqQTg2AgQMAgsgACACTQ0AIAIgA0kNACABKAIMQQhxDQBBeCACa0EPcSIAIAJqIgNBmNAAKAIAIAZqIgcgAGsiAEEBcjYCBCABIAUgBmo2AgRBqNAAQfTTACgCADYCAEGY0AAgADYCAEGk0AAgAzYCACACIAdqQTg2AgQMAQsgAEGc0AAoAgBJBEBBnNAAIAA2AgALIAAgBmohA0HM0wAhAQJAAkACQANAIAMgASgCAEcEQCABKAIIIgENAQwCCwsgAS0ADEEIcUUNAQtBzNMAIQEDQCABKAIAIgMgAk0EQCADIAEoAgRqIgUgAksNAwsgASgCCCEBDAALAAsgASAANgIAIAEgASgCBCAGajYCBCAAQXggAGtBD3FqIgkgBEEDcjYCBCADQXggA2tBD3FqIgYgBCAJaiIEayEBIAIgBkYEQEGk0AAgBDYCAEGY0ABBmNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEDAgLQaDQACgCACAGRgRAQaDQACAENgIAQZTQAEGU0AAoAgAgAWoiADYCACAEIABBAXI2AgQgACAEaiAANgIADAgLIAYoAgQiBUEDcUEBRw0GIAVBeHEhCCAFQf8BTQRAIAVBA3YhAyAGKAIIIgAgBigCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBwsgAiAANgIIIAAgAjYCDAwGCyAGKAIYIQcgBiAGKAIMIgBHBEAgACAGKAIIIgI2AgggAiAANgIMDAULIAZBFGoiAigCACIFRQRAIAYoAhAiBUUNBCAGQRBqIQILA0AgAiEDIAUiAEEUaiICKAIAIgUNACAAQRBqIQIgACgCECIFDQALIANBADYCAAwEC0F4IABrQQ9xIgEgAGoiByAGQThrIgMgAWsiAUEBcjYCBCAAIANqQTg2AgQgAiAFQTcgBWtBD3FqQT9rIgMgAyACQRBqSRsiA0EjNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAc2AgAgA0EQakHU0wApAgA3AgAgA0HM0wApAgA3AghB1NMAIANBCGo2AgBB0NMAIAY2AgBBzNMAIAA2AgBB2NMAQQA2AgAgA0EkaiEBA0AgAUEHNgIAIAUgAUEEaiIBSw0ACyACIANGDQAgAyADKAIEQX5xNgIEIAMgAyACayIFNgIAIAIgBUEBcjYCBCAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIDcUUEQEGM0AAgASADcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEGQ0AAoAgAiA0EBIAF0IgZxRQRAIAAgAjYCAEGQ0AAgAyAGcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQMCQANAIAMiACgCBEF4cSAFRg0BIAFBHXYhAyABQQF0IQEgACADQQRxakEQaiIGKAIAIgMNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAtBmNAAKAIAIgEgBE0NAEGk0AAoAgAiACAEaiICIAEgBGsiAUEBcjYCBEGY0AAgATYCAEGk0AAgAjYCACAAIARBA3I2AgQgAEEIaiEBDAgLQQAhAUH80wBBMDYCAAwHC0EAIQALIAdFDQACQCAGKAIcIgJBAnRBvNIAaiIDKAIAIAZGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAdBEEEUIAcoAhAgBkYbaiAANgIAIABFDQELIAAgBzYCGCAGKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAGQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAIaiEBIAYgCGoiBigCBCEFCyAGIAVBfnE2AgQgASAEaiABNgIAIAQgAUEBcjYCBCABQf8BTQRAIAFBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASABQQN2dCIBcUUEQEGM0AAgASACcjYCACAADAELIAAoAggLIgEgBDYCDCAAIAQ2AgggBCAANgIMIAQgATYCCAwBC0EfIQUgAUH///8HTQRAIAFBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohBQsgBCAFNgIcIARCADcCECAFQQJ0QbzSAGohAEGQ0AAoAgAiAkEBIAV0IgNxRQRAIAAgBDYCAEGQ0AAgAiADcjYCACAEIAA2AhggBCAENgIIIAQgBDYCDAwBCyABQRkgBUEBdmtBACAFQR9HG3QhBSAAKAIAIQACQANAIAAiAigCBEF4cSABRg0BIAVBHXYhACAFQQF0IQUgAiAAQQRxakEQaiIDKAIAIgANAAsgAyAENgIAIAQgAjYCGCAEIAQ2AgwgBCAENgIIDAELIAIoAggiACAENgIMIAIgBDYCCCAEQQA2AhggBCACNgIMIAQgADYCCAsgCUEIaiEBDAILAkAgB0UNAAJAIAMoAhwiAUECdEG80gBqIgIoAgAgA0YEQCACIAA2AgAgAA0BQZDQACAIQX4gAXdxIgg2AgAMAgsgB0EQQRQgBygCECADRhtqIAA2AgAgAEUNAQsgACAHNgIYIAMoAhAiAQRAIAAgATYCECABIAA2AhgLIANBFGooAgAiAUUNACAAQRRqIAE2AgAgASAANgIYCwJAIAVBD00EQCADIAQgBWoiAEEDcjYCBCAAIANqIgAgACgCBEEBcjYCBAwBCyADIARqIgIgBUEBcjYCBCADIARBA3I2AgQgAiAFaiAFNgIAIAVB/wFNBEAgBUF4cUG00ABqIQACf0GM0AAoAgAiAUEBIAVBA3Z0IgVxRQRAQYzQACABIAVyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRBvNIAaiEAQQEgAXQiBCAIcUUEQCAAIAI2AgBBkNAAIAQgCHI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEEAkADQCAEIgAoAgRBeHEgBUYNASABQR12IQQgAUEBdCEBIAAgBEEEcWpBEGoiBigCACIEDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLIANBCGohAQwBCwJAIAlFDQACQCAAKAIcIgFBAnRBvNIAaiICKAIAIABGBEAgAiADNgIAIAMNAUGQ0AAgC0F+IAF3cTYCAAwCCyAJQRBBFCAJKAIQIABGG2ogAzYCACADRQ0BCyADIAk2AhggACgCECIBBEAgAyABNgIQIAEgAzYCGAsgAEEUaigCACIBRQ0AIANBFGogATYCACABIAM2AhgLAkAgBUEPTQRAIAAgBCAFaiIBQQNyNgIEIAAgAWoiASABKAIEQQFyNgIEDAELIAAgBGoiByAFQQFyNgIEIAAgBEEDcjYCBCAFIAdqIAU2AgAgCARAIAhBeHFBtNAAaiEBQaDQACgCACEDAn9BASAIQQN2dCICIAZxRQRAQYzQACACIAZyNgIAIAEMAQsgASgCCAsiAiADNgIMIAEgAzYCCCADIAE2AgwgAyACNgIIC0Gg0AAgBzYCAEGU0AAgBTYCAAsgAEEIaiEBCyAKQRBqJAAgAQtDACAARQRAPwBBEHQPCwJAIABB//8DcQ0AIABBAEgNACAAQRB2QAAiAEF/RgRAQfzTAEEwNgIAQX8PCyAAQRB0DwsACwvcPyIAQYAICwkBAAAAAgAAAAMAQZQICwUEAAAABQBBpAgLCQYAAAAHAAAACABB3AgLii1JbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AFJlc3BvbnNlIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zAFVzZXIgY2FsbGJhY2sgZXJyb3IAYG9uX3Jlc2V0YCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfaGVhZGVyYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9iZWdpbmAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3N0YXR1c19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3ZlcnNpb25fY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl91cmxfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXRob2RfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfZmllbGRfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fbmFtZWAgY2FsbGJhY2sgZXJyb3IAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzZXJ2ZXIASW52YWxpZCBoZWFkZXIgdmFsdWUgY2hhcgBJbnZhbGlkIGhlYWRlciBmaWVsZCBjaGFyAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdmVyc2lvbgBJbnZhbGlkIG1pbm9yIHZlcnNpb24ASW52YWxpZCBtYWpvciB2ZXJzaW9uAEV4cGVjdGVkIHNwYWNlIGFmdGVyIHZlcnNpb24ARXhwZWN0ZWQgQ1JMRiBhZnRlciB2ZXJzaW9uAEludmFsaWQgSFRUUCB2ZXJzaW9uAEludmFsaWQgaGVhZGVyIHRva2VuAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdXJsAEludmFsaWQgY2hhcmFjdGVycyBpbiB1cmwAVW5leHBlY3RlZCBzdGFydCBjaGFyIGluIHVybABEb3VibGUgQCBpbiB1cmwARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgARHVwbGljYXRlIENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhciBpbiB1cmwgcGF0aABDb250ZW50LUxlbmd0aCBjYW4ndCBiZSBwcmVzZW50IHdpdGggVHJhbnNmZXItRW5jb2RpbmcASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgc2l6ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl92YWx1ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlZCB2YWx1ZQBQYXVzZWQgYnkgb25faGVhZGVyc19jb21wbGV0ZQBJbnZhbGlkIEVPRiBzdGF0ZQBvbl9yZXNldCBwYXVzZQBvbl9jaHVua19oZWFkZXIgcGF1c2UAb25fbWVzc2FnZV9iZWdpbiBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fdmFsdWUgcGF1c2UAb25fc3RhdHVzX2NvbXBsZXRlIHBhdXNlAG9uX3ZlcnNpb25fY29tcGxldGUgcGF1c2UAb25fdXJsX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXNzYWdlX2NvbXBsZXRlIHBhdXNlAG9uX21ldGhvZF9jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfZmllbGRfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUgcGF1c2UAVW5leHBlY3RlZCBzcGFjZSBhZnRlciBzdGFydCBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAFBhdXNlIG9uIENPTk5FQ1QvVXBncmFkZQBQYXVzZSBvbiBQUkkvVXBncmFkZQBFeHBlY3RlZCBIVFRQLzIgQ29ubmVjdGlvbiBQcmVmYWNlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fbWV0aG9kAEV4cGVjdGVkIHNwYWNlIGFmdGVyIG1ldGhvZABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl9maWVsZABQYXVzZWQASW52YWxpZCB3b3JkIGVuY291bnRlcmVkAEludmFsaWQgbWV0aG9kIGVuY291bnRlcmVkAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2NoZW1hAFJlcXVlc3QgaGFzIGludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYABTV0lUQ0hfUFJPWFkAVVNFX1BST1hZAE1LQUNUSVZJVFkAVU5QUk9DRVNTQUJMRV9FTlRJVFkAQ09QWQBNT1ZFRF9QRVJNQU5FTlRMWQBUT09fRUFSTFkATk9USUZZAEZBSUxFRF9ERVBFTkRFTkNZAEJBRF9HQVRFV0FZAFBMQVkAUFVUAENIRUNLT1VUAEdBVEVXQVlfVElNRU9VVABSRVFVRVNUX1RJTUVPVVQATkVUV09SS19DT05ORUNUX1RJTUVPVVQAQ09OTkVDVElPTl9USU1FT1VUAExPR0lOX1RJTUVPVVQATkVUV09SS19SRUFEX1RJTUVPVVQAUE9TVABNSVNESVJFQ1RFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX0xPQURfQkFMQU5DRURfUkVRVUVTVABCQURfUkVRVUVTVABIVFRQX1JFUVVFU1RfU0VOVF9UT19IVFRQU19QT1JUAFJFUE9SVABJTV9BX1RFQVBPVABSRVNFVF9DT05URU5UAE5PX0NPTlRFTlQAUEFSVElBTF9DT05URU5UAEhQRV9JTlZBTElEX0NPTlNUQU5UAEhQRV9DQl9SRVNFVABHRVQASFBFX1NUUklDVABDT05GTElDVABURU1QT1JBUllfUkVESVJFQ1QAUEVSTUFORU5UX1JFRElSRUNUAENPTk5FQ1QATVVMVElfU1RBVFVTAEhQRV9JTlZBTElEX1NUQVRVUwBUT09fTUFOWV9SRVFVRVNUUwBFQVJMWV9ISU5UUwBVTkFWQUlMQUJMRV9GT1JfTEVHQUxfUkVBU09OUwBPUFRJT05TAFNXSVRDSElOR19QUk9UT0NPTFMAVkFSSUFOVF9BTFNPX05FR09USUFURVMATVVMVElQTEVfQ0hPSUNFUwBJTlRFUk5BTF9TRVJWRVJfRVJST1IAV0VCX1NFUlZFUl9VTktOT1dOX0VSUk9SAFJBSUxHVU5fRVJST1IASURFTlRJVFlfUFJPVklERVJfQVVUSEVOVElDQVRJT05fRVJST1IAU1NMX0NFUlRJRklDQVRFX0VSUk9SAElOVkFMSURfWF9GT1JXQVJERURfRk9SAFNFVF9QQVJBTUVURVIAR0VUX1BBUkFNRVRFUgBIUEVfVVNFUgBTRUVfT1RIRVIASFBFX0NCX0NIVU5LX0hFQURFUgBNS0NBTEVOREFSAFNFVFVQAFdFQl9TRVJWRVJfSVNfRE9XTgBURUFSRE9XTgBIUEVfQ0xPU0VEX0NPTk5FQ1RJT04ASEVVUklTVElDX0VYUElSQVRJT04ARElTQ09OTkVDVEVEX09QRVJBVElPTgBOT05fQVVUSE9SSVRBVElWRV9JTkZPUk1BVElPTgBIUEVfSU5WQUxJRF9WRVJTSU9OAEhQRV9DQl9NRVNTQUdFX0JFR0lOAFNJVEVfSVNfRlJPWkVOAEhQRV9JTlZBTElEX0hFQURFUl9UT0tFTgBJTlZBTElEX1RPS0VOAEZPUkJJRERFTgBFTkhBTkNFX1lPVVJfQ0FMTQBIUEVfSU5WQUxJRF9VUkwAQkxPQ0tFRF9CWV9QQVJFTlRBTF9DT05UUk9MAE1LQ09MAEFDTABIUEVfSU5URVJOQUwAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRV9VTk9GRklDSUFMAEhQRV9PSwBVTkxJTksAVU5MT0NLAFBSSQBSRVRSWV9XSVRIAEhQRV9JTlZBTElEX0NPTlRFTlRfTEVOR1RIAEhQRV9VTkVYUEVDVEVEX0NPTlRFTlRfTEVOR1RIAEZMVVNIAFBST1BQQVRDSABNLVNFQVJDSABVUklfVE9PX0xPTkcAUFJPQ0VTU0lORwBNSVNDRUxMQU5FT1VTX1BFUlNJU1RFTlRfV0FSTklORwBNSVNDRUxMQU5FT1VTX1dBUk5JTkcASFBFX0lOVkFMSURfVFJBTlNGRVJfRU5DT0RJTkcARXhwZWN0ZWQgQ1JMRgBIUEVfSU5WQUxJRF9DSFVOS19TSVpFAE1PVkUAQ09OVElOVUUASFBFX0NCX1NUQVRVU19DT01QTEVURQBIUEVfQ0JfSEVBREVSU19DT01QTEVURQBIUEVfQ0JfVkVSU0lPTl9DT01QTEVURQBIUEVfQ0JfVVJMX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8AAF4TAAAmEwAAMBAAAPAXAACdEwAAFRIAADkXAADwEgAAChAAAHUSAACtEgAAghMAAE8UAAB/EAAAoBUAACMUAACJEgAAixQAAE0VAADUEQAAzxQAABAYAADJFgAA3BYAAMERAADgFwAAuxQAAHQUAAB8FQAA5RQAAAgXAAAfEAAAZRUAAKMUAAAoFQAAAhUAAJkVAAAsEAAAixkAAE8PAADUDgAAahAAAM4QAAACFwAAiQ4AAG4TAAAcEwAAZhQAAFYXAADBEwAAzRMAAGwTAABoFwAAZhcAAF8XAAAiEwAAzg8AAGkOAADYDgAAYxYAAMsTAACqDgAAKBcAACYXAADFEwAAXRYAAOgRAABnEwAAZRMAAPIWAABzEwAAHRcAAPkWAADzEQAAzw4AAM4VAAAMEgAAsxEAAKURAABhEAAAMhcAALsTAEH5NQsBAQBBkDYL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB/TcLAQEAQZE4C14CAwICAgICAAACAgACAgACAgICAgICAgICAAQAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEH9OQsBAQBBkToLXgIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAQfA7Cw1sb3NlZWVwLWFsaXZlAEGJPAsBAQBBoDwL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBiT4LAQEAQaA+C+cBAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAEGwwAALXwEBAAEBAQEBAAABAQABAQABAQEBAQEBAQEBAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAEGQwgALIWVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgBBwMIACy1yYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AQfnCAAsFAQIAAQMAQZDDAAvgAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH5xAALBQECAAEDAEGQxQAL4AEEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cYACwQBAAABAEGRxwAL3wEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH6yAALBAEAAAIAQZDJAAtfAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAQfrKAAsEAQAAAQBBkMsACwEBAEGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv', 'base64') diff --git a/node/node_modules/npm/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js b/node/node_modules/npm/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js new file mode 100644 index 0000000000000000000000000000000000000000..333f80e9d6a5b4fb824759df8dafa0d02bdce1ae --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js @@ -0,0 +1,5 @@ +'use strict' + +const { Buffer } = require('node:buffer') + +module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK77MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtzACAAQRBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAA/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQTBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQSBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQd0BNgIcCwYAIAAQMguaLQELfyMAQRBrIgokAEGk0AAoAgAiCUUEQEHk0wAoAgAiBUUEQEHw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBCGpBcHFB2KrVqgVzIgU2AgBB+NMAQQA2AgBByNMAQQA2AgALQczTAEGA1AQ2AgBBnNAAQYDUBDYCAEGw0AAgBTYCAEGs0ABBfzYCAEHQ0wBBgKwDNgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBjNQEQcGrAzYCAEGo0ABB9NMAKAIANgIAQZjQAEHAqwM2AgBBpNAAQYjUBDYCAEHM/wdBODYCAEGI1AQhCQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQewBTQRAQYzQACgCACIGQRAgAEETakFwcSAAQQtJGyIEQQN2IgB2IgFBA3EEQAJAIAFBAXEgAHJBAXMiAkEDdCIAQbTQAGoiASAAQbzQAGooAgAiACgCCCIDRgRAQYzQACAGQX4gAndxNgIADAELIAEgAzYCCCADIAE2AgwLIABBCGohASAAIAJBA3QiAkEDcjYCBCAAIAJqIgAgACgCBEEBcjYCBAwRC0GU0AAoAgAiCCAETw0BIAEEQAJAQQIgAHQiAkEAIAJrciABIAB0cWgiAEEDdCICQbTQAGoiASACQbzQAGooAgAiAigCCCIDRgRAQYzQACAGQX4gAHdxIgY2AgAMAQsgASADNgIIIAMgATYCDAsgAiAEQQNyNgIEIABBA3QiACAEayEFIAAgAmogBTYCACACIARqIgQgBUEBcjYCBCAIBEAgCEF4cUG00ABqIQBBoNAAKAIAIQMCf0EBIAhBA3Z0IgEgBnFFBEBBjNAAIAEgBnI2AgAgAAwBCyAAKAIICyIBIAM2AgwgACADNgIIIAMgADYCDCADIAE2AggLIAJBCGohAUGg0AAgBDYCAEGU0AAgBTYCAAwRC0GQ0AAoAgAiC0UNASALaEECdEG80gBqKAIAIgAoAgRBeHEgBGshBSAAIQIDQAJAIAIoAhAiAUUEQCACQRRqKAIAIgFFDQELIAEoAgRBeHEgBGsiAyAFSSECIAMgBSACGyEFIAEgACACGyEAIAEhAgwBCwsgACgCGCEJIAAoAgwiAyAARwRAQZzQACgCABogAyAAKAIIIgE2AgggASADNgIMDBALIABBFGoiAigCACIBRQRAIAAoAhAiAUUNAyAAQRBqIQILA0AgAiEHIAEiA0EUaiICKAIAIgENACADQRBqIQIgAygCECIBDQALIAdBADYCAAwPC0F/IQQgAEG/f0sNACAAQRNqIgFBcHEhBEGQ0AAoAgAiCEUNAEEAIARrIQUCQAJAAkACf0EAIARBgAJJDQAaQR8gBEH///8HSw0AGiAEQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qCyIGQQJ0QbzSAGooAgAiAkUEQEEAIQFBACEDDAELQQAhASAEQRkgBkEBdmtBACAGQR9HG3QhAEEAIQMDQAJAIAIoAgRBeHEgBGsiByAFTw0AIAIhAyAHIgUNAEEAIQUgAiEBDAMLIAEgAkEUaigCACIHIAcgAiAAQR12QQRxakEQaigCACICRhsgASAHGyEBIABBAXQhACACDQALCyABIANyRQRAQQAhA0ECIAZ0IgBBACAAa3IgCHEiAEUNAyAAaEECdEG80gBqKAIAIQELIAFFDQELA0AgASgCBEF4cSAEayICIAVJIQAgAiAFIAAbIQUgASADIAAbIQMgASgCECIABH8gAAUgAUEUaigCAAsiAQ0ACwsgA0UNACAFQZTQACgCACAEa08NACADKAIYIQcgAyADKAIMIgBHBEBBnNAAKAIAGiAAIAMoAggiATYCCCABIAA2AgwMDgsgA0EUaiICKAIAIgFFBEAgAygCECIBRQ0DIANBEGohAgsDQCACIQYgASIAQRRqIgIoAgAiAQ0AIABBEGohAiAAKAIQIgENAAsgBkEANgIADA0LQZTQACgCACIDIARPBEBBoNAAKAIAIQECQCADIARrIgJBEE8EQCABIARqIgAgAkEBcjYCBCABIANqIAI2AgAgASAEQQNyNgIEDAELIAEgA0EDcjYCBCABIANqIgAgACgCBEEBcjYCBEEAIQBBACECC0GU0AAgAjYCAEGg0AAgADYCACABQQhqIQEMDwtBmNAAKAIAIgMgBEsEQCAEIAlqIgAgAyAEayIBQQFyNgIEQaTQACAANgIAQZjQACABNgIAIAkgBEEDcjYCBCAJQQhqIQEMDwtBACEBIAQCf0Hk0wAoAgAEQEHs0wAoAgAMAQtB8NMAQn83AgBB6NMAQoCAhICAgMAANwIAQeTTACAKQQxqQXBxQdiq1aoFczYCAEH40wBBADYCAEHI0wBBADYCAEGAgAQLIgAgBEHHAGoiBWoiBkEAIABrIgdxIgJPBEBB/NMAQTA2AgAMDwsCQEHE0wAoAgAiAUUNAEG80wAoAgAiCCACaiEAIAAgAU0gACAIS3ENAEEAIQFB/NMAQTA2AgAMDwtByNMALQAAQQRxDQQCQAJAIAkEQEHM0wAhAQNAIAEoAgAiACAJTQRAIAAgASgCBGogCUsNAwsgASgCCCIBDQALC0EAEDMiAEF/Rg0FIAIhBkHo0wAoAgAiAUEBayIDIABxBEAgAiAAayAAIANqQQAgAWtxaiEGCyAEIAZPDQUgBkH+////B0sNBUHE0wAoAgAiAwRAQbzTACgCACIHIAZqIQEgASAHTQ0GIAEgA0sNBgsgBhAzIgEgAEcNAQwHCyAGIANrIAdxIgZB/v///wdLDQQgBhAzIQAgACABKAIAIAEoAgRqRg0DIAAhAQsCQCAGIARByABqTw0AIAFBf0YNAEHs0wAoAgAiACAFIAZrakEAIABrcSIAQf7///8HSwRAIAEhAAwHCyAAEDNBf0cEQCAAIAZqIQYgASEADAcLQQAgBmsQMxoMBAsgASIAQX9HDQUMAwtBACEDDAwLQQAhAAwKCyAAQX9HDQILQcjTAEHI0wAoAgBBBHI2AgALIAJB/v///wdLDQEgAhAzIQBBABAzIQEgAEF/Rg0BIAFBf0YNASAAIAFPDQEgASAAayIGIARBOGpNDQELQbzTAEG80wAoAgAgBmoiATYCAEHA0wAoAgAgAUkEQEHA0wAgATYCAAsCQAJAAkBBpNAAKAIAIgIEQEHM0wAhAQNAIAAgASgCACIDIAEoAgQiBWpGDQIgASgCCCIBDQALDAILQZzQACgCACIBQQBHIAAgAU9xRQRAQZzQACAANgIAC0EAIQFB0NMAIAY2AgBBzNMAIAA2AgBBrNAAQX82AgBBsNAAQeTTACgCADYCAEHY0wBBADYCAANAIAFByNAAaiABQbzQAGoiAjYCACACIAFBtNAAaiIDNgIAIAFBwNAAaiADNgIAIAFB0NAAaiABQcTQAGoiAzYCACADIAI2AgAgAUHY0ABqIAFBzNAAaiICNgIAIAIgAzYCACABQdTQAGogAjYCACABQSBqIgFBgAJHDQALQXggAGtBD3EiASAAaiICIAZBOGsiAyABayIBQQFyNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAI2AgAgACADakE4NgIEDAILIAAgAk0NACACIANJDQAgASgCDEEIcQ0AQXggAmtBD3EiACACaiIDQZjQACgCACAGaiIHIABrIgBBAXI2AgQgASAFIAZqNgIEQajQAEH00wAoAgA2AgBBmNAAIAA2AgBBpNAAIAM2AgAgAiAHakE4NgIEDAELIABBnNAAKAIASQRAQZzQACAANgIACyAAIAZqIQNBzNMAIQECQAJAAkADQCADIAEoAgBHBEAgASgCCCIBDQEMAgsLIAEtAAxBCHFFDQELQczTACEBA0AgASgCACIDIAJNBEAgAyABKAIEaiIFIAJLDQMLIAEoAgghAQwACwALIAEgADYCACABIAEoAgQgBmo2AgQgAEF4IABrQQ9xaiIJIARBA3I2AgQgA0F4IANrQQ9xaiIGIAQgCWoiBGshASACIAZGBEBBpNAAIAQ2AgBBmNAAQZjQACgCACABaiIANgIAIAQgAEEBcjYCBAwIC0Gg0AAoAgAgBkYEQEGg0AAgBDYCAEGU0ABBlNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEIAAgBGogADYCAAwICyAGKAIEIgVBA3FBAUcNBiAFQXhxIQggBUH/AU0EQCAFQQN2IQMgBigCCCIAIAYoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAcLIAIgADYCCCAAIAI2AgwMBgsgBigCGCEHIAYgBigCDCIARwRAIAAgBigCCCICNgIIIAIgADYCDAwFCyAGQRRqIgIoAgAiBUUEQCAGKAIQIgVFDQQgBkEQaiECCwNAIAIhAyAFIgBBFGoiAigCACIFDQAgAEEQaiECIAAoAhAiBQ0ACyADQQA2AgAMBAtBeCAAa0EPcSIBIABqIgcgBkE4ayIDIAFrIgFBAXI2AgQgACADakE4NgIEIAIgBUE3IAVrQQ9xakE/ayIDIAMgAkEQakkbIgNBIzYCBEGo0ABB9NMAKAIANgIAQZjQACABNgIAQaTQACAHNgIAIANBEGpB1NMAKQIANwIAIANBzNMAKQIANwIIQdTTACADQQhqNgIAQdDTACAGNgIAQczTACAANgIAQdjTAEEANgIAIANBJGohAQNAIAFBBzYCACAFIAFBBGoiAUsNAAsgAiADRg0AIAMgAygCBEF+cTYCBCADIAMgAmsiBTYCACACIAVBAXI2AgQgBUH/AU0EQCAFQXhxQbTQAGohAAJ/QYzQACgCACIBQQEgBUEDdnQiA3FFBEBBjNAAIAEgA3I2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEG80gBqIQBBkNAAKAIAIgNBASABdCIGcUUEQCAAIAI2AgBBkNAAIAMgBnI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEDAkADQCADIgAoAgRBeHEgBUYNASABQR12IQMgAUEBdCEBIAAgA0EEcWpBEGoiBigCACIDDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLQZjQACgCACIBIARNDQBBpNAAKAIAIgAgBGoiAiABIARrIgFBAXI2AgRBmNAAIAE2AgBBpNAAIAI2AgAgACAEQQNyNgIEIABBCGohAQwIC0EAIQFB/NMAQTA2AgAMBwtBACEACyAHRQ0AAkAgBigCHCICQQJ0QbzSAGoiAygCACAGRgRAIAMgADYCACAADQFBkNAAQZDQACgCAEF+IAJ3cTYCAAwCCyAHQRBBFCAHKAIQIAZGG2ogADYCACAARQ0BCyAAIAc2AhggBigCECICBEAgACACNgIQIAIgADYCGAsgBkEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgCGohASAGIAhqIgYoAgQhBQsgBiAFQX5xNgIEIAEgBGogATYCACAEIAFBAXI2AgQgAUH/AU0EQCABQXhxQbTQAGohAAJ/QYzQACgCACICQQEgAUEDdnQiAXFFBEBBjNAAIAEgAnI2AgAgAAwBCyAAKAIICyIBIAQ2AgwgACAENgIIIAQgADYCDCAEIAE2AggMAQtBHyEFIAFB////B00EQCABQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qIQULIAQgBTYCHCAEQgA3AhAgBUECdEG80gBqIQBBkNAAKAIAIgJBASAFdCIDcUUEQCAAIAQ2AgBBkNAAIAIgA3I2AgAgBCAANgIYIAQgBDYCCCAEIAQ2AgwMAQsgAUEZIAVBAXZrQQAgBUEfRxt0IQUgACgCACEAAkADQCAAIgIoAgRBeHEgAUYNASAFQR12IQAgBUEBdCEFIAIgAEEEcWpBEGoiAygCACIADQALIAMgBDYCACAEIAI2AhggBCAENgIMIAQgBDYCCAwBCyACKAIIIgAgBDYCDCACIAQ2AgggBEEANgIYIAQgAjYCDCAEIAA2AggLIAlBCGohAQwCCwJAIAdFDQACQCADKAIcIgFBAnRBvNIAaiICKAIAIANGBEAgAiAANgIAIAANAUGQ0AAgCEF+IAF3cSIINgIADAILIAdBEEEUIAcoAhAgA0YbaiAANgIAIABFDQELIAAgBzYCGCADKAIQIgEEQCAAIAE2AhAgASAANgIYCyADQRRqKAIAIgFFDQAgAEEUaiABNgIAIAEgADYCGAsCQCAFQQ9NBEAgAyAEIAVqIgBBA3I2AgQgACADaiIAIAAoAgRBAXI2AgQMAQsgAyAEaiICIAVBAXI2AgQgAyAEQQNyNgIEIAIgBWogBTYCACAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIFcUUEQEGM0AAgASAFcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEEBIAF0IgQgCHFFBEAgACACNgIAQZDQACAEIAhyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhBAJAA0AgBCIAKAIEQXhxIAVGDQEgAUEddiEEIAFBAXQhASAAIARBBHFqQRBqIgYoAgAiBA0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIICyADQQhqIQEMAQsCQCAJRQ0AAkAgACgCHCIBQQJ0QbzSAGoiAigCACAARgRAIAIgAzYCACADDQFBkNAAIAtBfiABd3E2AgAMAgsgCUEQQRQgCSgCECAARhtqIAM2AgAgA0UNAQsgAyAJNgIYIAAoAhAiAQRAIAMgATYCECABIAM2AhgLIABBFGooAgAiAUUNACADQRRqIAE2AgAgASADNgIYCwJAIAVBD00EQCAAIAQgBWoiAUEDcjYCBCAAIAFqIgEgASgCBEEBcjYCBAwBCyAAIARqIgcgBUEBcjYCBCAAIARBA3I2AgQgBSAHaiAFNgIAIAgEQCAIQXhxQbTQAGohAUGg0AAoAgAhAwJ/QQEgCEEDdnQiAiAGcUUEQEGM0AAgAiAGcjYCACABDAELIAEoAggLIgIgAzYCDCABIAM2AgggAyABNgIMIAMgAjYCCAtBoNAAIAc2AgBBlNAAIAU2AgALIABBCGohAQsgCkEQaiQAIAELQwAgAEUEQD8AQRB0DwsCQCAAQf//A3ENACAAQQBIDQAgAEEQdkAAIgBBf0YEQEH80wBBMDYCAEF/DwsgAEEQdA8LAAsL3D8iAEGACAsJAQAAAAIAAAADAEGUCAsFBAAAAAUAQaQICwkGAAAABwAAAAgAQdwIC4otSW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwBB+TULAQEAQZA2C+ABAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQf03CwEBAEGROAteAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgBB/TkLAQEAQZE6C14CAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEHwOwsNbG9zZWVlcC1hbGl2ZQBBiTwLAQEAQaA8C+ABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQYk+CwEBAEGgPgvnAQEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZABBsMAAC18BAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBBkMIACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQcDCAAstcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQoNClNNDQoNClRUUC9DRS9UU1AvAEH5wgALBQECAAEDAEGQwwAL4AEEAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cQACwUBAgABAwBBkMUAC+ABBAEBBQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQfnGAAsEAQAAAQBBkccAC98BAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+sgACwQBAAACAEGQyQALXwMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAEH6ygALBAEAAAEAQZDLAAsBAQBBqssAC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==', 'base64') diff --git a/node/node_modules/npm/node_modules/undici/lib/llhttp/utils.js b/node/node_modules/npm/node_modules/undici/lib/llhttp/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..86f4165267167a1497f75bbefc46dfa22f6a1283 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/llhttp/utils.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.enumToMap = void 0; +function enumToMap(obj) { + const res = {}; + Object.keys(obj).forEach((key) => { + const value = obj[key]; + if (typeof value === 'number') { + res[key] = value; + } + }); + return res; +} +exports.enumToMap = enumToMap; +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/undici/lib/mock/mock-agent.js b/node/node_modules/npm/node_modules/undici/lib/mock/mock-agent.js new file mode 100644 index 0000000000000000000000000000000000000000..92277a4c0296419e62fc3283d004080fcdd4c08b --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/mock/mock-agent.js @@ -0,0 +1,160 @@ +'use strict' + +const { kClients } = require('../core/symbols') +const Agent = require('../dispatcher/agent') +const { + kAgent, + kMockAgentSet, + kMockAgentGet, + kDispatches, + kIsMockActive, + kNetConnect, + kGetNetConnect, + kOptions, + kFactory +} = require('./mock-symbols') +const MockClient = require('./mock-client') +const MockPool = require('./mock-pool') +const { matchValue, buildMockOptions } = require('./mock-utils') +const { InvalidArgumentError, UndiciError } = require('../core/errors') +const Dispatcher = require('../dispatcher/dispatcher') +const Pluralizer = require('./pluralizer') +const PendingInterceptorsFormatter = require('./pending-interceptors-formatter') + +class MockAgent extends Dispatcher { + constructor (opts) { + super(opts) + + this[kNetConnect] = true + this[kIsMockActive] = true + + // Instantiate Agent and encapsulate + if ((opts?.agent && typeof opts.agent.dispatch !== 'function')) { + throw new InvalidArgumentError('Argument opts.agent must implement Agent') + } + const agent = opts?.agent ? opts.agent : new Agent(opts) + this[kAgent] = agent + + this[kClients] = agent[kClients] + this[kOptions] = buildMockOptions(opts) + } + + get (origin) { + let dispatcher = this[kMockAgentGet](origin) + + if (!dispatcher) { + dispatcher = this[kFactory](origin) + this[kMockAgentSet](origin, dispatcher) + } + return dispatcher + } + + dispatch (opts, handler) { + // Call MockAgent.get to perform additional setup before dispatching as normal + this.get(opts.origin) + return this[kAgent].dispatch(opts, handler) + } + + async close () { + await this[kAgent].close() + this[kClients].clear() + } + + deactivate () { + this[kIsMockActive] = false + } + + activate () { + this[kIsMockActive] = true + } + + enableNetConnect (matcher) { + if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) { + if (Array.isArray(this[kNetConnect])) { + this[kNetConnect].push(matcher) + } else { + this[kNetConnect] = [matcher] + } + } else if (typeof matcher === 'undefined') { + this[kNetConnect] = true + } else { + throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.') + } + } + + disableNetConnect () { + this[kNetConnect] = false + } + + // This is required to bypass issues caused by using global symbols - see: + // https://github.com/nodejs/undici/issues/1447 + get isMockActive () { + return this[kIsMockActive] + } + + [kMockAgentSet] (origin, dispatcher) { + this[kClients].set(origin, dispatcher) + } + + [kFactory] (origin) { + const mockOptions = Object.assign({ agent: this }, this[kOptions]) + return this[kOptions] && this[kOptions].connections === 1 + ? new MockClient(origin, mockOptions) + : new MockPool(origin, mockOptions) + } + + [kMockAgentGet] (origin) { + // First check if we can immediately find it + const client = this[kClients].get(origin) + if (client) { + return client + } + + // If the origin is not a string create a dummy parent pool and return to user + if (typeof origin !== 'string') { + const dispatcher = this[kFactory]('http://localhost:9999') + this[kMockAgentSet](origin, dispatcher) + return dispatcher + } + + // If we match, create a pool and assign the same dispatches + for (const [keyMatcher, nonExplicitDispatcher] of Array.from(this[kClients])) { + if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) { + const dispatcher = this[kFactory](origin) + this[kMockAgentSet](origin, dispatcher) + dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches] + return dispatcher + } + } + } + + [kGetNetConnect] () { + return this[kNetConnect] + } + + pendingInterceptors () { + const mockAgentClients = this[kClients] + + return Array.from(mockAgentClients.entries()) + .flatMap(([origin, scope]) => scope[kDispatches].map(dispatch => ({ ...dispatch, origin }))) + .filter(({ pending }) => pending) + } + + assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) { + const pending = this.pendingInterceptors() + + if (pending.length === 0) { + return + } + + const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length) + + throw new UndiciError(` +${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending: + +${pendingInterceptorsFormatter.format(pending)} +`.trim()) + } +} + +module.exports = MockAgent diff --git a/node/node_modules/npm/node_modules/undici/lib/mock/mock-client.js b/node/node_modules/npm/node_modules/undici/lib/mock/mock-client.js new file mode 100644 index 0000000000000000000000000000000000000000..eace35762d7084dbef6b3f6f1819f8d3a45eab4b --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/mock/mock-client.js @@ -0,0 +1,59 @@ +'use strict' + +const { promisify } = require('node:util') +const Client = require('../dispatcher/client') +const { buildMockDispatch } = require('./mock-utils') +const { + kDispatches, + kMockAgent, + kClose, + kOriginalClose, + kOrigin, + kOriginalDispatch, + kConnected +} = require('./mock-symbols') +const { MockInterceptor } = require('./mock-interceptor') +const Symbols = require('../core/symbols') +const { InvalidArgumentError } = require('../core/errors') + +/** + * MockClient provides an API that extends the Client to influence the mockDispatches. + */ +class MockClient extends Client { + constructor (origin, opts) { + super(origin, opts) + + if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') { + throw new InvalidArgumentError('Argument opts.agent must implement Agent') + } + + this[kMockAgent] = opts.agent + this[kOrigin] = origin + this[kDispatches] = [] + this[kConnected] = 1 + this[kOriginalDispatch] = this.dispatch + this[kOriginalClose] = this.close.bind(this) + + this.dispatch = buildMockDispatch.call(this) + this.close = this[kClose] + } + + get [Symbols.kConnected] () { + return this[kConnected] + } + + /** + * Sets up the base interceptor for mocking replies from undici. + */ + intercept (opts) { + return new MockInterceptor(opts, this[kDispatches]) + } + + async [kClose] () { + await promisify(this[kOriginalClose])() + this[kConnected] = 0 + this[kMockAgent][Symbols.kClients].delete(this[kOrigin]) + } +} + +module.exports = MockClient diff --git a/node/node_modules/npm/node_modules/undici/lib/mock/mock-errors.js b/node/node_modules/npm/node_modules/undici/lib/mock/mock-errors.js new file mode 100644 index 0000000000000000000000000000000000000000..93291c6af3d6707b90d501a10183757a94a29f68 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/mock/mock-errors.js @@ -0,0 +1,28 @@ +'use strict' + +const { UndiciError } = require('../core/errors') + +const kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED') + +/** + * The request does not match any registered mock dispatches. + */ +class MockNotMatchedError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, MockNotMatchedError) + this.name = 'MockNotMatchedError' + this.message = message || 'The request does not match any registered mock dispatches' + this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kMockNotMatchedError] === true + } + + [kMockNotMatchedError] = true +} + +module.exports = { + MockNotMatchedError +} diff --git a/node/node_modules/npm/node_modules/undici/lib/mock/mock-interceptor.js b/node/node_modules/npm/node_modules/undici/lib/mock/mock-interceptor.js new file mode 100644 index 0000000000000000000000000000000000000000..7e2a495c743322db0501113a75ede6c6631ff101 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/mock/mock-interceptor.js @@ -0,0 +1,207 @@ +'use strict' + +const { getResponseData, buildKey, addMockDispatch } = require('./mock-utils') +const { + kDispatches, + kDispatchKey, + kDefaultHeaders, + kDefaultTrailers, + kContentLength, + kMockDispatch +} = require('./mock-symbols') +const { InvalidArgumentError } = require('../core/errors') +const { buildURL } = require('../core/util') + +/** + * Defines the scope API for an interceptor reply + */ +class MockScope { + constructor (mockDispatch) { + this[kMockDispatch] = mockDispatch + } + + /** + * Delay a reply by a set amount in ms. + */ + delay (waitInMs) { + if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) { + throw new InvalidArgumentError('waitInMs must be a valid integer > 0') + } + + this[kMockDispatch].delay = waitInMs + return this + } + + /** + * For a defined reply, never mark as consumed. + */ + persist () { + this[kMockDispatch].persist = true + return this + } + + /** + * Allow one to define a reply for a set amount of matching requests. + */ + times (repeatTimes) { + if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) { + throw new InvalidArgumentError('repeatTimes must be a valid integer > 0') + } + + this[kMockDispatch].times = repeatTimes + return this + } +} + +/** + * Defines an interceptor for a Mock + */ +class MockInterceptor { + constructor (opts, mockDispatches) { + if (typeof opts !== 'object') { + throw new InvalidArgumentError('opts must be an object') + } + if (typeof opts.path === 'undefined') { + throw new InvalidArgumentError('opts.path must be defined') + } + if (typeof opts.method === 'undefined') { + opts.method = 'GET' + } + // See https://github.com/nodejs/undici/issues/1245 + // As per RFC 3986, clients are not supposed to send URI + // fragments to servers when they retrieve a document, + if (typeof opts.path === 'string') { + if (opts.query) { + opts.path = buildURL(opts.path, opts.query) + } else { + // Matches https://github.com/nodejs/undici/blob/main/lib/web/fetch/index.js#L1811 + const parsedURL = new URL(opts.path, 'data://') + opts.path = parsedURL.pathname + parsedURL.search + } + } + if (typeof opts.method === 'string') { + opts.method = opts.method.toUpperCase() + } + + this[kDispatchKey] = buildKey(opts) + this[kDispatches] = mockDispatches + this[kDefaultHeaders] = {} + this[kDefaultTrailers] = {} + this[kContentLength] = false + } + + createMockScopeDispatchData ({ statusCode, data, responseOptions }) { + const responseData = getResponseData(data) + const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {} + const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers } + const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers } + + return { statusCode, data, headers, trailers } + } + + validateReplyParameters (replyParameters) { + if (typeof replyParameters.statusCode === 'undefined') { + throw new InvalidArgumentError('statusCode must be defined') + } + if (typeof replyParameters.responseOptions !== 'object' || replyParameters.responseOptions === null) { + throw new InvalidArgumentError('responseOptions must be an object') + } + } + + /** + * Mock an undici request with a defined reply. + */ + reply (replyOptionsCallbackOrStatusCode) { + // Values of reply aren't available right now as they + // can only be available when the reply callback is invoked. + if (typeof replyOptionsCallbackOrStatusCode === 'function') { + // We'll first wrap the provided callback in another function, + // this function will properly resolve the data from the callback + // when invoked. + const wrappedDefaultsCallback = (opts) => { + // Our reply options callback contains the parameter for statusCode, data and options. + const resolvedData = replyOptionsCallbackOrStatusCode(opts) + + // Check if it is in the right format + if (typeof resolvedData !== 'object' || resolvedData === null) { + throw new InvalidArgumentError('reply options callback must return an object') + } + + const replyParameters = { data: '', responseOptions: {}, ...resolvedData } + this.validateReplyParameters(replyParameters) + // Since the values can be obtained immediately we return them + // from this higher order function that will be resolved later. + return { + ...this.createMockScopeDispatchData(replyParameters) + } + } + + // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data. + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback) + return new MockScope(newMockDispatch) + } + + // We can have either one or three parameters, if we get here, + // we should have 1-3 parameters. So we spread the arguments of + // this function to obtain the parameters, since replyData will always + // just be the statusCode. + const replyParameters = { + statusCode: replyOptionsCallbackOrStatusCode, + data: arguments[1] === undefined ? '' : arguments[1], + responseOptions: arguments[2] === undefined ? {} : arguments[2] + } + this.validateReplyParameters(replyParameters) + + // Send in-already provided data like usual + const dispatchData = this.createMockScopeDispatchData(replyParameters) + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData) + return new MockScope(newMockDispatch) + } + + /** + * Mock an undici request with a defined error. + */ + replyWithError (error) { + if (typeof error === 'undefined') { + throw new InvalidArgumentError('error must be defined') + } + + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error }) + return new MockScope(newMockDispatch) + } + + /** + * Set default reply headers on the interceptor for subsequent replies + */ + defaultReplyHeaders (headers) { + if (typeof headers === 'undefined') { + throw new InvalidArgumentError('headers must be defined') + } + + this[kDefaultHeaders] = headers + return this + } + + /** + * Set default reply trailers on the interceptor for subsequent replies + */ + defaultReplyTrailers (trailers) { + if (typeof trailers === 'undefined') { + throw new InvalidArgumentError('trailers must be defined') + } + + this[kDefaultTrailers] = trailers + return this + } + + /** + * Set reply content length header for replies on the interceptor + */ + replyContentLength () { + this[kContentLength] = true + return this + } +} + +module.exports.MockInterceptor = MockInterceptor +module.exports.MockScope = MockScope diff --git a/node/node_modules/npm/node_modules/undici/lib/mock/mock-pool.js b/node/node_modules/npm/node_modules/undici/lib/mock/mock-pool.js new file mode 100644 index 0000000000000000000000000000000000000000..71d72fd4e2788fcdc49f04131cd387c5d3c263c5 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/mock/mock-pool.js @@ -0,0 +1,59 @@ +'use strict' + +const { promisify } = require('node:util') +const Pool = require('../dispatcher/pool') +const { buildMockDispatch } = require('./mock-utils') +const { + kDispatches, + kMockAgent, + kClose, + kOriginalClose, + kOrigin, + kOriginalDispatch, + kConnected +} = require('./mock-symbols') +const { MockInterceptor } = require('./mock-interceptor') +const Symbols = require('../core/symbols') +const { InvalidArgumentError } = require('../core/errors') + +/** + * MockPool provides an API that extends the Pool to influence the mockDispatches. + */ +class MockPool extends Pool { + constructor (origin, opts) { + super(origin, opts) + + if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') { + throw new InvalidArgumentError('Argument opts.agent must implement Agent') + } + + this[kMockAgent] = opts.agent + this[kOrigin] = origin + this[kDispatches] = [] + this[kConnected] = 1 + this[kOriginalDispatch] = this.dispatch + this[kOriginalClose] = this.close.bind(this) + + this.dispatch = buildMockDispatch.call(this) + this.close = this[kClose] + } + + get [Symbols.kConnected] () { + return this[kConnected] + } + + /** + * Sets up the base interceptor for mocking replies from undici. + */ + intercept (opts) { + return new MockInterceptor(opts, this[kDispatches]) + } + + async [kClose] () { + await promisify(this[kOriginalClose])() + this[kConnected] = 0 + this[kMockAgent][Symbols.kClients].delete(this[kOrigin]) + } +} + +module.exports = MockPool diff --git a/node/node_modules/npm/node_modules/undici/lib/mock/mock-symbols.js b/node/node_modules/npm/node_modules/undici/lib/mock/mock-symbols.js new file mode 100644 index 0000000000000000000000000000000000000000..1bdfc85844314cbdbec6cb19e1e5a79651b10921 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/mock/mock-symbols.js @@ -0,0 +1,23 @@ +'use strict' + +module.exports = { + kAgent: Symbol('agent'), + kOptions: Symbol('options'), + kFactory: Symbol('factory'), + kDispatches: Symbol('dispatches'), + kDispatchKey: Symbol('dispatch key'), + kDefaultHeaders: Symbol('default headers'), + kDefaultTrailers: Symbol('default trailers'), + kContentLength: Symbol('content length'), + kMockAgent: Symbol('mock agent'), + kMockAgentSet: Symbol('mock agent set'), + kMockAgentGet: Symbol('mock agent get'), + kMockDispatch: Symbol('mock dispatch'), + kClose: Symbol('close'), + kOriginalClose: Symbol('original agent close'), + kOrigin: Symbol('origin'), + kIsMockActive: Symbol('is mock active'), + kNetConnect: Symbol('net connect'), + kGetNetConnect: Symbol('get net connect'), + kConnected: Symbol('connected') +} diff --git a/node/node_modules/npm/node_modules/undici/lib/mock/mock-utils.js b/node/node_modules/npm/node_modules/undici/lib/mock/mock-utils.js new file mode 100644 index 0000000000000000000000000000000000000000..4db67324b2b11872b63a93c03d21bccd6de16d01 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/mock/mock-utils.js @@ -0,0 +1,367 @@ +'use strict' + +const { MockNotMatchedError } = require('./mock-errors') +const { + kDispatches, + kMockAgent, + kOriginalDispatch, + kOrigin, + kGetNetConnect +} = require('./mock-symbols') +const { buildURL } = require('../core/util') +const { STATUS_CODES } = require('node:http') +const { + types: { + isPromise + } +} = require('node:util') + +function matchValue (match, value) { + if (typeof match === 'string') { + return match === value + } + if (match instanceof RegExp) { + return match.test(value) + } + if (typeof match === 'function') { + return match(value) === true + } + return false +} + +function lowerCaseEntries (headers) { + return Object.fromEntries( + Object.entries(headers).map(([headerName, headerValue]) => { + return [headerName.toLocaleLowerCase(), headerValue] + }) + ) +} + +/** + * @param {import('../../index').Headers|string[]|Record} headers + * @param {string} key + */ +function getHeaderByName (headers, key) { + if (Array.isArray(headers)) { + for (let i = 0; i < headers.length; i += 2) { + if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) { + return headers[i + 1] + } + } + + return undefined + } else if (typeof headers.get === 'function') { + return headers.get(key) + } else { + return lowerCaseEntries(headers)[key.toLocaleLowerCase()] + } +} + +/** @param {string[]} headers */ +function buildHeadersFromArray (headers) { // fetch HeadersList + const clone = headers.slice() + const entries = [] + for (let index = 0; index < clone.length; index += 2) { + entries.push([clone[index], clone[index + 1]]) + } + return Object.fromEntries(entries) +} + +function matchHeaders (mockDispatch, headers) { + if (typeof mockDispatch.headers === 'function') { + if (Array.isArray(headers)) { // fetch HeadersList + headers = buildHeadersFromArray(headers) + } + return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {}) + } + if (typeof mockDispatch.headers === 'undefined') { + return true + } + if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') { + return false + } + + for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) { + const headerValue = getHeaderByName(headers, matchHeaderName) + + if (!matchValue(matchHeaderValue, headerValue)) { + return false + } + } + return true +} + +function safeUrl (path) { + if (typeof path !== 'string') { + return path + } + + const pathSegments = path.split('?') + + if (pathSegments.length !== 2) { + return path + } + + const qp = new URLSearchParams(pathSegments.pop()) + qp.sort() + return [...pathSegments, qp.toString()].join('?') +} + +function matchKey (mockDispatch, { path, method, body, headers }) { + const pathMatch = matchValue(mockDispatch.path, path) + const methodMatch = matchValue(mockDispatch.method, method) + const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true + const headersMatch = matchHeaders(mockDispatch, headers) + return pathMatch && methodMatch && bodyMatch && headersMatch +} + +function getResponseData (data) { + if (Buffer.isBuffer(data)) { + return data + } else if (data instanceof Uint8Array) { + return data + } else if (data instanceof ArrayBuffer) { + return data + } else if (typeof data === 'object') { + return JSON.stringify(data) + } else { + return data.toString() + } +} + +function getMockDispatch (mockDispatches, key) { + const basePath = key.query ? buildURL(key.path, key.query) : key.path + const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath + + // Match path + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath)) + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`) + } + + // Match method + matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method)) + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}' on path '${resolvedPath}'`) + } + + // Match body + matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true) + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}' on path '${resolvedPath}'`) + } + + // Match headers + matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers)) + if (matchedMockDispatches.length === 0) { + const headers = typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers + throw new MockNotMatchedError(`Mock dispatch not matched for headers '${headers}' on path '${resolvedPath}'`) + } + + return matchedMockDispatches[0] +} + +function addMockDispatch (mockDispatches, key, data) { + const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false } + const replyData = typeof data === 'function' ? { callback: data } : { ...data } + const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } } + mockDispatches.push(newMockDispatch) + return newMockDispatch +} + +function deleteMockDispatch (mockDispatches, key) { + const index = mockDispatches.findIndex(dispatch => { + if (!dispatch.consumed) { + return false + } + return matchKey(dispatch, key) + }) + if (index !== -1) { + mockDispatches.splice(index, 1) + } +} + +function buildKey (opts) { + const { path, method, body, headers, query } = opts + return { + path, + method, + body, + headers, + query + } +} + +function generateKeyValues (data) { + const keys = Object.keys(data) + const result = [] + for (let i = 0; i < keys.length; ++i) { + const key = keys[i] + const value = data[key] + const name = Buffer.from(`${key}`) + if (Array.isArray(value)) { + for (let j = 0; j < value.length; ++j) { + result.push(name, Buffer.from(`${value[j]}`)) + } + } else { + result.push(name, Buffer.from(`${value}`)) + } + } + return result +} + +/** + * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status + * @param {number} statusCode + */ +function getStatusText (statusCode) { + return STATUS_CODES[statusCode] || 'unknown' +} + +async function getResponse (body) { + const buffers = [] + for await (const data of body) { + buffers.push(data) + } + return Buffer.concat(buffers).toString('utf8') +} + +/** + * Mock dispatch function used to simulate undici dispatches + */ +function mockDispatch (opts, handler) { + // Get mock dispatch from built key + const key = buildKey(opts) + const mockDispatch = getMockDispatch(this[kDispatches], key) + + mockDispatch.timesInvoked++ + + // Here's where we resolve a callback if a callback is present for the dispatch data. + if (mockDispatch.data.callback) { + mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) } + } + + // Parse mockDispatch data + const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch + const { timesInvoked, times } = mockDispatch + + // If it's used up and not persistent, mark as consumed + mockDispatch.consumed = !persist && timesInvoked >= times + mockDispatch.pending = timesInvoked < times + + // If specified, trigger dispatch error + if (error !== null) { + deleteMockDispatch(this[kDispatches], key) + handler.onError(error) + return true + } + + // Handle the request with a delay if necessary + if (typeof delay === 'number' && delay > 0) { + setTimeout(() => { + handleReply(this[kDispatches]) + }, delay) + } else { + handleReply(this[kDispatches]) + } + + function handleReply (mockDispatches, _data = data) { + // fetch's HeadersList is a 1D string array + const optsHeaders = Array.isArray(opts.headers) + ? buildHeadersFromArray(opts.headers) + : opts.headers + const body = typeof _data === 'function' + ? _data({ ...opts, headers: optsHeaders }) + : _data + + // util.types.isPromise is likely needed for jest. + if (isPromise(body)) { + // If handleReply is asynchronous, throwing an error + // in the callback will reject the promise, rather than + // synchronously throw the error, which breaks some tests. + // Rather, we wait for the callback to resolve if it is a + // promise, and then re-run handleReply with the new body. + body.then((newData) => handleReply(mockDispatches, newData)) + return + } + + const responseData = getResponseData(body) + const responseHeaders = generateKeyValues(headers) + const responseTrailers = generateKeyValues(trailers) + + handler.onConnect?.(err => handler.onError(err), null) + handler.onHeaders?.(statusCode, responseHeaders, resume, getStatusText(statusCode)) + handler.onData?.(Buffer.from(responseData)) + handler.onComplete?.(responseTrailers) + deleteMockDispatch(mockDispatches, key) + } + + function resume () {} + + return true +} + +function buildMockDispatch () { + const agent = this[kMockAgent] + const origin = this[kOrigin] + const originalDispatch = this[kOriginalDispatch] + + return function dispatch (opts, handler) { + if (agent.isMockActive) { + try { + mockDispatch.call(this, opts, handler) + } catch (error) { + if (error instanceof MockNotMatchedError) { + const netConnect = agent[kGetNetConnect]() + if (netConnect === false) { + throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`) + } + if (checkNetConnect(netConnect, origin)) { + originalDispatch.call(this, opts, handler) + } else { + throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`) + } + } else { + throw error + } + } + } else { + originalDispatch.call(this, opts, handler) + } + } +} + +function checkNetConnect (netConnect, origin) { + const url = new URL(origin) + if (netConnect === true) { + return true + } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) { + return true + } + return false +} + +function buildMockOptions (opts) { + if (opts) { + const { agent, ...mockOptions } = opts + return mockOptions + } +} + +module.exports = { + getResponseData, + getMockDispatch, + addMockDispatch, + deleteMockDispatch, + buildKey, + generateKeyValues, + matchValue, + getResponse, + getStatusText, + mockDispatch, + buildMockDispatch, + checkNetConnect, + buildMockOptions, + getHeaderByName, + buildHeadersFromArray +} diff --git a/node/node_modules/npm/node_modules/undici/lib/mock/pending-interceptors-formatter.js b/node/node_modules/npm/node_modules/undici/lib/mock/pending-interceptors-formatter.js new file mode 100644 index 0000000000000000000000000000000000000000..bbf9b72c1780953b87016ed8115ed88da62e09e3 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/mock/pending-interceptors-formatter.js @@ -0,0 +1,43 @@ +'use strict' + +const { Transform } = require('node:stream') +const { Console } = require('node:console') + +const PERSISTENT = process.versions.icu ? '✅' : 'Y ' +const NOT_PERSISTENT = process.versions.icu ? '❌' : 'N ' + +/** + * Gets the output of `console.table(…)` as a string. + */ +module.exports = class PendingInterceptorsFormatter { + constructor ({ disableColors } = {}) { + this.transform = new Transform({ + transform (chunk, _enc, cb) { + cb(null, chunk) + } + }) + + this.logger = new Console({ + stdout: this.transform, + inspectOptions: { + colors: !disableColors && !process.env.CI + } + }) + } + + format (pendingInterceptors) { + const withPrettyHeaders = pendingInterceptors.map( + ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + Method: method, + Origin: origin, + Path: path, + 'Status code': statusCode, + Persistent: persist ? PERSISTENT : NOT_PERSISTENT, + Invocations: timesInvoked, + Remaining: persist ? Infinity : times - timesInvoked + })) + + this.logger.table(withPrettyHeaders) + return this.transform.read().toString() + } +} diff --git a/node/node_modules/npm/node_modules/undici/lib/mock/pluralizer.js b/node/node_modules/npm/node_modules/undici/lib/mock/pluralizer.js new file mode 100644 index 0000000000000000000000000000000000000000..8b6602f82580fd41d9e086af5ae9b3a1b5b77e6c --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/mock/pluralizer.js @@ -0,0 +1,29 @@ +'use strict' + +const singulars = { + pronoun: 'it', + is: 'is', + was: 'was', + this: 'this' +} + +const plurals = { + pronoun: 'they', + is: 'are', + was: 'were', + this: 'these' +} + +module.exports = class Pluralizer { + constructor (singular, plural) { + this.singular = singular + this.plural = plural + } + + pluralize (count) { + const one = count === 1 + const keys = one ? singulars : plurals + const noun = one ? this.singular : this.plural + return { ...keys, count, noun } + } +} diff --git a/node/node_modules/npm/node_modules/undici/lib/util/timers.js b/node/node_modules/npm/node_modules/undici/lib/util/timers.js new file mode 100644 index 0000000000000000000000000000000000000000..b387b8213b5d311a5bacaffc5f86b722a4ceaee6 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/util/timers.js @@ -0,0 +1,423 @@ +'use strict' + +/** + * This module offers an optimized timer implementation designed for scenarios + * where high precision is not critical. + * + * The timer achieves faster performance by using a low-resolution approach, + * with an accuracy target of within 500ms. This makes it particularly useful + * for timers with delays of 1 second or more, where exact timing is less + * crucial. + * + * It's important to note that Node.js timers are inherently imprecise, as + * delays can occur due to the event loop being blocked by other operations. + * Consequently, timers may trigger later than their scheduled time. + */ + +/** + * The fastNow variable contains the internal fast timer clock value. + * + * @type {number} + */ +let fastNow = 0 + +/** + * RESOLUTION_MS represents the target resolution time in milliseconds. + * + * @type {number} + * @default 1000 + */ +const RESOLUTION_MS = 1e3 + +/** + * TICK_MS defines the desired interval in milliseconds between each tick. + * The target value is set to half the resolution time, minus 1 ms, to account + * for potential event loop overhead. + * + * @type {number} + * @default 499 + */ +const TICK_MS = (RESOLUTION_MS >> 1) - 1 + +/** + * fastNowTimeout is a Node.js timer used to manage and process + * the FastTimers stored in the `fastTimers` array. + * + * @type {NodeJS.Timeout} + */ +let fastNowTimeout + +/** + * The kFastTimer symbol is used to identify FastTimer instances. + * + * @type {Symbol} + */ +const kFastTimer = Symbol('kFastTimer') + +/** + * The fastTimers array contains all active FastTimers. + * + * @type {FastTimer[]} + */ +const fastTimers = [] + +/** + * These constants represent the various states of a FastTimer. + */ + +/** + * The `NOT_IN_LIST` constant indicates that the FastTimer is not included + * in the `fastTimers` array. Timers with this status will not be processed + * during the next tick by the `onTick` function. + * + * A FastTimer can be re-added to the `fastTimers` array by invoking the + * `refresh` method on the FastTimer instance. + * + * @type {-2} + */ +const NOT_IN_LIST = -2 + +/** + * The `TO_BE_CLEARED` constant indicates that the FastTimer is scheduled + * for removal from the `fastTimers` array. A FastTimer in this state will + * be removed in the next tick by the `onTick` function and will no longer + * be processed. + * + * This status is also set when the `clear` method is called on the FastTimer instance. + * + * @type {-1} + */ +const TO_BE_CLEARED = -1 + +/** + * The `PENDING` constant signifies that the FastTimer is awaiting processing + * in the next tick by the `onTick` function. Timers with this status will have + * their `_idleStart` value set and their status updated to `ACTIVE` in the next tick. + * + * @type {0} + */ +const PENDING = 0 + +/** + * The `ACTIVE` constant indicates that the FastTimer is active and waiting + * for its timer to expire. During the next tick, the `onTick` function will + * check if the timer has expired, and if so, it will execute the associated callback. + * + * @type {1} + */ +const ACTIVE = 1 + +/** + * The onTick function processes the fastTimers array. + * + * @returns {void} + */ +function onTick () { + /** + * Increment the fastNow value by the TICK_MS value, despite the actual time + * that has passed since the last tick. This approach ensures independence + * from the system clock and delays caused by a blocked event loop. + * + * @type {number} + */ + fastNow += TICK_MS + + /** + * The `idx` variable is used to iterate over the `fastTimers` array. + * Expired timers are removed by replacing them with the last element in the array. + * Consequently, `idx` is only incremented when the current element is not removed. + * + * @type {number} + */ + let idx = 0 + + /** + * The len variable will contain the length of the fastTimers array + * and will be decremented when a FastTimer should be removed from the + * fastTimers array. + * + * @type {number} + */ + let len = fastTimers.length + + while (idx < len) { + /** + * @type {FastTimer} + */ + const timer = fastTimers[idx] + + // If the timer is in the ACTIVE state and the timer has expired, it will + // be processed in the next tick. + if (timer._state === PENDING) { + // Set the _idleStart value to the fastNow value minus the TICK_MS value + // to account for the time the timer was in the PENDING state. + timer._idleStart = fastNow - TICK_MS + timer._state = ACTIVE + } else if ( + timer._state === ACTIVE && + fastNow >= timer._idleStart + timer._idleTimeout + ) { + timer._state = TO_BE_CLEARED + timer._idleStart = -1 + timer._onTimeout(timer._timerArg) + } + + if (timer._state === TO_BE_CLEARED) { + timer._state = NOT_IN_LIST + + // Move the last element to the current index and decrement len if it is + // not the only element in the array. + if (--len !== 0) { + fastTimers[idx] = fastTimers[len] + } + } else { + ++idx + } + } + + // Set the length of the fastTimers array to the new length and thus + // removing the excess FastTimers elements from the array. + fastTimers.length = len + + // If there are still active FastTimers in the array, refresh the Timer. + // If there are no active FastTimers, the timer will be refreshed again + // when a new FastTimer is instantiated. + if (fastTimers.length !== 0) { + refreshTimeout() + } +} + +function refreshTimeout () { + // If the fastNowTimeout is already set, refresh it. + if (fastNowTimeout) { + fastNowTimeout.refresh() + // fastNowTimeout is not instantiated yet, create a new Timer. + } else { + clearTimeout(fastNowTimeout) + fastNowTimeout = setTimeout(onTick, TICK_MS) + + // If the Timer has an unref method, call it to allow the process to exit if + // there are no other active handles. + if (fastNowTimeout.unref) { + fastNowTimeout.unref() + } + } +} + +/** + * The `FastTimer` class is a data structure designed to store and manage + * timer information. + */ +class FastTimer { + [kFastTimer] = true + + /** + * The state of the timer, which can be one of the following: + * - NOT_IN_LIST (-2) + * - TO_BE_CLEARED (-1) + * - PENDING (0) + * - ACTIVE (1) + * + * @type {-2|-1|0|1} + * @private + */ + _state = NOT_IN_LIST + + /** + * The number of milliseconds to wait before calling the callback. + * + * @type {number} + * @private + */ + _idleTimeout = -1 + + /** + * The time in milliseconds when the timer was started. This value is used to + * calculate when the timer should expire. + * + * @type {number} + * @default -1 + * @private + */ + _idleStart = -1 + + /** + * The function to be executed when the timer expires. + * @type {Function} + * @private + */ + _onTimeout + + /** + * The argument to be passed to the callback when the timer expires. + * + * @type {*} + * @private + */ + _timerArg + + /** + * @constructor + * @param {Function} callback A function to be executed after the timer + * expires. + * @param {number} delay The time, in milliseconds that the timer should wait + * before the specified function or code is executed. + * @param {*} arg + */ + constructor (callback, delay, arg) { + this._onTimeout = callback + this._idleTimeout = delay + this._timerArg = arg + + this.refresh() + } + + /** + * Sets the timer's start time to the current time, and reschedules the timer + * to call its callback at the previously specified duration adjusted to the + * current time. + * Using this on a timer that has already called its callback will reactivate + * the timer. + * + * @returns {void} + */ + refresh () { + // In the special case that the timer is not in the list of active timers, + // add it back to the array to be processed in the next tick by the onTick + // function. + if (this._state === NOT_IN_LIST) { + fastTimers.push(this) + } + + // If the timer is the only active timer, refresh the fastNowTimeout for + // better resolution. + if (!fastNowTimeout || fastTimers.length === 1) { + refreshTimeout() + } + + // Setting the state to PENDING will cause the timer to be reset in the + // next tick by the onTick function. + this._state = PENDING + } + + /** + * The `clear` method cancels the timer, preventing it from executing. + * + * @returns {void} + * @private + */ + clear () { + // Set the state to TO_BE_CLEARED to mark the timer for removal in the next + // tick by the onTick function. + this._state = TO_BE_CLEARED + + // Reset the _idleStart value to -1 to indicate that the timer is no longer + // active. + this._idleStart = -1 + } +} + +/** + * This module exports a setTimeout and clearTimeout function that can be + * used as a drop-in replacement for the native functions. + */ +module.exports = { + /** + * The setTimeout() method sets a timer which executes a function once the + * timer expires. + * @param {Function} callback A function to be executed after the timer + * expires. + * @param {number} delay The time, in milliseconds that the timer should + * wait before the specified function or code is executed. + * @param {*} [arg] An optional argument to be passed to the callback function + * when the timer expires. + * @returns {NodeJS.Timeout|FastTimer} + */ + setTimeout (callback, delay, arg) { + // If the delay is less than or equal to the RESOLUTION_MS value return a + // native Node.js Timer instance. + return delay <= RESOLUTION_MS + ? setTimeout(callback, delay, arg) + : new FastTimer(callback, delay, arg) + }, + /** + * The clearTimeout method cancels an instantiated Timer previously created + * by calling setTimeout. + * + * @param {NodeJS.Timeout|FastTimer} timeout + */ + clearTimeout (timeout) { + // If the timeout is a FastTimer, call its own clear method. + if (timeout[kFastTimer]) { + /** + * @type {FastTimer} + */ + timeout.clear() + // Otherwise it is an instance of a native NodeJS.Timeout, so call the + // Node.js native clearTimeout function. + } else { + clearTimeout(timeout) + } + }, + /** + * The setFastTimeout() method sets a fastTimer which executes a function once + * the timer expires. + * @param {Function} callback A function to be executed after the timer + * expires. + * @param {number} delay The time, in milliseconds that the timer should + * wait before the specified function or code is executed. + * @param {*} [arg] An optional argument to be passed to the callback function + * when the timer expires. + * @returns {FastTimer} + */ + setFastTimeout (callback, delay, arg) { + return new FastTimer(callback, delay, arg) + }, + /** + * The clearTimeout method cancels an instantiated FastTimer previously + * created by calling setFastTimeout. + * + * @param {FastTimer} timeout + */ + clearFastTimeout (timeout) { + timeout.clear() + }, + /** + * The now method returns the value of the internal fast timer clock. + * + * @returns {number} + */ + now () { + return fastNow + }, + /** + * Trigger the onTick function to process the fastTimers array. + * Exported for testing purposes only. + * Marking as deprecated to discourage any use outside of testing. + * @deprecated + * @param {number} [delay=0] The delay in milliseconds to add to the now value. + */ + tick (delay = 0) { + fastNow += delay - RESOLUTION_MS + 1 + onTick() + onTick() + }, + /** + * Reset FastTimers. + * Exported for testing purposes only. + * Marking as deprecated to discourage any use outside of testing. + * @deprecated + */ + reset () { + fastNow = 0 + fastTimers.length = 0 + clearTimeout(fastNowTimeout) + fastNowTimeout = null + }, + /** + * Exporting for testing purposes only. + * Marking as deprecated to discourage any use outside of testing. + * @deprecated + */ + kFastTimer +} diff --git a/node/node_modules/npm/node_modules/undici/lib/web/cache/cache.js b/node/node_modules/npm/node_modules/undici/lib/web/cache/cache.js new file mode 100644 index 0000000000000000000000000000000000000000..484c8e2c3ed93274a85b8d113d786a2c0e0744e7 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/web/cache/cache.js @@ -0,0 +1,859 @@ +'use strict' + +const { kConstruct } = require('./symbols') +const { urlEquals, getFieldValues } = require('./util') +const { kEnumerableProperty, isDisturbed } = require('../../core/util') +const { webidl } = require('../fetch/webidl') +const { Response, cloneResponse, fromInnerResponse } = require('../fetch/response') +const { Request, fromInnerRequest } = require('../fetch/request') +const { kState } = require('../fetch/symbols') +const { fetching } = require('../fetch/index') +const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require('../fetch/util') +const assert = require('node:assert') + +/** + * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation + * @typedef {Object} CacheBatchOperation + * @property {'delete' | 'put'} type + * @property {any} request + * @property {any} response + * @property {import('../../types/cache').CacheQueryOptions} options + */ + +/** + * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list + * @typedef {[any, any][]} requestResponseList + */ + +class Cache { + /** + * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list + * @type {requestResponseList} + */ + #relevantRequestResponseList + + constructor () { + if (arguments[0] !== kConstruct) { + webidl.illegalConstructor() + } + + webidl.util.markAsUncloneable(this) + this.#relevantRequestResponseList = arguments[1] + } + + async match (request, options = {}) { + webidl.brandCheck(this, Cache) + + const prefix = 'Cache.match' + webidl.argumentLengthCheck(arguments, 1, prefix) + + request = webidl.converters.RequestInfo(request, prefix, 'request') + options = webidl.converters.CacheQueryOptions(options, prefix, 'options') + + const p = this.#internalMatchAll(request, options, 1) + + if (p.length === 0) { + return + } + + return p[0] + } + + async matchAll (request = undefined, options = {}) { + webidl.brandCheck(this, Cache) + + const prefix = 'Cache.matchAll' + if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request') + options = webidl.converters.CacheQueryOptions(options, prefix, 'options') + + return this.#internalMatchAll(request, options) + } + + async add (request) { + webidl.brandCheck(this, Cache) + + const prefix = 'Cache.add' + webidl.argumentLengthCheck(arguments, 1, prefix) + + request = webidl.converters.RequestInfo(request, prefix, 'request') + + // 1. + const requests = [request] + + // 2. + const responseArrayPromise = this.addAll(requests) + + // 3. + return await responseArrayPromise + } + + async addAll (requests) { + webidl.brandCheck(this, Cache) + + const prefix = 'Cache.addAll' + webidl.argumentLengthCheck(arguments, 1, prefix) + + // 1. + const responsePromises = [] + + // 2. + const requestList = [] + + // 3. + for (let request of requests) { + if (request === undefined) { + throw webidl.errors.conversionFailed({ + prefix, + argument: 'Argument 1', + types: ['undefined is not allowed'] + }) + } + + request = webidl.converters.RequestInfo(request) + + if (typeof request === 'string') { + continue + } + + // 3.1 + const r = request[kState] + + // 3.2 + if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') { + throw webidl.errors.exception({ + header: prefix, + message: 'Expected http/s scheme when method is not GET.' + }) + } + } + + // 4. + /** @type {ReturnType[]} */ + const fetchControllers = [] + + // 5. + for (const request of requests) { + // 5.1 + const r = new Request(request)[kState] + + // 5.2 + if (!urlIsHttpHttpsScheme(r.url)) { + throw webidl.errors.exception({ + header: prefix, + message: 'Expected http/s scheme.' + }) + } + + // 5.4 + r.initiator = 'fetch' + r.destination = 'subresource' + + // 5.5 + requestList.push(r) + + // 5.6 + const responsePromise = createDeferredPromise() + + // 5.7 + fetchControllers.push(fetching({ + request: r, + processResponse (response) { + // 1. + if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) { + responsePromise.reject(webidl.errors.exception({ + header: 'Cache.addAll', + message: 'Received an invalid status code or the request failed.' + })) + } else if (response.headersList.contains('vary')) { // 2. + // 2.1 + const fieldValues = getFieldValues(response.headersList.get('vary')) + + // 2.2 + for (const fieldValue of fieldValues) { + // 2.2.1 + if (fieldValue === '*') { + responsePromise.reject(webidl.errors.exception({ + header: 'Cache.addAll', + message: 'invalid vary field value' + })) + + for (const controller of fetchControllers) { + controller.abort() + } + + return + } + } + } + }, + processResponseEndOfBody (response) { + // 1. + if (response.aborted) { + responsePromise.reject(new DOMException('aborted', 'AbortError')) + return + } + + // 2. + responsePromise.resolve(response) + } + })) + + // 5.8 + responsePromises.push(responsePromise.promise) + } + + // 6. + const p = Promise.all(responsePromises) + + // 7. + const responses = await p + + // 7.1 + const operations = [] + + // 7.2 + let index = 0 + + // 7.3 + for (const response of responses) { + // 7.3.1 + /** @type {CacheBatchOperation} */ + const operation = { + type: 'put', // 7.3.2 + request: requestList[index], // 7.3.3 + response // 7.3.4 + } + + operations.push(operation) // 7.3.5 + + index++ // 7.3.6 + } + + // 7.5 + const cacheJobPromise = createDeferredPromise() + + // 7.6.1 + let errorData = null + + // 7.6.2 + try { + this.#batchCacheOperations(operations) + } catch (e) { + errorData = e + } + + // 7.6.3 + queueMicrotask(() => { + // 7.6.3.1 + if (errorData === null) { + cacheJobPromise.resolve(undefined) + } else { + // 7.6.3.2 + cacheJobPromise.reject(errorData) + } + }) + + // 7.7 + return cacheJobPromise.promise + } + + async put (request, response) { + webidl.brandCheck(this, Cache) + + const prefix = 'Cache.put' + webidl.argumentLengthCheck(arguments, 2, prefix) + + request = webidl.converters.RequestInfo(request, prefix, 'request') + response = webidl.converters.Response(response, prefix, 'response') + + // 1. + let innerRequest = null + + // 2. + if (request instanceof Request) { + innerRequest = request[kState] + } else { // 3. + innerRequest = new Request(request)[kState] + } + + // 4. + if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') { + throw webidl.errors.exception({ + header: prefix, + message: 'Expected an http/s scheme when method is not GET' + }) + } + + // 5. + const innerResponse = response[kState] + + // 6. + if (innerResponse.status === 206) { + throw webidl.errors.exception({ + header: prefix, + message: 'Got 206 status' + }) + } + + // 7. + if (innerResponse.headersList.contains('vary')) { + // 7.1. + const fieldValues = getFieldValues(innerResponse.headersList.get('vary')) + + // 7.2. + for (const fieldValue of fieldValues) { + // 7.2.1 + if (fieldValue === '*') { + throw webidl.errors.exception({ + header: prefix, + message: 'Got * vary field value' + }) + } + } + } + + // 8. + if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) { + throw webidl.errors.exception({ + header: prefix, + message: 'Response body is locked or disturbed' + }) + } + + // 9. + const clonedResponse = cloneResponse(innerResponse) + + // 10. + const bodyReadPromise = createDeferredPromise() + + // 11. + if (innerResponse.body != null) { + // 11.1 + const stream = innerResponse.body.stream + + // 11.2 + const reader = stream.getReader() + + // 11.3 + readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject) + } else { + bodyReadPromise.resolve(undefined) + } + + // 12. + /** @type {CacheBatchOperation[]} */ + const operations = [] + + // 13. + /** @type {CacheBatchOperation} */ + const operation = { + type: 'put', // 14. + request: innerRequest, // 15. + response: clonedResponse // 16. + } + + // 17. + operations.push(operation) + + // 19. + const bytes = await bodyReadPromise.promise + + if (clonedResponse.body != null) { + clonedResponse.body.source = bytes + } + + // 19.1 + const cacheJobPromise = createDeferredPromise() + + // 19.2.1 + let errorData = null + + // 19.2.2 + try { + this.#batchCacheOperations(operations) + } catch (e) { + errorData = e + } + + // 19.2.3 + queueMicrotask(() => { + // 19.2.3.1 + if (errorData === null) { + cacheJobPromise.resolve() + } else { // 19.2.3.2 + cacheJobPromise.reject(errorData) + } + }) + + return cacheJobPromise.promise + } + + async delete (request, options = {}) { + webidl.brandCheck(this, Cache) + + const prefix = 'Cache.delete' + webidl.argumentLengthCheck(arguments, 1, prefix) + + request = webidl.converters.RequestInfo(request, prefix, 'request') + options = webidl.converters.CacheQueryOptions(options, prefix, 'options') + + /** + * @type {Request} + */ + let r = null + + if (request instanceof Request) { + r = request[kState] + + if (r.method !== 'GET' && !options.ignoreMethod) { + return false + } + } else { + assert(typeof request === 'string') + + r = new Request(request)[kState] + } + + /** @type {CacheBatchOperation[]} */ + const operations = [] + + /** @type {CacheBatchOperation} */ + const operation = { + type: 'delete', + request: r, + options + } + + operations.push(operation) + + const cacheJobPromise = createDeferredPromise() + + let errorData = null + let requestResponses + + try { + requestResponses = this.#batchCacheOperations(operations) + } catch (e) { + errorData = e + } + + queueMicrotask(() => { + if (errorData === null) { + cacheJobPromise.resolve(!!requestResponses?.length) + } else { + cacheJobPromise.reject(errorData) + } + }) + + return cacheJobPromise.promise + } + + /** + * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys + * @param {any} request + * @param {import('../../types/cache').CacheQueryOptions} options + * @returns {Promise} + */ + async keys (request = undefined, options = {}) { + webidl.brandCheck(this, Cache) + + const prefix = 'Cache.keys' + + if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request') + options = webidl.converters.CacheQueryOptions(options, prefix, 'options') + + // 1. + let r = null + + // 2. + if (request !== undefined) { + // 2.1 + if (request instanceof Request) { + // 2.1.1 + r = request[kState] + + // 2.1.2 + if (r.method !== 'GET' && !options.ignoreMethod) { + return [] + } + } else if (typeof request === 'string') { // 2.2 + r = new Request(request)[kState] + } + } + + // 4. + const promise = createDeferredPromise() + + // 5. + // 5.1 + const requests = [] + + // 5.2 + if (request === undefined) { + // 5.2.1 + for (const requestResponse of this.#relevantRequestResponseList) { + // 5.2.1.1 + requests.push(requestResponse[0]) + } + } else { // 5.3 + // 5.3.1 + const requestResponses = this.#queryCache(r, options) + + // 5.3.2 + for (const requestResponse of requestResponses) { + // 5.3.2.1 + requests.push(requestResponse[0]) + } + } + + // 5.4 + queueMicrotask(() => { + // 5.4.1 + const requestList = [] + + // 5.4.2 + for (const request of requests) { + const requestObject = fromInnerRequest( + request, + new AbortController().signal, + 'immutable' + ) + // 5.4.2.1 + requestList.push(requestObject) + } + + // 5.4.3 + promise.resolve(Object.freeze(requestList)) + }) + + return promise.promise + } + + /** + * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm + * @param {CacheBatchOperation[]} operations + * @returns {requestResponseList} + */ + #batchCacheOperations (operations) { + // 1. + const cache = this.#relevantRequestResponseList + + // 2. + const backupCache = [...cache] + + // 3. + const addedItems = [] + + // 4.1 + const resultList = [] + + try { + // 4.2 + for (const operation of operations) { + // 4.2.1 + if (operation.type !== 'delete' && operation.type !== 'put') { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'operation type does not match "delete" or "put"' + }) + } + + // 4.2.2 + if (operation.type === 'delete' && operation.response != null) { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'delete operation should not have an associated response' + }) + } + + // 4.2.3 + if (this.#queryCache(operation.request, operation.options, addedItems).length) { + throw new DOMException('???', 'InvalidStateError') + } + + // 4.2.4 + let requestResponses + + // 4.2.5 + if (operation.type === 'delete') { + // 4.2.5.1 + requestResponses = this.#queryCache(operation.request, operation.options) + + // TODO: the spec is wrong, this is needed to pass WPTs + if (requestResponses.length === 0) { + return [] + } + + // 4.2.5.2 + for (const requestResponse of requestResponses) { + const idx = cache.indexOf(requestResponse) + assert(idx !== -1) + + // 4.2.5.2.1 + cache.splice(idx, 1) + } + } else if (operation.type === 'put') { // 4.2.6 + // 4.2.6.1 + if (operation.response == null) { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'put operation should have an associated response' + }) + } + + // 4.2.6.2 + const r = operation.request + + // 4.2.6.3 + if (!urlIsHttpHttpsScheme(r.url)) { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'expected http or https scheme' + }) + } + + // 4.2.6.4 + if (r.method !== 'GET') { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'not get method' + }) + } + + // 4.2.6.5 + if (operation.options != null) { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'options must not be defined' + }) + } + + // 4.2.6.6 + requestResponses = this.#queryCache(operation.request) + + // 4.2.6.7 + for (const requestResponse of requestResponses) { + const idx = cache.indexOf(requestResponse) + assert(idx !== -1) + + // 4.2.6.7.1 + cache.splice(idx, 1) + } + + // 4.2.6.8 + cache.push([operation.request, operation.response]) + + // 4.2.6.10 + addedItems.push([operation.request, operation.response]) + } + + // 4.2.7 + resultList.push([operation.request, operation.response]) + } + + // 4.3 + return resultList + } catch (e) { // 5. + // 5.1 + this.#relevantRequestResponseList.length = 0 + + // 5.2 + this.#relevantRequestResponseList = backupCache + + // 5.3 + throw e + } + } + + /** + * @see https://w3c.github.io/ServiceWorker/#query-cache + * @param {any} requestQuery + * @param {import('../../types/cache').CacheQueryOptions} options + * @param {requestResponseList} targetStorage + * @returns {requestResponseList} + */ + #queryCache (requestQuery, options, targetStorage) { + /** @type {requestResponseList} */ + const resultList = [] + + const storage = targetStorage ?? this.#relevantRequestResponseList + + for (const requestResponse of storage) { + const [cachedRequest, cachedResponse] = requestResponse + if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) { + resultList.push(requestResponse) + } + } + + return resultList + } + + /** + * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm + * @param {any} requestQuery + * @param {any} request + * @param {any | null} response + * @param {import('../../types/cache').CacheQueryOptions | undefined} options + * @returns {boolean} + */ + #requestMatchesCachedItem (requestQuery, request, response = null, options) { + // if (options?.ignoreMethod === false && request.method === 'GET') { + // return false + // } + + const queryURL = new URL(requestQuery.url) + + const cachedURL = new URL(request.url) + + if (options?.ignoreSearch) { + cachedURL.search = '' + + queryURL.search = '' + } + + if (!urlEquals(queryURL, cachedURL, true)) { + return false + } + + if ( + response == null || + options?.ignoreVary || + !response.headersList.contains('vary') + ) { + return true + } + + const fieldValues = getFieldValues(response.headersList.get('vary')) + + for (const fieldValue of fieldValues) { + if (fieldValue === '*') { + return false + } + + const requestValue = request.headersList.get(fieldValue) + const queryValue = requestQuery.headersList.get(fieldValue) + + // If one has the header and the other doesn't, or one has + // a different value than the other, return false + if (requestValue !== queryValue) { + return false + } + } + + return true + } + + #internalMatchAll (request, options, maxResponses = Infinity) { + // 1. + let r = null + + // 2. + if (request !== undefined) { + if (request instanceof Request) { + // 2.1.1 + r = request[kState] + + // 2.1.2 + if (r.method !== 'GET' && !options.ignoreMethod) { + return [] + } + } else if (typeof request === 'string') { + // 2.2.1 + r = new Request(request)[kState] + } + } + + // 5. + // 5.1 + const responses = [] + + // 5.2 + if (request === undefined) { + // 5.2.1 + for (const requestResponse of this.#relevantRequestResponseList) { + responses.push(requestResponse[1]) + } + } else { // 5.3 + // 5.3.1 + const requestResponses = this.#queryCache(r, options) + + // 5.3.2 + for (const requestResponse of requestResponses) { + responses.push(requestResponse[1]) + } + } + + // 5.4 + // We don't implement CORs so we don't need to loop over the responses, yay! + + // 5.5.1 + const responseList = [] + + // 5.5.2 + for (const response of responses) { + // 5.5.2.1 + const responseObject = fromInnerResponse(response, 'immutable') + + responseList.push(responseObject.clone()) + + if (responseList.length >= maxResponses) { + break + } + } + + // 6. + return Object.freeze(responseList) + } +} + +Object.defineProperties(Cache.prototype, { + [Symbol.toStringTag]: { + value: 'Cache', + configurable: true + }, + match: kEnumerableProperty, + matchAll: kEnumerableProperty, + add: kEnumerableProperty, + addAll: kEnumerableProperty, + put: kEnumerableProperty, + delete: kEnumerableProperty, + keys: kEnumerableProperty +}) + +const cacheQueryOptionConverters = [ + { + key: 'ignoreSearch', + converter: webidl.converters.boolean, + defaultValue: () => false + }, + { + key: 'ignoreMethod', + converter: webidl.converters.boolean, + defaultValue: () => false + }, + { + key: 'ignoreVary', + converter: webidl.converters.boolean, + defaultValue: () => false + } +] + +webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters) + +webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([ + ...cacheQueryOptionConverters, + { + key: 'cacheName', + converter: webidl.converters.DOMString + } +]) + +webidl.converters.Response = webidl.interfaceConverter(Response) + +webidl.converters['sequence'] = webidl.sequenceConverter( + webidl.converters.RequestInfo +) + +module.exports = { + Cache +} diff --git a/node/node_modules/npm/node_modules/undici/lib/web/cache/cachestorage.js b/node/node_modules/npm/node_modules/undici/lib/web/cache/cachestorage.js new file mode 100644 index 0000000000000000000000000000000000000000..5e5da710e7100f4d2bd97b48f9760106a1ccab6a --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/web/cache/cachestorage.js @@ -0,0 +1,152 @@ +'use strict' + +const { kConstruct } = require('./symbols') +const { Cache } = require('./cache') +const { webidl } = require('../fetch/webidl') +const { kEnumerableProperty } = require('../../core/util') + +class CacheStorage { + /** + * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map + * @type {Map} + */ + async has (cacheName) { + webidl.brandCheck(this, CacheStorage) + + const prefix = 'CacheStorage.has' + webidl.argumentLengthCheck(arguments, 1, prefix) + + cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName') + + // 2.1.1 + // 2.2 + return this.#caches.has(cacheName) + } + + /** + * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open + * @param {string} cacheName + * @returns {Promise} + */ + async open (cacheName) { + webidl.brandCheck(this, CacheStorage) + + const prefix = 'CacheStorage.open' + webidl.argumentLengthCheck(arguments, 1, prefix) + + cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName') + + // 2.1 + if (this.#caches.has(cacheName)) { + // await caches.open('v1') !== await caches.open('v1') + + // 2.1.1 + const cache = this.#caches.get(cacheName) + + // 2.1.1.1 + return new Cache(kConstruct, cache) + } + + // 2.2 + const cache = [] + + // 2.3 + this.#caches.set(cacheName, cache) + + // 2.4 + return new Cache(kConstruct, cache) + } + + /** + * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete + * @param {string} cacheName + * @returns {Promise} + */ + async delete (cacheName) { + webidl.brandCheck(this, CacheStorage) + + const prefix = 'CacheStorage.delete' + webidl.argumentLengthCheck(arguments, 1, prefix) + + cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName') + + return this.#caches.delete(cacheName) + } + + /** + * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys + * @returns {Promise} + */ + async keys () { + webidl.brandCheck(this, CacheStorage) + + // 2.1 + const keys = this.#caches.keys() + + // 2.2 + return [...keys] + } +} + +Object.defineProperties(CacheStorage.prototype, { + [Symbol.toStringTag]: { + value: 'CacheStorage', + configurable: true + }, + match: kEnumerableProperty, + has: kEnumerableProperty, + open: kEnumerableProperty, + delete: kEnumerableProperty, + keys: kEnumerableProperty +}) + +module.exports = { + CacheStorage +} diff --git a/node/node_modules/npm/node_modules/undici/lib/web/cache/symbols.js b/node/node_modules/npm/node_modules/undici/lib/web/cache/symbols.js new file mode 100644 index 0000000000000000000000000000000000000000..5dff64c5fde63582e31c5f930ef9b1d925f328f6 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/web/cache/symbols.js @@ -0,0 +1,5 @@ +'use strict' + +module.exports = { + kConstruct: require('../../core/symbols').kConstruct +} diff --git a/node/node_modules/npm/node_modules/undici/lib/web/cache/util.js b/node/node_modules/npm/node_modules/undici/lib/web/cache/util.js new file mode 100644 index 0000000000000000000000000000000000000000..92c32c05e3d2bf511cbf160ff14e6e8b1a5459b8 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/web/cache/util.js @@ -0,0 +1,45 @@ +'use strict' + +const assert = require('node:assert') +const { URLSerializer } = require('../fetch/data-url') +const { isValidHeaderName } = require('../fetch/util') + +/** + * @see https://url.spec.whatwg.org/#concept-url-equals + * @param {URL} A + * @param {URL} B + * @param {boolean | undefined} excludeFragment + * @returns {boolean} + */ +function urlEquals (A, B, excludeFragment = false) { + const serializedA = URLSerializer(A, excludeFragment) + + const serializedB = URLSerializer(B, excludeFragment) + + return serializedA === serializedB +} + +/** + * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262 + * @param {string} header + */ +function getFieldValues (header) { + assert(header !== null) + + const values = [] + + for (let value of header.split(',')) { + value = value.trim() + + if (isValidHeaderName(value)) { + values.push(value) + } + } + + return values +} + +module.exports = { + urlEquals, + getFieldValues +} diff --git a/node/node_modules/npm/node_modules/undici/lib/web/cookies/constants.js b/node/node_modules/npm/node_modules/undici/lib/web/cookies/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..93ef03f121c88f6723e76577723c223523a75c21 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/web/cookies/constants.js @@ -0,0 +1,12 @@ +'use strict' + +// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size +const maxAttributeValueSize = 1024 + +// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size +const maxNameValuePairSize = 4096 + +module.exports = { + maxAttributeValueSize, + maxNameValuePairSize +} diff --git a/node/node_modules/npm/node_modules/undici/lib/web/cookies/index.js b/node/node_modules/npm/node_modules/undici/lib/web/cookies/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1e97c4a46b0b745a3ad5f8685c8e68ccb4d30fef --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/web/cookies/index.js @@ -0,0 +1,184 @@ +'use strict' + +const { parseSetCookie } = require('./parse') +const { stringify } = require('./util') +const { webidl } = require('../fetch/webidl') +const { Headers } = require('../fetch/headers') + +/** + * @typedef {Object} Cookie + * @property {string} name + * @property {string} value + * @property {Date|number|undefined} expires + * @property {number|undefined} maxAge + * @property {string|undefined} domain + * @property {string|undefined} path + * @property {boolean|undefined} secure + * @property {boolean|undefined} httpOnly + * @property {'Strict'|'Lax'|'None'} sameSite + * @property {string[]} unparsed + */ + +/** + * @param {Headers} headers + * @returns {Record} + */ +function getCookies (headers) { + webidl.argumentLengthCheck(arguments, 1, 'getCookies') + + webidl.brandCheck(headers, Headers, { strict: false }) + + const cookie = headers.get('cookie') + const out = {} + + if (!cookie) { + return out + } + + for (const piece of cookie.split(';')) { + const [name, ...value] = piece.split('=') + + out[name.trim()] = value.join('=') + } + + return out +} + +/** + * @param {Headers} headers + * @param {string} name + * @param {{ path?: string, domain?: string }|undefined} attributes + * @returns {void} + */ +function deleteCookie (headers, name, attributes) { + webidl.brandCheck(headers, Headers, { strict: false }) + + const prefix = 'deleteCookie' + webidl.argumentLengthCheck(arguments, 2, prefix) + + name = webidl.converters.DOMString(name, prefix, 'name') + attributes = webidl.converters.DeleteCookieAttributes(attributes) + + // Matches behavior of + // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278 + setCookie(headers, { + name, + value: '', + expires: new Date(0), + ...attributes + }) +} + +/** + * @param {Headers} headers + * @returns {Cookie[]} + */ +function getSetCookies (headers) { + webidl.argumentLengthCheck(arguments, 1, 'getSetCookies') + + webidl.brandCheck(headers, Headers, { strict: false }) + + const cookies = headers.getSetCookie() + + if (!cookies) { + return [] + } + + return cookies.map((pair) => parseSetCookie(pair)) +} + +/** + * @param {Headers} headers + * @param {Cookie} cookie + * @returns {void} + */ +function setCookie (headers, cookie) { + webidl.argumentLengthCheck(arguments, 2, 'setCookie') + + webidl.brandCheck(headers, Headers, { strict: false }) + + cookie = webidl.converters.Cookie(cookie) + + const str = stringify(cookie) + + if (str) { + headers.append('Set-Cookie', str) + } +} + +webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([ + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'path', + defaultValue: () => null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'domain', + defaultValue: () => null + } +]) + +webidl.converters.Cookie = webidl.dictionaryConverter([ + { + converter: webidl.converters.DOMString, + key: 'name' + }, + { + converter: webidl.converters.DOMString, + key: 'value' + }, + { + converter: webidl.nullableConverter((value) => { + if (typeof value === 'number') { + return webidl.converters['unsigned long long'](value) + } + + return new Date(value) + }), + key: 'expires', + defaultValue: () => null + }, + { + converter: webidl.nullableConverter(webidl.converters['long long']), + key: 'maxAge', + defaultValue: () => null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'domain', + defaultValue: () => null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'path', + defaultValue: () => null + }, + { + converter: webidl.nullableConverter(webidl.converters.boolean), + key: 'secure', + defaultValue: () => null + }, + { + converter: webidl.nullableConverter(webidl.converters.boolean), + key: 'httpOnly', + defaultValue: () => null + }, + { + converter: webidl.converters.USVString, + key: 'sameSite', + allowedValues: ['Strict', 'Lax', 'None'] + }, + { + converter: webidl.sequenceConverter(webidl.converters.DOMString), + key: 'unparsed', + defaultValue: () => new Array(0) + } +]) + +module.exports = { + getCookies, + deleteCookie, + getSetCookies, + setCookie +} diff --git a/node/node_modules/npm/node_modules/undici/lib/web/cookies/parse.js b/node/node_modules/npm/node_modules/undici/lib/web/cookies/parse.js new file mode 100644 index 0000000000000000000000000000000000000000..ee079a34bb7faa5e81b80e6e4f87d0ce76769653 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/lib/web/cookies/parse.js @@ -0,0 +1,317 @@ +'use strict' + +const { maxNameValuePairSize, maxAttributeValueSize } = require('./constants') +const { isCTLExcludingHtab } = require('./util') +const { collectASequenceOfCodePointsFast } = require('../fetch/data-url') +const assert = require('node:assert') + +/** + * @description Parses the field-value attributes of a set-cookie header string. + * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4 + * @param {string} header + * @returns if the header is invalid, null will be returned + */ +function parseSetCookie (header) { + // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F + // character (CTL characters excluding HTAB): Abort these steps and + // ignore the set-cookie-string entirely. + if (isCTLExcludingHtab(header)) { + return null + } + + let nameValuePair = '' + let unparsedAttributes = '' + let name = '' + let value = '' + + // 2. If the set-cookie-string contains a %x3B (";") character: + if (header.includes(';')) { + // 1. The name-value-pair string consists of the characters up to, + // but not including, the first %x3B (";"), and the unparsed- + // attributes consist of the remainder of the set-cookie-string + // (including the %x3B (";") in question). + const position = { position: 0 } + + nameValuePair = collectASequenceOfCodePointsFast(';', header, position) + unparsedAttributes = header.slice(position.position) + } else { + // Otherwise: + + // 1. The name-value-pair string consists of all the characters + // contained in the set-cookie-string, and the unparsed- + // attributes is the empty string. + nameValuePair = header + } + + // 3. If the name-value-pair string lacks a %x3D ("=") character, then + // the name string is empty, and the value string is the value of + // name-value-pair. + if (!nameValuePair.includes('=')) { + value = nameValuePair + } else { + // Otherwise, the name string consists of the characters up to, but + // not including, the first %x3D ("=") character, and the (possibly + // empty) value string consists of the characters after the first + // %x3D ("=") character. + const position = { position: 0 } + name = collectASequenceOfCodePointsFast( + '=', + nameValuePair, + position + ) + value = nameValuePair.slice(position.position + 1) + } + + // 4. Remove any leading or trailing WSP characters from the name + // string and the value string. + name = name.trim() + value = value.trim() + + // 5. If the sum of the lengths of the name string and the value string + // is more than 4096 octets, abort these steps and ignore the set- + // cookie-string entirely. + if (name.length + value.length > maxNameValuePairSize) { + return null + } + + // 6. The cookie-name is the name string, and the cookie-value is the + // value string. + return { + name, value, ...parseUnparsedAttributes(unparsedAttributes) + } +} + +/** + * Parses the remaining attributes of a set-cookie header + * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4 + * @param {string} unparsedAttributes + * @param {[Object.]={}} cookieAttributeList + */ +function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) { + // 1. If the unparsed-attributes string is empty, skip the rest of + // these steps. + if (unparsedAttributes.length === 0) { + return cookieAttributeList + } + + // 2. Discard the first character of the unparsed-attributes (which + // will be a %x3B (";") character). + assert(unparsedAttributes[0] === ';') + unparsedAttributes = unparsedAttributes.slice(1) + + let cookieAv = '' + + // 3. If the remaining unparsed-attributes contains a %x3B (";") + // character: + if (unparsedAttributes.includes(';')) { + // 1. Consume the characters of the unparsed-attributes up to, but + // not including, the first %x3B (";") character. + cookieAv = collectASequenceOfCodePointsFast( + ';', + unparsedAttributes, + { position: 0 } + ) + unparsedAttributes = unparsedAttributes.slice(cookieAv.length) + } else { + // Otherwise: + + // 1. Consume the remainder of the unparsed-attributes. + cookieAv = unparsedAttributes + unparsedAttributes = '' + } + + // Let the cookie-av string be the characters consumed in this step. + + let attributeName = '' + let attributeValue = '' + + // 4. If the cookie-av string contains a %x3D ("=") character: + if (cookieAv.includes('=')) { + // 1. The (possibly empty) attribute-name string consists of the + // characters up to, but not including, the first %x3D ("=") + // character, and the (possibly empty) attribute-value string + // consists of the characters after the first %x3D ("=") + // character. + const position = { position: 0 } + + attributeName = collectASequenceOfCodePointsFast( + '=', + cookieAv, + position + ) + attributeValue = cookieAv.slice(position.position + 1) + } else { + // Otherwise: + + // 1. The attribute-name string consists of the entire cookie-av + // string, and the attribute-value string is empty. + attributeName = cookieAv + } + + // 5. Remove any leading or trailing WSP characters from the attribute- + // name string and the attribute-value string. + attributeName = attributeName.trim() + attributeValue = attributeValue.trim() + + // 6. If the attribute-value is longer than 1024 octets, ignore the + // cookie-av string and return to Step 1 of this algorithm. + if (attributeValue.length > maxAttributeValueSize) { + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) + } + + // 7. Process the attribute-name and attribute-value according to the + // requirements in the following subsections. (Notice that + // attributes with unrecognized attribute-names are ignored.) + const attributeNameLowercase = attributeName.toLowerCase() + + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1 + // If the attribute-name case-insensitively matches the string + // "Expires", the user agent MUST process the cookie-av as follows. + if (attributeNameLowercase === 'expires') { + // 1. Let the expiry-time be the result of parsing the attribute-value + // as cookie-date (see Section 5.1.1). + const expiryTime = new Date(attributeValue) + + // 2. If the attribute-value failed to parse as a cookie date, ignore + // the cookie-av. + + cookieAttributeList.expires = expiryTime + } else if (attributeNameLowercase === 'max-age') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2 + // If the attribute-name case-insensitively matches the string "Max- + // Age", the user agent MUST process the cookie-av as follows. + + // 1. If the first character of the attribute-value is not a DIGIT or a + // "-" character, ignore the cookie-av. + const charCode = attributeValue.charCodeAt(0) + + if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') { + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) + } + + // 2. If the remainder of attribute-value contains a non-DIGIT + // character, ignore the cookie-av. + if (!/^\d+$/.test(attributeValue)) { + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) + } + + // 3. Let delta-seconds be the attribute-value converted to an integer. + const deltaSeconds = Number(attributeValue) + + // 4. Let cookie-age-limit be the maximum age of the cookie (which + // SHOULD be 400 days or less, see Section 4.1.2.2). + + // 5. Set delta-seconds to the smaller of its present value and cookie- + // age-limit. + // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs) + + // 6. If delta-seconds is less than or equal to zero (0), let expiry- + // time be the earliest representable date and time. Otherwise, let + // the expiry-time be the current date and time plus delta-seconds + // seconds. + // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds + + // 7. Append an attribute to the cookie-attribute-list with an + // attribute-name of Max-Age and an attribute-value of expiry-time. + cookieAttributeList.maxAge = deltaSeconds + } else if (attributeNameLowercase === 'domain') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3 + // If the attribute-name case-insensitively matches the string "Domain", + // the user agent MUST process the cookie-av as follows. + + // 1. Let cookie-domain be the attribute-value. + let cookieDomain = attributeValue + + // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be + // cookie-domain without its leading %x2E ("."). + if (cookieDomain[0] === '.') { + cookieDomain = cookieDomain.slice(1) + } + + // 3. Convert the cookie-domain to lower case. + cookieDomain = cookieDomain.toLowerCase() + + // 4. Append an attribute to the cookie-attribute-list with an + // attribute-name of Domain and an attribute-value of cookie-domain. + cookieAttributeList.domain = cookieDomain + } else if (attributeNameLowercase === 'path') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4 + // If the attribute-name case-insensitively matches the string "Path", + // the user agent MUST process the cookie-av as follows. + + // 1. If the attribute-value is empty or if the first character of the + // attribute-value is not %x2F ("/"): + let cookiePath = '' + if (attributeValue.length === 0 || attributeValue[0] !== '/') { + // 1. Let cookie-path be the default-path. + cookiePath = '/' + } else { + // Otherwise: + + // 1. Let cookie-path be the attribute-value. + cookiePath = attributeValue + } + + // 2. Append an attribute to the cookie-attribute-list with an + // attribute-name of Path and an attribute-value of cookie-path. + cookieAttributeList.path = cookiePath + } else if (attributeNameLowercase === 'secure') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5 + // If the attribute-name case-insensitively matches the string "Secure", + // the user agent MUST append an attribute to the cookie-attribute-list + // with an attribute-name of Secure and an empty attribute-value. + + cookieAttributeList.secure = true + } else if (attributeNameLowercase === 'httponly') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6 + // If the attribute-name case-insensitively matches the string + // "HttpOnly", the user agent MUST append an attribute to the cookie- + // attribute-list with an attribute-name of HttpOnly and an empty + // attribute-value. + + cookieAttributeList.httpOnly = true + } else if (attributeNameLowercase === 'samesite') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7 + // If the attribute-name case-insensitively matches the string + // "SameSite", the user agent MUST process the cookie-av as follows: + + // 1. Let enforcement be "Default". + let enforcement = 'Default' + + const attributeValueLowercase = attributeValue.toLowerCase() + // 2. If cookie-av's attribute-value is a case-insensitive match for + // "None", set enforcement to "None". + if (attributeValueLowercase.includes('none')) { + enforcement = 'None' + } + + // 3. If cookie-av's attribute-value is a case-insensitive match for + // "Strict", set enforcement to "Strict". + if (attributeValueLowercase.includes('strict')) { + enforcement = 'Strict' + } + + // 4. If cookie-av's attribute-value is a case-insensitive match for + // "Lax", set enforcement to "Lax". + if (attributeValueLowercase.includes('lax')) { + enforcement = 'Lax' + } + + // 5. Append an attribute to the cookie-attribute-list with an + // attribute-name of "SameSite" and an attribute-value of + // enforcement. + cookieAttributeList.sameSite = enforcement + } else { + cookieAttributeList.unparsed ??= [] + + cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`) + } + + // 8. Return to Step 1 of this algorithm. + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) +} + +module.exports = { + parseSetCookie, + parseUnparsedAttributes +} diff --git a/node/node_modules/npm/node_modules/undici/package.json b/node/node_modules/npm/node_modules/undici/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9d4ad839b2b39edb10e8b44c7b47a1fe43ed9e33 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/package.json @@ -0,0 +1,160 @@ +{ + "name": "undici", + "version": "6.25.0", + "description": "An HTTP/1.1 client, written from scratch for Node.js", + "homepage": "https://undici.nodejs.org", + "bugs": { + "url": "https://github.com/nodejs/undici/issues" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/nodejs/undici.git" + }, + "license": "MIT", + "contributors": [ + { + "name": "Daniele Belardi", + "url": "https://github.com/dnlup", + "author": true + }, + { + "name": "Ethan Arrowood", + "url": "https://github.com/ethan-arrowood", + "author": true + }, + { + "name": "Matteo Collina", + "url": "https://github.com/mcollina", + "author": true + }, + { + "name": "Matthew Aitken", + "url": "https://github.com/KhafraDev", + "author": true + }, + { + "name": "Robert Nagy", + "url": "https://github.com/ronag", + "author": true + }, + { + "name": "Szymon Marczak", + "url": "https://github.com/szmarczak", + "author": true + }, + { + "name": "Tomas Della Vedova", + "url": "https://github.com/delvedor", + "author": true + } + ], + "keywords": [ + "fetch", + "http", + "https", + "promise", + "request", + "curl", + "wget", + "xhr", + "whatwg" + ], + "main": "index.js", + "types": "index.d.ts", + "scripts": { + "build:node": "npx esbuild@0.19.10 index-fetch.js --bundle --platform=node --outfile=undici-fetch.js --define:esbuildDetection=1 --keep-names && node scripts/strip-comments.js", + "prebuild:wasm": "node build/wasm.js --prebuild", + "build:wasm": "node build/wasm.js --docker", + "lint": "standard | snazzy", + "lint:fix": "standard --fix | snazzy", + "test": "npm run test:javascript && cross-env NODE_V8_COVERAGE= npm run test:typescript", + "test:javascript": "node scripts/generate-pem && npm run test:unit && npm run test:node-fetch && npm run test:cache && npm run test:interceptors && npm run test:fetch && npm run test:cookies && npm run test:eventsource && npm run test:wpt && npm run test:websocket && npm run test:node-test && npm run test:jest", + "test:javascript:withoutintl": "node scripts/generate-pem && npm run test:unit && npm run test:node-fetch && npm run test:fetch:nobuild && npm run test:cache && npm run test:interceptors && npm run test:cookies && npm run test:eventsource:nobuild && npm run test:wpt:withoutintl && npm run test:node-test", + "test:busboy": "borp -p \"test/busboy/*.js\"", + "test:cache": "borp -p \"test/cache/*.js\"", + "test:cookies": "borp -p \"test/cookie/*.js\"", + "test:eventsource": "npm run build:node && npm run test:eventsource:nobuild", + "test:eventsource:nobuild": "borp --expose-gc -p \"test/eventsource/*.js\"", + "test:fuzzing": "node test/fuzzing/fuzzing.test.js", + "test:fetch": "npm run build:node && npm run test:fetch:nobuild", + "test:fetch:nobuild": "borp --timeout 180000 --expose-gc --concurrency 1 -p \"test/fetch/*.js\" && npm run test:webidl && npm run test:busboy", + "test:h2": "npm run test:h2:core && npm run test:h2:fetch", + "test:h2:core": "borp -p \"test/http2*.js\"", + "test:h2:fetch": "npm run build:node && borp -p \"test/fetch/http2*.js\"", + "test:interceptors": "borp -p \"test/interceptors/*.js\"", + "test:jest": "cross-env NODE_V8_COVERAGE= jest", + "test:unit": "borp --expose-gc -p \"test/*.js\"", + "test:node-fetch": "borp -p \"test/node-fetch/**/*.js\"", + "test:node-test": "borp -p \"test/node-test/**/*.js\"", + "test:tdd": "borp --expose-gc -p \"test/*.js\"", + "test:tdd:node-test": "borp -p \"test/node-test/**/*.js\" -w", + "test:typescript": "tsd && tsc test/imports/undici-import.ts --typeRoots ./types && tsc ./types/*.d.ts --noEmit --typeRoots ./types", + "test:webidl": "borp -p \"test/webidl/*.js\"", + "test:websocket": "borp -p \"test/websocket/*.js\"", + "test:websocket:autobahn": "node test/autobahn/client.js", + "test:websocket:autobahn:report": "node test/autobahn/report.js", + "test:wpt": "node test/wpt/start-fetch.mjs && node test/wpt/start-FileAPI.mjs && node test/wpt/start-mimesniff.mjs && node test/wpt/start-xhr.mjs && node test/wpt/start-websockets.mjs && node test/wpt/start-cacheStorage.mjs && node test/wpt/start-eventsource.mjs", + "test:wpt:withoutintl": "node test/wpt/start-fetch.mjs && node test/wpt/start-mimesniff.mjs && node test/wpt/start-xhr.mjs && node test/wpt/start-cacheStorage.mjs && node test/wpt/start-eventsource.mjs", + "coverage": "npm run coverage:clean && cross-env NODE_V8_COVERAGE=./coverage/tmp npm run test:javascript && npm run coverage:report", + "coverage:ci": "npm run coverage:clean && cross-env NODE_V8_COVERAGE=./coverage/tmp npm run test:javascript && npm run coverage:report:ci", + "coverage:clean": "node ./scripts/clean-coverage.js", + "coverage:report": "cross-env NODE_V8_COVERAGE= c8 report", + "coverage:report:ci": "c8 report", + "bench": "echo \"Error: Benchmarks have been moved to '/benchmarks'\" && exit 1", + "serve:website": "echo \"Error: Documentation has been moved to '/docs'\" && exit 1", + "prepare": "husky && node ./scripts/platform-shell.js" + }, + "devDependencies": { + "@fastify/busboy": "2.1.1", + "@matteo.collina/tspl": "^0.1.1", + "@metcoder95/https-pem": "^1.0.0", + "@sinonjs/fake-timers": "^11.1.0", + "@types/node": "~18.19.50", + "abort-controller": "^3.0.0", + "borp": "^0.15.0", + "c8": "^10.0.0", + "cross-env": "^7.0.3", + "dns-packet": "^5.4.0", + "fast-check": "^3.17.1", + "form-data": "^4.0.0", + "formdata-node": "^6.0.3", + "husky": "^9.0.7", + "jest": "^29.0.2", + "jsdom": "^24.0.0", + "node-forge": "^1.3.1", + "pre-commit": "^1.2.2", + "proxy": "^2.1.1", + "snazzy": "^9.0.0", + "standard": "^17.0.0", + "tsd": "^0.31.0", + "typescript": "^5.0.2", + "ws": "^8.11.0" + }, + "engines": { + "node": ">=18.17" + }, + "standard": { + "env": [ + "jest" + ], + "ignore": [ + "lib/llhttp/constants.js", + "lib/llhttp/utils.js", + "test/fixtures/wpt" + ] + }, + "tsd": { + "directory": "test/types", + "compilerOptions": { + "esModuleInterop": true, + "lib": [ + "esnext" + ] + } + }, + "jest": { + "testMatch": [ + "/test/jest/**" + ] + } +} diff --git a/node/node_modules/npm/node_modules/undici/scripts/strip-comments.js b/node/node_modules/npm/node_modules/undici/scripts/strip-comments.js new file mode 100644 index 0000000000000000000000000000000000000000..faf13c8e53d5d97d07ee4d88a91a9b1be20d1ae4 --- /dev/null +++ b/node/node_modules/npm/node_modules/undici/scripts/strip-comments.js @@ -0,0 +1,8 @@ +'use strict' + +const { readFileSync, writeFileSync } = require('node:fs') +const { transcode } = require('node:buffer') + +const buffer = transcode(readFileSync('./undici-fetch.js'), 'utf8', 'latin1') + +writeFileSync('./undici-fetch.js', buffer.toString('latin1')) diff --git a/node/node_modules/npm/node_modules/util-deprecate/History.md b/node/node_modules/npm/node_modules/util-deprecate/History.md new file mode 100644 index 0000000000000000000000000000000000000000..cebc86dab092372f4d9dd65fc36b711c271350c7 --- /dev/null +++ b/node/node_modules/npm/node_modules/util-deprecate/History.md @@ -0,0 +1,16 @@ + +1.0.2 / 2015-10-07 +================== + + * use try/catch when checking `localStorage` (#3, @kumavis) + +1.0.1 / 2014-11-25 +================== + + * browser: use `console.warn()` for deprecation calls + * browser: more jsdocs + +1.0.0 / 2014-04-30 +================== + + * initial commit diff --git a/node/node_modules/npm/node_modules/util-deprecate/LICENSE b/node/node_modules/npm/node_modules/util-deprecate/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..878b30f2acd3cca6116430ded4fdfc8217857aec --- /dev/null +++ b/node/node_modules/npm/node_modules/util-deprecate/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node/node_modules/npm/node_modules/util-deprecate/browser.js b/node/node_modules/npm/node_modules/util-deprecate/browser.js new file mode 100644 index 0000000000000000000000000000000000000000..7b72ed491496d6047fe3e62b56b3665b39b9ab5c --- /dev/null +++ b/node/node_modules/npm/node_modules/util-deprecate/browser.js @@ -0,0 +1,67 @@ + +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} diff --git a/node/node_modules/npm/node_modules/util-deprecate/node.js b/node/node_modules/npm/node_modules/util-deprecate/node.js new file mode 100644 index 0000000000000000000000000000000000000000..784e314926371055a0e60fb2fad386ee85eaa832 --- /dev/null +++ b/node/node_modules/npm/node_modules/util-deprecate/node.js @@ -0,0 +1,6 @@ + +/** + * For Node.js, simply re-export the core `util.deprecate` function. + */ + +module.exports = require('util').deprecate; diff --git a/node/node_modules/npm/node_modules/util-deprecate/package.json b/node/node_modules/npm/node_modules/util-deprecate/package.json new file mode 100644 index 0000000000000000000000000000000000000000..7e0c4db86439657631047666a3cfb8f39d34d572 --- /dev/null +++ b/node/node_modules/npm/node_modules/util-deprecate/package.json @@ -0,0 +1,27 @@ +{ + "name": "util-deprecate", + "version": "1.0.2", + "description": "The Node.js `util.deprecate()` function with browser support", + "main": "node.js", + "browser": "browser.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/util-deprecate.git" + }, + "keywords": [ + "util", + "deprecate", + "browserify", + "browser", + "node" + ], + "author": "Nathan Rajlich (http://n8.io/)", + "license": "MIT", + "bugs": { + "url": "https://github.com/TooTallNate/util-deprecate/issues" + }, + "homepage": "https://github.com/TooTallNate/util-deprecate" +} diff --git a/node/node_modules/npm/node_modules/validate-npm-package-name/LICENSE b/node/node_modules/npm/node_modules/validate-npm-package-name/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..f10c0e9d324c681a38a1b6b50216d0ee5e5f6e89 --- /dev/null +++ b/node/node_modules/npm/node_modules/validate-npm-package-name/LICENSE @@ -0,0 +1,6 @@ +Copyright (c) 2015, npm, Inc + + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/validate-npm-package-name/lib/builtin-modules.json b/node/node_modules/npm/node_modules/validate-npm-package-name/lib/builtin-modules.json new file mode 100644 index 0000000000000000000000000000000000000000..bb19dfab7d2bbaf0f6023720da83bbf5c19c165e --- /dev/null +++ b/node/node_modules/npm/node_modules/validate-npm-package-name/lib/builtin-modules.json @@ -0,0 +1 @@ +["_http_agent","_http_client","_http_common","_http_incoming","_http_outgoing","_http_server","_stream_duplex","_stream_passthrough","_stream_readable","_stream_transform","_stream_wrap","_stream_writable","_tls_common","_tls_wrap","assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","readline/promises","repl","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib","node:sea","node:sqlite","node:test","node:test/reporters"] diff --git a/node/node_modules/npm/node_modules/validate-npm-package-name/lib/index.js b/node/node_modules/npm/node_modules/validate-npm-package-name/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..368f30ced58aac78a619bd962c3dc5c8878d0eff --- /dev/null +++ b/node/node_modules/npm/node_modules/validate-npm-package-name/lib/index.js @@ -0,0 +1,114 @@ +'use strict' +const builtins = require('./builtin-modules.json') + +var scopedPackagePattern = new RegExp('^(?:@([^/]+?)[/])?([^/]+?)$') +var exclusionList = [ + 'node_modules', + 'favicon.ico', +] + +function validate (name) { + var warnings = [] + var errors = [] + + if (name === null) { + errors.push('name cannot be null') + return done(warnings, errors) + } + + if (name === undefined) { + errors.push('name cannot be undefined') + return done(warnings, errors) + } + + if (typeof name !== 'string') { + errors.push('name must be a string') + return done(warnings, errors) + } + + if (!name.length) { + errors.push('name length must be greater than zero') + } + + if (name.startsWith('.')) { + errors.push('name cannot start with a period') + } + + if (name.startsWith('-')) { + errors.push('name cannot start with a hyphen') + } + + if (name.match(/^_/)) { + errors.push('name cannot start with an underscore') + } + + if (name.trim() !== name) { + errors.push('name cannot contain leading or trailing spaces') + } + + // No funny business + exclusionList.forEach(function (excludedName) { + if (name.toLowerCase() === excludedName) { + errors.push(excludedName + ' is not a valid package name') + } + }) + + // Generate warnings for stuff that used to be allowed + + // core module names like http, events, util, etc + if (builtins.includes(name.toLowerCase())) { + warnings.push(name + ' is a core module name') + } + + if (name.length > 214) { + warnings.push('name can no longer contain more than 214 characters') + } + + // mIxeD CaSe nAMEs + if (name.toLowerCase() !== name) { + warnings.push('name can no longer contain capital letters') + } + + if (/[~'!()*]/.test(name.split('/').slice(-1)[0])) { + warnings.push('name can no longer contain special characters ("~\'!()*")') + } + + if (encodeURIComponent(name) !== name) { + // Maybe it's a scoped package name, like @user/package + var nameMatch = name.match(scopedPackagePattern) + if (nameMatch) { + var user = nameMatch[1] + var pkg = nameMatch[2] + + if (pkg.startsWith('.')) { + errors.push('name cannot start with a period') + } + + if (encodeURIComponent(user) === user && encodeURIComponent(pkg) === pkg) { + return done(warnings, errors) + } + } + + errors.push('name can only contain URL-friendly characters') + } + + return done(warnings, errors) +} + +var done = function (warnings, errors) { + var result = { + validForNewPackages: errors.length === 0 && warnings.length === 0, + validForOldPackages: errors.length === 0, + warnings: warnings, + errors: errors, + } + if (!result.warnings.length) { + delete result.warnings + } + if (!result.errors.length) { + delete result.errors + } + return result +} + +module.exports = validate diff --git a/node/node_modules/npm/node_modules/validate-npm-package-name/package.json b/node/node_modules/npm/node_modules/validate-npm-package-name/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5830a6863b2e5dd0d4243c998b42d6b3490a1aff --- /dev/null +++ b/node/node_modules/npm/node_modules/validate-npm-package-name/package.json @@ -0,0 +1,59 @@ +{ + "name": "validate-npm-package-name", + "version": "7.0.2", + "description": "Give me a string and I'll tell you if it's a valid npm package name", + "main": "lib/", + "directories": { + "test": "test" + }, + "devDependencies": { + "@npmcli/eslint-config": "^6.0.0", + "@npmcli/template-oss": "4.28.1" + }, + "scripts": { + "builtin-fixture": "node -e \"console.log(JSON.stringify(require('node:module').builtinModules))\" > ./lib/builtin-modules.json", + "cov:test": "TAP_FLAGS='--cov' npm run test:code", + "test:code": "tap ${TAP_FLAGS:-'--'} test/*.js", + "test:style": "standard", + "test": "node --test './test/**/*.js'", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "snap": "node --test --test-update-snapshots './test/**/*.js'", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", + "test:node20": "node --test test", + "test:cover": "node --test --experimental-test-coverage --test-timeout=3000 --test-coverage-lines=100 --test-coverage-functions=100 --test-coverage-branches=100 './test/**/*.js'" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/validate-npm-package-name.git" + }, + "keywords": [ + "npm", + "package", + "names", + "validation" + ], + "author": "GitHub Inc.", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/validate-npm-package-name/issues" + }, + "homepage": "https://github.com/npm/validate-npm-package-name", + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.28.1", + "publish": true, + "testRunner": "node:test", + "latestCiVersion": 24 + } +} diff --git a/node/node_modules/npm/node_modules/walk-up-path/LICENSE b/node/node_modules/npm/node_modules/walk-up-path/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..8bf5eab77a25a5ce84843a31bd669cdb8c00a877 --- /dev/null +++ b/node/node_modules/npm/node_modules/walk-up-path/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2020-2023 Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/walk-up-path/dist/commonjs/index.js b/node/node_modules/npm/node_modules/walk-up-path/dist/commonjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..728dcf9de948c9861b34d71693d209e846dfb235 --- /dev/null +++ b/node/node_modules/npm/node_modules/walk-up-path/dist/commonjs/index.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.walkUp = void 0; +const path_1 = require("path"); +const walkUp = function* (path) { + for (path = (0, path_1.resolve)(path); path;) { + yield path; + const pp = (0, path_1.dirname)(path); + if (pp === path) { + break; + } + else { + path = pp; + } + } +}; +exports.walkUp = walkUp; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/walk-up-path/dist/commonjs/package.json b/node/node_modules/npm/node_modules/walk-up-path/dist/commonjs/package.json new file mode 100644 index 0000000000000000000000000000000000000000..140154e8de6e45b8f73020ef9c28c8ce2321bda2 --- /dev/null +++ b/node/node_modules/npm/node_modules/walk-up-path/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node/node_modules/npm/node_modules/walk-up-path/dist/esm/index.js b/node/node_modules/npm/node_modules/walk-up-path/dist/esm/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1460617accf672ed68c3dee1aaa32b5025cdf90e --- /dev/null +++ b/node/node_modules/npm/node_modules/walk-up-path/dist/esm/index.js @@ -0,0 +1,14 @@ +import { dirname, resolve } from 'path'; +export const walkUp = function* (path) { + for (path = resolve(path); path;) { + yield path; + const pp = dirname(path); + if (pp === path) { + break; + } + else { + path = pp; + } + } +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/walk-up-path/dist/esm/package.json b/node/node_modules/npm/node_modules/walk-up-path/dist/esm/package.json new file mode 100644 index 0000000000000000000000000000000000000000..916833506f3f5b4f805b8ff70692019bf0910884 --- /dev/null +++ b/node/node_modules/npm/node_modules/walk-up-path/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node/node_modules/npm/node_modules/walk-up-path/package.json b/node/node_modules/npm/node_modules/walk-up-path/package.json new file mode 100644 index 0000000000000000000000000000000000000000..f6ebb9d801b9ecc910328bf81ee3b065ad85c136 --- /dev/null +++ b/node/node_modules/npm/node_modules/walk-up-path/package.json @@ -0,0 +1,71 @@ +{ + "name": "walk-up-path", + "version": "4.0.0", + "files": [ + "dist" + ], + "description": "Given a path string, return a generator that walks up the path, emitting each dirname.", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/walk-up-path" + }, + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write . --log-level warn", + "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts" + }, + "prettier": { + "experimentalTernaries": true, + "semi": false, + "printWidth": 75, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "devDependencies": { + "@types/node": "^20.14.10", + "prettier": "^3.3.2", + "tap": "^20.0.3", + "tshy": "^3.0.0", + "typedoc": "^0.26.3" + }, + "type": "module", + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js", + "engines": { + "node": "20 || >=22" + } +} diff --git a/node/node_modules/npm/node_modules/which/LICENSE b/node/node_modules/npm/node_modules/which/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..32eb517086ebb24cfe3dd076033211d444186dc9 --- /dev/null +++ b/node/node_modules/npm/node_modules/which/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/which/README.md b/node/node_modules/npm/node_modules/which/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9e97c6aaaede20adc5fe50154577537918900048 --- /dev/null +++ b/node/node_modules/npm/node_modules/which/README.md @@ -0,0 +1,51 @@ +# which + +Like the unix `which` utility. + +Finds the first instance of a specified executable in the PATH +environment variable. Does not cache the results, so `hash -r` is not +needed when the PATH changes. + +## USAGE + +```javascript +const which = require('which') + +// async usage +// rejects if not found +const resolved = await which('node') + +// if nothrow option is used, returns null if not found +const resolvedOrNull = await which('node', { nothrow: true }) + +// sync usage +// throws if not found +const resolved = which.sync('node') + +// if nothrow option is used, returns null if not found +const resolvedOrNull = which.sync('node', { nothrow: true }) + +// Pass options to override the PATH and PATHEXT environment vars. +await which('node', { path: someOtherPath, pathExt: somePathExt }) +``` + +## CLI USAGE + +Just like the BSD `which(1)` binary but using `node-which`. + +``` +usage: node-which [-as] program ... +``` + +You can learn more about why the binary is `node-which` and not `which` +[here](https://github.com/npm/node-which/pull/67) + +## OPTIONS + +You may pass an options object as the second argument. + +- `path`: Use instead of the `PATH` environment variable. +- `pathExt`: Use instead of the `PATHEXT` environment variable. +- `all`: Return all matches, instead of just the first one. Note that + this means the function returns an array of strings instead of a + single string. diff --git a/node/node_modules/npm/node_modules/which/bin/which.js b/node/node_modules/npm/node_modules/which/bin/which.js new file mode 100644 index 0000000000000000000000000000000000000000..d10dd0a1e31020b3e3636abac76253c33370048a --- /dev/null +++ b/node/node_modules/npm/node_modules/which/bin/which.js @@ -0,0 +1,52 @@ +#!/usr/bin/env node + +const which = require('../lib') +const argv = process.argv.slice(2) + +const usage = (err) => { + if (err) { + console.error(`which: ${err}`) + } + console.error('usage: which [-as] program ...') + process.exit(1) +} + +if (!argv.length) { + return usage() +} + +let dashdash = false +const [commands, flags] = argv.reduce((acc, arg) => { + if (dashdash || arg === '--') { + dashdash = true + return acc + } + + if (!/^-/.test(arg)) { + acc[0].push(arg) + return acc + } + + for (const flag of arg.slice(1).split('')) { + if (flag === 's') { + acc[1].silent = true + } else if (flag === 'a') { + acc[1].all = true + } else { + usage(`illegal option -- ${flag}`) + } + } + + return acc +}, [[], {}]) + +for (const command of commands) { + try { + const res = which.sync(command, { all: flags.all }) + if (!flags.silent) { + console.log([].concat(res).join('\n')) + } + } catch (err) { + process.exitCode = 1 + } +} diff --git a/node/node_modules/npm/node_modules/which/lib/index.js b/node/node_modules/npm/node_modules/which/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a5c866ecb6553f2685ebf32df48942b4a64df0e3 --- /dev/null +++ b/node/node_modules/npm/node_modules/which/lib/index.js @@ -0,0 +1,111 @@ +const { isexe, sync: isexeSync } = require('isexe') +const { join, delimiter, sep, posix } = require('path') + +const isWindows = process.platform === 'win32' + +// used to check for slashed in commands passed in. always checks for the posix +// seperator on all platforms, and checks for the current separator when not on +// a posix platform. don't use the isWindows check for this since that is mocked +// in tests but we still need the code to actually work when called. that is also +// why it is ignored from coverage. +/* istanbul ignore next */ +const rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? '' : sep}]`.replace(/(\\)/g, '\\$1')) +const rRel = new RegExp(`^\\.${rSlash.source}`) + +const getNotFoundError = (cmd) => + Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' }) + +const getPathInfo = (cmd, { + path: optPath = process.env.PATH, + pathExt: optPathExt = process.env.PATHEXT, + delimiter: optDelimiter = delimiter, +}) => { + // If it has a slash, then we don't bother searching the pathenv. + // just check the file itself, and that's it. + const pathEnv = cmd.match(rSlash) ? [''] : [ + // windows always checks the cwd first + ...(isWindows ? [process.cwd()] : []), + ...(optPath || /* istanbul ignore next: very unusual */ '').split(optDelimiter), + ] + + if (isWindows) { + const pathExtExe = optPathExt || + ['.EXE', '.CMD', '.BAT', '.COM'].join(optDelimiter) + const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()]) + if (cmd.includes('.') && pathExt[0] !== '') { + pathExt.unshift('') + } + return { pathEnv, pathExt, pathExtExe } + } + + return { pathEnv, pathExt: [''] } +} + +const getPathPart = (raw, cmd) => { + const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw + const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : '' + return prefix + join(pathPart, cmd) +} + +const which = async (cmd, opt = {}) => { + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) + const found = [] + + for (const envPart of pathEnv) { + const p = getPathPart(envPart, cmd) + + for (const ext of pathExt) { + const withExt = p + ext + const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true }) + if (is) { + if (!opt.all) { + return withExt + } + found.push(withExt) + } + } + } + + if (opt.all && found.length) { + return found + } + + if (opt.nothrow) { + return null + } + + throw getNotFoundError(cmd) +} + +const whichSync = (cmd, opt = {}) => { + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) + const found = [] + + for (const pathEnvPart of pathEnv) { + const p = getPathPart(pathEnvPart, cmd) + + for (const ext of pathExt) { + const withExt = p + ext + const is = isexeSync(withExt, { pathExt: pathExtExe, ignoreErrors: true }) + if (is) { + if (!opt.all) { + return withExt + } + found.push(withExt) + } + } + } + + if (opt.all && found.length) { + return found + } + + if (opt.nothrow) { + return null + } + + throw getNotFoundError(cmd) +} + +module.exports = which +which.sync = whichSync diff --git a/node/node_modules/npm/node_modules/which/package.json b/node/node_modules/npm/node_modules/which/package.json new file mode 100644 index 0000000000000000000000000000000000000000..a00b3d7e2f9f100cb3356dcc5279c26719c7733d --- /dev/null +++ b/node/node_modules/npm/node_modules/which/package.json @@ -0,0 +1,52 @@ +{ + "author": "GitHub Inc.", + "name": "which", + "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", + "version": "6.0.1", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/node-which.git" + }, + "main": "lib/index.js", + "bin": { + "node-which": "./bin/which.js" + }, + "license": "ISC", + "dependencies": { + "isexe": "^4.0.0" + }, + "devDependencies": { + "@npmcli/eslint-config": "^6.0.0", + "@npmcli/template-oss": "4.28.1", + "tap": "^16.3.0" + }, + "scripts": { + "test": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "files": [ + "bin/", + "lib/" + ], + "tap": { + "check-coverage": true, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.28.1", + "publish": "true" + } +} diff --git a/node/node_modules/npm/node_modules/write-file-atomic/LICENSE.md b/node/node_modules/npm/node_modules/write-file-atomic/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..2dcb803e6af06e508f80a8aadf5c33c7cf0849e7 --- /dev/null +++ b/node/node_modules/npm/node_modules/write-file-atomic/LICENSE.md @@ -0,0 +1,5 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node/node_modules/npm/node_modules/write-file-atomic/lib/index.js b/node/node_modules/npm/node_modules/write-file-atomic/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4aa19cd43a0ea27ec2e7d376afff3c5a43390b48 --- /dev/null +++ b/node/node_modules/npm/node_modules/write-file-atomic/lib/index.js @@ -0,0 +1,269 @@ +'use strict' +module.exports = writeFile +module.exports.sync = writeFileSync +module.exports._getTmpname = getTmpname // for testing +module.exports._cleanupOnExit = cleanupOnExit + +const fs = require('fs') +const crypto = require('node:crypto') +const { onExit } = require('signal-exit') +const path = require('path') +const { promisify } = require('util') +const activeFiles = {} + +// if we run inside of a worker_thread, `process.pid` is not unique +/* istanbul ignore next */ +const threadId = (function getId () { + try { + const workerThreads = require('worker_threads') + + /// if we are in main thread, this is set to `0` + return workerThreads.threadId + } catch (e) { + // worker_threads are not available, fallback to 0 + return 0 + } +})() + +let invocations = 0 +function getTmpname (filename) { + return filename + '.' + + crypto.createHash('sha1') + .update(__filename) + .update(String(process.pid)) + .update(String(threadId)) + .update(String(++invocations)) + .digest() + .readUInt32BE(0) +} + +function cleanupOnExit (tmpfile) { + return () => { + try { + fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile) + } catch { + // ignore errors + } + } +} + +function serializeActiveFile (absoluteName) { + return new Promise(resolve => { + // make a queue if it doesn't already exist + if (!activeFiles[absoluteName]) { + activeFiles[absoluteName] = [] + } + + activeFiles[absoluteName].push(resolve) // add this job to the queue + if (activeFiles[absoluteName].length === 1) { + resolve() + } // kick off the first one + }) +} + +// https://github.com/isaacs/node-graceful-fs/blob/master/polyfills.js#L315-L342 +function isChownErrOk (err) { + if (err.code === 'ENOSYS') { + return true + } + + const nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (err.code === 'EINVAL' || err.code === 'EPERM') { + return true + } + } + + return false +} + +async function writeFileAsync (filename, data, options = {}) { + if (typeof options === 'string') { + options = { encoding: options } + } + + let fd + let tmpfile + /* istanbul ignore next -- The closure only gets called when onExit triggers */ + const removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)) + const absoluteName = path.resolve(filename) + + try { + await serializeActiveFile(absoluteName) + const truename = await promisify(fs.realpath)(filename).catch(() => filename) + tmpfile = getTmpname(truename) + + if (!options.mode || !options.chown) { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + const stats = await promisify(fs.stat)(truename).catch(() => {}) + if (stats) { + if (options.mode == null) { + options.mode = stats.mode + } + + if (options.chown == null && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } + } + } + + fd = await promisify(fs.open)(tmpfile, 'w', options.mode) + if (options.tmpfileCreated) { + await options.tmpfileCreated(tmpfile) + } + if (ArrayBuffer.isView(data)) { + await promisify(fs.write)(fd, data, 0, data.length, 0) + } else if (data != null) { + await promisify(fs.write)(fd, String(data), 0, String(options.encoding || 'utf8')) + } + + if (options.fsync !== false) { + await promisify(fs.fsync)(fd) + } + + await promisify(fs.close)(fd) + fd = null + + if (options.chown) { + await promisify(fs.chown)(tmpfile, options.chown.uid, options.chown.gid).catch(err => { + if (!isChownErrOk(err)) { + throw err + } + }) + } + + if (options.mode) { + await promisify(fs.chmod)(tmpfile, options.mode).catch(err => { + if (!isChownErrOk(err)) { + throw err + } + }) + } + + await promisify(fs.rename)(tmpfile, truename) + } finally { + if (fd) { + await promisify(fs.close)(fd).catch( + /* istanbul ignore next */ + () => {} + ) + } + removeOnExitHandler() + await promisify(fs.unlink)(tmpfile).catch(() => {}) + activeFiles[absoluteName].shift() // remove the element added by serializeSameFile + if (activeFiles[absoluteName].length > 0) { + activeFiles[absoluteName][0]() // start next job if one is pending + } else { + delete activeFiles[absoluteName] + } + } +} + +async function writeFile (filename, data, options, callback) { + if (options instanceof Function) { + callback = options + options = {} + } + + const promise = writeFileAsync(filename, data, options) + if (callback) { + try { + const result = await promise + return callback(result) + } catch (err) { + return callback(err) + } + } + + return promise +} + +function writeFileSync (filename, data, options) { + if (typeof options === 'string') { + options = { encoding: options } + } else if (!options) { + options = {} + } + try { + filename = fs.realpathSync(filename) + } catch (ex) { + // it's ok, it'll happen on a not yet existing file + } + const tmpfile = getTmpname(filename) + + if (!options.mode || !options.chown) { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + try { + const stats = fs.statSync(filename) + options = Object.assign({}, options) + if (!options.mode) { + options.mode = stats.mode + } + if (!options.chown && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } + } catch (ex) { + // ignore stat errors + } + } + + let fd + const cleanup = cleanupOnExit(tmpfile) + const removeOnExitHandler = onExit(cleanup) + + let threw = true + try { + fd = fs.openSync(tmpfile, 'w', options.mode || 0o666) + if (options.tmpfileCreated) { + options.tmpfileCreated(tmpfile) + } + if (ArrayBuffer.isView(data)) { + fs.writeSync(fd, data, 0, data.length, 0) + } else if (data != null) { + fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8')) + } + if (options.fsync !== false) { + fs.fsyncSync(fd) + } + + fs.closeSync(fd) + fd = null + + if (options.chown) { + try { + fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) + } catch (err) { + if (!isChownErrOk(err)) { + throw err + } + } + } + + if (options.mode) { + try { + fs.chmodSync(tmpfile, options.mode) + } catch (err) { + if (!isChownErrOk(err)) { + throw err + } + } + } + + fs.renameSync(tmpfile, filename) + threw = false + } finally { + if (fd) { + try { + fs.closeSync(fd) + } catch (ex) { + // ignore close errors at this stage, error may have closed fd already. + } + } + removeOnExitHandler() + if (threw) { + cleanup() + } + } +} diff --git a/node/node_modules/npm/node_modules/write-file-atomic/package.json b/node/node_modules/npm/node_modules/write-file-atomic/package.json new file mode 100644 index 0000000000000000000000000000000000000000..e41b2a40c212a1c780faa6bc955c871e9cc07da9 --- /dev/null +++ b/node/node_modules/npm/node_modules/write-file-atomic/package.json @@ -0,0 +1,57 @@ +{ + "name": "write-file-atomic", + "version": "7.0.1", + "description": "Write files in an atomic fashion w/configurable ownership", + "main": "./lib/index.js", + "scripts": { + "test": "tap", + "posttest": "npm run lint", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/write-file-atomic.git" + }, + "keywords": [ + "writeFile", + "atomic" + ], + "author": "GitHub Inc.", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/write-file-atomic/issues" + }, + "homepage": "https://github.com/npm/write-file-atomic", + "dependencies": { + "signal-exit": "^4.0.1" + }, + "devDependencies": { + "@npmcli/eslint-config": "^6.0.0", + "@npmcli/template-oss": "4.28.1", + "tap": "^16.0.1" + }, + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "windowsCI": false, + "version": "4.28.1", + "publish": "true" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node/node_modules/npm/node_modules/yallist/LICENSE.md b/node/node_modules/npm/node_modules/yallist/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..d4082d06dd2530afb592b94ccbaa7ae6cd7091e4 --- /dev/null +++ b/node/node_modules/npm/node_modules/yallist/LICENSE.md @@ -0,0 +1,63 @@ +All packages under `src/` are licensed according to the terms in +their respective `LICENSE` or `LICENSE.md` files. + +The remainder of this project is licensed under the Blue Oak +Model License, as follows: + +----- + +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** diff --git a/node/node_modules/npm/node_modules/yallist/dist/commonjs/index.js b/node/node_modules/npm/node_modules/yallist/dist/commonjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1e65fe60e1c1ebb712c6fe1566095d9914dab52a --- /dev/null +++ b/node/node_modules/npm/node_modules/yallist/dist/commonjs/index.js @@ -0,0 +1,384 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Node = exports.Yallist = void 0; +class Yallist { + tail; + head; + length = 0; + static create(list = []) { + return new Yallist(list); + } + constructor(list = []) { + for (const item of list) { + this.push(item); + } + } + *[Symbol.iterator]() { + for (let walker = this.head; walker; walker = walker.next) { + yield walker.value; + } + } + removeNode(node) { + if (node.list !== this) { + throw new Error('removing node which does not belong to this list'); + } + const next = node.next; + const prev = node.prev; + if (next) { + next.prev = prev; + } + if (prev) { + prev.next = next; + } + if (node === this.head) { + this.head = next; + } + if (node === this.tail) { + this.tail = prev; + } + this.length--; + node.next = undefined; + node.prev = undefined; + node.list = undefined; + return next; + } + unshiftNode(node) { + if (node === this.head) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + const head = this.head; + node.list = this; + node.next = head; + if (head) { + head.prev = node; + } + this.head = node; + if (!this.tail) { + this.tail = node; + } + this.length++; + } + pushNode(node) { + if (node === this.tail) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + const tail = this.tail; + node.list = this; + node.prev = tail; + if (tail) { + tail.next = node; + } + this.tail = node; + if (!this.head) { + this.head = node; + } + this.length++; + } + push(...args) { + for (let i = 0, l = args.length; i < l; i++) { + push(this, args[i]); + } + return this.length; + } + unshift(...args) { + for (var i = 0, l = args.length; i < l; i++) { + unshift(this, args[i]); + } + return this.length; + } + pop() { + if (!this.tail) { + return undefined; + } + const res = this.tail.value; + const t = this.tail; + this.tail = this.tail.prev; + if (this.tail) { + this.tail.next = undefined; + } + else { + this.head = undefined; + } + t.list = undefined; + this.length--; + return res; + } + shift() { + if (!this.head) { + return undefined; + } + const res = this.head.value; + const h = this.head; + this.head = this.head.next; + if (this.head) { + this.head.prev = undefined; + } + else { + this.tail = undefined; + } + h.list = undefined; + this.length--; + return res; + } + forEach(fn, thisp) { + thisp = thisp || this; + for (let walker = this.head, i = 0; !!walker; i++) { + fn.call(thisp, walker.value, i, this); + walker = walker.next; + } + } + forEachReverse(fn, thisp) { + thisp = thisp || this; + for (let walker = this.tail, i = this.length - 1; !!walker; i--) { + fn.call(thisp, walker.value, i, this); + walker = walker.prev; + } + } + get(n) { + let i = 0; + let walker = this.head; + for (; !!walker && i < n; i++) { + walker = walker.next; + } + if (i === n && !!walker) { + return walker.value; + } + } + getReverse(n) { + let i = 0; + let walker = this.tail; + for (; !!walker && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.prev; + } + if (i === n && !!walker) { + return walker.value; + } + } + map(fn, thisp) { + thisp = thisp || this; + const res = new Yallist(); + for (let walker = this.head; !!walker;) { + res.push(fn.call(thisp, walker.value, this)); + walker = walker.next; + } + return res; + } + mapReverse(fn, thisp) { + thisp = thisp || this; + var res = new Yallist(); + for (let walker = this.tail; !!walker;) { + res.push(fn.call(thisp, walker.value, this)); + walker = walker.prev; + } + return res; + } + reduce(fn, initial) { + let acc; + let walker = this.head; + if (arguments.length > 1) { + acc = initial; + } + else if (this.head) { + walker = this.head.next; + acc = this.head.value; + } + else { + throw new TypeError('Reduce of empty list with no initial value'); + } + for (var i = 0; !!walker; i++) { + acc = fn(acc, walker.value, i); + walker = walker.next; + } + return acc; + } + reduceReverse(fn, initial) { + let acc; + let walker = this.tail; + if (arguments.length > 1) { + acc = initial; + } + else if (this.tail) { + walker = this.tail.prev; + acc = this.tail.value; + } + else { + throw new TypeError('Reduce of empty list with no initial value'); + } + for (let i = this.length - 1; !!walker; i--) { + acc = fn(acc, walker.value, i); + walker = walker.prev; + } + return acc; + } + toArray() { + const arr = new Array(this.length); + for (let i = 0, walker = this.head; !!walker; i++) { + arr[i] = walker.value; + walker = walker.next; + } + return arr; + } + toArrayReverse() { + const arr = new Array(this.length); + for (let i = 0, walker = this.tail; !!walker; i++) { + arr[i] = walker.value; + walker = walker.prev; + } + return arr; + } + slice(from = 0, to = this.length) { + if (to < 0) { + to += this.length; + } + if (from < 0) { + from += this.length; + } + const ret = new Yallist(); + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + let walker = this.head; + let i = 0; + for (i = 0; !!walker && i < from; i++) { + walker = walker.next; + } + for (; !!walker && i < to; i++, walker = walker.next) { + ret.push(walker.value); + } + return ret; + } + sliceReverse(from = 0, to = this.length) { + if (to < 0) { + to += this.length; + } + if (from < 0) { + from += this.length; + } + const ret = new Yallist(); + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + let i = this.length; + let walker = this.tail; + for (; !!walker && i > to; i--) { + walker = walker.prev; + } + for (; !!walker && i > from; i--, walker = walker.prev) { + ret.push(walker.value); + } + return ret; + } + splice(start, deleteCount = 0, ...nodes) { + if (start > this.length) { + start = this.length - 1; + } + if (start < 0) { + start = this.length + start; + } + let walker = this.head; + for (let i = 0; !!walker && i < start; i++) { + walker = walker.next; + } + const ret = []; + for (let i = 0; !!walker && i < deleteCount; i++) { + ret.push(walker.value); + walker = this.removeNode(walker); + } + if (!walker) { + walker = this.tail; + } + else if (walker !== this.tail) { + walker = walker.prev; + } + for (const v of nodes) { + walker = insertAfter(this, walker, v); + } + return ret; + } + reverse() { + const head = this.head; + const tail = this.tail; + for (let walker = head; !!walker; walker = walker.prev) { + const p = walker.prev; + walker.prev = walker.next; + walker.next = p; + } + this.head = tail; + this.tail = head; + return this; + } +} +exports.Yallist = Yallist; +// insertAfter undefined means "make the node the new head of list" +function insertAfter(self, node, value) { + const prev = node; + const next = node ? node.next : self.head; + const inserted = new Node(value, prev, next, self); + if (inserted.next === undefined) { + self.tail = inserted; + } + if (inserted.prev === undefined) { + self.head = inserted; + } + self.length++; + return inserted; +} +function push(self, item) { + self.tail = new Node(item, self.tail, undefined, self); + if (!self.head) { + self.head = self.tail; + } + self.length++; +} +function unshift(self, item) { + self.head = new Node(item, undefined, self.head, self); + if (!self.tail) { + self.tail = self.head; + } + self.length++; +} +class Node { + list; + next; + prev; + value; + constructor(value, prev, next, list) { + this.list = list; + this.value = value; + if (prev) { + prev.next = this; + this.prev = prev; + } + else { + this.prev = undefined; + } + if (next) { + next.prev = this; + this.next = next; + } + else { + this.next = undefined; + } + } +} +exports.Node = Node; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/yallist/dist/commonjs/package.json b/node/node_modules/npm/node_modules/yallist/dist/commonjs/package.json new file mode 100644 index 0000000000000000000000000000000000000000..140154e8de6e45b8f73020ef9c28c8ce2321bda2 --- /dev/null +++ b/node/node_modules/npm/node_modules/yallist/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node/node_modules/npm/node_modules/yallist/dist/esm/index.js b/node/node_modules/npm/node_modules/yallist/dist/esm/index.js new file mode 100644 index 0000000000000000000000000000000000000000..09327626fed2c982afdbb7aff9d2a9d3029fc091 --- /dev/null +++ b/node/node_modules/npm/node_modules/yallist/dist/esm/index.js @@ -0,0 +1,379 @@ +export class Yallist { + tail; + head; + length = 0; + static create(list = []) { + return new Yallist(list); + } + constructor(list = []) { + for (const item of list) { + this.push(item); + } + } + *[Symbol.iterator]() { + for (let walker = this.head; walker; walker = walker.next) { + yield walker.value; + } + } + removeNode(node) { + if (node.list !== this) { + throw new Error('removing node which does not belong to this list'); + } + const next = node.next; + const prev = node.prev; + if (next) { + next.prev = prev; + } + if (prev) { + prev.next = next; + } + if (node === this.head) { + this.head = next; + } + if (node === this.tail) { + this.tail = prev; + } + this.length--; + node.next = undefined; + node.prev = undefined; + node.list = undefined; + return next; + } + unshiftNode(node) { + if (node === this.head) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + const head = this.head; + node.list = this; + node.next = head; + if (head) { + head.prev = node; + } + this.head = node; + if (!this.tail) { + this.tail = node; + } + this.length++; + } + pushNode(node) { + if (node === this.tail) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + const tail = this.tail; + node.list = this; + node.prev = tail; + if (tail) { + tail.next = node; + } + this.tail = node; + if (!this.head) { + this.head = node; + } + this.length++; + } + push(...args) { + for (let i = 0, l = args.length; i < l; i++) { + push(this, args[i]); + } + return this.length; + } + unshift(...args) { + for (var i = 0, l = args.length; i < l; i++) { + unshift(this, args[i]); + } + return this.length; + } + pop() { + if (!this.tail) { + return undefined; + } + const res = this.tail.value; + const t = this.tail; + this.tail = this.tail.prev; + if (this.tail) { + this.tail.next = undefined; + } + else { + this.head = undefined; + } + t.list = undefined; + this.length--; + return res; + } + shift() { + if (!this.head) { + return undefined; + } + const res = this.head.value; + const h = this.head; + this.head = this.head.next; + if (this.head) { + this.head.prev = undefined; + } + else { + this.tail = undefined; + } + h.list = undefined; + this.length--; + return res; + } + forEach(fn, thisp) { + thisp = thisp || this; + for (let walker = this.head, i = 0; !!walker; i++) { + fn.call(thisp, walker.value, i, this); + walker = walker.next; + } + } + forEachReverse(fn, thisp) { + thisp = thisp || this; + for (let walker = this.tail, i = this.length - 1; !!walker; i--) { + fn.call(thisp, walker.value, i, this); + walker = walker.prev; + } + } + get(n) { + let i = 0; + let walker = this.head; + for (; !!walker && i < n; i++) { + walker = walker.next; + } + if (i === n && !!walker) { + return walker.value; + } + } + getReverse(n) { + let i = 0; + let walker = this.tail; + for (; !!walker && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.prev; + } + if (i === n && !!walker) { + return walker.value; + } + } + map(fn, thisp) { + thisp = thisp || this; + const res = new Yallist(); + for (let walker = this.head; !!walker;) { + res.push(fn.call(thisp, walker.value, this)); + walker = walker.next; + } + return res; + } + mapReverse(fn, thisp) { + thisp = thisp || this; + var res = new Yallist(); + for (let walker = this.tail; !!walker;) { + res.push(fn.call(thisp, walker.value, this)); + walker = walker.prev; + } + return res; + } + reduce(fn, initial) { + let acc; + let walker = this.head; + if (arguments.length > 1) { + acc = initial; + } + else if (this.head) { + walker = this.head.next; + acc = this.head.value; + } + else { + throw new TypeError('Reduce of empty list with no initial value'); + } + for (var i = 0; !!walker; i++) { + acc = fn(acc, walker.value, i); + walker = walker.next; + } + return acc; + } + reduceReverse(fn, initial) { + let acc; + let walker = this.tail; + if (arguments.length > 1) { + acc = initial; + } + else if (this.tail) { + walker = this.tail.prev; + acc = this.tail.value; + } + else { + throw new TypeError('Reduce of empty list with no initial value'); + } + for (let i = this.length - 1; !!walker; i--) { + acc = fn(acc, walker.value, i); + walker = walker.prev; + } + return acc; + } + toArray() { + const arr = new Array(this.length); + for (let i = 0, walker = this.head; !!walker; i++) { + arr[i] = walker.value; + walker = walker.next; + } + return arr; + } + toArrayReverse() { + const arr = new Array(this.length); + for (let i = 0, walker = this.tail; !!walker; i++) { + arr[i] = walker.value; + walker = walker.prev; + } + return arr; + } + slice(from = 0, to = this.length) { + if (to < 0) { + to += this.length; + } + if (from < 0) { + from += this.length; + } + const ret = new Yallist(); + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + let walker = this.head; + let i = 0; + for (i = 0; !!walker && i < from; i++) { + walker = walker.next; + } + for (; !!walker && i < to; i++, walker = walker.next) { + ret.push(walker.value); + } + return ret; + } + sliceReverse(from = 0, to = this.length) { + if (to < 0) { + to += this.length; + } + if (from < 0) { + from += this.length; + } + const ret = new Yallist(); + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + let i = this.length; + let walker = this.tail; + for (; !!walker && i > to; i--) { + walker = walker.prev; + } + for (; !!walker && i > from; i--, walker = walker.prev) { + ret.push(walker.value); + } + return ret; + } + splice(start, deleteCount = 0, ...nodes) { + if (start > this.length) { + start = this.length - 1; + } + if (start < 0) { + start = this.length + start; + } + let walker = this.head; + for (let i = 0; !!walker && i < start; i++) { + walker = walker.next; + } + const ret = []; + for (let i = 0; !!walker && i < deleteCount; i++) { + ret.push(walker.value); + walker = this.removeNode(walker); + } + if (!walker) { + walker = this.tail; + } + else if (walker !== this.tail) { + walker = walker.prev; + } + for (const v of nodes) { + walker = insertAfter(this, walker, v); + } + return ret; + } + reverse() { + const head = this.head; + const tail = this.tail; + for (let walker = head; !!walker; walker = walker.prev) { + const p = walker.prev; + walker.prev = walker.next; + walker.next = p; + } + this.head = tail; + this.tail = head; + return this; + } +} +// insertAfter undefined means "make the node the new head of list" +function insertAfter(self, node, value) { + const prev = node; + const next = node ? node.next : self.head; + const inserted = new Node(value, prev, next, self); + if (inserted.next === undefined) { + self.tail = inserted; + } + if (inserted.prev === undefined) { + self.head = inserted; + } + self.length++; + return inserted; +} +function push(self, item) { + self.tail = new Node(item, self.tail, undefined, self); + if (!self.head) { + self.head = self.tail; + } + self.length++; +} +function unshift(self, item) { + self.head = new Node(item, undefined, self.head, self); + if (!self.tail) { + self.tail = self.head; + } + self.length++; +} +export class Node { + list; + next; + prev; + value; + constructor(value, prev, next, list) { + this.list = list; + this.value = value; + if (prev) { + prev.next = this; + this.prev = prev; + } + else { + this.prev = undefined; + } + if (next) { + next.prev = this; + this.next = next; + } + else { + this.next = undefined; + } + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node/node_modules/npm/node_modules/yallist/dist/esm/package.json b/node/node_modules/npm/node_modules/yallist/dist/esm/package.json new file mode 100644 index 0000000000000000000000000000000000000000..916833506f3f5b4f805b8ff70692019bf0910884 --- /dev/null +++ b/node/node_modules/npm/node_modules/yallist/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node/node_modules/npm/node_modules/yallist/package.json b/node/node_modules/npm/node_modules/yallist/package.json new file mode 100644 index 0000000000000000000000000000000000000000..242319ebba48a41907c463cd0ad14344bbd59a85 --- /dev/null +++ b/node/node_modules/npm/node_modules/yallist/package.json @@ -0,0 +1,68 @@ +{ + "name": "yallist", + "version": "5.0.0", + "description": "Yet Another Linked List", + "files": [ + "dist" + ], + "devDependencies": { + "prettier": "^3.2.5", + "tap": "^18.7.2", + "tshy": "^1.13.1", + "typedoc": "^0.25.13" + }, + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write . --loglevel warn --ignore-path ../../.prettierignore --cache", + "typedoc": "typedoc" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/yallist.git" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "BlueOak-1.0.0", + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "type": "module", + "prettier": { + "semi": false, + "printWidth": 70, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "engines": { + "node": ">=18" + } +} diff --git a/node/node_modules/npm/package.json b/node/node_modules/npm/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9d916d85526a767c55512b552f3fbf357c7e4c93 --- /dev/null +++ b/node/node_modules/npm/package.json @@ -0,0 +1,259 @@ +{ + "version": "11.13.0", + "name": "npm", + "description": "a package manager for JavaScript", + "workspaces": [ + "docs", + "smoke-tests", + "mock-globals", + "mock-registry", + "workspaces/*" + ], + "files": [ + "bin/", + "lib/", + "index.js", + "docs/content/", + "docs/output/", + "man/" + ], + "keywords": [ + "install", + "modules", + "package manager", + "package.json" + ], + "homepage": "https://docs.npmjs.com/", + "author": "GitHub Inc.", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cli.git" + }, + "bugs": { + "url": "https://github.com/npm/cli/issues" + }, + "directories": { + "doc": "./doc", + "man": "./man" + }, + "main": "./index.js", + "bin": { + "npm": "bin/npm-cli.js", + "npx": "bin/npx-cli.js" + }, + "exports": { + ".": [ + { + "default": "./index.js" + }, + "./index.js" + ], + "./package.json": "./package.json" + }, + "dependencies": { + "@isaacs/string-locale-compare": "^1.1.0", + "@npmcli/arborist": "^9.4.3", + "@npmcli/config": "^10.8.1", + "@npmcli/fs": "^5.0.0", + "@npmcli/map-workspaces": "^5.0.3", + "@npmcli/metavuln-calculator": "^9.0.3", + "@npmcli/package-json": "^7.0.5", + "@npmcli/promise-spawn": "^9.0.1", + "@npmcli/redact": "^4.0.0", + "@npmcli/run-script": "^10.0.4", + "@sigstore/tuf": "^4.0.2", + "abbrev": "^4.0.0", + "archy": "~1.0.0", + "cacache": "^20.0.4", + "chalk": "^5.6.2", + "ci-info": "^4.4.0", + "fastest-levenshtein": "^1.0.16", + "fs-minipass": "^3.0.3", + "glob": "^13.0.6", + "graceful-fs": "^4.2.11", + "hosted-git-info": "^9.0.2", + "ini": "^6.0.0", + "init-package-json": "^8.2.5", + "is-cidr": "^6.0.4", + "json-parse-even-better-errors": "^5.0.0", + "libnpmaccess": "^10.0.3", + "libnpmdiff": "^8.1.6", + "libnpmexec": "^10.2.6", + "libnpmfund": "^7.0.20", + "libnpmorg": "^8.0.1", + "libnpmpack": "^9.1.6", + "libnpmpublish": "^11.1.3", + "libnpmsearch": "^9.0.1", + "libnpmteam": "^8.0.2", + "libnpmversion": "^8.0.3", + "make-fetch-happen": "^15.0.5", + "minimatch": "^10.2.5", + "minipass": "^7.1.3", + "minipass-pipeline": "^1.2.4", + "ms": "^2.1.2", + "node-gyp": "^12.3.0", + "nopt": "^9.0.0", + "npm-audit-report": "^7.0.0", + "npm-install-checks": "^8.0.0", + "npm-package-arg": "^13.0.2", + "npm-pick-manifest": "^11.0.3", + "npm-profile": "^12.0.1", + "npm-registry-fetch": "^19.1.1", + "npm-user-validate": "^4.0.0", + "p-map": "^7.0.4", + "pacote": "^21.5.0", + "parse-conflict-json": "^5.0.1", + "proc-log": "^6.1.0", + "qrcode-terminal": "^0.12.0", + "read": "^5.0.1", + "semver": "^7.7.4", + "spdx-expression-parse": "^4.0.0", + "ssri": "^13.0.1", + "supports-color": "^10.2.2", + "tar": "^7.5.13", + "text-table": "~0.2.0", + "tiny-relative-date": "^2.0.2", + "treeverse": "^3.0.0", + "validate-npm-package-name": "^7.0.2", + "which": "^6.0.1" + }, + "bundleDependencies": [ + "@isaacs/string-locale-compare", + "@npmcli/arborist", + "@npmcli/config", + "@npmcli/fs", + "@npmcli/map-workspaces", + "@npmcli/metavuln-calculator", + "@npmcli/package-json", + "@npmcli/promise-spawn", + "@npmcli/redact", + "@npmcli/run-script", + "@sigstore/tuf", + "abbrev", + "archy", + "cacache", + "chalk", + "ci-info", + "fastest-levenshtein", + "fs-minipass", + "glob", + "graceful-fs", + "hosted-git-info", + "ini", + "init-package-json", + "is-cidr", + "json-parse-even-better-errors", + "libnpmaccess", + "libnpmdiff", + "libnpmexec", + "libnpmfund", + "libnpmorg", + "libnpmpack", + "libnpmpublish", + "libnpmsearch", + "libnpmteam", + "libnpmversion", + "make-fetch-happen", + "minimatch", + "minipass", + "minipass-pipeline", + "ms", + "node-gyp", + "nopt", + "npm-audit-report", + "npm-install-checks", + "npm-package-arg", + "npm-pick-manifest", + "npm-profile", + "npm-registry-fetch", + "npm-user-validate", + "p-map", + "pacote", + "parse-conflict-json", + "proc-log", + "qrcode-terminal", + "read", + "semver", + "spdx-expression-parse", + "ssri", + "supports-color", + "tar", + "text-table", + "tiny-relative-date", + "treeverse", + "validate-npm-package-name", + "which" + ], + "devDependencies": { + "@npmcli/docs": "^1.0.0", + "@npmcli/eslint-config": "^5.1.0", + "@npmcli/git": "^7.0.2", + "@npmcli/mock-globals": "^1.0.0", + "@npmcli/mock-registry": "^1.0.0", + "@npmcli/template-oss": "4.29.0", + "@tufjs/repo-mock": "^4.0.0", + "ajv": "^8.12.0", + "ajv-formats": "^3.0.1", + "ajv-formats-draft2019": "^1.6.1", + "cli-table3": "^0.6.4", + "diff": "^8.0.4", + "nock": "^13.4.0", + "npm-packlist": "^10.0.4", + "remark": "^15.0.1", + "remark-gfm": "^4.0.1", + "remark-github": "^12.0.0", + "rimraf": "^6.0.1", + "spawk": "^1.7.1", + "tap": "^16.3.9" + }, + "scripts": { + "dependencies": "node scripts/bundle-and-gitignore-deps.js && node scripts/dependency-graph.js", + "dumpconf": "env | grep npm | sort | uniq", + "licenses": "npx licensee --production --errors-only", + "test": "tap", + "test:nocolor": "CI=true tap -Rclassic", + "test-all": "node . run test --workspaces --include-workspace-root --if-present", + "snap": "tap", + "prepack": "node . run build -w docs", + "posttest": "node . run lint", + "lint": "node . run eslint", + "lintfix": "node . run eslint -- --fix", + "lint-all": "node . run lint --workspaces --include-workspace-root --if-present", + "resetdeps": "node scripts/resetdeps.js", + "rp-pull-request": "node scripts/update-authors.js", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "tap": { + "test-env": [ + "LC_ALL=sk" + ], + "timeout": 600, + "nyc-arg": [ + "--exclude", + "docs/**", + "--exclude", + "smoke-tests/**", + "--exclude", + "mock-globals/**", + "--exclude", + "mock-registry/**", + "--exclude", + "workspaces/**", + "--exclude", + "tap-snapshots/**" + ], + "test-ignore": "^(docs|smoke-tests|mock-globals|mock-registry|workspaces)/" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.29.0", + "content": "./scripts/template-oss/root.js", + "updateNpm": false + }, + "license": "Artistic-2.0", + "engines": { + "node": "^20.17.0 || >=22.9.0" + } +} diff --git a/node24/node_modules/corepack/dist/corepack.js b/node24/node_modules/corepack/dist/corepack.js new file mode 100644 index 0000000000000000000000000000000000000000..dd82ad1477c2f547ec253310e6957398278c920f --- /dev/null +++ b/node24/node_modules/corepack/dist/corepack.js @@ -0,0 +1,4 @@ +#!/usr/bin/env node +process.env.COREPACK_ENABLE_DOWNLOAD_PROMPT??='0'; +require('module').enableCompileCache?.(); +require('./lib/corepack.cjs').runMain(process.argv.slice(2)); \ No newline at end of file diff --git a/node24/node_modules/corepack/dist/lib/corepack.cjs b/node24/node_modules/corepack/dist/lib/corepack.cjs new file mode 100644 index 0000000000000000000000000000000000000000..d5208772ed462ec871deeee10bc68108b96ca89b --- /dev/null +++ b/node24/node_modules/corepack/dist/lib/corepack.cjs @@ -0,0 +1,23739 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esm = (fn2, res) => function __init() { + return fn2 && (res = (0, fn2[__getOwnPropNames(fn2)[0]])(fn2 = 0)), res; +}; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name2 in all) + __defProp(target, name2, { get: all[name2], enumerable: true }); +}; +var __copyProps = (to, from, except, desc2) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc2 = __getOwnPropDesc(from, key)) || desc2.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// .yarn/cache/typanion-npm-3.14.0-8af344c436-8b03b19844.zip/node_modules/typanion/lib/index.mjs +var lib_exports = {}; +__export(lib_exports, { + KeyRelationship: () => KeyRelationship, + TypeAssertionError: () => TypeAssertionError, + applyCascade: () => applyCascade, + as: () => as, + assert: () => assert, + assertWithErrors: () => assertWithErrors, + cascade: () => cascade, + fn: () => fn, + hasAtLeastOneKey: () => hasAtLeastOneKey, + hasExactLength: () => hasExactLength, + hasForbiddenKeys: () => hasForbiddenKeys, + hasKeyRelationship: () => hasKeyRelationship, + hasMaxLength: () => hasMaxLength, + hasMinLength: () => hasMinLength, + hasMutuallyExclusiveKeys: () => hasMutuallyExclusiveKeys, + hasRequiredKeys: () => hasRequiredKeys, + hasUniqueItems: () => hasUniqueItems, + isArray: () => isArray, + isAtLeast: () => isAtLeast, + isAtMost: () => isAtMost, + isBase64: () => isBase64, + isBoolean: () => isBoolean, + isDate: () => isDate, + isDict: () => isDict, + isEnum: () => isEnum, + isHexColor: () => isHexColor, + isISO8601: () => isISO8601, + isInExclusiveRange: () => isInExclusiveRange, + isInInclusiveRange: () => isInInclusiveRange, + isInstanceOf: () => isInstanceOf, + isInteger: () => isInteger, + isJSON: () => isJSON, + isLiteral: () => isLiteral, + isLowerCase: () => isLowerCase, + isMap: () => isMap, + isNegative: () => isNegative, + isNullable: () => isNullable, + isNumber: () => isNumber, + isObject: () => isObject, + isOneOf: () => isOneOf, + isOptional: () => isOptional, + isPartial: () => isPartial, + isPayload: () => isPayload, + isPositive: () => isPositive, + isRecord: () => isRecord, + isSet: () => isSet, + isString: () => isString, + isTuple: () => isTuple, + isUUID4: () => isUUID4, + isUnknown: () => isUnknown, + isUpperCase: () => isUpperCase, + makeTrait: () => makeTrait, + makeValidator: () => makeValidator, + matchesRegExp: () => matchesRegExp, + softAssert: () => softAssert +}); +function getPrintable(value) { + if (value === null) + return `null`; + if (value === void 0) + return `undefined`; + if (value === ``) + return `an empty string`; + if (typeof value === "symbol") + return `<${value.toString()}>`; + if (Array.isArray(value)) + return `an array`; + return JSON.stringify(value); +} +function getPrintableArray(value, conjunction) { + if (value.length === 0) + return `nothing`; + if (value.length === 1) + return getPrintable(value[0]); + const rest = value.slice(0, -1); + const trailing = value[value.length - 1]; + const separator = value.length > 2 ? `, ${conjunction} ` : ` ${conjunction} `; + return `${rest.map((value2) => getPrintable(value2)).join(`, `)}${separator}${getPrintable(trailing)}`; +} +function computeKey(state, key) { + var _a, _b, _c; + if (typeof key === `number`) { + return `${(_a = state === null || state === void 0 ? void 0 : state.p) !== null && _a !== void 0 ? _a : `.`}[${key}]`; + } else if (simpleKeyRegExp.test(key)) { + return `${(_b = state === null || state === void 0 ? void 0 : state.p) !== null && _b !== void 0 ? _b : ``}.${key}`; + } else { + return `${(_c = state === null || state === void 0 ? void 0 : state.p) !== null && _c !== void 0 ? _c : `.`}[${JSON.stringify(key)}]`; + } +} +function plural(n, singular, plural2) { + return n === 1 ? singular : plural2; +} +function pushError({ errors, p } = {}, message) { + errors === null || errors === void 0 ? void 0 : errors.push(`${p !== null && p !== void 0 ? p : `.`}: ${message}`); + return false; +} +function makeSetter(target, key) { + return (v) => { + target[key] = v; + }; +} +function makeCoercionFn(target, key) { + return (v) => { + const previous = target[key]; + target[key] = v; + return makeCoercionFn(target, key).bind(null, previous); + }; +} +function makeLazyCoercionFn(fn2, orig, generator) { + const commit = () => { + fn2(generator()); + return revert; + }; + const revert = () => { + fn2(orig); + return commit; + }; + return commit; +} +function isUnknown() { + return makeValidator({ + test: (value, state) => { + return true; + } + }); +} +function isLiteral(expected) { + return makeValidator({ + test: (value, state) => { + if (value !== expected) + return pushError(state, `Expected ${getPrintable(expected)} (got ${getPrintable(value)})`); + return true; + } + }); +} +function isString() { + return makeValidator({ + test: (value, state) => { + if (typeof value !== `string`) + return pushError(state, `Expected a string (got ${getPrintable(value)})`); + return true; + } + }); +} +function isEnum(enumSpec) { + const valuesArray = Array.isArray(enumSpec) ? enumSpec : Object.values(enumSpec); + const isAlphaNum = valuesArray.every((item) => typeof item === "string" || typeof item === "number"); + const values = new Set(valuesArray); + if (values.size === 1) + return isLiteral([...values][0]); + return makeValidator({ + test: (value, state) => { + if (!values.has(value)) { + if (isAlphaNum) { + return pushError(state, `Expected one of ${getPrintableArray(valuesArray, `or`)} (got ${getPrintable(value)})`); + } else { + return pushError(state, `Expected a valid enumeration value (got ${getPrintable(value)})`); + } + } + return true; + } + }); +} +function isBoolean() { + return makeValidator({ + test: (value, state) => { + var _a; + if (typeof value !== `boolean`) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`) + return pushError(state, `Unbound coercion result`); + const coercion = BOOLEAN_COERCIONS.get(value); + if (typeof coercion !== `undefined`) { + state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, state.coercion.bind(null, coercion)]); + return true; + } + } + return pushError(state, `Expected a boolean (got ${getPrintable(value)})`); + } + return true; + } + }); +} +function isNumber() { + return makeValidator({ + test: (value, state) => { + var _a; + if (typeof value !== `number`) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`) + return pushError(state, `Unbound coercion result`); + let coercion; + if (typeof value === `string`) { + let val; + try { + val = JSON.parse(value); + } catch (_b) { + } + if (typeof val === `number`) { + if (JSON.stringify(val) === value) { + coercion = val; + } else { + return pushError(state, `Received a number that can't be safely represented by the runtime (${value})`); + } + } + } + if (typeof coercion !== `undefined`) { + state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, state.coercion.bind(null, coercion)]); + return true; + } + } + return pushError(state, `Expected a number (got ${getPrintable(value)})`); + } + return true; + } + }); +} +function isPayload(spec) { + return makeValidator({ + test: (value, state) => { + var _a; + if (typeof (state === null || state === void 0 ? void 0 : state.coercions) === `undefined`) + return pushError(state, `The isPayload predicate can only be used with coercion enabled`); + if (typeof state.coercion === `undefined`) + return pushError(state, `Unbound coercion result`); + if (typeof value !== `string`) + return pushError(state, `Expected a string (got ${getPrintable(value)})`); + let inner; + try { + inner = JSON.parse(value); + } catch (_b) { + return pushError(state, `Expected a JSON string (got ${getPrintable(value)})`); + } + const wrapper = { value: inner }; + if (!spec(inner, Object.assign(Object.assign({}, state), { coercion: makeCoercionFn(wrapper, `value`) }))) + return false; + state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, state.coercion.bind(null, wrapper.value)]); + return true; + } + }); +} +function isDate() { + return makeValidator({ + test: (value, state) => { + var _a; + if (!(value instanceof Date)) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`) + return pushError(state, `Unbound coercion result`); + let coercion; + if (typeof value === `string` && iso8601RegExp.test(value)) { + coercion = new Date(value); + } else { + let timestamp; + if (typeof value === `string`) { + let val; + try { + val = JSON.parse(value); + } catch (_b) { + } + if (typeof val === `number`) { + timestamp = val; + } + } else if (typeof value === `number`) { + timestamp = value; + } + if (typeof timestamp !== `undefined`) { + if (Number.isSafeInteger(timestamp) || !Number.isSafeInteger(timestamp * 1e3)) { + coercion = new Date(timestamp * 1e3); + } else { + return pushError(state, `Received a timestamp that can't be safely represented by the runtime (${value})`); + } + } + } + if (typeof coercion !== `undefined`) { + state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, state.coercion.bind(null, coercion)]); + return true; + } + } + return pushError(state, `Expected a date (got ${getPrintable(value)})`); + } + return true; + } + }); +} +function isArray(spec, { delimiter } = {}) { + return makeValidator({ + test: (value, state) => { + var _a; + const originalValue = value; + if (typeof value === `string` && typeof delimiter !== `undefined`) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`) + return pushError(state, `Unbound coercion result`); + value = value.split(delimiter); + } + } + if (!Array.isArray(value)) + return pushError(state, `Expected an array (got ${getPrintable(value)})`); + let valid = true; + for (let t = 0, T = value.length; t < T; ++t) { + valid = spec(value[t], Object.assign(Object.assign({}, state), { p: computeKey(state, t), coercion: makeCoercionFn(value, t) })) && valid; + if (!valid && (state === null || state === void 0 ? void 0 : state.errors) == null) { + break; + } + } + if (value !== originalValue) + state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, state.coercion.bind(null, value)]); + return valid; + } + }); +} +function isSet(spec, { delimiter } = {}) { + const isArrayValidator = isArray(spec, { delimiter }); + return makeValidator({ + test: (value, state) => { + var _a, _b; + if (Object.getPrototypeOf(value).toString() === `[object Set]`) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`) + return pushError(state, `Unbound coercion result`); + const originalValues = [...value]; + const coercedValues = [...value]; + if (!isArrayValidator(coercedValues, Object.assign(Object.assign({}, state), { coercion: void 0 }))) + return false; + const updateValue = () => coercedValues.some((val, t) => val !== originalValues[t]) ? new Set(coercedValues) : value; + state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, makeLazyCoercionFn(state.coercion, value, updateValue)]); + return true; + } else { + let valid = true; + for (const subValue of value) { + valid = spec(subValue, Object.assign({}, state)) && valid; + if (!valid && (state === null || state === void 0 ? void 0 : state.errors) == null) { + break; + } + } + return valid; + } + } + if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`) + return pushError(state, `Unbound coercion result`); + const store = { value }; + if (!isArrayValidator(value, Object.assign(Object.assign({}, state), { coercion: makeCoercionFn(store, `value`) }))) + return false; + state.coercions.push([(_b = state.p) !== null && _b !== void 0 ? _b : `.`, makeLazyCoercionFn(state.coercion, value, () => new Set(store.value))]); + return true; + } + return pushError(state, `Expected a set (got ${getPrintable(value)})`); + } + }); +} +function isMap(keySpec, valueSpec) { + const isArrayValidator = isArray(isTuple([keySpec, valueSpec])); + const isRecordValidator = isRecord(valueSpec, { keys: keySpec }); + return makeValidator({ + test: (value, state) => { + var _a, _b, _c; + if (Object.getPrototypeOf(value).toString() === `[object Map]`) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`) + return pushError(state, `Unbound coercion result`); + const originalValues = [...value]; + const coercedValues = [...value]; + if (!isArrayValidator(coercedValues, Object.assign(Object.assign({}, state), { coercion: void 0 }))) + return false; + const updateValue = () => coercedValues.some((val, t) => val[0] !== originalValues[t][0] || val[1] !== originalValues[t][1]) ? new Map(coercedValues) : value; + state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, makeLazyCoercionFn(state.coercion, value, updateValue)]); + return true; + } else { + let valid = true; + for (const [key, subValue] of value) { + valid = keySpec(key, Object.assign({}, state)) && valid; + if (!valid && (state === null || state === void 0 ? void 0 : state.errors) == null) { + break; + } + valid = valueSpec(subValue, Object.assign(Object.assign({}, state), { p: computeKey(state, key) })) && valid; + if (!valid && (state === null || state === void 0 ? void 0 : state.errors) == null) { + break; + } + } + return valid; + } + } + if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`) + return pushError(state, `Unbound coercion result`); + const store = { value }; + if (Array.isArray(value)) { + if (!isArrayValidator(value, Object.assign(Object.assign({}, state), { coercion: void 0 }))) + return false; + state.coercions.push([(_b = state.p) !== null && _b !== void 0 ? _b : `.`, makeLazyCoercionFn(state.coercion, value, () => new Map(store.value))]); + return true; + } else { + if (!isRecordValidator(value, Object.assign(Object.assign({}, state), { coercion: makeCoercionFn(store, `value`) }))) + return false; + state.coercions.push([(_c = state.p) !== null && _c !== void 0 ? _c : `.`, makeLazyCoercionFn(state.coercion, value, () => new Map(Object.entries(store.value)))]); + return true; + } + } + return pushError(state, `Expected a map (got ${getPrintable(value)})`); + } + }); +} +function isTuple(spec, { delimiter } = {}) { + const lengthValidator = hasExactLength(spec.length); + return makeValidator({ + test: (value, state) => { + var _a; + if (typeof value === `string` && typeof delimiter !== `undefined`) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`) + return pushError(state, `Unbound coercion result`); + value = value.split(delimiter); + state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, state.coercion.bind(null, value)]); + } + } + if (!Array.isArray(value)) + return pushError(state, `Expected a tuple (got ${getPrintable(value)})`); + let valid = lengthValidator(value, Object.assign({}, state)); + for (let t = 0, T = value.length; t < T && t < spec.length; ++t) { + valid = spec[t](value[t], Object.assign(Object.assign({}, state), { p: computeKey(state, t), coercion: makeCoercionFn(value, t) })) && valid; + if (!valid && (state === null || state === void 0 ? void 0 : state.errors) == null) { + break; + } + } + return valid; + } + }); +} +function isRecord(spec, { keys: keySpec = null } = {}) { + const isArrayValidator = isArray(isTuple([keySpec !== null && keySpec !== void 0 ? keySpec : isString(), spec])); + return makeValidator({ + test: (value, state) => { + var _a; + if (Array.isArray(value)) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`) + return pushError(state, `Unbound coercion result`); + if (!isArrayValidator(value, Object.assign(Object.assign({}, state), { coercion: void 0 }))) + return false; + value = Object.fromEntries(value); + state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, state.coercion.bind(null, value)]); + return true; + } + } + if (typeof value !== `object` || value === null) + return pushError(state, `Expected an object (got ${getPrintable(value)})`); + const keys = Object.keys(value); + let valid = true; + for (let t = 0, T = keys.length; t < T && (valid || (state === null || state === void 0 ? void 0 : state.errors) != null); ++t) { + const key = keys[t]; + const sub = value[key]; + if (key === `__proto__` || key === `constructor`) { + valid = pushError(Object.assign(Object.assign({}, state), { p: computeKey(state, key) }), `Unsafe property name`); + continue; + } + if (keySpec !== null && !keySpec(key, state)) { + valid = false; + continue; + } + if (!spec(sub, Object.assign(Object.assign({}, state), { p: computeKey(state, key), coercion: makeCoercionFn(value, key) }))) { + valid = false; + continue; + } + } + return valid; + } + }); +} +function isDict(spec, opts = {}) { + return isRecord(spec, opts); +} +function isObject(props, { extra: extraSpec = null } = {}) { + const specKeys = Object.keys(props); + const validator = makeValidator({ + test: (value, state) => { + if (typeof value !== `object` || value === null) + return pushError(state, `Expected an object (got ${getPrintable(value)})`); + const keys = /* @__PURE__ */ new Set([...specKeys, ...Object.keys(value)]); + const extra = {}; + let valid = true; + for (const key of keys) { + if (key === `constructor` || key === `__proto__`) { + valid = pushError(Object.assign(Object.assign({}, state), { p: computeKey(state, key) }), `Unsafe property name`); + } else { + const spec = Object.prototype.hasOwnProperty.call(props, key) ? props[key] : void 0; + const sub = Object.prototype.hasOwnProperty.call(value, key) ? value[key] : void 0; + if (typeof spec !== `undefined`) { + valid = spec(sub, Object.assign(Object.assign({}, state), { p: computeKey(state, key), coercion: makeCoercionFn(value, key) })) && valid; + } else if (extraSpec === null) { + valid = pushError(Object.assign(Object.assign({}, state), { p: computeKey(state, key) }), `Extraneous property (got ${getPrintable(sub)})`); + } else { + Object.defineProperty(extra, key, { + enumerable: true, + get: () => sub, + set: makeSetter(value, key) + }); + } + } + if (!valid && (state === null || state === void 0 ? void 0 : state.errors) == null) { + break; + } + } + if (extraSpec !== null && (valid || (state === null || state === void 0 ? void 0 : state.errors) != null)) + valid = extraSpec(extra, state) && valid; + return valid; + } + }); + return Object.assign(validator, { + properties: props + }); +} +function isPartial(props) { + return isObject(props, { extra: isRecord(isUnknown()) }); +} +function makeTrait(value) { + return () => { + return value; + }; +} +function makeValidator({ test }) { + return makeTrait(test)(); +} +function assert(val, validator) { + if (!validator(val)) { + throw new TypeAssertionError(); + } +} +function assertWithErrors(val, validator) { + const errors = []; + if (!validator(val, { errors })) { + throw new TypeAssertionError({ errors }); + } +} +function softAssert(val, validator) { +} +function as(value, validator, { coerce = false, errors: storeErrors, throw: throws } = {}) { + const errors = storeErrors ? [] : void 0; + if (!coerce) { + if (validator(value, { errors })) { + return throws ? value : { value, errors: void 0 }; + } else if (!throws) { + return { value: void 0, errors: errors !== null && errors !== void 0 ? errors : true }; + } else { + throw new TypeAssertionError({ errors }); + } + } + const state = { value }; + const coercion = makeCoercionFn(state, `value`); + const coercions = []; + if (!validator(value, { errors, coercion, coercions })) { + if (!throws) { + return { value: void 0, errors: errors !== null && errors !== void 0 ? errors : true }; + } else { + throw new TypeAssertionError({ errors }); + } + } + for (const [, apply] of coercions) + apply(); + if (throws) { + return state.value; + } else { + return { value: state.value, errors: void 0 }; + } +} +function fn(validators, fn2) { + const isValidArgList = isTuple(validators); + return ((...args) => { + const check = isValidArgList(args); + if (!check) + throw new TypeAssertionError(); + return fn2(...args); + }); +} +function hasMinLength(length) { + return makeValidator({ + test: (value, state) => { + if (!(value.length >= length)) + return pushError(state, `Expected to have a length of at least ${length} elements (got ${value.length})`); + return true; + } + }); +} +function hasMaxLength(length) { + return makeValidator({ + test: (value, state) => { + if (!(value.length <= length)) + return pushError(state, `Expected to have a length of at most ${length} elements (got ${value.length})`); + return true; + } + }); +} +function hasExactLength(length) { + return makeValidator({ + test: (value, state) => { + if (!(value.length === length)) + return pushError(state, `Expected to have a length of exactly ${length} elements (got ${value.length})`); + return true; + } + }); +} +function hasUniqueItems({ map } = {}) { + return makeValidator({ + test: (value, state) => { + const set = /* @__PURE__ */ new Set(); + const dup = /* @__PURE__ */ new Set(); + for (let t = 0, T = value.length; t < T; ++t) { + const sub = value[t]; + const key = typeof map !== `undefined` ? map(sub) : sub; + if (set.has(key)) { + if (dup.has(key)) + continue; + pushError(state, `Expected to contain unique elements; got a duplicate with ${getPrintable(value)}`); + dup.add(key); + } else { + set.add(key); + } + } + return dup.size === 0; + } + }); +} +function isNegative() { + return makeValidator({ + test: (value, state) => { + if (!(value <= 0)) + return pushError(state, `Expected to be negative (got ${value})`); + return true; + } + }); +} +function isPositive() { + return makeValidator({ + test: (value, state) => { + if (!(value >= 0)) + return pushError(state, `Expected to be positive (got ${value})`); + return true; + } + }); +} +function isAtLeast(n) { + return makeValidator({ + test: (value, state) => { + if (!(value >= n)) + return pushError(state, `Expected to be at least ${n} (got ${value})`); + return true; + } + }); +} +function isAtMost(n) { + return makeValidator({ + test: (value, state) => { + if (!(value <= n)) + return pushError(state, `Expected to be at most ${n} (got ${value})`); + return true; + } + }); +} +function isInInclusiveRange(a, b) { + return makeValidator({ + test: (value, state) => { + if (!(value >= a && value <= b)) + return pushError(state, `Expected to be in the [${a}; ${b}] range (got ${value})`); + return true; + } + }); +} +function isInExclusiveRange(a, b) { + return makeValidator({ + test: (value, state) => { + if (!(value >= a && value < b)) + return pushError(state, `Expected to be in the [${a}; ${b}[ range (got ${value})`); + return true; + } + }); +} +function isInteger({ unsafe = false } = {}) { + return makeValidator({ + test: (value, state) => { + if (value !== Math.round(value)) + return pushError(state, `Expected to be an integer (got ${value})`); + if (!unsafe && !Number.isSafeInteger(value)) + return pushError(state, `Expected to be a safe integer (got ${value})`); + return true; + } + }); +} +function matchesRegExp(regExp) { + return makeValidator({ + test: (value, state) => { + if (!regExp.test(value)) + return pushError(state, `Expected to match the pattern ${regExp.toString()} (got ${getPrintable(value)})`); + return true; + } + }); +} +function isLowerCase() { + return makeValidator({ + test: (value, state) => { + if (value !== value.toLowerCase()) + return pushError(state, `Expected to be all-lowercase (got ${value})`); + return true; + } + }); +} +function isUpperCase() { + return makeValidator({ + test: (value, state) => { + if (value !== value.toUpperCase()) + return pushError(state, `Expected to be all-uppercase (got ${value})`); + return true; + } + }); +} +function isUUID4() { + return makeValidator({ + test: (value, state) => { + if (!uuid4RegExp.test(value)) + return pushError(state, `Expected to be a valid UUID v4 (got ${getPrintable(value)})`); + return true; + } + }); +} +function isISO8601() { + return makeValidator({ + test: (value, state) => { + if (!iso8601RegExp.test(value)) + return pushError(state, `Expected to be a valid ISO 8601 date string (got ${getPrintable(value)})`); + return true; + } + }); +} +function isHexColor({ alpha = false }) { + return makeValidator({ + test: (value, state) => { + const res = alpha ? colorStringRegExp.test(value) : colorStringAlphaRegExp.test(value); + if (!res) + return pushError(state, `Expected to be a valid hexadecimal color string (got ${getPrintable(value)})`); + return true; + } + }); +} +function isBase64() { + return makeValidator({ + test: (value, state) => { + if (!base64RegExp.test(value)) + return pushError(state, `Expected to be a valid base 64 string (got ${getPrintable(value)})`); + return true; + } + }); +} +function isJSON(spec = isUnknown()) { + return makeValidator({ + test: (value, state) => { + let data; + try { + data = JSON.parse(value); + } catch (_a) { + return pushError(state, `Expected to be a valid JSON string (got ${getPrintable(value)})`); + } + return spec(data, state); + } + }); +} +function cascade(spec, ...followups) { + const resolvedFollowups = Array.isArray(followups[0]) ? followups[0] : followups; + return makeValidator({ + test: (value, state) => { + var _a, _b; + const context = { value }; + const subCoercion = typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined` ? makeCoercionFn(context, `value`) : void 0; + const subCoercions = typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined` ? [] : void 0; + if (!spec(value, Object.assign(Object.assign({}, state), { coercion: subCoercion, coercions: subCoercions }))) + return false; + const reverts = []; + if (typeof subCoercions !== `undefined`) + for (const [, coercion] of subCoercions) + reverts.push(coercion()); + try { + if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) { + if (context.value !== value) { + if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`) + return pushError(state, `Unbound coercion result`); + state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, state.coercion.bind(null, context.value)]); + } + (_b = state === null || state === void 0 ? void 0 : state.coercions) === null || _b === void 0 ? void 0 : _b.push(...subCoercions); + } + return resolvedFollowups.every((spec2) => { + return spec2(context.value, state); + }); + } finally { + for (const revert of reverts) { + revert(); + } + } + } + }); +} +function applyCascade(spec, ...followups) { + const resolvedFollowups = Array.isArray(followups[0]) ? followups[0] : followups; + return cascade(spec, resolvedFollowups); +} +function isOptional(spec) { + return makeValidator({ + test: (value, state) => { + if (typeof value === `undefined`) + return true; + return spec(value, state); + } + }); +} +function isNullable(spec) { + return makeValidator({ + test: (value, state) => { + if (value === null) + return true; + return spec(value, state); + } + }); +} +function hasRequiredKeys(requiredKeys, options) { + var _a; + const requiredSet = new Set(requiredKeys); + const check = checks[(_a = options === null || options === void 0 ? void 0 : options.missingIf) !== null && _a !== void 0 ? _a : "missing"]; + return makeValidator({ + test: (value, state) => { + const keys = new Set(Object.keys(value)); + const problems = []; + for (const key of requiredSet) + if (!check(keys, key, value)) + problems.push(key); + if (problems.length > 0) + return pushError(state, `Missing required ${plural(problems.length, `property`, `properties`)} ${getPrintableArray(problems, `and`)}`); + return true; + } + }); +} +function hasAtLeastOneKey(requiredKeys, options) { + var _a; + const requiredSet = new Set(requiredKeys); + const check = checks[(_a = options === null || options === void 0 ? void 0 : options.missingIf) !== null && _a !== void 0 ? _a : "missing"]; + return makeValidator({ + test: (value, state) => { + const keys = Object.keys(value); + const valid = keys.some((key) => check(requiredSet, key, value)); + if (!valid) + return pushError(state, `Missing at least one property from ${getPrintableArray(Array.from(requiredSet), `or`)}`); + return true; + } + }); +} +function hasForbiddenKeys(forbiddenKeys, options) { + var _a; + const forbiddenSet = new Set(forbiddenKeys); + const check = checks[(_a = options === null || options === void 0 ? void 0 : options.missingIf) !== null && _a !== void 0 ? _a : "missing"]; + return makeValidator({ + test: (value, state) => { + const keys = new Set(Object.keys(value)); + const problems = []; + for (const key of forbiddenSet) + if (check(keys, key, value)) + problems.push(key); + if (problems.length > 0) + return pushError(state, `Forbidden ${plural(problems.length, `property`, `properties`)} ${getPrintableArray(problems, `and`)}`); + return true; + } + }); +} +function hasMutuallyExclusiveKeys(exclusiveKeys, options) { + var _a; + const exclusiveSet = new Set(exclusiveKeys); + const check = checks[(_a = options === null || options === void 0 ? void 0 : options.missingIf) !== null && _a !== void 0 ? _a : "missing"]; + return makeValidator({ + test: (value, state) => { + const keys = new Set(Object.keys(value)); + const used = []; + for (const key of exclusiveSet) + if (check(keys, key, value)) + used.push(key); + if (used.length > 1) + return pushError(state, `Mutually exclusive properties ${getPrintableArray(used, `and`)}`); + return true; + } + }); +} +function hasKeyRelationship(subject, relationship, others, options) { + var _a, _b; + const skipped = new Set((_a = options === null || options === void 0 ? void 0 : options.ignore) !== null && _a !== void 0 ? _a : []); + const check = checks[(_b = options === null || options === void 0 ? void 0 : options.missingIf) !== null && _b !== void 0 ? _b : "missing"]; + const otherSet = new Set(others); + const spec = keyRelationships[relationship]; + const conjunction = relationship === KeyRelationship.Forbids ? `or` : `and`; + return makeValidator({ + test: (value, state) => { + const keys = new Set(Object.keys(value)); + if (!check(keys, subject, value) || skipped.has(value[subject])) + return true; + const problems = []; + for (const key of otherSet) + if ((check(keys, key, value) && !skipped.has(value[key])) !== spec.expect) + problems.push(key); + if (problems.length >= 1) + return pushError(state, `Property "${subject}" ${spec.message} ${plural(problems.length, `property`, `properties`)} ${getPrintableArray(problems, conjunction)}`); + return true; + } + }); +} +var simpleKeyRegExp, colorStringRegExp, colorStringAlphaRegExp, base64RegExp, uuid4RegExp, iso8601RegExp, BOOLEAN_COERCIONS, isInstanceOf, isOneOf, TypeAssertionError, checks, KeyRelationship, keyRelationships; +var init_lib = __esm({ + ".yarn/cache/typanion-npm-3.14.0-8af344c436-8b03b19844.zip/node_modules/typanion/lib/index.mjs"() { + simpleKeyRegExp = /^[a-zA-Z_][a-zA-Z0-9_]*$/; + colorStringRegExp = /^#[0-9a-f]{6}$/i; + colorStringAlphaRegExp = /^#[0-9a-f]{6}([0-9a-f]{2})?$/i; + base64RegExp = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/; + uuid4RegExp = /^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$/i; + iso8601RegExp = /^(?:[1-9]\d{3}(-?)(?:(?:0[1-9]|1[0-2])\1(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])\1(?:29|30)|(?:0[13578]|1[02])(?:\1)31|00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[0-5]))|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)(?:(-?)02(?:\2)29|-?366))T(?:[01]\d|2[0-3])(:?)[0-5]\d(?:\3[0-5]\d)?(?:Z|[+-][01]\d(?:\3[0-5]\d)?)$/; + BOOLEAN_COERCIONS = /* @__PURE__ */ new Map([ + [`true`, true], + [`True`, true], + [`1`, true], + [1, true], + [`false`, false], + [`False`, false], + [`0`, false], + [0, false] + ]); + isInstanceOf = (constructor) => makeValidator({ + test: (value, state) => { + if (!(value instanceof constructor)) + return pushError(state, `Expected an instance of ${constructor.name} (got ${getPrintable(value)})`); + return true; + } + }); + isOneOf = (specs, { exclusive = false } = {}) => makeValidator({ + test: (value, state) => { + var _a, _b, _c; + const matches = []; + const errorBuffer = typeof (state === null || state === void 0 ? void 0 : state.errors) !== `undefined` ? [] : void 0; + for (let t = 0, T = specs.length; t < T; ++t) { + const subErrors = typeof (state === null || state === void 0 ? void 0 : state.errors) !== `undefined` ? [] : void 0; + const subCoercions = typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined` ? [] : void 0; + if (specs[t](value, Object.assign(Object.assign({}, state), { errors: subErrors, coercions: subCoercions, p: `${(_a = state === null || state === void 0 ? void 0 : state.p) !== null && _a !== void 0 ? _a : `.`}#${t + 1}` }))) { + matches.push([`#${t + 1}`, subCoercions]); + if (!exclusive) { + break; + } + } else { + errorBuffer === null || errorBuffer === void 0 ? void 0 : errorBuffer.push(subErrors[0]); + } + } + if (matches.length === 1) { + const [, subCoercions] = matches[0]; + if (typeof subCoercions !== `undefined`) + (_b = state === null || state === void 0 ? void 0 : state.coercions) === null || _b === void 0 ? void 0 : _b.push(...subCoercions); + return true; + } + if (matches.length > 1) + pushError(state, `Expected to match exactly a single predicate (matched ${matches.join(`, `)})`); + else + (_c = state === null || state === void 0 ? void 0 : state.errors) === null || _c === void 0 ? void 0 : _c.push(...errorBuffer); + return false; + } + }); + TypeAssertionError = class extends Error { + constructor({ errors } = {}) { + let errorMessage = `Type mismatch`; + if (errors && errors.length > 0) { + errorMessage += ` +`; + for (const error of errors) { + errorMessage += ` +- ${error}`; + } + } + super(errorMessage); + } + }; + checks = { + missing: (keys, key) => keys.has(key), + undefined: (keys, key, value) => keys.has(key) && typeof value[key] !== `undefined`, + nil: (keys, key, value) => keys.has(key) && value[key] != null, + falsy: (keys, key, value) => keys.has(key) && !!value[key] + }; + (function(KeyRelationship2) { + KeyRelationship2["Forbids"] = "Forbids"; + KeyRelationship2["Requires"] = "Requires"; + })(KeyRelationship || (KeyRelationship = {})); + keyRelationships = { + [KeyRelationship.Forbids]: { + expect: false, + message: `forbids using` + }, + [KeyRelationship.Requires]: { + expect: true, + message: `requires using` + } + }; + } +}); + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/platform/node.js +var require_node = __commonJS({ + ".yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/platform/node.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var tty2 = require("tty"); + function _interopDefaultLegacy(e) { + return e && typeof e === "object" && "default" in e ? e : { "default": e }; + } + var tty__default = /* @__PURE__ */ _interopDefaultLegacy(tty2); + function getDefaultColorDepth2() { + if (tty__default["default"] && `getColorDepth` in tty__default["default"].WriteStream.prototype) + return tty__default["default"].WriteStream.prototype.getColorDepth(); + if (process.env.FORCE_COLOR === `0`) + return 1; + if (process.env.FORCE_COLOR === `1`) + return 8; + if (typeof process.stdout !== `undefined` && process.stdout.isTTY) + return 8; + return 1; + } + var gContextStorage; + function getCaptureActivator2(context) { + let contextStorage = gContextStorage; + if (typeof contextStorage === `undefined`) { + if (context.stdout === process.stdout && context.stderr === process.stderr) + return null; + const { AsyncLocalStorage: LazyAsyncLocalStorage } = require("async_hooks"); + contextStorage = gContextStorage = new LazyAsyncLocalStorage(); + const origStdoutWrite = process.stdout._write; + process.stdout._write = function(chunk, encoding, cb) { + const context2 = contextStorage.getStore(); + if (typeof context2 === `undefined`) + return origStdoutWrite.call(this, chunk, encoding, cb); + return context2.stdout.write(chunk, encoding, cb); + }; + const origStderrWrite = process.stderr._write; + process.stderr._write = function(chunk, encoding, cb) { + const context2 = contextStorage.getStore(); + if (typeof context2 === `undefined`) + return origStderrWrite.call(this, chunk, encoding, cb); + return context2.stderr.write(chunk, encoding, cb); + }; + } + return (fn2) => { + return contextStorage.run(context, fn2); + }; + } + exports2.getCaptureActivator = getCaptureActivator2; + exports2.getDefaultColorDepth = getDefaultColorDepth2; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/debug.js"(exports2, module2) { + "use strict"; + var debug2 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { + }; + module2.exports = debug2; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/constants.js +var require_constants = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/constants.js"(exports2, module2) { + "use strict"; + var SEMVER_SPEC_VERSION = "2.0.0"; + var MAX_LENGTH = 256; + var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ + 9007199254740991; + var MAX_SAFE_COMPONENT_LENGTH = 16; + var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; + var RELEASE_TYPES = [ + "major", + "premajor", + "minor", + "preminor", + "patch", + "prepatch", + "prerelease" + ]; + module2.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 1, + FLAG_LOOSE: 2 + }; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/re.js +var require_re = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/re.js"(exports2, module2) { + "use strict"; + var { + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_LENGTH + } = require_constants(); + var debug2 = require_debug(); + exports2 = module2.exports = {}; + var re = exports2.re = []; + var safeRe = exports2.safeRe = []; + var src = exports2.src = []; + var safeSrc = exports2.safeSrc = []; + var t = exports2.t = {}; + var R = 0; + var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; + var safeRegexReplacements = [ + ["\\s", 1], + ["\\d", MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] + ]; + var makeSafeRegex = (value) => { + for (const [token, max] of safeRegexReplacements) { + value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`); + } + return value; + }; + var createToken = (name2, value, isGlobal) => { + const safe = makeSafeRegex(value); + const index = R++; + debug2(name2, index, value); + t[name2] = index; + src[index] = value; + safeSrc[index] = safe; + re[index] = new RegExp(value, isGlobal ? "g" : void 0); + safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0); + }; + createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); + createToken("NUMERICIDENTIFIERLOOSE", "\\d+"); + createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); + createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`); + createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`); + createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`); + createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`); + createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`); + createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`); + createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); + createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`); + createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`); + createToken("FULL", `^${src[t.FULLPLAIN]}$`); + createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`); + createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`); + createToken("GTLT", "((?:<|>)?=?)"); + createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); + createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`); + createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`); + createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`); + createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`); + createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`); + createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`); + createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`); + createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`); + createToken("COERCERTL", src[t.COERCE], true); + createToken("COERCERTLFULL", src[t.COERCEFULL], true); + createToken("LONETILDE", "(?:~>?)"); + createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true); + exports2.tildeTrimReplace = "$1~"; + createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`); + createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`); + createToken("LONECARET", "(?:\\^)"); + createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true); + exports2.caretTrimReplace = "$1^"; + createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`); + createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`); + createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`); + createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`); + createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true); + exports2.comparatorTrimReplace = "$1$2$3"; + createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`); + createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`); + createToken("STAR", "(<|>)?=?\\s*\\*"); + createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); + createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/parse-options.js +var require_parse_options = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/parse-options.js"(exports2, module2) { + "use strict"; + var looseOption = Object.freeze({ loose: true }); + var emptyOpts = Object.freeze({}); + var parseOptions = (options) => { + if (!options) { + return emptyOpts; + } + if (typeof options !== "object") { + return looseOption; + } + return options; + }; + module2.exports = parseOptions; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/identifiers.js +var require_identifiers = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/identifiers.js"(exports2, module2) { + "use strict"; + var numeric = /^[0-9]+$/; + var compareIdentifiers = (a, b) => { + if (typeof a === "number" && typeof b === "number") { + return a === b ? 0 : a < b ? -1 : 1; + } + const anum = numeric.test(a); + const bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; + } + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; + }; + var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a); + module2.exports = { + compareIdentifiers, + rcompareIdentifiers + }; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/classes/semver.js +var require_semver = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/classes/semver.js"(exports2, module2) { + "use strict"; + var debug2 = require_debug(); + var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants(); + var { safeRe: re, t } = require_re(); + var parseOptions = require_parse_options(); + var { compareIdentifiers } = require_identifiers(); + var SemVer3 = class _SemVer { + constructor(version2, options) { + options = parseOptions(options); + if (version2 instanceof _SemVer) { + if (version2.loose === !!options.loose && version2.includePrerelease === !!options.includePrerelease) { + return version2; + } else { + version2 = version2.version; + } + } else if (typeof version2 !== "string") { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`); + } + if (version2.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ); + } + debug2("SemVer", version2, options); + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + const m = version2.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); + if (!m) { + throw new TypeError(`Invalid Version: ${version2}`); + } + this.raw = version2; + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError("Invalid major version"); + } + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError("Invalid minor version"); + } + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError("Invalid patch version"); + } + if (!m[4]) { + this.prerelease = []; + } else { + this.prerelease = m[4].split(".").map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id; + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num; + } + } + return id; + }); + } + this.build = m[5] ? m[5].split(".") : []; + this.format(); + } + format() { + this.version = `${this.major}.${this.minor}.${this.patch}`; + if (this.prerelease.length) { + this.version += `-${this.prerelease.join(".")}`; + } + return this.version; + } + toString() { + return this.version; + } + compare(other) { + debug2("SemVer.compare", this.version, this.options, other); + if (!(other instanceof _SemVer)) { + if (typeof other === "string" && other === this.version) { + return 0; + } + other = new _SemVer(other, this.options); + } + if (other.version === this.version) { + return 0; + } + return this.compareMain(other) || this.comparePre(other); + } + compareMain(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + if (this.major < other.major) { + return -1; + } + if (this.major > other.major) { + return 1; + } + if (this.minor < other.minor) { + return -1; + } + if (this.minor > other.minor) { + return 1; + } + if (this.patch < other.patch) { + return -1; + } + if (this.patch > other.patch) { + return 1; + } + return 0; + } + comparePre(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + if (this.prerelease.length && !other.prerelease.length) { + return -1; + } else if (!this.prerelease.length && other.prerelease.length) { + return 1; + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0; + } + let i = 0; + do { + const a = this.prerelease[i]; + const b = other.prerelease[i]; + debug2("prerelease compare", i, a, b); + if (a === void 0 && b === void 0) { + return 0; + } else if (b === void 0) { + return 1; + } else if (a === void 0) { + return -1; + } else if (a === b) { + continue; + } else { + return compareIdentifiers(a, b); + } + } while (++i); + } + compareBuild(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + let i = 0; + do { + const a = this.build[i]; + const b = other.build[i]; + debug2("build compare", i, a, b); + if (a === void 0 && b === void 0) { + return 0; + } else if (b === void 0) { + return 1; + } else if (a === void 0) { + return -1; + } else if (a === b) { + continue; + } else { + return compareIdentifiers(a, b); + } + } while (++i); + } + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc(release, identifier, identifierBase) { + if (release.startsWith("pre")) { + if (!identifier && identifierBase === false) { + throw new Error("invalid increment argument: identifier is empty"); + } + if (identifier) { + const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]); + if (!match || match[1] !== identifier) { + throw new Error(`invalid identifier: ${identifier}`); + } + } + } + switch (release) { + case "premajor": + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc("pre", identifier, identifierBase); + break; + case "preminor": + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc("pre", identifier, identifierBase); + break; + case "prepatch": + this.prerelease.length = 0; + this.inc("patch", identifier, identifierBase); + this.inc("pre", identifier, identifierBase); + break; + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case "prerelease": + if (this.prerelease.length === 0) { + this.inc("patch", identifier, identifierBase); + } + this.inc("pre", identifier, identifierBase); + break; + case "release": + if (this.prerelease.length === 0) { + throw new Error(`version ${this.raw} is not a prerelease`); + } + this.prerelease.length = 0; + break; + case "major": + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { + this.major++; + } + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case "minor": + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; + } + this.patch = 0; + this.prerelease = []; + break; + case "patch": + if (this.prerelease.length === 0) { + this.patch++; + } + this.prerelease = []; + break; + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case "pre": { + const base = Number(identifierBase) ? 1 : 0; + if (this.prerelease.length === 0) { + this.prerelease = [base]; + } else { + let i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === "number") { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) { + if (identifier === this.prerelease.join(".") && identifierBase === false) { + throw new Error("invalid increment argument: identifier already exists"); + } + this.prerelease.push(base); + } + } + if (identifier) { + let prerelease = [identifier, base]; + if (identifierBase === false) { + prerelease = [identifier]; + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease; + } + } else { + this.prerelease = prerelease; + } + } + break; + } + default: + throw new Error(`invalid increment argument: ${release}`); + } + this.raw = this.format(); + if (this.build.length) { + this.raw += `+${this.build.join(".")}`; + } + return this; + } + }; + module2.exports = SemVer3; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/compare.js +var require_compare = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/compare.js"(exports2, module2) { + "use strict"; + var SemVer3 = require_semver(); + var compare = (a, b, loose) => new SemVer3(a, loose).compare(new SemVer3(b, loose)); + module2.exports = compare; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/rcompare.js +var require_rcompare = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/rcompare.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var rcompare = (a, b, loose) => compare(b, a, loose); + module2.exports = rcompare; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/parse.js +var require_parse = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/parse.js"(exports2, module2) { + "use strict"; + var SemVer3 = require_semver(); + var parse4 = (version2, options, throwErrors = false) => { + if (version2 instanceof SemVer3) { + return version2; + } + try { + return new SemVer3(version2, options); + } catch (er) { + if (!throwErrors) { + return null; + } + throw er; + } + }; + module2.exports = parse4; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/valid.js +var require_valid = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/valid.js"(exports2, module2) { + "use strict"; + var parse4 = require_parse(); + var valid = (version2, options) => { + const v = parse4(version2, options); + return v ? v.version : null; + }; + module2.exports = valid; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/lrucache.js +var require_lrucache = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/internal/lrucache.js"(exports2, module2) { + "use strict"; + var LRUCache = class { + constructor() { + this.max = 1e3; + this.map = /* @__PURE__ */ new Map(); + } + get(key) { + const value = this.map.get(key); + if (value === void 0) { + return void 0; + } else { + this.map.delete(key); + this.map.set(key, value); + return value; + } + } + delete(key) { + return this.map.delete(key); + } + set(key, value) { + const deleted = this.delete(key); + if (!deleted && value !== void 0) { + if (this.map.size >= this.max) { + const firstKey = this.map.keys().next().value; + this.delete(firstKey); + } + this.map.set(key, value); + } + return this; + } + }; + module2.exports = LRUCache; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/eq.js +var require_eq = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/eq.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var eq = (a, b, loose) => compare(a, b, loose) === 0; + module2.exports = eq; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/neq.js +var require_neq = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/neq.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var neq = (a, b, loose) => compare(a, b, loose) !== 0; + module2.exports = neq; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/gt.js +var require_gt = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/gt.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var gt = (a, b, loose) => compare(a, b, loose) > 0; + module2.exports = gt; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/gte.js +var require_gte = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/gte.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var gte = (a, b, loose) => compare(a, b, loose) >= 0; + module2.exports = gte; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/lt.js +var require_lt = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/lt.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var lt = (a, b, loose) => compare(a, b, loose) < 0; + module2.exports = lt; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/lte.js +var require_lte = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/lte.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var lte = (a, b, loose) => compare(a, b, loose) <= 0; + module2.exports = lte; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/cmp.js +var require_cmp = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/cmp.js"(exports2, module2) { + "use strict"; + var eq = require_eq(); + var neq = require_neq(); + var gt = require_gt(); + var gte = require_gte(); + var lt = require_lt(); + var lte = require_lte(); + var cmp = (a, op, b, loose) => { + switch (op) { + case "===": + if (typeof a === "object") { + a = a.version; + } + if (typeof b === "object") { + b = b.version; + } + return a === b; + case "!==": + if (typeof a === "object") { + a = a.version; + } + if (typeof b === "object") { + b = b.version; + } + return a !== b; + case "": + case "=": + case "==": + return eq(a, b, loose); + case "!=": + return neq(a, b, loose); + case ">": + return gt(a, b, loose); + case ">=": + return gte(a, b, loose); + case "<": + return lt(a, b, loose); + case "<=": + return lte(a, b, loose); + default: + throw new TypeError(`Invalid operator: ${op}`); + } + }; + module2.exports = cmp; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/classes/comparator.js +var require_comparator = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/classes/comparator.js"(exports2, module2) { + "use strict"; + var ANY = Symbol("SemVer ANY"); + var Comparator = class _Comparator { + static get ANY() { + return ANY; + } + constructor(comp, options) { + options = parseOptions(options); + if (comp instanceof _Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; + } + } + comp = comp.trim().split(/\s+/).join(" "); + debug2("comparator", comp, options); + this.options = options; + this.loose = !!options.loose; + this.parse(comp); + if (this.semver === ANY) { + this.value = ""; + } else { + this.value = this.operator + this.semver.version; + } + debug2("comp", this); + } + parse(comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; + const m = comp.match(r); + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`); + } + this.operator = m[1] !== void 0 ? m[1] : ""; + if (this.operator === "=") { + this.operator = ""; + } + if (!m[2]) { + this.semver = ANY; + } else { + this.semver = new SemVer3(m[2], this.options.loose); + } + } + toString() { + return this.value; + } + test(version2) { + debug2("Comparator.test", version2, this.options.loose); + if (this.semver === ANY || version2 === ANY) { + return true; + } + if (typeof version2 === "string") { + try { + version2 = new SemVer3(version2, this.options); + } catch (er) { + return false; + } + } + return cmp(version2, this.operator, this.semver, this.options); + } + intersects(comp, options) { + if (!(comp instanceof _Comparator)) { + throw new TypeError("a Comparator is required"); + } + if (this.operator === "") { + if (this.value === "") { + return true; + } + return new Range3(comp.value, options).test(this.value); + } else if (comp.operator === "") { + if (comp.value === "") { + return true; + } + return new Range3(this.value, options).test(comp.semver); + } + options = parseOptions(options); + if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) { + return false; + } + if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) { + return false; + } + if (this.operator.startsWith(">") && comp.operator.startsWith(">")) { + return true; + } + if (this.operator.startsWith("<") && comp.operator.startsWith("<")) { + return true; + } + if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) { + return true; + } + if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) { + return true; + } + if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) { + return true; + } + return false; + } + }; + module2.exports = Comparator; + var parseOptions = require_parse_options(); + var { safeRe: re, t } = require_re(); + var cmp = require_cmp(); + var debug2 = require_debug(); + var SemVer3 = require_semver(); + var Range3 = require_range(); + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/classes/range.js +var require_range = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/classes/range.js"(exports2, module2) { + "use strict"; + var SPACE_CHARACTERS = /\s+/g; + var Range3 = class _Range { + constructor(range, options) { + options = parseOptions(options); + if (range instanceof _Range) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; + } else { + return new _Range(range.raw, options); + } + } + if (range instanceof Comparator) { + this.raw = range.value; + this.set = [[range]]; + this.formatted = void 0; + return this; + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().replace(SPACE_CHARACTERS, " "); + this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length); + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${this.raw}`); + } + if (this.set.length > 1) { + const first = this.set[0]; + this.set = this.set.filter((c) => !isNullSet(c[0])); + if (this.set.length === 0) { + this.set = [first]; + } else if (this.set.length > 1) { + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c]; + break; + } + } + } + } + this.formatted = void 0; + } + get range() { + if (this.formatted === void 0) { + this.formatted = ""; + for (let i = 0; i < this.set.length; i++) { + if (i > 0) { + this.formatted += "||"; + } + const comps = this.set[i]; + for (let k = 0; k < comps.length; k++) { + if (k > 0) { + this.formatted += " "; + } + this.formatted += comps[k].toString().trim(); + } + } + } + return this.formatted; + } + format() { + return this.range; + } + toString() { + return this.range; + } + parseRange(range) { + const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE); + const memoKey = memoOpts + ":" + range; + const cached = cache2.get(memoKey); + if (cached) { + return cached; + } + const loose = this.options.loose; + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)); + debug2("hyphen replace", range); + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); + debug2("comparator trim", range); + range = range.replace(re[t.TILDETRIM], tildeTrimReplace); + debug2("tilde trim", range); + range = range.replace(re[t.CARETTRIM], caretTrimReplace); + debug2("caret trim", range); + let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options)); + if (loose) { + rangeList = rangeList.filter((comp) => { + debug2("loose invalid filter", comp, this.options); + return !!comp.match(re[t.COMPARATORLOOSE]); + }); + } + debug2("range list", rangeList); + const rangeMap = /* @__PURE__ */ new Map(); + const comparators = rangeList.map((comp) => new Comparator(comp, this.options)); + for (const comp of comparators) { + if (isNullSet(comp)) { + return [comp]; + } + rangeMap.set(comp.value, comp); + } + if (rangeMap.size > 1 && rangeMap.has("")) { + rangeMap.delete(""); + } + const result = [...rangeMap.values()]; + cache2.set(memoKey, result); + return result; + } + intersects(range, options) { + if (!(range instanceof _Range)) { + throw new TypeError("a Range is required"); + } + return this.set.some((thisComparators) => { + return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => { + return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options); + }); + }); + }); + }); + } + // if ANY of the sets match ALL of its comparators, then pass + test(version2) { + if (!version2) { + return false; + } + if (typeof version2 === "string") { + try { + version2 = new SemVer3(version2, this.options); + } catch (er) { + return false; + } + } + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version2, this.options)) { + return true; + } + } + return false; + } + }; + module2.exports = Range3; + var LRU = require_lrucache(); + var cache2 = new LRU(); + var parseOptions = require_parse_options(); + var Comparator = require_comparator(); + var debug2 = require_debug(); + var SemVer3 = require_semver(); + var { + safeRe: re, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace + } = require_re(); + var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants(); + var isNullSet = (c) => c.value === "<0.0.0-0"; + var isAny = (c) => c.value === ""; + var isSatisfiable = (comparators, options) => { + let result = true; + const remainingComparators = comparators.slice(); + let testComparator = remainingComparators.pop(); + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options); + }); + testComparator = remainingComparators.pop(); + } + return result; + }; + var parseComparator = (comp, options) => { + comp = comp.replace(re[t.BUILD], ""); + debug2("comp", comp, options); + comp = replaceCarets(comp, options); + debug2("caret", comp); + comp = replaceTildes(comp, options); + debug2("tildes", comp); + comp = replaceXRanges(comp, options); + debug2("xrange", comp); + comp = replaceStars(comp, options); + debug2("stars", comp); + return comp; + }; + var isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; + var replaceTildes = (comp, options) => { + return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" "); + }; + var replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; + return comp.replace(r, (_, M, m, p, pr) => { + debug2("tilde", comp, _, M, m, p, pr); + let ret; + if (isX(M)) { + ret = ""; + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0`; + } else if (isX(p)) { + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`; + } else if (pr) { + debug2("replaceTilde pr", pr); + ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; + } else { + ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; + } + debug2("tilde return", ret); + return ret; + }); + }; + var replaceCarets = (comp, options) => { + return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" "); + }; + var replaceCaret = (comp, options) => { + debug2("caret", comp, options); + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; + const z = options.includePrerelease ? "-0" : ""; + return comp.replace(r, (_, M, m, p, pr) => { + debug2("caret", comp, _, M, m, p, pr); + let ret; + if (isX(M)) { + ret = ""; + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`; + } else if (isX(p)) { + if (M === "0") { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`; + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`; + } + } else if (pr) { + debug2("replaceCaret pr", pr); + if (M === "0") { + if (m === "0") { + ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`; + } else { + ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; + } + } else { + ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`; + } + } else { + debug2("no pr"); + if (M === "0") { + if (m === "0") { + ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`; + } else { + ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`; + } + } else { + ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`; + } + } + debug2("caret return", ret); + return ret; + }); + }; + var replaceXRanges = (comp, options) => { + debug2("replaceXRanges", comp, options); + return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" "); + }; + var replaceXRange = (comp, options) => { + comp = comp.trim(); + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug2("xRange", comp, ret, gtlt, M, m, p, pr); + const xM = isX(M); + const xm = xM || isX(m); + const xp = xm || isX(p); + const anyX = xp; + if (gtlt === "=" && anyX) { + gtlt = ""; + } + pr = options.includePrerelease ? "-0" : ""; + if (xM) { + if (gtlt === ">" || gtlt === "<") { + ret = "<0.0.0-0"; + } else { + ret = "*"; + } + } else if (gtlt && anyX) { + if (xm) { + m = 0; + } + p = 0; + if (gtlt === ">") { + gtlt = ">="; + if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else { + m = +m + 1; + p = 0; + } + } else if (gtlt === "<=") { + gtlt = "<"; + if (xm) { + M = +M + 1; + } else { + m = +m + 1; + } + } + if (gtlt === "<") { + pr = "-0"; + } + ret = `${gtlt + M}.${m}.${p}${pr}`; + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`; + } else if (xp) { + ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`; + } + debug2("xRange return", ret); + return ret; + }); + }; + var replaceStars = (comp, options) => { + debug2("replaceStars", comp, options); + return comp.trim().replace(re[t.STAR], ""); + }; + var replaceGTE0 = (comp, options) => { + debug2("replaceGTE0", comp, options); + return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], ""); + }; + var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => { + if (isX(fM)) { + from = ""; + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? "-0" : ""}`; + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`; + } else if (fpr) { + from = `>=${from}`; + } else { + from = `>=${from}${incPr ? "-0" : ""}`; + } + if (isX(tM)) { + to = ""; + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0`; + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0`; + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}`; + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0`; + } else { + to = `<=${to}`; + } + return `${from} ${to}`.trim(); + }; + var testSet = (set, version2, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version2)) { + return false; + } + } + if (version2.prerelease.length && !options.includePrerelease) { + for (let i = 0; i < set.length; i++) { + debug2(set[i].semver); + if (set[i].semver === Comparator.ANY) { + continue; + } + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver; + if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) { + return true; + } + } + } + return false; + } + return true; + }; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/ranges/valid.js +var require_valid2 = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/ranges/valid.js"(exports2, module2) { + "use strict"; + var Range3 = require_range(); + var validRange = (range, options) => { + try { + return new Range3(range, options).range || "*"; + } catch (er) { + return null; + } + }; + module2.exports = validRange; + } +}); + +// .yarn/cache/ms-npm-2.1.3-81ff3cfac1-d924b57e73.zip/node_modules/ms/index.js +var require_ms = __commonJS({ + ".yarn/cache/ms-npm-2.1.3-81ff3cfac1-d924b57e73.zip/node_modules/ms/index.js"(exports2, module2) { + var s = 1e3; + var m = s * 60; + var h = m * 60; + var d = h * 24; + var w = d * 7; + var y = d * 365.25; + module2.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === "string" && val.length > 0) { + return parse4(val); + } else if (type === "number" && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) + ); + }; + function parse4(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || "ms").toLowerCase(); + switch (type) { + case "years": + case "year": + case "yrs": + case "yr": + case "y": + return n * y; + case "weeks": + case "week": + case "w": + return n * w; + case "days": + case "day": + case "d": + return n * d; + case "hours": + case "hour": + case "hrs": + case "hr": + case "h": + return n * h; + case "minutes": + case "minute": + case "mins": + case "min": + case "m": + return n * m; + case "seconds": + case "second": + case "secs": + case "sec": + case "s": + return n * s; + case "milliseconds": + case "millisecond": + case "msecs": + case "msec": + case "ms": + return n; + default: + return void 0; + } + } + function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + "d"; + } + if (msAbs >= h) { + return Math.round(ms / h) + "h"; + } + if (msAbs >= m) { + return Math.round(ms / m) + "m"; + } + if (msAbs >= s) { + return Math.round(ms / s) + "s"; + } + return ms + "ms"; + } + function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural2(ms, msAbs, d, "day"); + } + if (msAbs >= h) { + return plural2(ms, msAbs, h, "hour"); + } + if (msAbs >= m) { + return plural2(ms, msAbs, m, "minute"); + } + if (msAbs >= s) { + return plural2(ms, msAbs, s, "second"); + } + return ms + " ms"; + } + function plural2(ms, msAbs, n, name2) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + " " + name2 + (isPlural ? "s" : ""); + } + } +}); + +// .yarn/__virtual__/debug-virtual-436baa457e/0/cache/debug-npm-4.4.3-0105c6123a-d79136ec6c.zip/node_modules/debug/src/common.js +var require_common = __commonJS({ + ".yarn/__virtual__/debug-virtual-436baa457e/0/cache/debug-npm-4.4.3-0105c6123a-d79136ec6c.zip/node_modules/debug/src/common.js"(exports2, module2) { + function setup(env2) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = require_ms(); + createDebug.destroy = destroy; + Object.keys(env2).forEach((key) => { + createDebug[key] = env2[key]; + }); + createDebug.names = []; + createDebug.skips = []; + createDebug.formatters = {}; + function selectColor(namespace) { + let hash = 0; + for (let i = 0; i < namespace.length; i++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; + } + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + function debug2(...args) { + if (!debug2.enabled) { + return; + } + const self2 = debug2; + const curr = Number(/* @__PURE__ */ new Date()); + const ms = curr - (prevTime || curr); + self2.diff = ms; + self2.prev = prevTime; + self2.curr = curr; + prevTime = curr; + args[0] = createDebug.coerce(args[0]); + if (typeof args[0] !== "string") { + args.unshift("%O"); + } + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + if (match === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === "function") { + const val = args[index]; + match = formatter.call(self2, val); + args.splice(index, 1); + index--; + } + return match; + }); + createDebug.formatArgs.call(self2, args); + const logFn = self2.log || createDebug.log; + logFn.apply(self2, args); + } + debug2.namespace = namespace; + debug2.useColors = createDebug.useColors(); + debug2.color = createDebug.selectColor(namespace); + debug2.extend = extend; + debug2.destroy = createDebug.destroy; + Object.defineProperty(debug2, "enabled", { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + return enabledCache; + }, + set: (v) => { + enableOverride = v; + } + }); + if (typeof createDebug.init === "function") { + createDebug.init(debug2); + } + return debug2; + } + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + createDebug.names = []; + createDebug.skips = []; + const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean); + for (const ns of split) { + if (ns[0] === "-") { + createDebug.skips.push(ns.slice(1)); + } else { + createDebug.names.push(ns); + } + } + } + function matchesTemplate(search, template) { + let searchIndex = 0; + let templateIndex = 0; + let starIndex = -1; + let matchIndex = 0; + while (searchIndex < search.length) { + if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) { + if (template[templateIndex] === "*") { + starIndex = templateIndex; + matchIndex = searchIndex; + templateIndex++; + } else { + searchIndex++; + templateIndex++; + } + } else if (starIndex !== -1) { + templateIndex = starIndex + 1; + matchIndex++; + searchIndex = matchIndex; + } else { + return false; + } + } + while (templateIndex < template.length && template[templateIndex] === "*") { + templateIndex++; + } + return templateIndex === template.length; + } + function disable() { + const namespaces = [ + ...createDebug.names, + ...createDebug.skips.map((namespace) => "-" + namespace) + ].join(","); + createDebug.enable(""); + return namespaces; + } + function enabled(name2) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name2, skip)) { + return false; + } + } + for (const ns of createDebug.names) { + if (matchesTemplate(name2, ns)) { + return true; + } + } + return false; + } + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + function destroy() { + console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); + } + createDebug.enable(createDebug.load()); + return createDebug; + } + module2.exports = setup; + } +}); + +// .yarn/__virtual__/debug-virtual-436baa457e/0/cache/debug-npm-4.4.3-0105c6123a-d79136ec6c.zip/node_modules/debug/src/browser.js +var require_browser = __commonJS({ + ".yarn/__virtual__/debug-virtual-436baa457e/0/cache/debug-npm-4.4.3-0105c6123a-d79136ec6c.zip/node_modules/debug/src/browser.js"(exports2, module2) { + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load; + exports2.useColors = useColors; + exports2.storage = localstorage(); + exports2.destroy = /* @__PURE__ */ (() => { + let warned = false; + return () => { + if (!warned) { + warned = true; + console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); + } + }; + })(); + exports2.colors = [ + "#0000CC", + "#0000FF", + "#0033CC", + "#0033FF", + "#0066CC", + "#0066FF", + "#0099CC", + "#0099FF", + "#00CC00", + "#00CC33", + "#00CC66", + "#00CC99", + "#00CCCC", + "#00CCFF", + "#3300CC", + "#3300FF", + "#3333CC", + "#3333FF", + "#3366CC", + "#3366FF", + "#3399CC", + "#3399FF", + "#33CC00", + "#33CC33", + "#33CC66", + "#33CC99", + "#33CCCC", + "#33CCFF", + "#6600CC", + "#6600FF", + "#6633CC", + "#6633FF", + "#66CC00", + "#66CC33", + "#9900CC", + "#9900FF", + "#9933CC", + "#9933FF", + "#99CC00", + "#99CC33", + "#CC0000", + "#CC0033", + "#CC0066", + "#CC0099", + "#CC00CC", + "#CC00FF", + "#CC3300", + "#CC3333", + "#CC3366", + "#CC3399", + "#CC33CC", + "#CC33FF", + "#CC6600", + "#CC6633", + "#CC9900", + "#CC9933", + "#CCCC00", + "#CCCC33", + "#FF0000", + "#FF0033", + "#FF0066", + "#FF0099", + "#FF00CC", + "#FF00FF", + "#FF3300", + "#FF3333", + "#FF3366", + "#FF3399", + "#FF33CC", + "#FF33FF", + "#FF6600", + "#FF6633", + "#FF9900", + "#FF9933", + "#FFCC00", + "#FFCC33" + ]; + function useColors() { + if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { + return true; + } + if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + let m; + return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 + typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker + typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); + } + function formatArgs(args) { + args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); + if (!this.useColors) { + return; + } + const c = "color: " + this.color; + args.splice(1, 0, c, "color: inherit"); + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, (match) => { + if (match === "%%") { + return; + } + index++; + if (match === "%c") { + lastC = index; + } + }); + args.splice(lastC, 0, c); + } + exports2.log = console.debug || console.log || (() => { + }); + function save(namespaces) { + try { + if (namespaces) { + exports2.storage.setItem("debug", namespaces); + } else { + exports2.storage.removeItem("debug"); + } + } catch (error) { + } + } + function load() { + let r; + try { + r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); + } catch (error) { + } + if (!r && typeof process !== "undefined" && "env" in process) { + r = process.env.DEBUG; + } + return r; + } + function localstorage() { + try { + return localStorage; + } catch (error) { + } + } + module2.exports = require_common()(exports2); + var { formatters } = module2.exports; + formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (error) { + return "[UnexpectedJSONParseError]: " + error.message; + } + }; + } +}); + +// .yarn/cache/supports-color-npm-10.2.2-e43ac15f9f-fb28dd7e0c.zip/node_modules/supports-color/index.js +var supports_color_exports = {}; +__export(supports_color_exports, { + createSupportsColor: () => createSupportsColor, + default: () => supports_color_default +}); +function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) { + const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf("--"); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); +} +function envForceColor() { + if (!("FORCE_COLOR" in env)) { + return; + } + if (env.FORCE_COLOR === "true") { + return 1; + } + if (env.FORCE_COLOR === "false") { + return 0; + } + if (env.FORCE_COLOR.length === 0) { + return 1; + } + const level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3); + if (![0, 1, 2, 3].includes(level)) { + return; + } + return level; +} +function translateLevel(level) { + if (level === 0) { + return false; + } + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +} +function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) { + const noFlagForceColor = envForceColor(); + if (noFlagForceColor !== void 0) { + flagForceColor = noFlagForceColor; + } + const forceColor = sniffFlags ? flagForceColor : noFlagForceColor; + if (forceColor === 0) { + return 0; + } + if (sniffFlags) { + if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { + return 3; + } + if (hasFlag("color=256")) { + return 2; + } + } + if ("TF_BUILD" in env && "AGENT_NAME" in env) { + return 1; + } + if (haveStream && !streamIsTTY && forceColor === void 0) { + return 0; + } + const min = forceColor || 0; + if (env.TERM === "dumb") { + return min; + } + if (import_node_process.default.platform === "win32") { + const osRelease = import_node_os.default.release().split("."); + if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + return 1; + } + if ("CI" in env) { + if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) { + return 3; + } + if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { + return 1; + } + return min; + } + if ("TEAMCITY_VERSION" in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + if (env.COLORTERM === "truecolor") { + return 3; + } + if (env.TERM === "xterm-kitty") { + return 3; + } + if (env.TERM === "xterm-ghostty") { + return 3; + } + if (env.TERM === "wezterm") { + return 3; + } + if ("TERM_PROGRAM" in env) { + const version2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (env.TERM_PROGRAM) { + case "iTerm.app": { + return version2 >= 3 ? 3 : 2; + } + case "Apple_Terminal": { + return 2; + } + } + } + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + if ("COLORTERM" in env) { + return 1; + } + return min; +} +function createSupportsColor(stream, options = {}) { + const level = _supportsColor(stream, { + streamIsTTY: stream && stream.isTTY, + ...options + }); + return translateLevel(level); +} +var import_node_process, import_node_os, import_node_tty, env, flagForceColor, supportsColor, supports_color_default; +var init_supports_color = __esm({ + ".yarn/cache/supports-color-npm-10.2.2-e43ac15f9f-fb28dd7e0c.zip/node_modules/supports-color/index.js"() { + import_node_process = __toESM(require("node:process"), 1); + import_node_os = __toESM(require("node:os"), 1); + import_node_tty = __toESM(require("node:tty"), 1); + ({ env } = import_node_process.default); + if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { + flagForceColor = 0; + } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { + flagForceColor = 1; + } + supportsColor = { + stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }), + stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) }) + }; + supports_color_default = supportsColor; + } +}); + +// .yarn/__virtual__/debug-virtual-436baa457e/0/cache/debug-npm-4.4.3-0105c6123a-d79136ec6c.zip/node_modules/debug/src/node.js +var require_node2 = __commonJS({ + ".yarn/__virtual__/debug-virtual-436baa457e/0/cache/debug-npm-4.4.3-0105c6123a-d79136ec6c.zip/node_modules/debug/src/node.js"(exports2, module2) { + var tty2 = require("tty"); + var util = require("util"); + exports2.init = init; + exports2.log = log2; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load; + exports2.useColors = useColors; + exports2.destroy = util.deprecate( + () => { + }, + "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`." + ); + exports2.colors = [6, 2, 3, 4, 5, 1]; + try { + const supportsColor2 = (init_supports_color(), __toCommonJS(supports_color_exports)); + if (supportsColor2 && (supportsColor2.stderr || supportsColor2).level >= 2) { + exports2.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } + } catch (error) { + } + exports2.inspectOpts = Object.keys(process.env).filter((key) => { + return /^debug_/i.test(key); + }).reduce((obj, key) => { + const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === "null") { + val = null; + } else { + val = Number(val); + } + obj[prop] = val; + return obj; + }, {}); + function useColors() { + return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty2.isatty(process.stderr.fd); + } + function formatArgs(args) { + const { namespace: name2, useColors: useColors2 } = this; + if (useColors2) { + const c = this.color; + const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c); + const prefix = ` ${colorCode};1m${name2} \x1B[0m`; + args[0] = prefix + args[0].split("\n").join("\n" + prefix); + args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m"); + } else { + args[0] = getDate() + name2 + " " + args[0]; + } + } + function getDate() { + if (exports2.inspectOpts.hideDate) { + return ""; + } + return (/* @__PURE__ */ new Date()).toISOString() + " "; + } + function log2(...args) { + return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); + } + function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + delete process.env.DEBUG; + } + } + function load() { + return process.env.DEBUG; + } + function init(debug2) { + debug2.inspectOpts = {}; + const keys = Object.keys(exports2.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug2.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; + } + } + module2.exports = require_common()(exports2); + var { formatters } = module2.exports; + formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); + }; + formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); + }; + } +}); + +// .yarn/__virtual__/debug-virtual-436baa457e/0/cache/debug-npm-4.4.3-0105c6123a-d79136ec6c.zip/node_modules/debug/src/index.js +var require_src = __commonJS({ + ".yarn/__virtual__/debug-virtual-436baa457e/0/cache/debug-npm-4.4.3-0105c6123a-d79136ec6c.zip/node_modules/debug/src/index.js"(exports2, module2) { + if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { + module2.exports = require_browser(); + } else { + module2.exports = require_node2(); + } + } +}); + +// .yarn/cache/proxy-from-env-npm-1.1.0-c13d07f26b-fe7dd8b1bd.zip/node_modules/proxy-from-env/index.js +var require_proxy_from_env = __commonJS({ + ".yarn/cache/proxy-from-env-npm-1.1.0-c13d07f26b-fe7dd8b1bd.zip/node_modules/proxy-from-env/index.js"(exports2) { + "use strict"; + var parseUrl = require("url").parse; + var DEFAULT_PORTS = { + ftp: 21, + gopher: 70, + http: 80, + https: 443, + ws: 80, + wss: 443 + }; + var stringEndsWith = String.prototype.endsWith || function(s) { + return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1; + }; + function getProxyForUrl(url) { + var parsedUrl = typeof url === "string" ? parseUrl(url) : url || {}; + var proto = parsedUrl.protocol; + var hostname = parsedUrl.host; + var port = parsedUrl.port; + if (typeof hostname !== "string" || !hostname || typeof proto !== "string") { + return ""; + } + proto = proto.split(":", 1)[0]; + hostname = hostname.replace(/:\d*$/, ""); + port = parseInt(port) || DEFAULT_PORTS[proto] || 0; + if (!shouldProxy(hostname, port)) { + return ""; + } + var proxy = getEnv("npm_config_" + proto + "_proxy") || getEnv(proto + "_proxy") || getEnv("npm_config_proxy") || getEnv("all_proxy"); + if (proxy && proxy.indexOf("://") === -1) { + proxy = proto + "://" + proxy; + } + return proxy; + } + function shouldProxy(hostname, port) { + var NO_PROXY = (getEnv("npm_config_no_proxy") || getEnv("no_proxy")).toLowerCase(); + if (!NO_PROXY) { + return true; + } + if (NO_PROXY === "*") { + return false; + } + return NO_PROXY.split(/[,\s]/).every(function(proxy) { + if (!proxy) { + return true; + } + var parsedProxy = proxy.match(/^(.+):(\d+)$/); + var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy; + var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0; + if (parsedProxyPort && parsedProxyPort !== port) { + return true; + } + if (!/^[.*]/.test(parsedProxyHostname)) { + return hostname !== parsedProxyHostname; + } + if (parsedProxyHostname.charAt(0) === "*") { + parsedProxyHostname = parsedProxyHostname.slice(1); + } + return !stringEndsWith.call(hostname, parsedProxyHostname); + }); + } + function getEnv(key) { + return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ""; + } + exports2.getProxyForUrl = getProxyForUrl; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/core/errors.js +var require_errors = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/core/errors.js"(exports2, module2) { + "use strict"; + var kUndiciError = Symbol.for("undici.error.UND_ERR"); + var UndiciError = class extends Error { + constructor(message) { + super(message); + this.name = "UndiciError"; + this.code = "UND_ERR"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kUndiciError] === true; + } + [kUndiciError] = true; + }; + var kConnectTimeoutError = Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"); + var ConnectTimeoutError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "ConnectTimeoutError"; + this.message = message || "Connect Timeout Error"; + this.code = "UND_ERR_CONNECT_TIMEOUT"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kConnectTimeoutError] === true; + } + [kConnectTimeoutError] = true; + }; + var kHeadersTimeoutError = Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"); + var HeadersTimeoutError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "HeadersTimeoutError"; + this.message = message || "Headers Timeout Error"; + this.code = "UND_ERR_HEADERS_TIMEOUT"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kHeadersTimeoutError] === true; + } + [kHeadersTimeoutError] = true; + }; + var kHeadersOverflowError = Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"); + var HeadersOverflowError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "HeadersOverflowError"; + this.message = message || "Headers Overflow Error"; + this.code = "UND_ERR_HEADERS_OVERFLOW"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kHeadersOverflowError] === true; + } + [kHeadersOverflowError] = true; + }; + var kBodyTimeoutError = Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"); + var BodyTimeoutError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "BodyTimeoutError"; + this.message = message || "Body Timeout Error"; + this.code = "UND_ERR_BODY_TIMEOUT"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kBodyTimeoutError] === true; + } + [kBodyTimeoutError] = true; + }; + var kResponseStatusCodeError = Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"); + var ResponseStatusCodeError = class extends UndiciError { + constructor(message, statusCode, headers, body) { + super(message); + this.name = "ResponseStatusCodeError"; + this.message = message || "Response Status Code Error"; + this.code = "UND_ERR_RESPONSE_STATUS_CODE"; + this.body = body; + this.status = statusCode; + this.statusCode = statusCode; + this.headers = headers; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kResponseStatusCodeError] === true; + } + [kResponseStatusCodeError] = true; + }; + var kInvalidArgumentError = Symbol.for("undici.error.UND_ERR_INVALID_ARG"); + var InvalidArgumentError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "InvalidArgumentError"; + this.message = message || "Invalid Argument Error"; + this.code = "UND_ERR_INVALID_ARG"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kInvalidArgumentError] === true; + } + [kInvalidArgumentError] = true; + }; + var kInvalidReturnValueError = Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"); + var InvalidReturnValueError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "InvalidReturnValueError"; + this.message = message || "Invalid Return Value Error"; + this.code = "UND_ERR_INVALID_RETURN_VALUE"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kInvalidReturnValueError] === true; + } + [kInvalidReturnValueError] = true; + }; + var kAbortError = Symbol.for("undici.error.UND_ERR_ABORT"); + var AbortError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "AbortError"; + this.message = message || "The operation was aborted"; + this.code = "UND_ERR_ABORT"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kAbortError] === true; + } + [kAbortError] = true; + }; + var kRequestAbortedError = Symbol.for("undici.error.UND_ERR_ABORTED"); + var RequestAbortedError = class extends AbortError { + constructor(message) { + super(message); + this.name = "AbortError"; + this.message = message || "Request aborted"; + this.code = "UND_ERR_ABORTED"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kRequestAbortedError] === true; + } + [kRequestAbortedError] = true; + }; + var kInformationalError = Symbol.for("undici.error.UND_ERR_INFO"); + var InformationalError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "InformationalError"; + this.message = message || "Request information"; + this.code = "UND_ERR_INFO"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kInformationalError] === true; + } + [kInformationalError] = true; + }; + var kRequestContentLengthMismatchError = Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"); + var RequestContentLengthMismatchError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "RequestContentLengthMismatchError"; + this.message = message || "Request body length does not match content-length header"; + this.code = "UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kRequestContentLengthMismatchError] === true; + } + [kRequestContentLengthMismatchError] = true; + }; + var kResponseContentLengthMismatchError = Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"); + var ResponseContentLengthMismatchError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "ResponseContentLengthMismatchError"; + this.message = message || "Response body length does not match content-length header"; + this.code = "UND_ERR_RES_CONTENT_LENGTH_MISMATCH"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kResponseContentLengthMismatchError] === true; + } + [kResponseContentLengthMismatchError] = true; + }; + var kClientDestroyedError = Symbol.for("undici.error.UND_ERR_DESTROYED"); + var ClientDestroyedError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "ClientDestroyedError"; + this.message = message || "The client is destroyed"; + this.code = "UND_ERR_DESTROYED"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kClientDestroyedError] === true; + } + [kClientDestroyedError] = true; + }; + var kClientClosedError = Symbol.for("undici.error.UND_ERR_CLOSED"); + var ClientClosedError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "ClientClosedError"; + this.message = message || "The client is closed"; + this.code = "UND_ERR_CLOSED"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kClientClosedError] === true; + } + [kClientClosedError] = true; + }; + var kSocketError = Symbol.for("undici.error.UND_ERR_SOCKET"); + var SocketError = class extends UndiciError { + constructor(message, socket) { + super(message); + this.name = "SocketError"; + this.message = message || "Socket error"; + this.code = "UND_ERR_SOCKET"; + this.socket = socket; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kSocketError] === true; + } + [kSocketError] = true; + }; + var kNotSupportedError = Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"); + var NotSupportedError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "NotSupportedError"; + this.message = message || "Not supported error"; + this.code = "UND_ERR_NOT_SUPPORTED"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kNotSupportedError] === true; + } + [kNotSupportedError] = true; + }; + var kBalancedPoolMissingUpstreamError = Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"); + var BalancedPoolMissingUpstreamError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "MissingUpstreamError"; + this.message = message || "No upstream has been added to the BalancedPool"; + this.code = "UND_ERR_BPL_MISSING_UPSTREAM"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kBalancedPoolMissingUpstreamError] === true; + } + [kBalancedPoolMissingUpstreamError] = true; + }; + var kHTTPParserError = Symbol.for("undici.error.UND_ERR_HTTP_PARSER"); + var HTTPParserError = class extends Error { + constructor(message, code2, data) { + super(message); + this.name = "HTTPParserError"; + this.code = code2 ? `HPE_${code2}` : void 0; + this.data = data ? data.toString() : void 0; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kHTTPParserError] === true; + } + [kHTTPParserError] = true; + }; + var kResponseExceededMaxSizeError = Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"); + var ResponseExceededMaxSizeError = class extends UndiciError { + constructor(message) { + super(message); + this.name = "ResponseExceededMaxSizeError"; + this.message = message || "Response content exceeded max size"; + this.code = "UND_ERR_RES_EXCEEDED_MAX_SIZE"; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kResponseExceededMaxSizeError] === true; + } + [kResponseExceededMaxSizeError] = true; + }; + var kRequestRetryError = Symbol.for("undici.error.UND_ERR_REQ_RETRY"); + var RequestRetryError = class extends UndiciError { + constructor(message, code2, { headers, data }) { + super(message); + this.name = "RequestRetryError"; + this.message = message || "Request retry error"; + this.code = "UND_ERR_REQ_RETRY"; + this.statusCode = code2; + this.data = data; + this.headers = headers; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kRequestRetryError] === true; + } + [kRequestRetryError] = true; + }; + var kResponseError = Symbol.for("undici.error.UND_ERR_RESPONSE"); + var ResponseError = class extends UndiciError { + constructor(message, code2, { headers, data }) { + super(message); + this.name = "ResponseError"; + this.message = message || "Response error"; + this.code = "UND_ERR_RESPONSE"; + this.statusCode = code2; + this.data = data; + this.headers = headers; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kResponseError] === true; + } + [kResponseError] = true; + }; + var kSecureProxyConnectionError = Symbol.for("undici.error.UND_ERR_PRX_TLS"); + var SecureProxyConnectionError = class extends UndiciError { + constructor(cause, message, options) { + super(message, { cause, ...options ?? {} }); + this.name = "SecureProxyConnectionError"; + this.message = message || "Secure Proxy Connection failed"; + this.code = "UND_ERR_PRX_TLS"; + this.cause = cause; + } + static [Symbol.hasInstance](instance) { + return instance && instance[kSecureProxyConnectionError] === true; + } + [kSecureProxyConnectionError] = true; + }; + module2.exports = { + AbortError, + HTTPParserError, + UndiciError, + HeadersTimeoutError, + HeadersOverflowError, + BodyTimeoutError, + RequestContentLengthMismatchError, + ConnectTimeoutError, + ResponseStatusCodeError, + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError, + ClientDestroyedError, + ClientClosedError, + InformationalError, + SocketError, + NotSupportedError, + ResponseContentLengthMismatchError, + BalancedPoolMissingUpstreamError, + ResponseExceededMaxSizeError, + RequestRetryError, + ResponseError, + SecureProxyConnectionError + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/core/symbols.js +var require_symbols = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/core/symbols.js"(exports2, module2) { + module2.exports = { + kClose: Symbol("close"), + kDestroy: Symbol("destroy"), + kDispatch: Symbol("dispatch"), + kUrl: Symbol("url"), + kWriting: Symbol("writing"), + kResuming: Symbol("resuming"), + kQueue: Symbol("queue"), + kConnect: Symbol("connect"), + kConnecting: Symbol("connecting"), + kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"), + kKeepAliveMaxTimeout: Symbol("max keep alive timeout"), + kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"), + kKeepAliveTimeoutValue: Symbol("keep alive timeout"), + kKeepAlive: Symbol("keep alive"), + kHeadersTimeout: Symbol("headers timeout"), + kBodyTimeout: Symbol("body timeout"), + kServerName: Symbol("server name"), + kLocalAddress: Symbol("local address"), + kHost: Symbol("host"), + kNoRef: Symbol("no ref"), + kBodyUsed: Symbol("used"), + kBody: Symbol("abstracted request body"), + kRunning: Symbol("running"), + kBlocking: Symbol("blocking"), + kPending: Symbol("pending"), + kSize: Symbol("size"), + kBusy: Symbol("busy"), + kQueued: Symbol("queued"), + kFree: Symbol("free"), + kConnected: Symbol("connected"), + kClosed: Symbol("closed"), + kNeedDrain: Symbol("need drain"), + kReset: Symbol("reset"), + kDestroyed: Symbol.for("nodejs.stream.destroyed"), + kResume: Symbol("resume"), + kOnError: Symbol("on error"), + kMaxHeadersSize: Symbol("max headers size"), + kRunningIdx: Symbol("running index"), + kPendingIdx: Symbol("pending index"), + kError: Symbol("error"), + kClients: Symbol("clients"), + kClient: Symbol("client"), + kParser: Symbol("parser"), + kOnDestroyed: Symbol("destroy callbacks"), + kPipelining: Symbol("pipelining"), + kSocket: Symbol("socket"), + kHostHeader: Symbol("host header"), + kConnector: Symbol("connector"), + kStrictContentLength: Symbol("strict content length"), + kMaxRedirections: Symbol("maxRedirections"), + kMaxRequests: Symbol("maxRequestsPerClient"), + kProxy: Symbol("proxy agent options"), + kCounter: Symbol("socket request counter"), + kInterceptors: Symbol("dispatch interceptors"), + kMaxResponseSize: Symbol("max response size"), + kHTTP2Session: Symbol("http2Session"), + kHTTP2SessionState: Symbol("http2Session state"), + kRetryHandlerDefaultRetry: Symbol("retry agent default retry"), + kConstruct: Symbol("constructable"), + kListeners: Symbol("listeners"), + kHTTPContext: Symbol("http context"), + kMaxConcurrentStreams: Symbol("max concurrent streams"), + kNoProxyAgent: Symbol("no proxy agent"), + kHttpProxyAgent: Symbol("http proxy agent"), + kHttpsProxyAgent: Symbol("https proxy agent") + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/core/constants.js +var require_constants2 = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/core/constants.js"(exports2, module2) { + "use strict"; + var headerNameLowerCasedRecord = {}; + var wellknownHeaderNames = [ + "Accept", + "Accept-Encoding", + "Accept-Language", + "Accept-Ranges", + "Access-Control-Allow-Credentials", + "Access-Control-Allow-Headers", + "Access-Control-Allow-Methods", + "Access-Control-Allow-Origin", + "Access-Control-Expose-Headers", + "Access-Control-Max-Age", + "Access-Control-Request-Headers", + "Access-Control-Request-Method", + "Age", + "Allow", + "Alt-Svc", + "Alt-Used", + "Authorization", + "Cache-Control", + "Clear-Site-Data", + "Connection", + "Content-Disposition", + "Content-Encoding", + "Content-Language", + "Content-Length", + "Content-Location", + "Content-Range", + "Content-Security-Policy", + "Content-Security-Policy-Report-Only", + "Content-Type", + "Cookie", + "Cross-Origin-Embedder-Policy", + "Cross-Origin-Opener-Policy", + "Cross-Origin-Resource-Policy", + "Date", + "Device-Memory", + "Downlink", + "ECT", + "ETag", + "Expect", + "Expect-CT", + "Expires", + "Forwarded", + "From", + "Host", + "If-Match", + "If-Modified-Since", + "If-None-Match", + "If-Range", + "If-Unmodified-Since", + "Keep-Alive", + "Last-Modified", + "Link", + "Location", + "Max-Forwards", + "Origin", + "Permissions-Policy", + "Pragma", + "Proxy-Authenticate", + "Proxy-Authorization", + "RTT", + "Range", + "Referer", + "Referrer-Policy", + "Refresh", + "Retry-After", + "Sec-WebSocket-Accept", + "Sec-WebSocket-Extensions", + "Sec-WebSocket-Key", + "Sec-WebSocket-Protocol", + "Sec-WebSocket-Version", + "Server", + "Server-Timing", + "Service-Worker-Allowed", + "Service-Worker-Navigation-Preload", + "Set-Cookie", + "SourceMap", + "Strict-Transport-Security", + "Supports-Loading-Mode", + "TE", + "Timing-Allow-Origin", + "Trailer", + "Transfer-Encoding", + "Upgrade", + "Upgrade-Insecure-Requests", + "User-Agent", + "Vary", + "Via", + "WWW-Authenticate", + "X-Content-Type-Options", + "X-DNS-Prefetch-Control", + "X-Frame-Options", + "X-Permitted-Cross-Domain-Policies", + "X-Powered-By", + "X-Requested-With", + "X-XSS-Protection" + ]; + for (let i = 0; i < wellknownHeaderNames.length; ++i) { + const key = wellknownHeaderNames[i]; + const lowerCasedKey = key.toLowerCase(); + headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] = lowerCasedKey; + } + Object.setPrototypeOf(headerNameLowerCasedRecord, null); + module2.exports = { + wellknownHeaderNames, + headerNameLowerCasedRecord + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/core/tree.js +var require_tree = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/core/tree.js"(exports2, module2) { + "use strict"; + var { + wellknownHeaderNames, + headerNameLowerCasedRecord + } = require_constants2(); + var TstNode = class _TstNode { + /** @type {any} */ + value = null; + /** @type {null | TstNode} */ + left = null; + /** @type {null | TstNode} */ + middle = null; + /** @type {null | TstNode} */ + right = null; + /** @type {number} */ + code; + /** + * @param {string} key + * @param {any} value + * @param {number} index + */ + constructor(key, value, index) { + if (index === void 0 || index >= key.length) { + throw new TypeError("Unreachable"); + } + const code2 = this.code = key.charCodeAt(index); + if (code2 > 127) { + throw new TypeError("key must be ascii string"); + } + if (key.length !== ++index) { + this.middle = new _TstNode(key, value, index); + } else { + this.value = value; + } + } + /** + * @param {string} key + * @param {any} value + */ + add(key, value) { + const length = key.length; + if (length === 0) { + throw new TypeError("Unreachable"); + } + let index = 0; + let node = this; + while (true) { + const code2 = key.charCodeAt(index); + if (code2 > 127) { + throw new TypeError("key must be ascii string"); + } + if (node.code === code2) { + if (length === ++index) { + node.value = value; + break; + } else if (node.middle !== null) { + node = node.middle; + } else { + node.middle = new _TstNode(key, value, index); + break; + } + } else if (node.code < code2) { + if (node.left !== null) { + node = node.left; + } else { + node.left = new _TstNode(key, value, index); + break; + } + } else if (node.right !== null) { + node = node.right; + } else { + node.right = new _TstNode(key, value, index); + break; + } + } + } + /** + * @param {Uint8Array} key + * @return {TstNode | null} + */ + search(key) { + const keylength = key.length; + let index = 0; + let node = this; + while (node !== null && index < keylength) { + let code2 = key[index]; + if (code2 <= 90 && code2 >= 65) { + code2 |= 32; + } + while (node !== null) { + if (code2 === node.code) { + if (keylength === ++index) { + return node; + } + node = node.middle; + break; + } + node = node.code < code2 ? node.left : node.right; + } + } + return null; + } + }; + var TernarySearchTree = class { + /** @type {TstNode | null} */ + node = null; + /** + * @param {string} key + * @param {any} value + * */ + insert(key, value) { + if (this.node === null) { + this.node = new TstNode(key, value, 0); + } else { + this.node.add(key, value); + } + } + /** + * @param {Uint8Array} key + * @return {any} + */ + lookup(key) { + return this.node?.search(key)?.value ?? null; + } + }; + var tree = new TernarySearchTree(); + for (let i = 0; i < wellknownHeaderNames.length; ++i) { + const key = headerNameLowerCasedRecord[wellknownHeaderNames[i]]; + tree.insert(key, key); + } + module2.exports = { + TernarySearchTree, + tree + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/core/util.js +var require_util = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/core/util.js"(exports2, module2) { + "use strict"; + var assert5 = require("node:assert"); + var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols(); + var { IncomingMessage } = require("node:http"); + var stream = require("node:stream"); + var net = require("node:net"); + var { Blob: Blob2 } = require("node:buffer"); + var nodeUtil = require("node:util"); + var { stringify } = require("node:querystring"); + var { EventEmitter: EE3 } = require("node:events"); + var { InvalidArgumentError } = require_errors(); + var { headerNameLowerCasedRecord } = require_constants2(); + var { tree } = require_tree(); + var [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v) => Number(v)); + var BodyAsyncIterable = class { + constructor(body) { + this[kBody] = body; + this[kBodyUsed] = false; + } + async *[Symbol.asyncIterator]() { + assert5(!this[kBodyUsed], "disturbed"); + this[kBodyUsed] = true; + yield* this[kBody]; + } + }; + function wrapRequestBody(body) { + if (isStream2(body)) { + if (bodyLength(body) === 0) { + body.on("data", function() { + assert5(false); + }); + } + if (typeof body.readableDidRead !== "boolean") { + body[kBodyUsed] = false; + EE3.prototype.on.call(body, "data", function() { + this[kBodyUsed] = true; + }); + } + return body; + } else if (body && typeof body.pipeTo === "function") { + return new BodyAsyncIterable(body); + } else if (body && typeof body !== "string" && !ArrayBuffer.isView(body) && isIterable(body)) { + return new BodyAsyncIterable(body); + } else { + return body; + } + } + function nop() { + } + function isStream2(obj) { + return obj && typeof obj === "object" && typeof obj.pipe === "function" && typeof obj.on === "function"; + } + function isBlobLike(object) { + if (object === null) { + return false; + } else if (object instanceof Blob2) { + return true; + } else if (typeof object !== "object") { + return false; + } else { + const sTag = object[Symbol.toStringTag]; + return (sTag === "Blob" || sTag === "File") && ("stream" in object && typeof object.stream === "function" || "arrayBuffer" in object && typeof object.arrayBuffer === "function"); + } + } + function buildURL(url, queryParams) { + if (url.includes("?") || url.includes("#")) { + throw new Error('Query params cannot be passed when url already contains "?" or "#".'); + } + const stringified = stringify(queryParams); + if (stringified) { + url += "?" + stringified; + } + return url; + } + function isValidPort(port) { + const value = parseInt(port, 10); + return value === Number(port) && value >= 0 && value <= 65535; + } + function isHttpOrHttpsPrefixed(value) { + return value != null && value[0] === "h" && value[1] === "t" && value[2] === "t" && value[3] === "p" && (value[4] === ":" || value[4] === "s" && value[5] === ":"); + } + function parseURL(url) { + if (typeof url === "string") { + url = new URL(url); + if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { + throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); + } + return url; + } + if (!url || typeof url !== "object") { + throw new InvalidArgumentError("Invalid URL: The URL argument must be a non-null object."); + } + if (!(url instanceof URL)) { + if (url.port != null && url.port !== "" && isValidPort(url.port) === false) { + throw new InvalidArgumentError("Invalid URL: port must be a valid integer or a string representation of an integer."); + } + if (url.path != null && typeof url.path !== "string") { + throw new InvalidArgumentError("Invalid URL path: the path must be a string or null/undefined."); + } + if (url.pathname != null && typeof url.pathname !== "string") { + throw new InvalidArgumentError("Invalid URL pathname: the pathname must be a string or null/undefined."); + } + if (url.hostname != null && typeof url.hostname !== "string") { + throw new InvalidArgumentError("Invalid URL hostname: the hostname must be a string or null/undefined."); + } + if (url.origin != null && typeof url.origin !== "string") { + throw new InvalidArgumentError("Invalid URL origin: the origin must be a string or null/undefined."); + } + if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { + throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); + } + const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80; + let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`; + let path16 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; + if (origin[origin.length - 1] === "/") { + origin = origin.slice(0, origin.length - 1); + } + if (path16 && path16[0] !== "/") { + path16 = `/${path16}`; + } + return new URL(`${origin}${path16}`); + } + if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { + throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); + } + return url; + } + function parseOrigin(url) { + url = parseURL(url); + if (url.pathname !== "/" || url.search || url.hash) { + throw new InvalidArgumentError("invalid url"); + } + return url; + } + function getHostname(host) { + if (host[0] === "[") { + const idx2 = host.indexOf("]"); + assert5(idx2 !== -1); + return host.substring(1, idx2); + } + const idx = host.indexOf(":"); + if (idx === -1) return host; + return host.substring(0, idx); + } + function getServerName(host) { + if (!host) { + return null; + } + assert5(typeof host === "string"); + const servername = getHostname(host); + if (net.isIP(servername)) { + return ""; + } + return servername; + } + function deepClone(obj) { + return JSON.parse(JSON.stringify(obj)); + } + function isAsyncIterable(obj) { + return !!(obj != null && typeof obj[Symbol.asyncIterator] === "function"); + } + function isIterable(obj) { + return !!(obj != null && (typeof obj[Symbol.iterator] === "function" || typeof obj[Symbol.asyncIterator] === "function")); + } + function bodyLength(body) { + if (body == null) { + return 0; + } else if (isStream2(body)) { + const state = body._readableState; + return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length) ? state.length : null; + } else if (isBlobLike(body)) { + return body.size != null ? body.size : null; + } else if (isBuffer(body)) { + return body.byteLength; + } + return null; + } + function isDestroyed(body) { + return body && !!(body.destroyed || body[kDestroyed] || stream.isDestroyed?.(body)); + } + function destroy(stream2, err) { + if (stream2 == null || !isStream2(stream2) || isDestroyed(stream2)) { + return; + } + if (typeof stream2.destroy === "function") { + if (Object.getPrototypeOf(stream2).constructor === IncomingMessage) { + stream2.socket = null; + } + stream2.destroy(err); + } else if (err) { + queueMicrotask(() => { + stream2.emit("error", err); + }); + } + if (stream2.destroyed !== true) { + stream2[kDestroyed] = true; + } + } + var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; + function parseKeepAliveTimeout(val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); + return m ? parseInt(m[1], 10) * 1e3 : null; + } + function headerNameToString(value) { + return typeof value === "string" ? headerNameLowerCasedRecord[value] ?? value.toLowerCase() : tree.lookup(value) ?? value.toString("latin1").toLowerCase(); + } + function bufferToLowerCasedHeaderName(value) { + return tree.lookup(value) ?? value.toString("latin1").toLowerCase(); + } + function parseHeaders(headers, obj) { + if (obj === void 0) obj = {}; + for (let i = 0; i < headers.length; i += 2) { + const key = headerNameToString(headers[i]); + let val = obj[key]; + if (val) { + if (typeof val === "string") { + val = [val]; + obj[key] = val; + } + val.push(headers[i + 1].toString("utf8")); + } else { + const headersValue = headers[i + 1]; + if (typeof headersValue === "string") { + obj[key] = headersValue; + } else { + obj[key] = Array.isArray(headersValue) ? headersValue.map((x) => x.toString("utf8")) : headersValue.toString("utf8"); + } + } + } + if ("content-length" in obj && "content-disposition" in obj) { + obj["content-disposition"] = Buffer.from(obj["content-disposition"]).toString("latin1"); + } + return obj; + } + function parseRawHeaders(headers) { + const len = headers.length; + const ret = new Array(len); + let hasContentLength = false; + let contentDispositionIdx = -1; + let key; + let val; + let kLen = 0; + for (let n = 0; n < headers.length; n += 2) { + key = headers[n]; + val = headers[n + 1]; + typeof key !== "string" && (key = key.toString()); + typeof val !== "string" && (val = val.toString("utf8")); + kLen = key.length; + if (kLen === 14 && key[7] === "-" && (key === "content-length" || key.toLowerCase() === "content-length")) { + hasContentLength = true; + } else if (kLen === 19 && key[7] === "-" && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { + contentDispositionIdx = n + 1; + } + ret[n] = key; + ret[n + 1] = val; + } + if (hasContentLength && contentDispositionIdx !== -1) { + ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString("latin1"); + } + return ret; + } + function isBuffer(buffer) { + return buffer instanceof Uint8Array || Buffer.isBuffer(buffer); + } + function validateHandler(handler, method, upgrade) { + if (!handler || typeof handler !== "object") { + throw new InvalidArgumentError("handler must be an object"); + } + if (typeof handler.onConnect !== "function") { + throw new InvalidArgumentError("invalid onConnect method"); + } + if (typeof handler.onError !== "function") { + throw new InvalidArgumentError("invalid onError method"); + } + if (typeof handler.onBodySent !== "function" && handler.onBodySent !== void 0) { + throw new InvalidArgumentError("invalid onBodySent method"); + } + if (upgrade || method === "CONNECT") { + if (typeof handler.onUpgrade !== "function") { + throw new InvalidArgumentError("invalid onUpgrade method"); + } + } else { + if (typeof handler.onHeaders !== "function") { + throw new InvalidArgumentError("invalid onHeaders method"); + } + if (typeof handler.onData !== "function") { + throw new InvalidArgumentError("invalid onData method"); + } + if (typeof handler.onComplete !== "function") { + throw new InvalidArgumentError("invalid onComplete method"); + } + } + } + function isDisturbed(body) { + return !!(body && (stream.isDisturbed(body) || body[kBodyUsed])); + } + function isErrored(body) { + return !!(body && stream.isErrored(body)); + } + function isReadable2(body) { + return !!(body && stream.isReadable(body)); + } + function getSocketInfo(socket) { + return { + localAddress: socket.localAddress, + localPort: socket.localPort, + remoteAddress: socket.remoteAddress, + remotePort: socket.remotePort, + remoteFamily: socket.remoteFamily, + timeout: socket.timeout, + bytesWritten: socket.bytesWritten, + bytesRead: socket.bytesRead + }; + } + function ReadableStreamFrom(iterable) { + let iterator; + return new ReadableStream( + { + async start() { + iterator = iterable[Symbol.asyncIterator](); + }, + async pull(controller) { + const { done, value } = await iterator.next(); + if (done) { + queueMicrotask(() => { + controller.close(); + controller.byobRequest?.respond(0); + }); + } else { + const buf = Buffer.isBuffer(value) ? value : Buffer.from(value); + if (buf.byteLength) { + controller.enqueue(new Uint8Array(buf)); + } + } + return controller.desiredSize > 0; + }, + async cancel(reason) { + await iterator.return(); + }, + type: "bytes" + } + ); + } + function isFormDataLike(object) { + return object && typeof object === "object" && typeof object.append === "function" && typeof object.delete === "function" && typeof object.get === "function" && typeof object.getAll === "function" && typeof object.has === "function" && typeof object.set === "function" && object[Symbol.toStringTag] === "FormData"; + } + function addAbortListener(signal, listener) { + if ("addEventListener" in signal) { + signal.addEventListener("abort", listener, { once: true }); + return () => signal.removeEventListener("abort", listener); + } + signal.addListener("abort", listener); + return () => signal.removeListener("abort", listener); + } + var hasToWellFormed = typeof String.prototype.toWellFormed === "function"; + var hasIsWellFormed = typeof String.prototype.isWellFormed === "function"; + function toUSVString(val) { + return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil.toUSVString(val); + } + function isUSVString(val) { + return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString(val) === `${val}`; + } + function isTokenCharCode(c) { + switch (c) { + case 34: + case 40: + case 41: + case 44: + case 47: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 64: + case 91: + case 92: + case 93: + case 123: + case 125: + return false; + default: + return c >= 33 && c <= 126; + } + } + function isValidHTTPToken(characters) { + if (characters.length === 0) { + return false; + } + for (let i = 0; i < characters.length; ++i) { + if (!isTokenCharCode(characters.charCodeAt(i))) { + return false; + } + } + return true; + } + var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; + function isValidHeaderValue(characters) { + return !headerCharRegex.test(characters); + } + function parseRangeHeader(range) { + if (range == null || range === "") return { start: 0, end: null, size: null }; + const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null; + return m ? { + start: parseInt(m[1]), + end: m[2] ? parseInt(m[2]) : null, + size: m[3] ? parseInt(m[3]) : null + } : null; + } + function addListener(obj, name2, listener) { + const listeners = obj[kListeners] ??= []; + listeners.push([name2, listener]); + obj.on(name2, listener); + return obj; + } + function removeAllListeners(obj) { + for (const [name2, listener] of obj[kListeners] ?? []) { + obj.removeListener(name2, listener); + } + obj[kListeners] = null; + } + function errorRequest(client, request, err) { + try { + request.onError(err); + assert5(request.aborted); + } catch (err2) { + client.emit("error", err2); + } + } + var kEnumerableProperty = /* @__PURE__ */ Object.create(null); + kEnumerableProperty.enumerable = true; + var normalizedMethodRecordsBase = { + delete: "DELETE", + DELETE: "DELETE", + get: "GET", + GET: "GET", + head: "HEAD", + HEAD: "HEAD", + options: "OPTIONS", + OPTIONS: "OPTIONS", + post: "POST", + POST: "POST", + put: "PUT", + PUT: "PUT" + }; + var normalizedMethodRecords = { + ...normalizedMethodRecordsBase, + patch: "patch", + PATCH: "PATCH" + }; + Object.setPrototypeOf(normalizedMethodRecordsBase, null); + Object.setPrototypeOf(normalizedMethodRecords, null); + module2.exports = { + kEnumerableProperty, + nop, + isDisturbed, + isErrored, + isReadable: isReadable2, + toUSVString, + isUSVString, + isBlobLike, + parseOrigin, + parseURL, + getServerName, + isStream: isStream2, + isIterable, + isAsyncIterable, + isDestroyed, + headerNameToString, + bufferToLowerCasedHeaderName, + addListener, + removeAllListeners, + errorRequest, + parseRawHeaders, + parseHeaders, + parseKeepAliveTimeout, + destroy, + bodyLength, + deepClone, + ReadableStreamFrom, + isBuffer, + validateHandler, + getSocketInfo, + isFormDataLike, + buildURL, + addAbortListener, + isValidHTTPToken, + isValidHeaderValue, + isTokenCharCode, + parseRangeHeader, + normalizedMethodRecordsBase, + normalizedMethodRecords, + isValidPort, + isHttpOrHttpsPrefixed, + nodeMajor, + nodeMinor, + safeHTTPMethods: ["GET", "HEAD", "OPTIONS", "TRACE"], + wrapRequestBody + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/api/readable.js +var require_readable = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/api/readable.js"(exports2, module2) { + "use strict"; + var assert5 = require("node:assert"); + var { Readable: Readable2 } = require("node:stream"); + var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require_errors(); + var util = require_util(); + var { ReadableStreamFrom } = require_util(); + var kConsume = Symbol("kConsume"); + var kReading = Symbol("kReading"); + var kBody = Symbol("kBody"); + var kAbort = Symbol("kAbort"); + var kContentType = Symbol("kContentType"); + var kContentLength = Symbol("kContentLength"); + var noop3 = () => { + }; + var BodyReadable = class extends Readable2 { + constructor({ + resume, + abort, + contentType = "", + contentLength, + highWaterMark = 64 * 1024 + // Same as nodejs fs streams. + }) { + super({ + autoDestroy: true, + read: resume, + highWaterMark + }); + this._readableState.dataEmitted = false; + this[kAbort] = abort; + this[kConsume] = null; + this[kBody] = null; + this[kContentType] = contentType; + this[kContentLength] = contentLength; + this[kReading] = false; + } + destroy(err) { + if (!err && !this._readableState.endEmitted) { + err = new RequestAbortedError(); + } + if (err) { + this[kAbort](); + } + return super.destroy(err); + } + _destroy(err, callback) { + if (!this[kReading]) { + setImmediate(() => { + callback(err); + }); + } else { + callback(err); + } + } + on(ev, ...args) { + if (ev === "data" || ev === "readable") { + this[kReading] = true; + } + return super.on(ev, ...args); + } + addListener(ev, ...args) { + return this.on(ev, ...args); + } + off(ev, ...args) { + const ret = super.off(ev, ...args); + if (ev === "data" || ev === "readable") { + this[kReading] = this.listenerCount("data") > 0 || this.listenerCount("readable") > 0; + } + return ret; + } + removeListener(ev, ...args) { + return this.off(ev, ...args); + } + push(chunk) { + if (this[kConsume] && chunk !== null) { + consumePush(this[kConsume], chunk); + return this[kReading] ? super.push(chunk) : true; + } + return super.push(chunk); + } + // https://fetch.spec.whatwg.org/#dom-body-text + async text() { + return consume(this, "text"); + } + // https://fetch.spec.whatwg.org/#dom-body-json + async json() { + return consume(this, "json"); + } + // https://fetch.spec.whatwg.org/#dom-body-blob + async blob() { + return consume(this, "blob"); + } + // https://fetch.spec.whatwg.org/#dom-body-bytes + async bytes() { + return consume(this, "bytes"); + } + // https://fetch.spec.whatwg.org/#dom-body-arraybuffer + async arrayBuffer() { + return consume(this, "arrayBuffer"); + } + // https://fetch.spec.whatwg.org/#dom-body-formdata + async formData() { + throw new NotSupportedError(); + } + // https://fetch.spec.whatwg.org/#dom-body-bodyused + get bodyUsed() { + return util.isDisturbed(this); + } + // https://fetch.spec.whatwg.org/#dom-body-body + get body() { + if (!this[kBody]) { + this[kBody] = ReadableStreamFrom(this); + if (this[kConsume]) { + this[kBody].getReader(); + assert5(this[kBody].locked); + } + } + return this[kBody]; + } + async dump(opts) { + let limit = Number.isFinite(opts?.limit) ? opts.limit : 128 * 1024; + const signal = opts?.signal; + if (signal != null && (typeof signal !== "object" || !("aborted" in signal))) { + throw new InvalidArgumentError("signal must be an AbortSignal"); + } + signal?.throwIfAborted(); + if (this._readableState.closeEmitted) { + return null; + } + return await new Promise((resolve, reject) => { + if (this[kContentLength] > limit) { + this.destroy(new AbortError()); + } + const onAbort = () => { + this.destroy(signal.reason ?? new AbortError()); + }; + signal?.addEventListener("abort", onAbort); + this.on("close", function() { + signal?.removeEventListener("abort", onAbort); + if (signal?.aborted) { + reject(signal.reason ?? new AbortError()); + } else { + resolve(null); + } + }).on("error", noop3).on("data", function(chunk) { + limit -= chunk.length; + if (limit <= 0) { + this.destroy(); + } + }).resume(); + }); + } + }; + function isLocked(self2) { + return self2[kBody] && self2[kBody].locked === true || self2[kConsume]; + } + function isUnusable(self2) { + return util.isDisturbed(self2) || isLocked(self2); + } + async function consume(stream, type) { + assert5(!stream[kConsume]); + return new Promise((resolve, reject) => { + if (isUnusable(stream)) { + const rState = stream._readableState; + if (rState.destroyed && rState.closeEmitted === false) { + stream.on("error", (err) => { + reject(err); + }).on("close", () => { + reject(new TypeError("unusable")); + }); + } else { + reject(rState.errored ?? new TypeError("unusable")); + } + } else { + queueMicrotask(() => { + stream[kConsume] = { + type, + stream, + resolve, + reject, + length: 0, + body: [] + }; + stream.on("error", function(err) { + consumeFinish(this[kConsume], err); + }).on("close", function() { + if (this[kConsume].body !== null) { + consumeFinish(this[kConsume], new RequestAbortedError()); + } + }); + consumeStart(stream[kConsume]); + }); + } + }); + } + function consumeStart(consume2) { + if (consume2.body === null) { + return; + } + const { _readableState: state } = consume2.stream; + if (state.bufferIndex) { + const start = state.bufferIndex; + const end = state.buffer.length; + for (let n = start; n < end; n++) { + consumePush(consume2, state.buffer[n]); + } + } else { + for (const chunk of state.buffer) { + consumePush(consume2, chunk); + } + } + if (state.endEmitted) { + consumeEnd(this[kConsume]); + } else { + consume2.stream.on("end", function() { + consumeEnd(this[kConsume]); + }); + } + consume2.stream.resume(); + while (consume2.stream.read() != null) { + } + } + function chunksDecode(chunks, length) { + if (chunks.length === 0 || length === 0) { + return ""; + } + const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length); + const bufferLength = buffer.length; + const start = bufferLength > 2 && buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191 ? 3 : 0; + return buffer.utf8Slice(start, bufferLength); + } + function chunksConcat(chunks, length) { + if (chunks.length === 0 || length === 0) { + return new Uint8Array(0); + } + if (chunks.length === 1) { + return new Uint8Array(chunks[0]); + } + const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer); + let offset = 0; + for (let i = 0; i < chunks.length; ++i) { + const chunk = chunks[i]; + buffer.set(chunk, offset); + offset += chunk.length; + } + return buffer; + } + function consumeEnd(consume2) { + const { type, body, resolve, stream, length } = consume2; + try { + if (type === "text") { + resolve(chunksDecode(body, length)); + } else if (type === "json") { + resolve(JSON.parse(chunksDecode(body, length))); + } else if (type === "arrayBuffer") { + resolve(chunksConcat(body, length).buffer); + } else if (type === "blob") { + resolve(new Blob(body, { type: stream[kContentType] })); + } else if (type === "bytes") { + resolve(chunksConcat(body, length)); + } + consumeFinish(consume2); + } catch (err) { + stream.destroy(err); + } + } + function consumePush(consume2, chunk) { + consume2.length += chunk.length; + consume2.body.push(chunk); + } + function consumeFinish(consume2, err) { + if (consume2.body === null) { + return; + } + if (err) { + consume2.reject(err); + } else { + consume2.resolve(); + } + consume2.type = null; + consume2.stream = null; + consume2.resolve = null; + consume2.reject = null; + consume2.length = 0; + consume2.body = null; + } + module2.exports = { Readable: BodyReadable, chunksDecode }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/api/util.js +var require_util2 = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/api/util.js"(exports2, module2) { + var assert5 = require("node:assert"); + var { + ResponseStatusCodeError + } = require_errors(); + var { chunksDecode } = require_readable(); + var CHUNK_LIMIT = 128 * 1024; + async function getResolveErrorBodyCallback({ callback, body, contentType, statusCode, statusMessage, headers }) { + assert5(body); + let chunks = []; + let length = 0; + try { + for await (const chunk of body) { + chunks.push(chunk); + length += chunk.length; + if (length > CHUNK_LIMIT) { + chunks = []; + length = 0; + break; + } + } + } catch { + chunks = []; + length = 0; + } + const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`; + if (statusCode === 204 || !contentType || !length) { + queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers))); + return; + } + const stackTraceLimit = Error.stackTraceLimit; + Error.stackTraceLimit = 0; + let payload; + try { + if (isContentTypeApplicationJson(contentType)) { + payload = JSON.parse(chunksDecode(chunks, length)); + } else if (isContentTypeText(contentType)) { + payload = chunksDecode(chunks, length); + } + } catch { + } finally { + Error.stackTraceLimit = stackTraceLimit; + } + queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers, payload))); + } + var isContentTypeApplicationJson = (contentType) => { + return contentType.length > 15 && contentType[11] === "/" && contentType[0] === "a" && contentType[1] === "p" && contentType[2] === "p" && contentType[3] === "l" && contentType[4] === "i" && contentType[5] === "c" && contentType[6] === "a" && contentType[7] === "t" && contentType[8] === "i" && contentType[9] === "o" && contentType[10] === "n" && contentType[12] === "j" && contentType[13] === "s" && contentType[14] === "o" && contentType[15] === "n"; + }; + var isContentTypeText = (contentType) => { + return contentType.length > 4 && contentType[4] === "/" && contentType[0] === "t" && contentType[1] === "e" && contentType[2] === "x" && contentType[3] === "t"; + }; + module2.exports = { + getResolveErrorBodyCallback, + isContentTypeApplicationJson, + isContentTypeText + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/api/api-request.js +var require_api_request = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/api/api-request.js"(exports2, module2) { + "use strict"; + var assert5 = require("node:assert"); + var { Readable: Readable2 } = require_readable(); + var { InvalidArgumentError, RequestAbortedError } = require_errors(); + var util = require_util(); + var { getResolveErrorBodyCallback } = require_util2(); + var { AsyncResource } = require("node:async_hooks"); + var RequestHandler = class extends AsyncResource { + constructor(opts, callback) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError("invalid opts"); + } + const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts; + try { + if (typeof callback !== "function") { + throw new InvalidArgumentError("invalid callback"); + } + if (highWaterMark && (typeof highWaterMark !== "number" || highWaterMark < 0)) { + throw new InvalidArgumentError("invalid highWaterMark"); + } + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); + } + if (method === "CONNECT") { + throw new InvalidArgumentError("invalid method"); + } + if (onInfo && typeof onInfo !== "function") { + throw new InvalidArgumentError("invalid onInfo callback"); + } + super("UNDICI_REQUEST"); + } catch (err) { + if (util.isStream(body)) { + util.destroy(body.on("error", util.nop), err); + } + throw err; + } + this.method = method; + this.responseHeaders = responseHeaders || null; + this.opaque = opaque || null; + this.callback = callback; + this.res = null; + this.abort = null; + this.body = body; + this.trailers = {}; + this.context = null; + this.onInfo = onInfo || null; + this.throwOnError = throwOnError; + this.highWaterMark = highWaterMark; + this.signal = signal; + this.reason = null; + this.removeAbortListener = null; + if (util.isStream(body)) { + body.on("error", (err) => { + this.onError(err); + }); + } + if (this.signal) { + if (this.signal.aborted) { + this.reason = this.signal.reason ?? new RequestAbortedError(); + } else { + this.removeAbortListener = util.addAbortListener(this.signal, () => { + this.reason = this.signal.reason ?? new RequestAbortedError(); + if (this.res) { + util.destroy(this.res.on("error", util.nop), this.reason); + } else if (this.abort) { + this.abort(this.reason); + } + if (this.removeAbortListener) { + this.res?.off("close", this.removeAbortListener); + this.removeAbortListener(); + this.removeAbortListener = null; + } + }); + } + } + } + onConnect(abort, context) { + if (this.reason) { + abort(this.reason); + return; + } + assert5(this.callback); + this.abort = abort; + this.context = context; + } + onHeaders(statusCode, rawHeaders, resume, statusMessage) { + const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this; + const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); + if (statusCode < 200) { + if (this.onInfo) { + this.onInfo({ statusCode, headers }); + } + return; + } + const parsedHeaders = responseHeaders === "raw" ? util.parseHeaders(rawHeaders) : headers; + const contentType = parsedHeaders["content-type"]; + const contentLength = parsedHeaders["content-length"]; + const res = new Readable2({ + resume, + abort, + contentType, + contentLength: this.method !== "HEAD" && contentLength ? Number(contentLength) : null, + highWaterMark + }); + if (this.removeAbortListener) { + res.on("close", this.removeAbortListener); + } + this.callback = null; + this.res = res; + if (callback !== null) { + if (this.throwOnError && statusCode >= 400) { + this.runInAsyncScope( + getResolveErrorBodyCallback, + null, + { callback, body: res, contentType, statusCode, statusMessage, headers } + ); + } else { + this.runInAsyncScope(callback, null, null, { + statusCode, + headers, + trailers: this.trailers, + opaque, + body: res, + context + }); + } + } + } + onData(chunk) { + return this.res.push(chunk); + } + onComplete(trailers) { + util.parseHeaders(trailers, this.trailers); + this.res.push(null); + } + onError(err) { + const { res, callback, body, opaque } = this; + if (callback) { + this.callback = null; + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }); + }); + } + if (res) { + this.res = null; + queueMicrotask(() => { + util.destroy(res, err); + }); + } + if (body) { + this.body = null; + util.destroy(body, err); + } + if (this.removeAbortListener) { + res?.off("close", this.removeAbortListener); + this.removeAbortListener(); + this.removeAbortListener = null; + } + } + }; + function request(opts, callback) { + if (callback === void 0) { + return new Promise((resolve, reject) => { + request.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data); + }); + }); + } + try { + this.dispatch(opts, new RequestHandler(opts, callback)); + } catch (err) { + if (typeof callback !== "function") { + throw err; + } + const opaque = opts?.opaque; + queueMicrotask(() => callback(err, { opaque })); + } + } + module2.exports = request; + module2.exports.RequestHandler = RequestHandler; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/api/abort-signal.js +var require_abort_signal = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/api/abort-signal.js"(exports2, module2) { + var { addAbortListener } = require_util(); + var { RequestAbortedError } = require_errors(); + var kListener = Symbol("kListener"); + var kSignal = Symbol("kSignal"); + function abort(self2) { + if (self2.abort) { + self2.abort(self2[kSignal]?.reason); + } else { + self2.reason = self2[kSignal]?.reason ?? new RequestAbortedError(); + } + removeSignal(self2); + } + function addSignal(self2, signal) { + self2.reason = null; + self2[kSignal] = null; + self2[kListener] = null; + if (!signal) { + return; + } + if (signal.aborted) { + abort(self2); + return; + } + self2[kSignal] = signal; + self2[kListener] = () => { + abort(self2); + }; + addAbortListener(self2[kSignal], self2[kListener]); + } + function removeSignal(self2) { + if (!self2[kSignal]) { + return; + } + if ("removeEventListener" in self2[kSignal]) { + self2[kSignal].removeEventListener("abort", self2[kListener]); + } else { + self2[kSignal].removeListener("abort", self2[kListener]); + } + self2[kSignal] = null; + self2[kListener] = null; + } + module2.exports = { + addSignal, + removeSignal + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/api/api-stream.js +var require_api_stream = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/api/api-stream.js"(exports2, module2) { + "use strict"; + var assert5 = require("node:assert"); + var { finished, PassThrough } = require("node:stream"); + var { InvalidArgumentError, InvalidReturnValueError } = require_errors(); + var util = require_util(); + var { getResolveErrorBodyCallback } = require_util2(); + var { AsyncResource } = require("node:async_hooks"); + var { addSignal, removeSignal } = require_abort_signal(); + var StreamHandler = class extends AsyncResource { + constructor(opts, factory, callback) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError("invalid opts"); + } + const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts; + try { + if (typeof callback !== "function") { + throw new InvalidArgumentError("invalid callback"); + } + if (typeof factory !== "function") { + throw new InvalidArgumentError("invalid factory"); + } + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); + } + if (method === "CONNECT") { + throw new InvalidArgumentError("invalid method"); + } + if (onInfo && typeof onInfo !== "function") { + throw new InvalidArgumentError("invalid onInfo callback"); + } + super("UNDICI_STREAM"); + } catch (err) { + if (util.isStream(body)) { + util.destroy(body.on("error", util.nop), err); + } + throw err; + } + this.responseHeaders = responseHeaders || null; + this.opaque = opaque || null; + this.factory = factory; + this.callback = callback; + this.res = null; + this.abort = null; + this.context = null; + this.trailers = null; + this.body = body; + this.onInfo = onInfo || null; + this.throwOnError = throwOnError || false; + if (util.isStream(body)) { + body.on("error", (err) => { + this.onError(err); + }); + } + addSignal(this, signal); + } + onConnect(abort, context) { + if (this.reason) { + abort(this.reason); + return; + } + assert5(this.callback); + this.abort = abort; + this.context = context; + } + onHeaders(statusCode, rawHeaders, resume, statusMessage) { + const { factory, opaque, context, callback, responseHeaders } = this; + const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); + if (statusCode < 200) { + if (this.onInfo) { + this.onInfo({ statusCode, headers }); + } + return; + } + this.factory = null; + let res; + if (this.throwOnError && statusCode >= 400) { + const parsedHeaders = responseHeaders === "raw" ? util.parseHeaders(rawHeaders) : headers; + const contentType = parsedHeaders["content-type"]; + res = new PassThrough(); + this.callback = null; + this.runInAsyncScope( + getResolveErrorBodyCallback, + null, + { callback, body: res, contentType, statusCode, statusMessage, headers } + ); + } else { + if (factory === null) { + return; + } + res = this.runInAsyncScope(factory, null, { + statusCode, + headers, + opaque, + context + }); + if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { + throw new InvalidReturnValueError("expected Writable"); + } + finished(res, { readable: false }, (err) => { + const { callback: callback2, res: res2, opaque: opaque2, trailers, abort } = this; + this.res = null; + if (err || !res2.readable) { + util.destroy(res2, err); + } + this.callback = null; + this.runInAsyncScope(callback2, null, err || null, { opaque: opaque2, trailers }); + if (err) { + abort(); + } + }); + } + res.on("drain", resume); + this.res = res; + const needDrain = res.writableNeedDrain !== void 0 ? res.writableNeedDrain : res._writableState?.needDrain; + return needDrain !== true; + } + onData(chunk) { + const { res } = this; + return res ? res.write(chunk) : true; + } + onComplete(trailers) { + const { res } = this; + removeSignal(this); + if (!res) { + return; + } + this.trailers = util.parseHeaders(trailers); + res.end(); + } + onError(err) { + const { res, callback, opaque, body } = this; + removeSignal(this); + this.factory = null; + if (res) { + this.res = null; + util.destroy(res, err); + } else if (callback) { + this.callback = null; + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }); + }); + } + if (body) { + this.body = null; + util.destroy(body, err); + } + } + }; + function stream(opts, factory, callback) { + if (callback === void 0) { + return new Promise((resolve, reject) => { + stream.call(this, opts, factory, (err, data) => { + return err ? reject(err) : resolve(data); + }); + }); + } + try { + this.dispatch(opts, new StreamHandler(opts, factory, callback)); + } catch (err) { + if (typeof callback !== "function") { + throw err; + } + const opaque = opts?.opaque; + queueMicrotask(() => callback(err, { opaque })); + } + } + module2.exports = stream; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/api/api-pipeline.js +var require_api_pipeline = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/api/api-pipeline.js"(exports2, module2) { + "use strict"; + var { + Readable: Readable2, + Duplex, + PassThrough + } = require("node:stream"); + var { + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError + } = require_errors(); + var util = require_util(); + var { AsyncResource } = require("node:async_hooks"); + var { addSignal, removeSignal } = require_abort_signal(); + var assert5 = require("node:assert"); + var kResume = Symbol("resume"); + var PipelineRequest = class extends Readable2 { + constructor() { + super({ autoDestroy: true }); + this[kResume] = null; + } + _read() { + const { [kResume]: resume } = this; + if (resume) { + this[kResume] = null; + resume(); + } + } + _destroy(err, callback) { + this._read(); + callback(err); + } + }; + var PipelineResponse = class extends Readable2 { + constructor(resume) { + super({ autoDestroy: true }); + this[kResume] = resume; + } + _read() { + this[kResume](); + } + _destroy(err, callback) { + if (!err && !this._readableState.endEmitted) { + err = new RequestAbortedError(); + } + callback(err); + } + }; + var PipelineHandler = class extends AsyncResource { + constructor(opts, handler) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError("invalid opts"); + } + if (typeof handler !== "function") { + throw new InvalidArgumentError("invalid handler"); + } + const { signal, method, opaque, onInfo, responseHeaders } = opts; + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); + } + if (method === "CONNECT") { + throw new InvalidArgumentError("invalid method"); + } + if (onInfo && typeof onInfo !== "function") { + throw new InvalidArgumentError("invalid onInfo callback"); + } + super("UNDICI_PIPELINE"); + this.opaque = opaque || null; + this.responseHeaders = responseHeaders || null; + this.handler = handler; + this.abort = null; + this.context = null; + this.onInfo = onInfo || null; + this.req = new PipelineRequest().on("error", util.nop); + this.ret = new Duplex({ + readableObjectMode: opts.objectMode, + autoDestroy: true, + read: () => { + const { body } = this; + if (body?.resume) { + body.resume(); + } + }, + write: (chunk, encoding, callback) => { + const { req } = this; + if (req.push(chunk, encoding) || req._readableState.destroyed) { + callback(); + } else { + req[kResume] = callback; + } + }, + destroy: (err, callback) => { + const { body, req, res, ret, abort } = this; + if (!err && !ret._readableState.endEmitted) { + err = new RequestAbortedError(); + } + if (abort && err) { + abort(); + } + util.destroy(body, err); + util.destroy(req, err); + util.destroy(res, err); + removeSignal(this); + callback(err); + } + }).on("prefinish", () => { + const { req } = this; + req.push(null); + }); + this.res = null; + addSignal(this, signal); + } + onConnect(abort, context) { + const { ret, res } = this; + if (this.reason) { + abort(this.reason); + return; + } + assert5(!res, "pipeline cannot be retried"); + assert5(!ret.destroyed); + this.abort = abort; + this.context = context; + } + onHeaders(statusCode, rawHeaders, resume) { + const { opaque, handler, context } = this; + if (statusCode < 200) { + if (this.onInfo) { + const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); + this.onInfo({ statusCode, headers }); + } + return; + } + this.res = new PipelineResponse(resume); + let body; + try { + this.handler = null; + const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); + body = this.runInAsyncScope(handler, null, { + statusCode, + headers, + opaque, + body: this.res, + context + }); + } catch (err) { + this.res.on("error", util.nop); + throw err; + } + if (!body || typeof body.on !== "function") { + throw new InvalidReturnValueError("expected Readable"); + } + body.on("data", (chunk) => { + const { ret, body: body2 } = this; + if (!ret.push(chunk) && body2.pause) { + body2.pause(); + } + }).on("error", (err) => { + const { ret } = this; + util.destroy(ret, err); + }).on("end", () => { + const { ret } = this; + ret.push(null); + }).on("close", () => { + const { ret } = this; + if (!ret._readableState.ended) { + util.destroy(ret, new RequestAbortedError()); + } + }); + this.body = body; + } + onData(chunk) { + const { res } = this; + return res.push(chunk); + } + onComplete(trailers) { + const { res } = this; + res.push(null); + } + onError(err) { + const { ret } = this; + this.handler = null; + util.destroy(ret, err); + } + }; + function pipeline(opts, handler) { + try { + const pipelineHandler = new PipelineHandler(opts, handler); + this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler); + return pipelineHandler.ret; + } catch (err) { + return new PassThrough().destroy(err); + } + } + module2.exports = pipeline; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/api/api-upgrade.js +var require_api_upgrade = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/api/api-upgrade.js"(exports2, module2) { + "use strict"; + var { InvalidArgumentError, SocketError } = require_errors(); + var { AsyncResource } = require("node:async_hooks"); + var util = require_util(); + var { addSignal, removeSignal } = require_abort_signal(); + var assert5 = require("node:assert"); + var UpgradeHandler = class extends AsyncResource { + constructor(opts, callback) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError("invalid opts"); + } + if (typeof callback !== "function") { + throw new InvalidArgumentError("invalid callback"); + } + const { signal, opaque, responseHeaders } = opts; + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); + } + super("UNDICI_UPGRADE"); + this.responseHeaders = responseHeaders || null; + this.opaque = opaque || null; + this.callback = callback; + this.abort = null; + this.context = null; + addSignal(this, signal); + } + onConnect(abort, context) { + if (this.reason) { + abort(this.reason); + return; + } + assert5(this.callback); + this.abort = abort; + this.context = null; + } + onHeaders() { + throw new SocketError("bad upgrade", null); + } + onUpgrade(statusCode, rawHeaders, socket) { + assert5(statusCode === 101); + const { callback, opaque, context } = this; + removeSignal(this); + this.callback = null; + const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); + this.runInAsyncScope(callback, null, null, { + headers, + socket, + opaque, + context + }); + } + onError(err) { + const { callback, opaque } = this; + removeSignal(this); + if (callback) { + this.callback = null; + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }); + }); + } + } + }; + function upgrade(opts, callback) { + if (callback === void 0) { + return new Promise((resolve, reject) => { + upgrade.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data); + }); + }); + } + try { + const upgradeHandler = new UpgradeHandler(opts, callback); + this.dispatch({ + ...opts, + method: opts.method || "GET", + upgrade: opts.protocol || "Websocket" + }, upgradeHandler); + } catch (err) { + if (typeof callback !== "function") { + throw err; + } + const opaque = opts?.opaque; + queueMicrotask(() => callback(err, { opaque })); + } + } + module2.exports = upgrade; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/api/api-connect.js +var require_api_connect = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/api/api-connect.js"(exports2, module2) { + "use strict"; + var assert5 = require("node:assert"); + var { AsyncResource } = require("node:async_hooks"); + var { InvalidArgumentError, SocketError } = require_errors(); + var util = require_util(); + var { addSignal, removeSignal } = require_abort_signal(); + var ConnectHandler = class extends AsyncResource { + constructor(opts, callback) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError("invalid opts"); + } + if (typeof callback !== "function") { + throw new InvalidArgumentError("invalid callback"); + } + const { signal, opaque, responseHeaders } = opts; + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); + } + super("UNDICI_CONNECT"); + this.opaque = opaque || null; + this.responseHeaders = responseHeaders || null; + this.callback = callback; + this.abort = null; + addSignal(this, signal); + } + onConnect(abort, context) { + if (this.reason) { + abort(this.reason); + return; + } + assert5(this.callback); + this.abort = abort; + this.context = context; + } + onHeaders() { + throw new SocketError("bad connect", null); + } + onUpgrade(statusCode, rawHeaders, socket) { + const { callback, opaque, context } = this; + removeSignal(this); + this.callback = null; + let headers = rawHeaders; + if (headers != null) { + headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); + } + this.runInAsyncScope(callback, null, null, { + statusCode, + headers, + socket, + opaque, + context + }); + } + onError(err) { + const { callback, opaque } = this; + removeSignal(this); + if (callback) { + this.callback = null; + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }); + }); + } + } + }; + function connect(opts, callback) { + if (callback === void 0) { + return new Promise((resolve, reject) => { + connect.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data); + }); + }); + } + try { + const connectHandler = new ConnectHandler(opts, callback); + this.dispatch({ ...opts, method: "CONNECT" }, connectHandler); + } catch (err) { + if (typeof callback !== "function") { + throw err; + } + const opaque = opts?.opaque; + queueMicrotask(() => callback(err, { opaque })); + } + } + module2.exports = connect; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/api/index.js +var require_api = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/api/index.js"(exports2, module2) { + "use strict"; + module2.exports.request = require_api_request(); + module2.exports.stream = require_api_stream(); + module2.exports.pipeline = require_api_pipeline(); + module2.exports.upgrade = require_api_upgrade(); + module2.exports.connect = require_api_connect(); + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/dispatcher.js +var require_dispatcher = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/dispatcher.js"(exports2, module2) { + "use strict"; + var EventEmitter2 = require("node:events"); + var Dispatcher = class extends EventEmitter2 { + dispatch() { + throw new Error("not implemented"); + } + close() { + throw new Error("not implemented"); + } + destroy() { + throw new Error("not implemented"); + } + compose(...args) { + const interceptors = Array.isArray(args[0]) ? args[0] : args; + let dispatch = this.dispatch.bind(this); + for (const interceptor of interceptors) { + if (interceptor == null) { + continue; + } + if (typeof interceptor !== "function") { + throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`); + } + dispatch = interceptor(dispatch); + if (dispatch == null || typeof dispatch !== "function" || dispatch.length !== 2) { + throw new TypeError("invalid interceptor"); + } + } + return new ComposedDispatcher(this, dispatch); + } + }; + var ComposedDispatcher = class extends Dispatcher { + #dispatcher = null; + #dispatch = null; + constructor(dispatcher, dispatch) { + super(); + this.#dispatcher = dispatcher; + this.#dispatch = dispatch; + } + dispatch(...args) { + this.#dispatch(...args); + } + close(...args) { + return this.#dispatcher.close(...args); + } + destroy(...args) { + return this.#dispatcher.destroy(...args); + } + }; + module2.exports = Dispatcher; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/dispatcher-base.js +var require_dispatcher_base = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/dispatcher-base.js"(exports2, module2) { + "use strict"; + var Dispatcher = require_dispatcher(); + var { + ClientDestroyedError, + ClientClosedError, + InvalidArgumentError + } = require_errors(); + var { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = require_symbols(); + var kOnDestroyed = Symbol("onDestroyed"); + var kOnClosed = Symbol("onClosed"); + var kInterceptedDispatch = Symbol("Intercepted Dispatch"); + var DispatcherBase = class extends Dispatcher { + constructor() { + super(); + this[kDestroyed] = false; + this[kOnDestroyed] = null; + this[kClosed] = false; + this[kOnClosed] = []; + } + get destroyed() { + return this[kDestroyed]; + } + get closed() { + return this[kClosed]; + } + get interceptors() { + return this[kInterceptors]; + } + set interceptors(newInterceptors) { + if (newInterceptors) { + for (let i = newInterceptors.length - 1; i >= 0; i--) { + const interceptor = this[kInterceptors][i]; + if (typeof interceptor !== "function") { + throw new InvalidArgumentError("interceptor must be an function"); + } + } + } + this[kInterceptors] = newInterceptors; + } + close(callback) { + if (callback === void 0) { + return new Promise((resolve, reject) => { + this.close((err, data) => { + return err ? reject(err) : resolve(data); + }); + }); + } + if (typeof callback !== "function") { + throw new InvalidArgumentError("invalid callback"); + } + if (this[kDestroyed]) { + queueMicrotask(() => callback(new ClientDestroyedError(), null)); + return; + } + if (this[kClosed]) { + if (this[kOnClosed]) { + this[kOnClosed].push(callback); + } else { + queueMicrotask(() => callback(null, null)); + } + return; + } + this[kClosed] = true; + this[kOnClosed].push(callback); + const onClosed = () => { + const callbacks = this[kOnClosed]; + this[kOnClosed] = null; + for (let i = 0; i < callbacks.length; i++) { + callbacks[i](null, null); + } + }; + this[kClose]().then(() => this.destroy()).then(() => { + queueMicrotask(onClosed); + }); + } + destroy(err, callback) { + if (typeof err === "function") { + callback = err; + err = null; + } + if (callback === void 0) { + return new Promise((resolve, reject) => { + this.destroy(err, (err2, data) => { + return err2 ? ( + /* istanbul ignore next: should never error */ + reject(err2) + ) : resolve(data); + }); + }); + } + if (typeof callback !== "function") { + throw new InvalidArgumentError("invalid callback"); + } + if (this[kDestroyed]) { + if (this[kOnDestroyed]) { + this[kOnDestroyed].push(callback); + } else { + queueMicrotask(() => callback(null, null)); + } + return; + } + if (!err) { + err = new ClientDestroyedError(); + } + this[kDestroyed] = true; + this[kOnDestroyed] = this[kOnDestroyed] || []; + this[kOnDestroyed].push(callback); + const onDestroyed = () => { + const callbacks = this[kOnDestroyed]; + this[kOnDestroyed] = null; + for (let i = 0; i < callbacks.length; i++) { + callbacks[i](null, null); + } + }; + this[kDestroy](err).then(() => { + queueMicrotask(onDestroyed); + }); + } + [kInterceptedDispatch](opts, handler) { + if (!this[kInterceptors] || this[kInterceptors].length === 0) { + this[kInterceptedDispatch] = this[kDispatch]; + return this[kDispatch](opts, handler); + } + let dispatch = this[kDispatch].bind(this); + for (let i = this[kInterceptors].length - 1; i >= 0; i--) { + dispatch = this[kInterceptors][i](dispatch); + } + this[kInterceptedDispatch] = dispatch; + return dispatch(opts, handler); + } + dispatch(opts, handler) { + if (!handler || typeof handler !== "object") { + throw new InvalidArgumentError("handler must be an object"); + } + try { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError("opts must be an object."); + } + if (this[kDestroyed] || this[kOnDestroyed]) { + throw new ClientDestroyedError(); + } + if (this[kClosed]) { + throw new ClientClosedError(); + } + return this[kInterceptedDispatch](opts, handler); + } catch (err) { + if (typeof handler.onError !== "function") { + throw new InvalidArgumentError("invalid onError method"); + } + handler.onError(err); + return false; + } + } + }; + module2.exports = DispatcherBase; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/fixed-queue.js +var require_fixed_queue = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/fixed-queue.js"(exports2, module2) { + "use strict"; + var kSize = 2048; + var kMask = kSize - 1; + var FixedCircularBuffer = class { + constructor() { + this.bottom = 0; + this.top = 0; + this.list = new Array(kSize); + this.next = null; + } + isEmpty() { + return this.top === this.bottom; + } + isFull() { + return (this.top + 1 & kMask) === this.bottom; + } + push(data) { + this.list[this.top] = data; + this.top = this.top + 1 & kMask; + } + shift() { + const nextItem = this.list[this.bottom]; + if (nextItem === void 0) + return null; + this.list[this.bottom] = void 0; + this.bottom = this.bottom + 1 & kMask; + return nextItem; + } + }; + module2.exports = class FixedQueue { + constructor() { + this.head = this.tail = new FixedCircularBuffer(); + } + isEmpty() { + return this.head.isEmpty(); + } + push(data) { + if (this.head.isFull()) { + this.head = this.head.next = new FixedCircularBuffer(); + } + this.head.push(data); + } + shift() { + const tail = this.tail; + const next = tail.shift(); + if (tail.isEmpty() && tail.next !== null) { + this.tail = tail.next; + } + return next; + } + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/pool-stats.js +var require_pool_stats = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/pool-stats.js"(exports2, module2) { + var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); + var kPool = Symbol("pool"); + var PoolStats = class { + constructor(pool) { + this[kPool] = pool; + } + get connected() { + return this[kPool][kConnected]; + } + get free() { + return this[kPool][kFree]; + } + get pending() { + return this[kPool][kPending]; + } + get queued() { + return this[kPool][kQueued]; + } + get running() { + return this[kPool][kRunning]; + } + get size() { + return this[kPool][kSize]; + } + }; + module2.exports = PoolStats; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/pool-base.js +var require_pool_base = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/pool-base.js"(exports2, module2) { + "use strict"; + var DispatcherBase = require_dispatcher_base(); + var FixedQueue = require_fixed_queue(); + var { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require_symbols(); + var PoolStats = require_pool_stats(); + var kClients = Symbol("clients"); + var kNeedDrain = Symbol("needDrain"); + var kQueue = Symbol("queue"); + var kClosedResolve = Symbol("closed resolve"); + var kOnDrain = Symbol("onDrain"); + var kOnConnect = Symbol("onConnect"); + var kOnDisconnect = Symbol("onDisconnect"); + var kOnConnectionError = Symbol("onConnectionError"); + var kGetDispatcher = Symbol("get dispatcher"); + var kAddClient = Symbol("add client"); + var kRemoveClient = Symbol("remove client"); + var kStats = Symbol("stats"); + var PoolBase = class extends DispatcherBase { + constructor() { + super(); + this[kQueue] = new FixedQueue(); + this[kClients] = []; + this[kQueued] = 0; + const pool = this; + this[kOnDrain] = function onDrain(origin, targets) { + const queue = pool[kQueue]; + let needDrain = false; + while (!needDrain) { + const item = queue.shift(); + if (!item) { + break; + } + pool[kQueued]--; + needDrain = !this.dispatch(item.opts, item.handler); + } + this[kNeedDrain] = needDrain; + if (!this[kNeedDrain] && pool[kNeedDrain]) { + pool[kNeedDrain] = false; + pool.emit("drain", origin, [pool, ...targets]); + } + if (pool[kClosedResolve] && queue.isEmpty()) { + Promise.all(pool[kClients].map((c) => c.close())).then(pool[kClosedResolve]); + } + }; + this[kOnConnect] = (origin, targets) => { + pool.emit("connect", origin, [pool, ...targets]); + }; + this[kOnDisconnect] = (origin, targets, err) => { + pool.emit("disconnect", origin, [pool, ...targets], err); + }; + this[kOnConnectionError] = (origin, targets, err) => { + pool.emit("connectionError", origin, [pool, ...targets], err); + }; + this[kStats] = new PoolStats(this); + } + get [kBusy]() { + return this[kNeedDrain]; + } + get [kConnected]() { + return this[kClients].filter((client) => client[kConnected]).length; + } + get [kFree]() { + return this[kClients].filter((client) => client[kConnected] && !client[kNeedDrain]).length; + } + get [kPending]() { + let ret = this[kQueued]; + for (const { [kPending]: pending } of this[kClients]) { + ret += pending; + } + return ret; + } + get [kRunning]() { + let ret = 0; + for (const { [kRunning]: running } of this[kClients]) { + ret += running; + } + return ret; + } + get [kSize]() { + let ret = this[kQueued]; + for (const { [kSize]: size } of this[kClients]) { + ret += size; + } + return ret; + } + get stats() { + return this[kStats]; + } + async [kClose]() { + if (this[kQueue].isEmpty()) { + await Promise.all(this[kClients].map((c) => c.close())); + } else { + await new Promise((resolve) => { + this[kClosedResolve] = resolve; + }); + } + } + async [kDestroy](err) { + while (true) { + const item = this[kQueue].shift(); + if (!item) { + break; + } + item.handler.onError(err); + } + await Promise.all(this[kClients].map((c) => c.destroy(err))); + } + [kDispatch](opts, handler) { + const dispatcher = this[kGetDispatcher](); + if (!dispatcher) { + this[kNeedDrain] = true; + this[kQueue].push({ opts, handler }); + this[kQueued]++; + } else if (!dispatcher.dispatch(opts, handler)) { + dispatcher[kNeedDrain] = true; + this[kNeedDrain] = !this[kGetDispatcher](); + } + return !this[kNeedDrain]; + } + [kAddClient](client) { + client.on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]); + this[kClients].push(client); + if (this[kNeedDrain]) { + queueMicrotask(() => { + if (this[kNeedDrain]) { + this[kOnDrain](client[kUrl], [this, client]); + } + }); + } + return this; + } + [kRemoveClient](client) { + client.close(() => { + const idx = this[kClients].indexOf(client); + if (idx !== -1) { + this[kClients].splice(idx, 1); + } + }); + this[kNeedDrain] = this[kClients].some((dispatcher) => !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true); + } + }; + module2.exports = { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kRemoveClient, + kGetDispatcher + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/core/diagnostics.js +var require_diagnostics = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/core/diagnostics.js"(exports2, module2) { + "use strict"; + var diagnosticsChannel = require("node:diagnostics_channel"); + var util = require("node:util"); + var undiciDebugLog = util.debuglog("undici"); + var fetchDebuglog = util.debuglog("fetch"); + var websocketDebuglog = util.debuglog("websocket"); + var isClientSet = false; + var channels = { + // Client + beforeConnect: diagnosticsChannel.channel("undici:client:beforeConnect"), + connected: diagnosticsChannel.channel("undici:client:connected"), + connectError: diagnosticsChannel.channel("undici:client:connectError"), + sendHeaders: diagnosticsChannel.channel("undici:client:sendHeaders"), + // Request + create: diagnosticsChannel.channel("undici:request:create"), + bodySent: diagnosticsChannel.channel("undici:request:bodySent"), + headers: diagnosticsChannel.channel("undici:request:headers"), + trailers: diagnosticsChannel.channel("undici:request:trailers"), + error: diagnosticsChannel.channel("undici:request:error"), + // WebSocket + open: diagnosticsChannel.channel("undici:websocket:open"), + close: diagnosticsChannel.channel("undici:websocket:close"), + socketError: diagnosticsChannel.channel("undici:websocket:socket_error"), + ping: diagnosticsChannel.channel("undici:websocket:ping"), + pong: diagnosticsChannel.channel("undici:websocket:pong") + }; + if (undiciDebugLog.enabled || fetchDebuglog.enabled) { + const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog; + diagnosticsChannel.channel("undici:client:beforeConnect").subscribe((evt) => { + const { + connectParams: { version: version2, protocol, port, host } + } = evt; + debuglog( + "connecting to %s using %s%s", + `${host}${port ? `:${port}` : ""}`, + protocol, + version2 + ); + }); + diagnosticsChannel.channel("undici:client:connected").subscribe((evt) => { + const { + connectParams: { version: version2, protocol, port, host } + } = evt; + debuglog( + "connected to %s using %s%s", + `${host}${port ? `:${port}` : ""}`, + protocol, + version2 + ); + }); + diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { + const { + connectParams: { version: version2, protocol, port, host }, + error + } = evt; + debuglog( + "connection to %s using %s%s errored - %s", + `${host}${port ? `:${port}` : ""}`, + protocol, + version2, + error.message + ); + }); + diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { + const { + request: { method, path: path16, origin } + } = evt; + debuglog("sending request to %s %s/%s", method, origin, path16); + }); + diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { + const { + request: { method, path: path16, origin }, + response: { statusCode } + } = evt; + debuglog( + "received response to %s %s/%s - HTTP %d", + method, + origin, + path16, + statusCode + ); + }); + diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { + const { + request: { method, path: path16, origin } + } = evt; + debuglog("trailers received from %s %s/%s", method, origin, path16); + }); + diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { + const { + request: { method, path: path16, origin }, + error + } = evt; + debuglog( + "request to %s %s/%s errored - %s", + method, + origin, + path16, + error.message + ); + }); + isClientSet = true; + } + if (websocketDebuglog.enabled) { + if (!isClientSet) { + const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog; + diagnosticsChannel.channel("undici:client:beforeConnect").subscribe((evt) => { + const { + connectParams: { version: version2, protocol, port, host } + } = evt; + debuglog( + "connecting to %s%s using %s%s", + host, + port ? `:${port}` : "", + protocol, + version2 + ); + }); + diagnosticsChannel.channel("undici:client:connected").subscribe((evt) => { + const { + connectParams: { version: version2, protocol, port, host } + } = evt; + debuglog( + "connected to %s%s using %s%s", + host, + port ? `:${port}` : "", + protocol, + version2 + ); + }); + diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { + const { + connectParams: { version: version2, protocol, port, host }, + error + } = evt; + debuglog( + "connection to %s%s using %s%s errored - %s", + host, + port ? `:${port}` : "", + protocol, + version2, + error.message + ); + }); + diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { + const { + request: { method, path: path16, origin } + } = evt; + debuglog("sending request to %s %s/%s", method, origin, path16); + }); + } + diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { + const { + address: { address, port } + } = evt; + websocketDebuglog("connection opened %s%s", address, port ? `:${port}` : ""); + }); + diagnosticsChannel.channel("undici:websocket:close").subscribe((evt) => { + const { websocket, code: code2, reason } = evt; + websocketDebuglog( + "closed connection to %s - %s %s", + websocket.url, + code2, + reason + ); + }); + diagnosticsChannel.channel("undici:websocket:socket_error").subscribe((err) => { + websocketDebuglog("connection errored - %s", err.message); + }); + diagnosticsChannel.channel("undici:websocket:ping").subscribe((evt) => { + websocketDebuglog("ping received"); + }); + diagnosticsChannel.channel("undici:websocket:pong").subscribe((evt) => { + websocketDebuglog("pong received"); + }); + } + module2.exports = { + channels + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/core/request.js +var require_request = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/core/request.js"(exports2, module2) { + "use strict"; + var { + InvalidArgumentError, + NotSupportedError + } = require_errors(); + var assert5 = require("node:assert"); + var { + isValidHTTPToken, + isValidHeaderValue, + isStream: isStream2, + destroy, + isBuffer, + isFormDataLike, + isIterable, + isBlobLike, + buildURL, + validateHandler, + getServerName, + normalizedMethodRecords + } = require_util(); + var { channels } = require_diagnostics(); + var { headerNameLowerCasedRecord } = require_constants2(); + var invalidPathRegex = /[^\u0021-\u00ff]/; + var kHandler = Symbol("handler"); + var Request = class { + constructor(origin, { + path: path16, + method, + body, + headers, + query, + idempotent, + blocking, + upgrade, + headersTimeout, + bodyTimeout, + reset, + throwOnError, + expectContinue, + servername + }, handler) { + if (typeof path16 !== "string") { + throw new InvalidArgumentError("path must be a string"); + } else if (path16[0] !== "/" && !(path16.startsWith("http://") || path16.startsWith("https://")) && method !== "CONNECT") { + throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); + } else if (invalidPathRegex.test(path16)) { + throw new InvalidArgumentError("invalid request path"); + } + if (typeof method !== "string") { + throw new InvalidArgumentError("method must be a string"); + } else if (normalizedMethodRecords[method] === void 0 && !isValidHTTPToken(method)) { + throw new InvalidArgumentError("invalid request method"); + } + if (upgrade && typeof upgrade !== "string") { + throw new InvalidArgumentError("upgrade must be a string"); + } + if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) { + throw new InvalidArgumentError("invalid headersTimeout"); + } + if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) { + throw new InvalidArgumentError("invalid bodyTimeout"); + } + if (reset != null && typeof reset !== "boolean") { + throw new InvalidArgumentError("invalid reset"); + } + if (expectContinue != null && typeof expectContinue !== "boolean") { + throw new InvalidArgumentError("invalid expectContinue"); + } + this.headersTimeout = headersTimeout; + this.bodyTimeout = bodyTimeout; + this.throwOnError = throwOnError === true; + this.method = method; + this.abort = null; + if (body == null) { + this.body = null; + } else if (isStream2(body)) { + this.body = body; + const rState = this.body._readableState; + if (!rState || !rState.autoDestroy) { + this.endHandler = function autoDestroy() { + destroy(this); + }; + this.body.on("end", this.endHandler); + } + this.errorHandler = (err) => { + if (this.abort) { + this.abort(err); + } else { + this.error = err; + } + }; + this.body.on("error", this.errorHandler); + } else if (isBuffer(body)) { + this.body = body.byteLength ? body : null; + } else if (ArrayBuffer.isView(body)) { + this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null; + } else if (body instanceof ArrayBuffer) { + this.body = body.byteLength ? Buffer.from(body) : null; + } else if (typeof body === "string") { + this.body = body.length ? Buffer.from(body) : null; + } else if (isFormDataLike(body) || isIterable(body) || isBlobLike(body)) { + this.body = body; + } else { + throw new InvalidArgumentError("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable"); + } + this.completed = false; + this.aborted = false; + this.upgrade = upgrade || null; + this.path = query ? buildURL(path16, query) : path16; + this.origin = origin; + this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; + this.blocking = blocking == null ? false : blocking; + this.reset = reset == null ? null : reset; + this.host = null; + this.contentLength = null; + this.contentType = null; + this.headers = []; + this.expectContinue = expectContinue != null ? expectContinue : false; + if (Array.isArray(headers)) { + if (headers.length % 2 !== 0) { + throw new InvalidArgumentError("headers array must be even"); + } + for (let i = 0; i < headers.length; i += 2) { + processHeader(this, headers[i], headers[i + 1]); + } + } else if (headers && typeof headers === "object") { + if (headers[Symbol.iterator]) { + for (const header of headers) { + if (!Array.isArray(header) || header.length !== 2) { + throw new InvalidArgumentError("headers must be in key-value pair format"); + } + processHeader(this, header[0], header[1]); + } + } else { + const keys = Object.keys(headers); + for (let i = 0; i < keys.length; ++i) { + processHeader(this, keys[i], headers[keys[i]]); + } + } + } else if (headers != null) { + throw new InvalidArgumentError("headers must be an object or an array"); + } + validateHandler(handler, method, upgrade); + this.servername = servername || getServerName(this.host); + this[kHandler] = handler; + if (channels.create.hasSubscribers) { + channels.create.publish({ request: this }); + } + } + onBodySent(chunk) { + if (this[kHandler].onBodySent) { + try { + return this[kHandler].onBodySent(chunk); + } catch (err) { + this.abort(err); + } + } + } + onRequestSent() { + if (channels.bodySent.hasSubscribers) { + channels.bodySent.publish({ request: this }); + } + if (this[kHandler].onRequestSent) { + try { + return this[kHandler].onRequestSent(); + } catch (err) { + this.abort(err); + } + } + } + onConnect(abort) { + assert5(!this.aborted); + assert5(!this.completed); + if (this.error) { + abort(this.error); + } else { + this.abort = abort; + return this[kHandler].onConnect(abort); + } + } + onResponseStarted() { + return this[kHandler].onResponseStarted?.(); + } + onHeaders(statusCode, headers, resume, statusText) { + assert5(!this.aborted); + assert5(!this.completed); + if (channels.headers.hasSubscribers) { + channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }); + } + try { + return this[kHandler].onHeaders(statusCode, headers, resume, statusText); + } catch (err) { + this.abort(err); + } + } + onData(chunk) { + assert5(!this.aborted); + assert5(!this.completed); + try { + return this[kHandler].onData(chunk); + } catch (err) { + this.abort(err); + return false; + } + } + onUpgrade(statusCode, headers, socket) { + assert5(!this.aborted); + assert5(!this.completed); + return this[kHandler].onUpgrade(statusCode, headers, socket); + } + onComplete(trailers) { + this.onFinally(); + assert5(!this.aborted); + this.completed = true; + if (channels.trailers.hasSubscribers) { + channels.trailers.publish({ request: this, trailers }); + } + try { + return this[kHandler].onComplete(trailers); + } catch (err) { + this.onError(err); + } + } + onError(error) { + this.onFinally(); + if (channels.error.hasSubscribers) { + channels.error.publish({ request: this, error }); + } + if (this.aborted) { + return; + } + this.aborted = true; + return this[kHandler].onError(error); + } + onFinally() { + if (this.errorHandler) { + this.body.off("error", this.errorHandler); + this.errorHandler = null; + } + if (this.endHandler) { + this.body.off("end", this.endHandler); + this.endHandler = null; + } + } + addHeader(key, value) { + processHeader(this, key, value); + return this; + } + }; + function processHeader(request, key, val) { + if (val && (typeof val === "object" && !Array.isArray(val))) { + throw new InvalidArgumentError(`invalid ${key} header`); + } else if (val === void 0) { + return; + } + let headerName = headerNameLowerCasedRecord[key]; + if (headerName === void 0) { + headerName = key.toLowerCase(); + if (headerNameLowerCasedRecord[headerName] === void 0 && !isValidHTTPToken(headerName)) { + throw new InvalidArgumentError("invalid header key"); + } + } + if (Array.isArray(val)) { + const arr = []; + for (let i = 0; i < val.length; i++) { + if (typeof val[i] === "string") { + if (!isValidHeaderValue(val[i])) { + throw new InvalidArgumentError(`invalid ${key} header`); + } + arr.push(val[i]); + } else if (val[i] === null) { + arr.push(""); + } else if (typeof val[i] === "object") { + throw new InvalidArgumentError(`invalid ${key} header`); + } else { + arr.push(`${val[i]}`); + } + } + val = arr; + } else if (typeof val === "string") { + if (!isValidHeaderValue(val)) { + throw new InvalidArgumentError(`invalid ${key} header`); + } + } else if (val === null) { + val = ""; + } else { + val = `${val}`; + } + if (request.host === null && headerName === "host") { + if (typeof val !== "string") { + throw new InvalidArgumentError("invalid host header"); + } + request.host = val; + } else if (request.contentLength === null && headerName === "content-length") { + request.contentLength = parseInt(val, 10); + if (!Number.isFinite(request.contentLength)) { + throw new InvalidArgumentError("invalid content-length header"); + } + } else if (request.contentType === null && headerName === "content-type") { + request.contentType = val; + request.headers.push(key, val); + } else if (headerName === "transfer-encoding" || headerName === "keep-alive" || headerName === "upgrade") { + throw new InvalidArgumentError(`invalid ${headerName} header`); + } else if (headerName === "connection") { + const value = typeof val === "string" ? val.toLowerCase() : null; + if (value !== "close" && value !== "keep-alive") { + throw new InvalidArgumentError("invalid connection header"); + } + if (value === "close") { + request.reset = true; + } + } else if (headerName === "expect") { + throw new NotSupportedError("expect header not supported"); + } else { + request.headers.push(key, val); + } + } + module2.exports = Request; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/util/timers.js +var require_timers = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/util/timers.js"(exports2, module2) { + "use strict"; + var fastNow = 0; + var RESOLUTION_MS = 1e3; + var TICK_MS = (RESOLUTION_MS >> 1) - 1; + var fastNowTimeout; + var kFastTimer = Symbol("kFastTimer"); + var fastTimers = []; + var NOT_IN_LIST = -2; + var TO_BE_CLEARED = -1; + var PENDING2 = 0; + var ACTIVE = 1; + function onTick() { + fastNow += TICK_MS; + let idx = 0; + let len = fastTimers.length; + while (idx < len) { + const timer = fastTimers[idx]; + if (timer._state === PENDING2) { + timer._idleStart = fastNow - TICK_MS; + timer._state = ACTIVE; + } else if (timer._state === ACTIVE && fastNow >= timer._idleStart + timer._idleTimeout) { + timer._state = TO_BE_CLEARED; + timer._idleStart = -1; + timer._onTimeout(timer._timerArg); + } + if (timer._state === TO_BE_CLEARED) { + timer._state = NOT_IN_LIST; + if (--len !== 0) { + fastTimers[idx] = fastTimers[len]; + } + } else { + ++idx; + } + } + fastTimers.length = len; + if (fastTimers.length !== 0) { + refreshTimeout(); + } + } + function refreshTimeout() { + if (fastNowTimeout) { + fastNowTimeout.refresh(); + } else { + clearTimeout(fastNowTimeout); + fastNowTimeout = setTimeout(onTick, TICK_MS); + if (fastNowTimeout.unref) { + fastNowTimeout.unref(); + } + } + } + var FastTimer = class { + [kFastTimer] = true; + /** + * The state of the timer, which can be one of the following: + * - NOT_IN_LIST (-2) + * - TO_BE_CLEARED (-1) + * - PENDING (0) + * - ACTIVE (1) + * + * @type {-2|-1|0|1} + * @private + */ + _state = NOT_IN_LIST; + /** + * The number of milliseconds to wait before calling the callback. + * + * @type {number} + * @private + */ + _idleTimeout = -1; + /** + * The time in milliseconds when the timer was started. This value is used to + * calculate when the timer should expire. + * + * @type {number} + * @default -1 + * @private + */ + _idleStart = -1; + /** + * The function to be executed when the timer expires. + * @type {Function} + * @private + */ + _onTimeout; + /** + * The argument to be passed to the callback when the timer expires. + * + * @type {*} + * @private + */ + _timerArg; + /** + * @constructor + * @param {Function} callback A function to be executed after the timer + * expires. + * @param {number} delay The time, in milliseconds that the timer should wait + * before the specified function or code is executed. + * @param {*} arg + */ + constructor(callback, delay, arg) { + this._onTimeout = callback; + this._idleTimeout = delay; + this._timerArg = arg; + this.refresh(); + } + /** + * Sets the timer's start time to the current time, and reschedules the timer + * to call its callback at the previously specified duration adjusted to the + * current time. + * Using this on a timer that has already called its callback will reactivate + * the timer. + * + * @returns {void} + */ + refresh() { + if (this._state === NOT_IN_LIST) { + fastTimers.push(this); + } + if (!fastNowTimeout || fastTimers.length === 1) { + refreshTimeout(); + } + this._state = PENDING2; + } + /** + * The `clear` method cancels the timer, preventing it from executing. + * + * @returns {void} + * @private + */ + clear() { + this._state = TO_BE_CLEARED; + this._idleStart = -1; + } + }; + module2.exports = { + /** + * The setTimeout() method sets a timer which executes a function once the + * timer expires. + * @param {Function} callback A function to be executed after the timer + * expires. + * @param {number} delay The time, in milliseconds that the timer should + * wait before the specified function or code is executed. + * @param {*} [arg] An optional argument to be passed to the callback function + * when the timer expires. + * @returns {NodeJS.Timeout|FastTimer} + */ + setTimeout(callback, delay, arg) { + return delay <= RESOLUTION_MS ? setTimeout(callback, delay, arg) : new FastTimer(callback, delay, arg); + }, + /** + * The clearTimeout method cancels an instantiated Timer previously created + * by calling setTimeout. + * + * @param {NodeJS.Timeout|FastTimer} timeout + */ + clearTimeout(timeout) { + if (timeout[kFastTimer]) { + timeout.clear(); + } else { + clearTimeout(timeout); + } + }, + /** + * The setFastTimeout() method sets a fastTimer which executes a function once + * the timer expires. + * @param {Function} callback A function to be executed after the timer + * expires. + * @param {number} delay The time, in milliseconds that the timer should + * wait before the specified function or code is executed. + * @param {*} [arg] An optional argument to be passed to the callback function + * when the timer expires. + * @returns {FastTimer} + */ + setFastTimeout(callback, delay, arg) { + return new FastTimer(callback, delay, arg); + }, + /** + * The clearTimeout method cancels an instantiated FastTimer previously + * created by calling setFastTimeout. + * + * @param {FastTimer} timeout + */ + clearFastTimeout(timeout) { + timeout.clear(); + }, + /** + * The now method returns the value of the internal fast timer clock. + * + * @returns {number} + */ + now() { + return fastNow; + }, + /** + * Trigger the onTick function to process the fastTimers array. + * Exported for testing purposes only. + * Marking as deprecated to discourage any use outside of testing. + * @deprecated + * @param {number} [delay=0] The delay in milliseconds to add to the now value. + */ + tick(delay = 0) { + fastNow += delay - RESOLUTION_MS + 1; + onTick(); + onTick(); + }, + /** + * Reset FastTimers. + * Exported for testing purposes only. + * Marking as deprecated to discourage any use outside of testing. + * @deprecated + */ + reset() { + fastNow = 0; + fastTimers.length = 0; + clearTimeout(fastNowTimeout); + fastNowTimeout = null; + }, + /** + * Exporting for testing purposes only. + * Marking as deprecated to discourage any use outside of testing. + * @deprecated + */ + kFastTimer + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/core/connect.js +var require_connect = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/core/connect.js"(exports2, module2) { + "use strict"; + var net = require("node:net"); + var assert5 = require("node:assert"); + var util = require_util(); + var { InvalidArgumentError, ConnectTimeoutError } = require_errors(); + var timers = require_timers(); + function noop3() { + } + var tls; + var SessionCache; + if (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) { + SessionCache = class WeakSessionCache { + constructor(maxCachedSessions) { + this._maxCachedSessions = maxCachedSessions; + this._sessionCache = /* @__PURE__ */ new Map(); + this._sessionRegistry = new global.FinalizationRegistry((key) => { + if (this._sessionCache.size < this._maxCachedSessions) { + return; + } + const ref = this._sessionCache.get(key); + if (ref !== void 0 && ref.deref() === void 0) { + this._sessionCache.delete(key); + } + }); + } + get(sessionKey) { + const ref = this._sessionCache.get(sessionKey); + return ref ? ref.deref() : null; + } + set(sessionKey, session) { + if (this._maxCachedSessions === 0) { + return; + } + this._sessionCache.set(sessionKey, new WeakRef(session)); + this._sessionRegistry.register(session, sessionKey); + } + }; + } else { + SessionCache = class SimpleSessionCache { + constructor(maxCachedSessions) { + this._maxCachedSessions = maxCachedSessions; + this._sessionCache = /* @__PURE__ */ new Map(); + } + get(sessionKey) { + return this._sessionCache.get(sessionKey); + } + set(sessionKey, session) { + if (this._maxCachedSessions === 0) { + return; + } + if (this._sessionCache.size >= this._maxCachedSessions) { + const { value: oldestKey } = this._sessionCache.keys().next(); + this._sessionCache.delete(oldestKey); + } + this._sessionCache.set(sessionKey, session); + } + }; + } + function buildConnector({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) { + if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { + throw new InvalidArgumentError("maxCachedSessions must be a positive integer or zero"); + } + const options = { path: socketPath, ...opts }; + const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions); + timeout = timeout == null ? 1e4 : timeout; + allowH2 = allowH2 != null ? allowH2 : false; + return function connect({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) { + let socket; + if (protocol === "https:") { + if (!tls) { + tls = require("node:tls"); + } + servername = servername || options.servername || util.getServerName(host) || null; + const sessionKey = servername || hostname; + assert5(sessionKey); + const session = customSession || sessionCache.get(sessionKey) || null; + port = port || 443; + socket = tls.connect({ + highWaterMark: 16384, + // TLS in node can't have bigger HWM anyway... + ...options, + servername, + session, + localAddress, + // TODO(HTTP/2): Add support for h2c + ALPNProtocols: allowH2 ? ["http/1.1", "h2"] : ["http/1.1"], + socket: httpSocket, + // upgrade socket connection + port, + host: hostname + }); + socket.on("session", function(session2) { + sessionCache.set(sessionKey, session2); + }); + } else { + assert5(!httpSocket, "httpSocket can only be sent on TLS update"); + port = port || 80; + socket = net.connect({ + highWaterMark: 64 * 1024, + // Same as nodejs fs streams. + ...options, + localAddress, + port, + host: hostname + }); + } + if (options.keepAlive == null || options.keepAlive) { + const keepAliveInitialDelay = options.keepAliveInitialDelay === void 0 ? 6e4 : options.keepAliveInitialDelay; + socket.setKeepAlive(true, keepAliveInitialDelay); + } + const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), { timeout, hostname, port }); + socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() { + queueMicrotask(clearConnectTimeout); + if (callback) { + const cb = callback; + callback = null; + cb(null, this); + } + }).on("error", function(err) { + queueMicrotask(clearConnectTimeout); + if (callback) { + const cb = callback; + callback = null; + cb(err); + } + }); + return socket; + }; + } + var setupConnectTimeout = process.platform === "win32" ? (socketWeakRef, opts) => { + if (!opts.timeout) { + return noop3; + } + let s1 = null; + let s2 = null; + const fastTimer = timers.setFastTimeout(() => { + s1 = setImmediate(() => { + s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts)); + }); + }, opts.timeout); + return () => { + timers.clearFastTimeout(fastTimer); + clearImmediate(s1); + clearImmediate(s2); + }; + } : (socketWeakRef, opts) => { + if (!opts.timeout) { + return noop3; + } + let s1 = null; + const fastTimer = timers.setFastTimeout(() => { + s1 = setImmediate(() => { + onConnectTimeout(socketWeakRef.deref(), opts); + }); + }, opts.timeout); + return () => { + timers.clearFastTimeout(fastTimer); + clearImmediate(s1); + }; + }; + function onConnectTimeout(socket, opts) { + if (socket == null) { + return; + } + let message = "Connect Timeout Error"; + if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) { + message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(", ")},`; + } else { + message += ` (attempted address: ${opts.hostname}:${opts.port},`; + } + message += ` timeout: ${opts.timeout}ms)`; + util.destroy(socket, new ConnectTimeoutError(message)); + } + module2.exports = buildConnector; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/llhttp/utils.js +var require_utils = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/llhttp/utils.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.enumToMap = void 0; + function enumToMap(obj) { + const res = {}; + Object.keys(obj).forEach((key) => { + const value = obj[key]; + if (typeof value === "number") { + res[key] = value; + } + }); + return res; + } + exports2.enumToMap = enumToMap; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/llhttp/constants.js +var require_constants3 = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/llhttp/constants.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SPECIAL_HEADERS = exports2.HEADER_STATE = exports2.MINOR = exports2.MAJOR = exports2.CONNECTION_TOKEN_CHARS = exports2.HEADER_CHARS = exports2.TOKEN = exports2.STRICT_TOKEN = exports2.HEX = exports2.URL_CHAR = exports2.STRICT_URL_CHAR = exports2.USERINFO_CHARS = exports2.MARK = exports2.ALPHANUM = exports2.NUM = exports2.HEX_MAP = exports2.NUM_MAP = exports2.ALPHA = exports2.FINISH = exports2.H_METHOD_MAP = exports2.METHOD_MAP = exports2.METHODS_RTSP = exports2.METHODS_ICE = exports2.METHODS_HTTP = exports2.METHODS = exports2.LENIENT_FLAGS = exports2.FLAGS = exports2.TYPE = exports2.ERROR = void 0; + var utils_1 = require_utils(); + var ERROR2; + (function(ERROR3) { + ERROR3[ERROR3["OK"] = 0] = "OK"; + ERROR3[ERROR3["INTERNAL"] = 1] = "INTERNAL"; + ERROR3[ERROR3["STRICT"] = 2] = "STRICT"; + ERROR3[ERROR3["LF_EXPECTED"] = 3] = "LF_EXPECTED"; + ERROR3[ERROR3["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH"; + ERROR3[ERROR3["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION"; + ERROR3[ERROR3["INVALID_METHOD"] = 6] = "INVALID_METHOD"; + ERROR3[ERROR3["INVALID_URL"] = 7] = "INVALID_URL"; + ERROR3[ERROR3["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT"; + ERROR3[ERROR3["INVALID_VERSION"] = 9] = "INVALID_VERSION"; + ERROR3[ERROR3["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN"; + ERROR3[ERROR3["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH"; + ERROR3[ERROR3["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE"; + ERROR3[ERROR3["INVALID_STATUS"] = 13] = "INVALID_STATUS"; + ERROR3[ERROR3["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE"; + ERROR3[ERROR3["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING"; + ERROR3[ERROR3["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN"; + ERROR3[ERROR3["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE"; + ERROR3[ERROR3["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE"; + ERROR3[ERROR3["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER"; + ERROR3[ERROR3["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE"; + ERROR3[ERROR3["PAUSED"] = 21] = "PAUSED"; + ERROR3[ERROR3["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE"; + ERROR3[ERROR3["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE"; + ERROR3[ERROR3["USER"] = 24] = "USER"; + })(ERROR2 = exports2.ERROR || (exports2.ERROR = {})); + var TYPE; + (function(TYPE2) { + TYPE2[TYPE2["BOTH"] = 0] = "BOTH"; + TYPE2[TYPE2["REQUEST"] = 1] = "REQUEST"; + TYPE2[TYPE2["RESPONSE"] = 2] = "RESPONSE"; + })(TYPE = exports2.TYPE || (exports2.TYPE = {})); + var FLAGS; + (function(FLAGS2) { + FLAGS2[FLAGS2["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE"; + FLAGS2[FLAGS2["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE"; + FLAGS2[FLAGS2["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE"; + FLAGS2[FLAGS2["CHUNKED"] = 8] = "CHUNKED"; + FLAGS2[FLAGS2["UPGRADE"] = 16] = "UPGRADE"; + FLAGS2[FLAGS2["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH"; + FLAGS2[FLAGS2["SKIPBODY"] = 64] = "SKIPBODY"; + FLAGS2[FLAGS2["TRAILING"] = 128] = "TRAILING"; + FLAGS2[FLAGS2["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING"; + })(FLAGS = exports2.FLAGS || (exports2.FLAGS = {})); + var LENIENT_FLAGS; + (function(LENIENT_FLAGS2) { + LENIENT_FLAGS2[LENIENT_FLAGS2["HEADERS"] = 1] = "HEADERS"; + LENIENT_FLAGS2[LENIENT_FLAGS2["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH"; + LENIENT_FLAGS2[LENIENT_FLAGS2["KEEP_ALIVE"] = 4] = "KEEP_ALIVE"; + })(LENIENT_FLAGS = exports2.LENIENT_FLAGS || (exports2.LENIENT_FLAGS = {})); + var METHODS; + (function(METHODS2) { + METHODS2[METHODS2["DELETE"] = 0] = "DELETE"; + METHODS2[METHODS2["GET"] = 1] = "GET"; + METHODS2[METHODS2["HEAD"] = 2] = "HEAD"; + METHODS2[METHODS2["POST"] = 3] = "POST"; + METHODS2[METHODS2["PUT"] = 4] = "PUT"; + METHODS2[METHODS2["CONNECT"] = 5] = "CONNECT"; + METHODS2[METHODS2["OPTIONS"] = 6] = "OPTIONS"; + METHODS2[METHODS2["TRACE"] = 7] = "TRACE"; + METHODS2[METHODS2["COPY"] = 8] = "COPY"; + METHODS2[METHODS2["LOCK"] = 9] = "LOCK"; + METHODS2[METHODS2["MKCOL"] = 10] = "MKCOL"; + METHODS2[METHODS2["MOVE"] = 11] = "MOVE"; + METHODS2[METHODS2["PROPFIND"] = 12] = "PROPFIND"; + METHODS2[METHODS2["PROPPATCH"] = 13] = "PROPPATCH"; + METHODS2[METHODS2["SEARCH"] = 14] = "SEARCH"; + METHODS2[METHODS2["UNLOCK"] = 15] = "UNLOCK"; + METHODS2[METHODS2["BIND"] = 16] = "BIND"; + METHODS2[METHODS2["REBIND"] = 17] = "REBIND"; + METHODS2[METHODS2["UNBIND"] = 18] = "UNBIND"; + METHODS2[METHODS2["ACL"] = 19] = "ACL"; + METHODS2[METHODS2["REPORT"] = 20] = "REPORT"; + METHODS2[METHODS2["MKACTIVITY"] = 21] = "MKACTIVITY"; + METHODS2[METHODS2["CHECKOUT"] = 22] = "CHECKOUT"; + METHODS2[METHODS2["MERGE"] = 23] = "MERGE"; + METHODS2[METHODS2["M-SEARCH"] = 24] = "M-SEARCH"; + METHODS2[METHODS2["NOTIFY"] = 25] = "NOTIFY"; + METHODS2[METHODS2["SUBSCRIBE"] = 26] = "SUBSCRIBE"; + METHODS2[METHODS2["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE"; + METHODS2[METHODS2["PATCH"] = 28] = "PATCH"; + METHODS2[METHODS2["PURGE"] = 29] = "PURGE"; + METHODS2[METHODS2["MKCALENDAR"] = 30] = "MKCALENDAR"; + METHODS2[METHODS2["LINK"] = 31] = "LINK"; + METHODS2[METHODS2["UNLINK"] = 32] = "UNLINK"; + METHODS2[METHODS2["SOURCE"] = 33] = "SOURCE"; + METHODS2[METHODS2["PRI"] = 34] = "PRI"; + METHODS2[METHODS2["DESCRIBE"] = 35] = "DESCRIBE"; + METHODS2[METHODS2["ANNOUNCE"] = 36] = "ANNOUNCE"; + METHODS2[METHODS2["SETUP"] = 37] = "SETUP"; + METHODS2[METHODS2["PLAY"] = 38] = "PLAY"; + METHODS2[METHODS2["PAUSE"] = 39] = "PAUSE"; + METHODS2[METHODS2["TEARDOWN"] = 40] = "TEARDOWN"; + METHODS2[METHODS2["GET_PARAMETER"] = 41] = "GET_PARAMETER"; + METHODS2[METHODS2["SET_PARAMETER"] = 42] = "SET_PARAMETER"; + METHODS2[METHODS2["REDIRECT"] = 43] = "REDIRECT"; + METHODS2[METHODS2["RECORD"] = 44] = "RECORD"; + METHODS2[METHODS2["FLUSH"] = 45] = "FLUSH"; + })(METHODS = exports2.METHODS || (exports2.METHODS = {})); + exports2.METHODS_HTTP = [ + METHODS.DELETE, + METHODS.GET, + METHODS.HEAD, + METHODS.POST, + METHODS.PUT, + METHODS.CONNECT, + METHODS.OPTIONS, + METHODS.TRACE, + METHODS.COPY, + METHODS.LOCK, + METHODS.MKCOL, + METHODS.MOVE, + METHODS.PROPFIND, + METHODS.PROPPATCH, + METHODS.SEARCH, + METHODS.UNLOCK, + METHODS.BIND, + METHODS.REBIND, + METHODS.UNBIND, + METHODS.ACL, + METHODS.REPORT, + METHODS.MKACTIVITY, + METHODS.CHECKOUT, + METHODS.MERGE, + METHODS["M-SEARCH"], + METHODS.NOTIFY, + METHODS.SUBSCRIBE, + METHODS.UNSUBSCRIBE, + METHODS.PATCH, + METHODS.PURGE, + METHODS.MKCALENDAR, + METHODS.LINK, + METHODS.UNLINK, + METHODS.PRI, + // TODO(indutny): should we allow it with HTTP? + METHODS.SOURCE + ]; + exports2.METHODS_ICE = [ + METHODS.SOURCE + ]; + exports2.METHODS_RTSP = [ + METHODS.OPTIONS, + METHODS.DESCRIBE, + METHODS.ANNOUNCE, + METHODS.SETUP, + METHODS.PLAY, + METHODS.PAUSE, + METHODS.TEARDOWN, + METHODS.GET_PARAMETER, + METHODS.SET_PARAMETER, + METHODS.REDIRECT, + METHODS.RECORD, + METHODS.FLUSH, + // For AirPlay + METHODS.GET, + METHODS.POST + ]; + exports2.METHOD_MAP = utils_1.enumToMap(METHODS); + exports2.H_METHOD_MAP = {}; + Object.keys(exports2.METHOD_MAP).forEach((key) => { + if (/^H/.test(key)) { + exports2.H_METHOD_MAP[key] = exports2.METHOD_MAP[key]; + } + }); + var FINISH; + (function(FINISH2) { + FINISH2[FINISH2["SAFE"] = 0] = "SAFE"; + FINISH2[FINISH2["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB"; + FINISH2[FINISH2["UNSAFE"] = 2] = "UNSAFE"; + })(FINISH = exports2.FINISH || (exports2.FINISH = {})); + exports2.ALPHA = []; + for (let i = "A".charCodeAt(0); i <= "Z".charCodeAt(0); i++) { + exports2.ALPHA.push(String.fromCharCode(i)); + exports2.ALPHA.push(String.fromCharCode(i + 32)); + } + exports2.NUM_MAP = { + 0: 0, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + 7: 7, + 8: 8, + 9: 9 + }; + exports2.HEX_MAP = { + 0: 0, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + 7: 7, + 8: 8, + 9: 9, + A: 10, + B: 11, + C: 12, + D: 13, + E: 14, + F: 15, + a: 10, + b: 11, + c: 12, + d: 13, + e: 14, + f: 15 + }; + exports2.NUM = [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9" + ]; + exports2.ALPHANUM = exports2.ALPHA.concat(exports2.NUM); + exports2.MARK = ["-", "_", ".", "!", "~", "*", "'", "(", ")"]; + exports2.USERINFO_CHARS = exports2.ALPHANUM.concat(exports2.MARK).concat(["%", ";", ":", "&", "=", "+", "$", ","]); + exports2.STRICT_URL_CHAR = [ + "!", + '"', + "$", + "%", + "&", + "'", + "(", + ")", + "*", + "+", + ",", + "-", + ".", + "/", + ":", + ";", + "<", + "=", + ">", + "@", + "[", + "\\", + "]", + "^", + "_", + "`", + "{", + "|", + "}", + "~" + ].concat(exports2.ALPHANUM); + exports2.URL_CHAR = exports2.STRICT_URL_CHAR.concat([" ", "\f"]); + for (let i = 128; i <= 255; i++) { + exports2.URL_CHAR.push(i); + } + exports2.HEX = exports2.NUM.concat(["a", "b", "c", "d", "e", "f", "A", "B", "C", "D", "E", "F"]); + exports2.STRICT_TOKEN = [ + "!", + "#", + "$", + "%", + "&", + "'", + "*", + "+", + "-", + ".", + "^", + "_", + "`", + "|", + "~" + ].concat(exports2.ALPHANUM); + exports2.TOKEN = exports2.STRICT_TOKEN.concat([" "]); + exports2.HEADER_CHARS = [" "]; + for (let i = 32; i <= 255; i++) { + if (i !== 127) { + exports2.HEADER_CHARS.push(i); + } + } + exports2.CONNECTION_TOKEN_CHARS = exports2.HEADER_CHARS.filter((c) => c !== 44); + exports2.MAJOR = exports2.NUM_MAP; + exports2.MINOR = exports2.MAJOR; + var HEADER_STATE; + (function(HEADER_STATE2) { + HEADER_STATE2[HEADER_STATE2["GENERAL"] = 0] = "GENERAL"; + HEADER_STATE2[HEADER_STATE2["CONNECTION"] = 1] = "CONNECTION"; + HEADER_STATE2[HEADER_STATE2["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH"; + HEADER_STATE2[HEADER_STATE2["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING"; + HEADER_STATE2[HEADER_STATE2["UPGRADE"] = 4] = "UPGRADE"; + HEADER_STATE2[HEADER_STATE2["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE"; + HEADER_STATE2[HEADER_STATE2["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE"; + HEADER_STATE2[HEADER_STATE2["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE"; + HEADER_STATE2[HEADER_STATE2["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED"; + })(HEADER_STATE = exports2.HEADER_STATE || (exports2.HEADER_STATE = {})); + exports2.SPECIAL_HEADERS = { + "connection": HEADER_STATE.CONNECTION, + "content-length": HEADER_STATE.CONTENT_LENGTH, + "proxy-connection": HEADER_STATE.CONNECTION, + "transfer-encoding": HEADER_STATE.TRANSFER_ENCODING, + "upgrade": HEADER_STATE.UPGRADE + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/llhttp/llhttp-wasm.js +var require_llhttp_wasm = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/llhttp/llhttp-wasm.js"(exports2, module2) { + "use strict"; + var { Buffer: Buffer3 } = require("node:buffer"); + module2.exports = Buffer3.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK07MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtXACAAQRhqQgA3AwAgAEIANwMAIABBOGpCADcDACAAQTBqQgA3AwAgAEEoakIANwMAIABBIGpCADcDACAAQRBqQgA3AwAgAEEIakIANwMAIABB3QE2AhwLBgAgABAyC5otAQt/IwBBEGsiCiQAQaTQACgCACIJRQRAQeTTACgCACIFRQRAQfDTAEJ/NwIAQejTAEKAgISAgIDAADcCAEHk0wAgCkEIakFwcUHYqtWqBXMiBTYCAEH40wBBADYCAEHI0wBBADYCAAtBzNMAQYDUBDYCAEGc0ABBgNQENgIAQbDQACAFNgIAQazQAEF/NgIAQdDTAEGArAM2AgADQCABQcjQAGogAUG80ABqIgI2AgAgAiABQbTQAGoiAzYCACABQcDQAGogAzYCACABQdDQAGogAUHE0ABqIgM2AgAgAyACNgIAIAFB2NAAaiABQczQAGoiAjYCACACIAM2AgAgAUHU0ABqIAI2AgAgAUEgaiIBQYACRw0AC0GM1ARBwasDNgIAQajQAEH00wAoAgA2AgBBmNAAQcCrAzYCAEGk0ABBiNQENgIAQcz/B0E4NgIAQYjUBCEJCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFNBEBBjNAAKAIAIgZBECAAQRNqQXBxIABBC0kbIgRBA3YiAHYiAUEDcQRAAkAgAUEBcSAAckEBcyICQQN0IgBBtNAAaiIBIABBvNAAaigCACIAKAIIIgNGBEBBjNAAIAZBfiACd3E2AgAMAQsgASADNgIIIAMgATYCDAsgAEEIaiEBIAAgAkEDdCICQQNyNgIEIAAgAmoiACAAKAIEQQFyNgIEDBELQZTQACgCACIIIARPDQEgAQRAAkBBAiAAdCICQQAgAmtyIAEgAHRxaCIAQQN0IgJBtNAAaiIBIAJBvNAAaigCACICKAIIIgNGBEBBjNAAIAZBfiAAd3EiBjYCAAwBCyABIAM2AgggAyABNgIMCyACIARBA3I2AgQgAEEDdCIAIARrIQUgACACaiAFNgIAIAIgBGoiBCAFQQFyNgIEIAgEQCAIQXhxQbTQAGohAEGg0AAoAgAhAwJ/QQEgCEEDdnQiASAGcUUEQEGM0AAgASAGcjYCACAADAELIAAoAggLIgEgAzYCDCAAIAM2AgggAyAANgIMIAMgATYCCAsgAkEIaiEBQaDQACAENgIAQZTQACAFNgIADBELQZDQACgCACILRQ0BIAtoQQJ0QbzSAGooAgAiACgCBEF4cSAEayEFIAAhAgNAAkAgAigCECIBRQRAIAJBFGooAgAiAUUNAQsgASgCBEF4cSAEayIDIAVJIQIgAyAFIAIbIQUgASAAIAIbIQAgASECDAELCyAAKAIYIQkgACgCDCIDIABHBEBBnNAAKAIAGiADIAAoAggiATYCCCABIAM2AgwMEAsgAEEUaiICKAIAIgFFBEAgACgCECIBRQ0DIABBEGohAgsDQCACIQcgASIDQRRqIgIoAgAiAQ0AIANBEGohAiADKAIQIgENAAsgB0EANgIADA8LQX8hBCAAQb9/Sw0AIABBE2oiAUFwcSEEQZDQACgCACIIRQ0AQQAgBGshBQJAAkACQAJ/QQAgBEGAAkkNABpBHyAEQf///wdLDQAaIARBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmoLIgZBAnRBvNIAaigCACICRQRAQQAhAUEAIQMMAQtBACEBIARBGSAGQQF2a0EAIAZBH0cbdCEAQQAhAwNAAkAgAigCBEF4cSAEayIHIAVPDQAgAiEDIAciBQ0AQQAhBSACIQEMAwsgASACQRRqKAIAIgcgByACIABBHXZBBHFqQRBqKAIAIgJGGyABIAcbIQEgAEEBdCEAIAINAAsLIAEgA3JFBEBBACEDQQIgBnQiAEEAIABrciAIcSIARQ0DIABoQQJ0QbzSAGooAgAhAQsgAUUNAQsDQCABKAIEQXhxIARrIgIgBUkhACACIAUgABshBSABIAMgABshAyABKAIQIgAEfyAABSABQRRqKAIACyIBDQALCyADRQ0AIAVBlNAAKAIAIARrTw0AIAMoAhghByADIAMoAgwiAEcEQEGc0AAoAgAaIAAgAygCCCIBNgIIIAEgADYCDAwOCyADQRRqIgIoAgAiAUUEQCADKAIQIgFFDQMgA0EQaiECCwNAIAIhBiABIgBBFGoiAigCACIBDQAgAEEQaiECIAAoAhAiAQ0ACyAGQQA2AgAMDQtBlNAAKAIAIgMgBE8EQEGg0AAoAgAhAQJAIAMgBGsiAkEQTwRAIAEgBGoiACACQQFyNgIEIAEgA2ogAjYCACABIARBA3I2AgQMAQsgASADQQNyNgIEIAEgA2oiACAAKAIEQQFyNgIEQQAhAEEAIQILQZTQACACNgIAQaDQACAANgIAIAFBCGohAQwPC0GY0AAoAgAiAyAESwRAIAQgCWoiACADIARrIgFBAXI2AgRBpNAAIAA2AgBBmNAAIAE2AgAgCSAEQQNyNgIEIAlBCGohAQwPC0EAIQEgBAJ/QeTTACgCAARAQezTACgCAAwBC0Hw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBDGpBcHFB2KrVqgVzNgIAQfjTAEEANgIAQcjTAEEANgIAQYCABAsiACAEQccAaiIFaiIGQQAgAGsiB3EiAk8EQEH80wBBMDYCAAwPCwJAQcTTACgCACIBRQ0AQbzTACgCACIIIAJqIQAgACABTSAAIAhLcQ0AQQAhAUH80wBBMDYCAAwPC0HI0wAtAABBBHENBAJAAkAgCQRAQczTACEBA0AgASgCACIAIAlNBEAgACABKAIEaiAJSw0DCyABKAIIIgENAAsLQQAQMyIAQX9GDQUgAiEGQejTACgCACIBQQFrIgMgAHEEQCACIABrIAAgA2pBACABa3FqIQYLIAQgBk8NBSAGQf7///8HSw0FQcTTACgCACIDBEBBvNMAKAIAIgcgBmohASABIAdNDQYgASADSw0GCyAGEDMiASAARw0BDAcLIAYgA2sgB3EiBkH+////B0sNBCAGEDMhACAAIAEoAgAgASgCBGpGDQMgACEBCwJAIAYgBEHIAGpPDQAgAUF/Rg0AQezTACgCACIAIAUgBmtqQQAgAGtxIgBB/v///wdLBEAgASEADAcLIAAQM0F/RwRAIAAgBmohBiABIQAMBwtBACAGaxAzGgwECyABIgBBf0cNBQwDC0EAIQMMDAtBACEADAoLIABBf0cNAgtByNMAQcjTACgCAEEEcjYCAAsgAkH+////B0sNASACEDMhAEEAEDMhASAAQX9GDQEgAUF/Rg0BIAAgAU8NASABIABrIgYgBEE4ak0NAQtBvNMAQbzTACgCACAGaiIBNgIAQcDTACgCACABSQRAQcDTACABNgIACwJAAkACQEGk0AAoAgAiAgRAQczTACEBA0AgACABKAIAIgMgASgCBCIFakYNAiABKAIIIgENAAsMAgtBnNAAKAIAIgFBAEcgACABT3FFBEBBnNAAIAA2AgALQQAhAUHQ0wAgBjYCAEHM0wAgADYCAEGs0ABBfzYCAEGw0ABB5NMAKAIANgIAQdjTAEEANgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBeCAAa0EPcSIBIABqIgIgBkE4ayIDIAFrIgFBAXI2AgRBqNAAQfTTACgCADYCAEGY0AAgATYCAEGk0AAgAjYCACAAIANqQTg2AgQMAgsgACACTQ0AIAIgA0kNACABKAIMQQhxDQBBeCACa0EPcSIAIAJqIgNBmNAAKAIAIAZqIgcgAGsiAEEBcjYCBCABIAUgBmo2AgRBqNAAQfTTACgCADYCAEGY0AAgADYCAEGk0AAgAzYCACACIAdqQTg2AgQMAQsgAEGc0AAoAgBJBEBBnNAAIAA2AgALIAAgBmohA0HM0wAhAQJAAkACQANAIAMgASgCAEcEQCABKAIIIgENAQwCCwsgAS0ADEEIcUUNAQtBzNMAIQEDQCABKAIAIgMgAk0EQCADIAEoAgRqIgUgAksNAwsgASgCCCEBDAALAAsgASAANgIAIAEgASgCBCAGajYCBCAAQXggAGtBD3FqIgkgBEEDcjYCBCADQXggA2tBD3FqIgYgBCAJaiIEayEBIAIgBkYEQEGk0AAgBDYCAEGY0ABBmNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEDAgLQaDQACgCACAGRgRAQaDQACAENgIAQZTQAEGU0AAoAgAgAWoiADYCACAEIABBAXI2AgQgACAEaiAANgIADAgLIAYoAgQiBUEDcUEBRw0GIAVBeHEhCCAFQf8BTQRAIAVBA3YhAyAGKAIIIgAgBigCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBwsgAiAANgIIIAAgAjYCDAwGCyAGKAIYIQcgBiAGKAIMIgBHBEAgACAGKAIIIgI2AgggAiAANgIMDAULIAZBFGoiAigCACIFRQRAIAYoAhAiBUUNBCAGQRBqIQILA0AgAiEDIAUiAEEUaiICKAIAIgUNACAAQRBqIQIgACgCECIFDQALIANBADYCAAwEC0F4IABrQQ9xIgEgAGoiByAGQThrIgMgAWsiAUEBcjYCBCAAIANqQTg2AgQgAiAFQTcgBWtBD3FqQT9rIgMgAyACQRBqSRsiA0EjNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAc2AgAgA0EQakHU0wApAgA3AgAgA0HM0wApAgA3AghB1NMAIANBCGo2AgBB0NMAIAY2AgBBzNMAIAA2AgBB2NMAQQA2AgAgA0EkaiEBA0AgAUEHNgIAIAUgAUEEaiIBSw0ACyACIANGDQAgAyADKAIEQX5xNgIEIAMgAyACayIFNgIAIAIgBUEBcjYCBCAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIDcUUEQEGM0AAgASADcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEGQ0AAoAgAiA0EBIAF0IgZxRQRAIAAgAjYCAEGQ0AAgAyAGcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQMCQANAIAMiACgCBEF4cSAFRg0BIAFBHXYhAyABQQF0IQEgACADQQRxakEQaiIGKAIAIgMNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAtBmNAAKAIAIgEgBE0NAEGk0AAoAgAiACAEaiICIAEgBGsiAUEBcjYCBEGY0AAgATYCAEGk0AAgAjYCACAAIARBA3I2AgQgAEEIaiEBDAgLQQAhAUH80wBBMDYCAAwHC0EAIQALIAdFDQACQCAGKAIcIgJBAnRBvNIAaiIDKAIAIAZGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAdBEEEUIAcoAhAgBkYbaiAANgIAIABFDQELIAAgBzYCGCAGKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAGQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAIaiEBIAYgCGoiBigCBCEFCyAGIAVBfnE2AgQgASAEaiABNgIAIAQgAUEBcjYCBCABQf8BTQRAIAFBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASABQQN2dCIBcUUEQEGM0AAgASACcjYCACAADAELIAAoAggLIgEgBDYCDCAAIAQ2AgggBCAANgIMIAQgATYCCAwBC0EfIQUgAUH///8HTQRAIAFBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohBQsgBCAFNgIcIARCADcCECAFQQJ0QbzSAGohAEGQ0AAoAgAiAkEBIAV0IgNxRQRAIAAgBDYCAEGQ0AAgAiADcjYCACAEIAA2AhggBCAENgIIIAQgBDYCDAwBCyABQRkgBUEBdmtBACAFQR9HG3QhBSAAKAIAIQACQANAIAAiAigCBEF4cSABRg0BIAVBHXYhACAFQQF0IQUgAiAAQQRxakEQaiIDKAIAIgANAAsgAyAENgIAIAQgAjYCGCAEIAQ2AgwgBCAENgIIDAELIAIoAggiACAENgIMIAIgBDYCCCAEQQA2AhggBCACNgIMIAQgADYCCAsgCUEIaiEBDAILAkAgB0UNAAJAIAMoAhwiAUECdEG80gBqIgIoAgAgA0YEQCACIAA2AgAgAA0BQZDQACAIQX4gAXdxIgg2AgAMAgsgB0EQQRQgBygCECADRhtqIAA2AgAgAEUNAQsgACAHNgIYIAMoAhAiAQRAIAAgATYCECABIAA2AhgLIANBFGooAgAiAUUNACAAQRRqIAE2AgAgASAANgIYCwJAIAVBD00EQCADIAQgBWoiAEEDcjYCBCAAIANqIgAgACgCBEEBcjYCBAwBCyADIARqIgIgBUEBcjYCBCADIARBA3I2AgQgAiAFaiAFNgIAIAVB/wFNBEAgBUF4cUG00ABqIQACf0GM0AAoAgAiAUEBIAVBA3Z0IgVxRQRAQYzQACABIAVyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRBvNIAaiEAQQEgAXQiBCAIcUUEQCAAIAI2AgBBkNAAIAQgCHI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEEAkADQCAEIgAoAgRBeHEgBUYNASABQR12IQQgAUEBdCEBIAAgBEEEcWpBEGoiBigCACIEDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLIANBCGohAQwBCwJAIAlFDQACQCAAKAIcIgFBAnRBvNIAaiICKAIAIABGBEAgAiADNgIAIAMNAUGQ0AAgC0F+IAF3cTYCAAwCCyAJQRBBFCAJKAIQIABGG2ogAzYCACADRQ0BCyADIAk2AhggACgCECIBBEAgAyABNgIQIAEgAzYCGAsgAEEUaigCACIBRQ0AIANBFGogATYCACABIAM2AhgLAkAgBUEPTQRAIAAgBCAFaiIBQQNyNgIEIAAgAWoiASABKAIEQQFyNgIEDAELIAAgBGoiByAFQQFyNgIEIAAgBEEDcjYCBCAFIAdqIAU2AgAgCARAIAhBeHFBtNAAaiEBQaDQACgCACEDAn9BASAIQQN2dCICIAZxRQRAQYzQACACIAZyNgIAIAEMAQsgASgCCAsiAiADNgIMIAEgAzYCCCADIAE2AgwgAyACNgIIC0Gg0AAgBzYCAEGU0AAgBTYCAAsgAEEIaiEBCyAKQRBqJAAgAQtDACAARQRAPwBBEHQPCwJAIABB//8DcQ0AIABBAEgNACAAQRB2QAAiAEF/RgRAQfzTAEEwNgIAQX8PCyAAQRB0DwsACwvcPyIAQYAICwkBAAAAAgAAAAMAQZQICwUEAAAABQBBpAgLCQYAAAAHAAAACABB3AgLii1JbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AFJlc3BvbnNlIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zAFVzZXIgY2FsbGJhY2sgZXJyb3IAYG9uX3Jlc2V0YCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfaGVhZGVyYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9iZWdpbmAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3N0YXR1c19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3ZlcnNpb25fY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl91cmxfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXRob2RfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfZmllbGRfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fbmFtZWAgY2FsbGJhY2sgZXJyb3IAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzZXJ2ZXIASW52YWxpZCBoZWFkZXIgdmFsdWUgY2hhcgBJbnZhbGlkIGhlYWRlciBmaWVsZCBjaGFyAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdmVyc2lvbgBJbnZhbGlkIG1pbm9yIHZlcnNpb24ASW52YWxpZCBtYWpvciB2ZXJzaW9uAEV4cGVjdGVkIHNwYWNlIGFmdGVyIHZlcnNpb24ARXhwZWN0ZWQgQ1JMRiBhZnRlciB2ZXJzaW9uAEludmFsaWQgSFRUUCB2ZXJzaW9uAEludmFsaWQgaGVhZGVyIHRva2VuAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdXJsAEludmFsaWQgY2hhcmFjdGVycyBpbiB1cmwAVW5leHBlY3RlZCBzdGFydCBjaGFyIGluIHVybABEb3VibGUgQCBpbiB1cmwARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgARHVwbGljYXRlIENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhciBpbiB1cmwgcGF0aABDb250ZW50LUxlbmd0aCBjYW4ndCBiZSBwcmVzZW50IHdpdGggVHJhbnNmZXItRW5jb2RpbmcASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgc2l6ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl92YWx1ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlZCB2YWx1ZQBQYXVzZWQgYnkgb25faGVhZGVyc19jb21wbGV0ZQBJbnZhbGlkIEVPRiBzdGF0ZQBvbl9yZXNldCBwYXVzZQBvbl9jaHVua19oZWFkZXIgcGF1c2UAb25fbWVzc2FnZV9iZWdpbiBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fdmFsdWUgcGF1c2UAb25fc3RhdHVzX2NvbXBsZXRlIHBhdXNlAG9uX3ZlcnNpb25fY29tcGxldGUgcGF1c2UAb25fdXJsX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXNzYWdlX2NvbXBsZXRlIHBhdXNlAG9uX21ldGhvZF9jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfZmllbGRfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUgcGF1c2UAVW5leHBlY3RlZCBzcGFjZSBhZnRlciBzdGFydCBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAFBhdXNlIG9uIENPTk5FQ1QvVXBncmFkZQBQYXVzZSBvbiBQUkkvVXBncmFkZQBFeHBlY3RlZCBIVFRQLzIgQ29ubmVjdGlvbiBQcmVmYWNlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fbWV0aG9kAEV4cGVjdGVkIHNwYWNlIGFmdGVyIG1ldGhvZABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl9maWVsZABQYXVzZWQASW52YWxpZCB3b3JkIGVuY291bnRlcmVkAEludmFsaWQgbWV0aG9kIGVuY291bnRlcmVkAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2NoZW1hAFJlcXVlc3QgaGFzIGludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYABTV0lUQ0hfUFJPWFkAVVNFX1BST1hZAE1LQUNUSVZJVFkAVU5QUk9DRVNTQUJMRV9FTlRJVFkAQ09QWQBNT1ZFRF9QRVJNQU5FTlRMWQBUT09fRUFSTFkATk9USUZZAEZBSUxFRF9ERVBFTkRFTkNZAEJBRF9HQVRFV0FZAFBMQVkAUFVUAENIRUNLT1VUAEdBVEVXQVlfVElNRU9VVABSRVFVRVNUX1RJTUVPVVQATkVUV09SS19DT05ORUNUX1RJTUVPVVQAQ09OTkVDVElPTl9USU1FT1VUAExPR0lOX1RJTUVPVVQATkVUV09SS19SRUFEX1RJTUVPVVQAUE9TVABNSVNESVJFQ1RFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX0xPQURfQkFMQU5DRURfUkVRVUVTVABCQURfUkVRVUVTVABIVFRQX1JFUVVFU1RfU0VOVF9UT19IVFRQU19QT1JUAFJFUE9SVABJTV9BX1RFQVBPVABSRVNFVF9DT05URU5UAE5PX0NPTlRFTlQAUEFSVElBTF9DT05URU5UAEhQRV9JTlZBTElEX0NPTlNUQU5UAEhQRV9DQl9SRVNFVABHRVQASFBFX1NUUklDVABDT05GTElDVABURU1QT1JBUllfUkVESVJFQ1QAUEVSTUFORU5UX1JFRElSRUNUAENPTk5FQ1QATVVMVElfU1RBVFVTAEhQRV9JTlZBTElEX1NUQVRVUwBUT09fTUFOWV9SRVFVRVNUUwBFQVJMWV9ISU5UUwBVTkFWQUlMQUJMRV9GT1JfTEVHQUxfUkVBU09OUwBPUFRJT05TAFNXSVRDSElOR19QUk9UT0NPTFMAVkFSSUFOVF9BTFNPX05FR09USUFURVMATVVMVElQTEVfQ0hPSUNFUwBJTlRFUk5BTF9TRVJWRVJfRVJST1IAV0VCX1NFUlZFUl9VTktOT1dOX0VSUk9SAFJBSUxHVU5fRVJST1IASURFTlRJVFlfUFJPVklERVJfQVVUSEVOVElDQVRJT05fRVJST1IAU1NMX0NFUlRJRklDQVRFX0VSUk9SAElOVkFMSURfWF9GT1JXQVJERURfRk9SAFNFVF9QQVJBTUVURVIAR0VUX1BBUkFNRVRFUgBIUEVfVVNFUgBTRUVfT1RIRVIASFBFX0NCX0NIVU5LX0hFQURFUgBNS0NBTEVOREFSAFNFVFVQAFdFQl9TRVJWRVJfSVNfRE9XTgBURUFSRE9XTgBIUEVfQ0xPU0VEX0NPTk5FQ1RJT04ASEVVUklTVElDX0VYUElSQVRJT04ARElTQ09OTkVDVEVEX09QRVJBVElPTgBOT05fQVVUSE9SSVRBVElWRV9JTkZPUk1BVElPTgBIUEVfSU5WQUxJRF9WRVJTSU9OAEhQRV9DQl9NRVNTQUdFX0JFR0lOAFNJVEVfSVNfRlJPWkVOAEhQRV9JTlZBTElEX0hFQURFUl9UT0tFTgBJTlZBTElEX1RPS0VOAEZPUkJJRERFTgBFTkhBTkNFX1lPVVJfQ0FMTQBIUEVfSU5WQUxJRF9VUkwAQkxPQ0tFRF9CWV9QQVJFTlRBTF9DT05UUk9MAE1LQ09MAEFDTABIUEVfSU5URVJOQUwAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRV9VTk9GRklDSUFMAEhQRV9PSwBVTkxJTksAVU5MT0NLAFBSSQBSRVRSWV9XSVRIAEhQRV9JTlZBTElEX0NPTlRFTlRfTEVOR1RIAEhQRV9VTkVYUEVDVEVEX0NPTlRFTlRfTEVOR1RIAEZMVVNIAFBST1BQQVRDSABNLVNFQVJDSABVUklfVE9PX0xPTkcAUFJPQ0VTU0lORwBNSVNDRUxMQU5FT1VTX1BFUlNJU1RFTlRfV0FSTklORwBNSVNDRUxMQU5FT1VTX1dBUk5JTkcASFBFX0lOVkFMSURfVFJBTlNGRVJfRU5DT0RJTkcARXhwZWN0ZWQgQ1JMRgBIUEVfSU5WQUxJRF9DSFVOS19TSVpFAE1PVkUAQ09OVElOVUUASFBFX0NCX1NUQVRVU19DT01QTEVURQBIUEVfQ0JfSEVBREVSU19DT01QTEVURQBIUEVfQ0JfVkVSU0lPTl9DT01QTEVURQBIUEVfQ0JfVVJMX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8AAF4TAAAmEwAAMBAAAPAXAACdEwAAFRIAADkXAADwEgAAChAAAHUSAACtEgAAghMAAE8UAAB/EAAAoBUAACMUAACJEgAAixQAAE0VAADUEQAAzxQAABAYAADJFgAA3BYAAMERAADgFwAAuxQAAHQUAAB8FQAA5RQAAAgXAAAfEAAAZRUAAKMUAAAoFQAAAhUAAJkVAAAsEAAAixkAAE8PAADUDgAAahAAAM4QAAACFwAAiQ4AAG4TAAAcEwAAZhQAAFYXAADBEwAAzRMAAGwTAABoFwAAZhcAAF8XAAAiEwAAzg8AAGkOAADYDgAAYxYAAMsTAACqDgAAKBcAACYXAADFEwAAXRYAAOgRAABnEwAAZRMAAPIWAABzEwAAHRcAAPkWAADzEQAAzw4AAM4VAAAMEgAAsxEAAKURAABhEAAAMhcAALsTAEH5NQsBAQBBkDYL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB/TcLAQEAQZE4C14CAwICAgICAAACAgACAgACAgICAgICAgICAAQAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEH9OQsBAQBBkToLXgIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAQfA7Cw1sb3NlZWVwLWFsaXZlAEGJPAsBAQBBoDwL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBiT4LAQEAQaA+C+cBAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAEGwwAALXwEBAAEBAQEBAAABAQABAQABAQEBAQEBAQEBAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAEGQwgALIWVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgBBwMIACy1yYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AQfnCAAsFAQIAAQMAQZDDAAvgAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH5xAALBQECAAEDAEGQxQAL4AEEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cYACwQBAAABAEGRxwAL3wEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH6yAALBAEAAAIAQZDJAAtfAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAQfrKAAsEAQAAAQBBkMsACwEBAEGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv", "base64"); + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +var require_llhttp_simd_wasm = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js"(exports2, module2) { + "use strict"; + var { Buffer: Buffer3 } = require("node:buffer"); + module2.exports = Buffer3.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK77MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtzACAAQRBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAA/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQTBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQSBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQd0BNgIcCwYAIAAQMguaLQELfyMAQRBrIgokAEGk0AAoAgAiCUUEQEHk0wAoAgAiBUUEQEHw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBCGpBcHFB2KrVqgVzIgU2AgBB+NMAQQA2AgBByNMAQQA2AgALQczTAEGA1AQ2AgBBnNAAQYDUBDYCAEGw0AAgBTYCAEGs0ABBfzYCAEHQ0wBBgKwDNgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBjNQEQcGrAzYCAEGo0ABB9NMAKAIANgIAQZjQAEHAqwM2AgBBpNAAQYjUBDYCAEHM/wdBODYCAEGI1AQhCQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQewBTQRAQYzQACgCACIGQRAgAEETakFwcSAAQQtJGyIEQQN2IgB2IgFBA3EEQAJAIAFBAXEgAHJBAXMiAkEDdCIAQbTQAGoiASAAQbzQAGooAgAiACgCCCIDRgRAQYzQACAGQX4gAndxNgIADAELIAEgAzYCCCADIAE2AgwLIABBCGohASAAIAJBA3QiAkEDcjYCBCAAIAJqIgAgACgCBEEBcjYCBAwRC0GU0AAoAgAiCCAETw0BIAEEQAJAQQIgAHQiAkEAIAJrciABIAB0cWgiAEEDdCICQbTQAGoiASACQbzQAGooAgAiAigCCCIDRgRAQYzQACAGQX4gAHdxIgY2AgAMAQsgASADNgIIIAMgATYCDAsgAiAEQQNyNgIEIABBA3QiACAEayEFIAAgAmogBTYCACACIARqIgQgBUEBcjYCBCAIBEAgCEF4cUG00ABqIQBBoNAAKAIAIQMCf0EBIAhBA3Z0IgEgBnFFBEBBjNAAIAEgBnI2AgAgAAwBCyAAKAIICyIBIAM2AgwgACADNgIIIAMgADYCDCADIAE2AggLIAJBCGohAUGg0AAgBDYCAEGU0AAgBTYCAAwRC0GQ0AAoAgAiC0UNASALaEECdEG80gBqKAIAIgAoAgRBeHEgBGshBSAAIQIDQAJAIAIoAhAiAUUEQCACQRRqKAIAIgFFDQELIAEoAgRBeHEgBGsiAyAFSSECIAMgBSACGyEFIAEgACACGyEAIAEhAgwBCwsgACgCGCEJIAAoAgwiAyAARwRAQZzQACgCABogAyAAKAIIIgE2AgggASADNgIMDBALIABBFGoiAigCACIBRQRAIAAoAhAiAUUNAyAAQRBqIQILA0AgAiEHIAEiA0EUaiICKAIAIgENACADQRBqIQIgAygCECIBDQALIAdBADYCAAwPC0F/IQQgAEG/f0sNACAAQRNqIgFBcHEhBEGQ0AAoAgAiCEUNAEEAIARrIQUCQAJAAkACf0EAIARBgAJJDQAaQR8gBEH///8HSw0AGiAEQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qCyIGQQJ0QbzSAGooAgAiAkUEQEEAIQFBACEDDAELQQAhASAEQRkgBkEBdmtBACAGQR9HG3QhAEEAIQMDQAJAIAIoAgRBeHEgBGsiByAFTw0AIAIhAyAHIgUNAEEAIQUgAiEBDAMLIAEgAkEUaigCACIHIAcgAiAAQR12QQRxakEQaigCACICRhsgASAHGyEBIABBAXQhACACDQALCyABIANyRQRAQQAhA0ECIAZ0IgBBACAAa3IgCHEiAEUNAyAAaEECdEG80gBqKAIAIQELIAFFDQELA0AgASgCBEF4cSAEayICIAVJIQAgAiAFIAAbIQUgASADIAAbIQMgASgCECIABH8gAAUgAUEUaigCAAsiAQ0ACwsgA0UNACAFQZTQACgCACAEa08NACADKAIYIQcgAyADKAIMIgBHBEBBnNAAKAIAGiAAIAMoAggiATYCCCABIAA2AgwMDgsgA0EUaiICKAIAIgFFBEAgAygCECIBRQ0DIANBEGohAgsDQCACIQYgASIAQRRqIgIoAgAiAQ0AIABBEGohAiAAKAIQIgENAAsgBkEANgIADA0LQZTQACgCACIDIARPBEBBoNAAKAIAIQECQCADIARrIgJBEE8EQCABIARqIgAgAkEBcjYCBCABIANqIAI2AgAgASAEQQNyNgIEDAELIAEgA0EDcjYCBCABIANqIgAgACgCBEEBcjYCBEEAIQBBACECC0GU0AAgAjYCAEGg0AAgADYCACABQQhqIQEMDwtBmNAAKAIAIgMgBEsEQCAEIAlqIgAgAyAEayIBQQFyNgIEQaTQACAANgIAQZjQACABNgIAIAkgBEEDcjYCBCAJQQhqIQEMDwtBACEBIAQCf0Hk0wAoAgAEQEHs0wAoAgAMAQtB8NMAQn83AgBB6NMAQoCAhICAgMAANwIAQeTTACAKQQxqQXBxQdiq1aoFczYCAEH40wBBADYCAEHI0wBBADYCAEGAgAQLIgAgBEHHAGoiBWoiBkEAIABrIgdxIgJPBEBB/NMAQTA2AgAMDwsCQEHE0wAoAgAiAUUNAEG80wAoAgAiCCACaiEAIAAgAU0gACAIS3ENAEEAIQFB/NMAQTA2AgAMDwtByNMALQAAQQRxDQQCQAJAIAkEQEHM0wAhAQNAIAEoAgAiACAJTQRAIAAgASgCBGogCUsNAwsgASgCCCIBDQALC0EAEDMiAEF/Rg0FIAIhBkHo0wAoAgAiAUEBayIDIABxBEAgAiAAayAAIANqQQAgAWtxaiEGCyAEIAZPDQUgBkH+////B0sNBUHE0wAoAgAiAwRAQbzTACgCACIHIAZqIQEgASAHTQ0GIAEgA0sNBgsgBhAzIgEgAEcNAQwHCyAGIANrIAdxIgZB/v///wdLDQQgBhAzIQAgACABKAIAIAEoAgRqRg0DIAAhAQsCQCAGIARByABqTw0AIAFBf0YNAEHs0wAoAgAiACAFIAZrakEAIABrcSIAQf7///8HSwRAIAEhAAwHCyAAEDNBf0cEQCAAIAZqIQYgASEADAcLQQAgBmsQMxoMBAsgASIAQX9HDQUMAwtBACEDDAwLQQAhAAwKCyAAQX9HDQILQcjTAEHI0wAoAgBBBHI2AgALIAJB/v///wdLDQEgAhAzIQBBABAzIQEgAEF/Rg0BIAFBf0YNASAAIAFPDQEgASAAayIGIARBOGpNDQELQbzTAEG80wAoAgAgBmoiATYCAEHA0wAoAgAgAUkEQEHA0wAgATYCAAsCQAJAAkBBpNAAKAIAIgIEQEHM0wAhAQNAIAAgASgCACIDIAEoAgQiBWpGDQIgASgCCCIBDQALDAILQZzQACgCACIBQQBHIAAgAU9xRQRAQZzQACAANgIAC0EAIQFB0NMAIAY2AgBBzNMAIAA2AgBBrNAAQX82AgBBsNAAQeTTACgCADYCAEHY0wBBADYCAANAIAFByNAAaiABQbzQAGoiAjYCACACIAFBtNAAaiIDNgIAIAFBwNAAaiADNgIAIAFB0NAAaiABQcTQAGoiAzYCACADIAI2AgAgAUHY0ABqIAFBzNAAaiICNgIAIAIgAzYCACABQdTQAGogAjYCACABQSBqIgFBgAJHDQALQXggAGtBD3EiASAAaiICIAZBOGsiAyABayIBQQFyNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAI2AgAgACADakE4NgIEDAILIAAgAk0NACACIANJDQAgASgCDEEIcQ0AQXggAmtBD3EiACACaiIDQZjQACgCACAGaiIHIABrIgBBAXI2AgQgASAFIAZqNgIEQajQAEH00wAoAgA2AgBBmNAAIAA2AgBBpNAAIAM2AgAgAiAHakE4NgIEDAELIABBnNAAKAIASQRAQZzQACAANgIACyAAIAZqIQNBzNMAIQECQAJAAkADQCADIAEoAgBHBEAgASgCCCIBDQEMAgsLIAEtAAxBCHFFDQELQczTACEBA0AgASgCACIDIAJNBEAgAyABKAIEaiIFIAJLDQMLIAEoAgghAQwACwALIAEgADYCACABIAEoAgQgBmo2AgQgAEF4IABrQQ9xaiIJIARBA3I2AgQgA0F4IANrQQ9xaiIGIAQgCWoiBGshASACIAZGBEBBpNAAIAQ2AgBBmNAAQZjQACgCACABaiIANgIAIAQgAEEBcjYCBAwIC0Gg0AAoAgAgBkYEQEGg0AAgBDYCAEGU0ABBlNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEIAAgBGogADYCAAwICyAGKAIEIgVBA3FBAUcNBiAFQXhxIQggBUH/AU0EQCAFQQN2IQMgBigCCCIAIAYoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAcLIAIgADYCCCAAIAI2AgwMBgsgBigCGCEHIAYgBigCDCIARwRAIAAgBigCCCICNgIIIAIgADYCDAwFCyAGQRRqIgIoAgAiBUUEQCAGKAIQIgVFDQQgBkEQaiECCwNAIAIhAyAFIgBBFGoiAigCACIFDQAgAEEQaiECIAAoAhAiBQ0ACyADQQA2AgAMBAtBeCAAa0EPcSIBIABqIgcgBkE4ayIDIAFrIgFBAXI2AgQgACADakE4NgIEIAIgBUE3IAVrQQ9xakE/ayIDIAMgAkEQakkbIgNBIzYCBEGo0ABB9NMAKAIANgIAQZjQACABNgIAQaTQACAHNgIAIANBEGpB1NMAKQIANwIAIANBzNMAKQIANwIIQdTTACADQQhqNgIAQdDTACAGNgIAQczTACAANgIAQdjTAEEANgIAIANBJGohAQNAIAFBBzYCACAFIAFBBGoiAUsNAAsgAiADRg0AIAMgAygCBEF+cTYCBCADIAMgAmsiBTYCACACIAVBAXI2AgQgBUH/AU0EQCAFQXhxQbTQAGohAAJ/QYzQACgCACIBQQEgBUEDdnQiA3FFBEBBjNAAIAEgA3I2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEG80gBqIQBBkNAAKAIAIgNBASABdCIGcUUEQCAAIAI2AgBBkNAAIAMgBnI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEDAkADQCADIgAoAgRBeHEgBUYNASABQR12IQMgAUEBdCEBIAAgA0EEcWpBEGoiBigCACIDDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLQZjQACgCACIBIARNDQBBpNAAKAIAIgAgBGoiAiABIARrIgFBAXI2AgRBmNAAIAE2AgBBpNAAIAI2AgAgACAEQQNyNgIEIABBCGohAQwIC0EAIQFB/NMAQTA2AgAMBwtBACEACyAHRQ0AAkAgBigCHCICQQJ0QbzSAGoiAygCACAGRgRAIAMgADYCACAADQFBkNAAQZDQACgCAEF+IAJ3cTYCAAwCCyAHQRBBFCAHKAIQIAZGG2ogADYCACAARQ0BCyAAIAc2AhggBigCECICBEAgACACNgIQIAIgADYCGAsgBkEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgCGohASAGIAhqIgYoAgQhBQsgBiAFQX5xNgIEIAEgBGogATYCACAEIAFBAXI2AgQgAUH/AU0EQCABQXhxQbTQAGohAAJ/QYzQACgCACICQQEgAUEDdnQiAXFFBEBBjNAAIAEgAnI2AgAgAAwBCyAAKAIICyIBIAQ2AgwgACAENgIIIAQgADYCDCAEIAE2AggMAQtBHyEFIAFB////B00EQCABQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qIQULIAQgBTYCHCAEQgA3AhAgBUECdEG80gBqIQBBkNAAKAIAIgJBASAFdCIDcUUEQCAAIAQ2AgBBkNAAIAIgA3I2AgAgBCAANgIYIAQgBDYCCCAEIAQ2AgwMAQsgAUEZIAVBAXZrQQAgBUEfRxt0IQUgACgCACEAAkADQCAAIgIoAgRBeHEgAUYNASAFQR12IQAgBUEBdCEFIAIgAEEEcWpBEGoiAygCACIADQALIAMgBDYCACAEIAI2AhggBCAENgIMIAQgBDYCCAwBCyACKAIIIgAgBDYCDCACIAQ2AgggBEEANgIYIAQgAjYCDCAEIAA2AggLIAlBCGohAQwCCwJAIAdFDQACQCADKAIcIgFBAnRBvNIAaiICKAIAIANGBEAgAiAANgIAIAANAUGQ0AAgCEF+IAF3cSIINgIADAILIAdBEEEUIAcoAhAgA0YbaiAANgIAIABFDQELIAAgBzYCGCADKAIQIgEEQCAAIAE2AhAgASAANgIYCyADQRRqKAIAIgFFDQAgAEEUaiABNgIAIAEgADYCGAsCQCAFQQ9NBEAgAyAEIAVqIgBBA3I2AgQgACADaiIAIAAoAgRBAXI2AgQMAQsgAyAEaiICIAVBAXI2AgQgAyAEQQNyNgIEIAIgBWogBTYCACAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIFcUUEQEGM0AAgASAFcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEEBIAF0IgQgCHFFBEAgACACNgIAQZDQACAEIAhyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhBAJAA0AgBCIAKAIEQXhxIAVGDQEgAUEddiEEIAFBAXQhASAAIARBBHFqQRBqIgYoAgAiBA0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIICyADQQhqIQEMAQsCQCAJRQ0AAkAgACgCHCIBQQJ0QbzSAGoiAigCACAARgRAIAIgAzYCACADDQFBkNAAIAtBfiABd3E2AgAMAgsgCUEQQRQgCSgCECAARhtqIAM2AgAgA0UNAQsgAyAJNgIYIAAoAhAiAQRAIAMgATYCECABIAM2AhgLIABBFGooAgAiAUUNACADQRRqIAE2AgAgASADNgIYCwJAIAVBD00EQCAAIAQgBWoiAUEDcjYCBCAAIAFqIgEgASgCBEEBcjYCBAwBCyAAIARqIgcgBUEBcjYCBCAAIARBA3I2AgQgBSAHaiAFNgIAIAgEQCAIQXhxQbTQAGohAUGg0AAoAgAhAwJ/QQEgCEEDdnQiAiAGcUUEQEGM0AAgAiAGcjYCACABDAELIAEoAggLIgIgAzYCDCABIAM2AgggAyABNgIMIAMgAjYCCAtBoNAAIAc2AgBBlNAAIAU2AgALIABBCGohAQsgCkEQaiQAIAELQwAgAEUEQD8AQRB0DwsCQCAAQf//A3ENACAAQQBIDQAgAEEQdkAAIgBBf0YEQEH80wBBMDYCAEF/DwsgAEEQdA8LAAsL3D8iAEGACAsJAQAAAAIAAAADAEGUCAsFBAAAAAUAQaQICwkGAAAABwAAAAgAQdwIC4otSW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwBB+TULAQEAQZA2C+ABAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQf03CwEBAEGROAteAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgBB/TkLAQEAQZE6C14CAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEHwOwsNbG9zZWVlcC1hbGl2ZQBBiTwLAQEAQaA8C+ABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQYk+CwEBAEGgPgvnAQEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZABBsMAAC18BAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBBkMIACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQcDCAAstcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQoNClNNDQoNClRUUC9DRS9UU1AvAEH5wgALBQECAAEDAEGQwwAL4AEEAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cQACwUBAgABAwBBkMUAC+ABBAEBBQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQfnGAAsEAQAAAQBBkccAC98BAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+sgACwQBAAACAEGQyQALXwMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAEH6ygALBAEAAAEAQZDLAAsBAQBBqssAC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==", "base64"); + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/constants.js +var require_constants4 = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/constants.js"(exports2, module2) { + "use strict"; + var corsSafeListedMethods = ( + /** @type {const} */ + ["GET", "HEAD", "POST"] + ); + var corsSafeListedMethodsSet = new Set(corsSafeListedMethods); + var nullBodyStatus = ( + /** @type {const} */ + [101, 204, 205, 304] + ); + var redirectStatus = ( + /** @type {const} */ + [301, 302, 303, 307, 308] + ); + var redirectStatusSet = new Set(redirectStatus); + var badPorts = ( + /** @type {const} */ + [ + "1", + "7", + "9", + "11", + "13", + "15", + "17", + "19", + "20", + "21", + "22", + "23", + "25", + "37", + "42", + "43", + "53", + "69", + "77", + "79", + "87", + "95", + "101", + "102", + "103", + "104", + "109", + "110", + "111", + "113", + "115", + "117", + "119", + "123", + "135", + "137", + "139", + "143", + "161", + "179", + "389", + "427", + "465", + "512", + "513", + "514", + "515", + "526", + "530", + "531", + "532", + "540", + "548", + "554", + "556", + "563", + "587", + "601", + "636", + "989", + "990", + "993", + "995", + "1719", + "1720", + "1723", + "2049", + "3659", + "4045", + "4190", + "5060", + "5061", + "6000", + "6566", + "6665", + "6666", + "6667", + "6668", + "6669", + "6679", + "6697", + "10080" + ] + ); + var badPortsSet = new Set(badPorts); + var referrerPolicy = ( + /** @type {const} */ + [ + "", + "no-referrer", + "no-referrer-when-downgrade", + "same-origin", + "origin", + "strict-origin", + "origin-when-cross-origin", + "strict-origin-when-cross-origin", + "unsafe-url" + ] + ); + var referrerPolicySet = new Set(referrerPolicy); + var requestRedirect = ( + /** @type {const} */ + ["follow", "manual", "error"] + ); + var safeMethods = ( + /** @type {const} */ + ["GET", "HEAD", "OPTIONS", "TRACE"] + ); + var safeMethodsSet = new Set(safeMethods); + var requestMode = ( + /** @type {const} */ + ["navigate", "same-origin", "no-cors", "cors"] + ); + var requestCredentials = ( + /** @type {const} */ + ["omit", "same-origin", "include"] + ); + var requestCache = ( + /** @type {const} */ + [ + "default", + "no-store", + "reload", + "no-cache", + "force-cache", + "only-if-cached" + ] + ); + var requestBodyHeader = ( + /** @type {const} */ + [ + "content-encoding", + "content-language", + "content-location", + "content-type", + // See https://github.com/nodejs/undici/issues/2021 + // 'Content-Length' is a forbidden header name, which is typically + // removed in the Headers implementation. However, undici doesn't + // filter out headers, so we add it here. + "content-length" + ] + ); + var requestDuplex = ( + /** @type {const} */ + [ + "half" + ] + ); + var forbiddenMethods = ( + /** @type {const} */ + ["CONNECT", "TRACE", "TRACK"] + ); + var forbiddenMethodsSet = new Set(forbiddenMethods); + var subresource = ( + /** @type {const} */ + [ + "audio", + "audioworklet", + "font", + "image", + "manifest", + "paintworklet", + "script", + "style", + "track", + "video", + "xslt", + "" + ] + ); + var subresourceSet = new Set(subresource); + module2.exports = { + subresource, + forbiddenMethods, + requestBodyHeader, + referrerPolicy, + requestRedirect, + requestMode, + requestCredentials, + requestCache, + redirectStatus, + corsSafeListedMethods, + nullBodyStatus, + safeMethods, + badPorts, + requestDuplex, + subresourceSet, + badPortsSet, + redirectStatusSet, + corsSafeListedMethodsSet, + safeMethodsSet, + forbiddenMethodsSet, + referrerPolicySet + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/global.js +var require_global = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/global.js"(exports2, module2) { + "use strict"; + var globalOrigin = Symbol.for("undici.globalOrigin.1"); + function getGlobalOrigin() { + return globalThis[globalOrigin]; + } + function setGlobalOrigin(newOrigin) { + if (newOrigin === void 0) { + Object.defineProperty(globalThis, globalOrigin, { + value: void 0, + writable: true, + enumerable: false, + configurable: false + }); + return; + } + const parsedURL = new URL(newOrigin); + if (parsedURL.protocol !== "http:" && parsedURL.protocol !== "https:") { + throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`); + } + Object.defineProperty(globalThis, globalOrigin, { + value: parsedURL, + writable: true, + enumerable: false, + configurable: false + }); + } + module2.exports = { + getGlobalOrigin, + setGlobalOrigin + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/data-url.js +var require_data_url = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/data-url.js"(exports2, module2) { + "use strict"; + var assert5 = require("node:assert"); + var encoder = new TextEncoder(); + var HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/; + var HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/; + var ASCII_WHITESPACE_REPLACE_REGEX = /[\u0009\u000A\u000C\u000D\u0020]/g; + var HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/; + function dataURLProcessor(dataURL) { + assert5(dataURL.protocol === "data:"); + let input = URLSerializer(dataURL, true); + input = input.slice(5); + const position = { position: 0 }; + let mimeType = collectASequenceOfCodePointsFast( + ",", + input, + position + ); + const mimeTypeLength = mimeType.length; + mimeType = removeASCIIWhitespace(mimeType, true, true); + if (position.position >= input.length) { + return "failure"; + } + position.position++; + const encodedBody = input.slice(mimeTypeLength + 1); + let body = stringPercentDecode(encodedBody); + if (/;(\u0020){0,}base64$/i.test(mimeType)) { + const stringBody = isomorphicDecode(body); + body = forgivingBase64(stringBody); + if (body === "failure") { + return "failure"; + } + mimeType = mimeType.slice(0, -6); + mimeType = mimeType.replace(/(\u0020)+$/, ""); + mimeType = mimeType.slice(0, -1); + } + if (mimeType.startsWith(";")) { + mimeType = "text/plain" + mimeType; + } + let mimeTypeRecord = parseMIMEType(mimeType); + if (mimeTypeRecord === "failure") { + mimeTypeRecord = parseMIMEType("text/plain;charset=US-ASCII"); + } + return { mimeType: mimeTypeRecord, body }; + } + function URLSerializer(url, excludeFragment = false) { + if (!excludeFragment) { + return url.href; + } + const href = url.href; + const hashLength = url.hash.length; + const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength); + if (!hashLength && href.endsWith("#")) { + return serialized.slice(0, -1); + } + return serialized; + } + function collectASequenceOfCodePoints(condition, input, position) { + let result = ""; + while (position.position < input.length && condition(input[position.position])) { + result += input[position.position]; + position.position++; + } + return result; + } + function collectASequenceOfCodePointsFast(char, input, position) { + const idx = input.indexOf(char, position.position); + const start = position.position; + if (idx === -1) { + position.position = input.length; + return input.slice(start); + } + position.position = idx; + return input.slice(start, position.position); + } + function stringPercentDecode(input) { + const bytes = encoder.encode(input); + return percentDecode(bytes); + } + function isHexCharByte(byte) { + return byte >= 48 && byte <= 57 || byte >= 65 && byte <= 70 || byte >= 97 && byte <= 102; + } + function hexByteToNumber(byte) { + return ( + // 0-9 + byte >= 48 && byte <= 57 ? byte - 48 : (byte & 223) - 55 + ); + } + function percentDecode(input) { + const length = input.length; + const output = new Uint8Array(length); + let j = 0; + for (let i = 0; i < length; ++i) { + const byte = input[i]; + if (byte !== 37) { + output[j++] = byte; + } else if (byte === 37 && !(isHexCharByte(input[i + 1]) && isHexCharByte(input[i + 2]))) { + output[j++] = 37; + } else { + output[j++] = hexByteToNumber(input[i + 1]) << 4 | hexByteToNumber(input[i + 2]); + i += 2; + } + } + return length === j ? output : output.subarray(0, j); + } + function parseMIMEType(input) { + input = removeHTTPWhitespace(input, true, true); + const position = { position: 0 }; + const type = collectASequenceOfCodePointsFast( + "/", + input, + position + ); + if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) { + return "failure"; + } + if (position.position > input.length) { + return "failure"; + } + position.position++; + let subtype = collectASequenceOfCodePointsFast( + ";", + input, + position + ); + subtype = removeHTTPWhitespace(subtype, false, true); + if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) { + return "failure"; + } + const typeLowercase = type.toLowerCase(); + const subtypeLowercase = subtype.toLowerCase(); + const mimeType = { + type: typeLowercase, + subtype: subtypeLowercase, + /** @type {Map} */ + parameters: /* @__PURE__ */ new Map(), + // https://mimesniff.spec.whatwg.org/#mime-type-essence + essence: `${typeLowercase}/${subtypeLowercase}` + }; + while (position.position < input.length) { + position.position++; + collectASequenceOfCodePoints( + // https://fetch.spec.whatwg.org/#http-whitespace + (char) => HTTP_WHITESPACE_REGEX.test(char), + input, + position + ); + let parameterName = collectASequenceOfCodePoints( + (char) => char !== ";" && char !== "=", + input, + position + ); + parameterName = parameterName.toLowerCase(); + if (position.position < input.length) { + if (input[position.position] === ";") { + continue; + } + position.position++; + } + if (position.position > input.length) { + break; + } + let parameterValue = null; + if (input[position.position] === '"') { + parameterValue = collectAnHTTPQuotedString(input, position, true); + collectASequenceOfCodePointsFast( + ";", + input, + position + ); + } else { + parameterValue = collectASequenceOfCodePointsFast( + ";", + input, + position + ); + parameterValue = removeHTTPWhitespace(parameterValue, false, true); + if (parameterValue.length === 0) { + continue; + } + } + if (parameterName.length !== 0 && HTTP_TOKEN_CODEPOINTS.test(parameterName) && (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) && !mimeType.parameters.has(parameterName)) { + mimeType.parameters.set(parameterName, parameterValue); + } + } + return mimeType; + } + function forgivingBase64(data) { + data = data.replace(ASCII_WHITESPACE_REPLACE_REGEX, ""); + let dataLength = data.length; + if (dataLength % 4 === 0) { + if (data.charCodeAt(dataLength - 1) === 61) { + --dataLength; + if (data.charCodeAt(dataLength - 1) === 61) { + --dataLength; + } + } + } + if (dataLength % 4 === 1) { + return "failure"; + } + if (/[^+/0-9A-Za-z]/.test(data.length === dataLength ? data : data.substring(0, dataLength))) { + return "failure"; + } + const buffer = Buffer.from(data, "base64"); + return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); + } + function collectAnHTTPQuotedString(input, position, extractValue) { + const positionStart = position.position; + let value = ""; + assert5(input[position.position] === '"'); + position.position++; + while (true) { + value += collectASequenceOfCodePoints( + (char) => char !== '"' && char !== "\\", + input, + position + ); + if (position.position >= input.length) { + break; + } + const quoteOrBackslash = input[position.position]; + position.position++; + if (quoteOrBackslash === "\\") { + if (position.position >= input.length) { + value += "\\"; + break; + } + value += input[position.position]; + position.position++; + } else { + assert5(quoteOrBackslash === '"'); + break; + } + } + if (extractValue) { + return value; + } + return input.slice(positionStart, position.position); + } + function serializeAMimeType(mimeType) { + assert5(mimeType !== "failure"); + const { parameters, essence } = mimeType; + let serialization = essence; + for (let [name2, value] of parameters.entries()) { + serialization += ";"; + serialization += name2; + serialization += "="; + if (!HTTP_TOKEN_CODEPOINTS.test(value)) { + value = value.replace(/(\\|")/g, "\\$1"); + value = '"' + value; + value += '"'; + } + serialization += value; + } + return serialization; + } + function isHTTPWhiteSpace(char) { + return char === 13 || char === 10 || char === 9 || char === 32; + } + function removeHTTPWhitespace(str, leading = true, trailing = true) { + return removeChars(str, leading, trailing, isHTTPWhiteSpace); + } + function isASCIIWhitespace(char) { + return char === 13 || char === 10 || char === 9 || char === 12 || char === 32; + } + function removeASCIIWhitespace(str, leading = true, trailing = true) { + return removeChars(str, leading, trailing, isASCIIWhitespace); + } + function removeChars(str, leading, trailing, predicate) { + let lead = 0; + let trail = str.length - 1; + if (leading) { + while (lead < str.length && predicate(str.charCodeAt(lead))) lead++; + } + if (trailing) { + while (trail > 0 && predicate(str.charCodeAt(trail))) trail--; + } + return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1); + } + function isomorphicDecode(input) { + const length = input.length; + if ((2 << 15) - 1 > length) { + return String.fromCharCode.apply(null, input); + } + let result = ""; + let i = 0; + let addition = (2 << 15) - 1; + while (i < length) { + if (i + addition > length) { + addition = length - i; + } + result += String.fromCharCode.apply(null, input.subarray(i, i += addition)); + } + return result; + } + function minimizeSupportedMimeType(mimeType) { + switch (mimeType.essence) { + case "application/ecmascript": + case "application/javascript": + case "application/x-ecmascript": + case "application/x-javascript": + case "text/ecmascript": + case "text/javascript": + case "text/javascript1.0": + case "text/javascript1.1": + case "text/javascript1.2": + case "text/javascript1.3": + case "text/javascript1.4": + case "text/javascript1.5": + case "text/jscript": + case "text/livescript": + case "text/x-ecmascript": + case "text/x-javascript": + return "text/javascript"; + case "application/json": + case "text/json": + return "application/json"; + case "image/svg+xml": + return "image/svg+xml"; + case "text/xml": + case "application/xml": + return "application/xml"; + } + if (mimeType.subtype.endsWith("+json")) { + return "application/json"; + } + if (mimeType.subtype.endsWith("+xml")) { + return "application/xml"; + } + return ""; + } + module2.exports = { + dataURLProcessor, + URLSerializer, + collectASequenceOfCodePoints, + collectASequenceOfCodePointsFast, + stringPercentDecode, + parseMIMEType, + collectAnHTTPQuotedString, + serializeAMimeType, + removeChars, + removeHTTPWhitespace, + minimizeSupportedMimeType, + HTTP_TOKEN_CODEPOINTS, + isomorphicDecode + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/webidl.js +var require_webidl = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/webidl.js"(exports2, module2) { + "use strict"; + var { types, inspect } = require("node:util"); + var { markAsUncloneable } = require("node:worker_threads"); + var { toUSVString } = require_util(); + var webidl = {}; + webidl.converters = {}; + webidl.util = {}; + webidl.errors = {}; + webidl.errors.exception = function(message) { + return new TypeError(`${message.header}: ${message.message}`); + }; + webidl.errors.conversionFailed = function(context) { + const plural2 = context.types.length === 1 ? "" : " one of"; + const message = `${context.argument} could not be converted to${plural2}: ${context.types.join(", ")}.`; + return webidl.errors.exception({ + header: context.prefix, + message + }); + }; + webidl.errors.invalidArgument = function(context) { + return webidl.errors.exception({ + header: context.prefix, + message: `"${context.value}" is an invalid ${context.type}.` + }); + }; + webidl.brandCheck = function(V, I, opts) { + if (opts?.strict !== false) { + if (!(V instanceof I)) { + const err = new TypeError("Illegal invocation"); + err.code = "ERR_INVALID_THIS"; + throw err; + } + } else { + if (V?.[Symbol.toStringTag] !== I.prototype[Symbol.toStringTag]) { + const err = new TypeError("Illegal invocation"); + err.code = "ERR_INVALID_THIS"; + throw err; + } + } + }; + webidl.argumentLengthCheck = function({ length }, min, ctx) { + if (length < min) { + throw webidl.errors.exception({ + message: `${min} argument${min !== 1 ? "s" : ""} required, but${length ? " only" : ""} ${length} found.`, + header: ctx + }); + } + }; + webidl.illegalConstructor = function() { + throw webidl.errors.exception({ + header: "TypeError", + message: "Illegal constructor" + }); + }; + webidl.util.Type = function(V) { + switch (typeof V) { + case "undefined": + return "Undefined"; + case "boolean": + return "Boolean"; + case "string": + return "String"; + case "symbol": + return "Symbol"; + case "number": + return "Number"; + case "bigint": + return "BigInt"; + case "function": + case "object": { + if (V === null) { + return "Null"; + } + return "Object"; + } + } + }; + webidl.util.markAsUncloneable = markAsUncloneable || (() => { + }); + webidl.util.ConvertToInt = function(V, bitLength, signedness, opts) { + let upperBound; + let lowerBound; + if (bitLength === 64) { + upperBound = Math.pow(2, 53) - 1; + if (signedness === "unsigned") { + lowerBound = 0; + } else { + lowerBound = Math.pow(-2, 53) + 1; + } + } else if (signedness === "unsigned") { + lowerBound = 0; + upperBound = Math.pow(2, bitLength) - 1; + } else { + lowerBound = Math.pow(-2, bitLength) - 1; + upperBound = Math.pow(2, bitLength - 1) - 1; + } + let x = Number(V); + if (x === 0) { + x = 0; + } + if (opts?.enforceRange === true) { + if (Number.isNaN(x) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY) { + throw webidl.errors.exception({ + header: "Integer conversion", + message: `Could not convert ${webidl.util.Stringify(V)} to an integer.` + }); + } + x = webidl.util.IntegerPart(x); + if (x < lowerBound || x > upperBound) { + throw webidl.errors.exception({ + header: "Integer conversion", + message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.` + }); + } + return x; + } + if (!Number.isNaN(x) && opts?.clamp === true) { + x = Math.min(Math.max(x, lowerBound), upperBound); + if (Math.floor(x) % 2 === 0) { + x = Math.floor(x); + } else { + x = Math.ceil(x); + } + return x; + } + if (Number.isNaN(x) || x === 0 && Object.is(0, x) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY) { + return 0; + } + x = webidl.util.IntegerPart(x); + x = x % Math.pow(2, bitLength); + if (signedness === "signed" && x >= Math.pow(2, bitLength) - 1) { + return x - Math.pow(2, bitLength); + } + return x; + }; + webidl.util.IntegerPart = function(n) { + const r = Math.floor(Math.abs(n)); + if (n < 0) { + return -1 * r; + } + return r; + }; + webidl.util.Stringify = function(V) { + const type = webidl.util.Type(V); + switch (type) { + case "Symbol": + return `Symbol(${V.description})`; + case "Object": + return inspect(V); + case "String": + return `"${V}"`; + default: + return `${V}`; + } + }; + webidl.sequenceConverter = function(converter) { + return (V, prefix, argument, Iterable) => { + if (webidl.util.Type(V) !== "Object") { + throw webidl.errors.exception({ + header: prefix, + message: `${argument} (${webidl.util.Stringify(V)}) is not iterable.` + }); + } + const method = typeof Iterable === "function" ? Iterable() : V?.[Symbol.iterator]?.(); + const seq = []; + let index = 0; + if (method === void 0 || typeof method.next !== "function") { + throw webidl.errors.exception({ + header: prefix, + message: `${argument} is not iterable.` + }); + } + while (true) { + const { done, value } = method.next(); + if (done) { + break; + } + seq.push(converter(value, prefix, `${argument}[${index++}]`)); + } + return seq; + }; + }; + webidl.recordConverter = function(keyConverter, valueConverter) { + return (O, prefix, argument) => { + if (webidl.util.Type(O) !== "Object") { + throw webidl.errors.exception({ + header: prefix, + message: `${argument} ("${webidl.util.Type(O)}") is not an Object.` + }); + } + const result = {}; + if (!types.isProxy(O)) { + const keys2 = [...Object.getOwnPropertyNames(O), ...Object.getOwnPropertySymbols(O)]; + for (const key of keys2) { + const typedKey = keyConverter(key, prefix, argument); + const typedValue = valueConverter(O[key], prefix, argument); + result[typedKey] = typedValue; + } + return result; + } + const keys = Reflect.ownKeys(O); + for (const key of keys) { + const desc2 = Reflect.getOwnPropertyDescriptor(O, key); + if (desc2?.enumerable) { + const typedKey = keyConverter(key, prefix, argument); + const typedValue = valueConverter(O[key], prefix, argument); + result[typedKey] = typedValue; + } + } + return result; + }; + }; + webidl.interfaceConverter = function(i) { + return (V, prefix, argument, opts) => { + if (opts?.strict !== false && !(V instanceof i)) { + throw webidl.errors.exception({ + header: prefix, + message: `Expected ${argument} ("${webidl.util.Stringify(V)}") to be an instance of ${i.name}.` + }); + } + return V; + }; + }; + webidl.dictionaryConverter = function(converters) { + return (dictionary, prefix, argument) => { + const type = webidl.util.Type(dictionary); + const dict = {}; + if (type === "Null" || type === "Undefined") { + return dict; + } else if (type !== "Object") { + throw webidl.errors.exception({ + header: prefix, + message: `Expected ${dictionary} to be one of: Null, Undefined, Object.` + }); + } + for (const options of converters) { + const { key, defaultValue, required, converter } = options; + if (required === true) { + if (!Object.hasOwn(dictionary, key)) { + throw webidl.errors.exception({ + header: prefix, + message: `Missing required key "${key}".` + }); + } + } + let value = dictionary[key]; + const hasDefault = Object.hasOwn(options, "defaultValue"); + if (hasDefault && value !== null) { + value ??= defaultValue(); + } + if (required || hasDefault || value !== void 0) { + value = converter(value, prefix, `${argument}.${key}`); + if (options.allowedValues && !options.allowedValues.includes(value)) { + throw webidl.errors.exception({ + header: prefix, + message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(", ")}.` + }); + } + dict[key] = value; + } + } + return dict; + }; + }; + webidl.nullableConverter = function(converter) { + return (V, prefix, argument) => { + if (V === null) { + return V; + } + return converter(V, prefix, argument); + }; + }; + webidl.converters.DOMString = function(V, prefix, argument, opts) { + if (V === null && opts?.legacyNullToEmptyString) { + return ""; + } + if (typeof V === "symbol") { + throw webidl.errors.exception({ + header: prefix, + message: `${argument} is a symbol, which cannot be converted to a DOMString.` + }); + } + return String(V); + }; + webidl.converters.ByteString = function(V, prefix, argument) { + const x = webidl.converters.DOMString(V, prefix, argument); + for (let index = 0; index < x.length; index++) { + if (x.charCodeAt(index) > 255) { + throw new TypeError( + `Cannot convert argument to a ByteString because the character at index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.` + ); + } + } + return x; + }; + webidl.converters.USVString = toUSVString; + webidl.converters.boolean = function(V) { + const x = Boolean(V); + return x; + }; + webidl.converters.any = function(V) { + return V; + }; + webidl.converters["long long"] = function(V, prefix, argument) { + const x = webidl.util.ConvertToInt(V, 64, "signed", void 0, prefix, argument); + return x; + }; + webidl.converters["unsigned long long"] = function(V, prefix, argument) { + const x = webidl.util.ConvertToInt(V, 64, "unsigned", void 0, prefix, argument); + return x; + }; + webidl.converters["unsigned long"] = function(V, prefix, argument) { + const x = webidl.util.ConvertToInt(V, 32, "unsigned", void 0, prefix, argument); + return x; + }; + webidl.converters["unsigned short"] = function(V, prefix, argument, opts) { + const x = webidl.util.ConvertToInt(V, 16, "unsigned", opts, prefix, argument); + return x; + }; + webidl.converters.ArrayBuffer = function(V, prefix, argument, opts) { + if (webidl.util.Type(V) !== "Object" || !types.isAnyArrayBuffer(V)) { + throw webidl.errors.conversionFailed({ + prefix, + argument: `${argument} ("${webidl.util.Stringify(V)}")`, + types: ["ArrayBuffer"] + }); + } + if (opts?.allowShared === false && types.isSharedArrayBuffer(V)) { + throw webidl.errors.exception({ + header: "ArrayBuffer", + message: "SharedArrayBuffer is not allowed." + }); + } + if (V.resizable || V.growable) { + throw webidl.errors.exception({ + header: "ArrayBuffer", + message: "Received a resizable ArrayBuffer." + }); + } + return V; + }; + webidl.converters.TypedArray = function(V, T, prefix, name2, opts) { + if (webidl.util.Type(V) !== "Object" || !types.isTypedArray(V) || V.constructor.name !== T.name) { + throw webidl.errors.conversionFailed({ + prefix, + argument: `${name2} ("${webidl.util.Stringify(V)}")`, + types: [T.name] + }); + } + if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) { + throw webidl.errors.exception({ + header: "ArrayBuffer", + message: "SharedArrayBuffer is not allowed." + }); + } + if (V.buffer.resizable || V.buffer.growable) { + throw webidl.errors.exception({ + header: "ArrayBuffer", + message: "Received a resizable ArrayBuffer." + }); + } + return V; + }; + webidl.converters.DataView = function(V, prefix, name2, opts) { + if (webidl.util.Type(V) !== "Object" || !types.isDataView(V)) { + throw webidl.errors.exception({ + header: prefix, + message: `${name2} is not a DataView.` + }); + } + if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) { + throw webidl.errors.exception({ + header: "ArrayBuffer", + message: "SharedArrayBuffer is not allowed." + }); + } + if (V.buffer.resizable || V.buffer.growable) { + throw webidl.errors.exception({ + header: "ArrayBuffer", + message: "Received a resizable ArrayBuffer." + }); + } + return V; + }; + webidl.converters.BufferSource = function(V, prefix, name2, opts) { + if (types.isAnyArrayBuffer(V)) { + return webidl.converters.ArrayBuffer(V, prefix, name2, { ...opts, allowShared: false }); + } + if (types.isTypedArray(V)) { + return webidl.converters.TypedArray(V, V.constructor, prefix, name2, { ...opts, allowShared: false }); + } + if (types.isDataView(V)) { + return webidl.converters.DataView(V, prefix, name2, { ...opts, allowShared: false }); + } + throw webidl.errors.conversionFailed({ + prefix, + argument: `${name2} ("${webidl.util.Stringify(V)}")`, + types: ["BufferSource"] + }); + }; + webidl.converters["sequence"] = webidl.sequenceConverter( + webidl.converters.ByteString + ); + webidl.converters["sequence>"] = webidl.sequenceConverter( + webidl.converters["sequence"] + ); + webidl.converters["record"] = webidl.recordConverter( + webidl.converters.ByteString, + webidl.converters.ByteString + ); + module2.exports = { + webidl + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/util.js +var require_util3 = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/util.js"(exports2, module2) { + "use strict"; + var { Transform } = require("node:stream"); + var zlib = require("node:zlib"); + var { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require_constants4(); + var { getGlobalOrigin } = require_global(); + var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url(); + var { performance } = require("node:perf_hooks"); + var { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util(); + var assert5 = require("node:assert"); + var { isUint8Array } = require("node:util/types"); + var { webidl } = require_webidl(); + var supportedHashes = []; + var crypto; + try { + crypto = require("node:crypto"); + const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; + supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); + } catch { + } + function responseURL(response) { + const urlList = response.urlList; + const length = urlList.length; + return length === 0 ? null : urlList[length - 1].toString(); + } + function responseLocationURL(response, requestFragment) { + if (!redirectStatusSet.has(response.status)) { + return null; + } + let location = response.headersList.get("location", true); + if (location !== null && isValidHeaderValue(location)) { + if (!isValidEncodedURL(location)) { + location = normalizeBinaryStringToUtf8(location); + } + location = new URL(location, responseURL(response)); + } + if (location && !location.hash) { + location.hash = requestFragment; + } + return location; + } + function isValidEncodedURL(url) { + for (let i = 0; i < url.length; ++i) { + const code2 = url.charCodeAt(i); + if (code2 > 126 || // Non-US-ASCII + DEL + code2 < 32) { + return false; + } + } + return true; + } + function normalizeBinaryStringToUtf8(value) { + return Buffer.from(value, "binary").toString("utf8"); + } + function requestCurrentURL(request) { + return request.urlList[request.urlList.length - 1]; + } + function requestBadPort(request) { + const url = requestCurrentURL(request); + if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) { + return "blocked"; + } + return "allowed"; + } + function isErrorLike(object) { + return object instanceof Error || (object?.constructor?.name === "Error" || object?.constructor?.name === "DOMException"); + } + function isValidReasonPhrase(statusText) { + for (let i = 0; i < statusText.length; ++i) { + const c = statusText.charCodeAt(i); + if (!(c === 9 || // HTAB + c >= 32 && c <= 126 || // SP / VCHAR + c >= 128 && c <= 255)) { + return false; + } + } + return true; + } + var isValidHeaderName = isValidHTTPToken; + function isValidHeaderValue(potentialValue) { + return (potentialValue[0] === " " || potentialValue[0] === " " || potentialValue[potentialValue.length - 1] === " " || potentialValue[potentialValue.length - 1] === " " || potentialValue.includes("\n") || potentialValue.includes("\r") || potentialValue.includes("\0")) === false; + } + function setRequestReferrerPolicyOnRedirect(request, actualResponse) { + const { headersList } = actualResponse; + const policyHeader = (headersList.get("referrer-policy", true) ?? "").split(","); + let policy = ""; + if (policyHeader.length > 0) { + for (let i = policyHeader.length; i !== 0; i--) { + const token = policyHeader[i - 1].trim(); + if (referrerPolicyTokens.has(token)) { + policy = token; + break; + } + } + } + if (policy !== "") { + request.referrerPolicy = policy; + } + } + function crossOriginResourcePolicyCheck() { + return "allowed"; + } + function corsCheck() { + return "success"; + } + function TAOCheck() { + return "success"; + } + function appendFetchMetadata(httpRequest) { + let header = null; + header = httpRequest.mode; + httpRequest.headersList.set("sec-fetch-mode", header, true); + } + function appendRequestOriginHeader(request) { + let serializedOrigin = request.origin; + if (serializedOrigin === "client" || serializedOrigin === void 0) { + return; + } + if (request.responseTainting === "cors" || request.mode === "websocket") { + request.headersList.append("origin", serializedOrigin, true); + } else if (request.method !== "GET" && request.method !== "HEAD") { + switch (request.referrerPolicy) { + case "no-referrer": + serializedOrigin = null; + break; + case "no-referrer-when-downgrade": + case "strict-origin": + case "strict-origin-when-cross-origin": + if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) { + serializedOrigin = null; + } + break; + case "same-origin": + if (!sameOrigin(request, requestCurrentURL(request))) { + serializedOrigin = null; + } + break; + default: + } + request.headersList.append("origin", serializedOrigin, true); + } + } + function coarsenTime(timestamp, crossOriginIsolatedCapability) { + return timestamp; + } + function clampAndCoarsenConnectionTimingInfo(connectionTimingInfo, defaultStartTime, crossOriginIsolatedCapability) { + if (!connectionTimingInfo?.startTime || connectionTimingInfo.startTime < defaultStartTime) { + return { + domainLookupStartTime: defaultStartTime, + domainLookupEndTime: defaultStartTime, + connectionStartTime: defaultStartTime, + connectionEndTime: defaultStartTime, + secureConnectionStartTime: defaultStartTime, + ALPNNegotiatedProtocol: connectionTimingInfo?.ALPNNegotiatedProtocol + }; + } + return { + domainLookupStartTime: coarsenTime(connectionTimingInfo.domainLookupStartTime, crossOriginIsolatedCapability), + domainLookupEndTime: coarsenTime(connectionTimingInfo.domainLookupEndTime, crossOriginIsolatedCapability), + connectionStartTime: coarsenTime(connectionTimingInfo.connectionStartTime, crossOriginIsolatedCapability), + connectionEndTime: coarsenTime(connectionTimingInfo.connectionEndTime, crossOriginIsolatedCapability), + secureConnectionStartTime: coarsenTime(connectionTimingInfo.secureConnectionStartTime, crossOriginIsolatedCapability), + ALPNNegotiatedProtocol: connectionTimingInfo.ALPNNegotiatedProtocol + }; + } + function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) { + return coarsenTime(performance.now(), crossOriginIsolatedCapability); + } + function createOpaqueTimingInfo(timingInfo) { + return { + startTime: timingInfo.startTime ?? 0, + redirectStartTime: 0, + redirectEndTime: 0, + postRedirectStartTime: timingInfo.startTime ?? 0, + finalServiceWorkerStartTime: 0, + finalNetworkResponseStartTime: 0, + finalNetworkRequestStartTime: 0, + endTime: 0, + encodedBodySize: 0, + decodedBodySize: 0, + finalConnectionTimingInfo: null + }; + } + function makePolicyContainer() { + return { + referrerPolicy: "strict-origin-when-cross-origin" + }; + } + function clonePolicyContainer(policyContainer) { + return { + referrerPolicy: policyContainer.referrerPolicy + }; + } + function determineRequestsReferrer(request) { + const policy = request.referrerPolicy; + assert5(policy); + let referrerSource = null; + if (request.referrer === "client") { + const globalOrigin = getGlobalOrigin(); + if (!globalOrigin || globalOrigin.origin === "null") { + return "no-referrer"; + } + referrerSource = new URL(globalOrigin); + } else if (request.referrer instanceof URL) { + referrerSource = request.referrer; + } + let referrerURL = stripURLForReferrer(referrerSource); + const referrerOrigin = stripURLForReferrer(referrerSource, true); + if (referrerURL.toString().length > 4096) { + referrerURL = referrerOrigin; + } + const areSameOrigin = sameOrigin(request, referrerURL); + const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(request.url); + switch (policy) { + case "origin": + return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true); + case "unsafe-url": + return referrerURL; + case "same-origin": + return areSameOrigin ? referrerOrigin : "no-referrer"; + case "origin-when-cross-origin": + return areSameOrigin ? referrerURL : referrerOrigin; + case "strict-origin-when-cross-origin": { + const currentURL = requestCurrentURL(request); + if (sameOrigin(referrerURL, currentURL)) { + return referrerURL; + } + if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) { + return "no-referrer"; + } + return referrerOrigin; + } + case "strict-origin": + // eslint-disable-line + /** + * 1. If referrerURL is a potentially trustworthy URL and + * request’s current URL is not a potentially trustworthy URL, + * then return no referrer. + * 2. Return referrerOrigin + */ + case "no-referrer-when-downgrade": + // eslint-disable-line + /** + * 1. If referrerURL is a potentially trustworthy URL and + * request’s current URL is not a potentially trustworthy URL, + * then return no referrer. + * 2. Return referrerOrigin + */ + default: + return isNonPotentiallyTrustWorthy ? "no-referrer" : referrerOrigin; + } + } + function stripURLForReferrer(url, originOnly) { + assert5(url instanceof URL); + url = new URL(url); + if (url.protocol === "file:" || url.protocol === "about:" || url.protocol === "blank:") { + return "no-referrer"; + } + url.username = ""; + url.password = ""; + url.hash = ""; + if (originOnly) { + url.pathname = ""; + url.search = ""; + } + return url; + } + function isURLPotentiallyTrustworthy(url) { + if (!(url instanceof URL)) { + return false; + } + if (url.href === "about:blank" || url.href === "about:srcdoc") { + return true; + } + if (url.protocol === "data:") return true; + if (url.protocol === "file:") return true; + return isOriginPotentiallyTrustworthy(url.origin); + function isOriginPotentiallyTrustworthy(origin) { + if (origin == null || origin === "null") return false; + const originAsURL = new URL(origin); + if (originAsURL.protocol === "https:" || originAsURL.protocol === "wss:") { + return true; + } + if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) || (originAsURL.hostname === "localhost" || originAsURL.hostname.includes("localhost.")) || originAsURL.hostname.endsWith(".localhost")) { + return true; + } + return false; + } + } + function bytesMatch(bytes, metadataList) { + if (crypto === void 0) { + return true; + } + const parsedMetadata = parseMetadata(metadataList); + if (parsedMetadata === "no metadata") { + return true; + } + if (parsedMetadata.length === 0) { + return true; + } + const strongest = getStrongestMetadata(parsedMetadata); + const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest); + for (const item of metadata) { + const algorithm = item.algo; + const expectedValue = item.hash; + let actualValue = crypto.createHash(algorithm).update(bytes).digest("base64"); + if (actualValue[actualValue.length - 1] === "=") { + if (actualValue[actualValue.length - 2] === "=") { + actualValue = actualValue.slice(0, -2); + } else { + actualValue = actualValue.slice(0, -1); + } + } + if (compareBase64Mixed(actualValue, expectedValue)) { + return true; + } + } + return false; + } + var parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i; + function parseMetadata(metadata) { + const result = []; + let empty = true; + for (const token of metadata.split(" ")) { + empty = false; + const parsedToken = parseHashWithOptions.exec(token); + if (parsedToken === null || parsedToken.groups === void 0 || parsedToken.groups.algo === void 0) { + continue; + } + const algorithm = parsedToken.groups.algo.toLowerCase(); + if (supportedHashes.includes(algorithm)) { + result.push(parsedToken.groups); + } + } + if (empty === true) { + return "no metadata"; + } + return result; + } + function getStrongestMetadata(metadataList) { + let algorithm = metadataList[0].algo; + if (algorithm[3] === "5") { + return algorithm; + } + for (let i = 1; i < metadataList.length; ++i) { + const metadata = metadataList[i]; + if (metadata.algo[3] === "5") { + algorithm = "sha512"; + break; + } else if (algorithm[3] === "3") { + continue; + } else if (metadata.algo[3] === "3") { + algorithm = "sha384"; + } + } + return algorithm; + } + function filterMetadataListByAlgorithm(metadataList, algorithm) { + if (metadataList.length === 1) { + return metadataList; + } + let pos2 = 0; + for (let i = 0; i < metadataList.length; ++i) { + if (metadataList[i].algo === algorithm) { + metadataList[pos2++] = metadataList[i]; + } + } + metadataList.length = pos2; + return metadataList; + } + function compareBase64Mixed(actualValue, expectedValue) { + if (actualValue.length !== expectedValue.length) { + return false; + } + for (let i = 0; i < actualValue.length; ++i) { + if (actualValue[i] !== expectedValue[i]) { + if (actualValue[i] === "+" && expectedValue[i] === "-" || actualValue[i] === "/" && expectedValue[i] === "_") { + continue; + } + return false; + } + } + return true; + } + function tryUpgradeRequestToAPotentiallyTrustworthyURL(request) { + } + function sameOrigin(A, B) { + if (A.origin === B.origin && A.origin === "null") { + return true; + } + if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) { + return true; + } + return false; + } + function createDeferredPromise() { + let res; + let rej; + const promise = new Promise((resolve, reject) => { + res = resolve; + rej = reject; + }); + return { promise, resolve: res, reject: rej }; + } + function isAborted(fetchParams) { + return fetchParams.controller.state === "aborted"; + } + function isCancelled(fetchParams) { + return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated"; + } + function normalizeMethod(method) { + return normalizedMethodRecordsBase[method.toLowerCase()] ?? method; + } + function serializeJavascriptValueToJSONString(value) { + const result = JSON.stringify(value); + if (result === void 0) { + throw new TypeError("Value is not JSON serializable"); + } + assert5(typeof result === "string"); + return result; + } + var esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); + function createIterator(name2, kInternalIterator, keyIndex = 0, valueIndex = 1) { + class FastIterableIterator { + /** @type {any} */ + #target; + /** @type {'key' | 'value' | 'key+value'} */ + #kind; + /** @type {number} */ + #index; + /** + * @see https://webidl.spec.whatwg.org/#dfn-default-iterator-object + * @param {unknown} target + * @param {'key' | 'value' | 'key+value'} kind + */ + constructor(target, kind) { + this.#target = target; + this.#kind = kind; + this.#index = 0; + } + next() { + if (typeof this !== "object" || this === null || !(#target in this)) { + throw new TypeError( + `'next' called on an object that does not implement interface ${name2} Iterator.` + ); + } + const index = this.#index; + const values = this.#target[kInternalIterator]; + const len = values.length; + if (index >= len) { + return { + value: void 0, + done: true + }; + } + const { [keyIndex]: key, [valueIndex]: value } = values[index]; + this.#index = index + 1; + let result; + switch (this.#kind) { + case "key": + result = key; + break; + case "value": + result = value; + break; + case "key+value": + result = [key, value]; + break; + } + return { + value: result, + done: false + }; + } + } + delete FastIterableIterator.prototype.constructor; + Object.setPrototypeOf(FastIterableIterator.prototype, esIteratorPrototype); + Object.defineProperties(FastIterableIterator.prototype, { + [Symbol.toStringTag]: { + writable: false, + enumerable: false, + configurable: true, + value: `${name2} Iterator` + }, + next: { writable: true, enumerable: true, configurable: true } + }); + return function(target, kind) { + return new FastIterableIterator(target, kind); + }; + } + function iteratorMixin(name2, object, kInternalIterator, keyIndex = 0, valueIndex = 1) { + const makeIterator = createIterator(name2, kInternalIterator, keyIndex, valueIndex); + const properties = { + keys: { + writable: true, + enumerable: true, + configurable: true, + value: function keys() { + webidl.brandCheck(this, object); + return makeIterator(this, "key"); + } + }, + values: { + writable: true, + enumerable: true, + configurable: true, + value: function values() { + webidl.brandCheck(this, object); + return makeIterator(this, "value"); + } + }, + entries: { + writable: true, + enumerable: true, + configurable: true, + value: function entries() { + webidl.brandCheck(this, object); + return makeIterator(this, "key+value"); + } + }, + forEach: { + writable: true, + enumerable: true, + configurable: true, + value: function forEach(callbackfn, thisArg = globalThis) { + webidl.brandCheck(this, object); + webidl.argumentLengthCheck(arguments, 1, `${name2}.forEach`); + if (typeof callbackfn !== "function") { + throw new TypeError( + `Failed to execute 'forEach' on '${name2}': parameter 1 is not of type 'Function'.` + ); + } + for (const { 0: key, 1: value } of makeIterator(this, "key+value")) { + callbackfn.call(thisArg, value, key, this); + } + } + } + }; + return Object.defineProperties(object.prototype, { + ...properties, + [Symbol.iterator]: { + writable: true, + enumerable: false, + configurable: true, + value: properties.entries.value + } + }); + } + async function fullyReadBody(body, processBody, processBodyError) { + const successSteps = processBody; + const errorSteps = processBodyError; + let reader; + try { + reader = body.stream.getReader(); + } catch (e) { + errorSteps(e); + return; + } + try { + successSteps(await readAllBytes(reader)); + } catch (e) { + errorSteps(e); + } + } + function isReadableStreamLike(stream) { + return stream instanceof ReadableStream || stream[Symbol.toStringTag] === "ReadableStream" && typeof stream.tee === "function"; + } + function readableStreamClose(controller) { + try { + controller.close(); + controller.byobRequest?.respond(0); + } catch (err) { + if (!err.message.includes("Controller is already closed") && !err.message.includes("ReadableStream is already closed")) { + throw err; + } + } + } + var invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/; + function isomorphicEncode(input) { + assert5(!invalidIsomorphicEncodeValueRegex.test(input)); + return input; + } + async function readAllBytes(reader) { + const bytes = []; + let byteLength = 0; + while (true) { + const { done, value: chunk } = await reader.read(); + if (done) { + return Buffer.concat(bytes, byteLength); + } + if (!isUint8Array(chunk)) { + throw new TypeError("Received non-Uint8Array chunk"); + } + bytes.push(chunk); + byteLength += chunk.length; + } + } + function urlIsLocal(url) { + assert5("protocol" in url); + const protocol = url.protocol; + return protocol === "about:" || protocol === "blob:" || protocol === "data:"; + } + function urlHasHttpsScheme(url) { + return typeof url === "string" && url[5] === ":" && url[0] === "h" && url[1] === "t" && url[2] === "t" && url[3] === "p" && url[4] === "s" || url.protocol === "https:"; + } + function urlIsHttpHttpsScheme(url) { + assert5("protocol" in url); + const protocol = url.protocol; + return protocol === "http:" || protocol === "https:"; + } + function simpleRangeHeaderValue(value, allowWhitespace) { + const data = value; + if (!data.startsWith("bytes")) { + return "failure"; + } + const position = { position: 5 }; + if (allowWhitespace) { + collectASequenceOfCodePoints( + (char) => char === " " || char === " ", + data, + position + ); + } + if (data.charCodeAt(position.position) !== 61) { + return "failure"; + } + position.position++; + if (allowWhitespace) { + collectASequenceOfCodePoints( + (char) => char === " " || char === " ", + data, + position + ); + } + const rangeStart = collectASequenceOfCodePoints( + (char) => { + const code2 = char.charCodeAt(0); + return code2 >= 48 && code2 <= 57; + }, + data, + position + ); + const rangeStartValue = rangeStart.length ? Number(rangeStart) : null; + if (allowWhitespace) { + collectASequenceOfCodePoints( + (char) => char === " " || char === " ", + data, + position + ); + } + if (data.charCodeAt(position.position) !== 45) { + return "failure"; + } + position.position++; + if (allowWhitespace) { + collectASequenceOfCodePoints( + (char) => char === " " || char === " ", + data, + position + ); + } + const rangeEnd = collectASequenceOfCodePoints( + (char) => { + const code2 = char.charCodeAt(0); + return code2 >= 48 && code2 <= 57; + }, + data, + position + ); + const rangeEndValue = rangeEnd.length ? Number(rangeEnd) : null; + if (position.position < data.length) { + return "failure"; + } + if (rangeEndValue === null && rangeStartValue === null) { + return "failure"; + } + if (rangeStartValue > rangeEndValue) { + return "failure"; + } + return { rangeStartValue, rangeEndValue }; + } + function buildContentRange(rangeStart, rangeEnd, fullLength) { + let contentRange = "bytes "; + contentRange += isomorphicEncode(`${rangeStart}`); + contentRange += "-"; + contentRange += isomorphicEncode(`${rangeEnd}`); + contentRange += "/"; + contentRange += isomorphicEncode(`${fullLength}`); + return contentRange; + } + var InflateStream = class extends Transform { + #zlibOptions; + /** @param {zlib.ZlibOptions} [zlibOptions] */ + constructor(zlibOptions) { + super(); + this.#zlibOptions = zlibOptions; + } + _transform(chunk, encoding, callback) { + if (!this._inflateStream) { + if (chunk.length === 0) { + callback(); + return; + } + this._inflateStream = (chunk[0] & 15) === 8 ? zlib.createInflate(this.#zlibOptions) : zlib.createInflateRaw(this.#zlibOptions); + this._inflateStream.on("data", this.push.bind(this)); + this._inflateStream.on("end", () => this.push(null)); + this._inflateStream.on("error", (err) => this.destroy(err)); + } + this._inflateStream.write(chunk, encoding, callback); + } + _final(callback) { + if (this._inflateStream) { + this._inflateStream.end(); + this._inflateStream = null; + } + callback(); + } + }; + function createInflate(zlibOptions) { + return new InflateStream(zlibOptions); + } + function extractMimeType(headers) { + let charset = null; + let essence = null; + let mimeType = null; + const values = getDecodeSplit("content-type", headers); + if (values === null) { + return "failure"; + } + for (const value of values) { + const temporaryMimeType = parseMIMEType(value); + if (temporaryMimeType === "failure" || temporaryMimeType.essence === "*/*") { + continue; + } + mimeType = temporaryMimeType; + if (mimeType.essence !== essence) { + charset = null; + if (mimeType.parameters.has("charset")) { + charset = mimeType.parameters.get("charset"); + } + essence = mimeType.essence; + } else if (!mimeType.parameters.has("charset") && charset !== null) { + mimeType.parameters.set("charset", charset); + } + } + if (mimeType == null) { + return "failure"; + } + return mimeType; + } + function gettingDecodingSplitting(value) { + const input = value; + const position = { position: 0 }; + const values = []; + let temporaryValue = ""; + while (position.position < input.length) { + temporaryValue += collectASequenceOfCodePoints( + (char) => char !== '"' && char !== ",", + input, + position + ); + if (position.position < input.length) { + if (input.charCodeAt(position.position) === 34) { + temporaryValue += collectAnHTTPQuotedString( + input, + position + ); + if (position.position < input.length) { + continue; + } + } else { + assert5(input.charCodeAt(position.position) === 44); + position.position++; + } + } + temporaryValue = removeChars(temporaryValue, true, true, (char) => char === 9 || char === 32); + values.push(temporaryValue); + temporaryValue = ""; + } + return values; + } + function getDecodeSplit(name2, list2) { + const value = list2.get(name2, true); + if (value === null) { + return null; + } + return gettingDecodingSplitting(value); + } + var textDecoder = new TextDecoder(); + function utf8DecodeBytes(buffer) { + if (buffer.length === 0) { + return ""; + } + if (buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191) { + buffer = buffer.subarray(3); + } + const output = textDecoder.decode(buffer); + return output; + } + var EnvironmentSettingsObjectBase = class { + get baseUrl() { + return getGlobalOrigin(); + } + get origin() { + return this.baseUrl?.origin; + } + policyContainer = makePolicyContainer(); + }; + var EnvironmentSettingsObject = class { + settingsObject = new EnvironmentSettingsObjectBase(); + }; + var environmentSettingsObject = new EnvironmentSettingsObject(); + module2.exports = { + isAborted, + isCancelled, + isValidEncodedURL, + createDeferredPromise, + ReadableStreamFrom, + tryUpgradeRequestToAPotentiallyTrustworthyURL, + clampAndCoarsenConnectionTimingInfo, + coarsenedSharedCurrentTime, + determineRequestsReferrer, + makePolicyContainer, + clonePolicyContainer, + appendFetchMetadata, + appendRequestOriginHeader, + TAOCheck, + corsCheck, + crossOriginResourcePolicyCheck, + createOpaqueTimingInfo, + setRequestReferrerPolicyOnRedirect, + isValidHTTPToken, + requestBadPort, + requestCurrentURL, + responseURL, + responseLocationURL, + isBlobLike, + isURLPotentiallyTrustworthy, + isValidReasonPhrase, + sameOrigin, + normalizeMethod, + serializeJavascriptValueToJSONString, + iteratorMixin, + createIterator, + isValidHeaderName, + isValidHeaderValue, + isErrorLike, + fullyReadBody, + bytesMatch, + isReadableStreamLike, + readableStreamClose, + isomorphicEncode, + urlIsLocal, + urlHasHttpsScheme, + urlIsHttpHttpsScheme, + readAllBytes, + simpleRangeHeaderValue, + buildContentRange, + parseMetadata, + createInflate, + extractMimeType, + getDecodeSplit, + utf8DecodeBytes, + environmentSettingsObject + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/symbols.js +var require_symbols2 = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/symbols.js"(exports2, module2) { + "use strict"; + module2.exports = { + kUrl: Symbol("url"), + kHeaders: Symbol("headers"), + kSignal: Symbol("signal"), + kState: Symbol("state"), + kDispatcher: Symbol("dispatcher") + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/file.js +var require_file = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/file.js"(exports2, module2) { + "use strict"; + var { Blob: Blob2, File } = require("node:buffer"); + var { kState } = require_symbols2(); + var { webidl } = require_webidl(); + var FileLike = class _FileLike { + constructor(blobLike, fileName, options = {}) { + const n = fileName; + const t = options.type; + const d = options.lastModified ?? Date.now(); + this[kState] = { + blobLike, + name: n, + type: t, + lastModified: d + }; + } + stream(...args) { + webidl.brandCheck(this, _FileLike); + return this[kState].blobLike.stream(...args); + } + arrayBuffer(...args) { + webidl.brandCheck(this, _FileLike); + return this[kState].blobLike.arrayBuffer(...args); + } + slice(...args) { + webidl.brandCheck(this, _FileLike); + return this[kState].blobLike.slice(...args); + } + text(...args) { + webidl.brandCheck(this, _FileLike); + return this[kState].blobLike.text(...args); + } + get size() { + webidl.brandCheck(this, _FileLike); + return this[kState].blobLike.size; + } + get type() { + webidl.brandCheck(this, _FileLike); + return this[kState].blobLike.type; + } + get name() { + webidl.brandCheck(this, _FileLike); + return this[kState].name; + } + get lastModified() { + webidl.brandCheck(this, _FileLike); + return this[kState].lastModified; + } + get [Symbol.toStringTag]() { + return "File"; + } + }; + webidl.converters.Blob = webidl.interfaceConverter(Blob2); + function isFileLike(object) { + return object instanceof File || object && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && object[Symbol.toStringTag] === "File"; + } + module2.exports = { FileLike, isFileLike }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/formdata.js +var require_formdata = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/formdata.js"(exports2, module2) { + "use strict"; + var { isBlobLike, iteratorMixin } = require_util3(); + var { kState } = require_symbols2(); + var { kEnumerableProperty } = require_util(); + var { FileLike, isFileLike } = require_file(); + var { webidl } = require_webidl(); + var { File: NativeFile } = require("node:buffer"); + var nodeUtil = require("node:util"); + var File = globalThis.File ?? NativeFile; + var FormData = class _FormData { + constructor(form) { + webidl.util.markAsUncloneable(this); + if (form !== void 0) { + throw webidl.errors.conversionFailed({ + prefix: "FormData constructor", + argument: "Argument 1", + types: ["undefined"] + }); + } + this[kState] = []; + } + append(name2, value, filename = void 0) { + webidl.brandCheck(this, _FormData); + const prefix = "FormData.append"; + webidl.argumentLengthCheck(arguments, 2, prefix); + if (arguments.length === 3 && !isBlobLike(value)) { + throw new TypeError( + "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'" + ); + } + name2 = webidl.converters.USVString(name2, prefix, "name"); + value = isBlobLike(value) ? webidl.converters.Blob(value, prefix, "value", { strict: false }) : webidl.converters.USVString(value, prefix, "value"); + filename = arguments.length === 3 ? webidl.converters.USVString(filename, prefix, "filename") : void 0; + const entry = makeEntry(name2, value, filename); + this[kState].push(entry); + } + delete(name2) { + webidl.brandCheck(this, _FormData); + const prefix = "FormData.delete"; + webidl.argumentLengthCheck(arguments, 1, prefix); + name2 = webidl.converters.USVString(name2, prefix, "name"); + this[kState] = this[kState].filter((entry) => entry.name !== name2); + } + get(name2) { + webidl.brandCheck(this, _FormData); + const prefix = "FormData.get"; + webidl.argumentLengthCheck(arguments, 1, prefix); + name2 = webidl.converters.USVString(name2, prefix, "name"); + const idx = this[kState].findIndex((entry) => entry.name === name2); + if (idx === -1) { + return null; + } + return this[kState][idx].value; + } + getAll(name2) { + webidl.brandCheck(this, _FormData); + const prefix = "FormData.getAll"; + webidl.argumentLengthCheck(arguments, 1, prefix); + name2 = webidl.converters.USVString(name2, prefix, "name"); + return this[kState].filter((entry) => entry.name === name2).map((entry) => entry.value); + } + has(name2) { + webidl.brandCheck(this, _FormData); + const prefix = "FormData.has"; + webidl.argumentLengthCheck(arguments, 1, prefix); + name2 = webidl.converters.USVString(name2, prefix, "name"); + return this[kState].findIndex((entry) => entry.name === name2) !== -1; + } + set(name2, value, filename = void 0) { + webidl.brandCheck(this, _FormData); + const prefix = "FormData.set"; + webidl.argumentLengthCheck(arguments, 2, prefix); + if (arguments.length === 3 && !isBlobLike(value)) { + throw new TypeError( + "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'" + ); + } + name2 = webidl.converters.USVString(name2, prefix, "name"); + value = isBlobLike(value) ? webidl.converters.Blob(value, prefix, "name", { strict: false }) : webidl.converters.USVString(value, prefix, "name"); + filename = arguments.length === 3 ? webidl.converters.USVString(filename, prefix, "name") : void 0; + const entry = makeEntry(name2, value, filename); + const idx = this[kState].findIndex((entry2) => entry2.name === name2); + if (idx !== -1) { + this[kState] = [ + ...this[kState].slice(0, idx), + entry, + ...this[kState].slice(idx + 1).filter((entry2) => entry2.name !== name2) + ]; + } else { + this[kState].push(entry); + } + } + [nodeUtil.inspect.custom](depth, options) { + const state = this[kState].reduce((a, b) => { + if (a[b.name]) { + if (Array.isArray(a[b.name])) { + a[b.name].push(b.value); + } else { + a[b.name] = [a[b.name], b.value]; + } + } else { + a[b.name] = b.value; + } + return a; + }, { __proto__: null }); + options.depth ??= depth; + options.colors ??= true; + const output = nodeUtil.formatWithOptions(options, state); + return `FormData ${output.slice(output.indexOf("]") + 2)}`; + } + }; + iteratorMixin("FormData", FormData, kState, "name", "value"); + Object.defineProperties(FormData.prototype, { + append: kEnumerableProperty, + delete: kEnumerableProperty, + get: kEnumerableProperty, + getAll: kEnumerableProperty, + has: kEnumerableProperty, + set: kEnumerableProperty, + [Symbol.toStringTag]: { + value: "FormData", + configurable: true + } + }); + function makeEntry(name2, value, filename) { + if (typeof value === "string") { + } else { + if (!isFileLike(value)) { + value = value instanceof Blob ? new File([value], "blob", { type: value.type }) : new FileLike(value, "blob", { type: value.type }); + } + if (filename !== void 0) { + const options = { + type: value.type, + lastModified: value.lastModified + }; + value = value instanceof NativeFile ? new File([value], filename, options) : new FileLike(value, filename, options); + } + } + return { name: name2, value }; + } + module2.exports = { FormData, makeEntry }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/formdata-parser.js +var require_formdata_parser = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/formdata-parser.js"(exports2, module2) { + "use strict"; + var { isUSVString, bufferToLowerCasedHeaderName } = require_util(); + var { utf8DecodeBytes } = require_util3(); + var { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = require_data_url(); + var { isFileLike } = require_file(); + var { makeEntry } = require_formdata(); + var assert5 = require("node:assert"); + var { File: NodeFile } = require("node:buffer"); + var File = globalThis.File ?? NodeFile; + var formDataNameBuffer = Buffer.from('form-data; name="'); + var filenameBuffer = Buffer.from("; filename"); + var dd = Buffer.from("--"); + var ddcrlf = Buffer.from("--\r\n"); + function isAsciiString(chars) { + for (let i = 0; i < chars.length; ++i) { + if ((chars.charCodeAt(i) & ~127) !== 0) { + return false; + } + } + return true; + } + function validateBoundary(boundary) { + const length = boundary.length; + if (length < 27 || length > 70) { + return false; + } + for (let i = 0; i < length; ++i) { + const cp = boundary.charCodeAt(i); + if (!(cp >= 48 && cp <= 57 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 39 || cp === 45 || cp === 95)) { + return false; + } + } + return true; + } + function multipartFormDataParser(input, mimeType) { + assert5(mimeType !== "failure" && mimeType.essence === "multipart/form-data"); + const boundaryString = mimeType.parameters.get("boundary"); + if (boundaryString === void 0) { + return "failure"; + } + const boundary = Buffer.from(`--${boundaryString}`, "utf8"); + const entryList = []; + const position = { position: 0 }; + while (input[position.position] === 13 && input[position.position + 1] === 10) { + position.position += 2; + } + let trailing = input.length; + while (input[trailing - 1] === 10 && input[trailing - 2] === 13) { + trailing -= 2; + } + if (trailing !== input.length) { + input = input.subarray(0, trailing); + } + while (true) { + if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) { + position.position += boundary.length; + } else { + return "failure"; + } + if (position.position === input.length - 2 && bufferStartsWith(input, dd, position) || position.position === input.length - 4 && bufferStartsWith(input, ddcrlf, position)) { + return entryList; + } + if (input[position.position] !== 13 || input[position.position + 1] !== 10) { + return "failure"; + } + position.position += 2; + const result = parseMultipartFormDataHeaders(input, position); + if (result === "failure") { + return "failure"; + } + let { name: name2, filename, contentType, encoding } = result; + position.position += 2; + let body; + { + const boundaryIndex = input.indexOf(boundary.subarray(2), position.position); + if (boundaryIndex === -1) { + return "failure"; + } + body = input.subarray(position.position, boundaryIndex - 4); + position.position += body.length; + if (encoding === "base64") { + body = Buffer.from(body.toString(), "base64"); + } + } + if (input[position.position] !== 13 || input[position.position + 1] !== 10) { + return "failure"; + } else { + position.position += 2; + } + let value; + if (filename !== null) { + contentType ??= "text/plain"; + if (!isAsciiString(contentType)) { + contentType = ""; + } + value = new File([body], filename, { type: contentType }); + } else { + value = utf8DecodeBytes(Buffer.from(body)); + } + assert5(isUSVString(name2)); + assert5(typeof value === "string" && isUSVString(value) || isFileLike(value)); + entryList.push(makeEntry(name2, value, filename)); + } + } + function parseMultipartFormDataHeaders(input, position) { + let name2 = null; + let filename = null; + let contentType = null; + let encoding = null; + while (true) { + if (input[position.position] === 13 && input[position.position + 1] === 10) { + if (name2 === null) { + return "failure"; + } + return { name: name2, filename, contentType, encoding }; + } + let headerName = collectASequenceOfBytes( + (char) => char !== 10 && char !== 13 && char !== 58, + input, + position + ); + headerName = removeChars(headerName, true, true, (char) => char === 9 || char === 32); + if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) { + return "failure"; + } + if (input[position.position] !== 58) { + return "failure"; + } + position.position++; + collectASequenceOfBytes( + (char) => char === 32 || char === 9, + input, + position + ); + switch (bufferToLowerCasedHeaderName(headerName)) { + case "content-disposition": { + name2 = filename = null; + if (!bufferStartsWith(input, formDataNameBuffer, position)) { + return "failure"; + } + position.position += 17; + name2 = parseMultipartFormDataName(input, position); + if (name2 === null) { + return "failure"; + } + if (bufferStartsWith(input, filenameBuffer, position)) { + let check = position.position + filenameBuffer.length; + if (input[check] === 42) { + position.position += 1; + check += 1; + } + if (input[check] !== 61 || input[check + 1] !== 34) { + return "failure"; + } + position.position += 12; + filename = parseMultipartFormDataName(input, position); + if (filename === null) { + return "failure"; + } + } + break; + } + case "content-type": { + let headerValue = collectASequenceOfBytes( + (char) => char !== 10 && char !== 13, + input, + position + ); + headerValue = removeChars(headerValue, false, true, (char) => char === 9 || char === 32); + contentType = isomorphicDecode(headerValue); + break; + } + case "content-transfer-encoding": { + let headerValue = collectASequenceOfBytes( + (char) => char !== 10 && char !== 13, + input, + position + ); + headerValue = removeChars(headerValue, false, true, (char) => char === 9 || char === 32); + encoding = isomorphicDecode(headerValue); + break; + } + default: { + collectASequenceOfBytes( + (char) => char !== 10 && char !== 13, + input, + position + ); + } + } + if (input[position.position] !== 13 && input[position.position + 1] !== 10) { + return "failure"; + } else { + position.position += 2; + } + } + } + function parseMultipartFormDataName(input, position) { + assert5(input[position.position - 1] === 34); + let name2 = collectASequenceOfBytes( + (char) => char !== 10 && char !== 13 && char !== 34, + input, + position + ); + if (input[position.position] !== 34) { + return null; + } else { + position.position++; + } + name2 = new TextDecoder().decode(name2).replace(/%0A/ig, "\n").replace(/%0D/ig, "\r").replace(/%22/g, '"'); + return name2; + } + function collectASequenceOfBytes(condition, input, position) { + let start = position.position; + while (start < input.length && condition(input[start])) { + ++start; + } + return input.subarray(position.position, position.position = start); + } + function removeChars(buf, leading, trailing, predicate) { + let lead = 0; + let trail = buf.length - 1; + if (leading) { + while (lead < buf.length && predicate(buf[lead])) lead++; + } + if (trailing) { + while (trail > 0 && predicate(buf[trail])) trail--; + } + return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1); + } + function bufferStartsWith(buffer, start, position) { + if (buffer.length < start.length) { + return false; + } + for (let i = 0; i < start.length; i++) { + if (start[i] !== buffer[position.position + i]) { + return false; + } + } + return true; + } + module2.exports = { + multipartFormDataParser, + validateBoundary + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/body.js +var require_body = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/web/fetch/body.js"(exports2, module2) { + "use strict"; + var util = require_util(); + var { + ReadableStreamFrom, + isBlobLike, + isReadableStreamLike, + readableStreamClose, + createDeferredPromise, + fullyReadBody, + extractMimeType, + utf8DecodeBytes + } = require_util3(); + var { FormData } = require_formdata(); + var { kState } = require_symbols2(); + var { webidl } = require_webidl(); + var { Blob: Blob2 } = require("node:buffer"); + var assert5 = require("node:assert"); + var { isErrored, isDisturbed } = require("node:stream"); + var { isArrayBuffer } = require("node:util/types"); + var { serializeAMimeType } = require_data_url(); + var { multipartFormDataParser } = require_formdata_parser(); + var random; + try { + const crypto = require("node:crypto"); + random = (max) => crypto.randomInt(0, max); + } catch { + random = (max) => Math.floor(Math.random(max)); + } + var textEncoder = new TextEncoder(); + function noop3() { + } + var hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf("v18") !== 0; + var streamRegistry; + if (hasFinalizationRegistry) { + streamRegistry = new FinalizationRegistry((weakRef) => { + const stream = weakRef.deref(); + if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) { + stream.cancel("Response object has been garbage collected").catch(noop3); + } + }); + } + function extractBody(object, keepalive = false) { + let stream = null; + if (object instanceof ReadableStream) { + stream = object; + } else if (isBlobLike(object)) { + stream = object.stream(); + } else { + stream = new ReadableStream({ + async pull(controller) { + const buffer = typeof source === "string" ? textEncoder.encode(source) : source; + if (buffer.byteLength) { + controller.enqueue(buffer); + } + queueMicrotask(() => readableStreamClose(controller)); + }, + start() { + }, + type: "bytes" + }); + } + assert5(isReadableStreamLike(stream)); + let action = null; + let source = null; + let length = null; + let type = null; + if (typeof object === "string") { + source = object; + type = "text/plain;charset=UTF-8"; + } else if (object instanceof URLSearchParams) { + source = object.toString(); + type = "application/x-www-form-urlencoded;charset=UTF-8"; + } else if (isArrayBuffer(object)) { + source = new Uint8Array(object.slice()); + } else if (ArrayBuffer.isView(object)) { + source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength)); + } else if (util.isFormDataLike(object)) { + const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`; + const prefix = `--${boundary}\r +Content-Disposition: form-data`; + const escape = (str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"); + const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, "\r\n"); + const blobParts = []; + const rn = new Uint8Array([13, 10]); + length = 0; + let hasUnknownSizeValue = false; + for (const [name2, value] of object) { + if (typeof value === "string") { + const chunk2 = textEncoder.encode(prefix + `; name="${escape(normalizeLinefeeds(name2))}"\r +\r +${normalizeLinefeeds(value)}\r +`); + blobParts.push(chunk2); + length += chunk2.byteLength; + } else { + const chunk2 = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name2))}"` + (value.name ? `; filename="${escape(value.name)}"` : "") + `\r +Content-Type: ${value.type || "application/octet-stream"}\r +\r +`); + blobParts.push(chunk2, value, rn); + if (typeof value.size === "number") { + length += chunk2.byteLength + value.size + rn.byteLength; + } else { + hasUnknownSizeValue = true; + } + } + } + const chunk = textEncoder.encode(`--${boundary}--\r +`); + blobParts.push(chunk); + length += chunk.byteLength; + if (hasUnknownSizeValue) { + length = null; + } + source = object; + action = async function* () { + for (const part of blobParts) { + if (part.stream) { + yield* part.stream(); + } else { + yield part; + } + } + }; + type = `multipart/form-data; boundary=${boundary}`; + } else if (isBlobLike(object)) { + source = object; + length = object.size; + if (object.type) { + type = object.type; + } + } else if (typeof object[Symbol.asyncIterator] === "function") { + if (keepalive) { + throw new TypeError("keepalive"); + } + if (util.isDisturbed(object) || object.locked) { + throw new TypeError( + "Response body object should not be disturbed or locked" + ); + } + stream = object instanceof ReadableStream ? object : ReadableStreamFrom(object); + } + if (typeof source === "string" || util.isBuffer(source)) { + length = Buffer.byteLength(source); + } + if (action != null) { + let iterator; + stream = new ReadableStream({ + async start() { + iterator = action(object)[Symbol.asyncIterator](); + }, + async pull(controller) { + const { value, done } = await iterator.next(); + if (done) { + queueMicrotask(() => { + controller.close(); + controller.byobRequest?.respond(0); + }); + } else { + if (!isErrored(stream)) { + const buffer = new Uint8Array(value); + if (buffer.byteLength) { + controller.enqueue(buffer); + } + } + } + return controller.desiredSize > 0; + }, + async cancel(reason) { + await iterator.return(); + }, + type: "bytes" + }); + } + const body = { stream, source, length }; + return [body, type]; + } + function safelyExtractBody(object, keepalive = false) { + if (object instanceof ReadableStream) { + assert5(!util.isDisturbed(object), "The body has already been consumed."); + assert5(!object.locked, "The stream is locked."); + } + return extractBody(object, keepalive); + } + function cloneBody(instance, body) { + const [out1, out2] = body.stream.tee(); + body.stream = out1; + return { + stream: out2, + length: body.length, + source: body.source + }; + } + function throwIfAborted(state) { + if (state.aborted) { + throw new DOMException("The operation was aborted.", "AbortError"); + } + } + function bodyMixinMethods(instance) { + const methods = { + blob() { + return consumeBody(this, (bytes) => { + let mimeType = bodyMimeType(this); + if (mimeType === null) { + mimeType = ""; + } else if (mimeType) { + mimeType = serializeAMimeType(mimeType); + } + return new Blob2([bytes], { type: mimeType }); + }, instance); + }, + arrayBuffer() { + return consumeBody(this, (bytes) => { + return new Uint8Array(bytes).buffer; + }, instance); + }, + text() { + return consumeBody(this, utf8DecodeBytes, instance); + }, + json() { + return consumeBody(this, parseJSONFromBytes, instance); + }, + formData() { + return consumeBody(this, (value) => { + const mimeType = bodyMimeType(this); + if (mimeType !== null) { + switch (mimeType.essence) { + case "multipart/form-data": { + const parsed = multipartFormDataParser(value, mimeType); + if (parsed === "failure") { + throw new TypeError("Failed to parse body as FormData."); + } + const fd = new FormData(); + fd[kState] = parsed; + return fd; + } + case "application/x-www-form-urlencoded": { + const entries = new URLSearchParams(value.toString()); + const fd = new FormData(); + for (const [name2, value2] of entries) { + fd.append(name2, value2); + } + return fd; + } + } + } + throw new TypeError( + 'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".' + ); + }, instance); + }, + bytes() { + return consumeBody(this, (bytes) => { + return new Uint8Array(bytes); + }, instance); + } + }; + return methods; + } + function mixinBody(prototype) { + Object.assign(prototype.prototype, bodyMixinMethods(prototype)); + } + async function consumeBody(object, convertBytesToJSValue, instance) { + webidl.brandCheck(object, instance); + if (bodyUnusable(object)) { + throw new TypeError("Body is unusable: Body has already been read"); + } + throwIfAborted(object[kState]); + const promise = createDeferredPromise(); + const errorSteps = (error) => promise.reject(error); + const successSteps = (data) => { + try { + promise.resolve(convertBytesToJSValue(data)); + } catch (e) { + errorSteps(e); + } + }; + if (object[kState].body == null) { + successSteps(Buffer.allocUnsafe(0)); + return promise.promise; + } + await fullyReadBody(object[kState].body, successSteps, errorSteps); + return promise.promise; + } + function bodyUnusable(object) { + const body = object[kState].body; + return body != null && (body.stream.locked || util.isDisturbed(body.stream)); + } + function parseJSONFromBytes(bytes) { + return JSON.parse(utf8DecodeBytes(bytes)); + } + function bodyMimeType(requestOrResponse) { + const headers = requestOrResponse[kState].headersList; + const mimeType = extractMimeType(headers); + if (mimeType === "failure") { + return null; + } + return mimeType; + } + module2.exports = { + extractBody, + safelyExtractBody, + cloneBody, + mixinBody, + streamRegistry, + hasFinalizationRegistry, + bodyUnusable + }; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/client-h1.js +var require_client_h1 = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/client-h1.js"(exports2, module2) { + "use strict"; + var assert5 = require("node:assert"); + var util = require_util(); + var { channels } = require_diagnostics(); + var timers = require_timers(); + var { + RequestContentLengthMismatchError, + ResponseContentLengthMismatchError, + RequestAbortedError, + HeadersTimeoutError, + HeadersOverflowError, + SocketError, + InformationalError, + BodyTimeoutError, + HTTPParserError, + ResponseExceededMaxSizeError + } = require_errors(); + var { + kUrl, + kReset, + kClient, + kParser, + kBlocking, + kRunning, + kPending, + kSize, + kWriting, + kQueue, + kNoRef, + kKeepAliveDefaultTimeout, + kHostHeader, + kPendingIdx, + kRunningIdx, + kError, + kPipelining, + kSocket, + kKeepAliveTimeoutValue, + kMaxHeadersSize, + kKeepAliveMaxTimeout, + kKeepAliveTimeoutThreshold, + kHeadersTimeout, + kBodyTimeout, + kStrictContentLength, + kMaxRequests, + kCounter, + kMaxResponseSize, + kOnError, + kResume, + kHTTPContext + } = require_symbols(); + var constants2 = require_constants3(); + var EMPTY_BUF = Buffer.alloc(0); + var FastBuffer = Buffer[Symbol.species]; + var addListener = util.addListener; + var removeAllListeners = util.removeAllListeners; + var extractBody; + async function lazyllhttp() { + const llhttpWasmData = process.env.JEST_WORKER_ID ? require_llhttp_wasm() : void 0; + let mod; + try { + mod = await WebAssembly.compile(require_llhttp_simd_wasm()); + } catch (e) { + mod = await WebAssembly.compile(llhttpWasmData || require_llhttp_wasm()); + } + return await WebAssembly.instantiate(mod, { + env: { + /* eslint-disable camelcase */ + wasm_on_url: (p, at, len) => { + return 0; + }, + wasm_on_status: (p, at, len) => { + assert5(currentParser.ptr === p); + const start = at - currentBufferPtr + currentBufferRef.byteOffset; + return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; + }, + wasm_on_message_begin: (p) => { + assert5(currentParser.ptr === p); + return currentParser.onMessageBegin() || 0; + }, + wasm_on_header_field: (p, at, len) => { + assert5(currentParser.ptr === p); + const start = at - currentBufferPtr + currentBufferRef.byteOffset; + return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; + }, + wasm_on_header_value: (p, at, len) => { + assert5(currentParser.ptr === p); + const start = at - currentBufferPtr + currentBufferRef.byteOffset; + return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; + }, + wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => { + assert5(currentParser.ptr === p); + return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0; + }, + wasm_on_body: (p, at, len) => { + assert5(currentParser.ptr === p); + const start = at - currentBufferPtr + currentBufferRef.byteOffset; + return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; + }, + wasm_on_message_complete: (p) => { + assert5(currentParser.ptr === p); + return currentParser.onMessageComplete() || 0; + } + /* eslint-enable camelcase */ + } + }); + } + var llhttpInstance = null; + var llhttpPromise = lazyllhttp(); + llhttpPromise.catch(); + var currentParser = null; + var currentBufferRef = null; + var currentBufferSize = 0; + var currentBufferPtr = null; + var USE_NATIVE_TIMER = 0; + var USE_FAST_TIMER = 1; + var TIMEOUT_HEADERS = 2 | USE_FAST_TIMER; + var TIMEOUT_BODY = 4 | USE_FAST_TIMER; + var TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER; + var Parser2 = class { + constructor(client, socket, { exports: exports3 }) { + assert5(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0); + this.llhttp = exports3; + this.ptr = this.llhttp.llhttp_alloc(constants2.TYPE.RESPONSE); + this.client = client; + this.socket = socket; + this.timeout = null; + this.timeoutValue = null; + this.timeoutType = null; + this.statusCode = null; + this.statusText = ""; + this.upgrade = false; + this.headers = []; + this.headersSize = 0; + this.headersMaxSize = client[kMaxHeadersSize]; + this.shouldKeepAlive = false; + this.paused = false; + this.resume = this.resume.bind(this); + this.bytesRead = 0; + this.keepAlive = ""; + this.contentLength = ""; + this.connection = ""; + this.maxResponseSize = client[kMaxResponseSize]; + } + setTimeout(delay, type) { + if (delay !== this.timeoutValue || type & USE_FAST_TIMER ^ this.timeoutType & USE_FAST_TIMER) { + if (this.timeout) { + timers.clearTimeout(this.timeout); + this.timeout = null; + } + if (delay) { + if (type & USE_FAST_TIMER) { + this.timeout = timers.setFastTimeout(onParserTimeout, delay, new WeakRef(this)); + } else { + this.timeout = setTimeout(onParserTimeout, delay, new WeakRef(this)); + this.timeout.unref(); + } + } + this.timeoutValue = delay; + } else if (this.timeout) { + if (this.timeout.refresh) { + this.timeout.refresh(); + } + } + this.timeoutType = type; + } + resume() { + if (this.socket.destroyed || !this.paused) { + return; + } + assert5(this.ptr != null); + assert5(currentParser == null); + this.llhttp.llhttp_resume(this.ptr); + assert5(this.timeoutType === TIMEOUT_BODY); + if (this.timeout) { + if (this.timeout.refresh) { + this.timeout.refresh(); + } + } + this.paused = false; + this.execute(this.socket.read() || EMPTY_BUF); + this.readMore(); + } + readMore() { + while (!this.paused && this.ptr) { + const chunk = this.socket.read(); + if (chunk === null) { + break; + } + this.execute(chunk); + } + } + execute(data) { + assert5(this.ptr != null); + assert5(currentParser == null); + assert5(!this.paused); + const { socket, llhttp } = this; + if (data.length > currentBufferSize) { + if (currentBufferPtr) { + llhttp.free(currentBufferPtr); + } + currentBufferSize = Math.ceil(data.length / 4096) * 4096; + currentBufferPtr = llhttp.malloc(currentBufferSize); + } + new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data); + try { + let ret; + try { + currentBufferRef = data; + currentParser = this; + ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length); + } catch (err) { + throw err; + } finally { + currentParser = null; + currentBufferRef = null; + } + const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr; + if (ret === constants2.ERROR.PAUSED_UPGRADE) { + this.onUpgrade(data.slice(offset)); + } else if (ret === constants2.ERROR.PAUSED) { + this.paused = true; + socket.unshift(data.slice(offset)); + } else if (ret !== constants2.ERROR.OK) { + const ptr = llhttp.llhttp_get_error_reason(this.ptr); + let message = ""; + if (ptr) { + const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0); + message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")"; + } + throw new HTTPParserError(message, constants2.ERROR[ret], data.slice(offset)); + } + } catch (err) { + util.destroy(socket, err); + } + } + destroy() { + assert5(this.ptr != null); + assert5(currentParser == null); + this.llhttp.llhttp_free(this.ptr); + this.ptr = null; + this.timeout && timers.clearTimeout(this.timeout); + this.timeout = null; + this.timeoutValue = null; + this.timeoutType = null; + this.paused = false; + } + onStatus(buf) { + this.statusText = buf.toString(); + } + onMessageBegin() { + const { socket, client } = this; + if (socket.destroyed) { + return -1; + } + const request = client[kQueue][client[kRunningIdx]]; + if (!request) { + return -1; + } + request.onResponseStarted(); + } + onHeaderField(buf) { + const len = this.headers.length; + if ((len & 1) === 0) { + this.headers.push(buf); + } else { + this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]); + } + this.trackHeader(buf.length); + } + onHeaderValue(buf) { + let len = this.headers.length; + if ((len & 1) === 1) { + this.headers.push(buf); + len += 1; + } else { + this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]); + } + const key = this.headers[len - 2]; + if (key.length === 10) { + const headerName = util.bufferToLowerCasedHeaderName(key); + if (headerName === "keep-alive") { + this.keepAlive += buf.toString(); + } else if (headerName === "connection") { + this.connection += buf.toString(); + } + } else if (key.length === 14 && util.bufferToLowerCasedHeaderName(key) === "content-length") { + this.contentLength += buf.toString(); + } + this.trackHeader(buf.length); + } + trackHeader(len) { + this.headersSize += len; + if (this.headersSize >= this.headersMaxSize) { + util.destroy(this.socket, new HeadersOverflowError()); + } + } + onUpgrade(head) { + const { upgrade, client, socket, headers, statusCode } = this; + assert5(upgrade); + assert5(client[kSocket] === socket); + assert5(!socket.destroyed); + assert5(!this.paused); + assert5((headers.length & 1) === 0); + const request = client[kQueue][client[kRunningIdx]]; + assert5(request); + assert5(request.upgrade || request.method === "CONNECT"); + this.statusCode = null; + this.statusText = ""; + this.shouldKeepAlive = null; + this.headers = []; + this.headersSize = 0; + socket.unshift(head); + socket[kParser].destroy(); + socket[kParser] = null; + socket[kClient] = null; + socket[kError] = null; + removeAllListeners(socket); + client[kSocket] = null; + client[kHTTPContext] = null; + client[kQueue][client[kRunningIdx]++] = null; + client.emit("disconnect", client[kUrl], [client], new InformationalError("upgrade")); + try { + request.onUpgrade(statusCode, headers, socket); + } catch (err) { + util.destroy(socket, err); + } + client[kResume](); + } + onHeadersComplete(statusCode, upgrade, shouldKeepAlive) { + const { client, socket, headers, statusText } = this; + if (socket.destroyed) { + return -1; + } + const request = client[kQueue][client[kRunningIdx]]; + if (!request) { + return -1; + } + assert5(!this.upgrade); + assert5(this.statusCode < 200); + if (statusCode === 100) { + util.destroy(socket, new SocketError("bad response", util.getSocketInfo(socket))); + return -1; + } + if (upgrade && !request.upgrade) { + util.destroy(socket, new SocketError("bad upgrade", util.getSocketInfo(socket))); + return -1; + } + assert5(this.timeoutType === TIMEOUT_HEADERS); + this.statusCode = statusCode; + this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD. + request.method === "HEAD" && !socket[kReset] && this.connection.toLowerCase() === "keep-alive"; + if (this.statusCode >= 200) { + const bodyTimeout = request.bodyTimeout != null ? request.bodyTimeout : client[kBodyTimeout]; + this.setTimeout(bodyTimeout, TIMEOUT_BODY); + } else if (this.timeout) { + if (this.timeout.refresh) { + this.timeout.refresh(); + } + } + if (request.method === "CONNECT") { + assert5(client[kRunning] === 1); + this.upgrade = true; + return 2; + } + if (upgrade) { + assert5(client[kRunning] === 1); + this.upgrade = true; + return 2; + } + assert5((this.headers.length & 1) === 0); + this.headers = []; + this.headersSize = 0; + if (this.shouldKeepAlive && client[kPipelining]) { + const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null; + if (keepAliveTimeout != null) { + const timeout = Math.min( + keepAliveTimeout - client[kKeepAliveTimeoutThreshold], + client[kKeepAliveMaxTimeout] + ); + if (timeout <= 0) { + socket[kReset] = true; + } else { + client[kKeepAliveTimeoutValue] = timeout; + } + } else { + client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]; + } + } else { + socket[kReset] = true; + } + const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false; + if (request.aborted) { + return -1; + } + if (request.method === "HEAD") { + return 1; + } + if (statusCode < 200) { + return 1; + } + if (socket[kBlocking]) { + socket[kBlocking] = false; + client[kResume](); + } + return pause ? constants2.ERROR.PAUSED : 0; + } + onBody(buf) { + const { client, socket, statusCode, maxResponseSize } = this; + if (socket.destroyed) { + return -1; + } + const request = client[kQueue][client[kRunningIdx]]; + assert5(request); + assert5(this.timeoutType === TIMEOUT_BODY); + if (this.timeout) { + if (this.timeout.refresh) { + this.timeout.refresh(); + } + } + assert5(statusCode >= 200); + if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { + util.destroy(socket, new ResponseExceededMaxSizeError()); + return -1; + } + this.bytesRead += buf.length; + if (request.onData(buf) === false) { + return constants2.ERROR.PAUSED; + } + } + onMessageComplete() { + const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this; + if (socket.destroyed && (!statusCode || shouldKeepAlive)) { + return -1; + } + if (upgrade) { + return; + } + assert5(statusCode >= 100); + assert5((this.headers.length & 1) === 0); + const request = client[kQueue][client[kRunningIdx]]; + assert5(request); + this.statusCode = null; + this.statusText = ""; + this.bytesRead = 0; + this.contentLength = ""; + this.keepAlive = ""; + this.connection = ""; + this.headers = []; + this.headersSize = 0; + if (statusCode < 200) { + return; + } + if (request.method !== "HEAD" && contentLength && bytesRead !== parseInt(contentLength, 10)) { + util.destroy(socket, new ResponseContentLengthMismatchError()); + return -1; + } + request.onComplete(headers); + client[kQueue][client[kRunningIdx]++] = null; + if (socket[kWriting]) { + assert5(client[kRunning] === 0); + util.destroy(socket, new InformationalError("reset")); + return constants2.ERROR.PAUSED; + } else if (!shouldKeepAlive) { + util.destroy(socket, new InformationalError("reset")); + return constants2.ERROR.PAUSED; + } else if (socket[kReset] && client[kRunning] === 0) { + util.destroy(socket, new InformationalError("reset")); + return constants2.ERROR.PAUSED; + } else if (client[kPipelining] == null || client[kPipelining] === 1) { + setImmediate(() => client[kResume]()); + } else { + client[kResume](); + } + } + }; + function onParserTimeout(parser) { + const { socket, timeoutType, client, paused } = parser.deref(); + if (timeoutType === TIMEOUT_HEADERS) { + if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { + assert5(!paused, "cannot be paused while waiting for headers"); + util.destroy(socket, new HeadersTimeoutError()); + } + } else if (timeoutType === TIMEOUT_BODY) { + if (!paused) { + util.destroy(socket, new BodyTimeoutError()); + } + } else if (timeoutType === TIMEOUT_KEEP_ALIVE) { + assert5(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]); + util.destroy(socket, new InformationalError("socket idle timeout")); + } + } + async function connectH1(client, socket) { + client[kSocket] = socket; + if (!llhttpInstance) { + llhttpInstance = await llhttpPromise; + llhttpPromise = null; + } + socket[kNoRef] = false; + socket[kWriting] = false; + socket[kReset] = false; + socket[kBlocking] = false; + socket[kParser] = new Parser2(client, socket, llhttpInstance); + addListener(socket, "error", function(err) { + assert5(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + const parser = this[kParser]; + if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) { + parser.onMessageComplete(); + return; + } + this[kError] = err; + this[kClient][kOnError](err); + }); + addListener(socket, "readable", function() { + const parser = this[kParser]; + if (parser) { + parser.readMore(); + } + }); + addListener(socket, "end", function() { + const parser = this[kParser]; + if (parser.statusCode && !parser.shouldKeepAlive) { + parser.onMessageComplete(); + return; + } + util.destroy(this, new SocketError("other side closed", util.getSocketInfo(this))); + }); + addListener(socket, "close", function() { + const client2 = this[kClient]; + const parser = this[kParser]; + if (parser) { + if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { + parser.onMessageComplete(); + } + this[kParser].destroy(); + this[kParser] = null; + } + const err = this[kError] || new SocketError("closed", util.getSocketInfo(this)); + client2[kSocket] = null; + client2[kHTTPContext] = null; + if (client2.destroyed) { + assert5(client2[kPending] === 0); + const requests = client2[kQueue].splice(client2[kRunningIdx]); + for (let i = 0; i < requests.length; i++) { + const request = requests[i]; + util.errorRequest(client2, request, err); + } + } else if (client2[kRunning] > 0 && err.code !== "UND_ERR_INFO") { + const request = client2[kQueue][client2[kRunningIdx]]; + client2[kQueue][client2[kRunningIdx]++] = null; + util.errorRequest(client2, request, err); + } + client2[kPendingIdx] = client2[kRunningIdx]; + assert5(client2[kRunning] === 0); + client2.emit("disconnect", client2[kUrl], [client2], err); + client2[kResume](); + }); + let closed = false; + socket.on("close", () => { + closed = true; + }); + return { + version: "h1", + defaultPipelining: 1, + write(...args) { + return writeH1(client, ...args); + }, + resume() { + resumeH1(client); + }, + destroy(err, callback) { + if (closed) { + queueMicrotask(callback); + } else { + socket.destroy(err).on("close", callback); + } + }, + get destroyed() { + return socket.destroyed; + }, + busy(request) { + if (socket[kWriting] || socket[kReset] || socket[kBlocking]) { + return true; + } + if (request) { + if (client[kRunning] > 0 && !request.idempotent) { + return true; + } + if (client[kRunning] > 0 && (request.upgrade || request.method === "CONNECT")) { + return true; + } + if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 && (util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) { + return true; + } + } + return false; + } + }; + } + function resumeH1(client) { + const socket = client[kSocket]; + if (socket && !socket.destroyed) { + if (client[kSize] === 0) { + if (!socket[kNoRef] && socket.unref) { + socket.unref(); + socket[kNoRef] = true; + } + } else if (socket[kNoRef] && socket.ref) { + socket.ref(); + socket[kNoRef] = false; + } + if (client[kSize] === 0) { + if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) { + socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE); + } + } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) { + if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) { + const request = client[kQueue][client[kRunningIdx]]; + const headersTimeout = request.headersTimeout != null ? request.headersTimeout : client[kHeadersTimeout]; + socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS); + } + } + } + } + function shouldSendContentLength(method) { + return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; + } + function writeH1(client, request) { + const { method, path: path16, host, upgrade, blocking, reset } = request; + let { body, headers, contentLength } = request; + const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; + if (util.isFormDataLike(body)) { + if (!extractBody) { + extractBody = require_body().extractBody; + } + const [bodyStream, contentType] = extractBody(body); + if (request.contentType == null) { + headers.push("content-type", contentType); + } + body = bodyStream.stream; + contentLength = bodyStream.length; + } else if (util.isBlobLike(body) && request.contentType == null && body.type) { + headers.push("content-type", body.type); + } + if (body && typeof body.read === "function") { + body.read(0); + } + const bodyLength = util.bodyLength(body); + contentLength = bodyLength ?? contentLength; + if (contentLength === null) { + contentLength = request.contentLength; + } + if (contentLength === 0 && !expectsPayload) { + contentLength = null; + } + if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) { + if (client[kStrictContentLength]) { + util.errorRequest(client, request, new RequestContentLengthMismatchError()); + return false; + } + process.emitWarning(new RequestContentLengthMismatchError()); + } + const socket = client[kSocket]; + const abort = (err) => { + if (request.aborted || request.completed) { + return; + } + util.errorRequest(client, request, err || new RequestAbortedError()); + util.destroy(body); + util.destroy(socket, new InformationalError("aborted")); + }; + try { + request.onConnect(abort); + } catch (err) { + util.errorRequest(client, request, err); + } + if (request.aborted) { + return false; + } + if (method === "HEAD") { + socket[kReset] = true; + } + if (upgrade || method === "CONNECT") { + socket[kReset] = true; + } + if (reset != null) { + socket[kReset] = reset; + } + if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) { + socket[kReset] = true; + } + if (blocking) { + socket[kBlocking] = true; + } + let header = `${method} ${path16} HTTP/1.1\r +`; + if (typeof host === "string") { + header += `host: ${host}\r +`; + } else { + header += client[kHostHeader]; + } + if (upgrade) { + header += `connection: upgrade\r +upgrade: ${upgrade}\r +`; + } else if (client[kPipelining] && !socket[kReset]) { + header += "connection: keep-alive\r\n"; + } else { + header += "connection: close\r\n"; + } + if (Array.isArray(headers)) { + for (let n = 0; n < headers.length; n += 2) { + const key = headers[n + 0]; + const val = headers[n + 1]; + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { + header += `${key}: ${val[i]}\r +`; + } + } else { + header += `${key}: ${val}\r +`; + } + } + } + if (channels.sendHeaders.hasSubscribers) { + channels.sendHeaders.publish({ request, headers: header, socket }); + } + if (!body || bodyLength === 0) { + writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload); + } else if (util.isBuffer(body)) { + writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload); + } else if (util.isBlobLike(body)) { + if (typeof body.stream === "function") { + writeIterable(abort, body.stream(), client, request, socket, contentLength, header, expectsPayload); + } else { + writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload); + } + } else if (util.isStream(body)) { + writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload); + } else if (util.isIterable(body)) { + writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload); + } else { + assert5(false); + } + return true; + } + function writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload) { + assert5(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); + let finished = false; + const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header }); + const onData = function(chunk) { + if (finished) { + return; + } + try { + if (!writer.write(chunk) && this.pause) { + this.pause(); + } + } catch (err) { + util.destroy(this, err); + } + }; + const onDrain = function() { + if (finished) { + return; + } + if (body.resume) { + body.resume(); + } + }; + const onClose = function() { + queueMicrotask(() => { + body.removeListener("error", onFinished); + }); + if (!finished) { + const err = new RequestAbortedError(); + queueMicrotask(() => onFinished(err)); + } + }; + const onFinished = function(err) { + if (finished) { + return; + } + finished = true; + assert5(socket.destroyed || socket[kWriting] && client[kRunning] <= 1); + socket.off("drain", onDrain).off("error", onFinished); + body.removeListener("data", onData).removeListener("end", onFinished).removeListener("close", onClose); + if (!err) { + try { + writer.end(); + } catch (er) { + err = er; + } + } + writer.destroy(err); + if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) { + util.destroy(body, err); + } else { + util.destroy(body); + } + }; + body.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onClose); + if (body.resume) { + body.resume(); + } + socket.on("drain", onDrain).on("error", onFinished); + if (body.errorEmitted ?? body.errored) { + setImmediate(() => onFinished(body.errored)); + } else if (body.endEmitted ?? body.readableEnded) { + setImmediate(() => onFinished(null)); + } + if (body.closeEmitted ?? body.closed) { + setImmediate(onClose); + } + } + function writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload) { + try { + if (!body) { + if (contentLength === 0) { + socket.write(`${header}content-length: 0\r +\r +`, "latin1"); + } else { + assert5(contentLength === null, "no body must not have content length"); + socket.write(`${header}\r +`, "latin1"); + } + } else if (util.isBuffer(body)) { + assert5(contentLength === body.byteLength, "buffer body must have content length"); + socket.cork(); + socket.write(`${header}content-length: ${contentLength}\r +\r +`, "latin1"); + socket.write(body); + socket.uncork(); + request.onBodySent(body); + if (!expectsPayload && request.reset !== false) { + socket[kReset] = true; + } + } + request.onRequestSent(); + client[kResume](); + } catch (err) { + abort(err); + } + } + async function writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload) { + assert5(contentLength === body.size, "blob body must have content length"); + try { + if (contentLength != null && contentLength !== body.size) { + throw new RequestContentLengthMismatchError(); + } + const buffer = Buffer.from(await body.arrayBuffer()); + socket.cork(); + socket.write(`${header}content-length: ${contentLength}\r +\r +`, "latin1"); + socket.write(buffer); + socket.uncork(); + request.onBodySent(buffer); + request.onRequestSent(); + if (!expectsPayload && request.reset !== false) { + socket[kReset] = true; + } + client[kResume](); + } catch (err) { + abort(err); + } + } + async function writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload) { + assert5(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); + let callback = null; + function onDrain() { + if (callback) { + const cb = callback; + callback = null; + cb(); + } + } + const waitForDrain = () => new Promise((resolve, reject) => { + assert5(callback === null); + if (socket[kError]) { + reject(socket[kError]); + } else { + callback = resolve; + } + }); + socket.on("close", onDrain).on("drain", onDrain); + const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header }); + try { + for await (const chunk of body) { + if (socket[kError]) { + throw socket[kError]; + } + if (!writer.write(chunk)) { + await waitForDrain(); + } + } + writer.end(); + } catch (err) { + writer.destroy(err); + } finally { + socket.off("close", onDrain).off("drain", onDrain); + } + } + var AsyncWriter = class { + constructor({ abort, socket, request, contentLength, client, expectsPayload, header }) { + this.socket = socket; + this.request = request; + this.contentLength = contentLength; + this.client = client; + this.bytesWritten = 0; + this.expectsPayload = expectsPayload; + this.header = header; + this.abort = abort; + socket[kWriting] = true; + } + write(chunk) { + const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this; + if (socket[kError]) { + throw socket[kError]; + } + if (socket.destroyed) { + return false; + } + const len = Buffer.byteLength(chunk); + if (!len) { + return true; + } + if (contentLength !== null && bytesWritten + len > contentLength) { + if (client[kStrictContentLength]) { + throw new RequestContentLengthMismatchError(); + } + process.emitWarning(new RequestContentLengthMismatchError()); + } + socket.cork(); + if (bytesWritten === 0) { + if (!expectsPayload && request.reset !== false) { + socket[kReset] = true; + } + if (contentLength === null) { + socket.write(`${header}transfer-encoding: chunked\r +`, "latin1"); + } else { + socket.write(`${header}content-length: ${contentLength}\r +\r +`, "latin1"); + } + } + if (contentLength === null) { + socket.write(`\r +${len.toString(16)}\r +`, "latin1"); + } + this.bytesWritten += len; + const ret = socket.write(chunk); + socket.uncork(); + request.onBodySent(chunk); + if (!ret) { + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { + if (socket[kParser].timeout.refresh) { + socket[kParser].timeout.refresh(); + } + } + } + return ret; + } + end() { + const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this; + request.onRequestSent(); + socket[kWriting] = false; + if (socket[kError]) { + throw socket[kError]; + } + if (socket.destroyed) { + return; + } + if (bytesWritten === 0) { + if (expectsPayload) { + socket.write(`${header}content-length: 0\r +\r +`, "latin1"); + } else { + socket.write(`${header}\r +`, "latin1"); + } + } else if (contentLength === null) { + socket.write("\r\n0\r\n\r\n", "latin1"); + } + if (contentLength !== null && bytesWritten !== contentLength) { + if (client[kStrictContentLength]) { + throw new RequestContentLengthMismatchError(); + } else { + process.emitWarning(new RequestContentLengthMismatchError()); + } + } + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { + if (socket[kParser].timeout.refresh) { + socket[kParser].timeout.refresh(); + } + } + client[kResume](); + } + destroy(err) { + const { socket, client, abort } = this; + socket[kWriting] = false; + if (err) { + assert5(client[kRunning] <= 1, "pipeline should only contain this request"); + abort(err); + } + } + }; + module2.exports = connectH1; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/client-h2.js +var require_client_h2 = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/client-h2.js"(exports2, module2) { + "use strict"; + var assert5 = require("node:assert"); + var { pipeline } = require("node:stream"); + var util = require_util(); + var { + RequestContentLengthMismatchError, + RequestAbortedError, + SocketError, + InformationalError + } = require_errors(); + var { + kUrl, + kReset, + kClient, + kRunning, + kPending, + kQueue, + kPendingIdx, + kRunningIdx, + kError, + kSocket, + kStrictContentLength, + kOnError, + kMaxConcurrentStreams, + kHTTP2Session, + kResume, + kSize, + kHTTPContext + } = require_symbols(); + var kOpenStreams = Symbol("open streams"); + var extractBody; + var h2ExperimentalWarned = false; + var http2; + try { + http2 = require("node:http2"); + } catch { + http2 = { constants: {} }; + } + var { + constants: { + HTTP2_HEADER_AUTHORITY, + HTTP2_HEADER_METHOD, + HTTP2_HEADER_PATH, + HTTP2_HEADER_SCHEME, + HTTP2_HEADER_CONTENT_LENGTH, + HTTP2_HEADER_EXPECT, + HTTP2_HEADER_STATUS + } + } = http2; + function parseH2Headers(headers) { + const result = []; + for (const [name2, value] of Object.entries(headers)) { + if (Array.isArray(value)) { + for (const subvalue of value) { + result.push(Buffer.from(name2), Buffer.from(subvalue)); + } + } else { + result.push(Buffer.from(name2), Buffer.from(value)); + } + } + return result; + } + async function connectH2(client, socket) { + client[kSocket] = socket; + if (!h2ExperimentalWarned) { + h2ExperimentalWarned = true; + process.emitWarning("H2 support is experimental, expect them to change at any time.", { + code: "UNDICI-H2" + }); + } + const session = http2.connect(client[kUrl], { + createConnection: () => socket, + peerMaxConcurrentStreams: client[kMaxConcurrentStreams] + }); + session[kOpenStreams] = 0; + session[kClient] = client; + session[kSocket] = socket; + util.addListener(session, "error", onHttp2SessionError); + util.addListener(session, "frameError", onHttp2FrameError); + util.addListener(session, "end", onHttp2SessionEnd); + util.addListener(session, "goaway", onHTTP2GoAway); + util.addListener(session, "close", function() { + const { [kClient]: client2 } = this; + const { [kSocket]: socket2 } = client2; + const err = this[kSocket][kError] || this[kError] || new SocketError("closed", util.getSocketInfo(socket2)); + client2[kHTTP2Session] = null; + if (client2.destroyed) { + assert5(client2[kPending] === 0); + const requests = client2[kQueue].splice(client2[kRunningIdx]); + for (let i = 0; i < requests.length; i++) { + const request = requests[i]; + util.errorRequest(client2, request, err); + } + } + }); + session.unref(); + client[kHTTP2Session] = session; + socket[kHTTP2Session] = session; + util.addListener(socket, "error", function(err) { + assert5(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + this[kError] = err; + this[kClient][kOnError](err); + }); + util.addListener(socket, "end", function() { + util.destroy(this, new SocketError("other side closed", util.getSocketInfo(this))); + }); + util.addListener(socket, "close", function() { + const err = this[kError] || new SocketError("closed", util.getSocketInfo(this)); + client[kSocket] = null; + if (this[kHTTP2Session] != null) { + this[kHTTP2Session].destroy(err); + } + client[kPendingIdx] = client[kRunningIdx]; + assert5(client[kRunning] === 0); + client.emit("disconnect", client[kUrl], [client], err); + client[kResume](); + }); + let closed = false; + socket.on("close", () => { + closed = true; + }); + return { + version: "h2", + defaultPipelining: Infinity, + write(...args) { + return writeH2(client, ...args); + }, + resume() { + resumeH2(client); + }, + destroy(err, callback) { + if (closed) { + queueMicrotask(callback); + } else { + socket.destroy(err).on("close", callback); + } + }, + get destroyed() { + return socket.destroyed; + }, + busy() { + return false; + } + }; + } + function resumeH2(client) { + const socket = client[kSocket]; + if (socket?.destroyed === false) { + if (client[kSize] === 0 && client[kMaxConcurrentStreams] === 0) { + socket.unref(); + client[kHTTP2Session].unref(); + } else { + socket.ref(); + client[kHTTP2Session].ref(); + } + } + } + function onHttp2SessionError(err) { + assert5(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + this[kSocket][kError] = err; + this[kClient][kOnError](err); + } + function onHttp2FrameError(type, code2, id) { + if (id === 0) { + const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code2}`); + this[kSocket][kError] = err; + this[kClient][kOnError](err); + } + } + function onHttp2SessionEnd() { + const err = new SocketError("other side closed", util.getSocketInfo(this[kSocket])); + this.destroy(err); + util.destroy(this[kSocket], err); + } + function onHTTP2GoAway(code2) { + const err = this[kError] || new SocketError(`HTTP/2: "GOAWAY" frame received with code ${code2}`, util.getSocketInfo(this)); + const client = this[kClient]; + client[kSocket] = null; + client[kHTTPContext] = null; + if (this[kHTTP2Session] != null) { + this[kHTTP2Session].destroy(err); + this[kHTTP2Session] = null; + } + util.destroy(this[kSocket], err); + if (client[kRunningIdx] < client[kQueue].length) { + const request = client[kQueue][client[kRunningIdx]]; + client[kQueue][client[kRunningIdx]++] = null; + util.errorRequest(client, request, err); + client[kPendingIdx] = client[kRunningIdx]; + } + assert5(client[kRunning] === 0); + client.emit("disconnect", client[kUrl], [client], err); + client[kResume](); + } + function shouldSendContentLength(method) { + return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; + } + function writeH2(client, request) { + const session = client[kHTTP2Session]; + const { method, path: path16, host, upgrade, expectContinue, signal, headers: reqHeaders } = request; + let { body } = request; + if (upgrade) { + util.errorRequest(client, request, new Error("Upgrade not supported for H2")); + return false; + } + const headers = {}; + for (let n = 0; n < reqHeaders.length; n += 2) { + const key = reqHeaders[n + 0]; + const val = reqHeaders[n + 1]; + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { + if (headers[key]) { + headers[key] += `,${val[i]}`; + } else { + headers[key] = val[i]; + } + } + } else { + headers[key] = val; + } + } + let stream; + const { hostname, port } = client[kUrl]; + headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ""}`; + headers[HTTP2_HEADER_METHOD] = method; + const abort = (err) => { + if (request.aborted || request.completed) { + return; + } + err = err || new RequestAbortedError(); + util.errorRequest(client, request, err); + if (stream != null) { + util.destroy(stream, err); + } + util.destroy(body, err); + client[kQueue][client[kRunningIdx]++] = null; + client[kResume](); + }; + try { + request.onConnect(abort); + } catch (err) { + util.errorRequest(client, request, err); + } + if (request.aborted) { + return false; + } + if (method === "CONNECT") { + session.ref(); + stream = session.request(headers, { endStream: false, signal }); + if (stream.id && !stream.pending) { + request.onUpgrade(null, null, stream); + ++session[kOpenStreams]; + client[kQueue][client[kRunningIdx]++] = null; + } else { + stream.once("ready", () => { + request.onUpgrade(null, null, stream); + ++session[kOpenStreams]; + client[kQueue][client[kRunningIdx]++] = null; + }); + } + stream.once("close", () => { + session[kOpenStreams] -= 1; + if (session[kOpenStreams] === 0) session.unref(); + }); + return true; + } + headers[HTTP2_HEADER_PATH] = path16; + headers[HTTP2_HEADER_SCHEME] = "https"; + const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; + if (body && typeof body.read === "function") { + body.read(0); + } + let contentLength = util.bodyLength(body); + if (util.isFormDataLike(body)) { + extractBody ??= require_body().extractBody; + const [bodyStream, contentType] = extractBody(body); + headers["content-type"] = contentType; + body = bodyStream.stream; + contentLength = bodyStream.length; + } + if (contentLength == null) { + contentLength = request.contentLength; + } + if (contentLength === 0 || !expectsPayload) { + contentLength = null; + } + if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) { + if (client[kStrictContentLength]) { + util.errorRequest(client, request, new RequestContentLengthMismatchError()); + return false; + } + process.emitWarning(new RequestContentLengthMismatchError()); + } + if (contentLength != null) { + assert5(body, "no body must not have content length"); + headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`; + } + session.ref(); + const shouldEndStream = method === "GET" || method === "HEAD" || body === null; + if (expectContinue) { + headers[HTTP2_HEADER_EXPECT] = "100-continue"; + stream = session.request(headers, { endStream: shouldEndStream, signal }); + stream.once("continue", writeBodyH2); + } else { + stream = session.request(headers, { + endStream: shouldEndStream, + signal + }); + writeBodyH2(); + } + ++session[kOpenStreams]; + stream.once("response", (headers2) => { + const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers2; + request.onResponseStarted(); + if (request.aborted) { + const err = new RequestAbortedError(); + util.errorRequest(client, request, err); + util.destroy(stream, err); + return; + } + if (request.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), "") === false) { + stream.pause(); + } + stream.on("data", (chunk) => { + if (request.onData(chunk) === false) { + stream.pause(); + } + }); + }); + stream.once("end", () => { + if (stream.state?.state == null || stream.state.state < 6) { + request.onComplete([]); + } + if (session[kOpenStreams] === 0) { + session.unref(); + } + abort(new InformationalError("HTTP/2: stream half-closed (remote)")); + client[kQueue][client[kRunningIdx]++] = null; + client[kPendingIdx] = client[kRunningIdx]; + client[kResume](); + }); + stream.once("close", () => { + session[kOpenStreams] -= 1; + if (session[kOpenStreams] === 0) { + session.unref(); + } + }); + stream.once("error", function(err) { + abort(err); + }); + stream.once("frameError", (type, code2) => { + abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code2}`)); + }); + return true; + function writeBodyH2() { + if (!body || contentLength === 0) { + writeBuffer( + abort, + stream, + null, + client, + request, + client[kSocket], + contentLength, + expectsPayload + ); + } else if (util.isBuffer(body)) { + writeBuffer( + abort, + stream, + body, + client, + request, + client[kSocket], + contentLength, + expectsPayload + ); + } else if (util.isBlobLike(body)) { + if (typeof body.stream === "function") { + writeIterable( + abort, + stream, + body.stream(), + client, + request, + client[kSocket], + contentLength, + expectsPayload + ); + } else { + writeBlob( + abort, + stream, + body, + client, + request, + client[kSocket], + contentLength, + expectsPayload + ); + } + } else if (util.isStream(body)) { + writeStream( + abort, + client[kSocket], + expectsPayload, + stream, + body, + client, + request, + contentLength + ); + } else if (util.isIterable(body)) { + writeIterable( + abort, + stream, + body, + client, + request, + client[kSocket], + contentLength, + expectsPayload + ); + } else { + assert5(false); + } + } + } + function writeBuffer(abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { + try { + if (body != null && util.isBuffer(body)) { + assert5(contentLength === body.byteLength, "buffer body must have content length"); + h2stream.cork(); + h2stream.write(body); + h2stream.uncork(); + h2stream.end(); + request.onBodySent(body); + } + if (!expectsPayload) { + socket[kReset] = true; + } + request.onRequestSent(); + client[kResume](); + } catch (error) { + abort(error); + } + } + function writeStream(abort, socket, expectsPayload, h2stream, body, client, request, contentLength) { + assert5(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); + const pipe = pipeline( + body, + h2stream, + (err) => { + if (err) { + util.destroy(pipe, err); + abort(err); + } else { + util.removeAllListeners(pipe); + request.onRequestSent(); + if (!expectsPayload) { + socket[kReset] = true; + } + client[kResume](); + } + } + ); + util.addListener(pipe, "data", onPipeData); + function onPipeData(chunk) { + request.onBodySent(chunk); + } + } + async function writeBlob(abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { + assert5(contentLength === body.size, "blob body must have content length"); + try { + if (contentLength != null && contentLength !== body.size) { + throw new RequestContentLengthMismatchError(); + } + const buffer = Buffer.from(await body.arrayBuffer()); + h2stream.cork(); + h2stream.write(buffer); + h2stream.uncork(); + h2stream.end(); + request.onBodySent(buffer); + request.onRequestSent(); + if (!expectsPayload) { + socket[kReset] = true; + } + client[kResume](); + } catch (err) { + abort(err); + } + } + async function writeIterable(abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { + assert5(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); + let callback = null; + function onDrain() { + if (callback) { + const cb = callback; + callback = null; + cb(); + } + } + const waitForDrain = () => new Promise((resolve, reject) => { + assert5(callback === null); + if (socket[kError]) { + reject(socket[kError]); + } else { + callback = resolve; + } + }); + h2stream.on("close", onDrain).on("drain", onDrain); + try { + for await (const chunk of body) { + if (socket[kError]) { + throw socket[kError]; + } + const res = h2stream.write(chunk); + request.onBodySent(chunk); + if (!res) { + await waitForDrain(); + } + } + h2stream.end(); + request.onRequestSent(); + if (!expectsPayload) { + socket[kReset] = true; + } + client[kResume](); + } catch (err) { + abort(err); + } finally { + h2stream.off("close", onDrain).off("drain", onDrain); + } + } + module2.exports = connectH2; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/handler/redirect-handler.js +var require_redirect_handler = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/handler/redirect-handler.js"(exports2, module2) { + "use strict"; + var util = require_util(); + var { kBodyUsed } = require_symbols(); + var assert5 = require("node:assert"); + var { InvalidArgumentError } = require_errors(); + var EE3 = require("node:events"); + var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; + var kBody = Symbol("body"); + var BodyAsyncIterable = class { + constructor(body) { + this[kBody] = body; + this[kBodyUsed] = false; + } + async *[Symbol.asyncIterator]() { + assert5(!this[kBodyUsed], "disturbed"); + this[kBodyUsed] = true; + yield* this[kBody]; + } + }; + var RedirectHandler = class { + constructor(dispatch, maxRedirections, opts, handler) { + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { + throw new InvalidArgumentError("maxRedirections must be a positive number"); + } + util.validateHandler(handler, opts.method, opts.upgrade); + this.dispatch = dispatch; + this.location = null; + this.abort = null; + this.opts = { ...opts, maxRedirections: 0 }; + this.maxRedirections = maxRedirections; + this.handler = handler; + this.history = []; + this.redirectionLimitReached = false; + if (util.isStream(this.opts.body)) { + if (util.bodyLength(this.opts.body) === 0) { + this.opts.body.on("data", function() { + assert5(false); + }); + } + if (typeof this.opts.body.readableDidRead !== "boolean") { + this.opts.body[kBodyUsed] = false; + EE3.prototype.on.call(this.opts.body, "data", function() { + this[kBodyUsed] = true; + }); + } + } else if (this.opts.body && typeof this.opts.body.pipeTo === "function") { + this.opts.body = new BodyAsyncIterable(this.opts.body); + } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util.isIterable(this.opts.body)) { + this.opts.body = new BodyAsyncIterable(this.opts.body); + } + } + onConnect(abort) { + this.abort = abort; + this.handler.onConnect(abort, { history: this.history }); + } + onUpgrade(statusCode, headers, socket) { + this.handler.onUpgrade(statusCode, headers, socket); + } + onError(error) { + this.handler.onError(error); + } + onHeaders(statusCode, headers, resume, statusText) { + this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); + if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) { + if (this.request) { + this.request.abort(new Error("max redirects")); + } + this.redirectionLimitReached = true; + this.abort(new Error("max redirects")); + return; + } + if (this.opts.origin) { + this.history.push(new URL(this.opts.path, this.opts.origin)); + } + if (!this.location) { + return this.handler.onHeaders(statusCode, headers, resume, statusText); + } + const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); + const path16 = search ? `${pathname}${search}` : pathname; + this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); + this.opts.path = path16; + this.opts.origin = origin; + this.opts.maxRedirections = 0; + this.opts.query = null; + if (statusCode === 303 && this.opts.method !== "HEAD") { + this.opts.method = "GET"; + this.opts.body = null; + } + } + onData(chunk) { + if (this.location) { + } else { + return this.handler.onData(chunk); + } + } + onComplete(trailers) { + if (this.location) { + this.location = null; + this.abort = null; + this.dispatch(this.opts, this); + } else { + this.handler.onComplete(trailers); + } + } + onBodySent(chunk) { + if (this.handler.onBodySent) { + this.handler.onBodySent(chunk); + } + } + }; + function parseLocation(statusCode, headers) { + if (redirectableStatusCodes.indexOf(statusCode) === -1) { + return null; + } + for (let i = 0; i < headers.length; i += 2) { + if (headers[i].length === 8 && util.headerNameToString(headers[i]) === "location") { + return headers[i + 1]; + } + } + } + function shouldRemoveHeader(header, removeContent, unknownOrigin) { + if (header.length === 4) { + return util.headerNameToString(header) === "host"; + } + if (removeContent && util.headerNameToString(header).startsWith("content-")) { + return true; + } + if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) { + const name2 = util.headerNameToString(header); + return name2 === "authorization" || name2 === "cookie" || name2 === "proxy-authorization"; + } + return false; + } + function cleanRequestHeaders(headers, removeContent, unknownOrigin) { + const ret = []; + if (Array.isArray(headers)) { + for (let i = 0; i < headers.length; i += 2) { + if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) { + ret.push(headers[i], headers[i + 1]); + } + } + } else if (headers && typeof headers === "object") { + for (const key of Object.keys(headers)) { + if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) { + ret.push(key, headers[key]); + } + } + } else { + assert5(headers == null, "headers must be an object or an array"); + } + return ret; + } + module2.exports = RedirectHandler; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/interceptor/redirect-interceptor.js +var require_redirect_interceptor = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/interceptor/redirect-interceptor.js"(exports2, module2) { + "use strict"; + var RedirectHandler = require_redirect_handler(); + function createRedirectInterceptor({ maxRedirections: defaultMaxRedirections }) { + return (dispatch) => { + return function Intercept(opts, handler) { + const { maxRedirections = defaultMaxRedirections } = opts; + if (!maxRedirections) { + return dispatch(opts, handler); + } + const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler); + opts = { ...opts, maxRedirections: 0 }; + return dispatch(opts, redirectHandler); + }; + }; + } + module2.exports = createRedirectInterceptor; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/client.js +var require_client = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/client.js"(exports2, module2) { + "use strict"; + var assert5 = require("node:assert"); + var net = require("node:net"); + var http = require("node:http"); + var util = require_util(); + var { channels } = require_diagnostics(); + var Request = require_request(); + var DispatcherBase = require_dispatcher_base(); + var { + InvalidArgumentError, + InformationalError, + ClientDestroyedError + } = require_errors(); + var buildConnector = require_connect(); + var { + kUrl, + kServerName, + kClient, + kBusy, + kConnect, + kResuming, + kRunning, + kPending, + kSize, + kQueue, + kConnected, + kConnecting, + kNeedDrain, + kKeepAliveDefaultTimeout, + kHostHeader, + kPendingIdx, + kRunningIdx, + kError, + kPipelining, + kKeepAliveTimeoutValue, + kMaxHeadersSize, + kKeepAliveMaxTimeout, + kKeepAliveTimeoutThreshold, + kHeadersTimeout, + kBodyTimeout, + kStrictContentLength, + kConnector, + kMaxRedirections, + kMaxRequests, + kCounter, + kClose, + kDestroy, + kDispatch, + kInterceptors, + kLocalAddress, + kMaxResponseSize, + kOnError, + kHTTPContext, + kMaxConcurrentStreams, + kResume + } = require_symbols(); + var connectH1 = require_client_h1(); + var connectH2 = require_client_h2(); + var deprecatedInterceptorWarned = false; + var kClosedResolve = Symbol("kClosedResolve"); + var noop3 = () => { + }; + function getPipelining(client) { + return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1; + } + var Client = class extends DispatcherBase { + /** + * + * @param {string|URL} url + * @param {import('../../types/client.js').Client.Options} options + */ + constructor(url, { + interceptors, + maxHeaderSize, + headersTimeout, + socketTimeout, + requestTimeout, + connectTimeout, + bodyTimeout, + idleTimeout, + keepAlive, + keepAliveTimeout, + maxKeepAliveTimeout, + keepAliveMaxTimeout, + keepAliveTimeoutThreshold, + socketPath, + pipelining, + tls, + strictContentLength, + maxCachedSessions, + maxRedirections, + connect: connect2, + maxRequestsPerClient, + localAddress, + maxResponseSize, + autoSelectFamily, + autoSelectFamilyAttemptTimeout, + // h2 + maxConcurrentStreams, + allowH2 + } = {}) { + super(); + if (keepAlive !== void 0) { + throw new InvalidArgumentError("unsupported keepAlive, use pipelining=0 instead"); + } + if (socketTimeout !== void 0) { + throw new InvalidArgumentError("unsupported socketTimeout, use headersTimeout & bodyTimeout instead"); + } + if (requestTimeout !== void 0) { + throw new InvalidArgumentError("unsupported requestTimeout, use headersTimeout & bodyTimeout instead"); + } + if (idleTimeout !== void 0) { + throw new InvalidArgumentError("unsupported idleTimeout, use keepAliveTimeout instead"); + } + if (maxKeepAliveTimeout !== void 0) { + throw new InvalidArgumentError("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead"); + } + if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) { + throw new InvalidArgumentError("invalid maxHeaderSize"); + } + if (socketPath != null && typeof socketPath !== "string") { + throw new InvalidArgumentError("invalid socketPath"); + } + if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) { + throw new InvalidArgumentError("invalid connectTimeout"); + } + if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) { + throw new InvalidArgumentError("invalid keepAliveTimeout"); + } + if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) { + throw new InvalidArgumentError("invalid keepAliveMaxTimeout"); + } + if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) { + throw new InvalidArgumentError("invalid keepAliveTimeoutThreshold"); + } + if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) { + throw new InvalidArgumentError("headersTimeout must be a positive integer or zero"); + } + if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) { + throw new InvalidArgumentError("bodyTimeout must be a positive integer or zero"); + } + if (connect2 != null && typeof connect2 !== "function" && typeof connect2 !== "object") { + throw new InvalidArgumentError("connect must be a function or an object"); + } + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { + throw new InvalidArgumentError("maxRedirections must be a positive number"); + } + if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) { + throw new InvalidArgumentError("maxRequestsPerClient must be a positive number"); + } + if (localAddress != null && (typeof localAddress !== "string" || net.isIP(localAddress) === 0)) { + throw new InvalidArgumentError("localAddress must be valid string IP address"); + } + if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) { + throw new InvalidArgumentError("maxResponseSize must be a positive number"); + } + if (autoSelectFamilyAttemptTimeout != null && (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)) { + throw new InvalidArgumentError("autoSelectFamilyAttemptTimeout must be a positive number"); + } + if (allowH2 != null && typeof allowH2 !== "boolean") { + throw new InvalidArgumentError("allowH2 must be a valid boolean value"); + } + if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== "number" || maxConcurrentStreams < 1)) { + throw new InvalidArgumentError("maxConcurrentStreams must be a positive integer, greater than 0"); + } + if (typeof connect2 !== "function") { + connect2 = buildConnector({ + ...tls, + maxCachedSessions, + allowH2, + socketPath, + timeout: connectTimeout, + ...autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, + ...connect2 + }); + } + if (interceptors?.Client && Array.isArray(interceptors.Client)) { + this[kInterceptors] = interceptors.Client; + if (!deprecatedInterceptorWarned) { + deprecatedInterceptorWarned = true; + process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.", { + code: "UNDICI-CLIENT-INTERCEPTOR-DEPRECATED" + }); + } + } else { + this[kInterceptors] = [createRedirectInterceptor({ maxRedirections })]; + } + this[kUrl] = util.parseOrigin(url); + this[kConnector] = connect2; + this[kPipelining] = pipelining != null ? pipelining : 1; + this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize; + this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout; + this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 6e5 : keepAliveMaxTimeout; + this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold; + this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]; + this[kServerName] = null; + this[kLocalAddress] = localAddress != null ? localAddress : null; + this[kResuming] = 0; + this[kNeedDrain] = 0; + this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ""}\r +`; + this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 3e5; + this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 3e5; + this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength; + this[kMaxRedirections] = maxRedirections; + this[kMaxRequests] = maxRequestsPerClient; + this[kClosedResolve] = null; + this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1; + this[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100; + this[kHTTPContext] = null; + this[kQueue] = []; + this[kRunningIdx] = 0; + this[kPendingIdx] = 0; + this[kResume] = (sync) => resume(this, sync); + this[kOnError] = (err) => onError(this, err); + } + get pipelining() { + return this[kPipelining]; + } + set pipelining(value) { + this[kPipelining] = value; + this[kResume](true); + } + get [kPending]() { + return this[kQueue].length - this[kPendingIdx]; + } + get [kRunning]() { + return this[kPendingIdx] - this[kRunningIdx]; + } + get [kSize]() { + return this[kQueue].length - this[kRunningIdx]; + } + get [kConnected]() { + return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed; + } + get [kBusy]() { + return Boolean( + this[kHTTPContext]?.busy(null) || this[kSize] >= (getPipelining(this) || 1) || this[kPending] > 0 + ); + } + /* istanbul ignore: only used for test */ + [kConnect](cb) { + connect(this); + this.once("connect", cb); + } + [kDispatch](opts, handler) { + const origin = opts.origin || this[kUrl].origin; + const request = new Request(origin, opts, handler); + this[kQueue].push(request); + if (this[kResuming]) { + } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) { + this[kResuming] = 1; + queueMicrotask(() => resume(this)); + } else { + this[kResume](true); + } + if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) { + this[kNeedDrain] = 2; + } + return this[kNeedDrain] < 2; + } + async [kClose]() { + return new Promise((resolve) => { + if (this[kSize]) { + this[kClosedResolve] = resolve; + } else { + resolve(null); + } + }); + } + async [kDestroy](err) { + return new Promise((resolve) => { + const requests = this[kQueue].splice(this[kPendingIdx]); + for (let i = 0; i < requests.length; i++) { + const request = requests[i]; + util.errorRequest(this, request, err); + } + const callback = () => { + if (this[kClosedResolve]) { + this[kClosedResolve](); + this[kClosedResolve] = null; + } + resolve(null); + }; + if (this[kHTTPContext]) { + this[kHTTPContext].destroy(err, callback); + this[kHTTPContext] = null; + } else { + queueMicrotask(callback); + } + this[kResume](); + }); + } + }; + var createRedirectInterceptor = require_redirect_interceptor(); + function onError(client, err) { + if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") { + assert5(client[kPendingIdx] === client[kRunningIdx]); + const requests = client[kQueue].splice(client[kRunningIdx]); + for (let i = 0; i < requests.length; i++) { + const request = requests[i]; + util.errorRequest(client, request, err); + } + assert5(client[kSize] === 0); + } + } + async function connect(client) { + assert5(!client[kConnecting]); + assert5(!client[kHTTPContext]); + let { host, hostname, protocol, port } = client[kUrl]; + if (hostname[0] === "[") { + const idx = hostname.indexOf("]"); + assert5(idx !== -1); + const ip = hostname.substring(1, idx); + assert5(net.isIP(ip)); + hostname = ip; + } + client[kConnecting] = true; + if (channels.beforeConnect.hasSubscribers) { + channels.beforeConnect.publish({ + connectParams: { + host, + hostname, + protocol, + port, + version: client[kHTTPContext]?.version, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector] + }); + } + try { + const socket = await new Promise((resolve, reject) => { + client[kConnector]({ + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, (err, socket2) => { + if (err) { + reject(err); + } else { + resolve(socket2); + } + }); + }); + if (client.destroyed) { + util.destroy(socket.on("error", noop3), new ClientDestroyedError()); + return; + } + assert5(socket); + try { + client[kHTTPContext] = socket.alpnProtocol === "h2" ? await connectH2(client, socket) : await connectH1(client, socket); + } catch (err) { + socket.destroy().on("error", noop3); + throw err; + } + client[kConnecting] = false; + socket[kCounter] = 0; + socket[kMaxRequests] = client[kMaxRequests]; + socket[kClient] = client; + socket[kError] = null; + if (channels.connected.hasSubscribers) { + channels.connected.publish({ + connectParams: { + host, + hostname, + protocol, + port, + version: client[kHTTPContext]?.version, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector], + socket + }); + } + client.emit("connect", client[kUrl], [client]); + } catch (err) { + if (client.destroyed) { + return; + } + client[kConnecting] = false; + if (channels.connectError.hasSubscribers) { + channels.connectError.publish({ + connectParams: { + host, + hostname, + protocol, + port, + version: client[kHTTPContext]?.version, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector], + error: err + }); + } + if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { + assert5(client[kRunning] === 0); + while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { + const request = client[kQueue][client[kPendingIdx]++]; + util.errorRequest(client, request, err); + } + } else { + onError(client, err); + } + client.emit("connectionError", client[kUrl], [client], err); + } + client[kResume](); + } + function emitDrain(client) { + client[kNeedDrain] = 0; + client.emit("drain", client[kUrl], [client]); + } + function resume(client, sync) { + if (client[kResuming] === 2) { + return; + } + client[kResuming] = 2; + _resume(client, sync); + client[kResuming] = 0; + if (client[kRunningIdx] > 256) { + client[kQueue].splice(0, client[kRunningIdx]); + client[kPendingIdx] -= client[kRunningIdx]; + client[kRunningIdx] = 0; + } + } + function _resume(client, sync) { + while (true) { + if (client.destroyed) { + assert5(client[kPending] === 0); + return; + } + if (client[kClosedResolve] && !client[kSize]) { + client[kClosedResolve](); + client[kClosedResolve] = null; + return; + } + if (client[kHTTPContext]) { + client[kHTTPContext].resume(); + } + if (client[kBusy]) { + client[kNeedDrain] = 2; + } else if (client[kNeedDrain] === 2) { + if (sync) { + client[kNeedDrain] = 1; + queueMicrotask(() => emitDrain(client)); + } else { + emitDrain(client); + } + continue; + } + if (client[kPending] === 0) { + return; + } + if (client[kRunning] >= (getPipelining(client) || 1)) { + return; + } + const request = client[kQueue][client[kPendingIdx]]; + if (client[kUrl].protocol === "https:" && client[kServerName] !== request.servername) { + if (client[kRunning] > 0) { + return; + } + client[kServerName] = request.servername; + client[kHTTPContext]?.destroy(new InformationalError("servername changed"), () => { + client[kHTTPContext] = null; + resume(client); + }); + } + if (client[kConnecting]) { + return; + } + if (!client[kHTTPContext]) { + connect(client); + return; + } + if (client[kHTTPContext].destroyed) { + return; + } + if (client[kHTTPContext].busy(request)) { + return; + } + if (!request.aborted && client[kHTTPContext].write(request)) { + client[kPendingIdx]++; + } else { + client[kQueue].splice(client[kPendingIdx], 1); + } + } + } + module2.exports = Client; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/pool.js +var require_pool = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/pool.js"(exports2, module2) { + "use strict"; + var { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kGetDispatcher + } = require_pool_base(); + var Client = require_client(); + var { + InvalidArgumentError + } = require_errors(); + var util = require_util(); + var { kUrl, kInterceptors } = require_symbols(); + var buildConnector = require_connect(); + var kOptions = Symbol("options"); + var kConnections = Symbol("connections"); + var kFactory = Symbol("factory"); + function defaultFactory(origin, opts) { + return new Client(origin, opts); + } + var Pool = class extends PoolBase { + constructor(origin, { + connections, + factory = defaultFactory, + connect, + connectTimeout, + tls, + maxCachedSessions, + socketPath, + autoSelectFamily, + autoSelectFamilyAttemptTimeout, + allowH2, + ...options + } = {}) { + super(); + if (connections != null && (!Number.isFinite(connections) || connections < 0)) { + throw new InvalidArgumentError("invalid connections"); + } + if (typeof factory !== "function") { + throw new InvalidArgumentError("factory must be a function."); + } + if (connect != null && typeof connect !== "function" && typeof connect !== "object") { + throw new InvalidArgumentError("connect must be a function or an object"); + } + if (typeof connect !== "function") { + connect = buildConnector({ + ...tls, + maxCachedSessions, + allowH2, + socketPath, + timeout: connectTimeout, + ...autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, + ...connect + }); + } + this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool) ? options.interceptors.Pool : []; + this[kConnections] = connections || null; + this[kUrl] = util.parseOrigin(origin); + this[kOptions] = { ...util.deepClone(options), connect, allowH2 }; + this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; + this[kFactory] = factory; + this.on("connectionError", (origin2, targets, error) => { + for (const target of targets) { + const idx = this[kClients].indexOf(target); + if (idx !== -1) { + this[kClients].splice(idx, 1); + } + } + }); + } + [kGetDispatcher]() { + for (const client of this[kClients]) { + if (!client[kNeedDrain]) { + return client; + } + } + if (!this[kConnections] || this[kClients].length < this[kConnections]) { + const dispatcher = this[kFactory](this[kUrl], this[kOptions]); + this[kAddClient](dispatcher); + return dispatcher; + } + } + }; + module2.exports = Pool; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/agent.js +var require_agent = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/agent.js"(exports2, module2) { + "use strict"; + var { InvalidArgumentError } = require_errors(); + var { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require_symbols(); + var DispatcherBase = require_dispatcher_base(); + var Pool = require_pool(); + var Client = require_client(); + var util = require_util(); + var createRedirectInterceptor = require_redirect_interceptor(); + var kOnConnect = Symbol("onConnect"); + var kOnDisconnect = Symbol("onDisconnect"); + var kOnConnectionError = Symbol("onConnectionError"); + var kMaxRedirections = Symbol("maxRedirections"); + var kOnDrain = Symbol("onDrain"); + var kFactory = Symbol("factory"); + var kOptions = Symbol("options"); + function defaultFactory(origin, opts) { + return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); + } + var Agent = class extends DispatcherBase { + constructor({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { + super(); + if (typeof factory !== "function") { + throw new InvalidArgumentError("factory must be a function."); + } + if (connect != null && typeof connect !== "function" && typeof connect !== "object") { + throw new InvalidArgumentError("connect must be a function or an object"); + } + if (!Number.isInteger(maxRedirections) || maxRedirections < 0) { + throw new InvalidArgumentError("maxRedirections must be a positive number"); + } + if (connect && typeof connect !== "function") { + connect = { ...connect }; + } + this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent) ? options.interceptors.Agent : [createRedirectInterceptor({ maxRedirections })]; + this[kOptions] = { ...util.deepClone(options), connect }; + this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; + this[kMaxRedirections] = maxRedirections; + this[kFactory] = factory; + this[kClients] = /* @__PURE__ */ new Map(); + this[kOnDrain] = (origin, targets) => { + this.emit("drain", origin, [this, ...targets]); + }; + this[kOnConnect] = (origin, targets) => { + this.emit("connect", origin, [this, ...targets]); + }; + this[kOnDisconnect] = (origin, targets, err) => { + this.emit("disconnect", origin, [this, ...targets], err); + }; + this[kOnConnectionError] = (origin, targets, err) => { + this.emit("connectionError", origin, [this, ...targets], err); + }; + } + get [kRunning]() { + let ret = 0; + for (const client of this[kClients].values()) { + ret += client[kRunning]; + } + return ret; + } + [kDispatch](opts, handler) { + let key; + if (opts.origin && (typeof opts.origin === "string" || opts.origin instanceof URL)) { + key = String(opts.origin); + } else { + throw new InvalidArgumentError("opts.origin must be a non-empty string or URL."); + } + let dispatcher = this[kClients].get(key); + if (!dispatcher) { + dispatcher = this[kFactory](opts.origin, this[kOptions]).on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]); + this[kClients].set(key, dispatcher); + } + return dispatcher.dispatch(opts, handler); + } + async [kClose]() { + const closePromises = []; + for (const client of this[kClients].values()) { + closePromises.push(client.close()); + } + this[kClients].clear(); + await Promise.all(closePromises); + } + async [kDestroy](err) { + const destroyPromises = []; + for (const client of this[kClients].values()) { + destroyPromises.push(client.destroy(err)); + } + this[kClients].clear(); + await Promise.all(destroyPromises); + } + }; + module2.exports = Agent; + } +}); + +// .yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/proxy-agent.js +var require_proxy_agent = __commonJS({ + ".yarn/cache/undici-npm-6.22.0-4664dd0314-47903c489d.zip/node_modules/undici/lib/dispatcher/proxy-agent.js"(exports2, module2) { + "use strict"; + var { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = require_symbols(); + var { URL: URL2 } = require("node:url"); + var Agent = require_agent(); + var Pool = require_pool(); + var DispatcherBase = require_dispatcher_base(); + var { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require_errors(); + var buildConnector = require_connect(); + var Client = require_client(); + var kAgent = Symbol("proxy agent"); + var kClient = Symbol("proxy client"); + var kProxyHeaders = Symbol("proxy headers"); + var kRequestTls = Symbol("request tls settings"); + var kProxyTls = Symbol("proxy tls settings"); + var kConnectEndpoint = Symbol("connect endpoint function"); + var kTunnelProxy = Symbol("tunnel proxy"); + function defaultProtocolPort(protocol) { + return protocol === "https:" ? 443 : 80; + } + function defaultFactory(origin, opts) { + return new Pool(origin, opts); + } + var noop3 = () => { + }; + function defaultAgentFactory(origin, opts) { + if (opts.connections === 1) { + return new Client(origin, opts); + } + return new Pool(origin, opts); + } + var Http1ProxyWrapper = class extends DispatcherBase { + #client; + constructor(proxyUrl, { headers = {}, connect, factory }) { + super(); + if (!proxyUrl) { + throw new InvalidArgumentError("Proxy URL is mandatory"); + } + this[kProxyHeaders] = headers; + if (factory) { + this.#client = factory(proxyUrl, { connect }); + } else { + this.#client = new Client(proxyUrl, { connect }); + } + } + [kDispatch](opts, handler) { + const onHeaders = handler.onHeaders; + handler.onHeaders = function(statusCode, data, resume) { + if (statusCode === 407) { + if (typeof handler.onError === "function") { + handler.onError(new InvalidArgumentError("Proxy Authentication Required (407)")); + } + return; + } + if (onHeaders) onHeaders.call(this, statusCode, data, resume); + }; + const { + origin, + path: path16 = "/", + headers = {} + } = opts; + opts.path = origin + path16; + if (!("host" in headers) && !("Host" in headers)) { + const { host } = new URL2(origin); + headers.host = host; + } + opts.headers = { ...this[kProxyHeaders], ...headers }; + return this.#client[kDispatch](opts, handler); + } + async [kClose]() { + return this.#client.close(); + } + async [kDestroy](err) { + return this.#client.destroy(err); + } + }; + var ProxyAgent2 = class extends DispatcherBase { + constructor(opts) { + super(); + if (!opts || typeof opts === "object" && !(opts instanceof URL2) && !opts.uri) { + throw new InvalidArgumentError("Proxy uri is mandatory"); + } + const { clientFactory = defaultFactory } = opts; + if (typeof clientFactory !== "function") { + throw new InvalidArgumentError("Proxy opts.clientFactory must be a function."); + } + const { proxyTunnel = true } = opts; + const url = this.#getUrl(opts); + const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url; + this[kProxy] = { uri: href, protocol }; + this[kInterceptors] = opts.interceptors?.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent) ? opts.interceptors.ProxyAgent : []; + this[kRequestTls] = opts.requestTls; + this[kProxyTls] = opts.proxyTls; + this[kProxyHeaders] = opts.headers || {}; + this[kTunnelProxy] = proxyTunnel; + if (opts.auth && opts.token) { + throw new InvalidArgumentError("opts.auth cannot be used in combination with opts.token"); + } else if (opts.auth) { + this[kProxyHeaders]["proxy-authorization"] = `Basic ${opts.auth}`; + } else if (opts.token) { + this[kProxyHeaders]["proxy-authorization"] = opts.token; + } else if (username && password) { + this[kProxyHeaders]["proxy-authorization"] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString("base64")}`; + } + const connect = buildConnector({ ...opts.proxyTls }); + this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }); + const agentFactory = opts.factory || defaultAgentFactory; + const factory = (origin2, options) => { + const { protocol: protocol2 } = new URL2(origin2); + if (!this[kTunnelProxy] && protocol2 === "http:" && this[kProxy].protocol === "http:") { + return new Http1ProxyWrapper(this[kProxy].uri, { + headers: this[kProxyHeaders], + connect, + factory: agentFactory + }); + } + return agentFactory(origin2, options); + }; + this[kClient] = clientFactory(url, { connect }); + this[kAgent] = new Agent({ + ...opts, + factory, + connect: async (opts2, callback) => { + let requestedPath = opts2.host; + if (!opts2.port) { + requestedPath += `:${defaultProtocolPort(opts2.protocol)}`; + } + try { + const { socket, statusCode } = await this[kClient].connect({ + origin, + port, + path: requestedPath, + signal: opts2.signal, + headers: { + ...this[kProxyHeaders], + host: opts2.host + }, + servername: this[kProxyTls]?.servername || proxyHostname + }); + if (statusCode !== 200) { + socket.on("error", noop3).destroy(); + callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`)); + } + if (opts2.protocol !== "https:") { + callback(null, socket); + return; + } + let servername; + if (this[kRequestTls]) { + servername = this[kRequestTls].servername; + } else { + servername = opts2.servername; + } + this[kConnectEndpoint]({ ...opts2, servername, httpSocket: socket }, callback); + } catch (err) { + if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { + callback(new SecureProxyConnectionError(err)); + } else { + callback(err); + } + } + } + }); + } + dispatch(opts, handler) { + const headers = buildHeaders(opts.headers); + throwIfProxyAuthIsSent(headers); + if (headers && !("host" in headers) && !("Host" in headers)) { + const { host } = new URL2(opts.origin); + headers.host = host; + } + return this[kAgent].dispatch( + { + ...opts, + headers + }, + handler + ); + } + /** + * @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts + * @returns {URL} + */ + #getUrl(opts) { + if (typeof opts === "string") { + return new URL2(opts); + } else if (opts instanceof URL2) { + return opts; + } else { + return new URL2(opts.uri); + } + } + async [kClose]() { + await this[kAgent].close(); + await this[kClient].close(); + } + async [kDestroy]() { + await this[kAgent].destroy(); + await this[kClient].destroy(); + } + }; + function buildHeaders(headers) { + if (Array.isArray(headers)) { + const headersPair = {}; + for (let i = 0; i < headers.length; i += 2) { + headersPair[headers[i]] = headers[i + 1]; + } + return headersPair; + } + return headers; + } + function throwIfProxyAuthIsSent(headers) { + const existProxyAuth = headers && Object.keys(headers).find((key) => key.toLowerCase() === "proxy-authorization"); + if (existProxyAuth) { + throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor"); + } + } + module2.exports = ProxyAgent2; + } +}); + +// .yarn/cache/minipass-npm-7.1.2-3a5327d36d-b0fd20bb9f.zip/node_modules/minipass/dist/esm/index.js +var import_node_events, import_node_stream, import_node_string_decoder, proc, isStream, isReadable, isWritable, EOF, MAYBE_EMIT_END, EMITTED_END, EMITTING_END, EMITTED_ERROR, CLOSED, READ, FLUSH, FLUSHCHUNK, ENCODING, DECODER, FLOWING, PAUSED, RESUME, BUFFER, PIPES, BUFFERLENGTH, BUFFERPUSH, BUFFERSHIFT, OBJECTMODE, DESTROYED, ERROR, EMITDATA, EMITEND, EMITEND2, ASYNC, ABORT, ABORTED, SIGNAL, DATALISTENERS, DISCARDED, defer, nodefer, isEndish, isArrayBufferLike, isArrayBufferView, Pipe, PipeProxyErrors, isObjectModeOptions, isEncodingOptions, Minipass; +var init_esm = __esm({ + ".yarn/cache/minipass-npm-7.1.2-3a5327d36d-b0fd20bb9f.zip/node_modules/minipass/dist/esm/index.js"() { + import_node_events = require("node:events"); + import_node_stream = __toESM(require("node:stream"), 1); + import_node_string_decoder = require("node:string_decoder"); + proc = typeof process === "object" && process ? process : { + stdout: null, + stderr: null + }; + isStream = (s) => !!s && typeof s === "object" && (s instanceof Minipass || s instanceof import_node_stream.default || isReadable(s) || isWritable(s)); + isReadable = (s) => !!s && typeof s === "object" && s instanceof import_node_events.EventEmitter && typeof s.pipe === "function" && // node core Writable streams have a pipe() method, but it throws + s.pipe !== import_node_stream.default.Writable.prototype.pipe; + isWritable = (s) => !!s && typeof s === "object" && s instanceof import_node_events.EventEmitter && typeof s.write === "function" && typeof s.end === "function"; + EOF = Symbol("EOF"); + MAYBE_EMIT_END = Symbol("maybeEmitEnd"); + EMITTED_END = Symbol("emittedEnd"); + EMITTING_END = Symbol("emittingEnd"); + EMITTED_ERROR = Symbol("emittedError"); + CLOSED = Symbol("closed"); + READ = Symbol("read"); + FLUSH = Symbol("flush"); + FLUSHCHUNK = Symbol("flushChunk"); + ENCODING = Symbol("encoding"); + DECODER = Symbol("decoder"); + FLOWING = Symbol("flowing"); + PAUSED = Symbol("paused"); + RESUME = Symbol("resume"); + BUFFER = Symbol("buffer"); + PIPES = Symbol("pipes"); + BUFFERLENGTH = Symbol("bufferLength"); + BUFFERPUSH = Symbol("bufferPush"); + BUFFERSHIFT = Symbol("bufferShift"); + OBJECTMODE = Symbol("objectMode"); + DESTROYED = Symbol("destroyed"); + ERROR = Symbol("error"); + EMITDATA = Symbol("emitData"); + EMITEND = Symbol("emitEnd"); + EMITEND2 = Symbol("emitEnd2"); + ASYNC = Symbol("async"); + ABORT = Symbol("abort"); + ABORTED = Symbol("aborted"); + SIGNAL = Symbol("signal"); + DATALISTENERS = Symbol("dataListeners"); + DISCARDED = Symbol("discarded"); + defer = (fn2) => Promise.resolve().then(fn2); + nodefer = (fn2) => fn2(); + isEndish = (ev) => ev === "end" || ev === "finish" || ev === "prefinish"; + isArrayBufferLike = (b) => b instanceof ArrayBuffer || !!b && typeof b === "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0; + isArrayBufferView = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b); + Pipe = class { + src; + dest; + opts; + ondrain; + constructor(src, dest, opts) { + this.src = src; + this.dest = dest; + this.opts = opts; + this.ondrain = () => src[RESUME](); + this.dest.on("drain", this.ondrain); + } + unpipe() { + this.dest.removeListener("drain", this.ondrain); + } + // only here for the prototype + /* c8 ignore start */ + proxyErrors(_er) { + } + /* c8 ignore stop */ + end() { + this.unpipe(); + if (this.opts.end) + this.dest.end(); + } + }; + PipeProxyErrors = class extends Pipe { + unpipe() { + this.src.removeListener("error", this.proxyErrors); + super.unpipe(); + } + constructor(src, dest, opts) { + super(src, dest, opts); + this.proxyErrors = (er) => dest.emit("error", er); + src.on("error", this.proxyErrors); + } + }; + isObjectModeOptions = (o) => !!o.objectMode; + isEncodingOptions = (o) => !o.objectMode && !!o.encoding && o.encoding !== "buffer"; + Minipass = class extends import_node_events.EventEmitter { + [FLOWING] = false; + [PAUSED] = false; + [PIPES] = []; + [BUFFER] = []; + [OBJECTMODE]; + [ENCODING]; + [ASYNC]; + [DECODER]; + [EOF] = false; + [EMITTED_END] = false; + [EMITTING_END] = false; + [CLOSED] = false; + [EMITTED_ERROR] = null; + [BUFFERLENGTH] = 0; + [DESTROYED] = false; + [SIGNAL]; + [ABORTED] = false; + [DATALISTENERS] = 0; + [DISCARDED] = false; + /** + * true if the stream can be written + */ + writable = true; + /** + * true if the stream can be read + */ + readable = true; + /** + * If `RType` is Buffer, then options do not need to be provided. + * Otherwise, an options object must be provided to specify either + * {@link Minipass.SharedOptions.objectMode} or + * {@link Minipass.SharedOptions.encoding}, as appropriate. + */ + constructor(...args) { + const options = args[0] || {}; + super(); + if (options.objectMode && typeof options.encoding === "string") { + throw new TypeError("Encoding and objectMode may not be used together"); + } + if (isObjectModeOptions(options)) { + this[OBJECTMODE] = true; + this[ENCODING] = null; + } else if (isEncodingOptions(options)) { + this[ENCODING] = options.encoding; + this[OBJECTMODE] = false; + } else { + this[OBJECTMODE] = false; + this[ENCODING] = null; + } + this[ASYNC] = !!options.async; + this[DECODER] = this[ENCODING] ? new import_node_string_decoder.StringDecoder(this[ENCODING]) : null; + if (options && options.debugExposeBuffer === true) { + Object.defineProperty(this, "buffer", { get: () => this[BUFFER] }); + } + if (options && options.debugExposePipes === true) { + Object.defineProperty(this, "pipes", { get: () => this[PIPES] }); + } + const { signal } = options; + if (signal) { + this[SIGNAL] = signal; + if (signal.aborted) { + this[ABORT](); + } else { + signal.addEventListener("abort", () => this[ABORT]()); + } + } + } + /** + * The amount of data stored in the buffer waiting to be read. + * + * For Buffer strings, this will be the total byte length. + * For string encoding streams, this will be the string character length, + * according to JavaScript's `string.length` logic. + * For objectMode streams, this is a count of the items waiting to be + * emitted. + */ + get bufferLength() { + return this[BUFFERLENGTH]; + } + /** + * The `BufferEncoding` currently in use, or `null` + */ + get encoding() { + return this[ENCODING]; + } + /** + * @deprecated - This is a read only property + */ + set encoding(_enc) { + throw new Error("Encoding must be set at instantiation time"); + } + /** + * @deprecated - Encoding may only be set at instantiation time + */ + setEncoding(_enc) { + throw new Error("Encoding must be set at instantiation time"); + } + /** + * True if this is an objectMode stream + */ + get objectMode() { + return this[OBJECTMODE]; + } + /** + * @deprecated - This is a read-only property + */ + set objectMode(_om) { + throw new Error("objectMode must be set at instantiation time"); + } + /** + * true if this is an async stream + */ + get ["async"]() { + return this[ASYNC]; + } + /** + * Set to true to make this stream async. + * + * Once set, it cannot be unset, as this would potentially cause incorrect + * behavior. Ie, a sync stream can be made async, but an async stream + * cannot be safely made sync. + */ + set ["async"](a) { + this[ASYNC] = this[ASYNC] || !!a; + } + // drop everything and get out of the flow completely + [ABORT]() { + this[ABORTED] = true; + this.emit("abort", this[SIGNAL]?.reason); + this.destroy(this[SIGNAL]?.reason); + } + /** + * True if the stream has been aborted. + */ + get aborted() { + return this[ABORTED]; + } + /** + * No-op setter. Stream aborted status is set via the AbortSignal provided + * in the constructor options. + */ + set aborted(_) { + } + write(chunk, encoding, cb) { + if (this[ABORTED]) + return false; + if (this[EOF]) + throw new Error("write after end"); + if (this[DESTROYED]) { + this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })); + return true; + } + if (typeof encoding === "function") { + cb = encoding; + encoding = "utf8"; + } + if (!encoding) + encoding = "utf8"; + const fn2 = this[ASYNC] ? defer : nodefer; + if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) { + if (isArrayBufferView(chunk)) { + chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength); + } else if (isArrayBufferLike(chunk)) { + chunk = Buffer.from(chunk); + } else if (typeof chunk !== "string") { + throw new Error("Non-contiguous data written to non-objectMode stream"); + } + } + if (this[OBJECTMODE]) { + if (this[FLOWING] && this[BUFFERLENGTH] !== 0) + this[FLUSH](true); + if (this[FLOWING]) + this.emit("data", chunk); + else + this[BUFFERPUSH](chunk); + if (this[BUFFERLENGTH] !== 0) + this.emit("readable"); + if (cb) + fn2(cb); + return this[FLOWING]; + } + if (!chunk.length) { + if (this[BUFFERLENGTH] !== 0) + this.emit("readable"); + if (cb) + fn2(cb); + return this[FLOWING]; + } + if (typeof chunk === "string" && // unless it is a string already ready for us to use + !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)) { + chunk = Buffer.from(chunk, encoding); + } + if (Buffer.isBuffer(chunk) && this[ENCODING]) { + chunk = this[DECODER].write(chunk); + } + if (this[FLOWING] && this[BUFFERLENGTH] !== 0) + this[FLUSH](true); + if (this[FLOWING]) + this.emit("data", chunk); + else + this[BUFFERPUSH](chunk); + if (this[BUFFERLENGTH] !== 0) + this.emit("readable"); + if (cb) + fn2(cb); + return this[FLOWING]; + } + /** + * Low-level explicit read method. + * + * In objectMode, the argument is ignored, and one item is returned if + * available. + * + * `n` is the number of bytes (or in the case of encoding streams, + * characters) to consume. If `n` is not provided, then the entire buffer + * is returned, or `null` is returned if no data is available. + * + * If `n` is greater that the amount of data in the internal buffer, + * then `null` is returned. + */ + read(n) { + if (this[DESTROYED]) + return null; + this[DISCARDED] = false; + if (this[BUFFERLENGTH] === 0 || n === 0 || n && n > this[BUFFERLENGTH]) { + this[MAYBE_EMIT_END](); + return null; + } + if (this[OBJECTMODE]) + n = null; + if (this[BUFFER].length > 1 && !this[OBJECTMODE]) { + this[BUFFER] = [ + this[ENCODING] ? this[BUFFER].join("") : Buffer.concat(this[BUFFER], this[BUFFERLENGTH]) + ]; + } + const ret = this[READ](n || null, this[BUFFER][0]); + this[MAYBE_EMIT_END](); + return ret; + } + [READ](n, chunk) { + if (this[OBJECTMODE]) + this[BUFFERSHIFT](); + else { + const c = chunk; + if (n === c.length || n === null) + this[BUFFERSHIFT](); + else if (typeof c === "string") { + this[BUFFER][0] = c.slice(n); + chunk = c.slice(0, n); + this[BUFFERLENGTH] -= n; + } else { + this[BUFFER][0] = c.subarray(n); + chunk = c.subarray(0, n); + this[BUFFERLENGTH] -= n; + } + } + this.emit("data", chunk); + if (!this[BUFFER].length && !this[EOF]) + this.emit("drain"); + return chunk; + } + end(chunk, encoding, cb) { + if (typeof chunk === "function") { + cb = chunk; + chunk = void 0; + } + if (typeof encoding === "function") { + cb = encoding; + encoding = "utf8"; + } + if (chunk !== void 0) + this.write(chunk, encoding); + if (cb) + this.once("end", cb); + this[EOF] = true; + this.writable = false; + if (this[FLOWING] || !this[PAUSED]) + this[MAYBE_EMIT_END](); + return this; + } + // don't let the internal resume be overwritten + [RESUME]() { + if (this[DESTROYED]) + return; + if (!this[DATALISTENERS] && !this[PIPES].length) { + this[DISCARDED] = true; + } + this[PAUSED] = false; + this[FLOWING] = true; + this.emit("resume"); + if (this[BUFFER].length) + this[FLUSH](); + else if (this[EOF]) + this[MAYBE_EMIT_END](); + else + this.emit("drain"); + } + /** + * Resume the stream if it is currently in a paused state + * + * If called when there are no pipe destinations or `data` event listeners, + * this will place the stream in a "discarded" state, where all data will + * be thrown away. The discarded state is removed if a pipe destination or + * data handler is added, if pause() is called, or if any synchronous or + * asynchronous iteration is started. + */ + resume() { + return this[RESUME](); + } + /** + * Pause the stream + */ + pause() { + this[FLOWING] = false; + this[PAUSED] = true; + this[DISCARDED] = false; + } + /** + * true if the stream has been forcibly destroyed + */ + get destroyed() { + return this[DESTROYED]; + } + /** + * true if the stream is currently in a flowing state, meaning that + * any writes will be immediately emitted. + */ + get flowing() { + return this[FLOWING]; + } + /** + * true if the stream is currently in a paused state + */ + get paused() { + return this[PAUSED]; + } + [BUFFERPUSH](chunk) { + if (this[OBJECTMODE]) + this[BUFFERLENGTH] += 1; + else + this[BUFFERLENGTH] += chunk.length; + this[BUFFER].push(chunk); + } + [BUFFERSHIFT]() { + if (this[OBJECTMODE]) + this[BUFFERLENGTH] -= 1; + else + this[BUFFERLENGTH] -= this[BUFFER][0].length; + return this[BUFFER].shift(); + } + [FLUSH](noDrain = false) { + do { + } while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) && this[BUFFER].length); + if (!noDrain && !this[BUFFER].length && !this[EOF]) + this.emit("drain"); + } + [FLUSHCHUNK](chunk) { + this.emit("data", chunk); + return this[FLOWING]; + } + /** + * Pipe all data emitted by this stream into the destination provided. + * + * Triggers the flow of data. + */ + pipe(dest, opts) { + if (this[DESTROYED]) + return dest; + this[DISCARDED] = false; + const ended = this[EMITTED_END]; + opts = opts || {}; + if (dest === proc.stdout || dest === proc.stderr) + opts.end = false; + else + opts.end = opts.end !== false; + opts.proxyErrors = !!opts.proxyErrors; + if (ended) { + if (opts.end) + dest.end(); + } else { + this[PIPES].push(!opts.proxyErrors ? new Pipe(this, dest, opts) : new PipeProxyErrors(this, dest, opts)); + if (this[ASYNC]) + defer(() => this[RESUME]()); + else + this[RESUME](); + } + return dest; + } + /** + * Fully unhook a piped destination stream. + * + * If the destination stream was the only consumer of this stream (ie, + * there are no other piped destinations or `'data'` event listeners) + * then the flow of data will stop until there is another consumer or + * {@link Minipass#resume} is explicitly called. + */ + unpipe(dest) { + const p = this[PIPES].find((p2) => p2.dest === dest); + if (p) { + if (this[PIPES].length === 1) { + if (this[FLOWING] && this[DATALISTENERS] === 0) { + this[FLOWING] = false; + } + this[PIPES] = []; + } else + this[PIPES].splice(this[PIPES].indexOf(p), 1); + p.unpipe(); + } + } + /** + * Alias for {@link Minipass#on} + */ + addListener(ev, handler) { + return this.on(ev, handler); + } + /** + * Mostly identical to `EventEmitter.on`, with the following + * behavior differences to prevent data loss and unnecessary hangs: + * + * - Adding a 'data' event handler will trigger the flow of data + * + * - Adding a 'readable' event handler when there is data waiting to be read + * will cause 'readable' to be emitted immediately. + * + * - Adding an 'endish' event handler ('end', 'finish', etc.) which has + * already passed will cause the event to be emitted immediately and all + * handlers removed. + * + * - Adding an 'error' event handler after an error has been emitted will + * cause the event to be re-emitted immediately with the error previously + * raised. + */ + on(ev, handler) { + const ret = super.on(ev, handler); + if (ev === "data") { + this[DISCARDED] = false; + this[DATALISTENERS]++; + if (!this[PIPES].length && !this[FLOWING]) { + this[RESUME](); + } + } else if (ev === "readable" && this[BUFFERLENGTH] !== 0) { + super.emit("readable"); + } else if (isEndish(ev) && this[EMITTED_END]) { + super.emit(ev); + this.removeAllListeners(ev); + } else if (ev === "error" && this[EMITTED_ERROR]) { + const h = handler; + if (this[ASYNC]) + defer(() => h.call(this, this[EMITTED_ERROR])); + else + h.call(this, this[EMITTED_ERROR]); + } + return ret; + } + /** + * Alias for {@link Minipass#off} + */ + removeListener(ev, handler) { + return this.off(ev, handler); + } + /** + * Mostly identical to `EventEmitter.off` + * + * If a 'data' event handler is removed, and it was the last consumer + * (ie, there are no pipe destinations or other 'data' event listeners), + * then the flow of data will stop until there is another consumer or + * {@link Minipass#resume} is explicitly called. + */ + off(ev, handler) { + const ret = super.off(ev, handler); + if (ev === "data") { + this[DATALISTENERS] = this.listeners("data").length; + if (this[DATALISTENERS] === 0 && !this[DISCARDED] && !this[PIPES].length) { + this[FLOWING] = false; + } + } + return ret; + } + /** + * Mostly identical to `EventEmitter.removeAllListeners` + * + * If all 'data' event handlers are removed, and they were the last consumer + * (ie, there are no pipe destinations), then the flow of data will stop + * until there is another consumer or {@link Minipass#resume} is explicitly + * called. + */ + removeAllListeners(ev) { + const ret = super.removeAllListeners(ev); + if (ev === "data" || ev === void 0) { + this[DATALISTENERS] = 0; + if (!this[DISCARDED] && !this[PIPES].length) { + this[FLOWING] = false; + } + } + return ret; + } + /** + * true if the 'end' event has been emitted + */ + get emittedEnd() { + return this[EMITTED_END]; + } + [MAYBE_EMIT_END]() { + if (!this[EMITTING_END] && !this[EMITTED_END] && !this[DESTROYED] && this[BUFFER].length === 0 && this[EOF]) { + this[EMITTING_END] = true; + this.emit("end"); + this.emit("prefinish"); + this.emit("finish"); + if (this[CLOSED]) + this.emit("close"); + this[EMITTING_END] = false; + } + } + /** + * Mostly identical to `EventEmitter.emit`, with the following + * behavior differences to prevent data loss and unnecessary hangs: + * + * If the stream has been destroyed, and the event is something other + * than 'close' or 'error', then `false` is returned and no handlers + * are called. + * + * If the event is 'end', and has already been emitted, then the event + * is ignored. If the stream is in a paused or non-flowing state, then + * the event will be deferred until data flow resumes. If the stream is + * async, then handlers will be called on the next tick rather than + * immediately. + * + * If the event is 'close', and 'end' has not yet been emitted, then + * the event will be deferred until after 'end' is emitted. + * + * If the event is 'error', and an AbortSignal was provided for the stream, + * and there are no listeners, then the event is ignored, matching the + * behavior of node core streams in the presense of an AbortSignal. + * + * If the event is 'finish' or 'prefinish', then all listeners will be + * removed after emitting the event, to prevent double-firing. + */ + emit(ev, ...args) { + const data = args[0]; + if (ev !== "error" && ev !== "close" && ev !== DESTROYED && this[DESTROYED]) { + return false; + } else if (ev === "data") { + return !this[OBJECTMODE] && !data ? false : this[ASYNC] ? (defer(() => this[EMITDATA](data)), true) : this[EMITDATA](data); + } else if (ev === "end") { + return this[EMITEND](); + } else if (ev === "close") { + this[CLOSED] = true; + if (!this[EMITTED_END] && !this[DESTROYED]) + return false; + const ret2 = super.emit("close"); + this.removeAllListeners("close"); + return ret2; + } else if (ev === "error") { + this[EMITTED_ERROR] = data; + super.emit(ERROR, data); + const ret2 = !this[SIGNAL] || this.listeners("error").length ? super.emit("error", data) : false; + this[MAYBE_EMIT_END](); + return ret2; + } else if (ev === "resume") { + const ret2 = super.emit("resume"); + this[MAYBE_EMIT_END](); + return ret2; + } else if (ev === "finish" || ev === "prefinish") { + const ret2 = super.emit(ev); + this.removeAllListeners(ev); + return ret2; + } + const ret = super.emit(ev, ...args); + this[MAYBE_EMIT_END](); + return ret; + } + [EMITDATA](data) { + for (const p of this[PIPES]) { + if (p.dest.write(data) === false) + this.pause(); + } + const ret = this[DISCARDED] ? false : super.emit("data", data); + this[MAYBE_EMIT_END](); + return ret; + } + [EMITEND]() { + if (this[EMITTED_END]) + return false; + this[EMITTED_END] = true; + this.readable = false; + return this[ASYNC] ? (defer(() => this[EMITEND2]()), true) : this[EMITEND2](); + } + [EMITEND2]() { + if (this[DECODER]) { + const data = this[DECODER].end(); + if (data) { + for (const p of this[PIPES]) { + p.dest.write(data); + } + if (!this[DISCARDED]) + super.emit("data", data); + } + } + for (const p of this[PIPES]) { + p.end(); + } + const ret = super.emit("end"); + this.removeAllListeners("end"); + return ret; + } + /** + * Return a Promise that resolves to an array of all emitted data once + * the stream ends. + */ + async collect() { + const buf = Object.assign([], { + dataLength: 0 + }); + if (!this[OBJECTMODE]) + buf.dataLength = 0; + const p = this.promise(); + this.on("data", (c) => { + buf.push(c); + if (!this[OBJECTMODE]) + buf.dataLength += c.length; + }); + await p; + return buf; + } + /** + * Return a Promise that resolves to the concatenation of all emitted data + * once the stream ends. + * + * Not allowed on objectMode streams. + */ + async concat() { + if (this[OBJECTMODE]) { + throw new Error("cannot concat in objectMode"); + } + const buf = await this.collect(); + return this[ENCODING] ? buf.join("") : Buffer.concat(buf, buf.dataLength); + } + /** + * Return a void Promise that resolves once the stream ends. + */ + async promise() { + return new Promise((resolve, reject) => { + this.on(DESTROYED, () => reject(new Error("stream destroyed"))); + this.on("error", (er) => reject(er)); + this.on("end", () => resolve()); + }); + } + /** + * Asynchronous `for await of` iteration. + * + * This will continue emitting all chunks until the stream terminates. + */ + [Symbol.asyncIterator]() { + this[DISCARDED] = false; + let stopped = false; + const stop = async () => { + this.pause(); + stopped = true; + return { value: void 0, done: true }; + }; + const next = () => { + if (stopped) + return stop(); + const res = this.read(); + if (res !== null) + return Promise.resolve({ done: false, value: res }); + if (this[EOF]) + return stop(); + let resolve; + let reject; + const onerr = (er) => { + this.off("data", ondata); + this.off("end", onend); + this.off(DESTROYED, ondestroy); + stop(); + reject(er); + }; + const ondata = (value) => { + this.off("error", onerr); + this.off("end", onend); + this.off(DESTROYED, ondestroy); + this.pause(); + resolve({ value, done: !!this[EOF] }); + }; + const onend = () => { + this.off("error", onerr); + this.off("data", ondata); + this.off(DESTROYED, ondestroy); + stop(); + resolve({ done: true, value: void 0 }); + }; + const ondestroy = () => onerr(new Error("stream destroyed")); + return new Promise((res2, rej) => { + reject = rej; + resolve = res2; + this.once(DESTROYED, ondestroy); + this.once("error", onerr); + this.once("end", onend); + this.once("data", ondata); + }); + }; + return { + next, + throw: stop, + return: stop, + [Symbol.asyncIterator]() { + return this; + } + }; + } + /** + * Synchronous `for of` iteration. + * + * The iteration will terminate when the internal buffer runs out, even + * if the stream has not yet terminated. + */ + [Symbol.iterator]() { + this[DISCARDED] = false; + let stopped = false; + const stop = () => { + this.pause(); + this.off(ERROR, stop); + this.off(DESTROYED, stop); + this.off("end", stop); + stopped = true; + return { done: true, value: void 0 }; + }; + const next = () => { + if (stopped) + return stop(); + const value = this.read(); + return value === null ? stop() : { done: false, value }; + }; + this.once("end", stop); + this.once(ERROR, stop); + this.once(DESTROYED, stop); + return { + next, + throw: stop, + return: stop, + [Symbol.iterator]() { + return this; + } + }; + } + /** + * Destroy a stream, preventing it from being used for any further purpose. + * + * If the stream has a `close()` method, then it will be called on + * destruction. + * + * After destruction, any attempt to write data, read data, or emit most + * events will be ignored. + * + * If an error argument is provided, then it will be emitted in an + * 'error' event. + */ + destroy(er) { + if (this[DESTROYED]) { + if (er) + this.emit("error", er); + else + this.emit(DESTROYED); + return this; + } + this[DESTROYED] = true; + this[DISCARDED] = true; + this[BUFFER].length = 0; + this[BUFFERLENGTH] = 0; + const wc = this; + if (typeof wc.close === "function" && !this[CLOSED]) + wc.close(); + if (er) + this.emit("error", er); + else + this.emit(DESTROYED); + return this; + } + /** + * Alias for {@link isStream} + * + * Former export location, maintained for backwards compatibility. + * + * @deprecated + */ + static get isStream() { + return isStream; + } + }; + } +}); + +// .yarn/cache/@isaacs-fs-minipass-npm-4.0.1-677026e841-c25b6dc159.zip/node_modules/@isaacs/fs-minipass/dist/esm/index.js +var import_events2, import_fs2, writev, _autoClose, _close, _ended, _fd, _finished, _flags, _flush, _handleChunk, _makeBuf, _mode, _needDrain, _onerror, _onopen, _onread, _onwrite, _open, _path, _pos, _queue, _read, _readSize, _reading, _remain, _size, _write, _writing, _defaultFlag, _errored, ReadStream, ReadStreamSync, WriteStream, WriteStreamSync; +var init_esm2 = __esm({ + ".yarn/cache/@isaacs-fs-minipass-npm-4.0.1-677026e841-c25b6dc159.zip/node_modules/@isaacs/fs-minipass/dist/esm/index.js"() { + import_events2 = __toESM(require("events"), 1); + import_fs2 = __toESM(require("fs"), 1); + init_esm(); + writev = import_fs2.default.writev; + _autoClose = Symbol("_autoClose"); + _close = Symbol("_close"); + _ended = Symbol("_ended"); + _fd = Symbol("_fd"); + _finished = Symbol("_finished"); + _flags = Symbol("_flags"); + _flush = Symbol("_flush"); + _handleChunk = Symbol("_handleChunk"); + _makeBuf = Symbol("_makeBuf"); + _mode = Symbol("_mode"); + _needDrain = Symbol("_needDrain"); + _onerror = Symbol("_onerror"); + _onopen = Symbol("_onopen"); + _onread = Symbol("_onread"); + _onwrite = Symbol("_onwrite"); + _open = Symbol("_open"); + _path = Symbol("_path"); + _pos = Symbol("_pos"); + _queue = Symbol("_queue"); + _read = Symbol("_read"); + _readSize = Symbol("_readSize"); + _reading = Symbol("_reading"); + _remain = Symbol("_remain"); + _size = Symbol("_size"); + _write = Symbol("_write"); + _writing = Symbol("_writing"); + _defaultFlag = Symbol("_defaultFlag"); + _errored = Symbol("_errored"); + ReadStream = class extends Minipass { + [_errored] = false; + [_fd]; + [_path]; + [_readSize]; + [_reading] = false; + [_size]; + [_remain]; + [_autoClose]; + constructor(path16, opt) { + opt = opt || {}; + super(opt); + this.readable = true; + this.writable = false; + if (typeof path16 !== "string") { + throw new TypeError("path must be a string"); + } + this[_errored] = false; + this[_fd] = typeof opt.fd === "number" ? opt.fd : void 0; + this[_path] = path16; + this[_readSize] = opt.readSize || 16 * 1024 * 1024; + this[_reading] = false; + this[_size] = typeof opt.size === "number" ? opt.size : Infinity; + this[_remain] = this[_size]; + this[_autoClose] = typeof opt.autoClose === "boolean" ? opt.autoClose : true; + if (typeof this[_fd] === "number") { + this[_read](); + } else { + this[_open](); + } + } + get fd() { + return this[_fd]; + } + get path() { + return this[_path]; + } + //@ts-ignore + write() { + throw new TypeError("this is a readable stream"); + } + //@ts-ignore + end() { + throw new TypeError("this is a readable stream"); + } + [_open]() { + import_fs2.default.open(this[_path], "r", (er, fd) => this[_onopen](er, fd)); + } + [_onopen](er, fd) { + if (er) { + this[_onerror](er); + } else { + this[_fd] = fd; + this.emit("open", fd); + this[_read](); + } + } + [_makeBuf]() { + return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain])); + } + [_read]() { + if (!this[_reading]) { + this[_reading] = true; + const buf = this[_makeBuf](); + if (buf.length === 0) { + return process.nextTick(() => this[_onread](null, 0, buf)); + } + import_fs2.default.read(this[_fd], buf, 0, buf.length, null, (er, br, b) => this[_onread](er, br, b)); + } + } + [_onread](er, br, buf) { + this[_reading] = false; + if (er) { + this[_onerror](er); + } else if (this[_handleChunk](br, buf)) { + this[_read](); + } + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === "number") { + const fd = this[_fd]; + this[_fd] = void 0; + import_fs2.default.close(fd, (er) => er ? this.emit("error", er) : this.emit("close")); + } + } + [_onerror](er) { + this[_reading] = true; + this[_close](); + this.emit("error", er); + } + [_handleChunk](br, buf) { + let ret = false; + this[_remain] -= br; + if (br > 0) { + ret = super.write(br < buf.length ? buf.subarray(0, br) : buf); + } + if (br === 0 || this[_remain] <= 0) { + ret = false; + this[_close](); + super.end(); + } + return ret; + } + emit(ev, ...args) { + switch (ev) { + case "prefinish": + case "finish": + return false; + case "drain": + if (typeof this[_fd] === "number") { + this[_read](); + } + return false; + case "error": + if (this[_errored]) { + return false; + } + this[_errored] = true; + return super.emit(ev, ...args); + default: + return super.emit(ev, ...args); + } + } + }; + ReadStreamSync = class extends ReadStream { + [_open]() { + let threw = true; + try { + this[_onopen](null, import_fs2.default.openSync(this[_path], "r")); + threw = false; + } finally { + if (threw) { + this[_close](); + } + } + } + [_read]() { + let threw = true; + try { + if (!this[_reading]) { + this[_reading] = true; + do { + const buf = this[_makeBuf](); + const br = buf.length === 0 ? 0 : import_fs2.default.readSync(this[_fd], buf, 0, buf.length, null); + if (!this[_handleChunk](br, buf)) { + break; + } + } while (true); + this[_reading] = false; + } + threw = false; + } finally { + if (threw) { + this[_close](); + } + } + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === "number") { + const fd = this[_fd]; + this[_fd] = void 0; + import_fs2.default.closeSync(fd); + this.emit("close"); + } + } + }; + WriteStream = class extends import_events2.default { + readable = false; + writable = true; + [_errored] = false; + [_writing] = false; + [_ended] = false; + [_queue] = []; + [_needDrain] = false; + [_path]; + [_mode]; + [_autoClose]; + [_fd]; + [_defaultFlag]; + [_flags]; + [_finished] = false; + [_pos]; + constructor(path16, opt) { + opt = opt || {}; + super(opt); + this[_path] = path16; + this[_fd] = typeof opt.fd === "number" ? opt.fd : void 0; + this[_mode] = opt.mode === void 0 ? 438 : opt.mode; + this[_pos] = typeof opt.start === "number" ? opt.start : void 0; + this[_autoClose] = typeof opt.autoClose === "boolean" ? opt.autoClose : true; + const defaultFlag = this[_pos] !== void 0 ? "r+" : "w"; + this[_defaultFlag] = opt.flags === void 0; + this[_flags] = opt.flags === void 0 ? defaultFlag : opt.flags; + if (this[_fd] === void 0) { + this[_open](); + } + } + emit(ev, ...args) { + if (ev === "error") { + if (this[_errored]) { + return false; + } + this[_errored] = true; + } + return super.emit(ev, ...args); + } + get fd() { + return this[_fd]; + } + get path() { + return this[_path]; + } + [_onerror](er) { + this[_close](); + this[_writing] = true; + this.emit("error", er); + } + [_open]() { + import_fs2.default.open(this[_path], this[_flags], this[_mode], (er, fd) => this[_onopen](er, fd)); + } + [_onopen](er, fd) { + if (this[_defaultFlag] && this[_flags] === "r+" && er && er.code === "ENOENT") { + this[_flags] = "w"; + this[_open](); + } else if (er) { + this[_onerror](er); + } else { + this[_fd] = fd; + this.emit("open", fd); + if (!this[_writing]) { + this[_flush](); + } + } + } + end(buf, enc) { + if (buf) { + this.write(buf, enc); + } + this[_ended] = true; + if (!this[_writing] && !this[_queue].length && typeof this[_fd] === "number") { + this[_onwrite](null, 0); + } + return this; + } + write(buf, enc) { + if (typeof buf === "string") { + buf = Buffer.from(buf, enc); + } + if (this[_ended]) { + this.emit("error", new Error("write() after end()")); + return false; + } + if (this[_fd] === void 0 || this[_writing] || this[_queue].length) { + this[_queue].push(buf); + this[_needDrain] = true; + return false; + } + this[_writing] = true; + this[_write](buf); + return true; + } + [_write](buf) { + import_fs2.default.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) => this[_onwrite](er, bw)); + } + [_onwrite](er, bw) { + if (er) { + this[_onerror](er); + } else { + if (this[_pos] !== void 0 && typeof bw === "number") { + this[_pos] += bw; + } + if (this[_queue].length) { + this[_flush](); + } else { + this[_writing] = false; + if (this[_ended] && !this[_finished]) { + this[_finished] = true; + this[_close](); + this.emit("finish"); + } else if (this[_needDrain]) { + this[_needDrain] = false; + this.emit("drain"); + } + } + } + } + [_flush]() { + if (this[_queue].length === 0) { + if (this[_ended]) { + this[_onwrite](null, 0); + } + } else if (this[_queue].length === 1) { + this[_write](this[_queue].pop()); + } else { + const iovec = this[_queue]; + this[_queue] = []; + writev(this[_fd], iovec, this[_pos], (er, bw) => this[_onwrite](er, bw)); + } + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === "number") { + const fd = this[_fd]; + this[_fd] = void 0; + import_fs2.default.close(fd, (er) => er ? this.emit("error", er) : this.emit("close")); + } + } + }; + WriteStreamSync = class extends WriteStream { + [_open]() { + let fd; + if (this[_defaultFlag] && this[_flags] === "r+") { + try { + fd = import_fs2.default.openSync(this[_path], this[_flags], this[_mode]); + } catch (er) { + if (er?.code === "ENOENT") { + this[_flags] = "w"; + return this[_open](); + } else { + throw er; + } + } + } else { + fd = import_fs2.default.openSync(this[_path], this[_flags], this[_mode]); + } + this[_onopen](null, fd); + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === "number") { + const fd = this[_fd]; + this[_fd] = void 0; + import_fs2.default.closeSync(fd); + this.emit("close"); + } + } + [_write](buf) { + let threw = true; + try { + this[_onwrite](null, import_fs2.default.writeSync(this[_fd], buf, 0, buf.length, this[_pos])); + threw = false; + } finally { + if (threw) { + try { + this[_close](); + } catch { + } + } + } + } + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/options.js +var argmap, isSyncFile, isAsyncFile, isSyncNoFile, isAsyncNoFile, dealiasKey, dealias; +var init_options = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/options.js"() { + argmap = /* @__PURE__ */ new Map([ + ["C", "cwd"], + ["f", "file"], + ["z", "gzip"], + ["P", "preservePaths"], + ["U", "unlink"], + ["strip-components", "strip"], + ["stripComponents", "strip"], + ["keep-newer", "newer"], + ["keepNewer", "newer"], + ["keep-newer-files", "newer"], + ["keepNewerFiles", "newer"], + ["k", "keep"], + ["keep-existing", "keep"], + ["keepExisting", "keep"], + ["m", "noMtime"], + ["no-mtime", "noMtime"], + ["p", "preserveOwner"], + ["L", "follow"], + ["h", "follow"], + ["onentry", "onReadEntry"] + ]); + isSyncFile = (o) => !!o.sync && !!o.file; + isAsyncFile = (o) => !o.sync && !!o.file; + isSyncNoFile = (o) => !!o.sync && !o.file; + isAsyncNoFile = (o) => !o.sync && !o.file; + dealiasKey = (k) => { + const d = argmap.get(k); + if (d) + return d; + return k; + }; + dealias = (opt = {}) => { + if (!opt) + return {}; + const result = {}; + for (const [key, v] of Object.entries(opt)) { + const k = dealiasKey(key); + result[k] = v; + } + if (result.chmod === void 0 && result.noChmod === false) { + result.chmod = true; + } + delete result.noChmod; + return result; + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/make-command.js +var makeCommand; +var init_make_command = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/make-command.js"() { + init_options(); + makeCommand = (syncFile, asyncFile, syncNoFile, asyncNoFile, validate) => { + return Object.assign((opt_ = [], entries, cb) => { + if (Array.isArray(opt_)) { + entries = opt_; + opt_ = {}; + } + if (typeof entries === "function") { + cb = entries; + entries = void 0; + } + if (!entries) { + entries = []; + } else { + entries = Array.from(entries); + } + const opt = dealias(opt_); + validate?.(opt, entries); + if (isSyncFile(opt)) { + if (typeof cb === "function") { + throw new TypeError("callback not supported for sync tar functions"); + } + return syncFile(opt, entries); + } else if (isAsyncFile(opt)) { + const p = asyncFile(opt, entries); + const c = cb ? cb : void 0; + return c ? p.then(() => c(), c) : p; + } else if (isSyncNoFile(opt)) { + if (typeof cb === "function") { + throw new TypeError("callback not supported for sync tar functions"); + } + return syncNoFile(opt, entries); + } else if (isAsyncNoFile(opt)) { + if (typeof cb === "function") { + throw new TypeError("callback only supported with file option"); + } + return asyncNoFile(opt, entries); + } else { + throw new Error("impossible options??"); + } + }, { + syncFile, + asyncFile, + syncNoFile, + asyncNoFile, + validate + }); + }; + } +}); + +// .yarn/cache/minizlib-npm-3.1.0-6680befdba-5aad75ab00.zip/node_modules/minizlib/dist/esm/constants.js +var import_zlib, realZlibConstants, constants; +var init_constants = __esm({ + ".yarn/cache/minizlib-npm-3.1.0-6680befdba-5aad75ab00.zip/node_modules/minizlib/dist/esm/constants.js"() { + import_zlib = __toESM(require("zlib"), 1); + realZlibConstants = import_zlib.default.constants || { ZLIB_VERNUM: 4736 }; + constants = Object.freeze(Object.assign(/* @__PURE__ */ Object.create(null), { + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + Z_VERSION_ERROR: -6, + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + DEFLATE: 1, + INFLATE: 2, + GZIP: 3, + GUNZIP: 4, + DEFLATERAW: 5, + INFLATERAW: 6, + UNZIP: 7, + BROTLI_DECODE: 8, + BROTLI_ENCODE: 9, + Z_MIN_WINDOWBITS: 8, + Z_MAX_WINDOWBITS: 15, + Z_DEFAULT_WINDOWBITS: 15, + Z_MIN_CHUNK: 64, + Z_MAX_CHUNK: Infinity, + Z_DEFAULT_CHUNK: 16384, + Z_MIN_MEMLEVEL: 1, + Z_MAX_MEMLEVEL: 9, + Z_DEFAULT_MEMLEVEL: 8, + Z_MIN_LEVEL: -1, + Z_MAX_LEVEL: 9, + Z_DEFAULT_LEVEL: -1, + BROTLI_OPERATION_PROCESS: 0, + BROTLI_OPERATION_FLUSH: 1, + BROTLI_OPERATION_FINISH: 2, + BROTLI_OPERATION_EMIT_METADATA: 3, + BROTLI_MODE_GENERIC: 0, + BROTLI_MODE_TEXT: 1, + BROTLI_MODE_FONT: 2, + BROTLI_DEFAULT_MODE: 0, + BROTLI_MIN_QUALITY: 0, + BROTLI_MAX_QUALITY: 11, + BROTLI_DEFAULT_QUALITY: 11, + BROTLI_MIN_WINDOW_BITS: 10, + BROTLI_MAX_WINDOW_BITS: 24, + BROTLI_LARGE_MAX_WINDOW_BITS: 30, + BROTLI_DEFAULT_WINDOW: 22, + BROTLI_MIN_INPUT_BLOCK_BITS: 16, + BROTLI_MAX_INPUT_BLOCK_BITS: 24, + BROTLI_PARAM_MODE: 0, + BROTLI_PARAM_QUALITY: 1, + BROTLI_PARAM_LGWIN: 2, + BROTLI_PARAM_LGBLOCK: 3, + BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4, + BROTLI_PARAM_SIZE_HINT: 5, + BROTLI_PARAM_LARGE_WINDOW: 6, + BROTLI_PARAM_NPOSTFIX: 7, + BROTLI_PARAM_NDIRECT: 8, + BROTLI_DECODER_RESULT_ERROR: 0, + BROTLI_DECODER_RESULT_SUCCESS: 1, + BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2, + BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3, + BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0, + BROTLI_DECODER_PARAM_LARGE_WINDOW: 1, + BROTLI_DECODER_NO_ERROR: 0, + BROTLI_DECODER_SUCCESS: 1, + BROTLI_DECODER_NEEDS_MORE_INPUT: 2, + BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3, + BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1, + BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2, + BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3, + BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4, + BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5, + BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6, + BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7, + BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8, + BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9, + BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10, + BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11, + BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12, + BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13, + BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14, + BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15, + BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16, + BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19, + BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20, + BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21, + BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22, + BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25, + BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26, + BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27, + BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30, + BROTLI_DECODER_ERROR_UNREACHABLE: -31 + }, realZlibConstants)); + } +}); + +// .yarn/cache/minizlib-npm-3.1.0-6680befdba-5aad75ab00.zip/node_modules/minizlib/dist/esm/index.js +var import_assert2, import_buffer, realZlib2, OriginalBufferConcat, desc, noop, passthroughBufferConcat, _superWrite, ZlibError, _flushFlag, ZlibBase, Zlib, Gzip, Unzip, Brotli, BrotliCompress, BrotliDecompress, Zstd, ZstdCompress, ZstdDecompress; +var init_esm3 = __esm({ + ".yarn/cache/minizlib-npm-3.1.0-6680befdba-5aad75ab00.zip/node_modules/minizlib/dist/esm/index.js"() { + import_assert2 = __toESM(require("assert"), 1); + import_buffer = require("buffer"); + init_esm(); + realZlib2 = __toESM(require("zlib"), 1); + init_constants(); + init_constants(); + OriginalBufferConcat = import_buffer.Buffer.concat; + desc = Object.getOwnPropertyDescriptor(import_buffer.Buffer, "concat"); + noop = (args) => args; + passthroughBufferConcat = desc?.writable === true || desc?.set !== void 0 ? (makeNoOp) => { + import_buffer.Buffer.concat = makeNoOp ? noop : OriginalBufferConcat; + } : (_) => { + }; + _superWrite = Symbol("_superWrite"); + ZlibError = class extends Error { + code; + errno; + constructor(err, origin) { + super("zlib: " + err.message, { cause: err }); + this.code = err.code; + this.errno = err.errno; + if (!this.code) + this.code = "ZLIB_ERROR"; + this.message = "zlib: " + err.message; + Error.captureStackTrace(this, origin ?? this.constructor); + } + get name() { + return "ZlibError"; + } + }; + _flushFlag = Symbol("flushFlag"); + ZlibBase = class extends Minipass { + #sawError = false; + #ended = false; + #flushFlag; + #finishFlushFlag; + #fullFlushFlag; + #handle; + #onError; + get sawError() { + return this.#sawError; + } + get handle() { + return this.#handle; + } + /* c8 ignore start */ + get flushFlag() { + return this.#flushFlag; + } + /* c8 ignore stop */ + constructor(opts, mode) { + if (!opts || typeof opts !== "object") + throw new TypeError("invalid options for ZlibBase constructor"); + super(opts); + this.#flushFlag = opts.flush ?? 0; + this.#finishFlushFlag = opts.finishFlush ?? 0; + this.#fullFlushFlag = opts.fullFlushFlag ?? 0; + if (typeof realZlib2[mode] !== "function") { + throw new TypeError("Compression method not supported: " + mode); + } + try { + this.#handle = new realZlib2[mode](opts); + } catch (er) { + throw new ZlibError(er, this.constructor); + } + this.#onError = (err) => { + if (this.#sawError) + return; + this.#sawError = true; + this.close(); + this.emit("error", err); + }; + this.#handle?.on("error", (er) => this.#onError(new ZlibError(er))); + this.once("end", () => this.close); + } + close() { + if (this.#handle) { + this.#handle.close(); + this.#handle = void 0; + this.emit("close"); + } + } + reset() { + if (!this.#sawError) { + (0, import_assert2.default)(this.#handle, "zlib binding closed"); + return this.#handle.reset?.(); + } + } + flush(flushFlag) { + if (this.ended) + return; + if (typeof flushFlag !== "number") + flushFlag = this.#fullFlushFlag; + this.write(Object.assign(import_buffer.Buffer.alloc(0), { [_flushFlag]: flushFlag })); + } + end(chunk, encoding, cb) { + if (typeof chunk === "function") { + cb = chunk; + encoding = void 0; + chunk = void 0; + } + if (typeof encoding === "function") { + cb = encoding; + encoding = void 0; + } + if (chunk) { + if (encoding) + this.write(chunk, encoding); + else + this.write(chunk); + } + this.flush(this.#finishFlushFlag); + this.#ended = true; + return super.end(cb); + } + get ended() { + return this.#ended; + } + // overridden in the gzip classes to do portable writes + [_superWrite](data) { + return super.write(data); + } + write(chunk, encoding, cb) { + if (typeof encoding === "function") + cb = encoding, encoding = "utf8"; + if (typeof chunk === "string") + chunk = import_buffer.Buffer.from(chunk, encoding); + if (this.#sawError) + return; + (0, import_assert2.default)(this.#handle, "zlib binding closed"); + const nativeHandle = this.#handle._handle; + const originalNativeClose = nativeHandle.close; + nativeHandle.close = () => { + }; + const originalClose = this.#handle.close; + this.#handle.close = () => { + }; + passthroughBufferConcat(true); + let result = void 0; + try { + const flushFlag = typeof chunk[_flushFlag] === "number" ? chunk[_flushFlag] : this.#flushFlag; + result = this.#handle._processChunk(chunk, flushFlag); + passthroughBufferConcat(false); + } catch (err) { + passthroughBufferConcat(false); + this.#onError(new ZlibError(err, this.write)); + } finally { + if (this.#handle) { + ; + this.#handle._handle = nativeHandle; + nativeHandle.close = originalNativeClose; + this.#handle.close = originalClose; + this.#handle.removeAllListeners("error"); + } + } + if (this.#handle) + this.#handle.on("error", (er) => this.#onError(new ZlibError(er, this.write))); + let writeReturn; + if (result) { + if (Array.isArray(result) && result.length > 0) { + const r = result[0]; + writeReturn = this[_superWrite](import_buffer.Buffer.from(r)); + for (let i = 1; i < result.length; i++) { + writeReturn = this[_superWrite](result[i]); + } + } else { + writeReturn = this[_superWrite](import_buffer.Buffer.from(result)); + } + } + if (cb) + cb(); + return writeReturn; + } + }; + Zlib = class extends ZlibBase { + #level; + #strategy; + constructor(opts, mode) { + opts = opts || {}; + opts.flush = opts.flush || constants.Z_NO_FLUSH; + opts.finishFlush = opts.finishFlush || constants.Z_FINISH; + opts.fullFlushFlag = constants.Z_FULL_FLUSH; + super(opts, mode); + this.#level = opts.level; + this.#strategy = opts.strategy; + } + params(level, strategy) { + if (this.sawError) + return; + if (!this.handle) + throw new Error("cannot switch params when binding is closed"); + if (!this.handle.params) + throw new Error("not supported in this implementation"); + if (this.#level !== level || this.#strategy !== strategy) { + this.flush(constants.Z_SYNC_FLUSH); + (0, import_assert2.default)(this.handle, "zlib binding closed"); + const origFlush = this.handle.flush; + this.handle.flush = (flushFlag, cb) => { + if (typeof flushFlag === "function") { + cb = flushFlag; + flushFlag = this.flushFlag; + } + this.flush(flushFlag); + cb?.(); + }; + try { + ; + this.handle.params(level, strategy); + } finally { + this.handle.flush = origFlush; + } + if (this.handle) { + this.#level = level; + this.#strategy = strategy; + } + } + } + }; + Gzip = class extends Zlib { + #portable; + constructor(opts) { + super(opts, "Gzip"); + this.#portable = opts && !!opts.portable; + } + [_superWrite](data) { + if (!this.#portable) + return super[_superWrite](data); + this.#portable = false; + data[9] = 255; + return super[_superWrite](data); + } + }; + Unzip = class extends Zlib { + constructor(opts) { + super(opts, "Unzip"); + } + }; + Brotli = class extends ZlibBase { + constructor(opts, mode) { + opts = opts || {}; + opts.flush = opts.flush || constants.BROTLI_OPERATION_PROCESS; + opts.finishFlush = opts.finishFlush || constants.BROTLI_OPERATION_FINISH; + opts.fullFlushFlag = constants.BROTLI_OPERATION_FLUSH; + super(opts, mode); + } + }; + BrotliCompress = class extends Brotli { + constructor(opts) { + super(opts, "BrotliCompress"); + } + }; + BrotliDecompress = class extends Brotli { + constructor(opts) { + super(opts, "BrotliDecompress"); + } + }; + Zstd = class extends ZlibBase { + constructor(opts, mode) { + opts = opts || {}; + opts.flush = opts.flush || constants.ZSTD_e_continue; + opts.finishFlush = opts.finishFlush || constants.ZSTD_e_end; + opts.fullFlushFlag = constants.ZSTD_e_flush; + super(opts, mode); + } + }; + ZstdCompress = class extends Zstd { + constructor(opts) { + super(opts, "ZstdCompress"); + } + }; + ZstdDecompress = class extends Zstd { + constructor(opts) { + super(opts, "ZstdDecompress"); + } + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/large-numbers.js +var encode, encodePositive, encodeNegative, parse, twos, pos, onesComp, twosComp; +var init_large_numbers = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/large-numbers.js"() { + encode = (num, buf) => { + if (!Number.isSafeInteger(num)) { + throw Error("cannot encode number outside of javascript safe integer range"); + } else if (num < 0) { + encodeNegative(num, buf); + } else { + encodePositive(num, buf); + } + return buf; + }; + encodePositive = (num, buf) => { + buf[0] = 128; + for (var i = buf.length; i > 1; i--) { + buf[i - 1] = num & 255; + num = Math.floor(num / 256); + } + }; + encodeNegative = (num, buf) => { + buf[0] = 255; + var flipped = false; + num = num * -1; + for (var i = buf.length; i > 1; i--) { + var byte = num & 255; + num = Math.floor(num / 256); + if (flipped) { + buf[i - 1] = onesComp(byte); + } else if (byte === 0) { + buf[i - 1] = 0; + } else { + flipped = true; + buf[i - 1] = twosComp(byte); + } + } + }; + parse = (buf) => { + const pre = buf[0]; + const value = pre === 128 ? pos(buf.subarray(1, buf.length)) : pre === 255 ? twos(buf) : null; + if (value === null) { + throw Error("invalid base256 encoding"); + } + if (!Number.isSafeInteger(value)) { + throw Error("parsed number outside of javascript safe integer range"); + } + return value; + }; + twos = (buf) => { + var len = buf.length; + var sum = 0; + var flipped = false; + for (var i = len - 1; i > -1; i--) { + var byte = Number(buf[i]); + var f; + if (flipped) { + f = onesComp(byte); + } else if (byte === 0) { + f = byte; + } else { + flipped = true; + f = twosComp(byte); + } + if (f !== 0) { + sum -= f * Math.pow(256, len - i - 1); + } + } + return sum; + }; + pos = (buf) => { + var len = buf.length; + var sum = 0; + for (var i = len - 1; i > -1; i--) { + var byte = Number(buf[i]); + if (byte !== 0) { + sum += byte * Math.pow(256, len - i - 1); + } + } + return sum; + }; + onesComp = (byte) => (255 ^ byte) & 255; + twosComp = (byte) => (255 ^ byte) + 1 & 255; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/types.js +var isCode, name, code; +var init_types = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/types.js"() { + isCode = (c) => name.has(c); + name = /* @__PURE__ */ new Map([ + ["0", "File"], + // same as File + ["", "OldFile"], + ["1", "Link"], + ["2", "SymbolicLink"], + // Devices and FIFOs aren't fully supported + // they are parsed, but skipped when unpacking + ["3", "CharacterDevice"], + ["4", "BlockDevice"], + ["5", "Directory"], + ["6", "FIFO"], + // same as File + ["7", "ContiguousFile"], + // pax headers + ["g", "GlobalExtendedHeader"], + ["x", "ExtendedHeader"], + // vendor-specific stuff + // skip + ["A", "SolarisACL"], + // like 5, but with data, which should be skipped + ["D", "GNUDumpDir"], + // metadata only, skip + ["I", "Inode"], + // data = link path of next file + ["K", "NextFileHasLongLinkpath"], + // data = path of next file + ["L", "NextFileHasLongPath"], + // skip + ["M", "ContinuationFile"], + // like L + ["N", "OldGnuLongPath"], + // skip + ["S", "SparseFile"], + // skip + ["V", "TapeVolumeHeader"], + // like x + ["X", "OldExtendedHeader"] + ]); + code = new Map(Array.from(name).map((kv) => [kv[1], kv[0]])); + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/header.js +var import_node_path, Header, splitPrefix, decString, decDate, numToDate, decNumber, nanUndef, decSmallNumber, MAXNUM, encNumber, encSmallNumber, octalString, padOctal, encDate, NULLS, encString; +var init_header = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/header.js"() { + import_node_path = require("node:path"); + init_large_numbers(); + init_types(); + Header = class { + cksumValid = false; + needPax = false; + nullBlock = false; + block; + path; + mode; + uid; + gid; + size; + cksum; + #type = "Unsupported"; + linkpath; + uname; + gname; + devmaj = 0; + devmin = 0; + atime; + ctime; + mtime; + charset; + comment; + constructor(data, off = 0, ex, gex) { + if (Buffer.isBuffer(data)) { + this.decode(data, off || 0, ex, gex); + } else if (data) { + this.#slurp(data); + } + } + decode(buf, off, ex, gex) { + if (!off) { + off = 0; + } + if (!buf || !(buf.length >= off + 512)) { + throw new Error("need 512 bytes for header"); + } + this.path = ex?.path ?? decString(buf, off, 100); + this.mode = ex?.mode ?? gex?.mode ?? decNumber(buf, off + 100, 8); + this.uid = ex?.uid ?? gex?.uid ?? decNumber(buf, off + 108, 8); + this.gid = ex?.gid ?? gex?.gid ?? decNumber(buf, off + 116, 8); + this.size = ex?.size ?? gex?.size ?? decNumber(buf, off + 124, 12); + this.mtime = ex?.mtime ?? gex?.mtime ?? decDate(buf, off + 136, 12); + this.cksum = decNumber(buf, off + 148, 12); + if (gex) + this.#slurp(gex, true); + if (ex) + this.#slurp(ex); + const t = decString(buf, off + 156, 1); + if (isCode(t)) { + this.#type = t || "0"; + } + if (this.#type === "0" && this.path.slice(-1) === "/") { + this.#type = "5"; + } + if (this.#type === "5") { + this.size = 0; + } + this.linkpath = decString(buf, off + 157, 100); + if (buf.subarray(off + 257, off + 265).toString() === "ustar\x0000") { + this.uname = ex?.uname ?? gex?.uname ?? decString(buf, off + 265, 32); + this.gname = ex?.gname ?? gex?.gname ?? decString(buf, off + 297, 32); + this.devmaj = ex?.devmaj ?? gex?.devmaj ?? decNumber(buf, off + 329, 8) ?? 0; + this.devmin = ex?.devmin ?? gex?.devmin ?? decNumber(buf, off + 337, 8) ?? 0; + if (buf[off + 475] !== 0) { + const prefix = decString(buf, off + 345, 155); + this.path = prefix + "/" + this.path; + } else { + const prefix = decString(buf, off + 345, 130); + if (prefix) { + this.path = prefix + "/" + this.path; + } + this.atime = ex?.atime ?? gex?.atime ?? decDate(buf, off + 476, 12); + this.ctime = ex?.ctime ?? gex?.ctime ?? decDate(buf, off + 488, 12); + } + } + let sum = 8 * 32; + for (let i = off; i < off + 148; i++) { + sum += buf[i]; + } + for (let i = off + 156; i < off + 512; i++) { + sum += buf[i]; + } + this.cksumValid = sum === this.cksum; + if (this.cksum === void 0 && sum === 8 * 32) { + this.nullBlock = true; + } + } + #slurp(ex, gex = false) { + Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => { + return !(v === null || v === void 0 || k === "path" && gex || k === "linkpath" && gex || k === "global"); + }))); + } + encode(buf, off = 0) { + if (!buf) { + buf = this.block = Buffer.alloc(512); + } + if (this.#type === "Unsupported") { + this.#type = "0"; + } + if (!(buf.length >= off + 512)) { + throw new Error("need 512 bytes for header"); + } + const prefixSize = this.ctime || this.atime ? 130 : 155; + const split = splitPrefix(this.path || "", prefixSize); + const path16 = split[0]; + const prefix = split[1]; + this.needPax = !!split[2]; + this.needPax = encString(buf, off, 100, path16) || this.needPax; + this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax; + this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax; + this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax; + this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax; + this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax; + buf[off + 156] = this.#type.charCodeAt(0); + this.needPax = encString(buf, off + 157, 100, this.linkpath) || this.needPax; + buf.write("ustar\x0000", off + 257, 8); + this.needPax = encString(buf, off + 265, 32, this.uname) || this.needPax; + this.needPax = encString(buf, off + 297, 32, this.gname) || this.needPax; + this.needPax = encNumber(buf, off + 329, 8, this.devmaj) || this.needPax; + this.needPax = encNumber(buf, off + 337, 8, this.devmin) || this.needPax; + this.needPax = encString(buf, off + 345, prefixSize, prefix) || this.needPax; + if (buf[off + 475] !== 0) { + this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax; + } else { + this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax; + this.needPax = encDate(buf, off + 476, 12, this.atime) || this.needPax; + this.needPax = encDate(buf, off + 488, 12, this.ctime) || this.needPax; + } + let sum = 8 * 32; + for (let i = off; i < off + 148; i++) { + sum += buf[i]; + } + for (let i = off + 156; i < off + 512; i++) { + sum += buf[i]; + } + this.cksum = sum; + encNumber(buf, off + 148, 8, this.cksum); + this.cksumValid = true; + return this.needPax; + } + get type() { + return this.#type === "Unsupported" ? this.#type : name.get(this.#type); + } + get typeKey() { + return this.#type; + } + set type(type) { + const c = String(code.get(type)); + if (isCode(c) || c === "Unsupported") { + this.#type = c; + } else if (isCode(type)) { + this.#type = type; + } else { + throw new TypeError("invalid entry type: " + type); + } + } + }; + splitPrefix = (p, prefixSize) => { + const pathSize = 100; + let pp = p; + let prefix = ""; + let ret = void 0; + const root = import_node_path.posix.parse(p).root || "."; + if (Buffer.byteLength(pp) < pathSize) { + ret = [pp, prefix, false]; + } else { + prefix = import_node_path.posix.dirname(pp); + pp = import_node_path.posix.basename(pp); + do { + if (Buffer.byteLength(pp) <= pathSize && Buffer.byteLength(prefix) <= prefixSize) { + ret = [pp, prefix, false]; + } else if (Buffer.byteLength(pp) > pathSize && Buffer.byteLength(prefix) <= prefixSize) { + ret = [pp.slice(0, pathSize - 1), prefix, true]; + } else { + pp = import_node_path.posix.join(import_node_path.posix.basename(prefix), pp); + prefix = import_node_path.posix.dirname(prefix); + } + } while (prefix !== root && ret === void 0); + if (!ret) { + ret = [p.slice(0, pathSize - 1), "", true]; + } + } + return ret; + }; + decString = (buf, off, size) => buf.subarray(off, off + size).toString("utf8").replace(/\0.*/, ""); + decDate = (buf, off, size) => numToDate(decNumber(buf, off, size)); + numToDate = (num) => num === void 0 ? void 0 : new Date(num * 1e3); + decNumber = (buf, off, size) => Number(buf[off]) & 128 ? parse(buf.subarray(off, off + size)) : decSmallNumber(buf, off, size); + nanUndef = (value) => isNaN(value) ? void 0 : value; + decSmallNumber = (buf, off, size) => nanUndef(parseInt(buf.subarray(off, off + size).toString("utf8").replace(/\0.*$/, "").trim(), 8)); + MAXNUM = { + 12: 8589934591, + 8: 2097151 + }; + encNumber = (buf, off, size, num) => num === void 0 ? false : num > MAXNUM[size] || num < 0 ? (encode(num, buf.subarray(off, off + size)), true) : (encSmallNumber(buf, off, size, num), false); + encSmallNumber = (buf, off, size, num) => buf.write(octalString(num, size), off, size, "ascii"); + octalString = (num, size) => padOctal(Math.floor(num).toString(8), size); + padOctal = (str, size) => (str.length === size - 1 ? str : new Array(size - str.length - 1).join("0") + str + " ") + "\0"; + encDate = (buf, off, size, date) => date === void 0 ? false : encNumber(buf, off, size, date.getTime() / 1e3); + NULLS = new Array(156).join("\0"); + encString = (buf, off, size, str) => str === void 0 ? false : (buf.write(str + NULLS, off, size, "utf8"), str.length !== Buffer.byteLength(str) || str.length > size); + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/pax.js +var import_node_path2, Pax, merge, parseKV, parseKVLine; +var init_pax = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/pax.js"() { + import_node_path2 = require("node:path"); + init_header(); + Pax = class _Pax { + atime; + mtime; + ctime; + charset; + comment; + gid; + uid; + gname; + uname; + linkpath; + dev; + ino; + nlink; + path; + size; + mode; + global; + constructor(obj, global2 = false) { + this.atime = obj.atime; + this.charset = obj.charset; + this.comment = obj.comment; + this.ctime = obj.ctime; + this.dev = obj.dev; + this.gid = obj.gid; + this.global = global2; + this.gname = obj.gname; + this.ino = obj.ino; + this.linkpath = obj.linkpath; + this.mtime = obj.mtime; + this.nlink = obj.nlink; + this.path = obj.path; + this.size = obj.size; + this.uid = obj.uid; + this.uname = obj.uname; + } + encode() { + const body = this.encodeBody(); + if (body === "") { + return Buffer.allocUnsafe(0); + } + const bodyLen = Buffer.byteLength(body); + const bufLen = 512 * Math.ceil(1 + bodyLen / 512); + const buf = Buffer.allocUnsafe(bufLen); + for (let i = 0; i < 512; i++) { + buf[i] = 0; + } + new Header({ + // XXX split the path + // then the path should be PaxHeader + basename, but less than 99, + // prepend with the dirname + /* c8 ignore start */ + path: ("PaxHeader/" + (0, import_node_path2.basename)(this.path ?? "")).slice(0, 99), + /* c8 ignore stop */ + mode: this.mode || 420, + uid: this.uid, + gid: this.gid, + size: bodyLen, + mtime: this.mtime, + type: this.global ? "GlobalExtendedHeader" : "ExtendedHeader", + linkpath: "", + uname: this.uname || "", + gname: this.gname || "", + devmaj: 0, + devmin: 0, + atime: this.atime, + ctime: this.ctime + }).encode(buf); + buf.write(body, 512, bodyLen, "utf8"); + for (let i = bodyLen + 512; i < buf.length; i++) { + buf[i] = 0; + } + return buf; + } + encodeBody() { + return this.encodeField("path") + this.encodeField("ctime") + this.encodeField("atime") + this.encodeField("dev") + this.encodeField("ino") + this.encodeField("nlink") + this.encodeField("charset") + this.encodeField("comment") + this.encodeField("gid") + this.encodeField("gname") + this.encodeField("linkpath") + this.encodeField("mtime") + this.encodeField("size") + this.encodeField("uid") + this.encodeField("uname"); + } + encodeField(field) { + if (this[field] === void 0) { + return ""; + } + const r = this[field]; + const v = r instanceof Date ? r.getTime() / 1e3 : r; + const s = " " + (field === "dev" || field === "ino" || field === "nlink" ? "SCHILY." : "") + field + "=" + v + "\n"; + const byteLen = Buffer.byteLength(s); + let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1; + if (byteLen + digits >= Math.pow(10, digits)) { + digits += 1; + } + const len = digits + byteLen; + return len + s; + } + static parse(str, ex, g = false) { + return new _Pax(merge(parseKV(str), ex), g); + } + }; + merge = (a, b) => b ? Object.assign({}, b, a) : a; + parseKV = (str) => str.replace(/\n$/, "").split("\n").reduce(parseKVLine, /* @__PURE__ */ Object.create(null)); + parseKVLine = (set, line) => { + const n = parseInt(line, 10); + if (n !== Buffer.byteLength(line) + 1) { + return set; + } + line = line.slice((n + " ").length); + const kv = line.split("="); + const r = kv.shift(); + if (!r) { + return set; + } + const k = r.replace(/^SCHILY\.(dev|ino|nlink)/, "$1"); + const v = kv.join("="); + set[k] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(k) ? new Date(Number(v) * 1e3) : /^[0-9]+$/.test(v) ? +v : v; + return set; + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/normalize-windows-path.js +var platform, normalizeWindowsPath; +var init_normalize_windows_path = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/normalize-windows-path.js"() { + platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform; + normalizeWindowsPath = platform !== "win32" ? (p) => p : (p) => p && p.replace(/\\/g, "/"); + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/read-entry.js +var ReadEntry; +var init_read_entry = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/read-entry.js"() { + init_esm(); + init_normalize_windows_path(); + ReadEntry = class extends Minipass { + extended; + globalExtended; + header; + startBlockSize; + blockRemain; + remain; + type; + meta = false; + ignore = false; + path; + mode; + uid; + gid; + uname; + gname; + size = 0; + mtime; + atime; + ctime; + linkpath; + dev; + ino; + nlink; + invalid = false; + absolute; + unsupported = false; + constructor(header, ex, gex) { + super({}); + this.pause(); + this.extended = ex; + this.globalExtended = gex; + this.header = header; + this.remain = header.size ?? 0; + this.startBlockSize = 512 * Math.ceil(this.remain / 512); + this.blockRemain = this.startBlockSize; + this.type = header.type; + switch (this.type) { + case "File": + case "OldFile": + case "Link": + case "SymbolicLink": + case "CharacterDevice": + case "BlockDevice": + case "Directory": + case "FIFO": + case "ContiguousFile": + case "GNUDumpDir": + break; + case "NextFileHasLongLinkpath": + case "NextFileHasLongPath": + case "OldGnuLongPath": + case "GlobalExtendedHeader": + case "ExtendedHeader": + case "OldExtendedHeader": + this.meta = true; + break; + // NOTE: gnutar and bsdtar treat unrecognized types as 'File' + // it may be worth doing the same, but with a warning. + default: + this.ignore = true; + } + if (!header.path) { + throw new Error("no path provided for tar.ReadEntry"); + } + this.path = normalizeWindowsPath(header.path); + this.mode = header.mode; + if (this.mode) { + this.mode = this.mode & 4095; + } + this.uid = header.uid; + this.gid = header.gid; + this.uname = header.uname; + this.gname = header.gname; + this.size = this.remain; + this.mtime = header.mtime; + this.atime = header.atime; + this.ctime = header.ctime; + this.linkpath = header.linkpath ? normalizeWindowsPath(header.linkpath) : void 0; + this.uname = header.uname; + this.gname = header.gname; + if (ex) { + this.#slurp(ex); + } + if (gex) { + this.#slurp(gex, true); + } + } + write(data) { + const writeLen = data.length; + if (writeLen > this.blockRemain) { + throw new Error("writing more to entry than is appropriate"); + } + const r = this.remain; + const br = this.blockRemain; + this.remain = Math.max(0, r - writeLen); + this.blockRemain = Math.max(0, br - writeLen); + if (this.ignore) { + return true; + } + if (r >= writeLen) { + return super.write(data); + } + return super.write(data.subarray(0, r)); + } + #slurp(ex, gex = false) { + if (ex.path) + ex.path = normalizeWindowsPath(ex.path); + if (ex.linkpath) + ex.linkpath = normalizeWindowsPath(ex.linkpath); + Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => { + return !(v === null || v === void 0 || k === "path" && gex); + }))); + } + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/warn-method.js +var warnMethod; +var init_warn_method = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/warn-method.js"() { + warnMethod = (self2, code2, message, data = {}) => { + if (self2.file) { + data.file = self2.file; + } + if (self2.cwd) { + data.cwd = self2.cwd; + } + data.code = message instanceof Error && message.code || code2; + data.tarCode = code2; + if (!self2.strict && data.recoverable !== false) { + if (message instanceof Error) { + data = Object.assign(message, data); + message = message.message; + } + self2.emit("warn", code2, message, data); + } else if (message instanceof Error) { + self2.emit("error", Object.assign(message, data)); + } else { + self2.emit("error", Object.assign(new Error(`${code2}: ${message}`), data)); + } + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/parse.js +var import_events3, maxMetaEntrySize, gzipHeader, zstdHeader, ZIP_HEADER_LEN, STATE, WRITEENTRY, READENTRY, NEXTENTRY, PROCESSENTRY, EX, GEX, META, EMITMETA, BUFFER2, QUEUE, ENDED, EMITTEDEND, EMIT, UNZIP, CONSUMECHUNK, CONSUMECHUNKSUB, CONSUMEBODY, CONSUMEMETA, CONSUMEHEADER, CONSUMING, BUFFERCONCAT, MAYBEEND, WRITING, ABORTED2, DONE, SAW_VALID_ENTRY, SAW_NULL_BLOCK, SAW_EOF, CLOSESTREAM, noop2, Parser; +var init_parse = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/parse.js"() { + import_events3 = require("events"); + init_esm3(); + init_header(); + init_pax(); + init_read_entry(); + init_warn_method(); + maxMetaEntrySize = 1024 * 1024; + gzipHeader = Buffer.from([31, 139]); + zstdHeader = Buffer.from([40, 181, 47, 253]); + ZIP_HEADER_LEN = Math.max(gzipHeader.length, zstdHeader.length); + STATE = Symbol("state"); + WRITEENTRY = Symbol("writeEntry"); + READENTRY = Symbol("readEntry"); + NEXTENTRY = Symbol("nextEntry"); + PROCESSENTRY = Symbol("processEntry"); + EX = Symbol("extendedHeader"); + GEX = Symbol("globalExtendedHeader"); + META = Symbol("meta"); + EMITMETA = Symbol("emitMeta"); + BUFFER2 = Symbol("buffer"); + QUEUE = Symbol("queue"); + ENDED = Symbol("ended"); + EMITTEDEND = Symbol("emittedEnd"); + EMIT = Symbol("emit"); + UNZIP = Symbol("unzip"); + CONSUMECHUNK = Symbol("consumeChunk"); + CONSUMECHUNKSUB = Symbol("consumeChunkSub"); + CONSUMEBODY = Symbol("consumeBody"); + CONSUMEMETA = Symbol("consumeMeta"); + CONSUMEHEADER = Symbol("consumeHeader"); + CONSUMING = Symbol("consuming"); + BUFFERCONCAT = Symbol("bufferConcat"); + MAYBEEND = Symbol("maybeEnd"); + WRITING = Symbol("writing"); + ABORTED2 = Symbol("aborted"); + DONE = Symbol("onDone"); + SAW_VALID_ENTRY = Symbol("sawValidEntry"); + SAW_NULL_BLOCK = Symbol("sawNullBlock"); + SAW_EOF = Symbol("sawEOF"); + CLOSESTREAM = Symbol("closeStream"); + noop2 = () => true; + Parser = class extends import_events3.EventEmitter { + file; + strict; + maxMetaEntrySize; + filter; + brotli; + zstd; + writable = true; + readable = false; + [QUEUE] = []; + [BUFFER2]; + [READENTRY]; + [WRITEENTRY]; + [STATE] = "begin"; + [META] = ""; + [EX]; + [GEX]; + [ENDED] = false; + [UNZIP]; + [ABORTED2] = false; + [SAW_VALID_ENTRY]; + [SAW_NULL_BLOCK] = false; + [SAW_EOF] = false; + [WRITING] = false; + [CONSUMING] = false; + [EMITTEDEND] = false; + constructor(opt = {}) { + super(); + this.file = opt.file || ""; + this.on(DONE, () => { + if (this[STATE] === "begin" || this[SAW_VALID_ENTRY] === false) { + this.warn("TAR_BAD_ARCHIVE", "Unrecognized archive format"); + } + }); + if (opt.ondone) { + this.on(DONE, opt.ondone); + } else { + this.on(DONE, () => { + this.emit("prefinish"); + this.emit("finish"); + this.emit("end"); + }); + } + this.strict = !!opt.strict; + this.maxMetaEntrySize = opt.maxMetaEntrySize || maxMetaEntrySize; + this.filter = typeof opt.filter === "function" ? opt.filter : noop2; + const isTBR = opt.file && (opt.file.endsWith(".tar.br") || opt.file.endsWith(".tbr")); + this.brotli = !(opt.gzip || opt.zstd) && opt.brotli !== void 0 ? opt.brotli : isTBR ? void 0 : false; + const isTZST = opt.file && (opt.file.endsWith(".tar.zst") || opt.file.endsWith(".tzst")); + this.zstd = !(opt.gzip || opt.brotli) && opt.zstd !== void 0 ? opt.zstd : isTZST ? true : void 0; + this.on("end", () => this[CLOSESTREAM]()); + if (typeof opt.onwarn === "function") { + this.on("warn", opt.onwarn); + } + if (typeof opt.onReadEntry === "function") { + this.on("entry", opt.onReadEntry); + } + } + warn(code2, message, data = {}) { + warnMethod(this, code2, message, data); + } + [CONSUMEHEADER](chunk, position) { + if (this[SAW_VALID_ENTRY] === void 0) { + this[SAW_VALID_ENTRY] = false; + } + let header; + try { + header = new Header(chunk, position, this[EX], this[GEX]); + } catch (er) { + return this.warn("TAR_ENTRY_INVALID", er); + } + if (header.nullBlock) { + if (this[SAW_NULL_BLOCK]) { + this[SAW_EOF] = true; + if (this[STATE] === "begin") { + this[STATE] = "header"; + } + this[EMIT]("eof"); + } else { + this[SAW_NULL_BLOCK] = true; + this[EMIT]("nullBlock"); + } + } else { + this[SAW_NULL_BLOCK] = false; + if (!header.cksumValid) { + this.warn("TAR_ENTRY_INVALID", "checksum failure", { header }); + } else if (!header.path) { + this.warn("TAR_ENTRY_INVALID", "path is required", { header }); + } else { + const type = header.type; + if (/^(Symbolic)?Link$/.test(type) && !header.linkpath) { + this.warn("TAR_ENTRY_INVALID", "linkpath required", { + header + }); + } else if (!/^(Symbolic)?Link$/.test(type) && !/^(Global)?ExtendedHeader$/.test(type) && header.linkpath) { + this.warn("TAR_ENTRY_INVALID", "linkpath forbidden", { + header + }); + } else { + const entry = this[WRITEENTRY] = new ReadEntry(header, this[EX], this[GEX]); + if (!this[SAW_VALID_ENTRY]) { + if (entry.remain) { + const onend = () => { + if (!entry.invalid) { + this[SAW_VALID_ENTRY] = true; + } + }; + entry.on("end", onend); + } else { + this[SAW_VALID_ENTRY] = true; + } + } + if (entry.meta) { + if (entry.size > this.maxMetaEntrySize) { + entry.ignore = true; + this[EMIT]("ignoredEntry", entry); + this[STATE] = "ignore"; + entry.resume(); + } else if (entry.size > 0) { + this[META] = ""; + entry.on("data", (c) => this[META] += c); + this[STATE] = "meta"; + } + } else { + this[EX] = void 0; + entry.ignore = entry.ignore || !this.filter(entry.path, entry); + if (entry.ignore) { + this[EMIT]("ignoredEntry", entry); + this[STATE] = entry.remain ? "ignore" : "header"; + entry.resume(); + } else { + if (entry.remain) { + this[STATE] = "body"; + } else { + this[STATE] = "header"; + entry.end(); + } + if (!this[READENTRY]) { + this[QUEUE].push(entry); + this[NEXTENTRY](); + } else { + this[QUEUE].push(entry); + } + } + } + } + } + } + } + [CLOSESTREAM]() { + queueMicrotask(() => this.emit("close")); + } + [PROCESSENTRY](entry) { + let go = true; + if (!entry) { + this[READENTRY] = void 0; + go = false; + } else if (Array.isArray(entry)) { + const [ev, ...args] = entry; + this.emit(ev, ...args); + } else { + this[READENTRY] = entry; + this.emit("entry", entry); + if (!entry.emittedEnd) { + entry.on("end", () => this[NEXTENTRY]()); + go = false; + } + } + return go; + } + [NEXTENTRY]() { + do { + } while (this[PROCESSENTRY](this[QUEUE].shift())); + if (!this[QUEUE].length) { + const re = this[READENTRY]; + const drainNow = !re || re.flowing || re.size === re.remain; + if (drainNow) { + if (!this[WRITING]) { + this.emit("drain"); + } + } else { + re.once("drain", () => this.emit("drain")); + } + } + } + [CONSUMEBODY](chunk, position) { + const entry = this[WRITEENTRY]; + if (!entry) { + throw new Error("attempt to consume body without entry??"); + } + const br = entry.blockRemain ?? 0; + const c = br >= chunk.length && position === 0 ? chunk : chunk.subarray(position, position + br); + entry.write(c); + if (!entry.blockRemain) { + this[STATE] = "header"; + this[WRITEENTRY] = void 0; + entry.end(); + } + return c.length; + } + [CONSUMEMETA](chunk, position) { + const entry = this[WRITEENTRY]; + const ret = this[CONSUMEBODY](chunk, position); + if (!this[WRITEENTRY] && entry) { + this[EMITMETA](entry); + } + return ret; + } + [EMIT](ev, data, extra) { + if (!this[QUEUE].length && !this[READENTRY]) { + this.emit(ev, data, extra); + } else { + this[QUEUE].push([ev, data, extra]); + } + } + [EMITMETA](entry) { + this[EMIT]("meta", this[META]); + switch (entry.type) { + case "ExtendedHeader": + case "OldExtendedHeader": + this[EX] = Pax.parse(this[META], this[EX], false); + break; + case "GlobalExtendedHeader": + this[GEX] = Pax.parse(this[META], this[GEX], true); + break; + case "NextFileHasLongPath": + case "OldGnuLongPath": { + const ex = this[EX] ?? /* @__PURE__ */ Object.create(null); + this[EX] = ex; + ex.path = this[META].replace(/\0.*/, ""); + break; + } + case "NextFileHasLongLinkpath": { + const ex = this[EX] || /* @__PURE__ */ Object.create(null); + this[EX] = ex; + ex.linkpath = this[META].replace(/\0.*/, ""); + break; + } + /* c8 ignore start */ + default: + throw new Error("unknown meta: " + entry.type); + } + } + abort(error) { + this[ABORTED2] = true; + this.emit("abort", error); + this.warn("TAR_ABORT", error, { recoverable: false }); + } + write(chunk, encoding, cb) { + if (typeof encoding === "function") { + cb = encoding; + encoding = void 0; + } + if (typeof chunk === "string") { + chunk = Buffer.from( + chunk, + /* c8 ignore next */ + typeof encoding === "string" ? encoding : "utf8" + ); + } + if (this[ABORTED2]) { + cb?.(); + return false; + } + const needSniff = this[UNZIP] === void 0 || this.brotli === void 0 && this[UNZIP] === false; + if (needSniff && chunk) { + if (this[BUFFER2]) { + chunk = Buffer.concat([this[BUFFER2], chunk]); + this[BUFFER2] = void 0; + } + if (chunk.length < ZIP_HEADER_LEN) { + this[BUFFER2] = chunk; + cb?.(); + return true; + } + for (let i = 0; this[UNZIP] === void 0 && i < gzipHeader.length; i++) { + if (chunk[i] !== gzipHeader[i]) { + this[UNZIP] = false; + } + } + let isZstd = false; + if (this[UNZIP] === false && this.zstd !== false) { + isZstd = true; + for (let i = 0; i < zstdHeader.length; i++) { + if (chunk[i] !== zstdHeader[i]) { + isZstd = false; + break; + } + } + } + const maybeBrotli = this.brotli === void 0 && !isZstd; + if (this[UNZIP] === false && maybeBrotli) { + if (chunk.length < 512) { + if (this[ENDED]) { + this.brotli = true; + } else { + this[BUFFER2] = chunk; + cb?.(); + return true; + } + } else { + try { + new Header(chunk.subarray(0, 512)); + this.brotli = false; + } catch (_) { + this.brotli = true; + } + } + } + if (this[UNZIP] === void 0 || this[UNZIP] === false && (this.brotli || isZstd)) { + const ended = this[ENDED]; + this[ENDED] = false; + this[UNZIP] = this[UNZIP] === void 0 ? new Unzip({}) : isZstd ? new ZstdDecompress({}) : new BrotliDecompress({}); + this[UNZIP].on("data", (chunk2) => this[CONSUMECHUNK](chunk2)); + this[UNZIP].on("error", (er) => this.abort(er)); + this[UNZIP].on("end", () => { + this[ENDED] = true; + this[CONSUMECHUNK](); + }); + this[WRITING] = true; + const ret2 = !!this[UNZIP][ended ? "end" : "write"](chunk); + this[WRITING] = false; + cb?.(); + return ret2; + } + } + this[WRITING] = true; + if (this[UNZIP]) { + this[UNZIP].write(chunk); + } else { + this[CONSUMECHUNK](chunk); + } + this[WRITING] = false; + const ret = this[QUEUE].length ? false : this[READENTRY] ? this[READENTRY].flowing : true; + if (!ret && !this[QUEUE].length) { + this[READENTRY]?.once("drain", () => this.emit("drain")); + } + cb?.(); + return ret; + } + [BUFFERCONCAT](c) { + if (c && !this[ABORTED2]) { + this[BUFFER2] = this[BUFFER2] ? Buffer.concat([this[BUFFER2], c]) : c; + } + } + [MAYBEEND]() { + if (this[ENDED] && !this[EMITTEDEND] && !this[ABORTED2] && !this[CONSUMING]) { + this[EMITTEDEND] = true; + const entry = this[WRITEENTRY]; + if (entry && entry.blockRemain) { + const have = this[BUFFER2] ? this[BUFFER2].length : 0; + this.warn("TAR_BAD_ARCHIVE", `Truncated input (needed ${entry.blockRemain} more bytes, only ${have} available)`, { entry }); + if (this[BUFFER2]) { + entry.write(this[BUFFER2]); + } + entry.end(); + } + this[EMIT](DONE); + } + } + [CONSUMECHUNK](chunk) { + if (this[CONSUMING] && chunk) { + this[BUFFERCONCAT](chunk); + } else if (!chunk && !this[BUFFER2]) { + this[MAYBEEND](); + } else if (chunk) { + this[CONSUMING] = true; + if (this[BUFFER2]) { + this[BUFFERCONCAT](chunk); + const c = this[BUFFER2]; + this[BUFFER2] = void 0; + this[CONSUMECHUNKSUB](c); + } else { + this[CONSUMECHUNKSUB](chunk); + } + while (this[BUFFER2] && this[BUFFER2]?.length >= 512 && !this[ABORTED2] && !this[SAW_EOF]) { + const c = this[BUFFER2]; + this[BUFFER2] = void 0; + this[CONSUMECHUNKSUB](c); + } + this[CONSUMING] = false; + } + if (!this[BUFFER2] || this[ENDED]) { + this[MAYBEEND](); + } + } + [CONSUMECHUNKSUB](chunk) { + let position = 0; + const length = chunk.length; + while (position + 512 <= length && !this[ABORTED2] && !this[SAW_EOF]) { + switch (this[STATE]) { + case "begin": + case "header": + this[CONSUMEHEADER](chunk, position); + position += 512; + break; + case "ignore": + case "body": + position += this[CONSUMEBODY](chunk, position); + break; + case "meta": + position += this[CONSUMEMETA](chunk, position); + break; + /* c8 ignore start */ + default: + throw new Error("invalid state: " + this[STATE]); + } + } + if (position < length) { + if (this[BUFFER2]) { + this[BUFFER2] = Buffer.concat([ + chunk.subarray(position), + this[BUFFER2] + ]); + } else { + this[BUFFER2] = chunk.subarray(position); + } + } + } + end(chunk, encoding, cb) { + if (typeof chunk === "function") { + cb = chunk; + encoding = void 0; + chunk = void 0; + } + if (typeof encoding === "function") { + cb = encoding; + encoding = void 0; + } + if (typeof chunk === "string") { + chunk = Buffer.from(chunk, encoding); + } + if (cb) + this.once("finish", cb); + if (!this[ABORTED2]) { + if (this[UNZIP]) { + if (chunk) + this[UNZIP].write(chunk); + this[UNZIP].end(); + } else { + this[ENDED] = true; + if (this.brotli === void 0 || this.zstd === void 0) + chunk = chunk || Buffer.alloc(0); + if (chunk) + this.write(chunk); + this[MAYBEEND](); + } + } + return this; + } + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/strip-trailing-slashes.js +var stripTrailingSlashes; +var init_strip_trailing_slashes = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/strip-trailing-slashes.js"() { + stripTrailingSlashes = (str) => { + let i = str.length - 1; + let slashesStart = -1; + while (i > -1 && str.charAt(i) === "/") { + slashesStart = i; + i--; + } + return slashesStart === -1 ? str : str.slice(0, slashesStart); + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/list.js +var list_exports = {}; +__export(list_exports, { + filesFilter: () => filesFilter, + list: () => list +}); +var import_node_fs, import_path2, onReadEntryFunction, filesFilter, listFileSync, listFile, list; +var init_list = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/list.js"() { + init_esm2(); + import_node_fs = __toESM(require("node:fs"), 1); + import_path2 = require("path"); + init_make_command(); + init_parse(); + init_strip_trailing_slashes(); + onReadEntryFunction = (opt) => { + const onReadEntry = opt.onReadEntry; + opt.onReadEntry = onReadEntry ? (e) => { + onReadEntry(e); + e.resume(); + } : (e) => e.resume(); + }; + filesFilter = (opt, files) => { + const map = new Map(files.map((f) => [stripTrailingSlashes(f), true])); + const filter = opt.filter; + const mapHas = (file, r = "") => { + const root = r || (0, import_path2.parse)(file).root || "."; + let ret; + if (file === root) + ret = false; + else { + const m = map.get(file); + if (m !== void 0) { + ret = m; + } else { + ret = mapHas((0, import_path2.dirname)(file), root); + } + } + map.set(file, ret); + return ret; + }; + opt.filter = filter ? (file, entry) => filter(file, entry) && mapHas(stripTrailingSlashes(file)) : (file) => mapHas(stripTrailingSlashes(file)); + }; + listFileSync = (opt) => { + const p = new Parser(opt); + const file = opt.file; + let fd; + try { + fd = import_node_fs.default.openSync(file, "r"); + const stat = import_node_fs.default.fstatSync(fd); + const readSize = opt.maxReadSize || 16 * 1024 * 1024; + if (stat.size < readSize) { + const buf = Buffer.allocUnsafe(stat.size); + const read = import_node_fs.default.readSync(fd, buf, 0, stat.size, 0); + p.end(read === buf.byteLength ? buf : buf.subarray(0, read)); + } else { + let pos2 = 0; + const buf = Buffer.allocUnsafe(readSize); + while (pos2 < stat.size) { + const bytesRead = import_node_fs.default.readSync(fd, buf, 0, readSize, pos2); + if (bytesRead === 0) + break; + pos2 += bytesRead; + p.write(buf.subarray(0, bytesRead)); + } + p.end(); + } + } finally { + if (typeof fd === "number") { + try { + import_node_fs.default.closeSync(fd); + } catch (er) { + } + } + } + }; + listFile = (opt, _files) => { + const parse4 = new Parser(opt); + const readSize = opt.maxReadSize || 16 * 1024 * 1024; + const file = opt.file; + const p = new Promise((resolve, reject) => { + parse4.on("error", reject); + parse4.on("end", resolve); + import_node_fs.default.stat(file, (er, stat) => { + if (er) { + reject(er); + } else { + const stream = new ReadStream(file, { + readSize, + size: stat.size + }); + stream.on("error", reject); + stream.pipe(parse4); + } + }); + }); + return p; + }; + list = makeCommand(listFileSync, listFile, (opt) => new Parser(opt), (opt) => new Parser(opt), (opt, files) => { + if (files?.length) + filesFilter(opt, files); + if (!opt.noResume) + onReadEntryFunction(opt); + }); + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/get-write-flag.js +var import_fs3, platform2, isWindows, O_CREAT, O_TRUNC, O_WRONLY, UV_FS_O_FILEMAP, fMapEnabled, fMapLimit, fMapFlag, getWriteFlag; +var init_get_write_flag = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/get-write-flag.js"() { + import_fs3 = __toESM(require("fs"), 1); + platform2 = process.env.__FAKE_PLATFORM__ || process.platform; + isWindows = platform2 === "win32"; + ({ O_CREAT, O_TRUNC, O_WRONLY } = import_fs3.default.constants); + UV_FS_O_FILEMAP = Number(process.env.__FAKE_FS_O_FILENAME__) || import_fs3.default.constants.UV_FS_O_FILEMAP || 0; + fMapEnabled = isWindows && !!UV_FS_O_FILEMAP; + fMapLimit = 512 * 1024; + fMapFlag = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY; + getWriteFlag = !fMapEnabled ? () => "w" : (size) => size < fMapLimit ? fMapFlag : "w"; + } +}); + +// .yarn/cache/chownr-npm-3.0.0-5275e85d25-43925b8770.zip/node_modules/chownr/dist/esm/index.js +var import_node_fs2, import_node_path3, lchownSync, chown, chownrKid, chownr, chownrKidSync, chownrSync; +var init_esm4 = __esm({ + ".yarn/cache/chownr-npm-3.0.0-5275e85d25-43925b8770.zip/node_modules/chownr/dist/esm/index.js"() { + import_node_fs2 = __toESM(require("node:fs"), 1); + import_node_path3 = __toESM(require("node:path"), 1); + lchownSync = (path16, uid, gid) => { + try { + return import_node_fs2.default.lchownSync(path16, uid, gid); + } catch (er) { + if (er?.code !== "ENOENT") + throw er; + } + }; + chown = (cpath, uid, gid, cb) => { + import_node_fs2.default.lchown(cpath, uid, gid, (er) => { + cb(er && er?.code !== "ENOENT" ? er : null); + }); + }; + chownrKid = (p, child, uid, gid, cb) => { + if (child.isDirectory()) { + chownr(import_node_path3.default.resolve(p, child.name), uid, gid, (er) => { + if (er) + return cb(er); + const cpath = import_node_path3.default.resolve(p, child.name); + chown(cpath, uid, gid, cb); + }); + } else { + const cpath = import_node_path3.default.resolve(p, child.name); + chown(cpath, uid, gid, cb); + } + }; + chownr = (p, uid, gid, cb) => { + import_node_fs2.default.readdir(p, { withFileTypes: true }, (er, children) => { + if (er) { + if (er.code === "ENOENT") + return cb(); + else if (er.code !== "ENOTDIR" && er.code !== "ENOTSUP") + return cb(er); + } + if (er || !children.length) + return chown(p, uid, gid, cb); + let len = children.length; + let errState = null; + const then = (er2) => { + if (errState) + return; + if (er2) + return cb(errState = er2); + if (--len === 0) + return chown(p, uid, gid, cb); + }; + for (const child of children) { + chownrKid(p, child, uid, gid, then); + } + }); + }; + chownrKidSync = (p, child, uid, gid) => { + if (child.isDirectory()) + chownrSync(import_node_path3.default.resolve(p, child.name), uid, gid); + lchownSync(import_node_path3.default.resolve(p, child.name), uid, gid); + }; + chownrSync = (p, uid, gid) => { + let children; + try { + children = import_node_fs2.default.readdirSync(p, { withFileTypes: true }); + } catch (er) { + const e = er; + if (e?.code === "ENOENT") + return; + else if (e?.code === "ENOTDIR" || e?.code === "ENOTSUP") + return lchownSync(p, uid, gid); + else + throw e; + } + for (const child of children) { + chownrKidSync(p, child, uid, gid); + } + return lchownSync(p, uid, gid); + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/cwd-error.js +var CwdError; +var init_cwd_error = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/cwd-error.js"() { + CwdError = class extends Error { + path; + code; + syscall = "chdir"; + constructor(path16, code2) { + super(`${code2}: Cannot cd into '${path16}'`); + this.path = path16; + this.code = code2; + } + get name() { + return "CwdError"; + } + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/symlink-error.js +var SymlinkError; +var init_symlink_error = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/symlink-error.js"() { + SymlinkError = class extends Error { + path; + symlink; + syscall = "symlink"; + code = "TAR_SYMLINK_ERROR"; + constructor(symlink, path16) { + super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"); + this.symlink = symlink; + this.path = path16; + } + get name() { + return "SymlinkError"; + } + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/mkdir.js +var import_node_fs3, import_promises, import_node_path4, checkCwd, mkdir, mkdir_, onmkdir, checkCwdSync, mkdirSync2; +var init_mkdir = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/mkdir.js"() { + init_esm4(); + import_node_fs3 = __toESM(require("node:fs"), 1); + import_promises = __toESM(require("node:fs/promises"), 1); + import_node_path4 = __toESM(require("node:path"), 1); + init_cwd_error(); + init_normalize_windows_path(); + init_symlink_error(); + checkCwd = (dir, cb) => { + import_node_fs3.default.stat(dir, (er, st) => { + if (er || !st.isDirectory()) { + er = new CwdError(dir, er?.code || "ENOTDIR"); + } + cb(er); + }); + }; + mkdir = (dir, opt, cb) => { + dir = normalizeWindowsPath(dir); + const umask = opt.umask ?? 18; + const mode = opt.mode | 448; + const needChmod = (mode & umask) !== 0; + const uid = opt.uid; + const gid = opt.gid; + const doChown = typeof uid === "number" && typeof gid === "number" && (uid !== opt.processUid || gid !== opt.processGid); + const preserve = opt.preserve; + const unlink = opt.unlink; + const cwd = normalizeWindowsPath(opt.cwd); + const done = (er, created) => { + if (er) { + cb(er); + } else { + if (created && doChown) { + chownr(created, uid, gid, (er2) => done(er2)); + } else if (needChmod) { + import_node_fs3.default.chmod(dir, mode, cb); + } else { + cb(); + } + } + }; + if (dir === cwd) { + return checkCwd(dir, done); + } + if (preserve) { + return import_promises.default.mkdir(dir, { mode, recursive: true }).then( + (made) => done(null, made ?? void 0), + // oh, ts + done + ); + } + const sub = normalizeWindowsPath(import_node_path4.default.relative(cwd, dir)); + const parts = sub.split("/"); + mkdir_(cwd, parts, mode, unlink, cwd, void 0, done); + }; + mkdir_ = (base, parts, mode, unlink, cwd, created, cb) => { + if (!parts.length) { + return cb(null, created); + } + const p = parts.shift(); + const part = normalizeWindowsPath(import_node_path4.default.resolve(base + "/" + p)); + import_node_fs3.default.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb)); + }; + onmkdir = (part, parts, mode, unlink, cwd, created, cb) => (er) => { + if (er) { + import_node_fs3.default.lstat(part, (statEr, st) => { + if (statEr) { + statEr.path = statEr.path && normalizeWindowsPath(statEr.path); + cb(statEr); + } else if (st.isDirectory()) { + mkdir_(part, parts, mode, unlink, cwd, created, cb); + } else if (unlink) { + import_node_fs3.default.unlink(part, (er2) => { + if (er2) { + return cb(er2); + } + import_node_fs3.default.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb)); + }); + } else if (st.isSymbolicLink()) { + return cb(new SymlinkError(part, part + "/" + parts.join("/"))); + } else { + cb(er); + } + }); + } else { + created = created || part; + mkdir_(part, parts, mode, unlink, cwd, created, cb); + } + }; + checkCwdSync = (dir) => { + let ok = false; + let code2 = void 0; + try { + ok = import_node_fs3.default.statSync(dir).isDirectory(); + } catch (er) { + code2 = er?.code; + } finally { + if (!ok) { + throw new CwdError(dir, code2 ?? "ENOTDIR"); + } + } + }; + mkdirSync2 = (dir, opt) => { + dir = normalizeWindowsPath(dir); + const umask = opt.umask ?? 18; + const mode = opt.mode | 448; + const needChmod = (mode & umask) !== 0; + const uid = opt.uid; + const gid = opt.gid; + const doChown = typeof uid === "number" && typeof gid === "number" && (uid !== opt.processUid || gid !== opt.processGid); + const preserve = opt.preserve; + const unlink = opt.unlink; + const cwd = normalizeWindowsPath(opt.cwd); + const done = (created2) => { + if (created2 && doChown) { + chownrSync(created2, uid, gid); + } + if (needChmod) { + import_node_fs3.default.chmodSync(dir, mode); + } + }; + if (dir === cwd) { + checkCwdSync(cwd); + return done(); + } + if (preserve) { + return done(import_node_fs3.default.mkdirSync(dir, { mode, recursive: true }) ?? void 0); + } + const sub = normalizeWindowsPath(import_node_path4.default.relative(cwd, dir)); + const parts = sub.split("/"); + let created = void 0; + for (let p = parts.shift(), part = cwd; p && (part += "/" + p); p = parts.shift()) { + part = normalizeWindowsPath(import_node_path4.default.resolve(part)); + try { + import_node_fs3.default.mkdirSync(part, mode); + created = created || part; + } catch (er) { + const st = import_node_fs3.default.lstatSync(part); + if (st.isDirectory()) { + continue; + } else if (unlink) { + import_node_fs3.default.unlinkSync(part); + import_node_fs3.default.mkdirSync(part, mode); + created = created || part; + continue; + } else if (st.isSymbolicLink()) { + return new SymlinkError(part, part + "/" + parts.join("/")); + } + } + } + return done(created); + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/strip-absolute-path.js +var import_node_path5, isAbsolute, parse3, stripAbsolutePath; +var init_strip_absolute_path = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/strip-absolute-path.js"() { + import_node_path5 = require("node:path"); + ({ isAbsolute, parse: parse3 } = import_node_path5.win32); + stripAbsolutePath = (path16) => { + let r = ""; + let parsed = parse3(path16); + while (isAbsolute(path16) || parsed.root) { + const root = path16.charAt(0) === "/" && path16.slice(0, 4) !== "//?/" ? "/" : parsed.root; + path16 = path16.slice(root.length); + r += root; + parsed = parse3(path16); + } + return [r, path16]; + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/winchars.js +var raw, win, toWin, toRaw, encode2, decode; +var init_winchars = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/winchars.js"() { + raw = ["|", "<", ">", "?", ":"]; + win = raw.map((char) => String.fromCharCode(61440 + char.charCodeAt(0))); + toWin = new Map(raw.map((char, i) => [char, win[i]])); + toRaw = new Map(win.map((char, i) => [char, raw[i]])); + encode2 = (s) => raw.reduce((s2, c) => s2.split(c).join(toWin.get(c)), s); + decode = (s) => win.reduce((s2, c) => s2.split(c).join(toRaw.get(c)), s); + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/normalize-unicode.js +var normalizeCache, MAX, cache, normalizeUnicode; +var init_normalize_unicode = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/normalize-unicode.js"() { + normalizeCache = /* @__PURE__ */ Object.create(null); + MAX = 1e4; + cache = /* @__PURE__ */ new Set(); + normalizeUnicode = (s) => { + if (!cache.has(s)) { + normalizeCache[s] = s.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"); + } else { + cache.delete(s); + } + cache.add(s); + const ret = normalizeCache[s]; + let i = cache.size - MAX; + if (i > MAX / 10) { + for (const s2 of cache) { + cache.delete(s2); + delete normalizeCache[s2]; + if (--i <= 0) + break; + } + } + return ret; + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/path-reservations.js +var import_node_path6, platform3, isWindows2, getDirs, PathReservations; +var init_path_reservations = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/path-reservations.js"() { + import_node_path6 = require("node:path"); + init_normalize_unicode(); + init_strip_trailing_slashes(); + platform3 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform; + isWindows2 = platform3 === "win32"; + getDirs = (path16) => { + const dirs = path16.split("/").slice(0, -1).reduce((set, path17) => { + const s = set[set.length - 1]; + if (s !== void 0) { + path17 = (0, import_node_path6.join)(s, path17); + } + set.push(path17 || "/"); + return set; + }, []); + return dirs; + }; + PathReservations = class { + // path => [function or Set] + // A Set object means a directory reservation + // A fn is a direct reservation on that path + #queues = /* @__PURE__ */ new Map(); + // fn => {paths:[path,...], dirs:[path, ...]} + #reservations = /* @__PURE__ */ new Map(); + // functions currently running + #running = /* @__PURE__ */ new Set(); + reserve(paths, fn2) { + paths = isWindows2 ? ["win32 parallelization disabled"] : paths.map((p) => { + return stripTrailingSlashes((0, import_node_path6.join)(normalizeUnicode(p))); + }); + const dirs = new Set(paths.map((path16) => getDirs(path16)).reduce((a, b) => a.concat(b))); + this.#reservations.set(fn2, { dirs, paths }); + for (const p of paths) { + const q = this.#queues.get(p); + if (!q) { + this.#queues.set(p, [fn2]); + } else { + q.push(fn2); + } + } + for (const dir of dirs) { + const q = this.#queues.get(dir); + if (!q) { + this.#queues.set(dir, [/* @__PURE__ */ new Set([fn2])]); + } else { + const l = q[q.length - 1]; + if (l instanceof Set) { + l.add(fn2); + } else { + q.push(/* @__PURE__ */ new Set([fn2])); + } + } + } + return this.#run(fn2); + } + // return the queues for each path the function cares about + // fn => {paths, dirs} + #getQueues(fn2) { + const res = this.#reservations.get(fn2); + if (!res) { + throw new Error("function does not have any path reservations"); + } + return { + paths: res.paths.map((path16) => this.#queues.get(path16)), + dirs: [...res.dirs].map((path16) => this.#queues.get(path16)) + }; + } + // check if fn is first in line for all its paths, and is + // included in the first set for all its dir queues + check(fn2) { + const { paths, dirs } = this.#getQueues(fn2); + return paths.every((q) => q && q[0] === fn2) && dirs.every((q) => q && q[0] instanceof Set && q[0].has(fn2)); + } + // run the function if it's first in line and not already running + #run(fn2) { + if (this.#running.has(fn2) || !this.check(fn2)) { + return false; + } + this.#running.add(fn2); + fn2(() => this.#clear(fn2)); + return true; + } + #clear(fn2) { + if (!this.#running.has(fn2)) { + return false; + } + const res = this.#reservations.get(fn2); + if (!res) { + throw new Error("invalid reservation"); + } + const { paths, dirs } = res; + const next = /* @__PURE__ */ new Set(); + for (const path16 of paths) { + const q = this.#queues.get(path16); + if (!q || q?.[0] !== fn2) { + continue; + } + const q0 = q[1]; + if (!q0) { + this.#queues.delete(path16); + continue; + } + q.shift(); + if (typeof q0 === "function") { + next.add(q0); + } else { + for (const f of q0) { + next.add(f); + } + } + } + for (const dir of dirs) { + const q = this.#queues.get(dir); + const q0 = q?.[0]; + if (!q || !(q0 instanceof Set)) + continue; + if (q0.size === 1 && q.length === 1) { + this.#queues.delete(dir); + continue; + } else if (q0.size === 1) { + q.shift(); + const n = q[0]; + if (typeof n === "function") { + next.add(n); + } + } else { + q0.delete(fn2); + } + } + this.#running.delete(fn2); + next.forEach((fn3) => this.#run(fn3)); + return true; + } + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/unpack.js +var import_node_assert, import_node_crypto, import_node_fs4, import_node_path7, ONENTRY, CHECKFS, CHECKFS2, ISREUSABLE, MAKEFS, FILE, DIRECTORY, LINK, SYMLINK, HARDLINK, UNSUPPORTED, CHECKPATH, STRIPABSOLUTEPATH, MKDIR, ONERROR, PENDING, PEND, UNPEND, ENDED2, MAYBECLOSE, SKIP, DOCHOWN, UID, GID, CHECKED_CWD, platform4, isWindows3, DEFAULT_MAX_DEPTH, unlinkFile, unlinkFileSync, uint32, Unpack, callSync, UnpackSync; +var init_unpack = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/unpack.js"() { + init_esm2(); + import_node_assert = __toESM(require("node:assert"), 1); + import_node_crypto = require("node:crypto"); + import_node_fs4 = __toESM(require("node:fs"), 1); + import_node_path7 = __toESM(require("node:path"), 1); + init_get_write_flag(); + init_mkdir(); + init_normalize_windows_path(); + init_parse(); + init_strip_absolute_path(); + init_winchars(); + init_path_reservations(); + ONENTRY = Symbol("onEntry"); + CHECKFS = Symbol("checkFs"); + CHECKFS2 = Symbol("checkFs2"); + ISREUSABLE = Symbol("isReusable"); + MAKEFS = Symbol("makeFs"); + FILE = Symbol("file"); + DIRECTORY = Symbol("directory"); + LINK = Symbol("link"); + SYMLINK = Symbol("symlink"); + HARDLINK = Symbol("hardlink"); + UNSUPPORTED = Symbol("unsupported"); + CHECKPATH = Symbol("checkPath"); + STRIPABSOLUTEPATH = Symbol("stripAbsolutePath"); + MKDIR = Symbol("mkdir"); + ONERROR = Symbol("onError"); + PENDING = Symbol("pending"); + PEND = Symbol("pend"); + UNPEND = Symbol("unpend"); + ENDED2 = Symbol("ended"); + MAYBECLOSE = Symbol("maybeClose"); + SKIP = Symbol("skip"); + DOCHOWN = Symbol("doChown"); + UID = Symbol("uid"); + GID = Symbol("gid"); + CHECKED_CWD = Symbol("checkedCwd"); + platform4 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform; + isWindows3 = platform4 === "win32"; + DEFAULT_MAX_DEPTH = 1024; + unlinkFile = (path16, cb) => { + if (!isWindows3) { + return import_node_fs4.default.unlink(path16, cb); + } + const name2 = path16 + ".DELETE." + (0, import_node_crypto.randomBytes)(16).toString("hex"); + import_node_fs4.default.rename(path16, name2, (er) => { + if (er) { + return cb(er); + } + import_node_fs4.default.unlink(name2, cb); + }); + }; + unlinkFileSync = (path16) => { + if (!isWindows3) { + return import_node_fs4.default.unlinkSync(path16); + } + const name2 = path16 + ".DELETE." + (0, import_node_crypto.randomBytes)(16).toString("hex"); + import_node_fs4.default.renameSync(path16, name2); + import_node_fs4.default.unlinkSync(name2); + }; + uint32 = (a, b, c) => a !== void 0 && a === a >>> 0 ? a : b !== void 0 && b === b >>> 0 ? b : c; + Unpack = class extends Parser { + [ENDED2] = false; + [CHECKED_CWD] = false; + [PENDING] = 0; + reservations = new PathReservations(); + transform; + writable = true; + readable = false; + uid; + gid; + setOwner; + preserveOwner; + processGid; + processUid; + maxDepth; + forceChown; + win32; + newer; + keep; + noMtime; + preservePaths; + unlink; + cwd; + strip; + processUmask; + umask; + dmode; + fmode; + chmod; + constructor(opt = {}) { + opt.ondone = () => { + this[ENDED2] = true; + this[MAYBECLOSE](); + }; + super(opt); + this.transform = opt.transform; + this.chmod = !!opt.chmod; + if (typeof opt.uid === "number" || typeof opt.gid === "number") { + if (typeof opt.uid !== "number" || typeof opt.gid !== "number") { + throw new TypeError("cannot set owner without number uid and gid"); + } + if (opt.preserveOwner) { + throw new TypeError("cannot preserve owner in archive and also set owner explicitly"); + } + this.uid = opt.uid; + this.gid = opt.gid; + this.setOwner = true; + } else { + this.uid = void 0; + this.gid = void 0; + this.setOwner = false; + } + if (opt.preserveOwner === void 0 && typeof opt.uid !== "number") { + this.preserveOwner = !!(process.getuid && process.getuid() === 0); + } else { + this.preserveOwner = !!opt.preserveOwner; + } + this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : void 0; + this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : void 0; + this.maxDepth = typeof opt.maxDepth === "number" ? opt.maxDepth : DEFAULT_MAX_DEPTH; + this.forceChown = opt.forceChown === true; + this.win32 = !!opt.win32 || isWindows3; + this.newer = !!opt.newer; + this.keep = !!opt.keep; + this.noMtime = !!opt.noMtime; + this.preservePaths = !!opt.preservePaths; + this.unlink = !!opt.unlink; + this.cwd = normalizeWindowsPath(import_node_path7.default.resolve(opt.cwd || process.cwd())); + this.strip = Number(opt.strip) || 0; + this.processUmask = !this.chmod ? 0 : typeof opt.processUmask === "number" ? opt.processUmask : process.umask(); + this.umask = typeof opt.umask === "number" ? opt.umask : this.processUmask; + this.dmode = opt.dmode || 511 & ~this.umask; + this.fmode = opt.fmode || 438 & ~this.umask; + this.on("entry", (entry) => this[ONENTRY](entry)); + } + // a bad or damaged archive is a warning for Parser, but an error + // when extracting. Mark those errors as unrecoverable, because + // the Unpack contract cannot be met. + warn(code2, msg, data = {}) { + if (code2 === "TAR_BAD_ARCHIVE" || code2 === "TAR_ABORT") { + data.recoverable = false; + } + return super.warn(code2, msg, data); + } + [MAYBECLOSE]() { + if (this[ENDED2] && this[PENDING] === 0) { + this.emit("prefinish"); + this.emit("finish"); + this.emit("end"); + } + } + // return false if we need to skip this file + // return true if the field was successfully sanitized + [STRIPABSOLUTEPATH](entry, field) { + const p = entry[field]; + if (!p || this.preservePaths) + return true; + const parts = p.split("/"); + if (parts.includes("..") || /* c8 ignore next */ + isWindows3 && /^[a-z]:\.\.$/i.test(parts[0] ?? "")) { + if (field === "path") { + this.warn("TAR_ENTRY_ERROR", `${field} contains '..'`, { + entry, + [field]: p + }); + return false; + } else { + const entryDir = import_node_path7.default.posix.dirname(entry.path); + const resolved = import_node_path7.default.posix.normalize(import_node_path7.default.posix.join(entryDir, p)); + if (resolved.startsWith("../") || resolved === "..") { + this.warn("TAR_ENTRY_ERROR", `${field} escapes extraction directory`, { + entry, + [field]: p + }); + return false; + } + } + } + const [root, stripped] = stripAbsolutePath(p); + if (root) { + entry[field] = String(stripped); + this.warn("TAR_ENTRY_INFO", `stripping ${root} from absolute ${field}`, { + entry, + [field]: p + }); + } + return true; + } + [CHECKPATH](entry) { + const p = normalizeWindowsPath(entry.path); + const parts = p.split("/"); + if (this.strip) { + if (parts.length < this.strip) { + return false; + } + if (entry.type === "Link") { + const linkparts = normalizeWindowsPath(String(entry.linkpath)).split("/"); + if (linkparts.length >= this.strip) { + entry.linkpath = linkparts.slice(this.strip).join("/"); + } else { + return false; + } + } + parts.splice(0, this.strip); + entry.path = parts.join("/"); + } + if (isFinite(this.maxDepth) && parts.length > this.maxDepth) { + this.warn("TAR_ENTRY_ERROR", "path excessively deep", { + entry, + path: p, + depth: parts.length, + maxDepth: this.maxDepth + }); + return false; + } + if (!this[STRIPABSOLUTEPATH](entry, "path") || !this[STRIPABSOLUTEPATH](entry, "linkpath")) { + return false; + } + if (import_node_path7.default.isAbsolute(entry.path)) { + entry.absolute = normalizeWindowsPath(import_node_path7.default.resolve(entry.path)); + } else { + entry.absolute = normalizeWindowsPath(import_node_path7.default.resolve(this.cwd, entry.path)); + } + if (!this.preservePaths && typeof entry.absolute === "string" && entry.absolute.indexOf(this.cwd + "/") !== 0 && entry.absolute !== this.cwd) { + this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", { + entry, + path: normalizeWindowsPath(entry.path), + resolvedPath: entry.absolute, + cwd: this.cwd + }); + return false; + } + if (entry.absolute === this.cwd && entry.type !== "Directory" && entry.type !== "GNUDumpDir") { + return false; + } + if (this.win32) { + const { root: aRoot } = import_node_path7.default.win32.parse(String(entry.absolute)); + entry.absolute = aRoot + encode2(String(entry.absolute).slice(aRoot.length)); + const { root: pRoot } = import_node_path7.default.win32.parse(entry.path); + entry.path = pRoot + encode2(entry.path.slice(pRoot.length)); + } + return true; + } + [ONENTRY](entry) { + if (!this[CHECKPATH](entry)) { + return entry.resume(); + } + import_node_assert.default.equal(typeof entry.absolute, "string"); + switch (entry.type) { + case "Directory": + case "GNUDumpDir": + if (entry.mode) { + entry.mode = entry.mode | 448; + } + // eslint-disable-next-line no-fallthrough + case "File": + case "OldFile": + case "ContiguousFile": + case "Link": + case "SymbolicLink": + return this[CHECKFS](entry); + case "CharacterDevice": + case "BlockDevice": + case "FIFO": + default: + return this[UNSUPPORTED](entry); + } + } + [ONERROR](er, entry) { + if (er.name === "CwdError") { + this.emit("error", er); + } else { + this.warn("TAR_ENTRY_ERROR", er, { entry }); + this[UNPEND](); + entry.resume(); + } + } + [MKDIR](dir, mode, cb) { + mkdir(normalizeWindowsPath(dir), { + uid: this.uid, + gid: this.gid, + processUid: this.processUid, + processGid: this.processGid, + umask: this.processUmask, + preserve: this.preservePaths, + unlink: this.unlink, + cwd: this.cwd, + mode + }, cb); + } + [DOCHOWN](entry) { + return this.forceChown || this.preserveOwner && (typeof entry.uid === "number" && entry.uid !== this.processUid || typeof entry.gid === "number" && entry.gid !== this.processGid) || typeof this.uid === "number" && this.uid !== this.processUid || typeof this.gid === "number" && this.gid !== this.processGid; + } + [UID](entry) { + return uint32(this.uid, entry.uid, this.processUid); + } + [GID](entry) { + return uint32(this.gid, entry.gid, this.processGid); + } + [FILE](entry, fullyDone) { + const mode = typeof entry.mode === "number" ? entry.mode & 4095 : this.fmode; + const stream = new WriteStream(String(entry.absolute), { + // slight lie, but it can be numeric flags + flags: getWriteFlag(entry.size), + mode, + autoClose: false + }); + stream.on("error", (er) => { + if (stream.fd) { + import_node_fs4.default.close(stream.fd, () => { + }); + } + stream.write = () => true; + this[ONERROR](er, entry); + fullyDone(); + }); + let actions = 1; + const done = (er) => { + if (er) { + if (stream.fd) { + import_node_fs4.default.close(stream.fd, () => { + }); + } + this[ONERROR](er, entry); + fullyDone(); + return; + } + if (--actions === 0) { + if (stream.fd !== void 0) { + import_node_fs4.default.close(stream.fd, (er2) => { + if (er2) { + this[ONERROR](er2, entry); + } else { + this[UNPEND](); + } + fullyDone(); + }); + } + } + }; + stream.on("finish", () => { + const abs = String(entry.absolute); + const fd = stream.fd; + if (typeof fd === "number" && entry.mtime && !this.noMtime) { + actions++; + const atime = entry.atime || /* @__PURE__ */ new Date(); + const mtime = entry.mtime; + import_node_fs4.default.futimes(fd, atime, mtime, (er) => er ? import_node_fs4.default.utimes(abs, atime, mtime, (er2) => done(er2 && er)) : done()); + } + if (typeof fd === "number" && this[DOCHOWN](entry)) { + actions++; + const uid = this[UID](entry); + const gid = this[GID](entry); + if (typeof uid === "number" && typeof gid === "number") { + import_node_fs4.default.fchown(fd, uid, gid, (er) => er ? import_node_fs4.default.chown(abs, uid, gid, (er2) => done(er2 && er)) : done()); + } + } + done(); + }); + const tx = this.transform ? this.transform(entry) || entry : entry; + if (tx !== entry) { + tx.on("error", (er) => { + this[ONERROR](er, entry); + fullyDone(); + }); + entry.pipe(tx); + } + tx.pipe(stream); + } + [DIRECTORY](entry, fullyDone) { + const mode = typeof entry.mode === "number" ? entry.mode & 4095 : this.dmode; + this[MKDIR](String(entry.absolute), mode, (er) => { + if (er) { + this[ONERROR](er, entry); + fullyDone(); + return; + } + let actions = 1; + const done = () => { + if (--actions === 0) { + fullyDone(); + this[UNPEND](); + entry.resume(); + } + }; + if (entry.mtime && !this.noMtime) { + actions++; + import_node_fs4.default.utimes(String(entry.absolute), entry.atime || /* @__PURE__ */ new Date(), entry.mtime, done); + } + if (this[DOCHOWN](entry)) { + actions++; + import_node_fs4.default.chown(String(entry.absolute), Number(this[UID](entry)), Number(this[GID](entry)), done); + } + done(); + }); + } + [UNSUPPORTED](entry) { + entry.unsupported = true; + this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${entry.type}`, { entry }); + entry.resume(); + } + [SYMLINK](entry, done) { + this[LINK](entry, String(entry.linkpath), "symlink", done); + } + [HARDLINK](entry, done) { + const linkpath = normalizeWindowsPath(import_node_path7.default.resolve(this.cwd, String(entry.linkpath))); + this[LINK](entry, linkpath, "link", done); + } + [PEND]() { + this[PENDING]++; + } + [UNPEND]() { + this[PENDING]--; + this[MAYBECLOSE](); + } + [SKIP](entry) { + this[UNPEND](); + entry.resume(); + } + // Check if we can reuse an existing filesystem entry safely and + // overwrite it, rather than unlinking and recreating + // Windows doesn't report a useful nlink, so we just never reuse entries + [ISREUSABLE](entry, st) { + return entry.type === "File" && !this.unlink && st.isFile() && st.nlink <= 1 && !isWindows3; + } + // check if a thing is there, and if so, try to clobber it + [CHECKFS](entry) { + this[PEND](); + const paths = [entry.path]; + if (entry.linkpath) { + paths.push(entry.linkpath); + } + this.reservations.reserve(paths, (done) => this[CHECKFS2](entry, done)); + } + [CHECKFS2](entry, fullyDone) { + const done = (er) => { + fullyDone(er); + }; + const checkCwd2 = () => { + this[MKDIR](this.cwd, this.dmode, (er) => { + if (er) { + this[ONERROR](er, entry); + done(); + return; + } + this[CHECKED_CWD] = true; + start(); + }); + }; + const start = () => { + if (entry.absolute !== this.cwd) { + const parent = normalizeWindowsPath(import_node_path7.default.dirname(String(entry.absolute))); + if (parent !== this.cwd) { + return this[MKDIR](parent, this.dmode, (er) => { + if (er) { + this[ONERROR](er, entry); + done(); + return; + } + afterMakeParent(); + }); + } + } + afterMakeParent(); + }; + const afterMakeParent = () => { + import_node_fs4.default.lstat(String(entry.absolute), (lstatEr, st) => { + if (st && (this.keep || /* c8 ignore next */ + this.newer && st.mtime > (entry.mtime ?? st.mtime))) { + this[SKIP](entry); + done(); + return; + } + if (lstatEr || this[ISREUSABLE](entry, st)) { + return this[MAKEFS](null, entry, done); + } + if (st.isDirectory()) { + if (entry.type === "Directory") { + const needChmod = this.chmod && entry.mode && (st.mode & 4095) !== entry.mode; + const afterChmod = (er) => this[MAKEFS](er ?? null, entry, done); + if (!needChmod) { + return afterChmod(); + } + return import_node_fs4.default.chmod(String(entry.absolute), Number(entry.mode), afterChmod); + } + if (entry.absolute !== this.cwd) { + return import_node_fs4.default.rmdir(String(entry.absolute), (er) => this[MAKEFS](er ?? null, entry, done)); + } + } + if (entry.absolute === this.cwd) { + return this[MAKEFS](null, entry, done); + } + unlinkFile(String(entry.absolute), (er) => this[MAKEFS](er ?? null, entry, done)); + }); + }; + if (this[CHECKED_CWD]) { + start(); + } else { + checkCwd2(); + } + } + [MAKEFS](er, entry, done) { + if (er) { + this[ONERROR](er, entry); + done(); + return; + } + switch (entry.type) { + case "File": + case "OldFile": + case "ContiguousFile": + return this[FILE](entry, done); + case "Link": + return this[HARDLINK](entry, done); + case "SymbolicLink": + return this[SYMLINK](entry, done); + case "Directory": + case "GNUDumpDir": + return this[DIRECTORY](entry, done); + } + } + [LINK](entry, linkpath, link, done) { + import_node_fs4.default[link](linkpath, String(entry.absolute), (er) => { + if (er) { + this[ONERROR](er, entry); + } else { + this[UNPEND](); + entry.resume(); + } + done(); + }); + } + }; + callSync = (fn2) => { + try { + return [null, fn2()]; + } catch (er) { + return [er, null]; + } + }; + UnpackSync = class extends Unpack { + sync = true; + [MAKEFS](er, entry) { + return super[MAKEFS](er, entry, () => { + }); + } + [CHECKFS](entry) { + if (!this[CHECKED_CWD]) { + const er2 = this[MKDIR](this.cwd, this.dmode); + if (er2) { + return this[ONERROR](er2, entry); + } + this[CHECKED_CWD] = true; + } + if (entry.absolute !== this.cwd) { + const parent = normalizeWindowsPath(import_node_path7.default.dirname(String(entry.absolute))); + if (parent !== this.cwd) { + const mkParent = this[MKDIR](parent, this.dmode); + if (mkParent) { + return this[ONERROR](mkParent, entry); + } + } + } + const [lstatEr, st] = callSync(() => import_node_fs4.default.lstatSync(String(entry.absolute))); + if (st && (this.keep || /* c8 ignore next */ + this.newer && st.mtime > (entry.mtime ?? st.mtime))) { + return this[SKIP](entry); + } + if (lstatEr || this[ISREUSABLE](entry, st)) { + return this[MAKEFS](null, entry); + } + if (st.isDirectory()) { + if (entry.type === "Directory") { + const needChmod = this.chmod && entry.mode && (st.mode & 4095) !== entry.mode; + const [er3] = needChmod ? callSync(() => { + import_node_fs4.default.chmodSync(String(entry.absolute), Number(entry.mode)); + }) : []; + return this[MAKEFS](er3, entry); + } + const [er2] = callSync(() => import_node_fs4.default.rmdirSync(String(entry.absolute))); + this[MAKEFS](er2, entry); + } + const [er] = entry.absolute === this.cwd ? [] : callSync(() => unlinkFileSync(String(entry.absolute))); + this[MAKEFS](er, entry); + } + [FILE](entry, done) { + const mode = typeof entry.mode === "number" ? entry.mode & 4095 : this.fmode; + const oner = (er) => { + let closeError; + try { + import_node_fs4.default.closeSync(fd); + } catch (e) { + closeError = e; + } + if (er || closeError) { + this[ONERROR](er || closeError, entry); + } + done(); + }; + let fd; + try { + fd = import_node_fs4.default.openSync(String(entry.absolute), getWriteFlag(entry.size), mode); + } catch (er) { + return oner(er); + } + const tx = this.transform ? this.transform(entry) || entry : entry; + if (tx !== entry) { + tx.on("error", (er) => this[ONERROR](er, entry)); + entry.pipe(tx); + } + tx.on("data", (chunk) => { + try { + import_node_fs4.default.writeSync(fd, chunk, 0, chunk.length); + } catch (er) { + oner(er); + } + }); + tx.on("end", () => { + let er = null; + if (entry.mtime && !this.noMtime) { + const atime = entry.atime || /* @__PURE__ */ new Date(); + const mtime = entry.mtime; + try { + import_node_fs4.default.futimesSync(fd, atime, mtime); + } catch (futimeser) { + try { + import_node_fs4.default.utimesSync(String(entry.absolute), atime, mtime); + } catch (utimeser) { + er = futimeser; + } + } + } + if (this[DOCHOWN](entry)) { + const uid = this[UID](entry); + const gid = this[GID](entry); + try { + import_node_fs4.default.fchownSync(fd, Number(uid), Number(gid)); + } catch (fchowner) { + try { + import_node_fs4.default.chownSync(String(entry.absolute), Number(uid), Number(gid)); + } catch (chowner) { + er = er || fchowner; + } + } + } + oner(er); + }); + } + [DIRECTORY](entry, done) { + const mode = typeof entry.mode === "number" ? entry.mode & 4095 : this.dmode; + const er = this[MKDIR](String(entry.absolute), mode); + if (er) { + this[ONERROR](er, entry); + done(); + return; + } + if (entry.mtime && !this.noMtime) { + try { + import_node_fs4.default.utimesSync(String(entry.absolute), entry.atime || /* @__PURE__ */ new Date(), entry.mtime); + } catch (er2) { + } + } + if (this[DOCHOWN](entry)) { + try { + import_node_fs4.default.chownSync(String(entry.absolute), Number(this[UID](entry)), Number(this[GID](entry))); + } catch (er2) { + } + } + done(); + entry.resume(); + } + [MKDIR](dir, mode) { + try { + return mkdirSync2(normalizeWindowsPath(dir), { + uid: this.uid, + gid: this.gid, + processUid: this.processUid, + processGid: this.processGid, + umask: this.processUmask, + preserve: this.preservePaths, + unlink: this.unlink, + cwd: this.cwd, + mode + }); + } catch (er) { + return er; + } + } + [LINK](entry, linkpath, link, done) { + const ls = `${link}Sync`; + try { + import_node_fs4.default[ls](linkpath, String(entry.absolute)); + done(); + entry.resume(); + } catch (er) { + return this[ONERROR](er, entry); + } + } + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/extract.js +var extract_exports = {}; +__export(extract_exports, { + extract: () => extract +}); +var import_node_fs5, extractFileSync, extractFile, extract; +var init_extract = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/extract.js"() { + init_esm2(); + import_node_fs5 = __toESM(require("node:fs"), 1); + init_list(); + init_make_command(); + init_unpack(); + extractFileSync = (opt) => { + const u = new UnpackSync(opt); + const file = opt.file; + const stat = import_node_fs5.default.statSync(file); + const readSize = opt.maxReadSize || 16 * 1024 * 1024; + const stream = new ReadStreamSync(file, { + readSize, + size: stat.size + }); + stream.pipe(u); + }; + extractFile = (opt, _) => { + const u = new Unpack(opt); + const readSize = opt.maxReadSize || 16 * 1024 * 1024; + const file = opt.file; + const p = new Promise((resolve, reject) => { + u.on("error", reject); + u.on("close", resolve); + import_node_fs5.default.stat(file, (er, stat) => { + if (er) { + reject(er); + } else { + const stream = new ReadStream(file, { + readSize, + size: stat.size + }); + stream.on("error", reject); + stream.pipe(u); + } + }); + }); + return p; + }; + extract = makeCommand(extractFileSync, extractFile, (opt) => new UnpackSync(opt), (opt) => new Unpack(opt), (opt, files) => { + if (files?.length) + filesFilter(opt, files); + }); + } +}); + +// .yarn/cache/v8-compile-cache-npm-2.4.0-5979f8e405-3878511925.zip/node_modules/v8-compile-cache/v8-compile-cache.js +var require_v8_compile_cache = __commonJS({ + ".yarn/cache/v8-compile-cache-npm-2.4.0-5979f8e405-3878511925.zip/node_modules/v8-compile-cache/v8-compile-cache.js"(exports2, module2) { + "use strict"; + var Module2 = require("module"); + var crypto = require("crypto"); + var fs17 = require("fs"); + var path16 = require("path"); + var vm = require("vm"); + var os3 = require("os"); + var hasOwnProperty = Object.prototype.hasOwnProperty; + var FileSystemBlobStore = class { + constructor(directory, prefix) { + const name2 = prefix ? slashEscape(prefix + ".") : ""; + this._blobFilename = path16.join(directory, name2 + "BLOB"); + this._mapFilename = path16.join(directory, name2 + "MAP"); + this._lockFilename = path16.join(directory, name2 + "LOCK"); + this._directory = directory; + this._load(); + } + has(key, invalidationKey) { + if (hasOwnProperty.call(this._memoryBlobs, key)) { + return this._invalidationKeys[key] === invalidationKey; + } else if (hasOwnProperty.call(this._storedMap, key)) { + return this._storedMap[key][0] === invalidationKey; + } + return false; + } + get(key, invalidationKey) { + if (hasOwnProperty.call(this._memoryBlobs, key)) { + if (this._invalidationKeys[key] === invalidationKey) { + return this._memoryBlobs[key]; + } + } else if (hasOwnProperty.call(this._storedMap, key)) { + const mapping = this._storedMap[key]; + if (mapping[0] === invalidationKey) { + return this._storedBlob.slice(mapping[1], mapping[2]); + } + } + } + set(key, invalidationKey, buffer) { + this._invalidationKeys[key] = invalidationKey; + this._memoryBlobs[key] = buffer; + this._dirty = true; + } + delete(key) { + if (hasOwnProperty.call(this._memoryBlobs, key)) { + this._dirty = true; + delete this._memoryBlobs[key]; + } + if (hasOwnProperty.call(this._invalidationKeys, key)) { + this._dirty = true; + delete this._invalidationKeys[key]; + } + if (hasOwnProperty.call(this._storedMap, key)) { + this._dirty = true; + delete this._storedMap[key]; + } + } + isDirty() { + return this._dirty; + } + save() { + const dump = this._getDump(); + const blobToStore = Buffer.concat(dump[0]); + const mapToStore = JSON.stringify(dump[1]); + try { + mkdirpSync(this._directory); + fs17.writeFileSync(this._lockFilename, "LOCK", { flag: "wx" }); + } catch (error) { + return false; + } + try { + fs17.writeFileSync(this._blobFilename, blobToStore); + fs17.writeFileSync(this._mapFilename, mapToStore); + } finally { + fs17.unlinkSync(this._lockFilename); + } + return true; + } + _load() { + try { + this._storedBlob = fs17.readFileSync(this._blobFilename); + this._storedMap = JSON.parse(fs17.readFileSync(this._mapFilename)); + } catch (e) { + this._storedBlob = Buffer.alloc(0); + this._storedMap = {}; + } + this._dirty = false; + this._memoryBlobs = {}; + this._invalidationKeys = {}; + } + _getDump() { + const buffers = []; + const newMap = {}; + let offset = 0; + function push2(key, invalidationKey, buffer) { + buffers.push(buffer); + newMap[key] = [invalidationKey, offset, offset + buffer.length]; + offset += buffer.length; + } + for (const key of Object.keys(this._memoryBlobs)) { + const buffer = this._memoryBlobs[key]; + const invalidationKey = this._invalidationKeys[key]; + push2(key, invalidationKey, buffer); + } + for (const key of Object.keys(this._storedMap)) { + if (hasOwnProperty.call(newMap, key)) continue; + const mapping = this._storedMap[key]; + const buffer = this._storedBlob.slice(mapping[1], mapping[2]); + push2(key, mapping[0], buffer); + } + return [buffers, newMap]; + } + }; + var NativeCompileCache = class { + constructor() { + this._cacheStore = null; + this._previousModuleCompile = null; + } + setCacheStore(cacheStore) { + this._cacheStore = cacheStore; + } + install() { + const self2 = this; + const hasRequireResolvePaths = typeof require.resolve.paths === "function"; + this._previousModuleCompile = Module2.prototype._compile; + Module2.prototype._compile = function(content, filename) { + const mod = this; + function require2(id) { + return mod.require(id); + } + function resolve(request, options) { + return Module2._resolveFilename(request, mod, false, options); + } + require2.resolve = resolve; + if (hasRequireResolvePaths) { + resolve.paths = function paths(request) { + return Module2._resolveLookupPaths(request, mod, true); + }; + } + require2.main = process.mainModule; + require2.extensions = Module2._extensions; + require2.cache = Module2._cache; + const dirname2 = path16.dirname(filename); + const compiledWrapper = self2._moduleCompile(filename, content); + const args = [mod.exports, require2, mod, filename, dirname2, process, global, Buffer]; + return compiledWrapper.apply(mod.exports, args); + }; + } + uninstall() { + Module2.prototype._compile = this._previousModuleCompile; + } + _moduleCompile(filename, content) { + var contLen = content.length; + if (contLen >= 2) { + if (content.charCodeAt(0) === 35 && content.charCodeAt(1) === 33) { + if (contLen === 2) { + content = ""; + } else { + var i = 2; + for (; i < contLen; ++i) { + var code2 = content.charCodeAt(i); + if (code2 === 10 || code2 === 13) break; + } + if (i === contLen) { + content = ""; + } else { + content = content.slice(i); + } + } + } + } + var wrapper = Module2.wrap(content); + var invalidationKey = crypto.createHash("sha1").update(content, "utf8").digest("hex"); + var buffer = this._cacheStore.get(filename, invalidationKey); + var script = new vm.Script(wrapper, { + filename, + lineOffset: 0, + displayErrors: true, + cachedData: buffer, + produceCachedData: true + }); + if (script.cachedDataProduced) { + this._cacheStore.set(filename, invalidationKey, script.cachedData); + } else if (script.cachedDataRejected) { + this._cacheStore.delete(filename); + } + var compiledWrapper = script.runInThisContext({ + filename, + lineOffset: 0, + columnOffset: 0, + displayErrors: true + }); + return compiledWrapper; + } + }; + function mkdirpSync(p_) { + _mkdirpSync(path16.resolve(p_), 511); + } + function _mkdirpSync(p, mode) { + try { + fs17.mkdirSync(p, mode); + } catch (err0) { + if (err0.code === "ENOENT") { + _mkdirpSync(path16.dirname(p)); + _mkdirpSync(p); + } else { + try { + const stat = fs17.statSync(p); + if (!stat.isDirectory()) { + throw err0; + } + } catch (err1) { + throw err0; + } + } + } + } + function slashEscape(str) { + const ESCAPE_LOOKUP = { + "\\": "zB", + ":": "zC", + "/": "zS", + "\0": "z0", + "z": "zZ" + }; + const ESCAPE_REGEX = /[\\:/\x00z]/g; + return str.replace(ESCAPE_REGEX, (match) => ESCAPE_LOOKUP[match]); + } + function supportsCachedData() { + const script = new vm.Script('""', { produceCachedData: true }); + return script.cachedDataProduced === true; + } + function getCacheDir() { + const v8_compile_cache_cache_dir = process.env.V8_COMPILE_CACHE_CACHE_DIR; + if (v8_compile_cache_cache_dir) { + return v8_compile_cache_cache_dir; + } + const dirname2 = typeof process.getuid === "function" ? "v8-compile-cache-" + process.getuid() : "v8-compile-cache"; + const arch = process.arch; + const version2 = typeof process.versions.v8 === "string" ? process.versions.v8 : typeof process.versions.chakracore === "string" ? "chakracore-" + process.versions.chakracore : "node-" + process.version; + const cacheDir = path16.join(os3.tmpdir(), dirname2, arch, version2); + return cacheDir; + } + function getMainName() { + const mainName = require.main && typeof require.main.filename === "string" ? require.main.filename : process.cwd(); + return mainName; + } + if (!process.env.DISABLE_V8_COMPILE_CACHE && supportsCachedData()) { + const cacheDir = getCacheDir(); + const prefix = getMainName(); + const blobStore = new FileSystemBlobStore(cacheDir, prefix); + const nativeCompileCache = new NativeCompileCache(); + nativeCompileCache.setCacheStore(blobStore); + nativeCompileCache.install(); + process.once("exit", () => { + if (blobStore.isDirty()) { + blobStore.save(); + } + nativeCompileCache.uninstall(); + }); + } + module2.exports.__TEST__ = { + FileSystemBlobStore, + NativeCompileCache, + mkdirpSync, + slashEscape, + supportsCachedData, + getCacheDir, + getMainName + }; + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/satisfies.js +var require_satisfies = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/satisfies.js"(exports2, module2) { + "use strict"; + var Range3 = require_range(); + var satisfies = (version2, range, options) => { + try { + range = new Range3(range, options); + } catch (er) { + return false; + } + return range.test(version2); + }; + module2.exports = satisfies; + } +}); + +// .yarn/cache/isexe-npm-3.1.1-9c0061eead-9ec2576540.zip/node_modules/isexe/dist/cjs/posix.js +var require_posix = __commonJS({ + ".yarn/cache/isexe-npm-3.1.1-9c0061eead-9ec2576540.zip/node_modules/isexe/dist/cjs/posix.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.sync = exports2.isexe = void 0; + var fs_1 = require("fs"); + var promises_1 = require("fs/promises"); + var isexe = async (path16, options = {}) => { + const { ignoreErrors = false } = options; + try { + return checkStat(await (0, promises_1.stat)(path16), options); + } catch (e) { + const er = e; + if (ignoreErrors || er.code === "EACCES") + return false; + throw er; + } + }; + exports2.isexe = isexe; + var sync = (path16, options = {}) => { + const { ignoreErrors = false } = options; + try { + return checkStat((0, fs_1.statSync)(path16), options); + } catch (e) { + const er = e; + if (ignoreErrors || er.code === "EACCES") + return false; + throw er; + } + }; + exports2.sync = sync; + var checkStat = (stat, options) => stat.isFile() && checkMode(stat, options); + var checkMode = (stat, options) => { + const myUid = options.uid ?? process.getuid?.(); + const myGroups = options.groups ?? process.getgroups?.() ?? []; + const myGid = options.gid ?? process.getgid?.() ?? myGroups[0]; + if (myUid === void 0 || myGid === void 0) { + throw new Error("cannot get uid or gid"); + } + const groups = /* @__PURE__ */ new Set([myGid, ...myGroups]); + const mod = stat.mode; + const uid = stat.uid; + const gid = stat.gid; + const u = parseInt("100", 8); + const g = parseInt("010", 8); + const o = parseInt("001", 8); + const ug = u | g; + return !!(mod & o || mod & g && groups.has(gid) || mod & u && uid === myUid || mod & ug && myUid === 0); + }; + } +}); + +// .yarn/cache/isexe-npm-3.1.1-9c0061eead-9ec2576540.zip/node_modules/isexe/dist/cjs/win32.js +var require_win32 = __commonJS({ + ".yarn/cache/isexe-npm-3.1.1-9c0061eead-9ec2576540.zip/node_modules/isexe/dist/cjs/win32.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.sync = exports2.isexe = void 0; + var fs_1 = require("fs"); + var promises_1 = require("fs/promises"); + var isexe = async (path16, options = {}) => { + const { ignoreErrors = false } = options; + try { + return checkStat(await (0, promises_1.stat)(path16), path16, options); + } catch (e) { + const er = e; + if (ignoreErrors || er.code === "EACCES") + return false; + throw er; + } + }; + exports2.isexe = isexe; + var sync = (path16, options = {}) => { + const { ignoreErrors = false } = options; + try { + return checkStat((0, fs_1.statSync)(path16), path16, options); + } catch (e) { + const er = e; + if (ignoreErrors || er.code === "EACCES") + return false; + throw er; + } + }; + exports2.sync = sync; + var checkPathExt = (path16, options) => { + const { pathExt = process.env.PATHEXT || "" } = options; + const peSplit = pathExt.split(";"); + if (peSplit.indexOf("") !== -1) { + return true; + } + for (let i = 0; i < peSplit.length; i++) { + const p = peSplit[i].toLowerCase(); + const ext = path16.substring(path16.length - p.length).toLowerCase(); + if (p && ext === p) { + return true; + } + } + return false; + }; + var checkStat = (stat, path16, options) => stat.isFile() && checkPathExt(path16, options); + } +}); + +// .yarn/cache/isexe-npm-3.1.1-9c0061eead-9ec2576540.zip/node_modules/isexe/dist/cjs/options.js +var require_options = __commonJS({ + ".yarn/cache/isexe-npm-3.1.1-9c0061eead-9ec2576540.zip/node_modules/isexe/dist/cjs/options.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// .yarn/cache/isexe-npm-3.1.1-9c0061eead-9ec2576540.zip/node_modules/isexe/dist/cjs/index.js +var require_cjs = __commonJS({ + ".yarn/cache/isexe-npm-3.1.1-9c0061eead-9ec2576540.zip/node_modules/isexe/dist/cjs/index.js"(exports2) { + "use strict"; + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc2 = Object.getOwnPropertyDescriptor(m, k); + if (!desc2 || ("get" in desc2 ? !m.__esModule : desc2.writable || desc2.configurable)) { + desc2 = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc2); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports2 && exports2.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + } + __setModuleDefault(result, mod); + return result; + }; + var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.sync = exports2.isexe = exports2.posix = exports2.win32 = void 0; + var posix = __importStar(require_posix()); + exports2.posix = posix; + var win322 = __importStar(require_win32()); + exports2.win32 = win322; + __exportStar(require_options(), exports2); + var platform5 = process.env._ISEXE_TEST_PLATFORM_ || process.platform; + var impl = platform5 === "win32" ? win322 : posix; + exports2.isexe = impl.isexe; + exports2.sync = impl.sync; + } +}); + +// .yarn/cache/which-npm-5.0.0-15aa39eb60-e556e4cd8b.zip/node_modules/which/lib/index.js +var require_lib = __commonJS({ + ".yarn/cache/which-npm-5.0.0-15aa39eb60-e556e4cd8b.zip/node_modules/which/lib/index.js"(exports2, module2) { + var { isexe, sync: isexeSync } = require_cjs(); + var { join: join3, delimiter, sep, posix } = require("path"); + var isWindows4 = process.platform === "win32"; + var rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? "" : sep}]`.replace(/(\\)/g, "\\$1")); + var rRel = new RegExp(`^\\.${rSlash.source}`); + var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }); + var getPathInfo = (cmd, { + path: optPath = process.env.PATH, + pathExt: optPathExt = process.env.PATHEXT, + delimiter: optDelimiter = delimiter + }) => { + const pathEnv = cmd.match(rSlash) ? [""] : [ + // windows always checks the cwd first + ...isWindows4 ? [process.cwd()] : [], + ...(optPath || /* istanbul ignore next: very unusual */ + "").split(optDelimiter) + ]; + if (isWindows4) { + const pathExtExe = optPathExt || [".EXE", ".CMD", ".BAT", ".COM"].join(optDelimiter); + const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()]); + if (cmd.includes(".") && pathExt[0] !== "") { + pathExt.unshift(""); + } + return { pathEnv, pathExt, pathExtExe }; + } + return { pathEnv, pathExt: [""] }; + }; + var getPathPart = (raw2, cmd) => { + const pathPart = /^".*"$/.test(raw2) ? raw2.slice(1, -1) : raw2; + const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : ""; + return prefix + join3(pathPart, cmd); + }; + var which3 = async (cmd, opt = {}) => { + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); + const found = []; + for (const envPart of pathEnv) { + const p = getPathPart(envPart, cmd); + for (const ext of pathExt) { + const withExt = p + ext; + const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true }); + if (is) { + if (!opt.all) { + return withExt; + } + found.push(withExt); + } + } + } + if (opt.all && found.length) { + return found; + } + if (opt.nothrow) { + return null; + } + throw getNotFoundError(cmd); + }; + var whichSync = (cmd, opt = {}) => { + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); + const found = []; + for (const pathEnvPart of pathEnv) { + const p = getPathPart(pathEnvPart, cmd); + for (const ext of pathExt) { + const withExt = p + ext; + const is = isexeSync(withExt, { pathExt: pathExtExe, ignoreErrors: true }); + if (is) { + if (!opt.all) { + return withExt; + } + found.push(withExt); + } + } + } + if (opt.all && found.length) { + return found; + } + if (opt.nothrow) { + return null; + } + throw getNotFoundError(cmd); + }; + module2.exports = which3; + which3.sync = whichSync; + } +}); + +// .yarn/cache/is-windows-npm-1.0.2-898cd6f3d7-b32f418ab3.zip/node_modules/is-windows/index.js +var require_is_windows = __commonJS({ + ".yarn/cache/is-windows-npm-1.0.2-898cd6f3d7-b32f418ab3.zip/node_modules/is-windows/index.js"(exports2, module2) { + (function(factory) { + if (exports2 && typeof exports2 === "object" && typeof module2 !== "undefined") { + module2.exports = factory(); + } else if (typeof define === "function" && define.amd) { + define([], factory); + } else if (typeof window !== "undefined") { + window.isWindows = factory(); + } else if (typeof global !== "undefined") { + global.isWindows = factory(); + } else if (typeof self !== "undefined") { + self.isWindows = factory(); + } else { + this.isWindows = factory(); + } + })(function() { + "use strict"; + return function isWindows4() { + return process && (process.platform === "win32" || /^(msys|cygwin)$/.test(process.env.OSTYPE)); + }; + }); + } +}); + +// .yarn/cache/cmd-extension-npm-1.0.2-11aa204c4b-acdb425d51.zip/node_modules/cmd-extension/index.js +var require_cmd_extension = __commonJS({ + ".yarn/cache/cmd-extension-npm-1.0.2-11aa204c4b-acdb425d51.zip/node_modules/cmd-extension/index.js"(exports2, module2) { + "use strict"; + var path16 = require("path"); + var cmdExtension; + if (process.env.PATHEXT) { + cmdExtension = process.env.PATHEXT.split(path16.delimiter).find((ext) => ext.toUpperCase() === ".CMD"); + } + module2.exports = cmdExtension || ".cmd"; + } +}); + +// .yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-386d011a55.zip/node_modules/graceful-fs/polyfills.js +var require_polyfills = __commonJS({ + ".yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-386d011a55.zip/node_modules/graceful-fs/polyfills.js"(exports2, module2) { + var constants2 = require("constants"); + var origCwd = process.cwd; + var cwd = null; + var platform5 = process.env.GRACEFUL_FS_PLATFORM || process.platform; + process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process); + return cwd; + }; + try { + process.cwd(); + } catch (er) { + } + if (typeof process.chdir === "function") { + chdir = process.chdir; + process.chdir = function(d) { + cwd = null; + chdir.call(process, d); + }; + if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir); + } + var chdir; + module2.exports = patch; + function patch(fs17) { + if (constants2.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs17); + } + if (!fs17.lutimes) { + patchLutimes(fs17); + } + fs17.chown = chownFix(fs17.chown); + fs17.fchown = chownFix(fs17.fchown); + fs17.lchown = chownFix(fs17.lchown); + fs17.chmod = chmodFix(fs17.chmod); + fs17.fchmod = chmodFix(fs17.fchmod); + fs17.lchmod = chmodFix(fs17.lchmod); + fs17.chownSync = chownFixSync(fs17.chownSync); + fs17.fchownSync = chownFixSync(fs17.fchownSync); + fs17.lchownSync = chownFixSync(fs17.lchownSync); + fs17.chmodSync = chmodFixSync(fs17.chmodSync); + fs17.fchmodSync = chmodFixSync(fs17.fchmodSync); + fs17.lchmodSync = chmodFixSync(fs17.lchmodSync); + fs17.stat = statFix(fs17.stat); + fs17.fstat = statFix(fs17.fstat); + fs17.lstat = statFix(fs17.lstat); + fs17.statSync = statFixSync(fs17.statSync); + fs17.fstatSync = statFixSync(fs17.fstatSync); + fs17.lstatSync = statFixSync(fs17.lstatSync); + if (fs17.chmod && !fs17.lchmod) { + fs17.lchmod = function(path16, mode, cb) { + if (cb) process.nextTick(cb); + }; + fs17.lchmodSync = function() { + }; + } + if (fs17.chown && !fs17.lchown) { + fs17.lchown = function(path16, uid, gid, cb) { + if (cb) process.nextTick(cb); + }; + fs17.lchownSync = function() { + }; + } + if (platform5 === "win32") { + fs17.rename = typeof fs17.rename !== "function" ? fs17.rename : (function(fs$rename) { + function rename(from, to, cb) { + var start = Date.now(); + var backoff = 0; + fs$rename(from, to, function CB(er) { + if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) { + setTimeout(function() { + fs17.stat(to, function(stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er); + }); + }, backoff); + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er); + }); + } + if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename); + return rename; + })(fs17.rename); + } + fs17.read = typeof fs17.read !== "function" ? fs17.read : (function(fs$read) { + function read(fd, buffer, offset, length, position, callback_) { + var callback; + if (callback_ && typeof callback_ === "function") { + var eagCounter = 0; + callback = function(er, _, __) { + if (er && er.code === "EAGAIN" && eagCounter < 10) { + eagCounter++; + return fs$read.call(fs17, fd, buffer, offset, length, position, callback); + } + callback_.apply(this, arguments); + }; + } + return fs$read.call(fs17, fd, buffer, offset, length, position, callback); + } + if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read); + return read; + })(fs17.read); + fs17.readSync = typeof fs17.readSync !== "function" ? fs17.readSync : /* @__PURE__ */ (function(fs$readSync) { + return function(fd, buffer, offset, length, position) { + var eagCounter = 0; + while (true) { + try { + return fs$readSync.call(fs17, fd, buffer, offset, length, position); + } catch (er) { + if (er.code === "EAGAIN" && eagCounter < 10) { + eagCounter++; + continue; + } + throw er; + } + } + }; + })(fs17.readSync); + function patchLchmod(fs18) { + fs18.lchmod = function(path16, mode, callback) { + fs18.open( + path16, + constants2.O_WRONLY | constants2.O_SYMLINK, + mode, + function(err, fd) { + if (err) { + if (callback) callback(err); + return; + } + fs18.fchmod(fd, mode, function(err2) { + fs18.close(fd, function(err22) { + if (callback) callback(err2 || err22); + }); + }); + } + ); + }; + fs18.lchmodSync = function(path16, mode) { + var fd = fs18.openSync(path16, constants2.O_WRONLY | constants2.O_SYMLINK, mode); + var threw = true; + var ret; + try { + ret = fs18.fchmodSync(fd, mode); + threw = false; + } finally { + if (threw) { + try { + fs18.closeSync(fd); + } catch (er) { + } + } else { + fs18.closeSync(fd); + } + } + return ret; + }; + } + function patchLutimes(fs18) { + if (constants2.hasOwnProperty("O_SYMLINK") && fs18.futimes) { + fs18.lutimes = function(path16, at, mt, cb) { + fs18.open(path16, constants2.O_SYMLINK, function(er, fd) { + if (er) { + if (cb) cb(er); + return; + } + fs18.futimes(fd, at, mt, function(er2) { + fs18.close(fd, function(er22) { + if (cb) cb(er2 || er22); + }); + }); + }); + }; + fs18.lutimesSync = function(path16, at, mt) { + var fd = fs18.openSync(path16, constants2.O_SYMLINK); + var ret; + var threw = true; + try { + ret = fs18.futimesSync(fd, at, mt); + threw = false; + } finally { + if (threw) { + try { + fs18.closeSync(fd); + } catch (er) { + } + } else { + fs18.closeSync(fd); + } + } + return ret; + }; + } else if (fs18.futimes) { + fs18.lutimes = function(_a, _b, _c, cb) { + if (cb) process.nextTick(cb); + }; + fs18.lutimesSync = function() { + }; + } + } + function chmodFix(orig) { + if (!orig) return orig; + return function(target, mode, cb) { + return orig.call(fs17, target, mode, function(er) { + if (chownErOk(er)) er = null; + if (cb) cb.apply(this, arguments); + }); + }; + } + function chmodFixSync(orig) { + if (!orig) return orig; + return function(target, mode) { + try { + return orig.call(fs17, target, mode); + } catch (er) { + if (!chownErOk(er)) throw er; + } + }; + } + function chownFix(orig) { + if (!orig) return orig; + return function(target, uid, gid, cb) { + return orig.call(fs17, target, uid, gid, function(er) { + if (chownErOk(er)) er = null; + if (cb) cb.apply(this, arguments); + }); + }; + } + function chownFixSync(orig) { + if (!orig) return orig; + return function(target, uid, gid) { + try { + return orig.call(fs17, target, uid, gid); + } catch (er) { + if (!chownErOk(er)) throw er; + } + }; + } + function statFix(orig) { + if (!orig) return orig; + return function(target, options, cb) { + if (typeof options === "function") { + cb = options; + options = null; + } + function callback(er, stats) { + if (stats) { + if (stats.uid < 0) stats.uid += 4294967296; + if (stats.gid < 0) stats.gid += 4294967296; + } + if (cb) cb.apply(this, arguments); + } + return options ? orig.call(fs17, target, options, callback) : orig.call(fs17, target, callback); + }; + } + function statFixSync(orig) { + if (!orig) return orig; + return function(target, options) { + var stats = options ? orig.call(fs17, target, options) : orig.call(fs17, target); + if (stats) { + if (stats.uid < 0) stats.uid += 4294967296; + if (stats.gid < 0) stats.gid += 4294967296; + } + return stats; + }; + } + function chownErOk(er) { + if (!er) + return true; + if (er.code === "ENOSYS") + return true; + var nonroot = !process.getuid || process.getuid() !== 0; + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true; + } + return false; + } + } + } +}); + +// .yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-386d011a55.zip/node_modules/graceful-fs/legacy-streams.js +var require_legacy_streams = __commonJS({ + ".yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-386d011a55.zip/node_modules/graceful-fs/legacy-streams.js"(exports2, module2) { + var Stream2 = require("stream").Stream; + module2.exports = legacy; + function legacy(fs17) { + return { + ReadStream: ReadStream2, + WriteStream: WriteStream2 + }; + function ReadStream2(path16, options) { + if (!(this instanceof ReadStream2)) return new ReadStream2(path16, options); + Stream2.call(this); + var self2 = this; + this.path = path16; + this.fd = null; + this.readable = true; + this.paused = false; + this.flags = "r"; + this.mode = 438; + this.bufferSize = 64 * 1024; + options = options || {}; + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + if (this.encoding) this.setEncoding(this.encoding); + if (this.start !== void 0) { + if ("number" !== typeof this.start) { + throw TypeError("start must be a Number"); + } + if (this.end === void 0) { + this.end = Infinity; + } else if ("number" !== typeof this.end) { + throw TypeError("end must be a Number"); + } + if (this.start > this.end) { + throw new Error("start must be <= end"); + } + this.pos = this.start; + } + if (this.fd !== null) { + process.nextTick(function() { + self2._read(); + }); + return; + } + fs17.open(this.path, this.flags, this.mode, function(err, fd) { + if (err) { + self2.emit("error", err); + self2.readable = false; + return; + } + self2.fd = fd; + self2.emit("open", fd); + self2._read(); + }); + } + function WriteStream2(path16, options) { + if (!(this instanceof WriteStream2)) return new WriteStream2(path16, options); + Stream2.call(this); + this.path = path16; + this.fd = null; + this.writable = true; + this.flags = "w"; + this.encoding = "binary"; + this.mode = 438; + this.bytesWritten = 0; + options = options || {}; + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + if (this.start !== void 0) { + if ("number" !== typeof this.start) { + throw TypeError("start must be a Number"); + } + if (this.start < 0) { + throw new Error("start must be >= zero"); + } + this.pos = this.start; + } + this.busy = false; + this._queue = []; + if (this.fd === null) { + this._open = fs17.open; + this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); + this.flush(); + } + } + } + } +}); + +// .yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-386d011a55.zip/node_modules/graceful-fs/clone.js +var require_clone = __commonJS({ + ".yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-386d011a55.zip/node_modules/graceful-fs/clone.js"(exports2, module2) { + "use strict"; + module2.exports = clone; + var getPrototypeOf = Object.getPrototypeOf || function(obj) { + return obj.__proto__; + }; + function clone(obj) { + if (obj === null || typeof obj !== "object") + return obj; + if (obj instanceof Object) + var copy = { __proto__: getPrototypeOf(obj) }; + else + var copy = /* @__PURE__ */ Object.create(null); + Object.getOwnPropertyNames(obj).forEach(function(key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)); + }); + return copy; + } + } +}); + +// .yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-386d011a55.zip/node_modules/graceful-fs/graceful-fs.js +var require_graceful_fs = __commonJS({ + ".yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-386d011a55.zip/node_modules/graceful-fs/graceful-fs.js"(exports2, module2) { + var fs17 = require("fs"); + var polyfills = require_polyfills(); + var legacy = require_legacy_streams(); + var clone = require_clone(); + var util = require("util"); + var gracefulQueue; + var previousSymbol; + if (typeof Symbol === "function" && typeof Symbol.for === "function") { + gracefulQueue = Symbol.for("graceful-fs.queue"); + previousSymbol = Symbol.for("graceful-fs.previous"); + } else { + gracefulQueue = "___graceful-fs.queue"; + previousSymbol = "___graceful-fs.previous"; + } + function noop3() { + } + function publishQueue(context, queue2) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue2; + } + }); + } + var debug2 = noop3; + if (util.debuglog) + debug2 = util.debuglog("gfs4"); + else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) + debug2 = function() { + var m = util.format.apply(util, arguments); + m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); + console.error(m); + }; + if (!fs17[gracefulQueue]) { + queue = global[gracefulQueue] || []; + publishQueue(fs17, queue); + fs17.close = (function(fs$close) { + function close(fd, cb) { + return fs$close.call(fs17, fd, function(err) { + if (!err) { + resetQueue(); + } + if (typeof cb === "function") + cb.apply(this, arguments); + }); + } + Object.defineProperty(close, previousSymbol, { + value: fs$close + }); + return close; + })(fs17.close); + fs17.closeSync = (function(fs$closeSync) { + function closeSync(fd) { + fs$closeSync.apply(fs17, arguments); + resetQueue(); + } + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }); + return closeSync; + })(fs17.closeSync); + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { + process.on("exit", function() { + debug2(fs17[gracefulQueue]); + require("assert").equal(fs17[gracefulQueue].length, 0); + }); + } + } + var queue; + if (!global[gracefulQueue]) { + publishQueue(global, fs17[gracefulQueue]); + } + module2.exports = patch(clone(fs17)); + if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs17.__patched) { + module2.exports = patch(fs17); + fs17.__patched = true; + } + function patch(fs18) { + polyfills(fs18); + fs18.gracefulify = patch; + fs18.createReadStream = createReadStream; + fs18.createWriteStream = createWriteStream; + var fs$readFile = fs18.readFile; + fs18.readFile = readFile; + function readFile(path16, options, cb) { + if (typeof options === "function") + cb = options, options = null; + return go$readFile(path16, options, cb); + function go$readFile(path17, options2, cb2, startTime) { + return fs$readFile(path17, options2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$readFile, [path17, options2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); + } + } + var fs$writeFile = fs18.writeFile; + fs18.writeFile = writeFile; + function writeFile(path16, data, options, cb) { + if (typeof options === "function") + cb = options, options = null; + return go$writeFile(path16, data, options, cb); + function go$writeFile(path17, data2, options2, cb2, startTime) { + return fs$writeFile(path17, data2, options2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$writeFile, [path17, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); + } + } + var fs$appendFile = fs18.appendFile; + if (fs$appendFile) + fs18.appendFile = appendFile; + function appendFile(path16, data, options, cb) { + if (typeof options === "function") + cb = options, options = null; + return go$appendFile(path16, data, options, cb); + function go$appendFile(path17, data2, options2, cb2, startTime) { + return fs$appendFile(path17, data2, options2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$appendFile, [path17, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); + } + } + var fs$copyFile = fs18.copyFile; + if (fs$copyFile) + fs18.copyFile = copyFile; + function copyFile(src, dest, flags, cb) { + if (typeof flags === "function") { + cb = flags; + flags = 0; + } + return go$copyFile(src, dest, flags, cb); + function go$copyFile(src2, dest2, flags2, cb2, startTime) { + return fs$copyFile(src2, dest2, flags2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); + } + } + var fs$readdir = fs18.readdir; + fs18.readdir = readdir; + var noReaddirOptionVersions = /^v[0-5]\./; + function readdir(path16, options, cb) { + if (typeof options === "function") + cb = options, options = null; + var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path17, options2, cb2, startTime) { + return fs$readdir(path17, fs$readdirCallback( + path17, + options2, + cb2, + startTime + )); + } : function go$readdir2(path17, options2, cb2, startTime) { + return fs$readdir(path17, options2, fs$readdirCallback( + path17, + options2, + cb2, + startTime + )); + }; + return go$readdir(path16, options, cb); + function fs$readdirCallback(path17, options2, cb2, startTime) { + return function(err, files) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([ + go$readdir, + [path17, options2, cb2], + err, + startTime || Date.now(), + Date.now() + ]); + else { + if (files && files.sort) + files.sort(); + if (typeof cb2 === "function") + cb2.call(this, err, files); + } + }; + } + } + if (process.version.substr(0, 4) === "v0.8") { + var legStreams = legacy(fs18); + ReadStream2 = legStreams.ReadStream; + WriteStream2 = legStreams.WriteStream; + } + var fs$ReadStream = fs18.ReadStream; + if (fs$ReadStream) { + ReadStream2.prototype = Object.create(fs$ReadStream.prototype); + ReadStream2.prototype.open = ReadStream$open; + } + var fs$WriteStream = fs18.WriteStream; + if (fs$WriteStream) { + WriteStream2.prototype = Object.create(fs$WriteStream.prototype); + WriteStream2.prototype.open = WriteStream$open; + } + Object.defineProperty(fs18, "ReadStream", { + get: function() { + return ReadStream2; + }, + set: function(val) { + ReadStream2 = val; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(fs18, "WriteStream", { + get: function() { + return WriteStream2; + }, + set: function(val) { + WriteStream2 = val; + }, + enumerable: true, + configurable: true + }); + var FileReadStream = ReadStream2; + Object.defineProperty(fs18, "FileReadStream", { + get: function() { + return FileReadStream; + }, + set: function(val) { + FileReadStream = val; + }, + enumerable: true, + configurable: true + }); + var FileWriteStream = WriteStream2; + Object.defineProperty(fs18, "FileWriteStream", { + get: function() { + return FileWriteStream; + }, + set: function(val) { + FileWriteStream = val; + }, + enumerable: true, + configurable: true + }); + function ReadStream2(path16, options) { + if (this instanceof ReadStream2) + return fs$ReadStream.apply(this, arguments), this; + else + return ReadStream2.apply(Object.create(ReadStream2.prototype), arguments); + } + function ReadStream$open() { + var that = this; + open(that.path, that.flags, that.mode, function(err, fd) { + if (err) { + if (that.autoClose) + that.destroy(); + that.emit("error", err); + } else { + that.fd = fd; + that.emit("open", fd); + that.read(); + } + }); + } + function WriteStream2(path16, options) { + if (this instanceof WriteStream2) + return fs$WriteStream.apply(this, arguments), this; + else + return WriteStream2.apply(Object.create(WriteStream2.prototype), arguments); + } + function WriteStream$open() { + var that = this; + open(that.path, that.flags, that.mode, function(err, fd) { + if (err) { + that.destroy(); + that.emit("error", err); + } else { + that.fd = fd; + that.emit("open", fd); + } + }); + } + function createReadStream(path16, options) { + return new fs18.ReadStream(path16, options); + } + function createWriteStream(path16, options) { + return new fs18.WriteStream(path16, options); + } + var fs$open = fs18.open; + fs18.open = open; + function open(path16, flags, mode, cb) { + if (typeof mode === "function") + cb = mode, mode = null; + return go$open(path16, flags, mode, cb); + function go$open(path17, flags2, mode2, cb2, startTime) { + return fs$open(path17, flags2, mode2, function(err, fd) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$open, [path17, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); + } + } + return fs18; + } + function enqueue(elem) { + debug2("ENQUEUE", elem[0].name, elem[1]); + fs17[gracefulQueue].push(elem); + retry(); + } + var retryTimer; + function resetQueue() { + var now = Date.now(); + for (var i = 0; i < fs17[gracefulQueue].length; ++i) { + if (fs17[gracefulQueue][i].length > 2) { + fs17[gracefulQueue][i][3] = now; + fs17[gracefulQueue][i][4] = now; + } + } + retry(); + } + function retry() { + clearTimeout(retryTimer); + retryTimer = void 0; + if (fs17[gracefulQueue].length === 0) + return; + var elem = fs17[gracefulQueue].shift(); + var fn2 = elem[0]; + var args = elem[1]; + var err = elem[2]; + var startTime = elem[3]; + var lastTime = elem[4]; + if (startTime === void 0) { + debug2("RETRY", fn2.name, args); + fn2.apply(null, args); + } else if (Date.now() - startTime >= 6e4) { + debug2("TIMEOUT", fn2.name, args); + var cb = args.pop(); + if (typeof cb === "function") + cb.call(null, err); + } else { + var sinceAttempt = Date.now() - lastTime; + var sinceStart = Math.max(lastTime - startTime, 1); + var desiredDelay = Math.min(sinceStart * 1.2, 100); + if (sinceAttempt >= desiredDelay) { + debug2("RETRY", fn2.name, args); + fn2.apply(null, args.concat([startTime])); + } else { + fs17[gracefulQueue].push(elem); + } + } + if (retryTimer === void 0) { + retryTimer = setTimeout(retry, 0); + } + } + } +}); + +// .yarn/cache/@zkochan-cmd-shim-npm-6.0.0-97792a7373-ba1442ba1e.zip/node_modules/@zkochan/cmd-shim/index.js +var require_cmd_shim = __commonJS({ + ".yarn/cache/@zkochan-cmd-shim-npm-6.0.0-97792a7373-ba1442ba1e.zip/node_modules/@zkochan/cmd-shim/index.js"(exports2, module2) { + "use strict"; + cmdShim2.ifExists = cmdShimIfExists; + var util_1 = require("util"); + var path16 = require("path"); + var isWindows4 = require_is_windows(); + var CMD_EXTENSION = require_cmd_extension(); + var shebangExpr = /^#!\s*(?:\/usr\/bin\/env(?:\s+-S\s*)?)?\s*([^ \t]+)(.*)$/; + var DEFAULT_OPTIONS = { + // Create PowerShell file by default if the option hasn't been specified + createPwshFile: true, + createCmdFile: isWindows4(), + fs: require_graceful_fs() + }; + var extensionToProgramMap = /* @__PURE__ */ new Map([ + [".js", "node"], + [".cjs", "node"], + [".mjs", "node"], + [".cmd", "cmd"], + [".bat", "cmd"], + [".ps1", "pwsh"], + [".sh", "sh"] + ]); + function ingestOptions(opts) { + const opts_ = { ...DEFAULT_OPTIONS, ...opts }; + const fs17 = opts_.fs; + opts_.fs_ = { + chmod: fs17.chmod ? (0, util_1.promisify)(fs17.chmod) : (async () => { + }), + mkdir: (0, util_1.promisify)(fs17.mkdir), + readFile: (0, util_1.promisify)(fs17.readFile), + stat: (0, util_1.promisify)(fs17.stat), + unlink: (0, util_1.promisify)(fs17.unlink), + writeFile: (0, util_1.promisify)(fs17.writeFile) + }; + return opts_; + } + async function cmdShim2(src, to, opts) { + const opts_ = ingestOptions(opts); + await cmdShim_(src, to, opts_); + } + function cmdShimIfExists(src, to, opts) { + return cmdShim2(src, to, opts).catch(() => { + }); + } + function rm(path17, opts) { + return opts.fs_.unlink(path17).catch(() => { + }); + } + async function cmdShim_(src, to, opts) { + const srcRuntimeInfo = await searchScriptRuntime(src, opts); + await writeShimsPreCommon(to, opts); + return writeAllShims(src, to, srcRuntimeInfo, opts); + } + function writeShimsPreCommon(target, opts) { + return opts.fs_.mkdir(path16.dirname(target), { recursive: true }); + } + function writeAllShims(src, to, srcRuntimeInfo, opts) { + const opts_ = ingestOptions(opts); + const generatorAndExts = [{ generator: generateShShim, extension: "" }]; + if (opts_.createCmdFile) { + generatorAndExts.push({ generator: generateCmdShim, extension: CMD_EXTENSION }); + } + if (opts_.createPwshFile) { + generatorAndExts.push({ generator: generatePwshShim, extension: ".ps1" }); + } + return Promise.all(generatorAndExts.map((generatorAndExt) => writeShim(src, to + generatorAndExt.extension, srcRuntimeInfo, generatorAndExt.generator, opts_))); + } + function writeShimPre(target, opts) { + return rm(target, opts); + } + function writeShimPost(target, opts) { + return chmodShim(target, opts); + } + async function searchScriptRuntime(target, opts) { + try { + const data = await opts.fs_.readFile(target, "utf8"); + const firstLine = data.trim().split(/\r*\n/)[0]; + const shebang = firstLine.match(shebangExpr); + if (!shebang) { + const targetExtension = path16.extname(target).toLowerCase(); + return { + // undefined if extension is unknown but it's converted to null. + program: extensionToProgramMap.get(targetExtension) || null, + additionalArgs: "" + }; + } + return { + program: shebang[1], + additionalArgs: shebang[2] + }; + } catch (err) { + if (!isWindows4() || err.code !== "ENOENT") + throw err; + if (await opts.fs_.stat(`${target}${getExeExtension()}`)) { + return { + program: null, + additionalArgs: "" + }; + } + throw err; + } + } + function getExeExtension() { + let cmdExtension; + if (process.env.PATHEXT) { + cmdExtension = process.env.PATHEXT.split(path16.delimiter).find((ext) => ext.toLowerCase() === ".exe"); + } + return cmdExtension || ".exe"; + } + async function writeShim(src, to, srcRuntimeInfo, generateShimScript, opts) { + const defaultArgs = opts.preserveSymlinks ? "--preserve-symlinks" : ""; + const args = [srcRuntimeInfo.additionalArgs, defaultArgs].filter((arg) => arg).join(" "); + opts = Object.assign({}, opts, { + prog: srcRuntimeInfo.program, + args + }); + await writeShimPre(to, opts); + await opts.fs_.writeFile(to, generateShimScript(src, to, opts), "utf8"); + return writeShimPost(to, opts); + } + function generateCmdShim(src, to, opts) { + const shTarget = path16.relative(path16.dirname(to), src); + let target = shTarget.split("/").join("\\"); + const quotedPathToTarget = path16.isAbsolute(target) ? `"${target}"` : `"%~dp0\\${target}"`; + let longProg; + let prog = opts.prog; + let args = opts.args || ""; + const nodePath = normalizePathEnvVar(opts.nodePath).win32; + const prependToPath = normalizePathEnvVar(opts.prependToPath).win32; + if (!prog) { + prog = quotedPathToTarget; + args = ""; + target = ""; + } else if (prog === "node" && opts.nodeExecPath) { + prog = `"${opts.nodeExecPath}"`; + target = quotedPathToTarget; + } else { + longProg = `"%~dp0\\${prog}.exe"`; + target = quotedPathToTarget; + } + let progArgs = opts.progArgs ? `${opts.progArgs.join(` `)} ` : ""; + let cmd = "@SETLOCAL\r\n"; + if (prependToPath) { + cmd += `@SET "PATH=${prependToPath}:%PATH%"\r +`; + } + if (nodePath) { + cmd += `@IF NOT DEFINED NODE_PATH (\r + @SET "NODE_PATH=${nodePath}"\r +) ELSE (\r + @SET "NODE_PATH=${nodePath};%NODE_PATH%"\r +)\r +`; + } + if (longProg) { + cmd += `@IF EXIST ${longProg} (\r + ${longProg} ${args} ${target} ${progArgs}%*\r +) ELSE (\r + @SET PATHEXT=%PATHEXT:;.JS;=;%\r + ${prog} ${args} ${target} ${progArgs}%*\r +)\r +`; + } else { + cmd += `@${prog} ${args} ${target} ${progArgs}%*\r +`; + } + return cmd; + } + function generateShShim(src, to, opts) { + let shTarget = path16.relative(path16.dirname(to), src); + let shProg = opts.prog && opts.prog.split("\\").join("/"); + let shLongProg; + shTarget = shTarget.split("\\").join("/"); + const quotedPathToTarget = path16.isAbsolute(shTarget) ? `"${shTarget}"` : `"$basedir/${shTarget}"`; + let args = opts.args || ""; + const shNodePath = normalizePathEnvVar(opts.nodePath).posix; + if (!shProg) { + shProg = quotedPathToTarget; + args = ""; + shTarget = ""; + } else if (opts.prog === "node" && opts.nodeExecPath) { + shProg = `"${opts.nodeExecPath}"`; + shTarget = quotedPathToTarget; + } else { + shLongProg = `"$basedir/${opts.prog}"`; + shTarget = quotedPathToTarget; + } + let progArgs = opts.progArgs ? `${opts.progArgs.join(` `)} ` : ""; + let sh = `#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')") + +case \`uname\` in + *CYGWIN*) basedir=\`cygpath -w "$basedir"\`;; +esac + +`; + if (opts.prependToPath) { + sh += `export PATH="${opts.prependToPath}:$PATH" +`; + } + if (shNodePath) { + sh += `if [ -z "$NODE_PATH" ]; then + export NODE_PATH="${shNodePath}" +else + export NODE_PATH="${shNodePath}:$NODE_PATH" +fi +`; + } + if (shLongProg) { + sh += `if [ -x ${shLongProg} ]; then + exec ${shLongProg} ${args} ${shTarget} ${progArgs}"$@" +else + exec ${shProg} ${args} ${shTarget} ${progArgs}"$@" +fi +`; + } else { + sh += `${shProg} ${args} ${shTarget} ${progArgs}"$@" +exit $? +`; + } + return sh; + } + function generatePwshShim(src, to, opts) { + let shTarget = path16.relative(path16.dirname(to), src); + const shProg = opts.prog && opts.prog.split("\\").join("/"); + let pwshProg = shProg && `"${shProg}$exe"`; + let pwshLongProg; + shTarget = shTarget.split("\\").join("/"); + const quotedPathToTarget = path16.isAbsolute(shTarget) ? `"${shTarget}"` : `"$basedir/${shTarget}"`; + let args = opts.args || ""; + let normalizedNodePathEnvVar = normalizePathEnvVar(opts.nodePath); + const nodePath = normalizedNodePathEnvVar.win32; + const shNodePath = normalizedNodePathEnvVar.posix; + let normalizedPrependPathEnvVar = normalizePathEnvVar(opts.prependToPath); + const prependPath = normalizedPrependPathEnvVar.win32; + const shPrependPath = normalizedPrependPathEnvVar.posix; + if (!pwshProg) { + pwshProg = quotedPathToTarget; + args = ""; + shTarget = ""; + } else if (opts.prog === "node" && opts.nodeExecPath) { + pwshProg = `"${opts.nodeExecPath}"`; + shTarget = quotedPathToTarget; + } else { + pwshLongProg = `"$basedir/${opts.prog}$exe"`; + shTarget = quotedPathToTarget; + } + let progArgs = opts.progArgs ? `${opts.progArgs.join(` `)} ` : ""; + let pwsh = `#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +${nodePath || prependPath ? '$pathsep=":"\n' : ""}${nodePath ? `$env_node_path=$env:NODE_PATH +$new_node_path="${nodePath}" +` : ""}${prependPath ? `$env_path=$env:PATH +$prepend_path="${prependPath}" +` : ""}if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +${nodePath || prependPath ? ' $pathsep=";"\n' : ""}}`; + if (shNodePath || shPrependPath) { + pwsh += ` else { +${shNodePath ? ` $new_node_path="${shNodePath}" +` : ""}${shPrependPath ? ` $prepend_path="${shPrependPath}" +` : ""}} +`; + } + if (shNodePath) { + pwsh += `if ([string]::IsNullOrEmpty($env_node_path)) { + $env:NODE_PATH=$new_node_path +} else { + $env:NODE_PATH="$new_node_path$pathsep$env_node_path" +} +`; + } + if (opts.prependToPath) { + pwsh += ` +$env:PATH="$prepend_path$pathsep$env:PATH" +`; + } + if (pwshLongProg) { + pwsh += ` +$ret=0 +if (Test-Path ${pwshLongProg}) { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & ${pwshLongProg} ${args} ${shTarget} ${progArgs}$args + } else { + & ${pwshLongProg} ${args} ${shTarget} ${progArgs}$args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & ${pwshProg} ${args} ${shTarget} ${progArgs}$args + } else { + & ${pwshProg} ${args} ${shTarget} ${progArgs}$args + } + $ret=$LASTEXITCODE +} +${nodePath ? "$env:NODE_PATH=$env_node_path\n" : ""}${prependPath ? "$env:PATH=$env_path\n" : ""}exit $ret +`; + } else { + pwsh += ` +# Support pipeline input +if ($MyInvocation.ExpectingInput) { + $input | & ${pwshProg} ${args} ${shTarget} ${progArgs}$args +} else { + & ${pwshProg} ${args} ${shTarget} ${progArgs}$args +} +${nodePath ? "$env:NODE_PATH=$env_node_path\n" : ""}${prependPath ? "$env:PATH=$env_path\n" : ""}exit $LASTEXITCODE +`; + } + return pwsh; + } + function chmodShim(to, opts) { + return opts.fs_.chmod(to, 493); + } + function normalizePathEnvVar(nodePath) { + if (!nodePath || !nodePath.length) { + return { + win32: "", + posix: "" + }; + } + let split = typeof nodePath === "string" ? nodePath.split(path16.delimiter) : Array.from(nodePath); + let result = {}; + for (let i = 0; i < split.length; i++) { + const win322 = split[i].split("/").join("\\"); + const posix = isWindows4() ? split[i].split("\\").join("/").replace(/^([^:\\/]*):/, (_, $1) => `/mnt/${$1.toLowerCase()}`) : split[i]; + result.win32 = result.win32 ? `${result.win32};${win322}` : win322; + result.posix = result.posix ? `${result.posix}:${posix}` : posix; + result[i] = { win32: win322, posix }; + } + return result; + } + module2.exports = cmdShim2; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/mode-fix.js +var modeFix; +var init_mode_fix = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/mode-fix.js"() { + modeFix = (mode, isDir, portable) => { + mode &= 4095; + if (portable) { + mode = (mode | 384) & ~18; + } + if (isDir) { + if (mode & 256) { + mode |= 64; + } + if (mode & 32) { + mode |= 8; + } + if (mode & 4) { + mode |= 1; + } + } + return mode; + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/write-entry.js +var import_fs11, import_path9, prefixPath, maxReadSize, PROCESS, FILE2, DIRECTORY2, SYMLINK2, HARDLINK2, HEADER, READ2, LSTAT, ONLSTAT, ONREAD, ONREADLINK, OPENFILE, ONOPENFILE, CLOSE, MODE, AWAITDRAIN, ONDRAIN, PREFIX, WriteEntry, WriteEntrySync, WriteEntryTar, getType; +var init_write_entry = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/write-entry.js"() { + import_fs11 = __toESM(require("fs"), 1); + init_esm(); + import_path9 = __toESM(require("path"), 1); + init_header(); + init_mode_fix(); + init_normalize_windows_path(); + init_options(); + init_pax(); + init_strip_absolute_path(); + init_strip_trailing_slashes(); + init_warn_method(); + init_winchars(); + prefixPath = (path16, prefix) => { + if (!prefix) { + return normalizeWindowsPath(path16); + } + path16 = normalizeWindowsPath(path16).replace(/^\.(\/|$)/, ""); + return stripTrailingSlashes(prefix) + "/" + path16; + }; + maxReadSize = 16 * 1024 * 1024; + PROCESS = Symbol("process"); + FILE2 = Symbol("file"); + DIRECTORY2 = Symbol("directory"); + SYMLINK2 = Symbol("symlink"); + HARDLINK2 = Symbol("hardlink"); + HEADER = Symbol("header"); + READ2 = Symbol("read"); + LSTAT = Symbol("lstat"); + ONLSTAT = Symbol("onlstat"); + ONREAD = Symbol("onread"); + ONREADLINK = Symbol("onreadlink"); + OPENFILE = Symbol("openfile"); + ONOPENFILE = Symbol("onopenfile"); + CLOSE = Symbol("close"); + MODE = Symbol("mode"); + AWAITDRAIN = Symbol("awaitDrain"); + ONDRAIN = Symbol("ondrain"); + PREFIX = Symbol("prefix"); + WriteEntry = class extends Minipass { + path; + portable; + myuid = process.getuid && process.getuid() || 0; + // until node has builtin pwnam functions, this'll have to do + myuser = process.env.USER || ""; + maxReadSize; + linkCache; + statCache; + preservePaths; + cwd; + strict; + mtime; + noPax; + noMtime; + prefix; + fd; + blockLen = 0; + blockRemain = 0; + buf; + pos = 0; + remain = 0; + length = 0; + offset = 0; + win32; + absolute; + header; + type; + linkpath; + stat; + onWriteEntry; + #hadError = false; + constructor(p, opt_ = {}) { + const opt = dealias(opt_); + super(); + this.path = normalizeWindowsPath(p); + this.portable = !!opt.portable; + this.maxReadSize = opt.maxReadSize || maxReadSize; + this.linkCache = opt.linkCache || /* @__PURE__ */ new Map(); + this.statCache = opt.statCache || /* @__PURE__ */ new Map(); + this.preservePaths = !!opt.preservePaths; + this.cwd = normalizeWindowsPath(opt.cwd || process.cwd()); + this.strict = !!opt.strict; + this.noPax = !!opt.noPax; + this.noMtime = !!opt.noMtime; + this.mtime = opt.mtime; + this.prefix = opt.prefix ? normalizeWindowsPath(opt.prefix) : void 0; + this.onWriteEntry = opt.onWriteEntry; + if (typeof opt.onwarn === "function") { + this.on("warn", opt.onwarn); + } + let pathWarn = false; + if (!this.preservePaths) { + const [root, stripped] = stripAbsolutePath(this.path); + if (root && typeof stripped === "string") { + this.path = stripped; + pathWarn = root; + } + } + this.win32 = !!opt.win32 || process.platform === "win32"; + if (this.win32) { + this.path = decode(this.path.replace(/\\/g, "/")); + p = p.replace(/\\/g, "/"); + } + this.absolute = normalizeWindowsPath(opt.absolute || import_path9.default.resolve(this.cwd, p)); + if (this.path === "") { + this.path = "./"; + } + if (pathWarn) { + this.warn("TAR_ENTRY_INFO", `stripping ${pathWarn} from absolute path`, { + entry: this, + path: pathWarn + this.path + }); + } + const cs = this.statCache.get(this.absolute); + if (cs) { + this[ONLSTAT](cs); + } else { + this[LSTAT](); + } + } + warn(code2, message, data = {}) { + return warnMethod(this, code2, message, data); + } + emit(ev, ...data) { + if (ev === "error") { + this.#hadError = true; + } + return super.emit(ev, ...data); + } + [LSTAT]() { + import_fs11.default.lstat(this.absolute, (er, stat) => { + if (er) { + return this.emit("error", er); + } + this[ONLSTAT](stat); + }); + } + [ONLSTAT](stat) { + this.statCache.set(this.absolute, stat); + this.stat = stat; + if (!stat.isFile()) { + stat.size = 0; + } + this.type = getType(stat); + this.emit("stat", stat); + this[PROCESS](); + } + [PROCESS]() { + switch (this.type) { + case "File": + return this[FILE2](); + case "Directory": + return this[DIRECTORY2](); + case "SymbolicLink": + return this[SYMLINK2](); + // unsupported types are ignored. + default: + return this.end(); + } + } + [MODE](mode) { + return modeFix(mode, this.type === "Directory", this.portable); + } + [PREFIX](path16) { + return prefixPath(path16, this.prefix); + } + [HEADER]() { + if (!this.stat) { + throw new Error("cannot write header before stat"); + } + if (this.type === "Directory" && this.portable) { + this.noMtime = true; + } + this.onWriteEntry?.(this); + this.header = new Header({ + path: this[PREFIX](this.path), + // only apply the prefix to hard links. + linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[PREFIX](this.linkpath) : this.linkpath, + // only the permissions and setuid/setgid/sticky bitflags + // not the higher-order bits that specify file type + mode: this[MODE](this.stat.mode), + uid: this.portable ? void 0 : this.stat.uid, + gid: this.portable ? void 0 : this.stat.gid, + size: this.stat.size, + mtime: this.noMtime ? void 0 : this.mtime || this.stat.mtime, + /* c8 ignore next */ + type: this.type === "Unsupported" ? void 0 : this.type, + uname: this.portable ? void 0 : this.stat.uid === this.myuid ? this.myuser : "", + atime: this.portable ? void 0 : this.stat.atime, + ctime: this.portable ? void 0 : this.stat.ctime + }); + if (this.header.encode() && !this.noPax) { + super.write(new Pax({ + atime: this.portable ? void 0 : this.header.atime, + ctime: this.portable ? void 0 : this.header.ctime, + gid: this.portable ? void 0 : this.header.gid, + mtime: this.noMtime ? void 0 : this.mtime || this.header.mtime, + path: this[PREFIX](this.path), + linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[PREFIX](this.linkpath) : this.linkpath, + size: this.header.size, + uid: this.portable ? void 0 : this.header.uid, + uname: this.portable ? void 0 : this.header.uname, + dev: this.portable ? void 0 : this.stat.dev, + ino: this.portable ? void 0 : this.stat.ino, + nlink: this.portable ? void 0 : this.stat.nlink + }).encode()); + } + const block = this.header?.block; + if (!block) { + throw new Error("failed to encode header"); + } + super.write(block); + } + [DIRECTORY2]() { + if (!this.stat) { + throw new Error("cannot create directory entry without stat"); + } + if (this.path.slice(-1) !== "/") { + this.path += "/"; + } + this.stat.size = 0; + this[HEADER](); + this.end(); + } + [SYMLINK2]() { + import_fs11.default.readlink(this.absolute, (er, linkpath) => { + if (er) { + return this.emit("error", er); + } + this[ONREADLINK](linkpath); + }); + } + [ONREADLINK](linkpath) { + this.linkpath = normalizeWindowsPath(linkpath); + this[HEADER](); + this.end(); + } + [HARDLINK2](linkpath) { + if (!this.stat) { + throw new Error("cannot create link entry without stat"); + } + this.type = "Link"; + this.linkpath = normalizeWindowsPath(import_path9.default.relative(this.cwd, linkpath)); + this.stat.size = 0; + this[HEADER](); + this.end(); + } + [FILE2]() { + if (!this.stat) { + throw new Error("cannot create file entry without stat"); + } + if (this.stat.nlink > 1) { + const linkKey = `${this.stat.dev}:${this.stat.ino}`; + const linkpath = this.linkCache.get(linkKey); + if (linkpath?.indexOf(this.cwd) === 0) { + return this[HARDLINK2](linkpath); + } + this.linkCache.set(linkKey, this.absolute); + } + this[HEADER](); + if (this.stat.size === 0) { + return this.end(); + } + this[OPENFILE](); + } + [OPENFILE]() { + import_fs11.default.open(this.absolute, "r", (er, fd) => { + if (er) { + return this.emit("error", er); + } + this[ONOPENFILE](fd); + }); + } + [ONOPENFILE](fd) { + this.fd = fd; + if (this.#hadError) { + return this[CLOSE](); + } + if (!this.stat) { + throw new Error("should stat before calling onopenfile"); + } + this.blockLen = 512 * Math.ceil(this.stat.size / 512); + this.blockRemain = this.blockLen; + const bufLen = Math.min(this.blockLen, this.maxReadSize); + this.buf = Buffer.allocUnsafe(bufLen); + this.offset = 0; + this.pos = 0; + this.remain = this.stat.size; + this.length = this.buf.length; + this[READ2](); + } + [READ2]() { + const { fd, buf, offset, length, pos: pos2 } = this; + if (fd === void 0 || buf === void 0) { + throw new Error("cannot read file without first opening"); + } + import_fs11.default.read(fd, buf, offset, length, pos2, (er, bytesRead) => { + if (er) { + return this[CLOSE](() => this.emit("error", er)); + } + this[ONREAD](bytesRead); + }); + } + /* c8 ignore start */ + [CLOSE](cb = () => { + }) { + if (this.fd !== void 0) + import_fs11.default.close(this.fd, cb); + } + [ONREAD](bytesRead) { + if (bytesRead <= 0 && this.remain > 0) { + const er = Object.assign(new Error("encountered unexpected EOF"), { + path: this.absolute, + syscall: "read", + code: "EOF" + }); + return this[CLOSE](() => this.emit("error", er)); + } + if (bytesRead > this.remain) { + const er = Object.assign(new Error("did not encounter expected EOF"), { + path: this.absolute, + syscall: "read", + code: "EOF" + }); + return this[CLOSE](() => this.emit("error", er)); + } + if (!this.buf) { + throw new Error("should have created buffer prior to reading"); + } + if (bytesRead === this.remain) { + for (let i = bytesRead; i < this.length && bytesRead < this.blockRemain; i++) { + this.buf[i + this.offset] = 0; + bytesRead++; + this.remain++; + } + } + const chunk = this.offset === 0 && bytesRead === this.buf.length ? this.buf : this.buf.subarray(this.offset, this.offset + bytesRead); + const flushed = this.write(chunk); + if (!flushed) { + this[AWAITDRAIN](() => this[ONDRAIN]()); + } else { + this[ONDRAIN](); + } + } + [AWAITDRAIN](cb) { + this.once("drain", cb); + } + write(chunk, encoding, cb) { + if (typeof encoding === "function") { + cb = encoding; + encoding = void 0; + } + if (typeof chunk === "string") { + chunk = Buffer.from(chunk, typeof encoding === "string" ? encoding : "utf8"); + } + if (this.blockRemain < chunk.length) { + const er = Object.assign(new Error("writing more data than expected"), { + path: this.absolute + }); + return this.emit("error", er); + } + this.remain -= chunk.length; + this.blockRemain -= chunk.length; + this.pos += chunk.length; + this.offset += chunk.length; + return super.write(chunk, null, cb); + } + [ONDRAIN]() { + if (!this.remain) { + if (this.blockRemain) { + super.write(Buffer.alloc(this.blockRemain)); + } + return this[CLOSE]((er) => er ? this.emit("error", er) : this.end()); + } + if (!this.buf) { + throw new Error("buffer lost somehow in ONDRAIN"); + } + if (this.offset >= this.length) { + this.buf = Buffer.allocUnsafe(Math.min(this.blockRemain, this.buf.length)); + this.offset = 0; + } + this.length = this.buf.length - this.offset; + this[READ2](); + } + }; + WriteEntrySync = class extends WriteEntry { + sync = true; + [LSTAT]() { + this[ONLSTAT](import_fs11.default.lstatSync(this.absolute)); + } + [SYMLINK2]() { + this[ONREADLINK](import_fs11.default.readlinkSync(this.absolute)); + } + [OPENFILE]() { + this[ONOPENFILE](import_fs11.default.openSync(this.absolute, "r")); + } + [READ2]() { + let threw = true; + try { + const { fd, buf, offset, length, pos: pos2 } = this; + if (fd === void 0 || buf === void 0) { + throw new Error("fd and buf must be set in READ method"); + } + const bytesRead = import_fs11.default.readSync(fd, buf, offset, length, pos2); + this[ONREAD](bytesRead); + threw = false; + } finally { + if (threw) { + try { + this[CLOSE](() => { + }); + } catch (er) { + } + } + } + } + [AWAITDRAIN](cb) { + cb(); + } + /* c8 ignore start */ + [CLOSE](cb = () => { + }) { + if (this.fd !== void 0) + import_fs11.default.closeSync(this.fd); + cb(); + } + }; + WriteEntryTar = class extends Minipass { + blockLen = 0; + blockRemain = 0; + buf = 0; + pos = 0; + remain = 0; + length = 0; + preservePaths; + portable; + strict; + noPax; + noMtime; + readEntry; + type; + prefix; + path; + mode; + uid; + gid; + uname; + gname; + header; + mtime; + atime; + ctime; + linkpath; + size; + onWriteEntry; + warn(code2, message, data = {}) { + return warnMethod(this, code2, message, data); + } + constructor(readEntry, opt_ = {}) { + const opt = dealias(opt_); + super(); + this.preservePaths = !!opt.preservePaths; + this.portable = !!opt.portable; + this.strict = !!opt.strict; + this.noPax = !!opt.noPax; + this.noMtime = !!opt.noMtime; + this.onWriteEntry = opt.onWriteEntry; + this.readEntry = readEntry; + const { type } = readEntry; + if (type === "Unsupported") { + throw new Error("writing entry that should be ignored"); + } + this.type = type; + if (this.type === "Directory" && this.portable) { + this.noMtime = true; + } + this.prefix = opt.prefix; + this.path = normalizeWindowsPath(readEntry.path); + this.mode = readEntry.mode !== void 0 ? this[MODE](readEntry.mode) : void 0; + this.uid = this.portable ? void 0 : readEntry.uid; + this.gid = this.portable ? void 0 : readEntry.gid; + this.uname = this.portable ? void 0 : readEntry.uname; + this.gname = this.portable ? void 0 : readEntry.gname; + this.size = readEntry.size; + this.mtime = this.noMtime ? void 0 : opt.mtime || readEntry.mtime; + this.atime = this.portable ? void 0 : readEntry.atime; + this.ctime = this.portable ? void 0 : readEntry.ctime; + this.linkpath = readEntry.linkpath !== void 0 ? normalizeWindowsPath(readEntry.linkpath) : void 0; + if (typeof opt.onwarn === "function") { + this.on("warn", opt.onwarn); + } + let pathWarn = false; + if (!this.preservePaths) { + const [root, stripped] = stripAbsolutePath(this.path); + if (root && typeof stripped === "string") { + this.path = stripped; + pathWarn = root; + } + } + this.remain = readEntry.size; + this.blockRemain = readEntry.startBlockSize; + this.onWriteEntry?.(this); + this.header = new Header({ + path: this[PREFIX](this.path), + linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[PREFIX](this.linkpath) : this.linkpath, + // only the permissions and setuid/setgid/sticky bitflags + // not the higher-order bits that specify file type + mode: this.mode, + uid: this.portable ? void 0 : this.uid, + gid: this.portable ? void 0 : this.gid, + size: this.size, + mtime: this.noMtime ? void 0 : this.mtime, + type: this.type, + uname: this.portable ? void 0 : this.uname, + atime: this.portable ? void 0 : this.atime, + ctime: this.portable ? void 0 : this.ctime + }); + if (pathWarn) { + this.warn("TAR_ENTRY_INFO", `stripping ${pathWarn} from absolute path`, { + entry: this, + path: pathWarn + this.path + }); + } + if (this.header.encode() && !this.noPax) { + super.write(new Pax({ + atime: this.portable ? void 0 : this.atime, + ctime: this.portable ? void 0 : this.ctime, + gid: this.portable ? void 0 : this.gid, + mtime: this.noMtime ? void 0 : this.mtime, + path: this[PREFIX](this.path), + linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[PREFIX](this.linkpath) : this.linkpath, + size: this.size, + uid: this.portable ? void 0 : this.uid, + uname: this.portable ? void 0 : this.uname, + dev: this.portable ? void 0 : this.readEntry.dev, + ino: this.portable ? void 0 : this.readEntry.ino, + nlink: this.portable ? void 0 : this.readEntry.nlink + }).encode()); + } + const b = this.header?.block; + if (!b) + throw new Error("failed to encode header"); + super.write(b); + readEntry.pipe(this); + } + [PREFIX](path16) { + return prefixPath(path16, this.prefix); + } + [MODE](mode) { + return modeFix(mode, this.type === "Directory", this.portable); + } + write(chunk, encoding, cb) { + if (typeof encoding === "function") { + cb = encoding; + encoding = void 0; + } + if (typeof chunk === "string") { + chunk = Buffer.from(chunk, typeof encoding === "string" ? encoding : "utf8"); + } + const writeLen = chunk.length; + if (writeLen > this.blockRemain) { + throw new Error("writing more to entry than is appropriate"); + } + this.blockRemain -= writeLen; + return super.write(chunk, cb); + } + end(chunk, encoding, cb) { + if (this.blockRemain) { + super.write(Buffer.alloc(this.blockRemain)); + } + if (typeof chunk === "function") { + cb = chunk; + encoding = void 0; + chunk = void 0; + } + if (typeof encoding === "function") { + cb = encoding; + encoding = void 0; + } + if (typeof chunk === "string") { + chunk = Buffer.from(chunk, encoding ?? "utf8"); + } + if (cb) + this.once("finish", cb); + chunk ? super.end(chunk, cb) : super.end(cb); + return this; + } + }; + getType = (stat) => stat.isFile() ? "File" : stat.isDirectory() ? "Directory" : stat.isSymbolicLink() ? "SymbolicLink" : "Unsupported"; + } +}); + +// .yarn/cache/yallist-npm-5.0.0-8732dd9f1c-a499c81ce6.zip/node_modules/yallist/dist/esm/index.js +function insertAfter(self2, node, value) { + const prev = node; + const next = node ? node.next : self2.head; + const inserted = new Node(value, prev, next, self2); + if (inserted.next === void 0) { + self2.tail = inserted; + } + if (inserted.prev === void 0) { + self2.head = inserted; + } + self2.length++; + return inserted; +} +function push(self2, item) { + self2.tail = new Node(item, self2.tail, void 0, self2); + if (!self2.head) { + self2.head = self2.tail; + } + self2.length++; +} +function unshift(self2, item) { + self2.head = new Node(item, void 0, self2.head, self2); + if (!self2.tail) { + self2.tail = self2.head; + } + self2.length++; +} +var Yallist, Node; +var init_esm5 = __esm({ + ".yarn/cache/yallist-npm-5.0.0-8732dd9f1c-a499c81ce6.zip/node_modules/yallist/dist/esm/index.js"() { + Yallist = class _Yallist { + tail; + head; + length = 0; + static create(list2 = []) { + return new _Yallist(list2); + } + constructor(list2 = []) { + for (const item of list2) { + this.push(item); + } + } + *[Symbol.iterator]() { + for (let walker = this.head; walker; walker = walker.next) { + yield walker.value; + } + } + removeNode(node) { + if (node.list !== this) { + throw new Error("removing node which does not belong to this list"); + } + const next = node.next; + const prev = node.prev; + if (next) { + next.prev = prev; + } + if (prev) { + prev.next = next; + } + if (node === this.head) { + this.head = next; + } + if (node === this.tail) { + this.tail = prev; + } + this.length--; + node.next = void 0; + node.prev = void 0; + node.list = void 0; + return next; + } + unshiftNode(node) { + if (node === this.head) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + const head = this.head; + node.list = this; + node.next = head; + if (head) { + head.prev = node; + } + this.head = node; + if (!this.tail) { + this.tail = node; + } + this.length++; + } + pushNode(node) { + if (node === this.tail) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + const tail = this.tail; + node.list = this; + node.prev = tail; + if (tail) { + tail.next = node; + } + this.tail = node; + if (!this.head) { + this.head = node; + } + this.length++; + } + push(...args) { + for (let i = 0, l = args.length; i < l; i++) { + push(this, args[i]); + } + return this.length; + } + unshift(...args) { + for (var i = 0, l = args.length; i < l; i++) { + unshift(this, args[i]); + } + return this.length; + } + pop() { + if (!this.tail) { + return void 0; + } + const res = this.tail.value; + const t = this.tail; + this.tail = this.tail.prev; + if (this.tail) { + this.tail.next = void 0; + } else { + this.head = void 0; + } + t.list = void 0; + this.length--; + return res; + } + shift() { + if (!this.head) { + return void 0; + } + const res = this.head.value; + const h = this.head; + this.head = this.head.next; + if (this.head) { + this.head.prev = void 0; + } else { + this.tail = void 0; + } + h.list = void 0; + this.length--; + return res; + } + forEach(fn2, thisp) { + thisp = thisp || this; + for (let walker = this.head, i = 0; !!walker; i++) { + fn2.call(thisp, walker.value, i, this); + walker = walker.next; + } + } + forEachReverse(fn2, thisp) { + thisp = thisp || this; + for (let walker = this.tail, i = this.length - 1; !!walker; i--) { + fn2.call(thisp, walker.value, i, this); + walker = walker.prev; + } + } + get(n) { + let i = 0; + let walker = this.head; + for (; !!walker && i < n; i++) { + walker = walker.next; + } + if (i === n && !!walker) { + return walker.value; + } + } + getReverse(n) { + let i = 0; + let walker = this.tail; + for (; !!walker && i < n; i++) { + walker = walker.prev; + } + if (i === n && !!walker) { + return walker.value; + } + } + map(fn2, thisp) { + thisp = thisp || this; + const res = new _Yallist(); + for (let walker = this.head; !!walker; ) { + res.push(fn2.call(thisp, walker.value, this)); + walker = walker.next; + } + return res; + } + mapReverse(fn2, thisp) { + thisp = thisp || this; + var res = new _Yallist(); + for (let walker = this.tail; !!walker; ) { + res.push(fn2.call(thisp, walker.value, this)); + walker = walker.prev; + } + return res; + } + reduce(fn2, initial) { + let acc; + let walker = this.head; + if (arguments.length > 1) { + acc = initial; + } else if (this.head) { + walker = this.head.next; + acc = this.head.value; + } else { + throw new TypeError("Reduce of empty list with no initial value"); + } + for (var i = 0; !!walker; i++) { + acc = fn2(acc, walker.value, i); + walker = walker.next; + } + return acc; + } + reduceReverse(fn2, initial) { + let acc; + let walker = this.tail; + if (arguments.length > 1) { + acc = initial; + } else if (this.tail) { + walker = this.tail.prev; + acc = this.tail.value; + } else { + throw new TypeError("Reduce of empty list with no initial value"); + } + for (let i = this.length - 1; !!walker; i--) { + acc = fn2(acc, walker.value, i); + walker = walker.prev; + } + return acc; + } + toArray() { + const arr = new Array(this.length); + for (let i = 0, walker = this.head; !!walker; i++) { + arr[i] = walker.value; + walker = walker.next; + } + return arr; + } + toArrayReverse() { + const arr = new Array(this.length); + for (let i = 0, walker = this.tail; !!walker; i++) { + arr[i] = walker.value; + walker = walker.prev; + } + return arr; + } + slice(from = 0, to = this.length) { + if (to < 0) { + to += this.length; + } + if (from < 0) { + from += this.length; + } + const ret = new _Yallist(); + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + let walker = this.head; + let i = 0; + for (i = 0; !!walker && i < from; i++) { + walker = walker.next; + } + for (; !!walker && i < to; i++, walker = walker.next) { + ret.push(walker.value); + } + return ret; + } + sliceReverse(from = 0, to = this.length) { + if (to < 0) { + to += this.length; + } + if (from < 0) { + from += this.length; + } + const ret = new _Yallist(); + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + let i = this.length; + let walker = this.tail; + for (; !!walker && i > to; i--) { + walker = walker.prev; + } + for (; !!walker && i > from; i--, walker = walker.prev) { + ret.push(walker.value); + } + return ret; + } + splice(start, deleteCount = 0, ...nodes) { + if (start > this.length) { + start = this.length - 1; + } + if (start < 0) { + start = this.length + start; + } + let walker = this.head; + for (let i = 0; !!walker && i < start; i++) { + walker = walker.next; + } + const ret = []; + for (let i = 0; !!walker && i < deleteCount; i++) { + ret.push(walker.value); + walker = this.removeNode(walker); + } + if (!walker) { + walker = this.tail; + } else if (walker !== this.tail) { + walker = walker.prev; + } + for (const v of nodes) { + walker = insertAfter(this, walker, v); + } + return ret; + } + reverse() { + const head = this.head; + const tail = this.tail; + for (let walker = head; !!walker; walker = walker.prev) { + const p = walker.prev; + walker.prev = walker.next; + walker.next = p; + } + this.head = tail; + this.tail = head; + return this; + } + }; + Node = class { + list; + next; + prev; + value; + constructor(value, prev, next, list2) { + this.list = list2; + this.value = value; + if (prev) { + prev.next = this; + this.prev = prev; + } else { + this.prev = void 0; + } + if (next) { + next.prev = this; + this.next = next; + } else { + this.next = void 0; + } + } + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/pack.js +var import_fs12, import_path10, PackJob, EOF2, ONSTAT, ENDED3, QUEUE2, CURRENT, PROCESS2, PROCESSING, PROCESSJOB, JOBS, JOBDONE, ADDFSENTRY, ADDTARENTRY, STAT, READDIR, ONREADDIR, PIPE, ENTRY, ENTRYOPT, WRITEENTRYCLASS, WRITE, ONDRAIN2, Pack, PackSync; +var init_pack = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/pack.js"() { + import_fs12 = __toESM(require("fs"), 1); + init_write_entry(); + init_esm(); + init_esm3(); + init_esm5(); + init_read_entry(); + init_warn_method(); + import_path10 = __toESM(require("path"), 1); + init_normalize_windows_path(); + PackJob = class { + path; + absolute; + entry; + stat; + readdir; + pending = false; + ignore = false; + piped = false; + constructor(path16, absolute) { + this.path = path16 || "./"; + this.absolute = absolute; + } + }; + EOF2 = Buffer.alloc(1024); + ONSTAT = Symbol("onStat"); + ENDED3 = Symbol("ended"); + QUEUE2 = Symbol("queue"); + CURRENT = Symbol("current"); + PROCESS2 = Symbol("process"); + PROCESSING = Symbol("processing"); + PROCESSJOB = Symbol("processJob"); + JOBS = Symbol("jobs"); + JOBDONE = Symbol("jobDone"); + ADDFSENTRY = Symbol("addFSEntry"); + ADDTARENTRY = Symbol("addTarEntry"); + STAT = Symbol("stat"); + READDIR = Symbol("readdir"); + ONREADDIR = Symbol("onreaddir"); + PIPE = Symbol("pipe"); + ENTRY = Symbol("entry"); + ENTRYOPT = Symbol("entryOpt"); + WRITEENTRYCLASS = Symbol("writeEntryClass"); + WRITE = Symbol("write"); + ONDRAIN2 = Symbol("ondrain"); + Pack = class extends Minipass { + sync = false; + opt; + cwd; + maxReadSize; + preservePaths; + strict; + noPax; + prefix; + linkCache; + statCache; + file; + portable; + zip; + readdirCache; + noDirRecurse; + follow; + noMtime; + mtime; + filter; + jobs; + [WRITEENTRYCLASS]; + onWriteEntry; + // Note: we actually DO need a linked list here, because we + // shift() to update the head of the list where we start, but still + // while that happens, need to know what the next item in the queue + // will be. Since we do multiple jobs in parallel, it's not as simple + // as just an Array.shift(), since that would lose the information about + // the next job in the list. We could add a .next field on the PackJob + // class, but then we'd have to be tracking the tail of the queue the + // whole time, and Yallist just does that for us anyway. + [QUEUE2]; + [JOBS] = 0; + [PROCESSING] = false; + [ENDED3] = false; + constructor(opt = {}) { + super(); + this.opt = opt; + this.file = opt.file || ""; + this.cwd = opt.cwd || process.cwd(); + this.maxReadSize = opt.maxReadSize; + this.preservePaths = !!opt.preservePaths; + this.strict = !!opt.strict; + this.noPax = !!opt.noPax; + this.prefix = normalizeWindowsPath(opt.prefix || ""); + this.linkCache = opt.linkCache || /* @__PURE__ */ new Map(); + this.statCache = opt.statCache || /* @__PURE__ */ new Map(); + this.readdirCache = opt.readdirCache || /* @__PURE__ */ new Map(); + this.onWriteEntry = opt.onWriteEntry; + this[WRITEENTRYCLASS] = WriteEntry; + if (typeof opt.onwarn === "function") { + this.on("warn", opt.onwarn); + } + this.portable = !!opt.portable; + if (opt.gzip || opt.brotli || opt.zstd) { + if ((opt.gzip ? 1 : 0) + (opt.brotli ? 1 : 0) + (opt.zstd ? 1 : 0) > 1) { + throw new TypeError("gzip, brotli, zstd are mutually exclusive"); + } + if (opt.gzip) { + if (typeof opt.gzip !== "object") { + opt.gzip = {}; + } + if (this.portable) { + opt.gzip.portable = true; + } + this.zip = new Gzip(opt.gzip); + } + if (opt.brotli) { + if (typeof opt.brotli !== "object") { + opt.brotli = {}; + } + this.zip = new BrotliCompress(opt.brotli); + } + if (opt.zstd) { + if (typeof opt.zstd !== "object") { + opt.zstd = {}; + } + this.zip = new ZstdCompress(opt.zstd); + } + if (!this.zip) + throw new Error("impossible"); + const zip = this.zip; + zip.on("data", (chunk) => super.write(chunk)); + zip.on("end", () => super.end()); + zip.on("drain", () => this[ONDRAIN2]()); + this.on("resume", () => zip.resume()); + } else { + this.on("drain", this[ONDRAIN2]); + } + this.noDirRecurse = !!opt.noDirRecurse; + this.follow = !!opt.follow; + this.noMtime = !!opt.noMtime; + if (opt.mtime) + this.mtime = opt.mtime; + this.filter = typeof opt.filter === "function" ? opt.filter : () => true; + this[QUEUE2] = new Yallist(); + this[JOBS] = 0; + this.jobs = Number(opt.jobs) || 4; + this[PROCESSING] = false; + this[ENDED3] = false; + } + [WRITE](chunk) { + return super.write(chunk); + } + add(path16) { + this.write(path16); + return this; + } + end(path16, encoding, cb) { + if (typeof path16 === "function") { + cb = path16; + path16 = void 0; + } + if (typeof encoding === "function") { + cb = encoding; + encoding = void 0; + } + if (path16) { + this.add(path16); + } + this[ENDED3] = true; + this[PROCESS2](); + if (cb) + cb(); + return this; + } + write(path16) { + if (this[ENDED3]) { + throw new Error("write after end"); + } + if (path16 instanceof ReadEntry) { + this[ADDTARENTRY](path16); + } else { + this[ADDFSENTRY](path16); + } + return this.flowing; + } + [ADDTARENTRY](p) { + const absolute = normalizeWindowsPath(import_path10.default.resolve(this.cwd, p.path)); + if (!this.filter(p.path, p)) { + p.resume(); + } else { + const job = new PackJob(p.path, absolute); + job.entry = new WriteEntryTar(p, this[ENTRYOPT](job)); + job.entry.on("end", () => this[JOBDONE](job)); + this[JOBS] += 1; + this[QUEUE2].push(job); + } + this[PROCESS2](); + } + [ADDFSENTRY](p) { + const absolute = normalizeWindowsPath(import_path10.default.resolve(this.cwd, p)); + this[QUEUE2].push(new PackJob(p, absolute)); + this[PROCESS2](); + } + [STAT](job) { + job.pending = true; + this[JOBS] += 1; + const stat = this.follow ? "stat" : "lstat"; + import_fs12.default[stat](job.absolute, (er, stat2) => { + job.pending = false; + this[JOBS] -= 1; + if (er) { + this.emit("error", er); + } else { + this[ONSTAT](job, stat2); + } + }); + } + [ONSTAT](job, stat) { + this.statCache.set(job.absolute, stat); + job.stat = stat; + if (!this.filter(job.path, stat)) { + job.ignore = true; + } else if (stat.isFile() && stat.nlink > 1 && job === this[CURRENT] && !this.linkCache.get(`${stat.dev}:${stat.ino}`) && !this.sync) { + this[PROCESSJOB](job); + } + this[PROCESS2](); + } + [READDIR](job) { + job.pending = true; + this[JOBS] += 1; + import_fs12.default.readdir(job.absolute, (er, entries) => { + job.pending = false; + this[JOBS] -= 1; + if (er) { + return this.emit("error", er); + } + this[ONREADDIR](job, entries); + }); + } + [ONREADDIR](job, entries) { + this.readdirCache.set(job.absolute, entries); + job.readdir = entries; + this[PROCESS2](); + } + [PROCESS2]() { + if (this[PROCESSING]) { + return; + } + this[PROCESSING] = true; + for (let w = this[QUEUE2].head; !!w && this[JOBS] < this.jobs; w = w.next) { + this[PROCESSJOB](w.value); + if (w.value.ignore) { + const p = w.next; + this[QUEUE2].removeNode(w); + w.next = p; + } + } + this[PROCESSING] = false; + if (this[ENDED3] && !this[QUEUE2].length && this[JOBS] === 0) { + if (this.zip) { + this.zip.end(EOF2); + } else { + super.write(EOF2); + super.end(); + } + } + } + get [CURRENT]() { + return this[QUEUE2] && this[QUEUE2].head && this[QUEUE2].head.value; + } + [JOBDONE](_job) { + this[QUEUE2].shift(); + this[JOBS] -= 1; + this[PROCESS2](); + } + [PROCESSJOB](job) { + if (job.pending) { + return; + } + if (job.entry) { + if (job === this[CURRENT] && !job.piped) { + this[PIPE](job); + } + return; + } + if (!job.stat) { + const sc = this.statCache.get(job.absolute); + if (sc) { + this[ONSTAT](job, sc); + } else { + this[STAT](job); + } + } + if (!job.stat) { + return; + } + if (job.ignore) { + return; + } + if (!this.noDirRecurse && job.stat.isDirectory() && !job.readdir) { + const rc = this.readdirCache.get(job.absolute); + if (rc) { + this[ONREADDIR](job, rc); + } else { + this[READDIR](job); + } + if (!job.readdir) { + return; + } + } + job.entry = this[ENTRY](job); + if (!job.entry) { + job.ignore = true; + return; + } + if (job === this[CURRENT] && !job.piped) { + this[PIPE](job); + } + } + [ENTRYOPT](job) { + return { + onwarn: (code2, msg, data) => this.warn(code2, msg, data), + noPax: this.noPax, + cwd: this.cwd, + absolute: job.absolute, + preservePaths: this.preservePaths, + maxReadSize: this.maxReadSize, + strict: this.strict, + portable: this.portable, + linkCache: this.linkCache, + statCache: this.statCache, + noMtime: this.noMtime, + mtime: this.mtime, + prefix: this.prefix, + onWriteEntry: this.onWriteEntry + }; + } + [ENTRY](job) { + this[JOBS] += 1; + try { + const e = new this[WRITEENTRYCLASS](job.path, this[ENTRYOPT](job)); + return e.on("end", () => this[JOBDONE](job)).on("error", (er) => this.emit("error", er)); + } catch (er) { + this.emit("error", er); + } + } + [ONDRAIN2]() { + if (this[CURRENT] && this[CURRENT].entry) { + this[CURRENT].entry.resume(); + } + } + // like .pipe() but using super, because our write() is special + [PIPE](job) { + job.piped = true; + if (job.readdir) { + job.readdir.forEach((entry) => { + const p = job.path; + const base = p === "./" ? "" : p.replace(/\/*$/, "/"); + this[ADDFSENTRY](base + entry); + }); + } + const source = job.entry; + const zip = this.zip; + if (!source) + throw new Error("cannot pipe without source"); + if (zip) { + source.on("data", (chunk) => { + if (!zip.write(chunk)) { + source.pause(); + } + }); + } else { + source.on("data", (chunk) => { + if (!super.write(chunk)) { + source.pause(); + } + }); + } + } + pause() { + if (this.zip) { + this.zip.pause(); + } + return super.pause(); + } + warn(code2, message, data = {}) { + warnMethod(this, code2, message, data); + } + }; + PackSync = class extends Pack { + sync = true; + constructor(opt) { + super(opt); + this[WRITEENTRYCLASS] = WriteEntrySync; + } + // pause/resume are no-ops in sync streams. + pause() { + } + resume() { + } + [STAT](job) { + const stat = this.follow ? "statSync" : "lstatSync"; + this[ONSTAT](job, import_fs12.default[stat](job.absolute)); + } + [READDIR](job) { + this[ONREADDIR](job, import_fs12.default.readdirSync(job.absolute)); + } + // gotta get it all in this tick + [PIPE](job) { + const source = job.entry; + const zip = this.zip; + if (job.readdir) { + job.readdir.forEach((entry) => { + const p = job.path; + const base = p === "./" ? "" : p.replace(/\/*$/, "/"); + this[ADDFSENTRY](base + entry); + }); + } + if (!source) + throw new Error("Cannot pipe without source"); + if (zip) { + source.on("data", (chunk) => { + zip.write(chunk); + }); + } else { + source.on("data", (chunk) => { + super[WRITE](chunk); + }); + } + } + }; + } +}); + +// .yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/create.js +var create_exports = {}; +__export(create_exports, { + create: () => create +}); +var import_node_path8, createFileSync, createFile, addFilesSync, addFilesAsync, createSync, createAsync, create; +var init_create = __esm({ + ".yarn/cache/tar-npm-7.5.6-955ec951c2-08af380703.zip/node_modules/tar/dist/esm/create.js"() { + init_esm2(); + import_node_path8 = __toESM(require("node:path"), 1); + init_list(); + init_make_command(); + init_pack(); + createFileSync = (opt, files) => { + const p = new PackSync(opt); + const stream = new WriteStreamSync(opt.file, { + mode: opt.mode || 438 + }); + p.pipe(stream); + addFilesSync(p, files); + }; + createFile = (opt, files) => { + const p = new Pack(opt); + const stream = new WriteStream(opt.file, { + mode: opt.mode || 438 + }); + p.pipe(stream); + const promise = new Promise((res, rej) => { + stream.on("error", rej); + stream.on("close", res); + p.on("error", rej); + }); + addFilesAsync(p, files); + return promise; + }; + addFilesSync = (p, files) => { + files.forEach((file) => { + if (file.charAt(0) === "@") { + list({ + file: import_node_path8.default.resolve(p.cwd, file.slice(1)), + sync: true, + noResume: true, + onReadEntry: (entry) => p.add(entry) + }); + } else { + p.add(file); + } + }); + p.end(); + }; + addFilesAsync = async (p, files) => { + for (let i = 0; i < files.length; i++) { + const file = String(files[i]); + if (file.charAt(0) === "@") { + await list({ + file: import_node_path8.default.resolve(String(p.cwd), file.slice(1)), + noResume: true, + onReadEntry: (entry) => { + p.add(entry); + } + }); + } else { + p.add(file); + } + } + p.end(); + }; + createSync = (opt, files) => { + const p = new PackSync(opt); + addFilesSync(p, files); + return p; + }; + createAsync = (opt, files) => { + const p = new Pack(opt); + addFilesAsync(p, files); + return p; + }; + create = makeCommand(createFileSync, createFile, createSync, createAsync, (_opt, files) => { + if (!files?.length) { + throw new TypeError("no paths specified to add to archive"); + } + }); + } +}); + +// .yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/major.js +var require_major = __commonJS({ + ".yarn/cache/semver-npm-7.7.3-9cf7b3b46c-4afe5c9865.zip/node_modules/semver/functions/major.js"(exports2, module2) { + "use strict"; + var SemVer3 = require_semver(); + var major = (a, loose) => new SemVer3(a, loose).major; + module2.exports = major; + } +}); + +// sources/_lib.ts +var lib_exports2 = {}; +__export(lib_exports2, { + runMain: () => runMain +}); +module.exports = __toCommonJS(lib_exports2); + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/constants.mjs +var NODE_INITIAL = 0; +var NODE_SUCCESS = 1; +var NODE_ERRORED = 2; +var START_OF_INPUT = ``; +var END_OF_INPUT = `\0`; +var HELP_COMMAND_INDEX = -1; +var HELP_REGEX = /^(-h|--help)(?:=([0-9]+))?$/; +var OPTION_REGEX = /^(--[a-z]+(?:-[a-z]+)*|-[a-zA-Z]+)$/; +var BATCH_REGEX = /^-[a-zA-Z]{2,}$/; +var BINDING_REGEX = /^([^=]+)=([\s\S]*)$/; +var DEBUG = process.env.DEBUG_CLI === `1`; + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/errors.mjs +var UsageError = class extends Error { + constructor(message) { + super(message); + this.clipanion = { type: `usage` }; + this.name = `UsageError`; + } +}; +var UnknownSyntaxError = class extends Error { + constructor(input, candidates) { + super(); + this.input = input; + this.candidates = candidates; + this.clipanion = { type: `none` }; + this.name = `UnknownSyntaxError`; + if (this.candidates.length === 0) { + this.message = `Command not found, but we're not sure what's the alternative.`; + } else if (this.candidates.every((candidate) => candidate.reason !== null && candidate.reason === candidates[0].reason)) { + const [{ reason }] = this.candidates; + this.message = `${reason} + +${this.candidates.map(({ usage }) => `$ ${usage}`).join(` +`)}`; + } else if (this.candidates.length === 1) { + const [{ usage }] = this.candidates; + this.message = `Command not found; did you mean: + +$ ${usage} +${whileRunning(input)}`; + } else { + this.message = `Command not found; did you mean one of: + +${this.candidates.map(({ usage }, index) => { + return `${`${index}.`.padStart(4)} ${usage}`; + }).join(` +`)} + +${whileRunning(input)}`; + } + } +}; +var AmbiguousSyntaxError = class extends Error { + constructor(input, usages) { + super(); + this.input = input; + this.usages = usages; + this.clipanion = { type: `none` }; + this.name = `AmbiguousSyntaxError`; + this.message = `Cannot find which to pick amongst the following alternatives: + +${this.usages.map((usage, index) => { + return `${`${index}.`.padStart(4)} ${usage}`; + }).join(` +`)} + +${whileRunning(input)}`; + } +}; +var whileRunning = (input) => `While running ${input.filter((token) => { + return token !== END_OF_INPUT; +}).map((token) => { + const json = JSON.stringify(token); + if (token.match(/\s/) || token.length === 0 || json !== `"${token}"`) { + return json; + } else { + return token; + } +}).join(` `)}`; + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/format.mjs +var MAX_LINE_LENGTH = 80; +var richLine = Array(MAX_LINE_LENGTH).fill(`\u2501`); +for (let t = 0; t <= 24; ++t) + richLine[richLine.length - t] = `\x1B[38;5;${232 + t}m\u2501`; +var richFormat = { + header: (str) => `\x1B[1m\u2501\u2501\u2501 ${str}${str.length < MAX_LINE_LENGTH - 5 ? ` ${richLine.slice(str.length + 5).join(``)}` : `:`}\x1B[0m`, + bold: (str) => `\x1B[1m${str}\x1B[22m`, + error: (str) => `\x1B[31m\x1B[1m${str}\x1B[22m\x1B[39m`, + code: (str) => `\x1B[36m${str}\x1B[39m` +}; +var textFormat = { + header: (str) => str, + bold: (str) => str, + error: (str) => str, + code: (str) => str +}; +function dedent(text) { + const lines = text.split(` +`); + const nonEmptyLines = lines.filter((line) => line.match(/\S/)); + const indent = nonEmptyLines.length > 0 ? nonEmptyLines.reduce((minLength, line) => Math.min(minLength, line.length - line.trimStart().length), Number.MAX_VALUE) : 0; + return lines.map((line) => line.slice(indent).trimRight()).join(` +`); +} +function formatMarkdownish(text, { format, paragraphs }) { + text = text.replace(/\r\n?/g, ` +`); + text = dedent(text); + text = text.replace(/^\n+|\n+$/g, ``); + text = text.replace(/^(\s*)-([^\n]*?)\n+/gm, `$1-$2 + +`); + text = text.replace(/\n(\n)?\n*/g, ($0, $1) => $1 ? $1 : ` `); + if (paragraphs) { + text = text.split(/\n/).map((paragraph) => { + const bulletMatch = paragraph.match(/^\s*[*-][\t ]+(.*)/); + if (!bulletMatch) + return paragraph.match(/(.{1,80})(?: |$)/g).join(` +`); + const indent = paragraph.length - paragraph.trimStart().length; + return bulletMatch[1].match(new RegExp(`(.{1,${78 - indent}})(?: |$)`, `g`)).map((line, index) => { + return ` `.repeat(indent) + (index === 0 ? `- ` : ` `) + line; + }).join(` +`); + }).join(` + +`); + } + text = text.replace(/(`+)((?:.|[\n])*?)\1/g, ($0, $1, $2) => { + return format.code($1 + $2 + $1); + }); + text = text.replace(/(\*\*)((?:.|[\n])*?)\1/g, ($0, $1, $2) => { + return format.bold($1 + $2 + $1); + }); + return text ? `${text} +` : ``; +} + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/options/utils.mjs +var isOptionSymbol = Symbol(`clipanion/isOption`); +function makeCommandOption(spec) { + return { ...spec, [isOptionSymbol]: true }; +} +function rerouteArguments(a, b) { + if (typeof a === `undefined`) + return [a, b]; + if (typeof a === `object` && a !== null && !Array.isArray(a)) { + return [void 0, a]; + } else { + return [a, b]; + } +} +function cleanValidationError(message, { mergeName = false } = {}) { + const match = message.match(/^([^:]+): (.*)$/m); + if (!match) + return `validation failed`; + let [, path16, line] = match; + if (mergeName) + line = line[0].toLowerCase() + line.slice(1); + line = path16 !== `.` || !mergeName ? `${path16.replace(/^\.(\[|$)/, `$1`)}: ${line}` : `: ${line}`; + return line; +} +function formatError(message, errors) { + if (errors.length === 1) { + return new UsageError(`${message}${cleanValidationError(errors[0], { mergeName: true })}`); + } else { + return new UsageError(`${message}: +${errors.map((error) => ` +- ${cleanValidationError(error)}`).join(``)}`); + } +} +function applyValidator(name2, value, validator) { + if (typeof validator === `undefined`) + return value; + const errors = []; + const coercions = []; + const coercion = (v) => { + const orig = value; + value = v; + return coercion.bind(null, orig); + }; + const check = validator(value, { errors, coercions, coercion }); + if (!check) + throw formatError(`Invalid value for ${name2}`, errors); + for (const [, op] of coercions) + op(); + return value; +} + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/Command.mjs +var Command = class { + constructor() { + this.help = false; + } + /** + * Defines the usage information for the given command. + */ + static Usage(usage) { + return usage; + } + /** + * Standard error handler which will simply rethrow the error. Can be used + * to add custom logic to handle errors from the command or simply return + * the parent class error handling. + */ + async catch(error) { + throw error; + } + async validateAndExecute() { + const commandClass = this.constructor; + const cascade2 = commandClass.schema; + if (Array.isArray(cascade2)) { + const { isDict: isDict2, isUnknown: isUnknown2, applyCascade: applyCascade2 } = await Promise.resolve().then(() => (init_lib(), lib_exports)); + const schema = applyCascade2(isDict2(isUnknown2()), cascade2); + const errors = []; + const coercions = []; + const check = schema(this, { errors, coercions }); + if (!check) + throw formatError(`Invalid option schema`, errors); + for (const [, op] of coercions) { + op(); + } + } else if (cascade2 != null) { + throw new Error(`Invalid command schema`); + } + const exitCode = await this.execute(); + if (typeof exitCode !== `undefined`) { + return exitCode; + } else { + return 0; + } + } +}; +Command.isOption = isOptionSymbol; +Command.Default = []; + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/core.mjs +function debug(str) { + if (DEBUG) { + console.log(str); + } +} +var basicHelpState = { + candidateUsage: null, + requiredOptions: [], + errorMessage: null, + ignoreOptions: false, + path: [], + positionals: [], + options: [], + remainder: null, + selectedIndex: HELP_COMMAND_INDEX +}; +function makeStateMachine() { + return { + nodes: [makeNode(), makeNode(), makeNode()] + }; +} +function makeAnyOfMachine(inputs) { + const output = makeStateMachine(); + const heads = []; + let offset = output.nodes.length; + for (const input of inputs) { + heads.push(offset); + for (let t = 0; t < input.nodes.length; ++t) + if (!isTerminalNode(t)) + output.nodes.push(cloneNode(input.nodes[t], offset)); + offset += input.nodes.length - 2; + } + for (const head of heads) + registerShortcut(output, NODE_INITIAL, head); + return output; +} +function injectNode(machine, node) { + machine.nodes.push(node); + return machine.nodes.length - 1; +} +function simplifyMachine(input) { + const visited = /* @__PURE__ */ new Set(); + const process5 = (node) => { + if (visited.has(node)) + return; + visited.add(node); + const nodeDef = input.nodes[node]; + for (const transitions of Object.values(nodeDef.statics)) + for (const { to } of transitions) + process5(to); + for (const [, { to }] of nodeDef.dynamics) + process5(to); + for (const { to } of nodeDef.shortcuts) + process5(to); + const shortcuts = new Set(nodeDef.shortcuts.map(({ to }) => to)); + while (nodeDef.shortcuts.length > 0) { + const { to } = nodeDef.shortcuts.shift(); + const toDef = input.nodes[to]; + for (const [segment, transitions] of Object.entries(toDef.statics)) { + const store = !Object.prototype.hasOwnProperty.call(nodeDef.statics, segment) ? nodeDef.statics[segment] = [] : nodeDef.statics[segment]; + for (const transition of transitions) { + if (!store.some(({ to: to2 }) => transition.to === to2)) { + store.push(transition); + } + } + } + for (const [test, transition] of toDef.dynamics) + if (!nodeDef.dynamics.some(([otherTest, { to: to2 }]) => test === otherTest && transition.to === to2)) + nodeDef.dynamics.push([test, transition]); + for (const transition of toDef.shortcuts) { + if (!shortcuts.has(transition.to)) { + nodeDef.shortcuts.push(transition); + shortcuts.add(transition.to); + } + } + } + }; + process5(NODE_INITIAL); +} +function debugMachine(machine, { prefix = `` } = {}) { + if (DEBUG) { + debug(`${prefix}Nodes are:`); + for (let t = 0; t < machine.nodes.length; ++t) { + debug(`${prefix} ${t}: ${JSON.stringify(machine.nodes[t])}`); + } + } +} +function runMachineInternal(machine, input, partial = false) { + debug(`Running a vm on ${JSON.stringify(input)}`); + let branches = [{ node: NODE_INITIAL, state: { + candidateUsage: null, + requiredOptions: [], + errorMessage: null, + ignoreOptions: false, + options: [], + path: [], + positionals: [], + remainder: null, + selectedIndex: null + } }]; + debugMachine(machine, { prefix: ` ` }); + const tokens = [START_OF_INPUT, ...input]; + for (let t = 0; t < tokens.length; ++t) { + const segment = tokens[t]; + debug(` Processing ${JSON.stringify(segment)}`); + const nextBranches = []; + for (const { node, state } of branches) { + debug(` Current node is ${node}`); + const nodeDef = machine.nodes[node]; + if (node === NODE_ERRORED) { + nextBranches.push({ node, state }); + continue; + } + console.assert(nodeDef.shortcuts.length === 0, `Shortcuts should have been eliminated by now`); + const hasExactMatch = Object.prototype.hasOwnProperty.call(nodeDef.statics, segment); + if (!partial || t < tokens.length - 1 || hasExactMatch) { + if (hasExactMatch) { + const transitions = nodeDef.statics[segment]; + for (const { to, reducer } of transitions) { + nextBranches.push({ node: to, state: typeof reducer !== `undefined` ? execute(reducers, reducer, state, segment) : state }); + debug(` Static transition to ${to} found`); + } + } else { + debug(` No static transition found`); + } + } else { + let hasMatches = false; + for (const candidate of Object.keys(nodeDef.statics)) { + if (!candidate.startsWith(segment)) + continue; + if (segment === candidate) { + for (const { to, reducer } of nodeDef.statics[candidate]) { + nextBranches.push({ node: to, state: typeof reducer !== `undefined` ? execute(reducers, reducer, state, segment) : state }); + debug(` Static transition to ${to} found`); + } + } else { + for (const { to } of nodeDef.statics[candidate]) { + nextBranches.push({ node: to, state: { ...state, remainder: candidate.slice(segment.length) } }); + debug(` Static transition to ${to} found (partial match)`); + } + } + hasMatches = true; + } + if (!hasMatches) { + debug(` No partial static transition found`); + } + } + if (segment !== END_OF_INPUT) { + for (const [test, { to, reducer }] of nodeDef.dynamics) { + if (execute(tests, test, state, segment)) { + nextBranches.push({ node: to, state: typeof reducer !== `undefined` ? execute(reducers, reducer, state, segment) : state }); + debug(` Dynamic transition to ${to} found (via ${test})`); + } + } + } + } + if (nextBranches.length === 0 && segment === END_OF_INPUT && input.length === 1) { + return [{ + node: NODE_INITIAL, + state: basicHelpState + }]; + } + if (nextBranches.length === 0) { + throw new UnknownSyntaxError(input, branches.filter(({ node }) => { + return node !== NODE_ERRORED; + }).map(({ state }) => { + return { usage: state.candidateUsage, reason: null }; + })); + } + if (nextBranches.every(({ node }) => node === NODE_ERRORED)) { + throw new UnknownSyntaxError(input, nextBranches.map(({ state }) => { + return { usage: state.candidateUsage, reason: state.errorMessage }; + })); + } + branches = trimSmallerBranches(nextBranches); + } + if (branches.length > 0) { + debug(` Results:`); + for (const branch of branches) { + debug(` - ${branch.node} -> ${JSON.stringify(branch.state)}`); + } + } else { + debug(` No results`); + } + return branches; +} +function checkIfNodeIsFinished(node, state) { + if (state.selectedIndex !== null) + return true; + if (Object.prototype.hasOwnProperty.call(node.statics, END_OF_INPUT)) { + for (const { to } of node.statics[END_OF_INPUT]) + if (to === NODE_SUCCESS) + return true; + } + return false; +} +function suggestMachine(machine, input, partial) { + const prefix = partial && input.length > 0 ? [``] : []; + const branches = runMachineInternal(machine, input, partial); + const suggestions = []; + const suggestionsJson = /* @__PURE__ */ new Set(); + const traverseSuggestion = (suggestion, node, skipFirst = true) => { + let nextNodes = [node]; + while (nextNodes.length > 0) { + const currentNodes = nextNodes; + nextNodes = []; + for (const node2 of currentNodes) { + const nodeDef = machine.nodes[node2]; + const keys = Object.keys(nodeDef.statics); + for (const key of Object.keys(nodeDef.statics)) { + const segment = keys[0]; + for (const { to, reducer } of nodeDef.statics[segment]) { + if (reducer !== `pushPath`) + continue; + if (!skipFirst) + suggestion.push(segment); + nextNodes.push(to); + } + } + } + skipFirst = false; + } + const json = JSON.stringify(suggestion); + if (suggestionsJson.has(json)) + return; + suggestions.push(suggestion); + suggestionsJson.add(json); + }; + for (const { node, state } of branches) { + if (state.remainder !== null) { + traverseSuggestion([state.remainder], node); + continue; + } + const nodeDef = machine.nodes[node]; + const isFinished = checkIfNodeIsFinished(nodeDef, state); + for (const [candidate, transitions] of Object.entries(nodeDef.statics)) + if (isFinished && candidate !== END_OF_INPUT || !candidate.startsWith(`-`) && transitions.some(({ reducer }) => reducer === `pushPath`)) + traverseSuggestion([...prefix, candidate], node); + if (!isFinished) + continue; + for (const [test, { to }] of nodeDef.dynamics) { + if (to === NODE_ERRORED) + continue; + const tokens = suggest(test, state); + if (tokens === null) + continue; + for (const token of tokens) { + traverseSuggestion([...prefix, token], node); + } + } + } + return [...suggestions].sort(); +} +function runMachine(machine, input) { + const branches = runMachineInternal(machine, [...input, END_OF_INPUT]); + return selectBestState(input, branches.map(({ state }) => { + return state; + })); +} +function trimSmallerBranches(branches) { + let maxPathSize = 0; + for (const { state } of branches) + if (state.path.length > maxPathSize) + maxPathSize = state.path.length; + return branches.filter(({ state }) => { + return state.path.length === maxPathSize; + }); +} +function selectBestState(input, states) { + const terminalStates = states.filter((state) => { + return state.selectedIndex !== null; + }); + if (terminalStates.length === 0) + throw new Error(); + const requiredOptionsSetStates = terminalStates.filter((state) => state.selectedIndex === HELP_COMMAND_INDEX || state.requiredOptions.every((names) => names.some((name2) => state.options.find((opt) => opt.name === name2)))); + if (requiredOptionsSetStates.length === 0) { + throw new UnknownSyntaxError(input, terminalStates.map((state) => ({ + usage: state.candidateUsage, + reason: null + }))); + } + let maxPathSize = 0; + for (const state of requiredOptionsSetStates) + if (state.path.length > maxPathSize) + maxPathSize = state.path.length; + const bestPathBranches = requiredOptionsSetStates.filter((state) => { + return state.path.length === maxPathSize; + }); + const getPositionalCount = (state) => state.positionals.filter(({ extra }) => { + return !extra; + }).length + state.options.length; + const statesWithPositionalCount = bestPathBranches.map((state) => { + return { state, positionalCount: getPositionalCount(state) }; + }); + let maxPositionalCount = 0; + for (const { positionalCount } of statesWithPositionalCount) + if (positionalCount > maxPositionalCount) + maxPositionalCount = positionalCount; + const bestPositionalStates = statesWithPositionalCount.filter(({ positionalCount }) => { + return positionalCount === maxPositionalCount; + }).map(({ state }) => { + return state; + }); + const fixedStates = aggregateHelpStates(bestPositionalStates); + if (fixedStates.length > 1) + throw new AmbiguousSyntaxError(input, fixedStates.map((state) => state.candidateUsage)); + return fixedStates[0]; +} +function aggregateHelpStates(states) { + const notHelps = []; + const helps = []; + for (const state of states) { + if (state.selectedIndex === HELP_COMMAND_INDEX) { + helps.push(state); + } else { + notHelps.push(state); + } + } + if (helps.length > 0) { + notHelps.push({ + ...basicHelpState, + path: findCommonPrefix(...helps.map((state) => state.path)), + options: helps.reduce((options, state) => options.concat(state.options), []) + }); + } + return notHelps; +} +function findCommonPrefix(firstPath, secondPath, ...rest) { + if (secondPath === void 0) + return Array.from(firstPath); + return findCommonPrefix(firstPath.filter((segment, i) => segment === secondPath[i]), ...rest); +} +function makeNode() { + return { + dynamics: [], + shortcuts: [], + statics: {} + }; +} +function isTerminalNode(node) { + return node === NODE_SUCCESS || node === NODE_ERRORED; +} +function cloneTransition(input, offset = 0) { + return { + to: !isTerminalNode(input.to) ? input.to > 2 ? input.to + offset - 2 : input.to + offset : input.to, + reducer: input.reducer + }; +} +function cloneNode(input, offset = 0) { + const output = makeNode(); + for (const [test, transition] of input.dynamics) + output.dynamics.push([test, cloneTransition(transition, offset)]); + for (const transition of input.shortcuts) + output.shortcuts.push(cloneTransition(transition, offset)); + for (const [segment, transitions] of Object.entries(input.statics)) + output.statics[segment] = transitions.map((transition) => cloneTransition(transition, offset)); + return output; +} +function registerDynamic(machine, from, test, to, reducer) { + machine.nodes[from].dynamics.push([ + test, + { to, reducer } + ]); +} +function registerShortcut(machine, from, to, reducer) { + machine.nodes[from].shortcuts.push({ to, reducer }); +} +function registerStatic(machine, from, test, to, reducer) { + const store = !Object.prototype.hasOwnProperty.call(machine.nodes[from].statics, test) ? machine.nodes[from].statics[test] = [] : machine.nodes[from].statics[test]; + store.push({ to, reducer }); +} +function execute(store, callback, state, segment) { + if (Array.isArray(callback)) { + const [name2, ...args] = callback; + return store[name2](state, segment, ...args); + } else { + return store[callback](state, segment); + } +} +function suggest(callback, state) { + const fn2 = Array.isArray(callback) ? tests[callback[0]] : tests[callback]; + if (typeof fn2.suggest === `undefined`) + return null; + const args = Array.isArray(callback) ? callback.slice(1) : []; + return fn2.suggest(state, ...args); +} +var tests = { + always: () => { + return true; + }, + isOptionLike: (state, segment) => { + return !state.ignoreOptions && (segment !== `-` && segment.startsWith(`-`)); + }, + isNotOptionLike: (state, segment) => { + return state.ignoreOptions || segment === `-` || !segment.startsWith(`-`); + }, + isOption: (state, segment, name2, hidden) => { + return !state.ignoreOptions && segment === name2; + }, + isBatchOption: (state, segment, names) => { + return !state.ignoreOptions && BATCH_REGEX.test(segment) && [...segment.slice(1)].every((name2) => names.includes(`-${name2}`)); + }, + isBoundOption: (state, segment, names, options) => { + const optionParsing = segment.match(BINDING_REGEX); + return !state.ignoreOptions && !!optionParsing && OPTION_REGEX.test(optionParsing[1]) && names.includes(optionParsing[1]) && options.filter((opt) => opt.names.includes(optionParsing[1])).every((opt) => opt.allowBinding); + }, + isNegatedOption: (state, segment, name2) => { + return !state.ignoreOptions && segment === `--no-${name2.slice(2)}`; + }, + isHelp: (state, segment) => { + return !state.ignoreOptions && HELP_REGEX.test(segment); + }, + isUnsupportedOption: (state, segment, names) => { + return !state.ignoreOptions && segment.startsWith(`-`) && OPTION_REGEX.test(segment) && !names.includes(segment); + }, + isInvalidOption: (state, segment) => { + return !state.ignoreOptions && segment.startsWith(`-`) && !OPTION_REGEX.test(segment); + } +}; +tests.isOption.suggest = (state, name2, hidden = true) => { + return !hidden ? [name2] : null; +}; +var reducers = { + setCandidateState: (state, segment, candidateState) => { + return { ...state, ...candidateState }; + }, + setSelectedIndex: (state, segment, index) => { + return { ...state, selectedIndex: index }; + }, + pushBatch: (state, segment) => { + return { ...state, options: state.options.concat([...segment.slice(1)].map((name2) => ({ name: `-${name2}`, value: true }))) }; + }, + pushBound: (state, segment) => { + const [, name2, value] = segment.match(BINDING_REGEX); + return { ...state, options: state.options.concat({ name: name2, value }) }; + }, + pushPath: (state, segment) => { + return { ...state, path: state.path.concat(segment) }; + }, + pushPositional: (state, segment) => { + return { ...state, positionals: state.positionals.concat({ value: segment, extra: false }) }; + }, + pushExtra: (state, segment) => { + return { ...state, positionals: state.positionals.concat({ value: segment, extra: true }) }; + }, + pushExtraNoLimits: (state, segment) => { + return { ...state, positionals: state.positionals.concat({ value: segment, extra: NoLimits }) }; + }, + pushTrue: (state, segment, name2 = segment) => { + return { ...state, options: state.options.concat({ name: segment, value: true }) }; + }, + pushFalse: (state, segment, name2 = segment) => { + return { ...state, options: state.options.concat({ name: name2, value: false }) }; + }, + pushUndefined: (state, segment) => { + return { ...state, options: state.options.concat({ name: segment, value: void 0 }) }; + }, + pushStringValue: (state, segment) => { + var _a; + const copy = { ...state, options: [...state.options] }; + const lastOption = state.options[state.options.length - 1]; + lastOption.value = ((_a = lastOption.value) !== null && _a !== void 0 ? _a : []).concat([segment]); + return copy; + }, + setStringValue: (state, segment) => { + const copy = { ...state, options: [...state.options] }; + const lastOption = state.options[state.options.length - 1]; + lastOption.value = segment; + return copy; + }, + inhibateOptions: (state) => { + return { ...state, ignoreOptions: true }; + }, + useHelp: (state, segment, command) => { + const [ + , + /* name */ + , + index + ] = segment.match(HELP_REGEX); + if (typeof index !== `undefined`) { + return { ...state, options: [{ name: `-c`, value: String(command) }, { name: `-i`, value: index }] }; + } else { + return { ...state, options: [{ name: `-c`, value: String(command) }] }; + } + }, + setError: (state, segment, errorMessage) => { + if (segment === END_OF_INPUT) { + return { ...state, errorMessage: `${errorMessage}.` }; + } else { + return { ...state, errorMessage: `${errorMessage} ("${segment}").` }; + } + }, + setOptionArityError: (state, segment) => { + const lastOption = state.options[state.options.length - 1]; + return { ...state, errorMessage: `Not enough arguments to option ${lastOption.name}.` }; + } +}; +var NoLimits = Symbol(); +var CommandBuilder = class { + constructor(cliIndex, cliOpts) { + this.allOptionNames = []; + this.arity = { leading: [], trailing: [], extra: [], proxy: false }; + this.options = []; + this.paths = []; + this.cliIndex = cliIndex; + this.cliOpts = cliOpts; + } + addPath(path16) { + this.paths.push(path16); + } + setArity({ leading = this.arity.leading, trailing = this.arity.trailing, extra = this.arity.extra, proxy = this.arity.proxy }) { + Object.assign(this.arity, { leading, trailing, extra, proxy }); + } + addPositional({ name: name2 = `arg`, required = true } = {}) { + if (!required && this.arity.extra === NoLimits) + throw new Error(`Optional parameters cannot be declared when using .rest() or .proxy()`); + if (!required && this.arity.trailing.length > 0) + throw new Error(`Optional parameters cannot be declared after the required trailing positional arguments`); + if (!required && this.arity.extra !== NoLimits) { + this.arity.extra.push(name2); + } else if (this.arity.extra !== NoLimits && this.arity.extra.length === 0) { + this.arity.leading.push(name2); + } else { + this.arity.trailing.push(name2); + } + } + addRest({ name: name2 = `arg`, required = 0 } = {}) { + if (this.arity.extra === NoLimits) + throw new Error(`Infinite lists cannot be declared multiple times in the same command`); + if (this.arity.trailing.length > 0) + throw new Error(`Infinite lists cannot be declared after the required trailing positional arguments`); + for (let t = 0; t < required; ++t) + this.addPositional({ name: name2 }); + this.arity.extra = NoLimits; + } + addProxy({ required = 0 } = {}) { + this.addRest({ required }); + this.arity.proxy = true; + } + addOption({ names, description, arity = 0, hidden = false, required = false, allowBinding = true }) { + if (!allowBinding && arity > 1) + throw new Error(`The arity cannot be higher than 1 when the option only supports the --arg=value syntax`); + if (!Number.isInteger(arity)) + throw new Error(`The arity must be an integer, got ${arity}`); + if (arity < 0) + throw new Error(`The arity must be positive, got ${arity}`); + this.allOptionNames.push(...names); + this.options.push({ names, description, arity, hidden, required, allowBinding }); + } + setContext(context) { + this.context = context; + } + usage({ detailed = true, inlineOptions = true } = {}) { + const segments = [this.cliOpts.binaryName]; + const detailedOptionList = []; + if (this.paths.length > 0) + segments.push(...this.paths[0]); + if (detailed) { + for (const { names, arity, hidden, description, required } of this.options) { + if (hidden) + continue; + const args = []; + for (let t = 0; t < arity; ++t) + args.push(` #${t}`); + const definition = `${names.join(`,`)}${args.join(``)}`; + if (!inlineOptions && description) { + detailedOptionList.push({ definition, description, required }); + } else { + segments.push(required ? `<${definition}>` : `[${definition}]`); + } + } + segments.push(...this.arity.leading.map((name2) => `<${name2}>`)); + if (this.arity.extra === NoLimits) + segments.push(`...`); + else + segments.push(...this.arity.extra.map((name2) => `[${name2}]`)); + segments.push(...this.arity.trailing.map((name2) => `<${name2}>`)); + } + const usage = segments.join(` `); + return { usage, options: detailedOptionList }; + } + compile() { + if (typeof this.context === `undefined`) + throw new Error(`Assertion failed: No context attached`); + const machine = makeStateMachine(); + let firstNode = NODE_INITIAL; + const candidateUsage = this.usage().usage; + const requiredOptions = this.options.filter((opt) => opt.required).map((opt) => opt.names); + firstNode = injectNode(machine, makeNode()); + registerStatic(machine, NODE_INITIAL, START_OF_INPUT, firstNode, [`setCandidateState`, { candidateUsage, requiredOptions }]); + const positionalArgument = this.arity.proxy ? `always` : `isNotOptionLike`; + const paths = this.paths.length > 0 ? this.paths : [[]]; + for (const path16 of paths) { + let lastPathNode = firstNode; + if (path16.length > 0) { + const optionPathNode = injectNode(machine, makeNode()); + registerShortcut(machine, lastPathNode, optionPathNode); + this.registerOptions(machine, optionPathNode); + lastPathNode = optionPathNode; + } + for (let t = 0; t < path16.length; ++t) { + const nextPathNode = injectNode(machine, makeNode()); + registerStatic(machine, lastPathNode, path16[t], nextPathNode, `pushPath`); + lastPathNode = nextPathNode; + } + if (this.arity.leading.length > 0 || !this.arity.proxy) { + const helpNode = injectNode(machine, makeNode()); + registerDynamic(machine, lastPathNode, `isHelp`, helpNode, [`useHelp`, this.cliIndex]); + registerDynamic(machine, helpNode, `always`, helpNode, `pushExtra`); + registerStatic(machine, helpNode, END_OF_INPUT, NODE_SUCCESS, [`setSelectedIndex`, HELP_COMMAND_INDEX]); + this.registerOptions(machine, lastPathNode); + } + if (this.arity.leading.length > 0) + registerStatic(machine, lastPathNode, END_OF_INPUT, NODE_ERRORED, [`setError`, `Not enough positional arguments`]); + let lastLeadingNode = lastPathNode; + for (let t = 0; t < this.arity.leading.length; ++t) { + const nextLeadingNode = injectNode(machine, makeNode()); + if (!this.arity.proxy || t + 1 !== this.arity.leading.length) + this.registerOptions(machine, nextLeadingNode); + if (this.arity.trailing.length > 0 || t + 1 !== this.arity.leading.length) + registerStatic(machine, nextLeadingNode, END_OF_INPUT, NODE_ERRORED, [`setError`, `Not enough positional arguments`]); + registerDynamic(machine, lastLeadingNode, `isNotOptionLike`, nextLeadingNode, `pushPositional`); + lastLeadingNode = nextLeadingNode; + } + let lastExtraNode = lastLeadingNode; + if (this.arity.extra === NoLimits || this.arity.extra.length > 0) { + const extraShortcutNode = injectNode(machine, makeNode()); + registerShortcut(machine, lastLeadingNode, extraShortcutNode); + if (this.arity.extra === NoLimits) { + const extraNode = injectNode(machine, makeNode()); + if (!this.arity.proxy) + this.registerOptions(machine, extraNode); + registerDynamic(machine, lastLeadingNode, positionalArgument, extraNode, `pushExtraNoLimits`); + registerDynamic(machine, extraNode, positionalArgument, extraNode, `pushExtraNoLimits`); + registerShortcut(machine, extraNode, extraShortcutNode); + } else { + for (let t = 0; t < this.arity.extra.length; ++t) { + const nextExtraNode = injectNode(machine, makeNode()); + if (!this.arity.proxy || t > 0) + this.registerOptions(machine, nextExtraNode); + registerDynamic(machine, lastExtraNode, positionalArgument, nextExtraNode, `pushExtra`); + registerShortcut(machine, nextExtraNode, extraShortcutNode); + lastExtraNode = nextExtraNode; + } + } + lastExtraNode = extraShortcutNode; + } + if (this.arity.trailing.length > 0) + registerStatic(machine, lastExtraNode, END_OF_INPUT, NODE_ERRORED, [`setError`, `Not enough positional arguments`]); + let lastTrailingNode = lastExtraNode; + for (let t = 0; t < this.arity.trailing.length; ++t) { + const nextTrailingNode = injectNode(machine, makeNode()); + if (!this.arity.proxy) + this.registerOptions(machine, nextTrailingNode); + if (t + 1 < this.arity.trailing.length) + registerStatic(machine, nextTrailingNode, END_OF_INPUT, NODE_ERRORED, [`setError`, `Not enough positional arguments`]); + registerDynamic(machine, lastTrailingNode, `isNotOptionLike`, nextTrailingNode, `pushPositional`); + lastTrailingNode = nextTrailingNode; + } + registerDynamic(machine, lastTrailingNode, positionalArgument, NODE_ERRORED, [`setError`, `Extraneous positional argument`]); + registerStatic(machine, lastTrailingNode, END_OF_INPUT, NODE_SUCCESS, [`setSelectedIndex`, this.cliIndex]); + } + return { + machine, + context: this.context + }; + } + registerOptions(machine, node) { + registerDynamic(machine, node, [`isOption`, `--`], node, `inhibateOptions`); + registerDynamic(machine, node, [`isBatchOption`, this.allOptionNames], node, `pushBatch`); + registerDynamic(machine, node, [`isBoundOption`, this.allOptionNames, this.options], node, `pushBound`); + registerDynamic(machine, node, [`isUnsupportedOption`, this.allOptionNames], NODE_ERRORED, [`setError`, `Unsupported option name`]); + registerDynamic(machine, node, [`isInvalidOption`], NODE_ERRORED, [`setError`, `Invalid option name`]); + for (const option of this.options) { + const longestName = option.names.reduce((longestName2, name2) => { + return name2.length > longestName2.length ? name2 : longestName2; + }, ``); + if (option.arity === 0) { + for (const name2 of option.names) { + registerDynamic(machine, node, [`isOption`, name2, option.hidden || name2 !== longestName], node, `pushTrue`); + if (name2.startsWith(`--`) && !name2.startsWith(`--no-`)) { + registerDynamic(machine, node, [`isNegatedOption`, name2], node, [`pushFalse`, name2]); + } + } + } else { + let lastNode = injectNode(machine, makeNode()); + for (const name2 of option.names) + registerDynamic(machine, node, [`isOption`, name2, option.hidden || name2 !== longestName], lastNode, `pushUndefined`); + for (let t = 0; t < option.arity; ++t) { + const nextNode = injectNode(machine, makeNode()); + registerStatic(machine, lastNode, END_OF_INPUT, NODE_ERRORED, `setOptionArityError`); + registerDynamic(machine, lastNode, `isOptionLike`, NODE_ERRORED, `setOptionArityError`); + const action = option.arity === 1 ? `setStringValue` : `pushStringValue`; + registerDynamic(machine, lastNode, `isNotOptionLike`, nextNode, action); + lastNode = nextNode; + } + registerShortcut(machine, lastNode, node); + } + } + } +}; +var CliBuilder = class _CliBuilder { + constructor({ binaryName = `...` } = {}) { + this.builders = []; + this.opts = { binaryName }; + } + static build(cbs, opts = {}) { + return new _CliBuilder(opts).commands(cbs).compile(); + } + getBuilderByIndex(n) { + if (!(n >= 0 && n < this.builders.length)) + throw new Error(`Assertion failed: Out-of-bound command index (${n})`); + return this.builders[n]; + } + commands(cbs) { + for (const cb of cbs) + cb(this.command()); + return this; + } + command() { + const builder = new CommandBuilder(this.builders.length, this.opts); + this.builders.push(builder); + return builder; + } + compile() { + const machines = []; + const contexts = []; + for (const builder of this.builders) { + const { machine: machine2, context } = builder.compile(); + machines.push(machine2); + contexts.push(context); + } + const machine = makeAnyOfMachine(machines); + simplifyMachine(machine); + return { + machine, + contexts, + process: (input) => { + return runMachine(machine, input); + }, + suggest: (input, partial) => { + return suggestMachine(machine, input, partial); + } + }; + } +}; + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/Cli.mjs +var import_platform = __toESM(require_node(), 1); + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/HelpCommand.mjs +var HelpCommand = class _HelpCommand extends Command { + constructor(contexts) { + super(); + this.contexts = contexts; + this.commands = []; + } + static from(state, contexts) { + const command = new _HelpCommand(contexts); + command.path = state.path; + for (const opt of state.options) { + switch (opt.name) { + case `-c`: + { + command.commands.push(Number(opt.value)); + } + break; + case `-i`: + { + command.index = Number(opt.value); + } + break; + } + } + return command; + } + async execute() { + let commands = this.commands; + if (typeof this.index !== `undefined` && this.index >= 0 && this.index < commands.length) + commands = [commands[this.index]]; + if (commands.length === 0) { + this.context.stdout.write(this.cli.usage()); + } else if (commands.length === 1) { + this.context.stdout.write(this.cli.usage(this.contexts[commands[0]].commandClass, { detailed: true })); + } else if (commands.length > 1) { + this.context.stdout.write(`Multiple commands match your selection: +`); + this.context.stdout.write(` +`); + let index = 0; + for (const command of this.commands) + this.context.stdout.write(this.cli.usage(this.contexts[command].commandClass, { prefix: `${index++}. `.padStart(5) })); + this.context.stdout.write(` +`); + this.context.stdout.write(`Run again with -h= to see the longer details of any of those commands. +`); + } + } +}; + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/Cli.mjs +var errorCommandSymbol = Symbol(`clipanion/errorCommand`); +var Cli = class _Cli { + constructor({ binaryLabel, binaryName: binaryNameOpt = `...`, binaryVersion, enableCapture = false, enableColors } = {}) { + this.registrations = /* @__PURE__ */ new Map(); + this.builder = new CliBuilder({ binaryName: binaryNameOpt }); + this.binaryLabel = binaryLabel; + this.binaryName = binaryNameOpt; + this.binaryVersion = binaryVersion; + this.enableCapture = enableCapture; + this.enableColors = enableColors; + } + /** + * Creates a new Cli and registers all commands passed as parameters. + * + * @param commandClasses The Commands to register + * @returns The created `Cli` instance + */ + static from(commandClasses, options = {}) { + const cli = new _Cli(options); + const resolvedCommandClasses = Array.isArray(commandClasses) ? commandClasses : [commandClasses]; + for (const commandClass of resolvedCommandClasses) + cli.register(commandClass); + return cli; + } + /** + * Registers a command inside the CLI. + */ + register(commandClass) { + var _a; + const specs = /* @__PURE__ */ new Map(); + const command = new commandClass(); + for (const key in command) { + const value = command[key]; + if (typeof value === `object` && value !== null && value[Command.isOption]) { + specs.set(key, value); + } + } + const builder = this.builder.command(); + const index = builder.cliIndex; + const paths = (_a = commandClass.paths) !== null && _a !== void 0 ? _a : command.paths; + if (typeof paths !== `undefined`) + for (const path16 of paths) + builder.addPath(path16); + this.registrations.set(commandClass, { specs, builder, index }); + for (const [key, { definition }] of specs.entries()) + definition(builder, key); + builder.setContext({ + commandClass + }); + } + process(input, userContext) { + const { contexts, process: process5 } = this.builder.compile(); + const state = process5(input); + const context = { + ..._Cli.defaultContext, + ...userContext + }; + switch (state.selectedIndex) { + case HELP_COMMAND_INDEX: { + const command = HelpCommand.from(state, contexts); + command.context = context; + return command; + } + default: + { + const { commandClass } = contexts[state.selectedIndex]; + const record = this.registrations.get(commandClass); + if (typeof record === `undefined`) + throw new Error(`Assertion failed: Expected the command class to have been registered.`); + const command = new commandClass(); + command.context = context; + command.path = state.path; + try { + for (const [key, { transformer }] of record.specs.entries()) + command[key] = transformer(record.builder, key, state, context); + return command; + } catch (error) { + error[errorCommandSymbol] = command; + throw error; + } + } + break; + } + } + async run(input, userContext) { + var _a, _b; + let command; + const context = { + ..._Cli.defaultContext, + ...userContext + }; + const colored = (_a = this.enableColors) !== null && _a !== void 0 ? _a : context.colorDepth > 1; + if (!Array.isArray(input)) { + command = input; + } else { + try { + command = this.process(input, context); + } catch (error) { + context.stdout.write(this.error(error, { colored })); + return 1; + } + } + if (command.help) { + context.stdout.write(this.usage(command, { colored, detailed: true })); + return 0; + } + command.context = context; + command.cli = { + binaryLabel: this.binaryLabel, + binaryName: this.binaryName, + binaryVersion: this.binaryVersion, + enableCapture: this.enableCapture, + enableColors: this.enableColors, + definitions: () => this.definitions(), + error: (error, opts) => this.error(error, opts), + format: (colored2) => this.format(colored2), + process: (input2, subContext) => this.process(input2, { ...context, ...subContext }), + run: (input2, subContext) => this.run(input2, { ...context, ...subContext }), + usage: (command2, opts) => this.usage(command2, opts) + }; + const activate = this.enableCapture ? (_b = (0, import_platform.getCaptureActivator)(context)) !== null && _b !== void 0 ? _b : noopCaptureActivator : noopCaptureActivator; + let exitCode; + try { + exitCode = await activate(() => command.validateAndExecute().catch((error) => command.catch(error).then(() => 0))); + } catch (error) { + context.stdout.write(this.error(error, { colored, command })); + return 1; + } + return exitCode; + } + async runExit(input, context) { + process.exitCode = await this.run(input, context); + } + suggest(input, partial) { + const { suggest: suggest2 } = this.builder.compile(); + return suggest2(input, partial); + } + definitions({ colored = false } = {}) { + const data = []; + for (const [commandClass, { index }] of this.registrations) { + if (typeof commandClass.usage === `undefined`) + continue; + const { usage: path16 } = this.getUsageByIndex(index, { detailed: false }); + const { usage, options } = this.getUsageByIndex(index, { detailed: true, inlineOptions: false }); + const category = typeof commandClass.usage.category !== `undefined` ? formatMarkdownish(commandClass.usage.category, { format: this.format(colored), paragraphs: false }) : void 0; + const description = typeof commandClass.usage.description !== `undefined` ? formatMarkdownish(commandClass.usage.description, { format: this.format(colored), paragraphs: false }) : void 0; + const details = typeof commandClass.usage.details !== `undefined` ? formatMarkdownish(commandClass.usage.details, { format: this.format(colored), paragraphs: true }) : void 0; + const examples = typeof commandClass.usage.examples !== `undefined` ? commandClass.usage.examples.map(([label, cli]) => [formatMarkdownish(label, { format: this.format(colored), paragraphs: false }), cli.replace(/\$0/g, this.binaryName)]) : void 0; + data.push({ path: path16, usage, category, description, details, examples, options }); + } + return data; + } + usage(command = null, { colored, detailed = false, prefix = `$ ` } = {}) { + var _a; + if (command === null) { + for (const commandClass2 of this.registrations.keys()) { + const paths = commandClass2.paths; + const isDocumented = typeof commandClass2.usage !== `undefined`; + const isExclusivelyDefault = !paths || paths.length === 0 || paths.length === 1 && paths[0].length === 0; + const isDefault = isExclusivelyDefault || ((_a = paths === null || paths === void 0 ? void 0 : paths.some((path16) => path16.length === 0)) !== null && _a !== void 0 ? _a : false); + if (isDefault) { + if (command) { + command = null; + break; + } else { + command = commandClass2; + } + } else { + if (isDocumented) { + command = null; + continue; + } + } + } + if (command) { + detailed = true; + } + } + const commandClass = command !== null && command instanceof Command ? command.constructor : command; + let result = ``; + if (!commandClass) { + const commandsByCategories = /* @__PURE__ */ new Map(); + for (const [commandClass2, { index }] of this.registrations.entries()) { + if (typeof commandClass2.usage === `undefined`) + continue; + const category = typeof commandClass2.usage.category !== `undefined` ? formatMarkdownish(commandClass2.usage.category, { format: this.format(colored), paragraphs: false }) : null; + let categoryCommands = commandsByCategories.get(category); + if (typeof categoryCommands === `undefined`) + commandsByCategories.set(category, categoryCommands = []); + const { usage } = this.getUsageByIndex(index); + categoryCommands.push({ commandClass: commandClass2, usage }); + } + const categoryNames = Array.from(commandsByCategories.keys()).sort((a, b) => { + if (a === null) + return -1; + if (b === null) + return 1; + return a.localeCompare(b, `en`, { usage: `sort`, caseFirst: `upper` }); + }); + const hasLabel = typeof this.binaryLabel !== `undefined`; + const hasVersion = typeof this.binaryVersion !== `undefined`; + if (hasLabel || hasVersion) { + if (hasLabel && hasVersion) + result += `${this.format(colored).header(`${this.binaryLabel} - ${this.binaryVersion}`)} + +`; + else if (hasLabel) + result += `${this.format(colored).header(`${this.binaryLabel}`)} +`; + else + result += `${this.format(colored).header(`${this.binaryVersion}`)} +`; + result += ` ${this.format(colored).bold(prefix)}${this.binaryName} +`; + } else { + result += `${this.format(colored).bold(prefix)}${this.binaryName} +`; + } + for (const categoryName of categoryNames) { + const commands = commandsByCategories.get(categoryName).slice().sort((a, b) => { + return a.usage.localeCompare(b.usage, `en`, { usage: `sort`, caseFirst: `upper` }); + }); + const header = categoryName !== null ? categoryName.trim() : `General commands`; + result += ` +`; + result += `${this.format(colored).header(`${header}`)} +`; + for (const { commandClass: commandClass2, usage } of commands) { + const doc = commandClass2.usage.description || `undocumented`; + result += ` +`; + result += ` ${this.format(colored).bold(usage)} +`; + result += ` ${formatMarkdownish(doc, { format: this.format(colored), paragraphs: false })}`; + } + } + result += ` +`; + result += formatMarkdownish(`You can also print more details about any of these commands by calling them with the \`-h,--help\` flag right after the command name.`, { format: this.format(colored), paragraphs: true }); + } else { + if (!detailed) { + const { usage } = this.getUsageByRegistration(commandClass); + result += `${this.format(colored).bold(prefix)}${usage} +`; + } else { + const { description = ``, details = ``, examples = [] } = commandClass.usage || {}; + if (description !== ``) { + result += formatMarkdownish(description, { format: this.format(colored), paragraphs: false }).replace(/^./, ($0) => $0.toUpperCase()); + result += ` +`; + } + if (details !== `` || examples.length > 0) { + result += `${this.format(colored).header(`Usage`)} +`; + result += ` +`; + } + const { usage, options } = this.getUsageByRegistration(commandClass, { inlineOptions: false }); + result += `${this.format(colored).bold(prefix)}${usage} +`; + if (options.length > 0) { + result += ` +`; + result += `${this.format(colored).header(`Options`)} +`; + const maxDefinitionLength = options.reduce((length, option) => { + return Math.max(length, option.definition.length); + }, 0); + result += ` +`; + for (const { definition, description: description2 } of options) { + result += ` ${this.format(colored).bold(definition.padEnd(maxDefinitionLength))} ${formatMarkdownish(description2, { format: this.format(colored), paragraphs: false })}`; + } + } + if (details !== ``) { + result += ` +`; + result += `${this.format(colored).header(`Details`)} +`; + result += ` +`; + result += formatMarkdownish(details, { format: this.format(colored), paragraphs: true }); + } + if (examples.length > 0) { + result += ` +`; + result += `${this.format(colored).header(`Examples`)} +`; + for (const [description2, example] of examples) { + result += ` +`; + result += formatMarkdownish(description2, { format: this.format(colored), paragraphs: false }); + result += `${example.replace(/^/m, ` ${this.format(colored).bold(prefix)}`).replace(/\$0/g, this.binaryName)} +`; + } + } + } + } + return result; + } + error(error, _a) { + var _b; + var { colored, command = (_b = error[errorCommandSymbol]) !== null && _b !== void 0 ? _b : null } = _a === void 0 ? {} : _a; + if (!error || typeof error !== `object` || !(`stack` in error)) + error = new Error(`Execution failed with a non-error rejection (rejected value: ${JSON.stringify(error)})`); + let result = ``; + let name2 = error.name.replace(/([a-z])([A-Z])/g, `$1 $2`); + if (name2 === `Error`) + name2 = `Internal Error`; + result += `${this.format(colored).error(name2)}: ${error.message} +`; + const meta = error.clipanion; + if (typeof meta !== `undefined`) { + if (meta.type === `usage`) { + result += ` +`; + result += this.usage(command); + } + } else { + if (error.stack) { + result += `${error.stack.replace(/^.*\n/, ``)} +`; + } + } + return result; + } + format(colored) { + var _a; + return ((_a = colored !== null && colored !== void 0 ? colored : this.enableColors) !== null && _a !== void 0 ? _a : _Cli.defaultContext.colorDepth > 1) ? richFormat : textFormat; + } + getUsageByRegistration(klass, opts) { + const record = this.registrations.get(klass); + if (typeof record === `undefined`) + throw new Error(`Assertion failed: Unregistered command`); + return this.getUsageByIndex(record.index, opts); + } + getUsageByIndex(n, opts) { + return this.builder.getBuilderByIndex(n).usage(opts); + } +}; +Cli.defaultContext = { + env: process.env, + stdin: process.stdin, + stdout: process.stdout, + stderr: process.stderr, + colorDepth: (0, import_platform.getDefaultColorDepth)() +}; +function noopCaptureActivator(fn2) { + return fn2(); +} + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/builtins/index.mjs +var builtins_exports = {}; +__export(builtins_exports, { + DefinitionsCommand: () => DefinitionsCommand, + HelpCommand: () => HelpCommand2, + VersionCommand: () => VersionCommand +}); + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/builtins/definitions.mjs +var DefinitionsCommand = class extends Command { + async execute() { + this.context.stdout.write(`${JSON.stringify(this.cli.definitions(), null, 2)} +`); + } +}; +DefinitionsCommand.paths = [[`--clipanion=definitions`]]; + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/builtins/help.mjs +var HelpCommand2 = class extends Command { + async execute() { + this.context.stdout.write(this.cli.usage()); + } +}; +HelpCommand2.paths = [[`-h`], [`--help`]]; + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/builtins/version.mjs +var VersionCommand = class extends Command { + async execute() { + var _a; + this.context.stdout.write(`${(_a = this.cli.binaryVersion) !== null && _a !== void 0 ? _a : ``} +`); + } +}; +VersionCommand.paths = [[`-v`], [`--version`]]; + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/options/index.mjs +var options_exports = {}; +__export(options_exports, { + Array: () => Array2, + Boolean: () => Boolean2, + Counter: () => Counter, + Proxy: () => Proxy2, + Rest: () => Rest, + String: () => String2, + applyValidator: () => applyValidator, + cleanValidationError: () => cleanValidationError, + formatError: () => formatError, + isOptionSymbol: () => isOptionSymbol, + makeCommandOption: () => makeCommandOption, + rerouteArguments: () => rerouteArguments +}); + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/options/Array.mjs +function Array2(descriptor, initialValueBase, optsBase) { + const [initialValue, opts] = rerouteArguments(initialValueBase, optsBase !== null && optsBase !== void 0 ? optsBase : {}); + const { arity = 1 } = opts; + const optNames = descriptor.split(`,`); + const nameSet = new Set(optNames); + return makeCommandOption({ + definition(builder) { + builder.addOption({ + names: optNames, + arity, + hidden: opts === null || opts === void 0 ? void 0 : opts.hidden, + description: opts === null || opts === void 0 ? void 0 : opts.description, + required: opts.required + }); + }, + transformer(builder, key, state) { + let usedName; + let currentValue = typeof initialValue !== `undefined` ? [...initialValue] : void 0; + for (const { name: name2, value } of state.options) { + if (!nameSet.has(name2)) + continue; + usedName = name2; + currentValue = currentValue !== null && currentValue !== void 0 ? currentValue : []; + currentValue.push(value); + } + if (typeof currentValue !== `undefined`) { + return applyValidator(usedName !== null && usedName !== void 0 ? usedName : key, currentValue, opts.validator); + } else { + return currentValue; + } + } + }); +} + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/options/Boolean.mjs +function Boolean2(descriptor, initialValueBase, optsBase) { + const [initialValue, opts] = rerouteArguments(initialValueBase, optsBase !== null && optsBase !== void 0 ? optsBase : {}); + const optNames = descriptor.split(`,`); + const nameSet = new Set(optNames); + return makeCommandOption({ + definition(builder) { + builder.addOption({ + names: optNames, + allowBinding: false, + arity: 0, + hidden: opts.hidden, + description: opts.description, + required: opts.required + }); + }, + transformer(builer, key, state) { + let currentValue = initialValue; + for (const { name: name2, value } of state.options) { + if (!nameSet.has(name2)) + continue; + currentValue = value; + } + return currentValue; + } + }); +} + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/options/Counter.mjs +function Counter(descriptor, initialValueBase, optsBase) { + const [initialValue, opts] = rerouteArguments(initialValueBase, optsBase !== null && optsBase !== void 0 ? optsBase : {}); + const optNames = descriptor.split(`,`); + const nameSet = new Set(optNames); + return makeCommandOption({ + definition(builder) { + builder.addOption({ + names: optNames, + allowBinding: false, + arity: 0, + hidden: opts.hidden, + description: opts.description, + required: opts.required + }); + }, + transformer(builder, key, state) { + let currentValue = initialValue; + for (const { name: name2, value } of state.options) { + if (!nameSet.has(name2)) + continue; + currentValue !== null && currentValue !== void 0 ? currentValue : currentValue = 0; + if (!value) { + currentValue = 0; + } else { + currentValue += 1; + } + } + return currentValue; + } + }); +} + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/options/Proxy.mjs +function Proxy2(opts = {}) { + return makeCommandOption({ + definition(builder, key) { + var _a; + builder.addProxy({ + name: (_a = opts.name) !== null && _a !== void 0 ? _a : key, + required: opts.required + }); + }, + transformer(builder, key, state) { + return state.positionals.map(({ value }) => value); + } + }); +} + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/options/Rest.mjs +function Rest(opts = {}) { + return makeCommandOption({ + definition(builder, key) { + var _a; + builder.addRest({ + name: (_a = opts.name) !== null && _a !== void 0 ? _a : key, + required: opts.required + }); + }, + transformer(builder, key, state) { + const isRestPositional = (index) => { + const positional = state.positionals[index]; + if (positional.extra === NoLimits) + return true; + if (positional.extra === false && index < builder.arity.leading.length) + return true; + return false; + }; + let count = 0; + while (count < state.positionals.length && isRestPositional(count)) + count += 1; + return state.positionals.splice(0, count).map(({ value }) => value); + } + }); +} + +// .yarn/__virtual__/clipanion-virtual-dbbb3cfe27/0/cache/clipanion-patch-1b1b878e9f-a833a30963.zip/node_modules/clipanion/lib/advanced/options/String.mjs +function StringOption(descriptor, initialValueBase, optsBase) { + const [initialValue, opts] = rerouteArguments(initialValueBase, optsBase !== null && optsBase !== void 0 ? optsBase : {}); + const { arity = 1 } = opts; + const optNames = descriptor.split(`,`); + const nameSet = new Set(optNames); + return makeCommandOption({ + definition(builder) { + builder.addOption({ + names: optNames, + arity: opts.tolerateBoolean ? 0 : arity, + hidden: opts.hidden, + description: opts.description, + required: opts.required + }); + }, + transformer(builder, key, state, context) { + let usedName; + let currentValue = initialValue; + if (typeof opts.env !== `undefined` && context.env[opts.env]) { + usedName = opts.env; + currentValue = context.env[opts.env]; + } + for (const { name: name2, value } of state.options) { + if (!nameSet.has(name2)) + continue; + usedName = name2; + currentValue = value; + } + if (typeof currentValue === `string`) { + return applyValidator(usedName !== null && usedName !== void 0 ? usedName : key, currentValue, opts.validator); + } else { + return currentValue; + } + } + }); +} +function StringPositional(opts = {}) { + const { required = true } = opts; + return makeCommandOption({ + definition(builder, key) { + var _a; + builder.addPositional({ + name: (_a = opts.name) !== null && _a !== void 0 ? _a : key, + required: opts.required + }); + }, + transformer(builder, key, state) { + var _a; + for (let i = 0; i < state.positionals.length; ++i) { + if (state.positionals[i].extra === NoLimits) + continue; + if (required && state.positionals[i].extra === true) + continue; + if (!required && state.positionals[i].extra === false) + continue; + const [positional] = state.positionals.splice(i, 1); + return applyValidator((_a = opts.name) !== null && _a !== void 0 ? _a : key, positional.value, opts.validator); + } + return void 0; + } + }); +} +function String2(descriptor, ...args) { + if (typeof descriptor === `string`) { + return StringOption(descriptor, ...args); + } else { + return StringPositional(descriptor); + } +} + +// package.json +var version = "0.34.6"; + +// sources/Engine.ts +var import_fs6 = __toESM(require("fs")); +var import_path5 = __toESM(require("path")); +var import_process3 = __toESM(require("process")); +var import_rcompare = __toESM(require_rcompare()); +var import_valid3 = __toESM(require_valid()); +var import_valid4 = __toESM(require_valid2()); + +// config.json +var config_default = { + definitions: { + npm: { + default: "11.8.0+sha1.d1bc924deb3b4d412055b1755098a70bf8a4713b", + fetchLatestFrom: { + type: "npm", + package: "npm" + }, + transparent: { + commands: [ + [ + "npm", + "init" + ], + [ + "npx" + ] + ] + }, + ranges: { + "*": { + url: "https://registry.npmjs.org/npm/-/npm-{}.tgz", + bin: { + npm: "./bin/npm-cli.js", + npx: "./bin/npx-cli.js" + }, + registry: { + type: "npm", + package: "npm" + }, + commands: { + use: [ + "npm", + "install" + ] + } + } + } + }, + pnpm: { + default: "10.28.1+sha1.20817ab95fb7f61154ba5ff3bcb61f27defb6142", + fetchLatestFrom: { + type: "npm", + package: "pnpm" + }, + transparent: { + commands: [ + [ + "pnpm", + "init" + ], + [ + "pnpx" + ], + [ + "pnpm", + "dlx" + ] + ] + }, + ranges: { + "<6.0.0": { + url: "https://registry.npmjs.org/pnpm/-/pnpm-{}.tgz", + bin: { + pnpm: "./bin/pnpm.js", + pnpx: "./bin/pnpx.js" + }, + registry: { + type: "npm", + package: "pnpm" + }, + commands: { + use: [ + "pnpm", + "install" + ] + } + }, + "6.x || 7.x || 8.x || 9.x || 10.x": { + url: "https://registry.npmjs.org/pnpm/-/pnpm-{}.tgz", + bin: { + pnpm: "./bin/pnpm.cjs", + pnpx: "./bin/pnpx.cjs" + }, + registry: { + type: "npm", + package: "pnpm" + }, + commands: { + use: [ + "pnpm", + "install" + ] + } + }, + ">=11.0.0": { + url: "https://registry.npmjs.org/pnpm/-/pnpm-{}.tgz", + bin: { + pnpm: "./bin/pnpm.mjs", + pnpx: "./bin/pnpx.mjs" + }, + registry: { + type: "npm", + package: "pnpm" + }, + commands: { + use: [ + "pnpm", + "install" + ] + } + } + } + }, + yarn: { + default: "1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610", + fetchLatestFrom: { + type: "npm", + package: "yarn" + }, + transparent: { + default: "4.12.0+sha224.877304a94a6946ab1d58a358df5ff8af2f7c9d86ea506f05f5c9df05", + commands: [ + [ + "yarn", + "init" + ], + [ + "yarn", + "dlx" + ] + ] + }, + ranges: { + "<2.0.0": { + url: "https://registry.yarnpkg.com/yarn/-/yarn-{}.tgz", + bin: { + yarn: "./bin/yarn.js", + yarnpkg: "./bin/yarn.js" + }, + registry: { + type: "npm", + package: "yarn" + }, + commands: { + use: [ + "yarn", + "install" + ] + } + }, + ">=2.0.0": { + name: "yarn", + url: "https://repo.yarnpkg.com/{}/packages/yarnpkg-cli/bin/yarn.js", + bin: [ + "yarn", + "yarnpkg" + ], + registry: { + type: "url", + url: "https://repo.yarnpkg.com/tags", + fields: { + tags: "aliases", + versions: "tags" + } + }, + npmRegistry: { + type: "npm", + package: "@yarnpkg/cli-dist", + bin: "bin/yarn.js" + }, + commands: { + use: [ + "yarn", + "install" + ] + } + } + } + } + }, + keys: { + npm: [ + { + expires: "2025-01-29T00:00:00.000Z", + keyid: "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA", + keytype: "ecdsa-sha2-nistp256", + scheme: "ecdsa-sha2-nistp256", + key: "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg==" + }, + { + expires: null, + keyid: "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U", + keytype: "ecdsa-sha2-nistp256", + scheme: "ecdsa-sha2-nistp256", + key: "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEY6Ya7W++7aUPzvMTrezH6Ycx3c+HOKYCcNGybJZSCJq/fd7Qa8uuAKtdIkUQtQiEKERhAmE5lMMJhP8OkDOa2g==" + } + ] + } +}; + +// sources/corepackUtils.ts +var import_crypto2 = require("crypto"); +var import_events4 = require("events"); +var import_fs4 = __toESM(require("fs")); +var import_module = __toESM(require("module")); +var import_path3 = __toESM(require("path")); +var import_range = __toESM(require_range()); +var import_semver = __toESM(require_semver()); +var import_lt = __toESM(require_lt()); +var import_parse3 = __toESM(require_parse()); +var import_promises2 = require("timers/promises"); + +// sources/debugUtils.ts +var import_debug = __toESM(require_src()); +var log = (0, import_debug.default)(`corepack`); + +// sources/folderUtils.ts +var import_fs = require("fs"); +var import_os = require("os"); +var import_path = require("path"); +var import_process = __toESM(require("process")); +var INSTALL_FOLDER_VERSION = 1; +function getCorepackHomeFolder() { + return import_process.default.env.COREPACK_HOME ?? (0, import_path.join)( + import_process.default.env.XDG_CACHE_HOME ?? import_process.default.env.LOCALAPPDATA ?? (0, import_path.join)((0, import_os.homedir)(), import_process.default.platform === `win32` ? `AppData/Local` : `.cache`), + `node/corepack` + ); +} +function getInstallFolder() { + return (0, import_path.join)( + getCorepackHomeFolder(), + `v${INSTALL_FOLDER_VERSION}` + ); +} +function getTemporaryFolder(target = (0, import_os.tmpdir)()) { + (0, import_fs.mkdirSync)(target, { recursive: true }); + while (true) { + const rnd = Math.random() * 4294967296; + const hex = rnd.toString(16).padStart(8, `0`); + const path16 = (0, import_path.join)(target, `corepack-${import_process.default.pid}-${hex}`); + try { + (0, import_fs.mkdirSync)(path16); + return path16; + } catch (error) { + if (error.code === `EEXIST`) { + continue; + } else if (error.code === `EACCES`) { + throw new UsageError(`Failed to create cache directory. Please ensure the user has write access to the target directory (${target}). If the user's home directory does not exist, create it first.`); + } else { + throw error; + } + } + } +} + +// sources/httpUtils.ts +var import_assert = __toESM(require("assert")); +var import_events = require("events"); +var import_process2 = require("process"); +var import_stream = require("stream"); + +// sources/npmRegistryUtils.ts +var import_crypto = require("crypto"); +var DEFAULT_HEADERS = { + [`Accept`]: `application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8` +}; +var DEFAULT_NPM_REGISTRY_URL = `https://registry.npmjs.org`; +async function fetchAsJson2(packageName, version2) { + const npmRegistryUrl = process.env.COREPACK_NPM_REGISTRY || DEFAULT_NPM_REGISTRY_URL; + if (process.env.COREPACK_ENABLE_NETWORK === `0`) + throw new UsageError(`Network access disabled by the environment; can't reach npm repository ${npmRegistryUrl}`); + const headers = { ...DEFAULT_HEADERS }; + if (`COREPACK_NPM_TOKEN` in process.env) { + headers.authorization = `Bearer ${process.env.COREPACK_NPM_TOKEN}`; + } else if (`COREPACK_NPM_USERNAME` in process.env && `COREPACK_NPM_PASSWORD` in process.env) { + const encodedCreds = Buffer.from(`${process.env.COREPACK_NPM_USERNAME}:${process.env.COREPACK_NPM_PASSWORD}`, `utf8`).toString(`base64`); + headers.authorization = `Basic ${encodedCreds}`; + } + return fetchAsJson(`${npmRegistryUrl}/${packageName}${version2 ? `/${version2}` : ``}`, { headers }); +} +function verifySignature({ signatures, integrity, packageName, version: version2 }) { + if (!Array.isArray(signatures) || !signatures.length) throw new Error(`No compatible signature found in package metadata`); + const { npm: trustedKeys } = process.env.COREPACK_INTEGRITY_KEYS ? JSON.parse(process.env.COREPACK_INTEGRITY_KEYS) : config_default.keys; + let signature; + let key; + for (const k of trustedKeys) { + signature = signatures.find(({ keyid }) => keyid === k.keyid); + if (signature != null) { + key = k.key; + break; + } + } + if (signature?.sig == null) throw new UsageError(`The package was not signed by any trusted keys: ${JSON.stringify({ signatures, trustedKeys }, void 0, 2)}`); + const verifier = (0, import_crypto.createVerify)(`SHA256`); + verifier.end(`${packageName}@${version2}:${integrity}`); + const valid = verifier.verify( + `-----BEGIN PUBLIC KEY----- +${key} +-----END PUBLIC KEY-----`, + signature.sig, + `base64` + ); + if (!valid) { + throw new Error(`Signature does not match`); + } +} +async function fetchLatestStableVersion(packageName) { + const metadata = await fetchAsJson2(packageName, `latest`); + const { version: version2, dist: { integrity, signatures, shasum } } = metadata; + if (!shouldSkipIntegrityCheck()) { + try { + verifySignature({ + packageName, + version: version2, + integrity, + signatures + }); + } catch (cause) { + throw new Error(`Corepack cannot download the latest stable version of ${packageName}; you can disable signature verification by setting COREPACK_INTEGRITY_CHECK to 0 in your env, or instruct Corepack to use the latest stable release known by this version of Corepack by setting COREPACK_USE_LATEST to 0`, { cause }); + } + } + return `${version2}+${integrity ? `sha512.${Buffer.from(integrity.slice(7), `base64`).toString(`hex`)}` : `sha1.${shasum}`}`; +} +async function fetchAvailableTags(packageName) { + const metadata = await fetchAsJson2(packageName); + return metadata[`dist-tags`]; +} +async function fetchAvailableVersions(packageName) { + const metadata = await fetchAsJson2(packageName); + return Object.keys(metadata.versions); +} +async function fetchTarballURLAndSignature(packageName, version2) { + const versionMetadata = await fetchAsJson2(packageName, version2); + const { tarball, signatures, integrity } = versionMetadata.dist; + if (tarball === void 0 || !tarball.startsWith(`http`)) + throw new Error(`${packageName}@${version2} does not have a valid tarball.`); + return { tarball, signatures, integrity }; +} + +// sources/httpUtils.ts +async function fetch(input, init) { + if (process.env.COREPACK_ENABLE_NETWORK === `0`) + throw new UsageError(`Network access disabled by the environment; can't reach ${input}`); + const agent = await getProxyAgent(input); + if (typeof input === `string`) + input = new URL(input); + let headers = init?.headers; + const username = input.username || process.env.COREPACK_NPM_USERNAME; + const password = input.password || process.env.COREPACK_NPM_PASSWORD; + if (username || password) { + headers = { + ...headers, + authorization: `Basic ${Buffer.from(`${username}:${password}`).toString(`base64`)}` + }; + input.username = input.password = ``; + } + const registry = process.env.COREPACK_NPM_TOKEN && new URL(process.env.COREPACK_NPM_REGISTRY || DEFAULT_NPM_REGISTRY_URL); + if (registry && input.origin === registry.origin) { + headers = { + ...headers, + authorization: `Bearer ${process.env.COREPACK_NPM_TOKEN}` + }; + } + let response; + try { + response = await globalThis.fetch(input, { + ...init, + dispatcher: agent, + headers + }); + } catch (error) { + throw new Error( + `Error when performing the request to ${input}; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting`, + { cause: error } + ); + } + if (!response.ok) { + await response.arrayBuffer(); + throw new Error( + `Server answered with HTTP ${response.status} when performing the request to ${input}; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting` + ); + } + return response; +} +async function fetchAsJson(input, init) { + const response = await fetch(input, init); + return response.json(); +} +async function fetchUrlStream(input, init) { + if (process.env.COREPACK_ENABLE_DOWNLOAD_PROMPT === `1`) { + console.error(`! Corepack is about to download ${input}`); + if (import_process2.stdin.isTTY && !process.env.CI) { + import_process2.stderr.write(`? Do you want to continue? [Y/n] `); + import_process2.stdin.resume(); + const chars = await (0, import_events.once)(import_process2.stdin, `data`); + import_process2.stdin.pause(); + if (chars[0][0] === 110 || chars[0][0] === 78) + throw new UsageError(`Aborted by the user`); + console.error(); + } + } + const response = await fetch(input, init); + const webStream = response.body; + (0, import_assert.default)(webStream, `Expected stream to be set`); + const stream = import_stream.Readable.fromWeb(webStream); + return stream; +} +var ProxyAgent; +async function getProxyAgent(input) { + const { getProxyForUrl } = await Promise.resolve().then(() => __toESM(require_proxy_from_env())); + const proxy = getProxyForUrl(input); + if (!proxy) return void 0; + if (ProxyAgent == null) { + const [api, Dispatcher, _ProxyAgent] = await Promise.all([ + // @ts-expect-error internal module is untyped + Promise.resolve().then(() => __toESM(require_api())), + // @ts-expect-error internal module is untyped + Promise.resolve().then(() => __toESM(require_dispatcher())), + // @ts-expect-error internal module is untyped + Promise.resolve().then(() => __toESM(require_proxy_agent())) + ]); + Object.assign(Dispatcher.default.prototype, api.default); + ProxyAgent = _ProxyAgent.default; + } + return new ProxyAgent(proxy); +} + +// sources/nodeUtils.ts +var import_os2 = __toESM(require("os")); +function isNodeError(err) { + return !!err?.code; +} +function isExistError(err) { + return err.code === `EEXIST` || err.code === `ENOTEMPTY`; +} +function getEndOfLine(content) { + const matches = content.match(/\r?\n/g); + if (matches === null) + return import_os2.default.EOL; + const crlf = matches.filter((nl) => nl === `\r +`).length; + const lf = matches.length - crlf; + return crlf > lf ? `\r +` : ` +`; +} +function normalizeLineEndings(originalContent, newContent) { + return newContent.replace(/\r?\n/g, getEndOfLine(originalContent)); +} +function getIndent(content) { + const indentMatch = content.match(/^[ \t]+/m); + if (indentMatch) { + return indentMatch[0]; + } else { + return ` `; + } +} +function stripBOM(content) { + if (content.charCodeAt(0) === 65279) { + return content.slice(1); + } else { + return content; + } +} +function readPackageJson(content) { + return { + data: JSON.parse(stripBOM(content) || `{}`), + indent: getIndent(content) + }; +} + +// sources/corepackUtils.ts +var YARN_SWITCH_REGEX = /[/\\]switch[/\\]bin[/\\]/; +function isYarnSwitchPath(p) { + return YARN_SWITCH_REGEX.test(p); +} +function getRegistryFromPackageManagerSpec(spec) { + return process.env.COREPACK_NPM_REGISTRY ? spec.npmRegistry ?? spec.registry : spec.registry; +} +async function fetchLatestStableVersion2(spec) { + switch (spec.type) { + case `npm`: { + return await fetchLatestStableVersion(spec.package); + } + case `url`: { + const data = await fetchAsJson(spec.url); + return data[spec.fields.tags].stable; + } + default: { + throw new Error(`Unsupported specification ${JSON.stringify(spec)}`); + } + } +} +async function fetchAvailableTags2(spec) { + switch (spec.type) { + case `npm`: { + return await fetchAvailableTags(spec.package); + } + case `url`: { + const data = await fetchAsJson(spec.url); + return data[spec.fields.tags]; + } + default: { + throw new Error(`Unsupported specification ${JSON.stringify(spec)}`); + } + } +} +async function fetchAvailableVersions2(spec) { + switch (spec.type) { + case `npm`: { + return await fetchAvailableVersions(spec.package); + } + case `url`: { + const data = await fetchAsJson(spec.url); + const field = data[spec.fields.versions]; + return Array.isArray(field) ? field : Object.keys(field); + } + default: { + throw new Error(`Unsupported specification ${JSON.stringify(spec)}`); + } + } +} +async function findInstalledVersion(installTarget, descriptor) { + const installFolder = import_path3.default.join(installTarget, descriptor.name); + let cacheDirectory; + try { + cacheDirectory = await import_fs4.default.promises.opendir(installFolder); + } catch (error) { + if (isNodeError(error) && error.code === `ENOENT`) { + return null; + } else { + throw error; + } + } + const range = new import_range.default(descriptor.range); + let bestMatch = null; + let maxSV = void 0; + for await (const { name: name2 } of cacheDirectory) { + if (name2.startsWith(`.`)) + continue; + if (range.test(name2) && maxSV?.compare(name2) !== 1) { + bestMatch = name2; + maxSV = new import_semver.default(bestMatch); + } + } + return bestMatch; +} +function isSupportedPackageManagerDescriptor(descriptor) { + return !URL.canParse(descriptor.range); +} +function isSupportedPackageManagerLocator(locator) { + return !URL.canParse(locator.reference); +} +function parseURLReference(locator) { + const { hash, href } = new URL(locator.reference); + if (hash) { + return { + version: encodeURIComponent(href.slice(0, -hash.length)), + build: hash.slice(1).split(`.`) + }; + } + return { version: encodeURIComponent(href), build: [] }; +} +function isValidBinList(x) { + return Array.isArray(x) && x.length > 0; +} +function isValidBinSpec(x) { + return typeof x === `object` && x !== null && !Array.isArray(x) && Object.keys(x).length > 0; +} +async function download(installTarget, url, algo, binPath = null) { + const tmpFolder = getTemporaryFolder(installTarget); + log(`Downloading to ${tmpFolder}`); + const stream = await fetchUrlStream(url); + const parsedUrl = new URL(url); + const ext = import_path3.default.posix.extname(parsedUrl.pathname); + let outputFile = null; + let sendTo; + if (ext === `.tgz`) { + const { extract: tarX } = await Promise.resolve().then(() => (init_extract(), extract_exports)); + sendTo = tarX({ + strip: 1, + cwd: tmpFolder, + filter: binPath ? (path16) => { + const pos2 = path16.indexOf(`/`); + return pos2 !== -1 && path16.slice(pos2 + 1) === binPath; + } : void 0 + }); + } else if (ext === `.js`) { + outputFile = import_path3.default.join(tmpFolder, import_path3.default.posix.basename(parsedUrl.pathname)); + sendTo = import_fs4.default.createWriteStream(outputFile); + } + stream.pipe(sendTo); + let hash = !binPath ? stream.pipe((0, import_crypto2.createHash)(algo)) : null; + await (0, import_events4.once)(sendTo, `finish`); + if (binPath) { + const downloadedBin = import_path3.default.join(tmpFolder, binPath); + outputFile = import_path3.default.join(tmpFolder, import_path3.default.basename(downloadedBin)); + try { + await renameSafe(downloadedBin, outputFile); + } catch (err) { + if (isNodeError(err) && err.code === `ENOENT`) + throw new Error(`Cannot locate '${binPath}' in downloaded tarball`, { cause: err }); + if (isNodeError(err) && isExistError(err)) { + await import_fs4.default.promises.rm(downloadedBin); + } else { + throw err; + } + } + const fileStream = import_fs4.default.createReadStream(outputFile); + hash = fileStream.pipe((0, import_crypto2.createHash)(algo)); + await (0, import_events4.once)(fileStream, `close`); + } + return { + tmpFolder, + outputFile, + hash: hash.digest(`hex`) + }; +} +async function installVersion(installTarget, locator, { spec }) { + const locatorIsASupportedPackageManager = isSupportedPackageManagerLocator(locator); + const locatorReference = locatorIsASupportedPackageManager ? (0, import_parse3.default)(locator.reference) : parseURLReference(locator); + const { version: version2, build } = locatorReference; + const installFolder = import_path3.default.join(installTarget, locator.name, version2); + try { + const corepackFile = import_path3.default.join(installFolder, `.corepack`); + const corepackContent = await import_fs4.default.promises.readFile(corepackFile, `utf8`); + const corepackData = JSON.parse(corepackContent); + log(`Reusing ${locator.name}@${locator.reference} found in ${installFolder}`); + return { + hash: corepackData.hash, + location: installFolder, + bin: corepackData.bin + }; + } catch (err) { + if (isNodeError(err) && err.code !== `ENOENT`) { + throw err; + } + } + let url; + let signatures; + let integrity; + let binPath = null; + if (locatorIsASupportedPackageManager) { + url = spec.url.replace(`{}`, version2); + if (process.env.COREPACK_NPM_REGISTRY) { + const registry = getRegistryFromPackageManagerSpec(spec); + if (registry.type === `npm`) { + ({ tarball: url, signatures, integrity } = await fetchTarballURLAndSignature(registry.package, version2)); + if (registry.bin) { + binPath = registry.bin; + } + } + url = url.replace( + DEFAULT_NPM_REGISTRY_URL, + () => process.env.COREPACK_NPM_REGISTRY + ); + } + } else { + url = decodeURIComponent(version2); + if (process.env.COREPACK_NPM_REGISTRY && url.startsWith(DEFAULT_NPM_REGISTRY_URL)) { + url = url.replace( + DEFAULT_NPM_REGISTRY_URL, + () => process.env.COREPACK_NPM_REGISTRY + ); + } + } + log(`Installing ${locator.name}@${version2} from ${url}`); + const algo = build[0] ?? `sha512`; + const { tmpFolder, outputFile, hash: actualHash } = await download(installTarget, url, algo, binPath); + let bin; + const isSingleFile = outputFile !== null; + if (isSingleFile) { + if (locatorIsASupportedPackageManager && isValidBinList(spec.bin)) { + bin = spec.bin; + } else { + bin = [locator.name]; + } + } else { + if (locatorIsASupportedPackageManager && isValidBinSpec(spec.bin)) { + bin = spec.bin; + } else { + const { name: packageName, bin: packageBin } = require(import_path3.default.join(tmpFolder, `package.json`)); + if (typeof packageBin === `string`) { + bin = { [packageName]: packageBin }; + } else if (isValidBinSpec(packageBin)) { + bin = packageBin; + } else { + throw new Error(`Unable to locate bin in package.json`); + } + } + } + if (!build[1]) { + const registry = getRegistryFromPackageManagerSpec(spec); + if (registry.type === `npm` && !registry.bin && !shouldSkipIntegrityCheck()) { + if (signatures == null || integrity == null) + ({ signatures, integrity } = await fetchTarballURLAndSignature(registry.package, version2)); + verifySignature({ signatures, integrity, packageName: registry.package, version: version2 }); + build[1] = Buffer.from(integrity.slice(`sha512-`.length), `base64`).toString(`hex`); + } + } + if (build[1] && actualHash !== build[1]) + throw new Error(`Mismatch hashes. Expected ${build[1]}, got ${actualHash}`); + const serializedHash = `${algo}.${actualHash}`; + await import_fs4.default.promises.writeFile(import_path3.default.join(tmpFolder, `.corepack`), JSON.stringify({ + locator, + bin, + hash: serializedHash + })); + await import_fs4.default.promises.mkdir(import_path3.default.dirname(installFolder), { recursive: true }); + try { + await renameSafe(tmpFolder, installFolder); + } catch (err) { + if (isNodeError(err) && (isExistError(err) || // On Windows the error code is EPERM so we check if it is a directory + err.code === `EPERM` && (await import_fs4.default.promises.stat(installFolder)).isDirectory())) { + log(`Another instance of corepack installed ${locator.name}@${locator.reference}`); + await import_fs4.default.promises.rm(tmpFolder, { recursive: true, force: true }); + } else { + throw err; + } + } + if (locatorIsASupportedPackageManager && process.env.COREPACK_DEFAULT_TO_LATEST !== `0`) { + const lastKnownGood = await getLastKnownGood(); + const defaultVersion = getLastKnownGoodFromFileContent(lastKnownGood, locator.name); + if (defaultVersion) { + const currentDefault = (0, import_parse3.default)(defaultVersion); + const downloadedVersion = locatorReference; + if (currentDefault.major === downloadedVersion.major && (0, import_lt.default)(currentDefault, downloadedVersion)) { + await activatePackageManager(lastKnownGood, locator); + } + } + } + log(`Download and install of ${locator.name}@${locator.reference} is finished`); + return { + location: installFolder, + bin, + hash: serializedHash + }; +} +async function renameSafe(oldPath, newPath) { + if (process.platform === `win32`) { + await renameUnderWindows(oldPath, newPath); + } else { + await import_fs4.default.promises.rename(oldPath, newPath); + } +} +async function renameUnderWindows(oldPath, newPath) { + const retries = 5; + for (let i = 0; i < retries; i++) { + try { + await import_fs4.default.promises.rename(oldPath, newPath); + break; + } catch (err) { + if (isNodeError(err) && (err.code === `ENOENT` || err.code === `EPERM`) && i < retries - 1) { + await (0, import_promises2.setTimeout)(100 * 2 ** i); + continue; + } else { + throw err; + } + } + } +} +async function runVersion(locator, installSpec, binName, args) { + let binPath = null; + const bin = installSpec.bin ?? installSpec.spec.bin; + if (Array.isArray(bin)) { + if (bin.some((name2) => name2 === binName)) { + const parsedUrl = new URL(installSpec.spec.url); + const ext = import_path3.default.posix.extname(parsedUrl.pathname); + if (ext === `.js`) { + binPath = import_path3.default.join(installSpec.location, import_path3.default.posix.basename(parsedUrl.pathname)); + } + } + } else { + for (const [name2, dest] of Object.entries(bin)) { + if (name2 === binName) { + binPath = import_path3.default.join(installSpec.location, dest); + break; + } + } + } + if (!binPath) + throw new Error(`Assertion failed: Unable to locate path for bin '${binName}'`); + if (!import_module.default.enableCompileCache) { + if (locator.name !== `npm` || (0, import_lt.default)(locator.reference, `9.7.0`)) { + await Promise.resolve().then(() => __toESM(require_v8_compile_cache())); + } + } + process.env.COREPACK_ROOT = import_path3.default.dirname(require.resolve("corepack/package.json")); + process.argv = [ + process.execPath, + binPath, + ...args + ]; + process.execArgv = []; + process.mainModule = void 0; + process.nextTick(import_module.default.runMain, binPath); + if (import_module.default.flushCompileCache) { + setImmediate(import_module.default.flushCompileCache); + } +} +function shouldSkipIntegrityCheck() { + return process.env.COREPACK_INTEGRITY_KEYS === `` || process.env.COREPACK_INTEGRITY_KEYS === `0`; +} + +// sources/semverUtils.ts +var import_range2 = __toESM(require_range()); +var import_semver2 = __toESM(require_semver()); +function satisfiesWithPrereleases(version2, range, loose = false) { + let semverRange; + try { + semverRange = new import_range2.default(range, loose); + } catch (err) { + return false; + } + if (!version2) + return false; + let semverVersion; + try { + semverVersion = new import_semver2.default(version2, semverRange.loose); + if (semverVersion.prerelease) { + semverVersion.prerelease = []; + } + } catch (err) { + return false; + } + return semverRange.set.some((comparatorSet) => { + for (const comparator of comparatorSet) + if (comparator.semver.prerelease) + comparator.semver.prerelease = []; + return comparatorSet.every((comparator) => { + return comparator.test(semverVersion); + }); + }); +} + +// sources/specUtils.ts +var import_fs5 = __toESM(require("fs")); +var import_path4 = __toESM(require("path")); +var import_satisfies = __toESM(require_satisfies()); +var import_valid = __toESM(require_valid()); +var import_valid2 = __toESM(require_valid2()); +var import_util = require("util"); + +// sources/types.ts +var SupportedPackageManagers = /* @__PURE__ */ ((SupportedPackageManagers3) => { + SupportedPackageManagers3["Npm"] = `npm`; + SupportedPackageManagers3["Pnpm"] = `pnpm`; + SupportedPackageManagers3["Yarn"] = `yarn`; + return SupportedPackageManagers3; +})(SupportedPackageManagers || {}); +var SupportedPackageManagerSet = new Set( + Object.values(SupportedPackageManagers) +); +var SupportedPackageManagerSetWithoutNpm = new Set( + Object.values(SupportedPackageManagers) +); +SupportedPackageManagerSetWithoutNpm.delete("npm" /* Npm */); +function isSupportedPackageManager(value) { + return SupportedPackageManagerSet.has(value); +} + +// sources/specUtils.ts +var nodeModulesRegExp = /[\\/]node_modules[\\/](@[^\\/]*[\\/])?([^@\\/][^\\/]*)$/; +function parseSpec(raw2, source, { enforceExactVersion = true } = {}) { + if (typeof raw2 !== `string`) + throw new UsageError(`Invalid package manager specification in ${source}; expected a string`); + const atIndex = raw2.indexOf(`@`); + if (atIndex === -1 || atIndex === raw2.length - 1) { + if (enforceExactVersion) + throw new UsageError(`No version specified for ${raw2} in "packageManager" of ${source}`); + const name3 = atIndex === -1 ? raw2 : raw2.slice(0, -1); + if (!isSupportedPackageManager(name3)) + throw new UsageError(`Unsupported package manager specification (${name3})`); + return { + name: name3, + range: `*` + }; + } + const name2 = raw2.slice(0, atIndex); + const range = raw2.slice(atIndex + 1); + const isURL = URL.canParse(range); + if (!isURL) { + if (enforceExactVersion && !(0, import_valid.default)(range)) + throw new UsageError(`Invalid package manager specification in ${source} (${raw2}); expected a semver version${enforceExactVersion ? `` : `, range, or tag`}`); + if (!isSupportedPackageManager(name2)) { + throw new UsageError(`Unsupported package manager specification (${raw2})`); + } + } else if (isSupportedPackageManager(name2) && process.env.COREPACK_ENABLE_UNSAFE_CUSTOM_URLS !== `1`) { + throw new UsageError(`Illegal use of URL for known package manager. Instead, select a specific version, or set COREPACK_ENABLE_UNSAFE_CUSTOM_URLS=1 in your environment (${raw2})`); + } + return { + name: name2, + range + }; +} +function warnOrThrow(errorMessage, onFail) { + switch (onFail) { + case `ignore`: + break; + case `error`: + case void 0: + throw new UsageError(errorMessage); + default: + console.warn(`! Corepack validation warning: ${errorMessage}`); + } +} +function parsePackageJSON(packageJSONContent) { + const { packageManager: pm } = packageJSONContent; + if (packageJSONContent.devEngines?.packageManager != null) { + const { packageManager } = packageJSONContent.devEngines; + if (typeof packageManager !== `object`) { + console.warn(`! Corepack only supports objects as valid value for devEngines.packageManager. The current value (${JSON.stringify(packageManager)}) will be ignored.`); + return pm; + } + if (Array.isArray(packageManager)) { + console.warn(`! Corepack does not currently support array values for devEngines.packageManager`); + return pm; + } + const { name: name2, version: version2, onFail } = packageManager; + if (typeof name2 !== `string` || name2.includes(`@`)) { + warnOrThrow(`The value of devEngines.packageManager.name ${JSON.stringify(name2)} is not a supported string value`, onFail); + return pm; + } + if (version2 != null && (typeof version2 !== `string` || !(0, import_valid2.default)(version2))) { + warnOrThrow(`The value of devEngines.packageManager.version ${JSON.stringify(version2)} is not a valid semver range`, onFail); + return pm; + } + log(`devEngines.packageManager defines that ${name2}@${version2} is the local package manager`); + if (pm) { + if (!pm.startsWith?.(`${name2}@`)) + warnOrThrow(`"packageManager" field is set to ${JSON.stringify(pm)} which does not match the "devEngines.packageManager" field set to ${JSON.stringify(name2)}`, onFail); + else if (version2 != null && !(0, import_satisfies.default)(pm.slice(packageManager.name.length + 1), version2)) + warnOrThrow(`"packageManager" field is set to ${JSON.stringify(pm)} which does not match the value defined in "devEngines.packageManager" for ${JSON.stringify(name2)} of ${JSON.stringify(version2)}`, onFail); + return pm; + } + return `${name2}@${version2 ?? `*`}`; + } + return pm; +} +async function setLocalPackageManager(cwd, info) { + const lookup = await loadSpec(cwd); + const range = `range` in lookup && lookup.range; + if (range) { + if (info.locator.name !== range.name || !(0, import_satisfies.default)(info.locator.reference, range.range)) { + warnOrThrow(`The requested version of ${info.locator.name}@${info.locator.reference} does not match the devEngines specification (${range.name}@${range.range})`, range.onFail); + } + } + const content = lookup.type !== `NoProject` ? await import_fs5.default.promises.readFile(lookup.target, `utf8`) : ``; + const { data, indent } = readPackageJson(content); + const previousPackageManager = data.packageManager ?? (range ? `${range.name}@${range.range}` : `unknown`); + data.packageManager = `${info.locator.name}@${info.locator.reference}`; + const newContent = normalizeLineEndings(content, `${JSON.stringify(data, null, indent)} +`); + await import_fs5.default.promises.writeFile(lookup.target, newContent, `utf8`); + return { + previousPackageManager + }; +} +async function loadSpec(initialCwd) { + let nextCwd = initialCwd; + let currCwd = ``; + let selection = null; + while (nextCwd !== currCwd && (!selection || !selection.data.packageManager)) { + currCwd = nextCwd; + nextCwd = import_path4.default.dirname(currCwd); + if (nodeModulesRegExp.test(currCwd)) + continue; + const manifestPath = import_path4.default.join(currCwd, `package.json`); + log(`Checking ${manifestPath}`); + let content; + try { + content = await import_fs5.default.promises.readFile(manifestPath, `utf8`); + } catch (err) { + if (err?.code === `ENOENT`) continue; + throw err; + } + let data; + try { + data = JSON.parse(content); + } catch { + } + if (typeof data !== `object` || data === null) + throw new UsageError(`Invalid package.json in ${import_path4.default.relative(initialCwd, manifestPath)}`); + let localEnv; + const envFilePath2 = import_path4.default.resolve(currCwd, process.env.COREPACK_ENV_FILE ?? `.corepack.env`); + if (process.env.COREPACK_ENV_FILE == `0`) { + log(`Skipping env file as configured with COREPACK_ENV_FILE`); + localEnv = process.env; + } else if (typeof import_util.parseEnv !== `function`) { + log(`Skipping env file as it is not supported by the current version of Node.js`); + localEnv = process.env; + } else { + log(`Checking ${envFilePath2}`); + try { + localEnv = { + ...Object.fromEntries(Object.entries((0, import_util.parseEnv)(await import_fs5.default.promises.readFile(envFilePath2, `utf8`))).filter((e) => e[0].startsWith(`COREPACK_`))), + ...process.env + }; + log(`Successfully loaded env file found at ${envFilePath2}`); + } catch (err) { + if (err?.code !== `ENOENT`) + throw err; + log(`No env file found at ${envFilePath2}`); + localEnv = process.env; + } + } + selection = { data, manifestPath, localEnv, envFilePath: envFilePath2 }; + } + if (selection === null) + return { type: `NoProject`, target: import_path4.default.join(initialCwd, `package.json`) }; + let envFilePath; + if (selection.localEnv !== process.env) { + envFilePath = selection.envFilePath; + process.env = selection.localEnv; + } + const rawPmSpec = parsePackageJSON(selection.data); + if (typeof rawPmSpec === `undefined`) + return { type: `NoSpec`, target: selection.manifestPath }; + log(`${selection.manifestPath} defines ${rawPmSpec} as local package manager`); + return { + type: `Found`, + target: selection.manifestPath, + envFilePath, + range: selection.data.devEngines?.packageManager?.version && { + name: selection.data.devEngines.packageManager.name, + range: selection.data.devEngines.packageManager.version, + onFail: selection.data.devEngines.packageManager.onFail + }, + // Lazy-loading it so we do not throw errors on commands that do not need valid spec. + getSpec: ({ enforceExactVersion = true } = {}) => parseSpec(rawPmSpec, import_path4.default.relative(initialCwd, selection.manifestPath), { enforceExactVersion }) + }; +} + +// sources/Engine.ts +function getLastKnownGoodFilePath() { + const lkg = import_path5.default.join(getCorepackHomeFolder(), `lastKnownGood.json`); + log(`LastKnownGood file would be located at ${lkg}`); + return lkg; +} +async function getLastKnownGood() { + let raw2; + try { + raw2 = await import_fs6.default.promises.readFile(getLastKnownGoodFilePath(), `utf8`); + } catch (err) { + if (err?.code === `ENOENT`) { + log(`No LastKnownGood version found in Corepack home.`); + return {}; + } + throw err; + } + try { + const parsed = JSON.parse(raw2); + if (!parsed) { + log(`Invalid LastKnowGood file in Corepack home (JSON parsable, but falsy)`); + return {}; + } + if (typeof parsed !== `object`) { + log(`Invalid LastKnowGood file in Corepack home (JSON parsable, but non-object)`); + return {}; + } + Object.entries(parsed).forEach(([key, value]) => { + if (typeof value !== `string`) { + log(`Ignoring key ${key} in LastKnownGood file as its value is not a string`); + delete parsed[key]; + } + }); + return parsed; + } catch { + log(`Invalid LastKnowGood file in Corepack home (maybe not JSON parsable)`); + return {}; + } +} +async function createLastKnownGoodFile(lastKnownGood) { + const content = `${JSON.stringify(lastKnownGood, null, 2)} +`; + await import_fs6.default.promises.mkdir(getCorepackHomeFolder(), { recursive: true }); + await import_fs6.default.promises.writeFile(getLastKnownGoodFilePath(), content, `utf8`); +} +function getLastKnownGoodFromFileContent(lastKnownGood, packageManager) { + if (Object.hasOwn(lastKnownGood, packageManager)) + return lastKnownGood[packageManager]; + return void 0; +} +async function activatePackageManager(lastKnownGood, locator) { + if (lastKnownGood[locator.name] === locator.reference) { + log(`${locator.name}@${locator.reference} is already Last Known Good version`); + return; + } + lastKnownGood[locator.name] = locator.reference; + log(`Setting ${locator.name}@${locator.reference} as Last Known Good version`); + await createLastKnownGoodFile(lastKnownGood); +} +var Engine = class { + constructor(config = config_default) { + this.config = config; + } + getPackageManagerFor(binaryName) { + for (const packageManager of SupportedPackageManagerSet) { + for (const rangeDefinition of Object.values(this.config.definitions[packageManager].ranges)) { + const bins = Array.isArray(rangeDefinition.bin) ? rangeDefinition.bin : Object.keys(rangeDefinition.bin); + if (bins.includes(binaryName)) { + return packageManager; + } + } + } + return null; + } + getPackageManagerSpecFor(locator) { + if (!isSupportedPackageManagerLocator(locator)) { + const url = `${locator.reference}`; + return { + url, + bin: void 0, + // bin will be set later + registry: { + type: `url`, + url, + fields: { + tags: ``, + versions: `` + } + } + }; + } + const definition = this.config.definitions[locator.name]; + if (typeof definition === `undefined`) + throw new UsageError(`This package manager (${locator.name}) isn't supported by this corepack build`); + const ranges = Object.keys(definition.ranges).reverse(); + const range = ranges.find((range2) => satisfiesWithPrereleases(locator.reference, range2)); + if (typeof range === `undefined`) + throw new Error(`Assertion failed: Specified resolution (${locator.reference}) isn't supported by any of ${ranges.join(`, `)}`); + return definition.ranges[range]; + } + getBinariesFor(name2) { + const binNames = /* @__PURE__ */ new Set(); + for (const rangeDefinition of Object.values(this.config.definitions[name2].ranges)) { + const bins = Array.isArray(rangeDefinition.bin) ? rangeDefinition.bin : Object.keys(rangeDefinition.bin); + for (const name3 of bins) { + binNames.add(name3); + } + } + return binNames; + } + async getDefaultDescriptors() { + const locators = []; + for (const name2 of SupportedPackageManagerSet) + locators.push({ name: name2, range: await this.getDefaultVersion(name2) }); + return locators; + } + async getDefaultVersion(packageManager) { + const definition = this.config.definitions[packageManager]; + if (typeof definition === `undefined`) + throw new UsageError(`This package manager (${packageManager}) isn't supported by this corepack build`); + const lastKnownGood = await getLastKnownGood(); + const lastKnownGoodForThisPackageManager = getLastKnownGoodFromFileContent(lastKnownGood, packageManager); + if (lastKnownGoodForThisPackageManager) { + log(`Search for default version: Found ${packageManager}@${lastKnownGoodForThisPackageManager} in LastKnownGood file`); + return lastKnownGoodForThisPackageManager; + } + if (import_process3.default.env.COREPACK_DEFAULT_TO_LATEST === `0`) { + log(`Search for default version: As defined in environment, defaulting to internal config ${packageManager}@${definition.default}`); + return definition.default; + } + const reference = await fetchLatestStableVersion2(definition.fetchLatestFrom); + log(`Search for default version: found in remote registry ${packageManager}@${reference}`); + try { + await activatePackageManager(lastKnownGood, { + name: packageManager, + reference + }); + } catch { + log(`Search for default version: could not activate registry version`); + } + return reference; + } + async activatePackageManager(locator) { + const lastKnownGood = await getLastKnownGood(); + await activatePackageManager(lastKnownGood, locator); + } + async ensurePackageManager(locator) { + const spec = this.getPackageManagerSpecFor(locator); + const packageManagerInfo = await installVersion(getInstallFolder(), locator, { + spec + }); + const noHashReference = locator.reference.replace(/\+.*/, ``); + const fixedHashReference = `${noHashReference}+${packageManagerInfo.hash}`; + const fixedHashLocator = { + name: locator.name, + reference: fixedHashReference + }; + return { + ...packageManagerInfo, + locator: fixedHashLocator, + spec + }; + } + /** + * Locates the active project's package manager specification. + * + * If the specification exists but doesn't match the active package manager, + * an error is thrown to prevent users from using the wrong package manager, + * which would lead to inconsistent project layouts. + * + * If the project doesn't include a specification file, we just assume that + * whatever the user uses is exactly what they want to use. Since the version + * isn't specified, we fallback on known good versions. + * + * Finally, if the project doesn't exist at all, we ask the user whether they + * want to create one in the current project. If they do, we initialize a new + * project using the default package managers, and configure it so that we + * don't need to ask again in the future. + */ + async findProjectSpec(initialCwd, locator, { transparent = false, binaryVersion } = {}) { + const fallbackDescriptor = { name: locator.name, range: `${locator.reference}` }; + if (import_process3.default.env.COREPACK_ENABLE_PROJECT_SPEC === `0`) { + if (typeof locator.reference === `function`) + fallbackDescriptor.range = await locator.reference(); + return fallbackDescriptor; + } + if (import_process3.default.env.COREPACK_ENABLE_STRICT === `0`) + transparent = true; + while (true) { + const result = await loadSpec(initialCwd); + switch (result.type) { + case `NoProject`: { + if (typeof locator.reference === `function`) + fallbackDescriptor.range = await locator.reference(); + log(`Falling back to ${fallbackDescriptor.name}@${fallbackDescriptor.range} as no project manifest were found`); + return fallbackDescriptor; + } + case `NoSpec`: { + if (typeof locator.reference === `function`) + fallbackDescriptor.range = await locator.reference(); + if (import_process3.default.env.COREPACK_ENABLE_AUTO_PIN === `1`) { + const resolved = await this.resolveDescriptor(fallbackDescriptor, { allowTags: true }); + if (resolved === null) + throw new UsageError(`Failed to successfully resolve '${fallbackDescriptor.range}' to a valid ${fallbackDescriptor.name} release`); + const installSpec = await this.ensurePackageManager(resolved); + console.error(`! The local project doesn't define a 'packageManager' field. Corepack will now add one referencing ${installSpec.locator.name}@${installSpec.locator.reference}.`); + console.error(`! For more details about this field, consult the documentation at https://nodejs.org/api/packages.html#packagemanager`); + console.error(); + await setLocalPackageManager(import_path5.default.dirname(result.target), installSpec); + } + log(`Falling back to ${fallbackDescriptor.name}@${fallbackDescriptor.range} in the absence of "packageManager" field in ${result.target}`); + return fallbackDescriptor; + } + case `Found`: { + const spec = result.getSpec({ enforceExactVersion: !binaryVersion }); + if (spec.name !== locator.name) { + if (transparent) { + if (typeof locator.reference === `function`) + fallbackDescriptor.range = await locator.reference(); + log(`Falling back to ${fallbackDescriptor.name}@${fallbackDescriptor.range} in a ${spec.name}@${spec.range} project`); + return fallbackDescriptor; + } else { + throw new UsageError(`This project is configured to use ${spec.name} because ${result.target} has a "packageManager" field`); + } + } else { + log(`Using ${spec.name}@${spec.range} as defined in project manifest ${result.target}`); + return spec; + } + } + } + } + } + async executePackageManagerRequest({ packageManager, binaryName, binaryVersion }, { cwd, args }) { + let fallbackLocator = { + name: binaryName, + reference: void 0 + }; + let isTransparentCommand = false; + if (packageManager != null) { + const defaultVersion = binaryVersion || (() => this.getDefaultVersion(packageManager)); + const definition = this.config.definitions[packageManager]; + for (const transparentPath of definition.transparent.commands) { + if (transparentPath[0] === binaryName && transparentPath.slice(1).every((segment, index) => segment === args[index])) { + isTransparentCommand = true; + break; + } + } + const fallbackReference = isTransparentCommand ? definition.transparent.default ?? defaultVersion : defaultVersion; + fallbackLocator = { + name: packageManager, + reference: fallbackReference + }; + } + const descriptor = await this.findProjectSpec(cwd, fallbackLocator, { transparent: isTransparentCommand, binaryVersion }); + if (binaryVersion) + descriptor.range = binaryVersion; + const resolved = await this.resolveDescriptor(descriptor, { allowTags: true }); + if (resolved === null) + throw new UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); + const installSpec = await this.ensurePackageManager(resolved); + return await runVersion(resolved, installSpec, binaryName, args); + } + async resolveDescriptor(descriptor, { allowTags = false, useCache = true } = {}) { + if (!isSupportedPackageManagerDescriptor(descriptor)) { + if (import_process3.default.env.COREPACK_ENABLE_UNSAFE_CUSTOM_URLS !== `1` && isSupportedPackageManager(descriptor.name)) + throw new UsageError(`Illegal use of URL for known package manager. Instead, select a specific version, or set COREPACK_ENABLE_UNSAFE_CUSTOM_URLS=1 in your environment (${descriptor.name}@${descriptor.range})`); + return { + name: descriptor.name, + reference: descriptor.range + }; + } + const definition = this.config.definitions[descriptor.name]; + if (typeof definition === `undefined`) + throw new UsageError(`This package manager (${descriptor.name}) isn't supported by this corepack build`); + let finalDescriptor = descriptor; + if (!(0, import_valid3.default)(descriptor.range) && !(0, import_valid4.default)(descriptor.range)) { + if (!allowTags) + throw new UsageError(`Packages managers can't be referenced via tags in this context`); + const ranges = Object.keys(definition.ranges); + const tagRange = ranges[ranges.length - 1]; + const packageManagerSpec = definition.ranges[tagRange]; + const registry = getRegistryFromPackageManagerSpec(packageManagerSpec); + const tags = await fetchAvailableTags2(registry); + if (!Object.hasOwn(tags, descriptor.range)) + throw new UsageError(`Tag not found (${descriptor.range})`); + finalDescriptor = { + name: descriptor.name, + range: tags[descriptor.range] + }; + } + const cachedVersion = await findInstalledVersion(getInstallFolder(), finalDescriptor); + if (cachedVersion !== null && useCache) + return { name: finalDescriptor.name, reference: cachedVersion }; + if ((0, import_valid3.default)(finalDescriptor.range)) + return { name: finalDescriptor.name, reference: finalDescriptor.range }; + const versions = await Promise.all(Object.keys(definition.ranges).map(async (range) => { + const packageManagerSpec = definition.ranges[range]; + const registry = getRegistryFromPackageManagerSpec(packageManagerSpec); + const versions2 = await fetchAvailableVersions2(registry); + return versions2.filter((version2) => satisfiesWithPrereleases(version2, finalDescriptor.range)); + })); + const highestVersion = [...new Set(versions.flat())].sort(import_rcompare.default); + if (highestVersion.length === 0) + return null; + return { name: finalDescriptor.name, reference: highestVersion[0] }; + } +}; + +// sources/commands/Cache.ts +var import_fs7 = __toESM(require("fs")); +var CacheCommand = class extends Command { + static paths = [ + [`cache`, `clean`], + [`cache`, `clear`] + ]; + static usage = Command.Usage({ + description: `Cleans Corepack cache`, + details: ` + Removes Corepack cache directory from your local disk. + ` + }); + async execute() { + await import_fs7.default.promises.rm(getInstallFolder(), { recursive: true, force: true }); + } +}; + +// sources/commands/Disable.ts +var import_fs8 = __toESM(require("fs")); +var import_path6 = __toESM(require("path")); +var import_which = __toESM(require_lib()); +var DisableCommand = class extends Command { + static paths = [ + [`disable`] + ]; + static usage = Command.Usage({ + description: `Remove the Corepack shims from the install directory`, + details: ` + When run, this command will remove the shims for the specified package managers from the install directory, or all shims if no parameters are passed. + + By default it will locate the install directory by running the equivalent of \`which corepack\`, but this can be tweaked by explicitly passing the install directory via the \`--install-directory\` flag. + `, + examples: [[ + `Disable all shims, removing them if they're next to the \`coreshim\` binary`, + `$0 disable` + ], [ + `Disable all shims, removing them from the specified directory`, + `$0 disable --install-directory /path/to/bin` + ], [ + `Disable the Yarn shim only`, + `$0 disable yarn` + ]] + }); + installDirectory = options_exports.String(`--install-directory`, { + description: `Where the shims are located` + }); + names = options_exports.Rest(); + async execute() { + let installDirectory = this.installDirectory; + if (typeof installDirectory === `undefined`) + installDirectory = import_path6.default.dirname(await (0, import_which.default)(`corepack`)); + const names = this.names.length === 0 ? SupportedPackageManagerSetWithoutNpm : this.names; + const allBinNames = []; + for (const name2 of new Set(names)) { + if (!isSupportedPackageManager(name2)) + throw new UsageError(`Invalid package manager name '${name2}'`); + const binNames = this.context.engine.getBinariesFor(name2); + allBinNames.push(...binNames); + } + const removeLink = process.platform === `win32` ? (binName) => this.removeWin32Link(installDirectory, binName) : (binName) => this.removePosixLink(installDirectory, binName); + await Promise.all(allBinNames.map(removeLink)); + } + async removePosixLink(installDirectory, binName) { + const file = import_path6.default.join(installDirectory, binName); + try { + if (binName.includes(`yarn`) && isYarnSwitchPath(await import_fs8.default.promises.realpath(file))) { + console.warn(`${binName} is already installed in ${file} and points to a Yarn Switch install - skipping`); + return; + } + await import_fs8.default.promises.unlink(file); + } catch (err) { + if (err.code !== `ENOENT`) { + throw err; + } + } + } + async removeWin32Link(installDirectory, binName) { + for (const ext of [``, `.ps1`, `.cmd`]) { + const file = import_path6.default.join(installDirectory, `${binName}${ext}`); + try { + await import_fs8.default.promises.unlink(file); + } catch (err) { + if (err.code !== `ENOENT`) { + throw err; + } + } + } + } +}; + +// sources/commands/Enable.ts +var import_cmd_shim = __toESM(require_cmd_shim()); +var import_fs9 = __toESM(require("fs")); +var import_path7 = __toESM(require("path")); +var import_which2 = __toESM(require_lib()); +var EnableCommand = class extends Command { + static paths = [ + [`enable`] + ]; + static usage = Command.Usage({ + description: `Add the Corepack shims to the install directory`, + details: ` + When run, this command will check whether the shims for the specified package managers can be found with the correct values inside the install directory. If not, or if they don't exist, they will be created. + + By default it will locate the install directory by running the equivalent of \`which corepack\`, but this can be tweaked by explicitly passing the install directory via the \`--install-directory\` flag. + `, + examples: [[ + `Enable all shims, putting them next to the \`corepack\` binary`, + `$0 enable` + ], [ + `Enable all shims, putting them in the specified directory`, + `$0 enable --install-directory /path/to/folder` + ], [ + `Enable the Yarn shim only`, + `$0 enable yarn` + ]] + }); + installDirectory = options_exports.String(`--install-directory`, { + description: `Where the shims are to be installed` + }); + names = options_exports.Rest(); + async execute() { + let installDirectory = this.installDirectory; + if (typeof installDirectory === `undefined`) + installDirectory = import_path7.default.dirname(await (0, import_which2.default)(`corepack`)); + installDirectory = import_fs9.default.realpathSync(installDirectory); + const manifestPath = require.resolve("corepack/package.json"); + const distFolder = import_path7.default.join(import_path7.default.dirname(manifestPath), `dist`); + if (!import_fs9.default.existsSync(distFolder)) + throw new Error(`Assertion failed: The stub folder doesn't exist`); + const names = this.names.length === 0 ? SupportedPackageManagerSetWithoutNpm : this.names; + const allBinNames = []; + for (const name2 of new Set(names)) { + if (!isSupportedPackageManager(name2)) + throw new UsageError(`Invalid package manager name '${name2}'`); + const binNames = this.context.engine.getBinariesFor(name2); + allBinNames.push(...binNames); + } + const generateLink = process.platform === `win32` ? (binName) => this.generateWin32Link(installDirectory, distFolder, binName) : (binName) => this.generatePosixLink(installDirectory, distFolder, binName); + await Promise.all(allBinNames.map(generateLink)); + } + async generatePosixLink(installDirectory, distFolder, binName) { + const file = import_path7.default.join(installDirectory, binName); + const symlink = import_path7.default.relative(installDirectory, import_path7.default.join(distFolder, `${binName}.js`)); + const stats = import_fs9.default.lstatSync(file, { throwIfNoEntry: false }); + if (stats) { + if (stats.isSymbolicLink()) { + const currentSymlink = await import_fs9.default.promises.readlink(file); + if (binName.includes(`yarn`) && isYarnSwitchPath(await import_fs9.default.promises.realpath(file))) { + console.warn(`${binName} is already installed in ${file} and points to a Yarn Switch install - skipping`); + return; + } + if (currentSymlink === symlink) { + return; + } + } + await import_fs9.default.promises.unlink(file); + } + await import_fs9.default.promises.symlink(symlink, file); + } + async generateWin32Link(installDirectory, distFolder, binName) { + const file = import_path7.default.join(installDirectory, binName); + await (0, import_cmd_shim.default)(import_path7.default.join(distFolder, `${binName}.js`), file, { + createCmdFile: true + }); + } +}; + +// sources/commands/InstallGlobal.ts +var import_fs10 = __toESM(require("fs")); +var import_path8 = __toESM(require("path")); + +// sources/commands/Base.ts +var BaseCommand = class extends Command { + async resolvePatternsToDescriptors({ patterns }) { + const resolvedSpecs = patterns.map((pattern) => parseSpec(pattern, `CLI arguments`, { enforceExactVersion: false })); + if (resolvedSpecs.length === 0) { + const lookup = await loadSpec(this.context.cwd); + switch (lookup.type) { + case `NoProject`: + throw new UsageError(`Couldn't find a project in the local directory - please specify the package manager to pack, or run this command from a valid project`); + case `NoSpec`: + throw new UsageError(`The local project doesn't feature a 'packageManager' field nor a 'devEngines.packageManager' field - please specify the package manager to pack, or update the manifest to reference it`); + default: { + return [lookup.range ?? lookup.getSpec()]; + } + } + } + return resolvedSpecs; + } + async setAndInstallLocalPackageManager(info) { + const { + previousPackageManager + } = await setLocalPackageManager(this.context.cwd, info); + const command = this.context.engine.getPackageManagerSpecFor(info.locator).commands?.use ?? null; + if (command === null) + return 0; + process.env.COREPACK_MIGRATE_FROM = previousPackageManager; + this.context.stdout.write(` +`); + const [binaryName, ...args] = command; + return await runVersion(info.locator, info, binaryName, args); + } +}; + +// sources/commands/InstallGlobal.ts +var InstallGlobalCommand = class extends BaseCommand { + static paths = [ + [`install`] + ]; + static usage = Command.Usage({ + description: `Install package managers on the system`, + details: ` + Download the selected package managers and install them on the system. + + Package managers thus installed will be configured as the new default when calling their respective binaries outside of projects defining the 'packageManager' field. + `, + examples: [[ + `Install the latest version of Yarn 1.x and make it globally available`, + `corepack install -g yarn@^1` + ], [ + `Install the latest version of pnpm, and make it globally available`, + `corepack install -g pnpm` + ]] + }); + global = options_exports.Boolean(`-g,--global`, { + required: true + }); + cacheOnly = options_exports.Boolean(`--cache-only`, false, { + description: `If true, the package managers will only be cached, not set as new defaults` + }); + args = options_exports.Rest(); + async execute() { + if (this.args.length === 0) + throw new UsageError(`No package managers specified`); + await Promise.all(this.args.map((arg) => { + if (arg.endsWith(`.tgz`)) { + return this.installFromTarball(import_path8.default.resolve(this.context.cwd, arg)); + } else { + return this.installFromDescriptor(parseSpec(arg, `CLI arguments`, { enforceExactVersion: false })); + } + })); + } + log(locator) { + if (this.cacheOnly) { + this.context.stdout.write(`Adding ${locator.name}@${locator.reference} to the cache... +`); + } else { + this.context.stdout.write(`Installing ${locator.name}@${locator.reference}... +`); + } + } + async installFromDescriptor(descriptor) { + const resolved = await this.context.engine.resolveDescriptor(descriptor, { allowTags: true, useCache: false }); + if (resolved === null) + throw new UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); + this.log(resolved); + await this.context.engine.ensurePackageManager(resolved); + if (!this.cacheOnly) { + await this.context.engine.activatePackageManager(resolved); + } + } + async installFromTarball(p) { + const installFolder = getInstallFolder(); + const archiveEntries = /* @__PURE__ */ new Map(); + const { list: tarT } = await Promise.resolve().then(() => (init_list(), list_exports)); + let hasShortEntries = false; + await tarT({ file: p, onentry: (entry) => { + const segments = entry.path.split(/\//g); + if (segments.length > 0 && segments[segments.length - 1] !== `.corepack`) + return; + if (segments.length < 3) { + hasShortEntries = true; + } else { + let references = archiveEntries.get(segments[0]); + if (typeof references === `undefined`) + archiveEntries.set(segments[0], references = /* @__PURE__ */ new Set()); + references.add(segments[1]); + } + } }); + if (hasShortEntries || archiveEntries.size < 1) + throw new UsageError(`Invalid archive format; did it get generated by 'corepack pack'?`); + const { extract: tarX } = await Promise.resolve().then(() => (init_extract(), extract_exports)); + for (const [name2, references] of archiveEntries) { + for (const reference of references) { + if (!isSupportedPackageManager(name2)) + throw new UsageError(`Unsupported package manager '${name2}'`); + this.log({ name: name2, reference }); + await import_fs10.default.promises.mkdir(installFolder, { recursive: true }); + await tarX({ file: p, cwd: installFolder }, [`${name2}/${reference}`]); + if (!this.cacheOnly) { + await this.context.engine.activatePackageManager({ name: name2, reference }); + } + } + } + } +}; + +// sources/commands/InstallLocal.ts +var InstallLocalCommand = class extends BaseCommand { + static paths = [ + [`install`] + ]; + static usage = Command.Usage({ + description: `Install the package manager configured in the local project`, + details: ` + Download and install the package manager configured in the local project. This command doesn't change the global version used when running the package manager from outside the project (use the \`-g,--global\` flag if you wish to do this). + `, + examples: [[ + `Install the project's package manager in the cache`, + `corepack install` + ]] + }); + async execute() { + const [descriptor] = await this.resolvePatternsToDescriptors({ + patterns: [] + }); + const resolved = await this.context.engine.resolveDescriptor(descriptor, { allowTags: true }); + if (resolved === null) + throw new UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); + this.context.stdout.write(`Adding ${resolved.name}@${resolved.reference} to the cache... +`); + await this.context.engine.ensurePackageManager(resolved); + } +}; + +// sources/commands/Pack.ts +var import_promises3 = require("fs/promises"); +var import_path11 = __toESM(require("path")); +var PackCommand = class extends BaseCommand { + static paths = [ + [`pack`] + ]; + static usage = Command.Usage({ + description: `Store package managers in a tarball`, + details: ` + Download the selected package managers and store them inside a tarball suitable for use with \`corepack install -g\`. + `, + examples: [[ + `Pack the package manager defined in the package.json file`, + `corepack pack` + ], [ + `Pack the latest version of Yarn 1.x inside a file named corepack.tgz`, + `corepack pack yarn@^1` + ]] + }); + json = options_exports.Boolean(`--json`, false, { + description: `If true, the path to the generated tarball will be printed on stdout` + }); + output = options_exports.String(`-o,--output`, { + description: `Where the tarball should be generated; by default "corepack.tgz"` + }); + patterns = options_exports.Rest(); + async execute() { + const descriptors = await this.resolvePatternsToDescriptors({ + patterns: this.patterns + }); + const installLocations = []; + for (const descriptor of descriptors) { + const resolved = await this.context.engine.resolveDescriptor(descriptor, { allowTags: true, useCache: false }); + if (resolved === null) + throw new UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); + this.context.stdout.write(`Adding ${resolved.name}@${resolved.reference} to the cache... +`); + const packageManagerInfo = await this.context.engine.ensurePackageManager(resolved); + await this.context.engine.activatePackageManager(packageManagerInfo.locator); + installLocations.push(packageManagerInfo.location); + } + const baseInstallFolder = getInstallFolder(); + const outputPath = import_path11.default.resolve(this.context.cwd, this.output ?? `corepack.tgz`); + if (!this.json) { + this.context.stdout.write(` +`); + this.context.stdout.write(`Packing the selected tools in ${import_path11.default.basename(outputPath)}... +`); + } + const { create: tarC } = await Promise.resolve().then(() => (init_create(), create_exports)); + await (0, import_promises3.mkdir)(baseInstallFolder, { recursive: true }); + await tarC({ gzip: true, cwd: baseInstallFolder, file: import_path11.default.resolve(outputPath) }, installLocations.map((location) => { + return import_path11.default.relative(baseInstallFolder, location); + })); + if (this.json) { + this.context.stdout.write(`${JSON.stringify(outputPath)} +`); + } else { + this.context.stdout.write(`All done! +`); + } + } +}; + +// sources/commands/Up.ts +var import_major = __toESM(require_major()); +var import_valid5 = __toESM(require_valid()); +var import_valid6 = __toESM(require_valid2()); +var UpCommand = class extends BaseCommand { + static paths = [ + [`up`] + ]; + static usage = Command.Usage({ + description: `Update the package manager used in the current project`, + details: ` + Retrieve the latest available version for the current major release line + of the package manager used in the local project, and update the project + to use it. + + Unlike \`corepack use\` this command doesn't take a package manager name + nor a version range, as it will always select the latest available + version from the same major line. Should you need to upgrade to a new + major, use an explicit \`corepack use '{name}@*'\` call. + `, + examples: [[ + `Configure the project to use the latest Yarn release`, + `corepack up` + ]] + }); + async execute() { + const [descriptor] = await this.resolvePatternsToDescriptors({ + patterns: [] + }); + if (!(0, import_valid5.default)(descriptor.range) && !(0, import_valid6.default)(descriptor.range)) + throw new UsageError(`The 'corepack up' command can only be used when your project's packageManager field is set to a semver version or semver range`); + const resolved = await this.context.engine.resolveDescriptor(descriptor, { useCache: false }); + if (!resolved) + throw new UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); + const majorVersion = (0, import_major.default)(resolved.reference); + const majorDescriptor = { name: descriptor.name, range: `^${majorVersion}.0.0` }; + const highestVersion = await this.context.engine.resolveDescriptor(majorDescriptor, { useCache: false }); + if (!highestVersion) + throw new UsageError(`Failed to find the highest release for ${descriptor.name} ${majorVersion}.x`); + this.context.stdout.write(`Installing ${highestVersion.name}@${highestVersion.reference} in the project... +`); + const packageManagerInfo = await this.context.engine.ensurePackageManager(highestVersion); + await this.setAndInstallLocalPackageManager(packageManagerInfo); + } +}; + +// sources/commands/Use.ts +var UseCommand = class extends BaseCommand { + static paths = [ + [`use`] + ]; + static usage = Command.Usage({ + description: `Define the package manager to use for the current project`, + details: ` + When run, this command will retrieve the latest release matching the + provided descriptor, assign it to the project's package.json file, and + automatically perform an install. + `, + examples: [[ + `Configure the project to use the latest Yarn release`, + `corepack use yarn` + ]] + }); + pattern = options_exports.String(); + async execute() { + const [descriptor] = await this.resolvePatternsToDescriptors({ + patterns: [this.pattern] + }); + const resolved = await this.context.engine.resolveDescriptor(descriptor, { allowTags: true, useCache: false }); + if (resolved === null) + throw new UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); + this.context.stdout.write(`Installing ${resolved.name}@${resolved.reference} in the project... +`); + const packageManagerInfo = await this.context.engine.ensurePackageManager(resolved); + await this.setAndInstallLocalPackageManager(packageManagerInfo); + } +}; + +// sources/commands/deprecated/Hydrate.ts +var import_promises4 = require("fs/promises"); +var import_path12 = __toESM(require("path")); +var HydrateCommand = class extends Command { + static paths = [ + [`hydrate`] + ]; + activate = options_exports.Boolean(`--activate`, false, { + description: `If true, this release will become the default one for this package manager` + }); + fileName = options_exports.String(); + async execute() { + const installFolder = getInstallFolder(); + const fileName = import_path12.default.resolve(this.context.cwd, this.fileName); + const archiveEntries = /* @__PURE__ */ new Map(); + let hasShortEntries = false; + const { list: tarT } = await Promise.resolve().then(() => (init_list(), list_exports)); + await tarT({ file: fileName, onentry: (entry) => { + const segments = entry.path.split(/\//g); + if (segments.length < 3) { + hasShortEntries = true; + } else { + let references = archiveEntries.get(segments[0]); + if (typeof references === `undefined`) + archiveEntries.set(segments[0], references = /* @__PURE__ */ new Set()); + references.add(segments[1]); + } + } }); + if (hasShortEntries || archiveEntries.size < 1) + throw new UsageError(`Invalid archive format; did it get generated by 'corepack prepare'?`); + const { extract: tarX } = await Promise.resolve().then(() => (init_extract(), extract_exports)); + for (const [name2, references] of archiveEntries) { + for (const reference of references) { + if (!isSupportedPackageManager(name2)) + throw new UsageError(`Unsupported package manager '${name2}'`); + if (this.activate) + this.context.stdout.write(`Hydrating ${name2}@${reference} for immediate activation... +`); + else + this.context.stdout.write(`Hydrating ${name2}@${reference}... +`); + await (0, import_promises4.mkdir)(installFolder, { recursive: true }); + await tarX({ file: fileName, cwd: installFolder }, [`${name2}/${reference}`]); + if (this.activate) { + await this.context.engine.activatePackageManager({ name: name2, reference }); + } + } + } + this.context.stdout.write(`All done! +`); + } +}; + +// sources/commands/deprecated/Prepare.ts +var import_promises5 = require("fs/promises"); +var import_path13 = __toESM(require("path")); +var PrepareCommand = class extends Command { + static paths = [ + [`prepare`] + ]; + activate = options_exports.Boolean(`--activate`, false, { + description: `If true, this release will become the default one for this package manager` + }); + json = options_exports.Boolean(`--json`, false, { + description: `If true, the output will be the path of the generated tarball` + }); + output = options_exports.String(`-o,--output`, { + description: `If true, the installed package managers will also be stored in a tarball`, + tolerateBoolean: true + }); + specs = options_exports.Rest(); + async execute() { + const specs = this.specs; + const installLocations = []; + if (specs.length === 0) { + const lookup = await loadSpec(this.context.cwd); + switch (lookup.type) { + case `NoProject`: + throw new UsageError(`Couldn't find a project in the local directory - please specify the package manager to pack, or run this command from a valid project`); + case `NoSpec`: + throw new UsageError(`The local project doesn't feature a 'packageManager' field - please specify the package manager to pack, or update the manifest to reference it`); + default: { + specs.push(lookup.getSpec()); + } + } + } + for (const request of specs) { + const spec = typeof request === `string` ? parseSpec(request, `CLI arguments`, { enforceExactVersion: false }) : request; + const resolved = await this.context.engine.resolveDescriptor(spec, { allowTags: true }); + if (resolved === null) + throw new UsageError(`Failed to successfully resolve '${spec.range}' to a valid ${spec.name} release`); + if (!this.json) { + if (this.activate) { + this.context.stdout.write(`Preparing ${spec.name}@${spec.range} for immediate activation... +`); + } else { + this.context.stdout.write(`Preparing ${spec.name}@${spec.range}... +`); + } + } + const installSpec = await this.context.engine.ensurePackageManager(resolved); + installLocations.push(installSpec.location); + if (this.activate) { + await this.context.engine.activatePackageManager(resolved); + } + } + if (this.output) { + const outputName = typeof this.output === `string` ? this.output : `corepack.tgz`; + const baseInstallFolder = getInstallFolder(); + const outputPath = import_path13.default.resolve(this.context.cwd, outputName); + if (!this.json) + this.context.stdout.write(`Packing the selected tools in ${import_path13.default.basename(outputPath)}... +`); + const { create: tarC } = await Promise.resolve().then(() => (init_create(), create_exports)); + await (0, import_promises5.mkdir)(baseInstallFolder, { recursive: true }); + await tarC({ gzip: true, cwd: baseInstallFolder, file: import_path13.default.resolve(outputPath) }, installLocations.map((location) => { + return import_path13.default.relative(baseInstallFolder, location); + })); + if (this.json) { + this.context.stdout.write(`${JSON.stringify(outputPath)} +`); + } else { + this.context.stdout.write(`All done! +`); + } + } + } +}; + +// sources/main.ts +function getPackageManagerRequestFromCli(parameter, engine) { + if (!parameter) + return null; + const match = parameter.match(/^([^@]*)(?:@(.*))?$/); + if (!match) + return null; + const [, binaryName, binaryVersion] = match; + const packageManager = engine.getPackageManagerFor(binaryName); + if (packageManager == null && binaryVersion == null) return null; + return { + packageManager, + binaryName, + binaryVersion: binaryVersion || null + }; +} +function isUsageError(error) { + return error?.name === `UsageError`; +} +async function runMain(argv) { + const engine = new Engine(); + const [firstArg, ...restArgs] = argv; + const request = getPackageManagerRequestFromCli(firstArg, engine); + if (!request) { + const cli = new Cli({ + binaryLabel: `Corepack`, + binaryName: `corepack`, + binaryVersion: version + }); + cli.register(builtins_exports.HelpCommand); + cli.register(builtins_exports.VersionCommand); + cli.register(CacheCommand); + cli.register(DisableCommand); + cli.register(EnableCommand); + cli.register(InstallGlobalCommand); + cli.register(InstallLocalCommand); + cli.register(PackCommand); + cli.register(UpCommand); + cli.register(UseCommand); + cli.register(HydrateCommand); + cli.register(PrepareCommand); + const context = { + ...Cli.defaultContext, + cwd: process.cwd(), + engine + }; + const code2 = await cli.run(argv, context); + if (code2 !== 0) { + process.exitCode ??= code2; + } + } else { + try { + await engine.executePackageManagerRequest(request, { + cwd: process.cwd(), + args: restArgs + }); + } catch (error) { + if (isUsageError(error)) { + console.error(error.message); + process.exit(1); + } + throw error; + } + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + runMain +}); +/*! Bundled license information: + +undici/lib/web/fetch/body.js: + (*! formdata-polyfill. MIT License. Jimmy Wärting *) + +is-windows/index.js: + (*! + * is-windows + * + * Copyright © 2015-2018, Jon Schlinkert. + * Released under the MIT License. + *) +*/ diff --git a/node24/node_modules/corepack/dist/npm.js b/node24/node_modules/corepack/dist/npm.js new file mode 100644 index 0000000000000000000000000000000000000000..8035fae8bd96d3ab32e504b348c74b32fe52a781 --- /dev/null +++ b/node24/node_modules/corepack/dist/npm.js @@ -0,0 +1,4 @@ +#!/usr/bin/env node +process.env.COREPACK_ENABLE_DOWNLOAD_PROMPT??='1' +require('module').enableCompileCache?.(); +require('./lib/corepack.cjs').runMain(['npm', ...process.argv.slice(2)]); \ No newline at end of file diff --git a/node24/node_modules/corepack/dist/npx.js b/node24/node_modules/corepack/dist/npx.js new file mode 100644 index 0000000000000000000000000000000000000000..ae39cfc626e487c4b85d55b1ec91968a08ead102 --- /dev/null +++ b/node24/node_modules/corepack/dist/npx.js @@ -0,0 +1,4 @@ +#!/usr/bin/env node +process.env.COREPACK_ENABLE_DOWNLOAD_PROMPT??='1' +require('module').enableCompileCache?.(); +require('./lib/corepack.cjs').runMain(['npx', ...process.argv.slice(2)]); \ No newline at end of file diff --git a/node24/node_modules/corepack/dist/pnpm.js b/node24/node_modules/corepack/dist/pnpm.js new file mode 100644 index 0000000000000000000000000000000000000000..82df79884e17c218e8094923eb8f66bb513e4768 --- /dev/null +++ b/node24/node_modules/corepack/dist/pnpm.js @@ -0,0 +1,4 @@ +#!/usr/bin/env node +process.env.COREPACK_ENABLE_DOWNLOAD_PROMPT??='1' +require('module').enableCompileCache?.(); +require('./lib/corepack.cjs').runMain(['pnpm', ...process.argv.slice(2)]); \ No newline at end of file diff --git a/node24/node_modules/corepack/dist/pnpx.js b/node24/node_modules/corepack/dist/pnpx.js new file mode 100644 index 0000000000000000000000000000000000000000..2354763c6d663b01c42002c7f6af3188f460f761 --- /dev/null +++ b/node24/node_modules/corepack/dist/pnpx.js @@ -0,0 +1,4 @@ +#!/usr/bin/env node +process.env.COREPACK_ENABLE_DOWNLOAD_PROMPT??='1' +require('module').enableCompileCache?.(); +require('./lib/corepack.cjs').runMain(['pnpx', ...process.argv.slice(2)]); \ No newline at end of file diff --git a/node24/node_modules/corepack/dist/yarn.js b/node24/node_modules/corepack/dist/yarn.js new file mode 100644 index 0000000000000000000000000000000000000000..22f6cd18c8feda6f6f4064189dc008ceef975a64 --- /dev/null +++ b/node24/node_modules/corepack/dist/yarn.js @@ -0,0 +1,4 @@ +#!/usr/bin/env node +process.env.COREPACK_ENABLE_DOWNLOAD_PROMPT??='1' +require('module').enableCompileCache?.(); +require('./lib/corepack.cjs').runMain(['yarn', ...process.argv.slice(2)]); \ No newline at end of file diff --git a/node24/node_modules/corepack/dist/yarnpkg.js b/node24/node_modules/corepack/dist/yarnpkg.js new file mode 100644 index 0000000000000000000000000000000000000000..a9ff171f7aca24c3a9c651bd5df6bcd09fab76e6 --- /dev/null +++ b/node24/node_modules/corepack/dist/yarnpkg.js @@ -0,0 +1,4 @@ +#!/usr/bin/env node +process.env.COREPACK_ENABLE_DOWNLOAD_PROMPT??='1' +require('module').enableCompileCache?.(); +require('./lib/corepack.cjs').runMain(['yarnpkg', ...process.argv.slice(2)]); \ No newline at end of file diff --git a/node24/node_modules/corepack/shims/corepack b/node24/node_modules/corepack/shims/corepack new file mode 100644 index 0000000000000000000000000000000000000000..cc65902585b8543ba05fcd518d74b8c216194c95 --- /dev/null +++ b/node24/node_modules/corepack/shims/corepack @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../dist/corepack.js" "$@" +else + exec node "$basedir/../dist/corepack.js" "$@" +fi diff --git a/node24/node_modules/corepack/shims/corepack.cmd b/node24/node_modules/corepack/shims/corepack.cmd new file mode 100644 index 0000000000000000000000000000000000000000..79a51d5eb7d4fb3631192cbb91ffce57f8d6a27c --- /dev/null +++ b/node24/node_modules/corepack/shims/corepack.cmd @@ -0,0 +1,7 @@ +@SETLOCAL +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\dist\corepack.js" %* +) ELSE ( + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\dist\corepack.js" %* +) diff --git a/node24/node_modules/corepack/shims/corepack.ps1 b/node24/node_modules/corepack/shims/corepack.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..8c4eaa561103b509e4350434e971c1c2f2e80938 --- /dev/null +++ b/node24/node_modules/corepack/shims/corepack.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../dist/corepack.js" $args + } else { + & "$basedir/node$exe" "$basedir/../dist/corepack.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../dist/corepack.js" $args + } else { + & "node$exe" "$basedir/../dist/corepack.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node24/node_modules/corepack/shims/nodewin/corepack b/node24/node_modules/corepack/shims/nodewin/corepack new file mode 100644 index 0000000000000000000000000000000000000000..8ad47d30f8af2404cc60b5b68686d24e16d5dd08 --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/corepack @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/node_modules/corepack/dist/corepack.js" "$@" +else + exec node "$basedir/node_modules/corepack/dist/corepack.js" "$@" +fi diff --git a/node24/node_modules/corepack/shims/nodewin/corepack.cmd b/node24/node_modules/corepack/shims/nodewin/corepack.cmd new file mode 100644 index 0000000000000000000000000000000000000000..6e2e1b7de7f71569a420df8141d19be5cdcbc08d --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/corepack.cmd @@ -0,0 +1,7 @@ +@SETLOCAL +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\node_modules\corepack\dist\corepack.js" %* +) ELSE ( + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\node_modules\corepack\dist\corepack.js" %* +) diff --git a/node24/node_modules/corepack/shims/nodewin/corepack.ps1 b/node24/node_modules/corepack/shims/nodewin/corepack.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..19d2a081b34161bccfbfa74c25abba31c3fdd3a2 --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/corepack.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/corepack.js" $args + } else { + & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/corepack.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/node_modules/corepack/dist/corepack.js" $args + } else { + & "node$exe" "$basedir/node_modules/corepack/dist/corepack.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node24/node_modules/corepack/shims/nodewin/npm b/node24/node_modules/corepack/shims/nodewin/npm new file mode 100644 index 0000000000000000000000000000000000000000..9aa2b14b81678ac85d28ed56598f84220fa62a31 --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/npm @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/node_modules/corepack/dist/npm.js" "$@" +else + exec node "$basedir/node_modules/corepack/dist/npm.js" "$@" +fi diff --git a/node24/node_modules/corepack/shims/nodewin/npm.cmd b/node24/node_modules/corepack/shims/nodewin/npm.cmd new file mode 100644 index 0000000000000000000000000000000000000000..b84f335345e149e81b7dde059a77b873308e3333 --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/npm.cmd @@ -0,0 +1,7 @@ +@SETLOCAL +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\node_modules\corepack\dist\npm.js" %* +) ELSE ( + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\node_modules\corepack\dist\npm.js" %* +) diff --git a/node24/node_modules/corepack/shims/nodewin/npm.ps1 b/node24/node_modules/corepack/shims/nodewin/npm.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..b7fdd6a6bbb7b359c56b4a5f13df3f85522ed5f7 --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/npm.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/npm.js" $args + } else { + & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/npm.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/node_modules/corepack/dist/npm.js" $args + } else { + & "node$exe" "$basedir/node_modules/corepack/dist/npm.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node24/node_modules/corepack/shims/nodewin/npx b/node24/node_modules/corepack/shims/nodewin/npx new file mode 100644 index 0000000000000000000000000000000000000000..3d66aa0f7685e08d5f66e77c6e9870329fb6be5b --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/npx @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/node_modules/corepack/dist/npx.js" "$@" +else + exec node "$basedir/node_modules/corepack/dist/npx.js" "$@" +fi diff --git a/node24/node_modules/corepack/shims/nodewin/npx.cmd b/node24/node_modules/corepack/shims/nodewin/npx.cmd new file mode 100644 index 0000000000000000000000000000000000000000..9c58097e7d791a43fdbf7658389837809483e00a --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/npx.cmd @@ -0,0 +1,7 @@ +@SETLOCAL +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\node_modules\corepack\dist\npx.js" %* +) ELSE ( + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\node_modules\corepack\dist\npx.js" %* +) diff --git a/node24/node_modules/corepack/shims/nodewin/npx.ps1 b/node24/node_modules/corepack/shims/nodewin/npx.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..04b8876ab13fbe533b1391b8dc7d1df3c1810f6c --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/npx.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/npx.js" $args + } else { + & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/npx.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/node_modules/corepack/dist/npx.js" $args + } else { + & "node$exe" "$basedir/node_modules/corepack/dist/npx.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node24/node_modules/corepack/shims/nodewin/pnpm b/node24/node_modules/corepack/shims/nodewin/pnpm new file mode 100644 index 0000000000000000000000000000000000000000..e143819d98fa1e945f8c5963d00859f232325b8e --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/pnpm @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/node_modules/corepack/dist/pnpm.js" "$@" +else + exec node "$basedir/node_modules/corepack/dist/pnpm.js" "$@" +fi diff --git a/node24/node_modules/corepack/shims/nodewin/pnpm.cmd b/node24/node_modules/corepack/shims/nodewin/pnpm.cmd new file mode 100644 index 0000000000000000000000000000000000000000..2eaa074dc9afc1fcc619840931ac160a9137d448 --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/pnpm.cmd @@ -0,0 +1,7 @@ +@SETLOCAL +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\node_modules\corepack\dist\pnpm.js" %* +) ELSE ( + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\node_modules\corepack\dist\pnpm.js" %* +) diff --git a/node24/node_modules/corepack/shims/nodewin/pnpm.ps1 b/node24/node_modules/corepack/shims/nodewin/pnpm.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..387eb538edb4fbb44075787b9b1d8ab3234480ef --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/pnpm.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/pnpm.js" $args + } else { + & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/pnpm.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/node_modules/corepack/dist/pnpm.js" $args + } else { + & "node$exe" "$basedir/node_modules/corepack/dist/pnpm.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node24/node_modules/corepack/shims/nodewin/pnpx b/node24/node_modules/corepack/shims/nodewin/pnpx new file mode 100644 index 0000000000000000000000000000000000000000..6bce2dcc866252218fa09c063cd3c8fff163af83 --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/pnpx @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/node_modules/corepack/dist/pnpx.js" "$@" +else + exec node "$basedir/node_modules/corepack/dist/pnpx.js" "$@" +fi diff --git a/node24/node_modules/corepack/shims/nodewin/pnpx.cmd b/node24/node_modules/corepack/shims/nodewin/pnpx.cmd new file mode 100644 index 0000000000000000000000000000000000000000..1da3b1b7bccfcd741ecf890086350321c05b7008 --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/pnpx.cmd @@ -0,0 +1,7 @@ +@SETLOCAL +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\node_modules\corepack\dist\pnpx.js" %* +) ELSE ( + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\node_modules\corepack\dist\pnpx.js" %* +) diff --git a/node24/node_modules/corepack/shims/nodewin/pnpx.ps1 b/node24/node_modules/corepack/shims/nodewin/pnpx.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..bbba7b232e89c84d48cfdd30422be7b365eb679f --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/pnpx.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/pnpx.js" $args + } else { + & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/pnpx.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/node_modules/corepack/dist/pnpx.js" $args + } else { + & "node$exe" "$basedir/node_modules/corepack/dist/pnpx.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node24/node_modules/corepack/shims/nodewin/yarn b/node24/node_modules/corepack/shims/nodewin/yarn new file mode 100644 index 0000000000000000000000000000000000000000..061ca0b3ecd39d3fe055d9733041bba73ab73081 --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/yarn @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/node_modules/corepack/dist/yarn.js" "$@" +else + exec node "$basedir/node_modules/corepack/dist/yarn.js" "$@" +fi diff --git a/node24/node_modules/corepack/shims/nodewin/yarn.cmd b/node24/node_modules/corepack/shims/nodewin/yarn.cmd new file mode 100644 index 0000000000000000000000000000000000000000..31b2426655675a738f09d42d96b8d3f9b5c110fe --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/yarn.cmd @@ -0,0 +1,7 @@ +@SETLOCAL +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\node_modules\corepack\dist\yarn.js" %* +) ELSE ( + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\node_modules\corepack\dist\yarn.js" %* +) diff --git a/node24/node_modules/corepack/shims/nodewin/yarn.ps1 b/node24/node_modules/corepack/shims/nodewin/yarn.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..b64e302cc156808b7597c0793666618143ee548a --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/yarn.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/yarn.js" $args + } else { + & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/yarn.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/node_modules/corepack/dist/yarn.js" $args + } else { + & "node$exe" "$basedir/node_modules/corepack/dist/yarn.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node24/node_modules/corepack/shims/nodewin/yarnpkg b/node24/node_modules/corepack/shims/nodewin/yarnpkg new file mode 100644 index 0000000000000000000000000000000000000000..5c8283daf19b687a610564ac111437594ac18484 --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/yarnpkg @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/node_modules/corepack/dist/yarnpkg.js" "$@" +else + exec node "$basedir/node_modules/corepack/dist/yarnpkg.js" "$@" +fi diff --git a/node24/node_modules/corepack/shims/nodewin/yarnpkg.cmd b/node24/node_modules/corepack/shims/nodewin/yarnpkg.cmd new file mode 100644 index 0000000000000000000000000000000000000000..d490dbb6469b65969f2bb61e9e7bdcf76181c21c --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/yarnpkg.cmd @@ -0,0 +1,7 @@ +@SETLOCAL +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\node_modules\corepack\dist\yarnpkg.js" %* +) ELSE ( + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\node_modules\corepack\dist\yarnpkg.js" %* +) diff --git a/node24/node_modules/corepack/shims/nodewin/yarnpkg.ps1 b/node24/node_modules/corepack/shims/nodewin/yarnpkg.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..337f102d18daa051af2f2c0b12c0e63c56785d39 --- /dev/null +++ b/node24/node_modules/corepack/shims/nodewin/yarnpkg.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/yarnpkg.js" $args + } else { + & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/yarnpkg.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/node_modules/corepack/dist/yarnpkg.js" $args + } else { + & "node$exe" "$basedir/node_modules/corepack/dist/yarnpkg.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node24/node_modules/corepack/shims/npm b/node24/node_modules/corepack/shims/npm new file mode 100644 index 0000000000000000000000000000000000000000..447881559eec94bc5fe9477deea28b84abd1940c --- /dev/null +++ b/node24/node_modules/corepack/shims/npm @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../dist/npm.js" "$@" +else + exec node "$basedir/../dist/npm.js" "$@" +fi diff --git a/node24/node_modules/corepack/shims/npm.cmd b/node24/node_modules/corepack/shims/npm.cmd new file mode 100644 index 0000000000000000000000000000000000000000..5df57499710322cc67a2c601b8bf26cea0c4ac8b --- /dev/null +++ b/node24/node_modules/corepack/shims/npm.cmd @@ -0,0 +1,7 @@ +@SETLOCAL +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\dist\npm.js" %* +) ELSE ( + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\dist\npm.js" %* +) diff --git a/node24/node_modules/corepack/shims/npm.ps1 b/node24/node_modules/corepack/shims/npm.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..eed985044771cb8cbbdbd61be48f6a20b2d5f046 --- /dev/null +++ b/node24/node_modules/corepack/shims/npm.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../dist/npm.js" $args + } else { + & "$basedir/node$exe" "$basedir/../dist/npm.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../dist/npm.js" $args + } else { + & "node$exe" "$basedir/../dist/npm.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node24/node_modules/corepack/shims/npx b/node24/node_modules/corepack/shims/npx new file mode 100644 index 0000000000000000000000000000000000000000..da101c94701d13e993fcc91b9714887252ce4c7b --- /dev/null +++ b/node24/node_modules/corepack/shims/npx @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../dist/npx.js" "$@" +else + exec node "$basedir/../dist/npx.js" "$@" +fi diff --git a/node24/node_modules/corepack/shims/npx.cmd b/node24/node_modules/corepack/shims/npx.cmd new file mode 100644 index 0000000000000000000000000000000000000000..c5da4edb2f3953ebb0310c5c7b4cd791c4e0c8b3 --- /dev/null +++ b/node24/node_modules/corepack/shims/npx.cmd @@ -0,0 +1,7 @@ +@SETLOCAL +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\dist\npx.js" %* +) ELSE ( + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\dist\npx.js" %* +) diff --git a/node24/node_modules/corepack/shims/npx.ps1 b/node24/node_modules/corepack/shims/npx.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..71412764b17865a7a494be5cdff87ac769cc183c --- /dev/null +++ b/node24/node_modules/corepack/shims/npx.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../dist/npx.js" $args + } else { + & "$basedir/node$exe" "$basedir/../dist/npx.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../dist/npx.js" $args + } else { + & "node$exe" "$basedir/../dist/npx.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node24/node_modules/corepack/shims/pnpm b/node24/node_modules/corepack/shims/pnpm new file mode 100644 index 0000000000000000000000000000000000000000..8e6b662cb3223de4a058f33753d6f1050d02b36d --- /dev/null +++ b/node24/node_modules/corepack/shims/pnpm @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../dist/pnpm.js" "$@" +else + exec node "$basedir/../dist/pnpm.js" "$@" +fi diff --git a/node24/node_modules/corepack/shims/pnpm.cmd b/node24/node_modules/corepack/shims/pnpm.cmd new file mode 100644 index 0000000000000000000000000000000000000000..3a39baa15f1edde02c34b3605096b30c8a13646a --- /dev/null +++ b/node24/node_modules/corepack/shims/pnpm.cmd @@ -0,0 +1,7 @@ +@SETLOCAL +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\dist\pnpm.js" %* +) ELSE ( + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\dist\pnpm.js" %* +) diff --git a/node24/node_modules/corepack/shims/pnpm.ps1 b/node24/node_modules/corepack/shims/pnpm.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..4c90f2acdb66ccabf05a9a8b91716475b9f79389 --- /dev/null +++ b/node24/node_modules/corepack/shims/pnpm.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../dist/pnpm.js" $args + } else { + & "$basedir/node$exe" "$basedir/../dist/pnpm.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../dist/pnpm.js" $args + } else { + & "node$exe" "$basedir/../dist/pnpm.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node24/node_modules/corepack/shims/pnpx b/node24/node_modules/corepack/shims/pnpx new file mode 100644 index 0000000000000000000000000000000000000000..2d229e52aa2997d9be2fcc5159098d323a11647e --- /dev/null +++ b/node24/node_modules/corepack/shims/pnpx @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../dist/pnpx.js" "$@" +else + exec node "$basedir/../dist/pnpx.js" "$@" +fi diff --git a/node24/node_modules/corepack/shims/pnpx.cmd b/node24/node_modules/corepack/shims/pnpx.cmd new file mode 100644 index 0000000000000000000000000000000000000000..ec45e6af81bb88646c3a97cabc974120e71f2db3 --- /dev/null +++ b/node24/node_modules/corepack/shims/pnpx.cmd @@ -0,0 +1,7 @@ +@SETLOCAL +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\dist\pnpx.js" %* +) ELSE ( + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\dist\pnpx.js" %* +) diff --git a/node24/node_modules/corepack/shims/pnpx.ps1 b/node24/node_modules/corepack/shims/pnpx.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..597873ec3105c38696705f24e9043a47d0a9d9a1 --- /dev/null +++ b/node24/node_modules/corepack/shims/pnpx.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../dist/pnpx.js" $args + } else { + & "$basedir/node$exe" "$basedir/../dist/pnpx.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../dist/pnpx.js" $args + } else { + & "node$exe" "$basedir/../dist/pnpx.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node24/node_modules/corepack/shims/yarn b/node24/node_modules/corepack/shims/yarn new file mode 100644 index 0000000000000000000000000000000000000000..639a5a90ce3cac93610a9200bff61ddcdc0beab3 --- /dev/null +++ b/node24/node_modules/corepack/shims/yarn @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../dist/yarn.js" "$@" +else + exec node "$basedir/../dist/yarn.js" "$@" +fi diff --git a/node24/node_modules/corepack/shims/yarn.cmd b/node24/node_modules/corepack/shims/yarn.cmd new file mode 100644 index 0000000000000000000000000000000000000000..e35cb92663d524220d6bf43c3590755be1137867 --- /dev/null +++ b/node24/node_modules/corepack/shims/yarn.cmd @@ -0,0 +1,7 @@ +@SETLOCAL +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\dist\yarn.js" %* +) ELSE ( + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\dist\yarn.js" %* +) diff --git a/node24/node_modules/corepack/shims/yarn.ps1 b/node24/node_modules/corepack/shims/yarn.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..41f739196b5b97dacd95b6d92f2d882b8431fe71 --- /dev/null +++ b/node24/node_modules/corepack/shims/yarn.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../dist/yarn.js" $args + } else { + & "$basedir/node$exe" "$basedir/../dist/yarn.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../dist/yarn.js" $args + } else { + & "node$exe" "$basedir/../dist/yarn.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node24/node_modules/corepack/shims/yarnpkg b/node24/node_modules/corepack/shims/yarnpkg new file mode 100644 index 0000000000000000000000000000000000000000..3bc1a133c750648e13005fa1e875d9c3cb9ae151 --- /dev/null +++ b/node24/node_modules/corepack/shims/yarnpkg @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../dist/yarnpkg.js" "$@" +else + exec node "$basedir/../dist/yarnpkg.js" "$@" +fi diff --git a/node24/node_modules/corepack/shims/yarnpkg.cmd b/node24/node_modules/corepack/shims/yarnpkg.cmd new file mode 100644 index 0000000000000000000000000000000000000000..1d369bb5a14c2c948b3e94c75e49e80fb3a4fc87 --- /dev/null +++ b/node24/node_modules/corepack/shims/yarnpkg.cmd @@ -0,0 +1,7 @@ +@SETLOCAL +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\dist\yarnpkg.js" %* +) ELSE ( + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\dist\yarnpkg.js" %* +) diff --git a/node24/node_modules/corepack/shims/yarnpkg.ps1 b/node24/node_modules/corepack/shims/yarnpkg.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..97931ea7e4225d73abcc3954dcc25c9b5d7c8dbb --- /dev/null +++ b/node24/node_modules/corepack/shims/yarnpkg.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../dist/yarnpkg.js" $args + } else { + & "$basedir/node$exe" "$basedir/../dist/yarnpkg.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../dist/yarnpkg.js" $args + } else { + & "node$exe" "$basedir/../dist/yarnpkg.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node24/node_modules/npm/bin/node-gyp-bin/node-gyp b/node24/node_modules/npm/bin/node-gyp-bin/node-gyp new file mode 100644 index 0000000000000000000000000000000000000000..640ac1a85ad19b6ca2b187a2490be56e9aa96f90 --- /dev/null +++ b/node24/node_modules/npm/bin/node-gyp-bin/node-gyp @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +if [ "x$npm_config_node_gyp" = "x" ]; then + node "`dirname "$0"`/../../node_modules/node-gyp/bin/node-gyp.js" "$@" +else + "$npm_config_node_gyp" "$@" +fi diff --git a/node24/node_modules/npm/bin/node-gyp-bin/node-gyp.cmd b/node24/node_modules/npm/bin/node-gyp-bin/node-gyp.cmd new file mode 100644 index 0000000000000000000000000000000000000000..6816e5bfe44324c3defca536f01b6e8aa3052473 --- /dev/null +++ b/node24/node_modules/npm/bin/node-gyp-bin/node-gyp.cmd @@ -0,0 +1,5 @@ +if not defined npm_config_node_gyp ( + node "%~dp0\..\..\node_modules\node-gyp\bin\node-gyp.js" %* +) else ( + node "%npm_config_node_gyp%" %* +) diff --git a/node24/node_modules/npm/docs/content/commands/npm-access.md b/node24/node_modules/npm/docs/content/commands/npm-access.md new file mode 100644 index 0000000000000000000000000000000000000000..08baad7c24a90d3dbd69e11cbd4bcbfc79558ca8 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-access.md @@ -0,0 +1,95 @@ +--- +title: npm-access +section: 1 +description: Set access level on published packages +--- + +### Synopsis + +```bash +npm access list packages [||] [] +npm access list collaborators [ []] +npm access get status [] +npm access set status=public|private [] +npm access set mfa=none|publish|automation [] +npm access grant [] +npm access revoke [] +``` + +Note: This command is unaware of workspaces. + +### Description + +Used to set access controls on private packages. + +For all of the subcommands, `npm access` will perform actions on the packages in the current working directory if no package name is passed to the subcommand. + +* grant / revoke: + Add or remove the ability of users and teams to have read-only or read-write access to a package. + +### Details + +`npm access` always operates directly on the current registry, configurable from the command line using `--registry=`. + +Unscoped packages are *always public*. + +Scoped packages *default to restricted*, but you can either publish them as public using `npm publish --access=public`, or set their access as public using `npm access set status=public` after the initial publish. + +You must have privileges to set the access of a package: + +* You are an owner of an unscoped or scoped package. +* You are a member of the team that owns a scope. +* You have been given read-write privileges for a package, either as a member of a team or directly as an owner. + +If you have two-factor authentication enabled then you'll be prompted to provide a second factor, or may use the `--otp=...` option to specify it on the command line. + +If your account is not paid, then attempts to publish scoped packages will fail with an HTTP 402 status code (logically enough), unless you use +`--access=public`. + +Management of teams and team memberships is done with the `npm team` command. + +### Configuration + +#### `json` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. + + + +#### `otp` + +* Default: null +* Type: null or String + +This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with `npm access`. + +If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one. + + + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +### See Also + +* [`libnpmaccess`](https://npm.im/libnpmaccess) +* [npm team](/commands/npm-team) +* [npm publish](/commands/npm-publish) +* [npm config](/commands/npm-config) +* [npm registry](/using-npm/registry) diff --git a/node24/node_modules/npm/docs/content/commands/npm-adduser.md b/node24/node_modules/npm/docs/content/commands/npm-adduser.md new file mode 100644 index 0000000000000000000000000000000000000000..158406fd6149270d99642a8a41b59f6221c22ac9 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-adduser.md @@ -0,0 +1,87 @@ +--- +title: npm-adduser +section: 1 +description: Add a registry user account +--- + +### Synopsis + +```bash +npm adduser + +alias: add-user +``` + +Note: This command is unaware of workspaces. + +### Description + +Create a new user in the specified registry, and save the credentials to the `.npmrc` file. +If no registry is specified, the default registry will be used (see [`registry`](/using-npm/registry)). + +When you run `npm adduser`, the CLI automatically generates a legacy token of `publish` type. +For more information, see [About legacy tokens](/about-access-tokens#about-legacy-tokens). + +When using `legacy` for your `auth-type`, the username, password, and email are read in from prompts. + +### Configuration + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +#### `scope` + +* Default: the scope of the current project, if any, or "" +* Type: String + +Associate an operation with a scope for a scoped registry. + +Useful when logging in to or out of a private registry: + +``` +# log in, linking the scope to the custom registry +npm login --scope=@mycorp --registry=https://registry.mycorp.com + +# log out, removing the link and the auth token +npm logout --scope=@mycorp +``` + +This will cause `@mycorp` to be mapped to the registry for future +installation of packages specified according to the pattern +`@mycorp/package`. + +This will also cause `npm init` to create a scoped package. + +``` +# accept all defaults, and create a package named "@foo/whatever", +# instead of just named "whatever" +npm init --scope=@foo --yes +``` + + + +#### `auth-type` + +* Default: "web" +* Type: "legacy" or "web" + +What authentication strategy to use with `login`. Note that if an `otp` +config is given, this value will always be set to `legacy`. + + + +### See Also + +* [npm registry](/using-npm/registry) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [npm owner](/commands/npm-owner) +* [npm whoami](/commands/npm-whoami) +* [npm token](/commands/npm-token) +* [npm profile](/commands/npm-profile) diff --git a/node24/node_modules/npm/docs/content/commands/npm-audit.md b/node24/node_modules/npm/docs/content/commands/npm-audit.md new file mode 100644 index 0000000000000000000000000000000000000000..431d12af861c26d544d8418b68b806deca4b8e80 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-audit.md @@ -0,0 +1,449 @@ +--- +title: npm-audit +section: 1 +description: Run a security audit +--- + +### Synopsis + +```bash +npm audit [fix|signatures] +``` + +### Description + +The audit command submits a description of the dependencies configured in your project to your default registry and asks for a report of known vulnerabilities. +If any vulnerabilities are found, then the impact and appropriate remediation will be calculated. +If the `fix` argument is provided, then remediations will be applied to the package tree. + +The command will exit with a 0 exit code if no vulnerabilities were found. + +Note that some vulnerabilities cannot be fixed automatically and will require manual intervention or review. +Also note that since `npm audit fix` runs a full-fledged `npm install` under the hood, all configs that apply to the installer will also apply to `npm install` -- so things like `npm audit fix --package-lock-only` will work as expected. + +By default, the audit command will exit with a non-zero code if any vulnerability is found. +It may be useful in CI environments to include the `--audit-level` parameter to specify the minimum vulnerability level that will cause the command to fail. +This option does not filter the report output, it simply changes the command's failure threshold. + +### Package lock + +By default npm requires a package-lock or shrinkwrap in order to run the audit. +You can bypass the package lock with `--no-package-lock` but be aware the results may be different with every run, since npm will re-build the dependency tree each time. + +### Audit Signatures + +To ensure the integrity of packages you download from the public npm registry, or any registry that supports signatures, you can verify the registry signatures of downloaded packages using the npm CLI. + +Registry signatures can be verified using the following `audit` command: + +```bash +$ npm audit signatures +``` + +The `audit signatures` command will also verify the provenance attestations of downloaded packages. +Because provenance attestations are such a new feature, security features may be added to (or changed in) the attestation format over time. +To ensure that you're always able to verify attestation signatures check that you're running the latest version of the npm CLI. Please note this often means updating npm beyond the version that ships with Node.js. + +To include the full sigstore attestation bundles in JSON output, use: + +```bash +$ npm audit signatures --json --include-attestations +``` + +This adds a `verified` array to the JSON output containing the attestation +bundles (DSSE envelopes, verification material, and transparency log entries) +for each verified package. + +The npm CLI supports registry signatures and signing keys provided by any registry if the following conventions are followed: + +1. Signatures are provided in the package's `packument` in each published version within the `dist` object: + +```json +"dist":{ + "..omitted..": "..omitted..", + "signatures": [{ + "keyid": "SHA256:{{SHA256_PUBLIC_KEY}}", + "sig": "a312b9c3cb4a1b693e8ebac5ee1ca9cc01f2661c14391917dcb111517f72370809..." + }] +} +``` + +See this [example](https://registry.npmjs.org/light-cycle/1.4.3) of a signed package from the public npm registry. + +The `sig` is generated using the following template: `${package.name}@${package.version}:${package.dist.integrity}` and the `keyid` has to match one of the public signing keys below. + +2. Public signing keys are provided at `registry-host.tld/-/npm/v1/keys` in the following format: + +``` +{ + "keys": [{ + "expires": null, + "keyid": "SHA256:{{SHA256_PUBLIC_KEY}}", + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "key": "{{B64_PUBLIC_KEY}}" + }] +} +``` + +Keys response: + +- `expires`: null or a simplified extended [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601): `YYYY-MM-DDTHH:mm:ss.sssZ` +- `keyid`: sha256 fingerprint of the public key +- `keytype`: only `ecdsa-sha2-nistp256` is currently supported by the npm CLI +- `scheme`: only `ecdsa-sha2-nistp256` is currently supported by the npm CLI +- `key`: base64 encoded public key + +See this [example key's response from the public npm registry](https://registry.npmjs.org/-/npm/v1/keys). + +### Audit Endpoints + +There are two audit endpoints that npm may use to fetch vulnerability information: the `Bulk Advisory` endpoint and the `Quick Audit` endpoint. + +#### Bulk Advisory Endpoint + +As of version 7, npm uses the much faster `Bulk Advisory` endpoint to optimize the speed of calculating audit results. + +npm will generate a JSON payload with the name and list of versions of each package in the tree, and POST it to the default configured registry at the path `/-/npm/v1/security/advisories/bulk`. + +Any packages in the tree that do not have a `version` field in their package.json file will be ignored. +If any `--omit` options are specified (either via the [`--omit` config](/using-npm/config#omit), or one of the shorthands such as `--production`, `--only=dev`, and so on), then packages will be omitted from the submitted payload as appropriate. + +If the registry responds with an error, or with an invalid response, then npm will attempt to load advisory data from the `Quick Audit` endpoint. + +The expected result will contain a set of advisory objects for each dependency that matches the advisory range. +Each advisory object contains a `name`, `url`, `id`, `severity`, `vulnerable_versions`, and `title`. + +npm then uses these advisory objects to calculate vulnerabilities and meta-vulnerabilities of the dependencies within the tree. + +#### Quick Audit Endpoint + +If the `Bulk Advisory` endpoint returns an error, or invalid data, npm will attempt to load advisory data from the `Quick Audit` endpoint, which is considerably slower in most cases. + +The full package tree as found in `package-lock.json` is submitted, along with the following pieces of additional metadata: + +* `npm_version` +* `node_version` +* `platform` +* `arch` +* `node_env` + +All packages in the tree are submitted to the Quick Audit endpoint. +Omitted dependency types are skipped when generating the report. + +#### Scrubbing + +Out of an abundance of caution, npm versions 5 and 6 would "scrub" any packages from the submitted report if their name contained a `/` character, so as to avoid leaking the names of potentially private packages or git URLs. + +However, in practice, this resulted in audits often failing to properly detect meta-vulnerabilities, because the tree would appear to be invalid due to missing dependencies, and prevented the detection of vulnerabilities in package trees that used git dependencies or private modules. + +This scrubbing has been removed from npm as of version 7. + +#### Calculating Meta-Vulnerabilities and Remediations + +npm uses the [`@npmcli/metavuln-calculator`](http://npm.im/@npmcli/metavuln-calculator) module to turn a set of security advisories into a set of "vulnerability" objects. +A "meta-vulnerability" is a dependency that is vulnerable by virtue of dependence on vulnerable versions of a vulnerable package. + +For example, if the package `foo` is vulnerable in the range `>=1.0.2 <2.0.0`, and the package `bar` depends on `foo@^1.1.0`, then that version of `bar` can only be installed by installing a vulnerable version of `foo`. +In this case, `bar` is a "metavulnerability". + +Once metavulnerabilities for a given package are calculated, they are cached in the `~/.npm` folder and only re-evaluated if the advisory range changes, or a new version of the package is published (in which case, the new version is checked for metavulnerable status as well). + +If the chain of metavulnerabilities extends all the way to the root project, and it cannot be updated without changing its dependency ranges, then `npm audit fix` will require the `--force` option to apply the remediation. +If remediations do not require changes to the dependency ranges, then all vulnerable packages will be updated to a version that does not have an advisory or metavulnerability posted against it. + +### Exit Code + +The `npm audit` command will exit with a 0 exit code if no vulnerabilities were found. +The `npm audit fix` command will exit with 0 exit code if no vulnerabilities are found _or_ if the remediation is able to successfully fix all vulnerabilities. + +If vulnerabilities were found the exit code will depend on the [`audit-level` config](/using-npm/config#audit-level). + +### Examples + +Scan your project for vulnerabilities and automatically install any compatible updates to vulnerable dependencies: + +```bash +$ npm audit fix +``` + +Run `audit fix` without modifying `node_modules`, but still updating the pkglock: + +```bash +$ npm audit fix --package-lock-only +``` + +Skip updating `devDependencies`: + +```bash +$ npm audit fix --only=prod +``` + +Have `audit fix` install SemVer-major updates to toplevel dependencies, not just SemVer-compatible ones: + +```bash +$ npm audit fix --force +``` + +Do a dry run to get an idea of what `audit fix` will do, and _also_ output install information in JSON format: + +```bash +$ npm audit fix --dry-run --json +``` + +Scan your project for vulnerabilities and just show the details, without fixing anything: + +```bash +$ npm audit +``` + +Get the detailed audit report in JSON format: + +```bash +$ npm audit --json +``` + +Fail an audit only if the results include a vulnerability with a level of moderate or higher: + +```bash +$ npm audit --audit-level=moderate +``` + +### Configuration + +#### `audit-level` + +* Default: null +* Type: null, "info", "low", "moderate", "high", "critical", or "none" + +The minimum level of vulnerability for `npm audit` to exit with a non-zero +exit code. + + + +#### `dry-run` + +* Default: false +* Type: Boolean + +Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, `install`, `update`, +`dedupe`, `uninstall`, as well as `pack` and `publish`. + +Note: This is NOT honored by other network related commands, eg `dist-tags`, +`owner`, etc. + + + +#### `force` + +* Default: false +* Type: Boolean + +Removes various protections against unfortunate side effects, common +mistakes, unnecessary performance degradation, and malicious input. + +* Allow clobbering non-npm files in global installs. +* Allow the `npm version` command to work on an unclean git repository. +* Allow deleting the cache folder with `npm cache clean`. +* Allow installing packages that have an `engines` declaration requiring a + different version of npm. +* Allow installing packages that have an `engines` declaration requiring a + different version of `node`, even if `--engine-strict` is enabled. +* Allow `npm audit fix` to install modules outside your stated dependency + range (including SemVer-major changes). +* Allow unpublishing all versions of a published package. +* Allow conflicting peerDependencies to be installed in the root project. +* Implicitly set `--yes` during `npm init`. +* Allow clobbering existing values in `npm pkg` +* Allow unpublishing of entire packages (not just a single version). + +If you don't have a clear idea of what you want to do, it is strongly +recommended that you do not use this option! + + + +#### `json` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. + + + +#### `package-lock-only` + +* Default: false +* Type: Boolean + +If set to true, the current operation will only use the `package-lock.json`, +ignoring `node_modules`. + +For `update` this means only the `package-lock.json` will be updated, +instead of checking `node_modules` and downloading dependencies. + +For `list` this means the output will be based on the tree described by the +`package-lock.json`, rather than the contents of `node_modules`. + + + +#### `package-lock` + +* Default: true +* Type: Boolean + +If set to false, then ignore `package-lock.json` files when installing. This +will also prevent _writing_ `package-lock.json` if `save` is true. + + + +#### `omit` + +* Default: 'dev' if the `NODE_ENV` environment variable is set to + 'production'; otherwise, empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) + +Dependency types to omit from the installation tree on disk. + +Note that these dependencies _are_ still resolved and added to the +`package-lock.json` or `npm-shrinkwrap.json` file. They are just not +physically installed on disk. + +If a package type appears in both the `--include` and `--omit` lists, then +it will be included. + +If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment +variable will be set to `'production'` for all lifecycle scripts. + + + +#### `include` + +* Default: +* Type: "prod", "dev", "optional", or "peer" (can be set multiple times) + +Option that allows for defining which types of dependencies to install. + +This is the inverse of `--omit=`. + +Dependency types specified in `--include` will not be omitted, regardless of +the order in which omit/include are specified on the command-line. + + + +#### `foreground-scripts` + +* Default: `false` unless when using `npm pack` or `npm publish` where it + defaults to `true` +* Type: Boolean + +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. + + + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +#### `include-attestations` + +* Default: false +* Type: Boolean + +When used with `npm audit signatures --json`, includes the full sigstore +attestation bundles in the JSON output for each verified package. The +bundles contain DSSE envelopes, verification material, and transparency log +entries. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `install-links` + +* Default: false +* Type: Boolean + +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. + + + +### See Also + +* [npm install](/commands/npm-install) +* [config](/using-npm/config) diff --git a/node24/node_modules/npm/docs/content/commands/npm-bugs.md b/node24/node_modules/npm/docs/content/commands/npm-bugs.md new file mode 100644 index 0000000000000000000000000000000000000000..e93f5c0c4950108566effef17920b3ba6d10a709 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-bugs.md @@ -0,0 +1,106 @@ +--- +title: npm-bugs +section: 1 +description: Report bugs for a package in a web browser +--- + +### Synopsis + +```bash +npm bugs [ [ ...]] + +alias: issues +``` + +### Description + +This command tries to guess at the likely location of a package's bug tracker URL or the `mailto` URL of the support email, and then tries to open it using the [`--browser` config](/using-npm/config#browser) param. +If no package name is provided, it will search for a `package.json` in the current folder and use the `name` property. + +### Configuration + +#### `browser` + +* Default: macOS: `"open"`, Windows: `"start"`, Others: `"xdg-open"` +* Type: null, Boolean, or String + +The browser that is called by npm commands to open websites. + +Set to `false` to suppress browser behavior and instead print urls to +terminal. + +Set to `true` to use default system URL opener. + + + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +### See Also + +* [npm docs](/commands/npm-docs) +* [npm view](/commands/npm-view) +* [npm publish](/commands/npm-publish) +* [npm registry](/using-npm/registry) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [package.json](/configuring-npm/package-json) diff --git a/node24/node_modules/npm/docs/content/commands/npm-cache.md b/node24/node_modules/npm/docs/content/commands/npm-cache.md new file mode 100644 index 0000000000000000000000000000000000000000..bb30012b5a7a92ce7b29ae94f55783e6d91f0017 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-cache.md @@ -0,0 +1,100 @@ +--- +title: npm-cache +section: 1 +description: Manipulates packages cache +--- + +### Synopsis + +```bash +npm cache add +npm cache clean [] +npm cache ls [@] +npm cache verify +npm cache npx ls +npm cache npx rm [...] +npm cache npx info ... +``` + +Note: This command is unaware of workspaces. + +### Description + +Used to add, list, or clean the `npm cache` folder. +Also used to view info about entries in the `npm exec` (aka `npx`) cache folder. + +#### `npm cache` + +* add: + Add the specified packages to the local cache. + This command is primarily intended to be used internally by npm, but it can provide a way to add data to the local installation cache explicitly. + +* clean: + Delete a single entry or all entries out of the cache folder. + Note that this is typically unnecessary, as npm's cache is self-healing and resistant to data corruption issues. + +* ls: + List given entries or all entries in the local cache. + +* verify: + Verify the contents of the cache folder, garbage collecting any unneeded data, and verifying the integrity of the cache index and all cached data. + +#### `npm cache npx` + +* ls: + List all entries in the npx cache. + +* rm: + Remove given entries or all entries from the npx cache. + +* info: + Get detailed information about given entries in the npx cache. + +### Details + +npm stores cache data in an opaque directory within the configured `cache`, named `_cacache`. +This directory is a [`cacache`](http://npm.im/cacache)-based content-addressable cache that stores all http request data as well as other package-related data. +This directory is primarily accessed through `pacote`, the library responsible for all package fetching as of npm@5. + +All data that passes through the cache is fully verified for integrity on both insertion and extraction. +Cache corruption will either trigger an error, or signal to `pacote` that the data must be refetched, which it will do automatically. +For this reason, it should never be necessary to clear the cache for any reason other than reclaiming disk space, thus why `clean` now requires `--force` to run. + +There is currently no method exposed through npm to inspect or directly manage the contents of this cache. +In order to access it, `cacache` must be used directly. + +npm will not remove data by itself: the cache will grow as new packages are installed. + +### A note about the cache's design + +The npm cache is strictly a cache: it should not be relied upon as a persistent and reliable data store for package data. +npm makes no guarantee that a previously-cached piece of data will be available later, and will automatically delete corrupted contents. +The primary guarantee that the cache makes is that, if it does return data, that data will be exactly the data that was inserted. + +To run an offline verification of existing cache contents, use `npm cache verify`. + +### Configuration + +#### `cache` + +* Default: Windows: `%LocalAppData%\npm-cache`, Posix: `~/.npm` +* Type: Path + +The location of npm's cache directory. + + + +### See Also + +* [package spec](/using-npm/package-spec) +* [npm folders](/configuring-npm/folders) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [npm install](/commands/npm-install) +* [npm publish](/commands/npm-publish) +* [npm pack](/commands/npm-pack) +* [npm exec](/commands/npm-exec) +* https://npm.im/cacache +* https://npm.im/pacote +* https://npm.im/@npmcli/arborist +* https://npm.im/make-fetch-happen diff --git a/node24/node_modules/npm/docs/content/commands/npm-ci.md b/node24/node_modules/npm/docs/content/commands/npm-ci.md new file mode 100644 index 0000000000000000000000000000000000000000..3ffeea3e14f32343d746e19d2cf538ff9f1e329f --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-ci.md @@ -0,0 +1,329 @@ +--- +title: npm-ci +section: 1 +description: Clean install a project +--- + +### Synopsis + +```bash +npm ci + +aliases: clean-install, ic, install-clean, isntall-clean +``` + +### Description + +This command is similar to [`npm install`](/commands/npm-install), except it's meant to be used in automated environments such as test platforms, continuous integration, and deployment -- or any situation where you want to make sure you're doing a clean install of your dependencies. + +The main differences between using `npm install` and `npm ci` are: + +* The project **must** have an existing `package-lock.json` or + `npm-shrinkwrap.json`. +* If dependencies in the package lock do not match those in `package.json`, + `npm ci` will exit with an error, instead of updating the package lock. +* `npm ci` can only install entire projects at a time: individual dependencies cannot be added with this command. +* If a `node_modules` is already present, it will be automatically removed before `npm ci` begins its install. +* It will never write to `package.json` or any of the package-locks: + installs are essentially frozen. + +NOTE: If you create your `package-lock.json` file by running `npm install` with flags that can affect the shape of your dependency tree, such as +`--legacy-peer-deps` or `--install-links`, you _must_ provide the same flags to `npm ci` or you are likely to encounter errors. +An easy way to do this is to run, for example, +`npm config set legacy-peer-deps=true --location=project` and commit the +`.npmrc` file to your repo. + +### Example + +Make sure you have a package-lock and an up-to-date install: + +```bash +$ cd ./my/npm/project +$ npm install +added 154 packages in 10s +$ ls | grep package-lock +``` + +Run `npm ci` in that project + +```bash +$ npm ci +added 154 packages in 5s +``` + +Configure Travis CI to build using `npm ci` instead of `npm install`: + +```bash +# .travis.yml +install: +- npm ci +# keep the npm cache around to speed up installs +cache: + directories: + - "$HOME/.npm" +``` + +### Configuration + +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", "shallow", or "linked" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (experimental) install in node_modules/.store, +link in place, unhoisted. + + + +#### `legacy-bundling` + +* Default: false +* Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` + +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. + + + +#### `global-style` + +* Default: false +* Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` + +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependencies. Sets `--install-strategy=shallow`. + + + +#### `omit` + +* Default: 'dev' if the `NODE_ENV` environment variable is set to + 'production'; otherwise, empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) + +Dependency types to omit from the installation tree on disk. + +Note that these dependencies _are_ still resolved and added to the +`package-lock.json` or `npm-shrinkwrap.json` file. They are just not +physically installed on disk. + +If a package type appears in both the `--include` and `--omit` lists, then +it will be included. + +If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment +variable will be set to `'production'` for all lifecycle scripts. + + + +#### `include` + +* Default: +* Type: "prod", "dev", "optional", or "peer" (can be set multiple times) + +Option that allows for defining which types of dependencies to install. + +This is the inverse of `--omit=`. + +Dependency types specified in `--include` will not be omitted, regardless of +the order in which omit/include are specified on the command-line. + + + +#### `strict-peer-deps` + +* Default: false +* Type: Boolean + +If set to `true`, and `--legacy-peer-deps` is not set, then _any_ +conflicting `peerDependencies` will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships. + +By default, conflicting `peerDependencies` deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's `peerDependencies` object. + +When such an override is performed, a warning is printed, explaining the +conflict and the packages involved. If `--strict-peer-deps` is set, then +this warning is treated as a failure. + + + +#### `foreground-scripts` + +* Default: `false` unless when using `npm pack` or `npm publish` where it + defaults to `true` +* Type: Boolean + +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. + + + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +#### `allow-git` + +* Default: "all" +* Type: "all", "none", or "root" + +Limits the ability for npm to fetch dependencies from git references. That +is, dependencies that point to a git repo instead of a version or semver +range. Please note that this could leave your tree incomplete and some +packages may not function as intended or designed. + +`all` allows any git dependencies to be fetched and installed. `none` +prevents any git dependencies from being fetched and installed. `root` only +allows git dependencies defined in your project's package.json to be fetched +installed. Also allows git dependencies to be fetched for other commands +like `npm view` + + + +#### `audit` + +* Default: true +* Type: Boolean + +When "true" submit audit reports alongside the current npm command to the +default registry and all registries configured for scopes. See the +documentation for [`npm audit`](/commands/npm-audit) for details on what is +submitted. + + + +#### `bin-links` + +* Default: true +* Type: Boolean + +Tells npm to create symlinks (or `.cmd` shims on Windows) for package +executables. + +Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems. + + + +#### `fund` + +* Default: true +* Type: Boolean + +When "true" displays the message at the end of each `npm install` +acknowledging the number of dependencies looking for funding. See [`npm +fund`](/commands/npm-fund) for details. + + + +#### `dry-run` + +* Default: false +* Type: Boolean + +Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, `install`, `update`, +`dedupe`, `uninstall`, as well as `pack` and `publish`. + +Note: This is NOT honored by other network related commands, eg `dist-tags`, +`owner`, etc. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `install-links` + +* Default: false +* Type: Boolean + +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. + + + +### See Also + +* [npm install](/commands/npm-install) +* [package-lock.json](/configuring-npm/package-lock-json) diff --git a/node24/node_modules/npm/docs/content/commands/npm-completion.md b/node24/node_modules/npm/docs/content/commands/npm-completion.md new file mode 100644 index 0000000000000000000000000000000000000000..a2643dd40f90ecea2e97ba052204f2625f756780 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-completion.md @@ -0,0 +1,36 @@ +--- +title: npm-completion +section: 1 +description: Tab Completion for npm +--- + +### Synopsis + +```bash +npm completion +``` + +Note: This command is unaware of workspaces. + +### Description + +Enables tab-completion in all npm commands. + +The synopsis above loads the completions into your current shell. +Adding it to your ~/.bashrc or ~/.zshrc will make the completions available everywhere: + +```bash +npm completion >> ~/.bashrc +npm completion >> ~/.zshrc +``` + +You may of course also pipe the output of `npm completion` to a file such as `/usr/local/etc/bash_completion.d/npm` or +`/etc/bash_completion.d/npm` if you have a system that will read +that file for you. + +When `COMP_CWORD`, `COMP_LINE`, and `COMP_POINT` are defined in the environment, `npm completion` acts in "plumbing mode", and outputs completions based on the arguments. + +### See Also + +* [npm developers](/using-npm/developers) +* [npm](/commands/npm) diff --git a/node24/node_modules/npm/docs/content/commands/npm-config.md b/node24/node_modules/npm/docs/content/commands/npm-config.md new file mode 100644 index 0000000000000000000000000000000000000000..a036a41eb94c9d343da53e1aead5c1d26fef8bb8 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-config.md @@ -0,0 +1,176 @@ +--- +title: npm-config +section: 1 +description: Manage the npm configuration files +--- + +### Synopsis + +```bash +npm config set = [= ...] +npm config get [ [ ...]] +npm config delete [ ...] +npm config list [--json] +npm config edit +npm config fix + +alias: c +``` + +Note: This command is unaware of workspaces. + +### Description + +npm gets its config settings from the command line, environment variables, `npmrc` files, and in some cases, the `package.json` file. + +See [npmrc](/configuring-npm/npmrc) for more information about the npmrc files. + +See [config](/using-npm/config) for a more thorough explanation of the mechanisms involved, and a full list of config options available. + +The `npm config` command can be used to update and edit the contents of the user and global npmrc files. + +### Sub-commands + +Config supports the following sub-commands: + +#### set + +```bash +npm config set key=value [key=value...] +npm set key=value [key=value...] +``` + +Sets each of the config keys to the value provided. +Modifies the user configuration file unless [`location`](/commands/npm-config#location) is passed. + +If value is omitted, the key will be removed from your config file entirely. + +Note: for backwards compatibility, `npm config set key value` is supported as an alias for `npm config set key=value`. + +#### get + +```bash +npm config get [key ...] +npm get [key ...] +``` + +Echo the config value(s) to stdout. + +If multiple keys are provided, then the values will be prefixed with the key names. + +If no keys are provided, then this command behaves the same as `npm config list`. + +#### list + +```bash +npm config list +``` + +Show all the config settings. +Use `-l` to also show defaults. +Use `--json` to show the settings in json format. + +#### delete + +```bash +npm config delete key [key ...] +``` + +Deletes the specified keys from all configuration files. + +#### edit + +```bash +npm config edit +``` + +Opens the config file in an editor. +Use the `--global` flag to edit the global config. + +#### fix + +```bash +npm config fix +``` + +Attempts to repair invalid configuration items. +Usually this means attaching authentication config (i.e. +`_auth`, `_authToken`) to the configured `registry`. + +### Configuration + +#### `json` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. + + + +#### `global` + +* Default: false +* Type: Boolean + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +#### `editor` + +* Default: The EDITOR or VISUAL environment variables, or + '%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems +* Type: String + +The command to run for `npm edit` and `npm config edit`. + + + +#### `location` + +* Default: "user" unless `--global` is passed, which will also set this value + to "global" +* Type: "global", "user", or "project" + +When passed to `npm config` this refers to which config file to use. + +When set to "global" mode, packages are installed into the `prefix` folder +instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +#### `long` + +* Default: false +* Type: Boolean + +Show extended information in `ls`, `search`, and `help-search`. + + + +### See Also + +* [npm folders](/configuring-npm/folders) +* [npm config](/commands/npm-config) +* [package.json](/configuring-npm/package-json) +* [npmrc](/configuring-npm/npmrc) +* [npm](/commands/npm) diff --git a/node24/node_modules/npm/docs/content/commands/npm-dedupe.md b/node24/node_modules/npm/docs/content/commands/npm-dedupe.md new file mode 100644 index 0000000000000000000000000000000000000000..90e4b6ef7a897975bcc1d410db72ec1906da133b --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-dedupe.md @@ -0,0 +1,326 @@ +--- +title: npm-dedupe +section: 1 +description: Reduce duplication in the package tree +--- + +### Synopsis + +```bash +npm dedupe + +alias: ddp +``` + +### Description + +Searches the local package tree and attempts to simplify the overall structure by moving dependencies further up the tree, where they can be more effectively shared by multiple dependent packages. + +For example, consider this dependency graph: + +``` +a ++-- b <-- depends on c@1.0.x +| `-- c@1.0.3 +`-- d <-- depends on c@~1.0.9 + `-- c@1.0.10 +``` + +In this case, `npm dedupe` will transform the tree to: + +```bash +a ++-- b ++-- d +`-- c@1.0.10 +``` + +Because of the hierarchical nature of node's module lookup, b and d will both get their dependency met by the single c package at the root level of the tree. + +In some cases, you may have a dependency graph like this: + +``` +a ++-- b <-- depends on c@1.0.x ++-- c@1.0.3 +`-- d <-- depends on c@1.x + `-- c@1.9.9 +``` + +During the installation process, the `c@1.0.3` dependency for `b` was placed in the root of the tree. +Though `d`'s dependency on `c@1.x` could have been satisfied by `c@1.0.3`, the newer `c@1.9.9` dependency was used, because npm favors updates by default, even when doing so causes duplication. + +Running `npm dedupe` will cause npm to note the duplication and re-evaluate, deleting the nested `c` module, because the one in the root is sufficient. + +To prefer deduplication over novelty during the installation process, run `npm install --prefer-dedupe` or `npm config set prefer-dedupe true`. + +Arguments are ignored. +Dedupe always acts on the entire tree. + +Note that this operation transforms the dependency tree, but will never result in new modules being installed. + +Using `npm find-dupes` will run the command in `--dry-run` mode. + +Note: `npm dedupe` will never update the semver values of direct dependencies in your project `package.json`, if you want to update values in `package.json` you can run: `npm update --save` instead. + +### Configuration + +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", "shallow", or "linked" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (experimental) install in node_modules/.store, +link in place, unhoisted. + + + +#### `legacy-bundling` + +* Default: false +* Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` + +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. + + + +#### `global-style` + +* Default: false +* Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` + +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependencies. Sets `--install-strategy=shallow`. + + + +#### `strict-peer-deps` + +* Default: false +* Type: Boolean + +If set to `true`, and `--legacy-peer-deps` is not set, then _any_ +conflicting `peerDependencies` will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships. + +By default, conflicting `peerDependencies` deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's `peerDependencies` object. + +When such an override is performed, a warning is printed, explaining the +conflict and the packages involved. If `--strict-peer-deps` is set, then +this warning is treated as a failure. + + + +#### `package-lock` + +* Default: true +* Type: Boolean + +If set to false, then ignore `package-lock.json` files when installing. This +will also prevent _writing_ `package-lock.json` if `save` is true. + + + +#### `omit` + +* Default: 'dev' if the `NODE_ENV` environment variable is set to + 'production'; otherwise, empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) + +Dependency types to omit from the installation tree on disk. + +Note that these dependencies _are_ still resolved and added to the +`package-lock.json` or `npm-shrinkwrap.json` file. They are just not +physically installed on disk. + +If a package type appears in both the `--include` and `--omit` lists, then +it will be included. + +If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment +variable will be set to `'production'` for all lifecycle scripts. + + + +#### `include` + +* Default: +* Type: "prod", "dev", "optional", or "peer" (can be set multiple times) + +Option that allows for defining which types of dependencies to install. + +This is the inverse of `--omit=`. + +Dependency types specified in `--include` will not be omitted, regardless of +the order in which omit/include are specified on the command-line. + + + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +#### `allow-git` + +* Default: "all" +* Type: "all", "none", or "root" + +Limits the ability for npm to fetch dependencies from git references. That +is, dependencies that point to a git repo instead of a version or semver +range. Please note that this could leave your tree incomplete and some +packages may not function as intended or designed. + +`all` allows any git dependencies to be fetched and installed. `none` +prevents any git dependencies from being fetched and installed. `root` only +allows git dependencies defined in your project's package.json to be fetched +installed. Also allows git dependencies to be fetched for other commands +like `npm view` + + + +#### `audit` + +* Default: true +* Type: Boolean + +When "true" submit audit reports alongside the current npm command to the +default registry and all registries configured for scopes. See the +documentation for [`npm audit`](/commands/npm-audit) for details on what is +submitted. + + + +#### `bin-links` + +* Default: true +* Type: Boolean + +Tells npm to create symlinks (or `.cmd` shims on Windows) for package +executables. + +Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems. + + + +#### `fund` + +* Default: true +* Type: Boolean + +When "true" displays the message at the end of each `npm install` +acknowledging the number of dependencies looking for funding. See [`npm +fund`](/commands/npm-fund) for details. + + + +#### `dry-run` + +* Default: false +* Type: Boolean + +Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, `install`, `update`, +`dedupe`, `uninstall`, as well as `pack` and `publish`. + +Note: This is NOT honored by other network related commands, eg `dist-tags`, +`owner`, etc. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `install-links` + +* Default: false +* Type: Boolean + +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. + + + +### See Also + +* [npm find-dupes](/commands/npm-find-dupes) +* [npm ls](/commands/npm-ls) +* [npm update](/commands/npm-update) +* [npm install](/commands/npm-install) diff --git a/node24/node_modules/npm/docs/content/commands/npm-deprecate.md b/node24/node_modules/npm/docs/content/commands/npm-deprecate.md new file mode 100644 index 0000000000000000000000000000000000000000..22762144be98ef5b5a4be231e0c142e5490f3ffe --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-deprecate.md @@ -0,0 +1,85 @@ +--- +title: npm-deprecate +section: 1 +description: Deprecate a version of a package +--- + +### Synopsis + +```bash +npm deprecate +``` + +Note: This command is unaware of workspaces. + +### Description + +This command will update the npm registry entry for a package, providing a deprecation warning to all who attempt to install it. + +It works on [version ranges](https://semver.npmjs.com/) as well as specific versions, so you can do something like this: + +```bash +npm deprecate my-thing@"< 0.2.3" "critical bug fixed in v0.2.3" +``` + +SemVer ranges passed to this command are interpreted such that they *do* include prerelease versions. +For example: + +```bash +npm deprecate my-thing@1.x "1.x is no longer supported" +``` + +In this case, a version `my-thing@1.0.0-beta.0` will also be deprecated. + +You must be the package owner to deprecate something. +See the `owner` and `adduser` help topics. + +To un-deprecate a package, specify an empty string (`""`) for the `message` argument. +Note that you must use double quotes with no space between them to format an empty string. + +### Configuration + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +#### `otp` + +* Default: null +* Type: null or String + +This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with `npm access`. + +If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one. + + + +#### `dry-run` + +* Default: false +* Type: Boolean + +Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, `install`, `update`, +`dedupe`, `uninstall`, as well as `pack` and `publish`. + +Note: This is NOT honored by other network related commands, eg `dist-tags`, +`owner`, etc. + + + +### See Also + +* [package spec](/using-npm/package-spec) +* [npm publish](/commands/npm-publish) +* [npm registry](/using-npm/registry) +* [npm owner](/commands/npm-owner) +* [npm adduser](/commands/npm-adduser) diff --git a/node24/node_modules/npm/docs/content/commands/npm-diff.md b/node24/node_modules/npm/docs/content/commands/npm-diff.md new file mode 100644 index 0000000000000000000000000000000000000000..2ef0245c91c040bb3a034b68b74ba834f6254dbf --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-diff.md @@ -0,0 +1,282 @@ +--- +title: npm-diff +section: 1 +description: The registry diff command +--- + +### Synopsis + +```bash +npm diff [...] +``` + +### Description + +Similar to its `git diff` counterpart, this command will print diff patches of files for packages published to the npm registry. + +* `npm diff --diff= --diff=` + + Compares two package versions using their registry specifiers, e.g: `npm diff --diff=pkg@1.0.0 --diff=pkg@^2.0.0`. + It's also possible to compare across forks of any package, e.g: `npm diff --diff=pkg@1.0.0 --diff=pkg-fork@1.0.0`. + + Any valid spec can be used, so that it's also possible to compare directories or git repositories, e.g: `npm diff --diff=pkg@latest --diff=./packages/pkg` + + Here's an example comparing two different versions of a package named `abbrev` from the registry: + + ```bash + npm diff --diff=abbrev@1.1.0 --diff=abbrev@1.1.1 + ``` + + On success, output looks like: + + ```bash + diff --git a/package.json b/package.json + index v1.1.0..v1.1.1 100644 + --- a/package.json + +++ b/package.json + @@ -1,6 +1,6 @@ + { + "name": "abbrev", + - "version": "1.1.0", + + "version": "1.1.1", + "description": "Like ruby's abbrev module, but in js", + "author": "Isaac Z. Schlueter ", + "main": "abbrev.js", + ``` + + Given the flexible nature of npm specs, you can also target local directories or git repos just like when using `npm install`: + + ```bash + npm diff --diff=https://github.com/npm/libnpmdiff --diff=./local-path + ``` + + In the example above we can compare the contents from the package installed from the git repo at `github.com/npm/libnpmdiff` with the contents of the `./local-path` that contains a valid package, such as a modified copy of the original. + +* `npm diff` (in a package directory, no arguments): + + If the package is published to the registry, `npm diff` will fetch the tarball version tagged as `latest` (this value can be configured using the `tag` option) and proceed to compare the contents of files present in that tarball, with the current files in your local file system. + + This workflow provides a handy way for package authors to see what package-tracked files have been changed in comparison with the latest published version of that package. + +* `npm diff --diff=` (in a package directory): + + When using a single package name (with no version or tag specifier) as an argument, `npm diff` will work in a similar way to [`npm-outdated`](npm-outdated) and reach for the registry to figure out what current published version of the package named `` will satisfy its dependent declared semver-range. + Once that specific version is known `npm diff` will print diff patches comparing the current version of `` found in the local file system with that specific version returned by the registry. + + Given a package named `abbrev` that is currently installed: + + ```bash + npm diff --diff=abbrev + ``` + + That will request from the registry its most up to date version and will print a diff output comparing the currently installed version to this newer one if the version numbers are not the same. + +* `npm diff --diff=` (in a package directory): + + Similar to using only a single package name, it's also possible to declare a full registry specifier version if you wish to compare the local version of an installed package with the specific version/tag/semver-range provided in ``. + + An example: assuming `pkg@1.0.0` is installed in the current `node_modules` folder, running: + + ```bash + npm diff --diff=pkg@2.0.0 + ``` + + It will effectively be an alias to + `npm diff --diff=pkg@1.0.0 --diff=pkg@2.0.0`. + +* `npm diff --diff= [--diff=]` (in a package directory): + + Using `npm diff` along with semver-valid version numbers is a shorthand to compare different versions of the current package. + + It needs to be run from a package directory, such that for a package named `pkg` running `npm diff --diff=1.0.0 --diff=1.0.1` is the same as running `npm diff --diff=pkg@1.0.0 --diff=pkg@1.0.1`. + + If only a single argument `` is provided, then the current local file system is going to be compared against that version. + + Here's an example comparing two specific versions (published to the configured registry) of the current project directory: + + ```bash + npm diff --diff=1.0.0 --diff=1.1.0 + ``` + +Note that tag names are not valid `--diff` argument values, if you wish to compare to a published tag, you must use the `pkg@tagname` syntax. + +#### Filtering files + +It's possible to also specify positional arguments using file names or globs pattern matching in order to limit the result of diff patches to only a subset of files for a given package, e.g: + + ```bash + npm diff --diff=pkg@2 ./lib/ CHANGELOG.md + ``` + +In the example above the diff output is only going to print contents of files located within the folder `./lib/` and changed lines of code within the `CHANGELOG.md` file. + +### Configuration + +#### `diff` + +* Default: +* Type: String (can be set multiple times) + +Define arguments to compare in `npm diff`. + + + +#### `diff-name-only` + +* Default: false +* Type: Boolean + +Prints only filenames when using `npm diff`. + + + +#### `diff-unified` + +* Default: 3 +* Type: Number + +The number of lines of context to print in `npm diff`. + + + +#### `diff-ignore-all-space` + +* Default: false +* Type: Boolean + +Ignore whitespace when comparing lines in `npm diff`. + + + +#### `diff-no-prefix` + +* Default: false +* Type: Boolean + +Do not show any source or destination prefix in `npm diff` output. + +Note: this causes `npm diff` to ignore the `--diff-src-prefix` and +`--diff-dst-prefix` configs. + + + +#### `diff-src-prefix` + +* Default: "a/" +* Type: String + +Source prefix to be used in `npm diff` output. + + + +#### `diff-dst-prefix` + +* Default: "b/" +* Type: String + +Destination prefix to be used in `npm diff` output. + + + +#### `diff-text` + +* Default: false +* Type: Boolean + +Treat all files as text in `npm diff`. + + + +#### `global` + +* Default: false +* Type: Boolean + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +#### `tag` + +* Default: "latest" +* Type: String + +If you ask npm to install a package and don't tell it a specific version, +then it will install the specified tag. + +It is the tag added to the package@version specified in the `npm dist-tag +add` command, if no explicit tag is given. + +When used by the `npm diff` command, this is the tag used to fetch the +tarball that will be compared with the local files by default. + +If used in the `npm publish` command, this is the tag that will be added to +the package submitted to the registry. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. +## See Also + +* [npm outdated](/commands/npm-outdated) +* [npm install](/commands/npm-install) +* [npm config](/commands/npm-config) +* [npm registry](/using-npm/registry) diff --git a/node24/node_modules/npm/docs/content/commands/npm-dist-tag.md b/node24/node_modules/npm/docs/content/commands/npm-dist-tag.md new file mode 100644 index 0000000000000000000000000000000000000000..c6b9b517a7d2873c844c08662b362fab43334d8e --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-dist-tag.md @@ -0,0 +1,138 @@ +--- +title: npm-dist-tag +section: 1 +description: Modify package distribution tags +--- + +### Synopsis + +```bash +npm dist-tag add [] +npm dist-tag rm +npm dist-tag ls [] + +alias: dist-tags +``` + +### Description + +Add, remove, and enumerate distribution tags on a package: + +* add: Tags the specified version of the package with the specified tag, or the [`--tag` config](/using-npm/config#tag) if not specified. + If you have two-factor authentication on auth-and-writes then you’ll need to include a one-time password on the command line with `--otp `, or go through a second factor flow based on your `authtype`. + +* rm: Clear a tag that is no longer in use from the package. + If you have two-factor authentication on auth-and-writes then you’ll need to include a one-time password on the command line with `--otp `, or go through a second factor flow based on your `authtype` + +* ls: Show all of the dist-tags for a package, defaulting to the package in the current prefix. + This is the default action if none is specified. + +A tag can be used when installing packages as a reference to a version instead of using a specific version number: + +```bash +npm install @ +``` + +When installing dependencies, a preferred tagged version may be specified: + +```bash +npm install --tag +``` + +(This also applies to any other commands that resolve and install dependencies, such as `npm dedupe`, `npm update`, and `npm audit fix`.) + +Publishing a package sets the `latest` tag to the published version unless the `--tag` option is used. +For example, `npm publish --tag=beta`. + +By default, `npm install ` (without any `@` or `@` specifier) installs the `latest` tag. + +### Purpose + +Tags can be used to provide an alias instead of version numbers. + +For example, a project might choose to have multiple streams of development and use a different tag for each stream, e.g., `stable`, `beta`, `dev`, +`canary`. + +By default, the `latest` tag is used by npm to identify the current version of a package, and `npm install ` (without any `@` or `@` specifier) installs the `latest` tag. +Typically, projects only use the `latest` tag for stable release versions, and use other tags for unstable versions such as prereleases. + +The `next` tag is used by some projects to identify the upcoming version. + +Other than `latest`, no tag has any special significance to npm itself. + +### Caveats + +This command used to be known as `npm tag`, which only created new tags, and so had a different syntax. + +Tags must share a namespace with version numbers, because they are specified in the same slot: `npm install @` vs `npm install @`. + +Tags that can be interpreted as valid semver ranges will be rejected. +For example, `v1.4` cannot be used as a tag, because it is interpreted by semver as `>=1.4.0 <1.5.0`. +See . + +The simplest way to avoid semver problems with tags is to use tags that do not begin with a number or the letter `v`. + +### Configuration + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +### See Also + +* [package spec](/using-npm/package-spec) +* [npm publish](/commands/npm-publish) +* [npm install](/commands/npm-install) +* [npm dedupe](/commands/npm-dedupe) +* [npm registry](/using-npm/registry) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) diff --git a/node24/node_modules/npm/docs/content/commands/npm-docs.md b/node24/node_modules/npm/docs/content/commands/npm-docs.md new file mode 100644 index 0000000000000000000000000000000000000000..2d5d0f476da10d3ec5c2abc262266b4fcb8d39fc --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-docs.md @@ -0,0 +1,106 @@ +--- +title: npm-docs +section: 1 +description: Open documentation for a package in a web browser +--- + +### Synopsis + +```bash +npm docs [ [ ...]] + +alias: home +``` + +### Description + +This command tries to guess at the likely location of a package's documentation URL, and then tries to open it using the [`--browser` config](/using-npm/config#browser) param. +You can pass multiple package names at once. +If no package name is provided, it will search for a `package.json` in the current folder and use the `name` property. + +### Configuration + +#### `browser` + +* Default: macOS: `"open"`, Windows: `"start"`, Others: `"xdg-open"` +* Type: null, Boolean, or String + +The browser that is called by npm commands to open websites. + +Set to `false` to suppress browser behavior and instead print urls to +terminal. + +Set to `true` to use default system URL opener. + + + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +### See Also + +* [npm view](/commands/npm-view) +* [npm publish](/commands/npm-publish) +* [npm registry](/using-npm/registry) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [package.json](/configuring-npm/package-json) diff --git a/node24/node_modules/npm/docs/content/commands/npm-doctor.md b/node24/node_modules/npm/docs/content/commands/npm-doctor.md new file mode 100644 index 0000000000000000000000000000000000000000..bb46ab220e86cec625c69e1000f779e33d6cdc77 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-doctor.md @@ -0,0 +1,98 @@ +--- +title: npm-doctor +section: 1 +description: Check the health of your npm environment +--- + +### Synopsis + +```bash +npm doctor [connection] [registry] [versions] [environment] [permissions] [cache] +``` + +Note: This command is unaware of workspaces. + +### Description + +`npm doctor` runs a set of checks to ensure that your npm installation has what it needs to manage your JavaScript packages. +npm is mostly a standalone tool, but it does have some basic requirements that must be met: + ++ Node.js and git must be executable by npm. ++ The primary npm registry, `registry.npmjs.com`, or another service that uses the registry API, is available. ++ The directories that npm uses, `node_modules` (both locally and globally), exist and can be written by the current user. ++ The npm cache exists, and the package tarballs within it aren't corrupt. + +Without all of these working properly, npm may not work properly. +Many issues are often attributable to things that are outside npm's code base, so `npm doctor` confirms that the npm installation is in a good state. + +Also, in addition to this, there are also very many issue reports due to using old versions of npm. +Since npm is constantly improving, running `npm@latest` is better than an old version. + +`npm doctor` verifies the following items in your environment, and if there are any recommended changes, it will display them. +By default npm runs all of these checks. +You can limit what checks are ran by specifying them as extra arguments. + +#### `Connecting to the registry` + +By default, npm installs from the primary npm registry, +`registry.npmjs.org`. +`npm doctor` hits a special connection testing endpoint within the registry. +This can also be checked with `npm ping`. +If this check fails, you may be using a proxy that needs to be configured, or may need to talk to your IT staff to get access over HTTPS to `registry.npmjs.org`. + +This check is done against whichever registry you've configured (you can see what that is by running `npm config get registry`), and if you're using a private registry that doesn't support the `/whoami` endpoint supported by the primary registry, this check may fail. + +#### `Checking npm version` + +While Node.js may come bundled with a particular version of npm, it's the policy of the CLI team that we recommend all users run `npm@latest` if they can. +As the CLI is maintained by a small team of contributors, there are only resources for a single line of development, so npm's own long-term support releases typically only receive critical security and regression fixes. +The team believes that the latest tested version of npm is almost always likely to be the most functional and defect-free version of npm. + +#### `Checking node version` + +For most users, in most circumstances, the best version of Node will be the latest long-term support (LTS) release. +Those of you who want access to new ECMAscript features or bleeding-edge changes to Node's standard library may be running a newer version, and some may be required to run an older version of Node because of enterprise change control policies. +That's OK! +But in general, the npm team recommends that most users run Node.js LTS. + +#### `Checking configured npm registry` + +You may be installing from private package registries for your project or company. +That's great! Others may be following tutorials or StackOverflow questions in an effort to troubleshoot problems you may be having. +Sometimes, this may entail changing the registry you're pointing at. +This part of `npm doctor` just lets you, and maybe whoever's helping you with support, know that you're not using the default registry. + +#### `Checking for git executable in PATH` + +While it's documented in the README, it may not be obvious that npm needs Git installed to do many of the things that it does. +Also, in some cases – especially on Windows – you may have Git set up in such a way that it's not accessible via your `PATH` so that npm can find it. +This check ensures that Git is available. + +#### Permissions checks + +* Your cache must be readable and writable by the user running npm. +* Global package binaries must be writable by the user running npm. +* Your local `node_modules` path, if you're running `npm doctor` with a project directory, must be readable and writable by the user running npm. + +#### Validate the checksums of cached packages + +When an npm package is published, the publishing process generates a checksum that npm uses at install time to verify that the package didn't get corrupted in transit. +`npm doctor` uses these checksums to validate the package tarballs in your local cache (you can see where that cache is located with `npm config get cache`). +In the event that there are corrupt packages in your cache, you should probably run `npm cache clean -f` and reset the cache. + +### Configuration + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +### See Also + +* [npm bugs](/commands/npm-bugs) +* [npm help](/commands/npm-help) +* [npm ping](/commands/npm-ping) diff --git a/node24/node_modules/npm/docs/content/commands/npm-edit.md b/node24/node_modules/npm/docs/content/commands/npm-edit.md new file mode 100644 index 0000000000000000000000000000000000000000..eea56da85bf8bc200748e208de2fd440c0147e7d --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-edit.md @@ -0,0 +1,41 @@ +--- +title: npm-edit +section: 1 +description: Edit an installed package +--- + +### Synopsis + +```bash +npm edit [/...] +``` + +Note: This command is unaware of workspaces. + +### Description + +Selects a dependency in the current project and opens the package folder in the default editor (or whatever you've configured as the npm `editor` config -- see [`npm-config`](npm-config).) + +After it has been edited, the package is rebuilt so as to pick up any changes in compiled packages. + +For instance, you can do `npm install connect` to install connect into your package, and then `npm edit connect` to make a few changes to your locally installed copy. + +### Configuration + +#### `editor` + +* Default: The EDITOR or VISUAL environment variables, or + '%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems +* Type: String + +The command to run for `npm edit` and `npm config edit`. + + + +### See Also + +* [npm folders](/configuring-npm/folders) +* [npm explore](/commands/npm-explore) +* [npm install](/commands/npm-install) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) diff --git a/node24/node_modules/npm/docs/content/commands/npm-exec.md b/node24/node_modules/npm/docs/content/commands/npm-exec.md new file mode 100644 index 0000000000000000000000000000000000000000..51a31f23aa62f0364cd2b5b1dc05accf8cd881a1 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-exec.md @@ -0,0 +1,314 @@ +--- +title: npm-exec +section: 1 +description: Run a command from a local or remote npm package +--- + +### Synopsis + +```bash +npm exec -- [@] [args...] +npm exec --package=[@] -- [args...] +npm exec -c ' [args...]' +npm exec --package=foo -c ' [args...]' + +alias: x +``` + +### Description + +This command allows you to run an arbitrary command from an npm package (either one installed locally, or fetched remotely), in a similar context as running it via `npm run`. + +Run without positional arguments or `--call`, this allows you to interactively run commands in the same sort of shell environment that `package.json` scripts are run. +Interactive mode is not supported in CI environments when standard input is a TTY, to prevent hangs. + +Whatever packages are specified by the `--package` option will be provided in the `PATH` of the executed command, along with any locally installed package executables. +The `--package` option may be specified multiple times, to execute the supplied command in an environment where all specified packages are available. + +If any requested packages are not present in the local project dependencies, then a prompt is printed, which can be suppressed by providing either `--yes` or `--no`. +When standard input is not a TTY or a CI environment is detected, `--yes` is assumed. +The requested packages are installed to a folder in the npm cache, which is added to the `PATH` environment variable in the executed process. + +Package names provided without a specifier will be matched with whatever version exists in the local project. +Package names with a specifier will only be considered a match if they have the exact same name and version as the local dependency. + +If no `-c` or `--call` option is provided, then the positional arguments are used to generate the command string. +If no `--package` options are provided, then npm will attempt to determine the executable name from the package specifier provided as the first positional argument according to the following heuristic: + +- If the package has a single entry in its `bin` field in `package.json`, or if all entries are aliases of the same command, then that command will be used. +- If the package has multiple `bin` entries, and one of them matches the unscoped portion of the `name` field, then that command will be used. +- If this does not result in exactly one option (either because there are no bin entries, or none of them match the `name` of the package), then `npm exec` exits with an error. + +To run a binary _other than_ the named binary, specify one or more `--package` options, which will prevent npm from inferring the package from the first command argument. + +### `npx` vs `npm exec` + +When run via the `npx` binary, all flags and options *must* be set prior to any positional arguments. +When run via `npm exec`, a double-hyphen `--` flag can be used to suppress npm's parsing of switches and options that should be sent to the executed command. + +For example: + +``` +$ npx foo@latest bar --package=@npmcli/foo +``` + +In this case, npm will resolve the `foo` package name, and run the following command: + +``` +$ foo bar --package=@npmcli/foo +``` + +Since the `--package` option comes _after_ the positional arguments, it is treated as an argument to the executed command. + +In contrast, due to npm's argument parsing logic, running this command is different: + +``` +$ npm exec foo@latest bar --package=@npmcli/foo +``` + +In this case, npm will parse the `--package` option first, resolving the `@npmcli/foo` package. +Then, it will execute the following command in that context: + +``` +$ foo@latest bar +``` + +The double-hyphen character is recommended to explicitly tell npm to stop parsing command line options and switches. +The following command would thus be equivalent to the `npx` command above: + +``` +$ npm exec -- foo@latest bar --package=@npmcli/foo +``` + +### Configuration + +#### `package` + +* Default: +* Type: String (can be set multiple times) + +The package or packages to install for [`npm exec`](/commands/npm-exec) + + + +#### `call` + +* Default: "" +* Type: String + +Optional companion option for `npm exec`, `npx` that allows for specifying a +custom command to be run along with the installed packages. + +```bash +npm exec --package yo --package generator-node --call "yo node" +``` + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +### Examples + +Run the version of `tap` in the local dependencies, with the provided arguments: + +``` +$ npm exec -- tap --bail test/foo.js +$ npx tap --bail test/foo.js +``` + +Run a command _other than_ the command whose name matches the package name by specifying a `--package` option: + +``` +$ npm exec --package=foo -- bar --bar-argument +# ~ or ~ +$ npx --package=foo bar --bar-argument +``` + +Run an arbitrary shell script, in the context of the current project: + +``` +$ npm x -c 'eslint && say "hooray, lint passed"' +$ npx -c 'eslint && say "hooray, lint passed"' +``` + +### Workspaces support + +You may use the [`workspace`](/using-npm/config#workspace) or [`workspaces`](/using-npm/config#workspaces) configs in order to run an arbitrary command from an npm package (either one installed locally, or fetched remotely) in the context of the specified workspaces. +If no positional argument or `--call` option is provided, it will open an interactive subshell in the context of each of these configured workspaces one at a time. + +Given a project with configured workspaces, e.g: + +``` +. ++-- package.json +`-- packages + +-- a + | `-- package.json + +-- b + | `-- package.json + `-- c + `-- package.json +``` + +Assuming the workspace configuration is properly set up at the root level `package.json` file. +e.g: + +``` +{ + "workspaces": [ "./packages/*" ] +} +``` + +You can execute an arbitrary command from a package in the context of each of the configured workspaces when using the [`workspaces` config options](/using-npm/config#workspace), in this example we're using **eslint** to lint any js file found within each workspace folder: + +``` +npm exec --ws -- eslint ./*.js +``` + +#### Filtering workspaces + +It's also possible to execute a command in a single workspace using the `workspace` config along with a name or directory path: + +``` +npm exec --workspace=a -- eslint ./*.js +``` + +The `workspace` config can also be specified multiple times in order to run a specific script in the context of multiple workspaces. +When defining values for the `workspace` config in the command line, it also possible to use `-w` as a shorthand, e.g: + +``` +npm exec -w a -w b -- eslint ./*.js +``` + +This last command will run the `eslint` command in both `./packages/a` and +`./packages/b` folders. + +### Compatibility with Older npx Versions + +The `npx` binary was rewritten in npm v7.0.0, and the standalone `npx` package deprecated at that time. +`npx` uses the `npm exec` command instead of a separate argument parser and install process, with some affordances to maintain backwards compatibility with the arguments it accepted in previous versions. + +This resulted in some shifts in its functionality: + +- Any `npm` config value may be provided. +- To prevent security and user-experience problems from mistyping package + names, `npx` prompts before installing anything. + Suppress this prompt with the `-y` or `--yes` option. +- The `--no-install` option is deprecated, and will be converted to `--no`. +- Shell fallback functionality is removed, as it is not advisable. +- The `-p` argument is a shorthand for `--parseable` in npm, but shorthand for `--package` in npx. + This is maintained, but only for the `npx` executable. +- The `--ignore-existing` option is removed. + Locally installed bins are always present in the executed process `PATH`. +- The `--npm` option is removed. + `npx` will always use the `npm` it ships with. +- The `--node-arg` and `-n` options are removed. +- The `--always-spawn` option is redundant, and thus removed. +- The `--shell` option is replaced with `--script-shell`, but maintained in the `npx` executable for backwards compatibility. + +### A note on caching + +The npm cli utilizes its internal package cache when using the package name specified. +You can use the following to change how and when the cli uses this cache. +See [`npm cache`](/commands/npm-cache) for more on how the cache works. + +#### prefer-online + +Forces staleness checks for packages, making the cli look for updates immediately even if the package is already in the cache. + +#### prefer-offline + +Bypasses staleness checks for packages. +Missing data will still be requested from the server. +To force full offline mode, use `offline`. + +#### offline + +Forces full offline mode. +Any packages not locally cached will result in an error. + +#### workspace + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result to selecting all of the nested workspaces) + +This value is not exported to the environment for child processes. + +#### workspaces + +* Alias: `--ws` +* Type: Boolean +* Default: `false` + +Run scripts in the context of all configured workspaces for the current project. + +### See Also + +* [npm run](/commands/npm-run) +* [npm scripts](/using-npm/scripts) +* [npm test](/commands/npm-test) +* [npm start](/commands/npm-start) +* [npm restart](/commands/npm-restart) +* [npm stop](/commands/npm-stop) +* [npm config](/commands/npm-config) +* [npm workspaces](/using-npm/workspaces) +* [npx](/commands/npx) diff --git a/node24/node_modules/npm/docs/content/commands/npm-explain.md b/node24/node_modules/npm/docs/content/commands/npm-explain.md new file mode 100644 index 0000000000000000000000000000000000000000..059926529a826eac2ca355646704037f32153adf --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-explain.md @@ -0,0 +1,101 @@ +--- +title: npm-explain +section: 1 +description: Explain installed packages +--- + +### Synopsis + +```bash +npm explain + +alias: why +``` + +### Description + +This command will print the chain of dependencies causing a given package to be installed in the current project. + +If one or more package specs are provided, then only packages matching one of the specifiers will have their relationships explained. + +The package spec can also refer to a folder within `./node_modules` + +For example, running `npm explain glob` within npm's source tree will show: + +```bash +glob@7.1.6 +node_modules/glob + glob@"^7.1.4" from the root project + +glob@7.1.1 dev +node_modules/tacks/node_modules/glob + glob@"^7.0.5" from rimraf@2.6.2 + node_modules/tacks/node_modules/rimraf + rimraf@"^2.6.2" from tacks@1.3.0 + node_modules/tacks + dev tacks@"^1.3.0" from the root project +``` + +To explain just the package residing at a specific folder, pass that as the argument to the command. +This can be useful when trying to figure out exactly why a given dependency is being duplicated to satisfy conflicting version requirements within the project. + +```bash +$ npm explain node_modules/nyc/node_modules/find-up +find-up@3.0.0 dev +node_modules/nyc/node_modules/find-up + find-up@"^3.0.0" from nyc@14.1.1 + node_modules/nyc + nyc@"^14.1.1" from tap@14.10.8 + node_modules/tap + dev tap@"^14.10.8" from the root project +``` + +### Configuration +#### `json` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +### See Also + +* [package spec](/using-npm/package-spec) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [npm folders](/configuring-npm/folders) +* [npm ls](/commands/npm-ls) +* [npm install](/commands/npm-install) +* [npm link](/commands/npm-link) +* [npm prune](/commands/npm-prune) +* [npm outdated](/commands/npm-outdated) +* [npm update](/commands/npm-update) diff --git a/node24/node_modules/npm/docs/content/commands/npm-explore.md b/node24/node_modules/npm/docs/content/commands/npm-explore.md new file mode 100644 index 0000000000000000000000000000000000000000..ee86308c6bab1aa4edec0436d2136190c1e322c2 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-explore.md @@ -0,0 +1,46 @@ +--- +title: npm-explore +section: 1 +description: Browse an installed package +--- + +### Synopsis + +```bash +npm explore [ -- ] +``` + +Note: This command is unaware of workspaces. + +### Description + +Spawn a subshell in the directory of the installed package specified. + +If a command is specified, then it is run in the subshell, which then immediately terminates. + +This is particularly handy in the case of git submodules in the `node_modules` folder: + +```bash +npm explore some-dependency -- git pull origin master +``` + +Note that the package is *not* automatically rebuilt afterwards, so be sure to use `npm rebuild ` if you make any changes. + +### Configuration + +#### `shell` + +* Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on + Windows +* Type: String + +The shell to run for the `npm explore` command. + + + +### See Also + +* [npm folders](/configuring-npm/folders) +* [npm edit](/commands/npm-edit) +* [npm rebuild](/commands/npm-rebuild) +* [npm install](/commands/npm-install) diff --git a/node24/node_modules/npm/docs/content/commands/npm-find-dupes.md b/node24/node_modules/npm/docs/content/commands/npm-find-dupes.md new file mode 100644 index 0000000000000000000000000000000000000000..5f43ebc1340adcabff81a7bd885e6d0b76119b13 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-find-dupes.md @@ -0,0 +1,245 @@ +--- +title: npm-find-dupes +section: 1 +description: Find duplication in the package tree +--- + +### Synopsis + +```bash +npm find-dupes +``` + +### Description + +Runs `npm dedupe` in `--dry-run` mode, making npm only output the duplications, without actually changing the package tree. + +### Configuration + +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", "shallow", or "linked" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (experimental) install in node_modules/.store, +link in place, unhoisted. + + + +#### `legacy-bundling` + +* Default: false +* Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` + +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. + + + +#### `global-style` + +* Default: false +* Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` + +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependencies. Sets `--install-strategy=shallow`. + + + +#### `strict-peer-deps` + +* Default: false +* Type: Boolean + +If set to `true`, and `--legacy-peer-deps` is not set, then _any_ +conflicting `peerDependencies` will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships. + +By default, conflicting `peerDependencies` deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's `peerDependencies` object. + +When such an override is performed, a warning is printed, explaining the +conflict and the packages involved. If `--strict-peer-deps` is set, then +this warning is treated as a failure. + + + +#### `package-lock` + +* Default: true +* Type: Boolean + +If set to false, then ignore `package-lock.json` files when installing. This +will also prevent _writing_ `package-lock.json` if `save` is true. + + + +#### `omit` + +* Default: 'dev' if the `NODE_ENV` environment variable is set to + 'production'; otherwise, empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) + +Dependency types to omit from the installation tree on disk. + +Note that these dependencies _are_ still resolved and added to the +`package-lock.json` or `npm-shrinkwrap.json` file. They are just not +physically installed on disk. + +If a package type appears in both the `--include` and `--omit` lists, then +it will be included. + +If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment +variable will be set to `'production'` for all lifecycle scripts. + + + +#### `include` + +* Default: +* Type: "prod", "dev", "optional", or "peer" (can be set multiple times) + +Option that allows for defining which types of dependencies to install. + +This is the inverse of `--omit=`. + +Dependency types specified in `--include` will not be omitted, regardless of +the order in which omit/include are specified on the command-line. + + + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +#### `audit` + +* Default: true +* Type: Boolean + +When "true" submit audit reports alongside the current npm command to the +default registry and all registries configured for scopes. See the +documentation for [`npm audit`](/commands/npm-audit) for details on what is +submitted. + + + +#### `bin-links` + +* Default: true +* Type: Boolean + +Tells npm to create symlinks (or `.cmd` shims on Windows) for package +executables. + +Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems. + + + +#### `fund` + +* Default: true +* Type: Boolean + +When "true" displays the message at the end of each `npm install` +acknowledging the number of dependencies looking for funding. See [`npm +fund`](/commands/npm-fund) for details. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `install-links` + +* Default: false +* Type: Boolean + +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. + + + +### See Also + +* [npm dedupe](/commands/npm-dedupe) +* [npm ls](/commands/npm-ls) +* [npm update](/commands/npm-update) +* [npm install](/commands/npm-install) + diff --git a/node24/node_modules/npm/docs/content/commands/npm-fund.md b/node24/node_modules/npm/docs/content/commands/npm-fund.md new file mode 100644 index 0000000000000000000000000000000000000000..90cb37226a24a9aeb34f5dac7ee9e4bafcb304cf --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-fund.md @@ -0,0 +1,136 @@ +--- +title: npm-fund +section: 1 +description: Retrieve funding information +--- + +### Synopsis + +```bash +npm fund [] +``` + +### Description + +This command retrieves information on how to fund the dependencies of a given project. +If no package name is provided, it will list all dependencies that are looking for funding in a tree structure, listing the type of funding and the url to visit. +If a package name is provided then it tries to open its funding url using the [`--browser` config](/using-npm/config#browser) param; if there are multiple funding sources for the package, the user will be instructed to pass the +`--which` option to disambiguate. + +The list will avoid duplicated entries and will stack all packages that share the same url as a single entry. +Thus, the list does not have the same shape of the output from `npm ls`. + +#### Example + +### Workspaces support + +It's possible to filter the results to only include a single workspace and its dependencies using the [`workspace` config](/using-npm/config#workspace) option. + +#### Example: + +Here's an example running `npm fund` in a project with a configured workspace `a`: + +```bash +$ npm fund +test-workspaces-fund@1.0.0 ++-- https://example.com/a +| | `-- a@1.0.0 +| `-- https://example.com/maintainer +| `-- foo@1.0.0 ++-- https://example.com/npmcli-funding +| `-- @npmcli/test-funding +`-- https://example.com/org + `-- bar@2.0.0 +``` + +And here is an example of the expected result when filtering only by a specific workspace `a` in the same project: + +```bash +$ npm fund -w a +test-workspaces-fund@1.0.0 +`-- https://example.com/a + | `-- a@1.0.0 + `-- https://example.com/maintainer + `-- foo@2.0.0 +``` + +### Configuration + +#### `json` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. + + + +#### `browser` + +* Default: macOS: `"open"`, Windows: `"start"`, Others: `"xdg-open"` +* Type: null, Boolean, or String + +The browser that is called by npm commands to open websites. + +Set to `false` to suppress browser behavior and instead print urls to +terminal. + +Set to `true` to use default system URL opener. + + + +#### `unicode` + +* Default: false on windows, true on mac/unix systems with a unicode locale, + as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables. +* Type: Boolean + +When set to true, npm uses unicode characters in the tree output. When +false, it uses ascii characters instead of unicode glyphs. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `which` + +* Default: null +* Type: null or Number + +If there are multiple funding sources, which 1-indexed source URL to open. + + + +## See Also + +* [package spec](/using-npm/package-spec) +* [npm install](/commands/npm-install) +* [npm docs](/commands/npm-docs) +* [npm ls](/commands/npm-ls) +* [npm config](/commands/npm-config) +* [npm workspaces](/using-npm/workspaces) diff --git a/node24/node_modules/npm/docs/content/commands/npm-get.md b/node24/node_modules/npm/docs/content/commands/npm-get.md new file mode 100644 index 0000000000000000000000000000000000000000..fa96795dd85ac0f9191ace2b4478596b6960ce03 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-get.md @@ -0,0 +1,32 @@ +--- +title: npm-get +section: 1 +description: Get a value from the npm configuration +--- + +### Synopsis + +```bash +npm get [ ...] (See `npm config`) +``` + +Note: This command is unaware of workspaces. + +### Description + +Get a value from the npm configuration + +### Configuration + +#### `long` + +* Default: false +* Type: Boolean + +Show extended information in `ls`, `search`, and `help-search`. + + + +### See Also + +* [npm help config](/commands/npm-config) diff --git a/node24/node_modules/npm/docs/content/commands/npm-help-search.md b/node24/node_modules/npm/docs/content/commands/npm-help-search.md new file mode 100644 index 0000000000000000000000000000000000000000..fa47fcbebcd78e8e90bac181a8c4165ca65ed047 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-help-search.md @@ -0,0 +1,38 @@ +--- +title: npm-help-search +section: 1 +description: Search npm help documentation +--- + +### Synopsis + +```bash +npm help-search +``` + +Note: This command is unaware of workspaces. + +### Description + +This command will search the npm markdown documentation files for the terms provided, and then list the results, sorted by relevance. + +If only one result is found, then it will show that help topic. + +If the argument to `npm help` is not a known help topic, then it will call `help-search`. +It is rarely if ever necessary to call this command directly. + +### Configuration + +#### `long` + +* Default: false +* Type: Boolean + +Show extended information in `ls`, `search`, and `help-search`. + + + +### See Also + +* [npm](/commands/npm) +* [npm help](/commands/npm-help) diff --git a/node24/node_modules/npm/docs/content/commands/npm-help.md b/node24/node_modules/npm/docs/content/commands/npm-help.md new file mode 100644 index 0000000000000000000000000000000000000000..82f6b862a42369158b1fe752f1646c1bea3d040a --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-help.md @@ -0,0 +1,44 @@ +--- +title: npm-help +section: 1 +description: Get help on npm +--- + +### Synopsis + +```bash +npm help [] + +alias: hlep +``` + +Note: This command is unaware of workspaces. + +### Description + +If supplied a topic, then show the appropriate documentation page. + +If the topic does not exist, or if multiple terms are provided, then npm will run the `help-search` command to find a match. +Note that, if `help-search` finds a single subject, then it will run `help` on that topic, so unique matches are equivalent to specifying a topic name. + +### Configuration + +#### `viewer` + +* Default: "man" on Posix, "browser" on Windows +* Type: String + +The program to use to view help content. + +Set to `"browser"` to view html help content in the default web browser. + + + +### See Also + +* [npm](/commands/npm) +* [npm folders](/configuring-npm/folders) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [package.json](/configuring-npm/package-json) +* [npm help-search](/commands/npm-help-search) diff --git a/node24/node_modules/npm/docs/content/commands/npm-init.md b/node24/node_modules/npm/docs/content/commands/npm-init.md new file mode 100644 index 0000000000000000000000000000000000000000..ed8877cc881bbf673aa46fc7c9080cc3a26c39bd --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-init.md @@ -0,0 +1,348 @@ +--- +title: npm-init +section: 1 +description: Create a package.json file +--- + +### Synopsis + +```bash +npm init (same as `npx create-`) +npm init <@scope> (same as `npx <@scope>/create`) + +aliases: create, innit +``` + +### Description + +`npm init ` can be used to set up a new or existing npm package. + +`initializer` in this case is an npm package named `create-`, +which will be installed by [`npm-exec`](/commands/npm-exec), and then have its main bin executed -- presumably creating or updating `package.json` and running any other initialization-related operations. + +The init command is transformed to a corresponding `npm exec` operation as follows: + +* `npm init foo` -> `npm exec create-foo` +* `npm init @usr/foo` -> `npm exec @usr/create-foo` +* `npm init @usr` -> `npm exec @usr/create` +* `npm init @usr@2.0.0` -> `npm exec @usr/create@2.0.0` +* `npm init @usr/foo@2.0.0` -> `npm exec @usr/create-foo@2.0.0` + +If the initializer is omitted (by just calling `npm init`), init will fall back to legacy init behavior. +It will ask you a bunch of questions, and then write a package.json for you. +It will attempt to make reasonable guesses based on existing fields, dependencies, and options selected. +It is strictly additive, so it will keep any fields and values that were already set. +You can also use `-y`/`--yes` to skip the questionnaire altogether. +If you pass `--scope`, it will create a scoped package. + +*Note:* if a user already has the `create-` package globally installed, that will be what `npm init` uses. +If you want npm to use the latest version, or another specific version you must specify it: + +* `npm init foo@latest` # fetches and runs the latest `create-foo` from the registry +* `npm init foo@1.2.3` # runs `create-foo@1.2.3` specifically + +#### Forwarding additional options + +Any additional options will be passed directly to the command, so `npm init foo -- --hello` will map to `npm exec -- create-foo --hello`. + +To better illustrate how options are forwarded, here's a more evolved example showing options passed to both the **npm cli** and a create package, both following commands are equivalent: + +- `npm init foo -y --registry= -- --hello -a` +- `npm exec -y --registry= -- create-foo --hello -a` + +### Examples + +Create a new React-based project using [`create-react-app`](https://npm.im/create-react-app): + +```bash +$ npm init react-app ./my-react-app +``` + +Create a new `esm`-compatible package using [`create-esm`](https://npm.im/create-esm): + +```bash +$ mkdir my-esm-lib && cd my-esm-lib +$ npm init esm --yes +``` + +Generate a plain old package.json using legacy init: + +```bash +$ mkdir my-npm-pkg && cd my-npm-pkg +$ git init +$ npm init +``` + +Generate it without having it ask any questions: + +```bash +$ npm init -y +``` + +Set the private flag to `true` in package.json: +```bash +$ npm init --init-private -y +``` + +### Workspaces support + +It's possible to create a new workspace within your project by using the `workspace` config option. +When using `npm init -w ` the cli will create the folders and boilerplate expected while also adding a reference to your project `package.json` `"workspaces": []` property in order to make sure that new generated **workspace** is properly set up as such. + +Given a project with no workspaces, e.g: + +``` +. ++-- package.json +``` + +You may generate a new workspace using the legacy init: + +```bash +$ npm init -w packages/a +``` + +That will generate a new folder and `package.json` file, while also updating your top-level `package.json` to add the reference to this new workspace: + +``` +. ++-- package.json +`-- packages + `-- a + `-- package.json +``` + +The workspaces init also supports the `npm init -w ` syntax, following the same set of rules explained earlier in the initial +**Description** section of this page. +Similar to the previous example of creating a new React-based project using [`create-react-app`](https://npm.im/create-react-app), the following syntax will make sure to create the new react app as a nested **workspace** within your project and configure your `package.json` to recognize it as such: + +```bash +npm init -w packages/my-react-app react-app . +``` + +This will make sure to generate your react app as expected, one important consideration to have in mind is that `npm exec` is going to be run in the context of the newly created folder for that workspace, and that's the reason why in this example the initializer uses the initializer name followed with a dot to represent the current directory in that context, e.g: `react-app .`: + +``` +. ++-- package.json +`-- packages + +-- a + | `-- package.json + `-- my-react-app + +-- README + +-- package.json + `-- ... +``` + +### Configuration + +#### `init-author-name` + +* Default: "" +* Type: String + +The value `npm init` should use by default for the package author's name. + + + +#### `init-author-url` + +* Default: "" +* Type: "" or URL + +The value `npm init` should use by default for the package author's +homepage. + + + +#### `init-license` + +* Default: "ISC" +* Type: String + +The value `npm init` should use by default for the package license. + + + +#### `init-module` + +* Default: "~/.npm-init.js" +* Type: Path + +A module that will be loaded by the `npm init` command. See the +documentation for the +[init-package-json](https://github.com/npm/init-package-json) module for +more information, or [npm init](/commands/npm-init). + + + +#### `init-type` + +* Default: "commonjs" +* Type: String + +The value that `npm init` should use by default for the package.json type +field. + + + +#### `init-version` + +* Default: "1.0.0" +* Type: SemVer string + +The value that `npm init` should use by default for the package version +number, if not already set in package.json. + + + +#### `init-private` + +* Default: false +* Type: Boolean + +The value `npm init` should use by default for the package's private flag. + + + +#### `yes` + +* Default: null +* Type: null or Boolean + +Automatically answer "yes" to any prompts that npm might print on the +command line. + + + +#### `force` + +* Default: false +* Type: Boolean + +Removes various protections against unfortunate side effects, common +mistakes, unnecessary performance degradation, and malicious input. + +* Allow clobbering non-npm files in global installs. +* Allow the `npm version` command to work on an unclean git repository. +* Allow deleting the cache folder with `npm cache clean`. +* Allow installing packages that have an `engines` declaration requiring a + different version of npm. +* Allow installing packages that have an `engines` declaration requiring a + different version of `node`, even if `--engine-strict` is enabled. +* Allow `npm audit fix` to install modules outside your stated dependency + range (including SemVer-major changes). +* Allow unpublishing all versions of a published package. +* Allow conflicting peerDependencies to be installed in the root project. +* Implicitly set `--yes` during `npm init`. +* Allow clobbering existing values in `npm pkg` +* Allow unpublishing of entire packages (not just a single version). + +If you don't have a clear idea of what you want to do, it is strongly +recommended that you do not use this option! + + + +#### `scope` + +* Default: the scope of the current project, if any, or "" +* Type: String + +Associate an operation with a scope for a scoped registry. + +Useful when logging in to or out of a private registry: + +``` +# log in, linking the scope to the custom registry +npm login --scope=@mycorp --registry=https://registry.mycorp.com + +# log out, removing the link and the auth token +npm logout --scope=@mycorp +``` + +This will cause `@mycorp` to be mapped to the registry for future +installation of packages specified according to the pattern +`@mycorp/package`. + +This will also cause `npm init` to create a scoped package. + +``` +# accept all defaults, and create a package named "@foo/whatever", +# instead of just named "whatever" +npm init --scope=@foo --yes +``` + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `workspaces-update` + +* Default: true +* Type: Boolean + +If set to true, the npm cli will run an update after operations that may +possibly change the workspaces installed to the `node_modules` folder. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +### See Also + +* [package spec](/using-npm/package-spec) +* [init-package-json module](http://npm.im/init-package-json) +* [package.json](/configuring-npm/package-json) +* [npm version](/commands/npm-version) +* [npm scope](/using-npm/scope) +* [npm exec](/commands/npm-exec) +* [npm workspaces](/using-npm/workspaces) diff --git a/node24/node_modules/npm/docs/content/commands/npm-install-ci-test.md b/node24/node_modules/npm/docs/content/commands/npm-install-ci-test.md new file mode 100644 index 0000000000000000000000000000000000000000..0e8b04c26634df13d8054e897936a2e32874da6b --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-install-ci-test.md @@ -0,0 +1,283 @@ +--- +title: npm-install-ci-test +section: 1 +description: Install a project with a clean slate and run tests +--- + +### Synopsis + +```bash +npm install-ci-test + +aliases: cit, clean-install-test, sit +``` + +### Description + +This command runs `npm ci` followed immediately by `npm test`. + +### Configuration + +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", "shallow", or "linked" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (experimental) install in node_modules/.store, +link in place, unhoisted. + + + +#### `legacy-bundling` + +* Default: false +* Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` + +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. + + + +#### `global-style` + +* Default: false +* Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` + +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependencies. Sets `--install-strategy=shallow`. + + + +#### `omit` + +* Default: 'dev' if the `NODE_ENV` environment variable is set to + 'production'; otherwise, empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) + +Dependency types to omit from the installation tree on disk. + +Note that these dependencies _are_ still resolved and added to the +`package-lock.json` or `npm-shrinkwrap.json` file. They are just not +physically installed on disk. + +If a package type appears in both the `--include` and `--omit` lists, then +it will be included. + +If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment +variable will be set to `'production'` for all lifecycle scripts. + + + +#### `include` + +* Default: +* Type: "prod", "dev", "optional", or "peer" (can be set multiple times) + +Option that allows for defining which types of dependencies to install. + +This is the inverse of `--omit=`. + +Dependency types specified in `--include` will not be omitted, regardless of +the order in which omit/include are specified on the command-line. + + + +#### `strict-peer-deps` + +* Default: false +* Type: Boolean + +If set to `true`, and `--legacy-peer-deps` is not set, then _any_ +conflicting `peerDependencies` will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships. + +By default, conflicting `peerDependencies` deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's `peerDependencies` object. + +When such an override is performed, a warning is printed, explaining the +conflict and the packages involved. If `--strict-peer-deps` is set, then +this warning is treated as a failure. + + + +#### `foreground-scripts` + +* Default: `false` unless when using `npm pack` or `npm publish` where it + defaults to `true` +* Type: Boolean + +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. + + + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +#### `allow-git` + +* Default: "all" +* Type: "all", "none", or "root" + +Limits the ability for npm to fetch dependencies from git references. That +is, dependencies that point to a git repo instead of a version or semver +range. Please note that this could leave your tree incomplete and some +packages may not function as intended or designed. + +`all` allows any git dependencies to be fetched and installed. `none` +prevents any git dependencies from being fetched and installed. `root` only +allows git dependencies defined in your project's package.json to be fetched +installed. Also allows git dependencies to be fetched for other commands +like `npm view` + + + +#### `audit` + +* Default: true +* Type: Boolean + +When "true" submit audit reports alongside the current npm command to the +default registry and all registries configured for scopes. See the +documentation for [`npm audit`](/commands/npm-audit) for details on what is +submitted. + + + +#### `bin-links` + +* Default: true +* Type: Boolean + +Tells npm to create symlinks (or `.cmd` shims on Windows) for package +executables. + +Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems. + + + +#### `fund` + +* Default: true +* Type: Boolean + +When "true" displays the message at the end of each `npm install` +acknowledging the number of dependencies looking for funding. See [`npm +fund`](/commands/npm-fund) for details. + + + +#### `dry-run` + +* Default: false +* Type: Boolean + +Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, `install`, `update`, +`dedupe`, `uninstall`, as well as `pack` and `publish`. + +Note: This is NOT honored by other network related commands, eg `dist-tags`, +`owner`, etc. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `install-links` + +* Default: false +* Type: Boolean + +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. + + + +### See Also + +* [npm install-test](/commands/npm-install-test) +* [npm ci](/commands/npm-ci) +* [npm test](/commands/npm-test) diff --git a/node24/node_modules/npm/docs/content/commands/npm-install-test.md b/node24/node_modules/npm/docs/content/commands/npm-install-test.md new file mode 100644 index 0000000000000000000000000000000000000000..1d688974bf1cab6fd975507d738f4ba2ece30a4c --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-install-test.md @@ -0,0 +1,424 @@ +--- +title: npm-install-test +section: 1 +description: Install package(s) and run tests +--- + +### Synopsis + +```bash +npm install-test [ ...] + +alias: it +``` + +### Description + +This command runs an `npm install` followed immediately by an `npm test`. +It takes exactly the same arguments as `npm install`. + +### Configuration + +#### `save` + +* Default: `true` unless when using `npm update` where it defaults to `false` +* Type: Boolean + +Save installed packages to a `package.json` file as dependencies. + +When used with the `npm rm` command, removes the dependency from +`package.json`. + +Will also prevent writing to `package-lock.json` if set to `false`. + + + +#### `save-exact` + +* Default: false +* Type: Boolean + +Dependencies saved to package.json will be configured with an exact version +rather than using npm's default semver range operator. + + + +#### `global` + +* Default: false +* Type: Boolean + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", "shallow", or "linked" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (experimental) install in node_modules/.store, +link in place, unhoisted. + + + +#### `legacy-bundling` + +* Default: false +* Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` + +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. + + + +#### `global-style` + +* Default: false +* Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` + +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependencies. Sets `--install-strategy=shallow`. + + + +#### `omit` + +* Default: 'dev' if the `NODE_ENV` environment variable is set to + 'production'; otherwise, empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) + +Dependency types to omit from the installation tree on disk. + +Note that these dependencies _are_ still resolved and added to the +`package-lock.json` or `npm-shrinkwrap.json` file. They are just not +physically installed on disk. + +If a package type appears in both the `--include` and `--omit` lists, then +it will be included. + +If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment +variable will be set to `'production'` for all lifecycle scripts. + + + +#### `include` + +* Default: +* Type: "prod", "dev", "optional", or "peer" (can be set multiple times) + +Option that allows for defining which types of dependencies to install. + +This is the inverse of `--omit=`. + +Dependency types specified in `--include` will not be omitted, regardless of +the order in which omit/include are specified on the command-line. + + + +#### `strict-peer-deps` + +* Default: false +* Type: Boolean + +If set to `true`, and `--legacy-peer-deps` is not set, then _any_ +conflicting `peerDependencies` will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships. + +By default, conflicting `peerDependencies` deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's `peerDependencies` object. + +When such an override is performed, a warning is printed, explaining the +conflict and the packages involved. If `--strict-peer-deps` is set, then +this warning is treated as a failure. + + + +#### `prefer-dedupe` + +* Default: false +* Type: Boolean + +Prefer to deduplicate packages if possible, rather than choosing a newer +version of a dependency. + + + +#### `package-lock` + +* Default: true +* Type: Boolean + +If set to false, then ignore `package-lock.json` files when installing. This +will also prevent _writing_ `package-lock.json` if `save` is true. + + + +#### `package-lock-only` + +* Default: false +* Type: Boolean + +If set to true, the current operation will only use the `package-lock.json`, +ignoring `node_modules`. + +For `update` this means only the `package-lock.json` will be updated, +instead of checking `node_modules` and downloading dependencies. + +For `list` this means the output will be based on the tree described by the +`package-lock.json`, rather than the contents of `node_modules`. + + + +#### `foreground-scripts` + +* Default: `false` unless when using `npm pack` or `npm publish` where it + defaults to `true` +* Type: Boolean + +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. + + + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +#### `allow-git` + +* Default: "all" +* Type: "all", "none", or "root" + +Limits the ability for npm to fetch dependencies from git references. That +is, dependencies that point to a git repo instead of a version or semver +range. Please note that this could leave your tree incomplete and some +packages may not function as intended or designed. + +`all` allows any git dependencies to be fetched and installed. `none` +prevents any git dependencies from being fetched and installed. `root` only +allows git dependencies defined in your project's package.json to be fetched +installed. Also allows git dependencies to be fetched for other commands +like `npm view` + + + +#### `audit` + +* Default: true +* Type: Boolean + +When "true" submit audit reports alongside the current npm command to the +default registry and all registries configured for scopes. See the +documentation for [`npm audit`](/commands/npm-audit) for details on what is +submitted. + + + +#### `before` + +* Default: null +* Type: null or Date + +If passed to `npm install`, will rebuild the npm tree such that only +versions that were available **on or before** the given date are installed. +If there are no versions available for the current set of dependencies, the +command will error. + +If the requested version is a `dist-tag` and the given tag does not pass the +`--before` filter, the most recent version less than or equal to that tag +will be used. For example, `foo@latest` might install `foo@1.2` even though +`latest` is `2.0`. + +This config cannot be used with: `min-release-age` + +#### `min-release-age` + +* Default: null +* Type: null or Number + +If set, npm will build the npm tree such that only versions that were +available more than the given number of days ago will be installed. If there +are no versions available for the current set of dependencies, the command +will error. + +This flag is a complement to `before`, which accepts an exact date instead +of a relative number of days. + +This config cannot be used with: `before` + +This value is not exported to the environment for child processes. + +#### `bin-links` + +* Default: true +* Type: Boolean + +Tells npm to create symlinks (or `.cmd` shims on Windows) for package +executables. + +Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems. + + + +#### `fund` + +* Default: true +* Type: Boolean + +When "true" displays the message at the end of each `npm install` +acknowledging the number of dependencies looking for funding. See [`npm +fund`](/commands/npm-fund) for details. + + + +#### `dry-run` + +* Default: false +* Type: Boolean + +Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, `install`, `update`, +`dedupe`, `uninstall`, as well as `pack` and `publish`. + +Note: This is NOT honored by other network related commands, eg `dist-tags`, +`owner`, etc. + + + +#### `cpu` + +* Default: null +* Type: null or String + +Override CPU architecture of native modules to install. Acceptable values +are same as `cpu` field of package.json, which comes from `process.arch`. + + + +#### `os` + +* Default: null +* Type: null or String + +Override OS of native modules to install. Acceptable values are same as `os` +field of package.json, which comes from `process.platform`. + + + +#### `libc` + +* Default: null +* Type: null or String + +Override libc of native modules to install. Acceptable values are same as +`libc` field of package.json + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `install-links` + +* Default: false +* Type: Boolean + +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. + + + +### See Also + +* [npm install](/commands/npm-install) +* [npm install-ci-test](/commands/npm-install-ci-test) +* [npm test](/commands/npm-test) diff --git a/node24/node_modules/npm/docs/content/commands/npm-install.md b/node24/node_modules/npm/docs/content/commands/npm-install.md new file mode 100644 index 0000000000000000000000000000000000000000..1d5cf2a6e9b558bd07fe94ef539687f71aa4c165 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-install.md @@ -0,0 +1,807 @@ +--- +title: npm-install +section: 1 +description: Install a package +--- + +### Synopsis + +```bash +npm install [ ...] + +aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall +``` + +### Description + +This command installs a package and any packages that it depends on. +If the package has a package-lock, or an npm shrinkwrap file, or a yarn lock file, the installation of dependencies will be driven by that, respecting the following order of precedence: + +* `npm-shrinkwrap.json` +* `package-lock.json` +* `yarn.lock` + +See [package-lock.json](/configuring-npm/package-lock-json) and [`npm shrinkwrap`](/commands/npm-shrinkwrap). + +#### How `npm install` uses `package-lock.json` + +When you run `npm install` without arguments, npm compares `package.json` and `package-lock.json`: + +* **If the lockfile's resolved versions satisfy the `package.json` ranges:** npm uses the exact versions from `package-lock.json` to ensure reproducible builds across environments. + +* **If the ranges don't match:** npm resolves new versions that satisfy the `package.json` ranges and updates `package-lock.json` accordingly. This happens when you modify version ranges in `package.json` (e.g., changing `^7.0.0` to `^8.0.0`). Note that changing a range within the same major version (e.g., `^7.0.0` to `^7.1.0`) will only update the metadata in the lockfile if the currently installed version still satisfies the new range. + +In essence, `package-lock.json` locks your dependencies to specific versions, but `package.json` is the source of truth for acceptable version ranges. When the lockfile's versions satisfy the `package.json` ranges, the lockfile wins. When they conflict, `package.json` wins and the lockfile is updated. + +If you want to install packages while ensuring that `package.json` is not modified and that both files are strictly in sync, use [`npm ci`](/commands/npm-ci) instead. + +A `package` is: + +* a) a folder containing a program described by a [`package.json`](/configuring-npm/package-json) file +* b) a gzipped tarball containing (a) +* c) a url that resolves to (b) +* d) a `@` that is published on the registry (see [`registry`](/using-npm/registry)) with (c) +* e) a `@` (see [`npm dist-tag`](/commands/npm-dist-tag)) that points to (d) +* f) a `` that has a "latest" tag satisfying (e) +* g) a `` that resolves to (a) + +Even if you never publish your package, you can still get a lot of benefits of using npm if you just want to write a node program (a), and perhaps if you also want to be able to easily install it elsewhere after packing it up into a tarball (b). + + +* `npm install` (in a package directory, no arguments): + + Install the dependencies to the local `node_modules` folder. + + In global mode (ie, with `-g` or `--global` appended to the command), it installs the current package context (ie, the current working directory) as a global package. + + By default, `npm install` will install all modules listed as dependencies in [`package.json`](/configuring-npm/package-json). + + With the `--production` flag (or when the `NODE_ENV` environment variable is set to `production`), npm will not install modules listed in `devDependencies`. + To install all modules listed in both `dependencies` and `devDependencies` when `NODE_ENV` environment variable is set to `production`, you can use `--production=false`. + + > NOTE: The `--production` flag has no particular meaning when adding a dependency to a project. + +* `npm install `: + + If `` sits inside the root of your project, its dependencies will be installed and may be hoisted to the top-level `node_modules` as they would for other types of dependencies. + If `` sits outside the root of your project, *npm will not install the package dependencies* in the directory ``, but it will create a symlink to ``. + + > NOTE: If you want to install the content of a directory like a package from the registry instead of creating a link, you would need to use the `--install-links` option. + + Example: + + ```bash + npm install ../../other-package --install-links + npm install ./sub-package + ``` + +* `npm install `: + + Install a package that is sitting on the filesystem. + Note: if you just want to link a dev directory into your npm root, you can do this more easily by using [`npm link`](/commands/npm-link). + + Tarball requirements: + * The filename *must* use `.tar`, `.tar.gz`, or `.tgz` as the extension. + * The package contents should reside in a subfolder inside the tarball (usually it is called `package/`). + npm strips one directory layer when installing the package (an equivalent of `tar x --strip-components=1` is run). + * The package must contain a `package.json` file with `name` and `version` properties. + + Example: + + ```bash + npm install ./package.tgz + ``` + +* `npm install `: + + Fetch the tarball url, and then install it. + In order to distinguish between this and other options, the argument must start with "http://" or "https://" + + Example: + + ```bash + npm install https://github.com/indexzero/forever/tarball/v0.5.6 + ``` + +* `npm install [<@scope>/]`: + + Do a `@` install, where `` is the "tag" config. + (See [`config`](/using-npm/config#tag). + The config's default value is `latest`.) + + In most cases, this will install the version of the modules tagged as `latest` on the npm registry. + + **Note:** When installing by name without specifying a version or tag, npm prioritizes versions that match the current Node.js version based on the package's `engines` field. If the `latest` tag points to a version incompatible with your current Node.js version, npm will install the newest compatible version instead. To install a specific version regardless of `engines` compatibility, explicitly specify the version or tag: `npm install @latest`. + + Example: + + ```bash + npm install sax + ``` + + `npm install` saves any specified packages into `dependencies` by default. + Additionally, you can control where and how they get saved with some additional flags: + + * `-P, --save-prod`: Package will appear in your `dependencies`. + This is the default unless `-D` or `-O` are present. + + * `-D, --save-dev`: Package will appear in your `devDependencies`. + + * `--save-peer`: Package will appear in your `peerDependencies`. + + * `-O, --save-optional`: Package will appear in your + `optionalDependencies`. + + * `--no-save`: Prevents saving to `dependencies`. + + When using any of the above options to save dependencies to your package.json, there are two additional, optional flags: + + * `-E, --save-exact`: Saved dependencies will be configured with an exact version rather than using npm's default semver range operator. + + * `-B, --save-bundle`: Saved dependencies will also be added to your `bundleDependencies` list. + + Further, if you have an `npm-shrinkwrap.json` or `package-lock.json` then it will be updated as well. + + `` is optional. + The package will be downloaded from the registry associated with the specified scope. + If no registry is associated with the given scope the default registry is assumed. + See [`scope`](/using-npm/scope). + + Note: if you do not include the @-symbol on your scope name, npm will interpret this as a GitHub repository instead, see below. + Scopes names must also be followed by a slash. + + Examples: + + ```bash + npm install sax + npm install githubname/reponame + npm install @myorg/privatepackage + npm install node-tap --save-dev + npm install dtrace-provider --save-optional + npm install readable-stream --save-exact + npm install ansi-regex --save-bundle + ``` + +* `npm install @npm:`: + + Install a package under a custom alias. + Allows multiple versions of a same-name package side-by-side, more convenient import names for packages with otherwise long ones, and using git forks replacements or forked npm packages as replacements. + Aliasing works only on your project and does not rename packages in transitive dependencies. + Aliases should follow the naming conventions stated in [`validate-npm-package-name`](https://www.npmjs.com/package/validate-npm-package-name#naming-rules). + + Examples: + + ```bash + npm install my-react@npm:react + npm install jquery2@npm:jquery@2 + npm install jquery3@npm:jquery@3 + npm install npa@npm:npm-package-arg + ``` + +* `npm install [<@scope>/]@`: + + Install the version of the package that is referenced by the specified tag. + If the tag does not exist in the registry data for that package, then this will fail. + + Example: + + ```bash + npm install sax@latest + npm install @myorg/mypackage@latest + ``` + +* `npm install [<@scope>/]@`: + + Install the specified version of the package. + This will fail if the version has not been published to the registry. + + Example: + + ```bash + npm install sax@0.1.1 + npm install @myorg/privatepackage@1.5.0 + ``` + +* `npm install [<@scope>/]@`: + + Install a version of the package matching the specified version range. + This will follow the same rules for resolving dependencies described in [`package.json`](/configuring-npm/package-json). + + Note that most version ranges must be put in quotes so that your shell will treat it as a single argument. + + Example: + + ```bash + npm install sax@">=0.1.0 <0.2.0" + npm install @myorg/privatepackage@"16 - 17" + ``` + + **Prerelease versions:** By default, version ranges only match stable versions. To include prerelease versions, they must be explicitly specified in the range. Prerelease versions are tied to a specific version triple (major.minor.patch). For example, `^1.2.3-beta.1` will only match prereleases for `1.2.x`, not `1.3.x`. To match all prereleases for a major version, use a range like `^1.0.0-0`, which will include all `1.x.x` prereleases. + + Example: + + ```bash + npm install package@^1.2.3-beta.1 # Matches 1.2.3-beta.1, 1.2.3-beta.2, 1.2.4-beta.1, etc. + npm install package@^1.0.0-0 # Matches all 1.x.x prereleases and stable versions + ``` + +* `npm install `: + + Installs the package from the hosted git provider, cloning it with `git`. + For a full git remote url, only that URL will be attempted. + + ```bash + ://[[:]@][:][:][/][# | #semver:] + ``` + + `` is one of `git`, `git+ssh`, `git+http`, `git+https`, or + `git+file`. + + If `#` is provided, it will be used to clone exactly that commit. + If the commit-ish has the format `#semver:`, `` can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. + If neither `#` or `#semver:` is specified, then the default branch of the repository is used. + + If the repository makes use of submodules, those submodules will be cloned as well. + + If the package being installed contains a `prepare` script, its `dependencies` and `devDependencies` will be installed, and the prepare script will be run, before the package is packaged and installed. + + The following git environment variables are recognized by npm and will be added to the environment when running git: + + * `GIT_ASKPASS` + * `GIT_EXEC_PATH` + * `GIT_PROXY_COMMAND` + * `GIT_SSH` + * `GIT_SSH_COMMAND` + * `GIT_SSL_CAINFO` + * `GIT_SSL_NO_VERIFY` + + See the git man page for details. + + Examples: + + ```bash + npm install git+ssh://git@github.com:npm/cli.git#v1.0.27 + npm install git+ssh://git@github.com:npm/cli#pull/273 + npm install git+ssh://git@github.com:npm/cli#semver:^5.0 + npm install git+https://isaacs@github.com/npm/cli.git + npm install git://github.com/npm/cli.git#v1.0.27 + GIT_SSH_COMMAND='ssh -i ~/.ssh/custom_ident' npm install git+ssh://git@github.com:npm/cli.git + ``` + +* `npm install /[#]`: +* `npm install github:/[#]`: + + Install the package at `https://github.com/githubname/githubrepo` by attempting to clone it using `git`. + + If `#` is provided, it will be used to clone exactly that commit. + If the commit-ish has the format `#semver:`, `` can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. + If neither `#` or `#semver:` is specified, then the default branch is used. + + As with regular git dependencies, `dependencies` and `devDependencies` will be installed if the package has a `prepare` script before the package is done installing. + + Examples: + + ```bash + npm install mygithubuser/myproject + npm install github:mygithubuser/myproject + ``` + +* `npm install gist:[/][#|#semver:]`: + + Install the package at `https://gist.github.com/gistID` by attempting to clone it using `git`. + The GitHub username associated with the gist is optional and will not be saved in `package.json`. + + As with regular git dependencies, `dependencies` and `devDependencies` will be installed if the package has a `prepare` script before the package is done installing. + + Example: + + ```bash + npm install gist:101a11beef + ``` + +* `npm install bitbucket:/[#]`: + + Install the package at `https://bitbucket.org/bitbucketname/bitbucketrepo` by attempting to clone it using `git`. + + If `#` is provided, it will be used to clone exactly that commit. + If the commit-ish has the format `#semver:`, `` can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. + If neither `#` or `#semver:` is specified, then `master` is used. + + As with regular git dependencies, `dependencies` and `devDependencies` will be installed if the package has a `prepare` script before the package is done installing. + + Example: + + ```bash + npm install bitbucket:mybitbucketuser/myproject + ``` + +* `npm install gitlab:/[#]`: + + Install the package at `https://gitlab.com/gitlabname/gitlabrepo` by attempting to clone it using `git`. + + If `#` is provided, it will be used to clone exactly that commit. + If the commit-ish has the format `#semver:`, `` can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. + If neither `#` or `#semver:` is specified, then `master` is used. + + As with regular git dependencies, `dependencies` and `devDependencies` will be installed if the package has a `prepare` script before the package is done installing. + + Example: + + ```bash + npm install gitlab:mygitlabuser/myproject + npm install gitlab:myusr/myproj#semver:^5.0 + ``` + +You may combine multiple arguments and even multiple types of arguments. +For example: + +```bash +npm install sax@">=0.1.0 <0.2.0" bench supervisor +``` + +The `--tag` argument will apply to all of the specified install targets. +If a tag with the given name exists, the tagged version is preferred over newer versions. + +**Note:** The `--tag` option only affects packages specified on the command line. It does not override version ranges specified in `package.json`. For example, if `package.json` specifies `"foo": "^1.0.0"` and you run `npm install --tag beta`, npm will still install a version matching `^1.0.0` even if the `beta` tag points to a different version. To install a tagged version, specify the package explicitly: `npm install foo@beta`. + +The `--dry-run` argument will report in the usual way what the install would have done without actually installing anything. + +The `--package-lock-only` argument will only update the `package-lock.json`, instead of checking `node_modules` and downloading dependencies. + +The `-f` or `--force` argument will force npm to fetch remote resources even if a local copy exists on disk. + +```bash +npm install sax --force +``` + +### Configuration + +See the [`config`](/using-npm/config) help doc. +Many of the configuration params have some effect on installation, since that's most of what npm does. + +These are some of the most common options related to installation. + +#### `save` + +* Default: `true` unless when using `npm update` where it defaults to `false` +* Type: Boolean + +Save installed packages to a `package.json` file as dependencies. + +When used with the `npm rm` command, removes the dependency from +`package.json`. + +Will also prevent writing to `package-lock.json` if set to `false`. + + + +#### `save-exact` + +* Default: false +* Type: Boolean + +Dependencies saved to package.json will be configured with an exact version +rather than using npm's default semver range operator. + + + +#### `global` + +* Default: false +* Type: Boolean + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", "shallow", or "linked" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (experimental) install in node_modules/.store, +link in place, unhoisted. + + + +#### `legacy-bundling` + +* Default: false +* Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` + +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. + + + +#### `global-style` + +* Default: false +* Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` + +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependencies. Sets `--install-strategy=shallow`. + + + +#### `omit` + +* Default: 'dev' if the `NODE_ENV` environment variable is set to + 'production'; otherwise, empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) + +Dependency types to omit from the installation tree on disk. + +Note that these dependencies _are_ still resolved and added to the +`package-lock.json` or `npm-shrinkwrap.json` file. They are just not +physically installed on disk. + +If a package type appears in both the `--include` and `--omit` lists, then +it will be included. + +If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment +variable will be set to `'production'` for all lifecycle scripts. + + + +#### `include` + +* Default: +* Type: "prod", "dev", "optional", or "peer" (can be set multiple times) + +Option that allows for defining which types of dependencies to install. + +This is the inverse of `--omit=`. + +Dependency types specified in `--include` will not be omitted, regardless of +the order in which omit/include are specified on the command-line. + + + +#### `strict-peer-deps` + +* Default: false +* Type: Boolean + +If set to `true`, and `--legacy-peer-deps` is not set, then _any_ +conflicting `peerDependencies` will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships. + +By default, conflicting `peerDependencies` deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's `peerDependencies` object. + +When such an override is performed, a warning is printed, explaining the +conflict and the packages involved. If `--strict-peer-deps` is set, then +this warning is treated as a failure. + + + +#### `prefer-dedupe` + +* Default: false +* Type: Boolean + +Prefer to deduplicate packages if possible, rather than choosing a newer +version of a dependency. + + + +#### `package-lock` + +* Default: true +* Type: Boolean + +If set to false, then ignore `package-lock.json` files when installing. This +will also prevent _writing_ `package-lock.json` if `save` is true. + + + +#### `package-lock-only` + +* Default: false +* Type: Boolean + +If set to true, the current operation will only use the `package-lock.json`, +ignoring `node_modules`. + +For `update` this means only the `package-lock.json` will be updated, +instead of checking `node_modules` and downloading dependencies. + +For `list` this means the output will be based on the tree described by the +`package-lock.json`, rather than the contents of `node_modules`. + + + +#### `foreground-scripts` + +* Default: `false` unless when using `npm pack` or `npm publish` where it + defaults to `true` +* Type: Boolean + +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. + + + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +#### `allow-git` + +* Default: "all" +* Type: "all", "none", or "root" + +Limits the ability for npm to fetch dependencies from git references. That +is, dependencies that point to a git repo instead of a version or semver +range. Please note that this could leave your tree incomplete and some +packages may not function as intended or designed. + +`all` allows any git dependencies to be fetched and installed. `none` +prevents any git dependencies from being fetched and installed. `root` only +allows git dependencies defined in your project's package.json to be fetched +installed. Also allows git dependencies to be fetched for other commands +like `npm view` + + + +#### `audit` + +* Default: true +* Type: Boolean + +When "true" submit audit reports alongside the current npm command to the +default registry and all registries configured for scopes. See the +documentation for [`npm audit`](/commands/npm-audit) for details on what is +submitted. + + + +#### `before` + +* Default: null +* Type: null or Date + +If passed to `npm install`, will rebuild the npm tree such that only +versions that were available **on or before** the given date are installed. +If there are no versions available for the current set of dependencies, the +command will error. + +If the requested version is a `dist-tag` and the given tag does not pass the +`--before` filter, the most recent version less than or equal to that tag +will be used. For example, `foo@latest` might install `foo@1.2` even though +`latest` is `2.0`. + +This config cannot be used with: `min-release-age` + +#### `min-release-age` + +* Default: null +* Type: null or Number + +If set, npm will build the npm tree such that only versions that were +available more than the given number of days ago will be installed. If there +are no versions available for the current set of dependencies, the command +will error. + +This flag is a complement to `before`, which accepts an exact date instead +of a relative number of days. + +This config cannot be used with: `before` + +This value is not exported to the environment for child processes. + +#### `bin-links` + +* Default: true +* Type: Boolean + +Tells npm to create symlinks (or `.cmd` shims on Windows) for package +executables. + +Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems. + + + +#### `fund` + +* Default: true +* Type: Boolean + +When "true" displays the message at the end of each `npm install` +acknowledging the number of dependencies looking for funding. See [`npm +fund`](/commands/npm-fund) for details. + + + +#### `dry-run` + +* Default: false +* Type: Boolean + +Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, `install`, `update`, +`dedupe`, `uninstall`, as well as `pack` and `publish`. + +Note: This is NOT honored by other network related commands, eg `dist-tags`, +`owner`, etc. + + + +#### `cpu` + +* Default: null +* Type: null or String + +Override CPU architecture of native modules to install. Acceptable values +are same as `cpu` field of package.json, which comes from `process.arch`. + + + +#### `os` + +* Default: null +* Type: null or String + +Override OS of native modules to install. Acceptable values are same as `os` +field of package.json, which comes from `process.platform`. + + + +#### `libc` + +* Default: null +* Type: null or String + +Override libc of native modules to install. Acceptable values are same as +`libc` field of package.json + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `install-links` + +* Default: false +* Type: Boolean + +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. + + + +### Algorithm + +Given a `package{dep}` structure: `A{B,C}, B{C}, C{D}`, the npm install algorithm produces: + +```bash +A ++-- B ++-- C ++-- D +``` + +That is, the dependency from B to C is satisfied by the fact that A already caused C to be installed at a higher level. +D is still installed at the top level because nothing conflicts with it. + +For `A{B,C}, B{C,D@1}, C{D@2}`, this algorithm produces: + +```bash +A ++-- B ++-- C + `-- D@2 ++-- D@1 +``` + +Because B's D@1 will be installed in the top-level, C now has to install D@2 privately for itself. +This algorithm is deterministic, but different trees may be produced if two dependencies are requested for installation in a different order. + +See [folders](/configuring-npm/folders) for a more detailed description of the specific folder structures that npm creates. + +### See Also + +* [npm folders](/configuring-npm/folders) +* [npm update](/commands/npm-update) +* [npm audit](/commands/npm-audit) +* [npm fund](/commands/npm-fund) +* [npm link](/commands/npm-link) +* [npm rebuild](/commands/npm-rebuild) +* [npm scripts](/using-npm/scripts) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [npm registry](/using-npm/registry) +* [npm dist-tag](/commands/npm-dist-tag) +* [npm uninstall](/commands/npm-uninstall) +* [npm shrinkwrap](/commands/npm-shrinkwrap) +* [package.json](/configuring-npm/package-json) +* [workspaces](/using-npm/workspaces) diff --git a/node24/node_modules/npm/docs/content/commands/npm-link.md b/node24/node_modules/npm/docs/content/commands/npm-link.md new file mode 100644 index 0000000000000000000000000000000000000000..574be114dbf5f53859cb44796c64219ba2cdcb6d --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-link.md @@ -0,0 +1,393 @@ +--- +title: npm-link +section: 1 +description: Symlink a package folder +--- + +### Synopsis + +```bash +npm link [] + +alias: ln +``` + +### Description + +This is handy for installing your own stuff, so that you can work on it and test iteratively without having to continually rebuild. + +Package linking is a two-step process. + +First, `npm link` in a package folder with no arguments will create a symlink in the global folder `{prefix}/lib/node_modules/` that links to the package where the `npm link` command was executed. +It will also link any bins in the package to `{prefix}/bin/{name}`. +Note that `npm link` uses the global prefix (see `npm prefix -g` for its value). + +Next, in some other location, `npm link package-name` will create a symbolic link from globally-installed `package-name` to `node_modules/` of the current folder. + +Note that `package-name` is taken from `package.json`, _not_ from the directory name. + +The package name can be optionally prefixed with a scope. +See [`scope`](/using-npm/scope). +The scope must be preceded by an @-symbol and followed by a slash. + +When creating tarballs for `npm publish`, the linked packages are "snapshotted" to their current state by resolving the symbolic links, if they are included in `bundleDependencies`. + +For example: + +```bash +cd ~/projects/node-redis # go into the package directory +npm link # creates global link +cd ~/projects/node-bloggy # go into some other package directory. +npm link redis # link-install the package +``` + +Now, any changes to `~/projects/node-redis` will be reflected in +`~/projects/node-bloggy/node_modules/node-redis/`. +Note that the link should be to the package name, not the directory name for that package. + +You may also shortcut the two steps in one. +For example, to do the above use-case in a shorter way: + +```bash +cd ~/projects/node-bloggy # go into the dir of your main project +npm link ../node-redis # link the dir of your dependency +``` + +The second line is the equivalent of doing: + +```bash +(cd ../node-redis; npm link) +npm link redis +``` + +That is, it first creates a global link, and then links the global installation target into your project's `node_modules` folder. + +Note that in this case, you are referring to the directory name, +`node-redis`, rather than the package name `redis`. + +If your linked package is scoped (see [`scope`](/using-npm/scope)) your link command must include that scope, e.g. + +```bash +npm link @myorg/privatepackage +``` + +### Caveat + +Note that package dependencies linked in this way are _not_ saved to `package.json` by default, on the assumption that the intention is to have a link stand in for a regular non-link dependency. +Otherwise, for example, if you depend on `redis@^3.0.1`, and ran `npm link redis`, it would replace the `^3.0.1` dependency with `file:../path/to/node-redis`, which you probably don't want! Additionally, other users or developers on your project would run into issues if they do not have their folders set up exactly the same as yours. + +If you are adding a _new_ dependency as a link, you should add it to the relevant metadata by running `npm install --package-lock-only`. + +If you _want_ to save the `file:` reference in your `package.json` and `package-lock.json` files, you can use `npm link --save` to do so. + +### Workspace Usage + +`npm link --workspace ` will link the relevant package as a dependency of the specified workspace(s). +Note that It may actually be linked into the parent project's `node_modules` folder, if there are no conflicting dependencies. + +`npm link --workspace ` will create a global link to the specified workspace(s). + +### Configuration + +#### `save` + +* Default: `true` unless when using `npm update` where it defaults to `false` +* Type: Boolean + +Save installed packages to a `package.json` file as dependencies. + +When used with the `npm rm` command, removes the dependency from +`package.json`. + +Will also prevent writing to `package-lock.json` if set to `false`. + + + +#### `save-exact` + +* Default: false +* Type: Boolean + +Dependencies saved to package.json will be configured with an exact version +rather than using npm's default semver range operator. + + + +#### `global` + +* Default: false +* Type: Boolean + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", "shallow", or "linked" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (experimental) install in node_modules/.store, +link in place, unhoisted. + + + +#### `legacy-bundling` + +* Default: false +* Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` + +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. + + + +#### `global-style` + +* Default: false +* Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` + +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependencies. Sets `--install-strategy=shallow`. + + + +#### `strict-peer-deps` + +* Default: false +* Type: Boolean + +If set to `true`, and `--legacy-peer-deps` is not set, then _any_ +conflicting `peerDependencies` will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships. + +By default, conflicting `peerDependencies` deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's `peerDependencies` object. + +When such an override is performed, a warning is printed, explaining the +conflict and the packages involved. If `--strict-peer-deps` is set, then +this warning is treated as a failure. + + + +#### `package-lock` + +* Default: true +* Type: Boolean + +If set to false, then ignore `package-lock.json` files when installing. This +will also prevent _writing_ `package-lock.json` if `save` is true. + + + +#### `omit` + +* Default: 'dev' if the `NODE_ENV` environment variable is set to + 'production'; otherwise, empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) + +Dependency types to omit from the installation tree on disk. + +Note that these dependencies _are_ still resolved and added to the +`package-lock.json` or `npm-shrinkwrap.json` file. They are just not +physically installed on disk. + +If a package type appears in both the `--include` and `--omit` lists, then +it will be included. + +If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment +variable will be set to `'production'` for all lifecycle scripts. + + + +#### `include` + +* Default: +* Type: "prod", "dev", "optional", or "peer" (can be set multiple times) + +Option that allows for defining which types of dependencies to install. + +This is the inverse of `--omit=`. + +Dependency types specified in `--include` will not be omitted, regardless of +the order in which omit/include are specified on the command-line. + + + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +#### `allow-git` + +* Default: "all" +* Type: "all", "none", or "root" + +Limits the ability for npm to fetch dependencies from git references. That +is, dependencies that point to a git repo instead of a version or semver +range. Please note that this could leave your tree incomplete and some +packages may not function as intended or designed. + +`all` allows any git dependencies to be fetched and installed. `none` +prevents any git dependencies from being fetched and installed. `root` only +allows git dependencies defined in your project's package.json to be fetched +installed. Also allows git dependencies to be fetched for other commands +like `npm view` + + + +#### `audit` + +* Default: true +* Type: Boolean + +When "true" submit audit reports alongside the current npm command to the +default registry and all registries configured for scopes. See the +documentation for [`npm audit`](/commands/npm-audit) for details on what is +submitted. + + + +#### `bin-links` + +* Default: true +* Type: Boolean + +Tells npm to create symlinks (or `.cmd` shims on Windows) for package +executables. + +Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems. + + + +#### `fund` + +* Default: true +* Type: Boolean + +When "true" displays the message at the end of each `npm install` +acknowledging the number of dependencies looking for funding. See [`npm +fund`](/commands/npm-fund) for details. + + + +#### `dry-run` + +* Default: false +* Type: Boolean + +Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, `install`, `update`, +`dedupe`, `uninstall`, as well as `pack` and `publish`. + +Note: This is NOT honored by other network related commands, eg `dist-tags`, +`owner`, etc. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `install-links` + +* Default: false +* Type: Boolean + +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. + + + +### See Also + +* [package spec](/using-npm/package-spec) +* [npm developers](/using-npm/developers) +* [package.json](/configuring-npm/package-json) +* [npm install](/commands/npm-install) +* [npm folders](/configuring-npm/folders) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) diff --git a/node24/node_modules/npm/docs/content/commands/npm-ll.md b/node24/node_modules/npm/docs/content/commands/npm-ll.md new file mode 100644 index 0000000000000000000000000000000000000000..f9509c963574caf1db89f8f7eab2cbc11d458c60 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-ll.md @@ -0,0 +1,229 @@ +--- +title: npm-ll +section: 1 +description: List installed packages +--- + +### Synopsis + +```bash +npm ll [[<@scope>/] ...] + +alias: la +``` + +### Description + +List installed packages + +### Configuration + +#### `all` + +* Default: false +* Type: Boolean + +When running `npm outdated` and `npm ls`, setting `--all` will show all +outdated or installed packages, rather than only those directly depended +upon by the current project. + + + +#### `json` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. + + + +#### `long` + +* Default: false +* Type: Boolean + +Show extended information in `ls`, `search`, and `help-search`. + + + +#### `parseable` + +* Default: false +* Type: Boolean + +Output parseable results from commands that write to standard output. For +`npm search`, this will be tab-separated table format. + + + +#### `global` + +* Default: false +* Type: Boolean + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +#### `depth` + +* Default: `Infinity` if `--all` is set; otherwise, `0` +* Type: null or Number + +The depth to go when recursing packages for `npm ls`. + +If not set, `npm ls` will show only the immediate dependencies of the root +project. If `--all` is set, then npm will show all dependencies by default. + + + +#### `omit` + +* Default: 'dev' if the `NODE_ENV` environment variable is set to + 'production'; otherwise, empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) + +Dependency types to omit from the installation tree on disk. + +Note that these dependencies _are_ still resolved and added to the +`package-lock.json` or `npm-shrinkwrap.json` file. They are just not +physically installed on disk. + +If a package type appears in both the `--include` and `--omit` lists, then +it will be included. + +If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment +variable will be set to `'production'` for all lifecycle scripts. + + + +#### `include` + +* Default: +* Type: "prod", "dev", "optional", or "peer" (can be set multiple times) + +Option that allows for defining which types of dependencies to install. + +This is the inverse of `--omit=`. + +Dependency types specified in `--include` will not be omitted, regardless of +the order in which omit/include are specified on the command-line. + + + +#### `link` + +* Default: false +* Type: Boolean + +Used with `npm ls`, limiting output to only those packages that are linked. + + + +#### `package-lock-only` + +* Default: false +* Type: Boolean + +If set to true, the current operation will only use the `package-lock.json`, +ignoring `node_modules`. + +For `update` this means only the `package-lock.json` will be updated, +instead of checking `node_modules` and downloading dependencies. + +For `list` this means the output will be based on the tree described by the +`package-lock.json`, rather than the contents of `node_modules`. + + + +#### `unicode` + +* Default: false on windows, true on mac/unix systems with a unicode locale, + as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables. +* Type: Boolean + +When set to true, npm uses unicode characters in the tree output. When +false, it uses ascii characters instead of unicode glyphs. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `install-links` + +* Default: false +* Type: Boolean + +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. + + + +### See Also + +* [npm help config](/commands/npm-config) diff --git a/node24/node_modules/npm/docs/content/commands/npm-login.md b/node24/node_modules/npm/docs/content/commands/npm-login.md new file mode 100644 index 0000000000000000000000000000000000000000..ea0150ec523e5b7c7682d6c51a21b0bc179b3b0a --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-login.md @@ -0,0 +1,93 @@ +--- +title: npm-login +section: 1 +description: Login to a registry user account +--- + +### Synopsis + +```bash +npm login +``` + +Note: This command is unaware of workspaces. + +### Description + +Verify a user in the specified registry, and save the credentials to the +`.npmrc` file. +If no registry is specified, the default registry will be used (see [`config`](/using-npm/config)). + +When you run `npm login`, the CLI automatically generates a legacy token of `publish` type. +For more information, see [About legacy tokens](/about-access-tokens#about-legacy-tokens). + +When using `legacy` for your `auth-type`, the username and password, are read in from prompts. + +To reset your password, go to + +To change your email address, go to + +You may use this command multiple times with the same user account to authorize on a new machine. +When authenticating on a new machine, the username, password and email address must all match with your existing record. + +### Configuration + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +#### `scope` + +* Default: the scope of the current project, if any, or "" +* Type: String + +Associate an operation with a scope for a scoped registry. + +Useful when logging in to or out of a private registry: + +``` +# log in, linking the scope to the custom registry +npm login --scope=@mycorp --registry=https://registry.mycorp.com + +# log out, removing the link and the auth token +npm logout --scope=@mycorp +``` + +This will cause `@mycorp` to be mapped to the registry for future +installation of packages specified according to the pattern +`@mycorp/package`. + +This will also cause `npm init` to create a scoped package. + +``` +# accept all defaults, and create a package named "@foo/whatever", +# instead of just named "whatever" +npm init --scope=@foo --yes +``` + + + +#### `auth-type` + +* Default: "web" +* Type: "legacy" or "web" + +What authentication strategy to use with `login`. Note that if an `otp` +config is given, this value will always be set to `legacy`. + + + +### See Also + +* [npm registry](/using-npm/registry) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [npm owner](/commands/npm-owner) +* [npm whoami](/commands/npm-whoami) +* [npm token](/commands/npm-token) +* [npm profile](/commands/npm-profile) diff --git a/node24/node_modules/npm/docs/content/commands/npm-logout.md b/node24/node_modules/npm/docs/content/commands/npm-logout.md new file mode 100644 index 0000000000000000000000000000000000000000..e26badb465e44e30ea48410fc707a8b7c0fa4e4d --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-logout.md @@ -0,0 +1,72 @@ +--- +title: npm-logout +section: 1 +description: Log out of the registry +--- + +### Synopsis + +```bash +npm logout +``` + +Note: This command is unaware of workspaces. + +### Description + +When logged into a registry that supports token-based authentication, tell the server to end this token's session. +This will invalidate the token everywhere you're using it, not just for the current environment. + +When logged into a legacy registry that uses username and password authentication, this will clear the credentials in your user configuration. +In this case, it will _only_ affect the current environment. + +If `--scope` is provided, this will find the credentials for the registry connected to that scope, if set. + +### Configuration + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +#### `scope` + +* Default: the scope of the current project, if any, or "" +* Type: String + +Associate an operation with a scope for a scoped registry. + +Useful when logging in to or out of a private registry: + +``` +# log in, linking the scope to the custom registry +npm login --scope=@mycorp --registry=https://registry.mycorp.com + +# log out, removing the link and the auth token +npm logout --scope=@mycorp +``` + +This will cause `@mycorp` to be mapped to the registry for future +installation of packages specified according to the pattern +`@mycorp/package`. + +This will also cause `npm init` to create a scoped package. + +``` +# accept all defaults, and create a package named "@foo/whatever", +# instead of just named "whatever" +npm init --scope=@foo --yes +``` + + + +### See Also + +* [npm adduser](/commands/npm-adduser) +* [npm registry](/using-npm/registry) +* [npm config](/commands/npm-config) +* [npm whoami](/commands/npm-whoami) diff --git a/node24/node_modules/npm/docs/content/commands/npm-ls.md b/node24/node_modules/npm/docs/content/commands/npm-ls.md new file mode 100644 index 0000000000000000000000000000000000000000..77c50404b30eb6983a0465e1d2b2ae3acd6999eb --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-ls.md @@ -0,0 +1,259 @@ +--- +title: npm-ls +section: 1 +description: List installed packages +--- + +### Synopsis + +```bash +npm ls + +alias: list +``` + +### Description + +This command will print to stdout all the versions of packages that are installed, as well as their dependencies when `--all` is specified, in a tree structure. + +Note: to get a "bottoms up" view of why a given package is included in the tree at all, use [`npm explain`](/commands/npm-explain). + +Positional arguments are `name@version-range` identifiers, which will limit the results to only the paths to the packages named. +Note that nested packages will *also* show the paths to the specified packages. +For example, running `npm ls promzard` in npm's source tree will show: + +```bash +npm@11.12.1 /path/to/npm +└─┬ init-package-json@0.0.4 + └── promzard@0.1.5 +``` + +It will print out extraneous, missing, and invalid packages. + +If a project specifies git urls for dependencies these are shown in parentheses after the `name@version` to make it easier for users to recognize potential forks of a project. + +The tree shown is the logical dependency tree, based on package dependencies, not the physical layout of your `node_modules` folder. + +When run as `ll` or `la`, it shows extended information by default. + +### Configuration + +#### `all` + +* Default: false +* Type: Boolean + +When running `npm outdated` and `npm ls`, setting `--all` will show all +outdated or installed packages, rather than only those directly depended +upon by the current project. + + + +#### `json` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. + + + +#### `long` + +* Default: false +* Type: Boolean + +Show extended information in `ls`, `search`, and `help-search`. + + + +#### `parseable` + +* Default: false +* Type: Boolean + +Output parseable results from commands that write to standard output. For +`npm search`, this will be tab-separated table format. + + + +#### `global` + +* Default: false +* Type: Boolean + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +#### `depth` + +* Default: `Infinity` if `--all` is set; otherwise, `0` +* Type: null or Number + +The depth to go when recursing packages for `npm ls`. + +If not set, `npm ls` will show only the immediate dependencies of the root +project. If `--all` is set, then npm will show all dependencies by default. + + + +#### `omit` + +* Default: 'dev' if the `NODE_ENV` environment variable is set to + 'production'; otherwise, empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) + +Dependency types to omit from the installation tree on disk. + +Note that these dependencies _are_ still resolved and added to the +`package-lock.json` or `npm-shrinkwrap.json` file. They are just not +physically installed on disk. + +If a package type appears in both the `--include` and `--omit` lists, then +it will be included. + +If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment +variable will be set to `'production'` for all lifecycle scripts. + + + +#### `include` + +* Default: +* Type: "prod", "dev", "optional", or "peer" (can be set multiple times) + +Option that allows for defining which types of dependencies to install. + +This is the inverse of `--omit=`. + +Dependency types specified in `--include` will not be omitted, regardless of +the order in which omit/include are specified on the command-line. + + + +#### `link` + +* Default: false +* Type: Boolean + +Used with `npm ls`, limiting output to only those packages that are linked. + + + +#### `package-lock-only` + +* Default: false +* Type: Boolean + +If set to true, the current operation will only use the `package-lock.json`, +ignoring `node_modules`. + +For `update` this means only the `package-lock.json` will be updated, +instead of checking `node_modules` and downloading dependencies. + +For `list` this means the output will be based on the tree described by the +`package-lock.json`, rather than the contents of `node_modules`. + + + +#### `unicode` + +* Default: false on windows, true on mac/unix systems with a unicode locale, + as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables. +* Type: Boolean + +When set to true, npm uses unicode characters in the tree output. When +false, it uses ascii characters instead of unicode glyphs. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `install-links` + +* Default: false +* Type: Boolean + +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. + + + +### See Also + +* [package spec](/using-npm/package-spec) +* [npm explain](/commands/npm-explain) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [npm folders](/configuring-npm/folders) +* [npm explain](/commands/npm-explain) +* [npm install](/commands/npm-install) +* [npm link](/commands/npm-link) +* [npm prune](/commands/npm-prune) +* [npm outdated](/commands/npm-outdated) +* [npm update](/commands/npm-update) diff --git a/node24/node_modules/npm/docs/content/commands/npm-org.md b/node24/node_modules/npm/docs/content/commands/npm-org.md new file mode 100644 index 0000000000000000000000000000000000000000..04c617f15b06d2fb6112fc5d605f182fa9947835 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-org.md @@ -0,0 +1,113 @@ +--- +title: npm-org +section: 1 +description: Manage orgs +--- + +### Synopsis + +```bash +npm org set orgname username [developer | admin | owner] +npm org rm orgname username +npm org ls orgname [] + +alias: ogr +``` + +Note: This command is unaware of workspaces. + +### Example + +Add a new developer to an org: + +```bash +$ npm org set my-org @mx-smith +``` + +Add a new admin to an org (or change a developer to an admin): + +```bash +$ npm org set my-org @mx-santos admin +``` + +Remove a user from an org: + +```bash +$ npm org rm my-org mx-santos +``` + +List all users in an org: + +```bash +$ npm org ls my-org +``` + +List all users in JSON format: + +```bash +$ npm org ls my-org --json +``` + +See what role a user has in an org: + +```bash +$ npm org ls my-org @mx-santos +``` + +### Description + +You can use the `npm org` commands to manage and view users of an organization. +It supports adding and removing users, changing their roles, listing them, and finding specific ones and their roles. + +### Configuration + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +#### `otp` + +* Default: null +* Type: null or String + +This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with `npm access`. + +If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one. + + + +#### `json` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. + + + +#### `parseable` + +* Default: false +* Type: Boolean + +Output parseable results from commands that write to standard output. For +`npm search`, this will be tab-separated table format. + + + +### See Also + +* [using orgs](/using-npm/orgs) +* [Documentation on npm Orgs](https://docs.npmjs.com/orgs/) diff --git a/node24/node_modules/npm/docs/content/commands/npm-outdated.md b/node24/node_modules/npm/docs/content/commands/npm-outdated.md new file mode 100644 index 0000000000000000000000000000000000000000..4881ce3c2db261440b821f1246108bacc2062170 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-outdated.md @@ -0,0 +1,194 @@ +--- +title: npm-outdated +section: 1 +description: Check for outdated packages +--- + +### Synopsis + +```bash +npm outdated [ ...] +``` + +### Description + +This command will check the registry to see if any (or, specific) installed packages are currently outdated. + +By default, only the direct dependencies of the root project and direct dependencies of your configured *workspaces* are shown. +Use `--all` to find all outdated meta-dependencies as well. + +In the output: + +* `wanted` is the maximum version of the package that satisfies the semver range specified in `package.json`. + If there's no available semver range (i.e. you're running `npm outdated --global`, or the package isn't included in `package.json`), then `wanted` shows the currently-installed version. +* `latest` is the version of the package tagged as latest in the registry. + Running `npm publish` with no special configuration will publish the package with a dist-tag of `latest`. + This may or may not be the maximum version of the package, or the most-recently published version of the package, depending on how the package's developer manages the latest [dist-tag](/commands/npm-dist-tag). +* `location` is where in the physical tree the package is located. +* `depended by` shows which package depends on the displayed dependency +* `package type` (when using `--long` / `-l`) tells you whether this package is a `dependency` or a dev/peer/optional dependency. + Packages not included in `package.json` are always marked `dependencies`. +* `homepage` (when using `--long` / `-l`) is the `homepage` value contained in the package's packument +* `depended by location` (when using `--long` / `-l`) shows location of the package that depends on the displayed dependency +* Red means there's a newer version matching your semver requirements, so you should update now. +* Yellow indicates that there's a newer version _above_ your semver requirements (usually new major, or new 0.x minor) so proceed with caution. + +### An example + +```bash +$ npm outdated +Package Current Wanted Latest Location Depended by +glob 5.0.15 5.0.15 6.0.1 node_modules/glob dependent-package-name +nothingness 0.0.3 git git node_modules/nothingness dependent-package-name +npm 3.5.1 3.5.2 3.5.1 node_modules/npm dependent-package-name +local-dev 0.0.3 linked linked local-dev dependent-package-name +once 1.3.2 1.3.3 1.3.3 node_modules/once dependent-package-name +``` + +With these `dependencies`: +```json +{ + "glob": "^5.0.15", + "nothingness": "github:othiym23/nothingness#master", + "npm": "^3.5.1", + "once": "^1.3.1" +} +``` + +A few things to note: + +* `glob` requires `^5`, which prevents npm from installing `glob@6`, which is outside the semver range. +* Git dependencies will always be reinstalled, because of how they're specified. + The installed committish might satisfy the dependency specifier (if it's something immutable, like a commit SHA), or it might not, so `npm outdated` and `npm update` have to fetch Git repos to check. + This is why currently doing a reinstall of a Git dependency always forces a new clone and install. +* `npm@3.5.2` is marked as "wanted", but "latest" is `npm@3.5.1` because npm uses dist-tags to manage its `latest` and `next` release channels. + `npm update` will install the _newest_ version, but `npm install npm` (with no semver range) will install whatever's tagged as `latest`. +* `once` is just plain out of date. + Reinstalling `node_modules` from scratch or running `npm update` will bring it up to spec. + +### Configuration + +#### `all` + +* Default: false +* Type: Boolean + +When running `npm outdated` and `npm ls`, setting `--all` will show all +outdated or installed packages, rather than only those directly depended +upon by the current project. + + + +#### `json` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. + + + +#### `long` + +* Default: false +* Type: Boolean + +Show extended information in `ls`, `search`, and `help-search`. + + + +#### `parseable` + +* Default: false +* Type: Boolean + +Output parseable results from commands that write to standard output. For +`npm search`, this will be tab-separated table format. + + + +#### `global` + +* Default: false +* Type: Boolean + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `before` + +* Default: null +* Type: null or Date + +If passed to `npm install`, will rebuild the npm tree such that only +versions that were available **on or before** the given date are installed. +If there are no versions available for the current set of dependencies, the +command will error. + +If the requested version is a `dist-tag` and the given tag does not pass the +`--before` filter, the most recent version less than or equal to that tag +will be used. For example, `foo@latest` might install `foo@1.2` even though +`latest` is `2.0`. + +This config cannot be used with: `min-release-age` + +#### `min-release-age` + +* Default: null +* Type: null or Number + +If set, npm will build the npm tree such that only versions that were +available more than the given number of days ago will be installed. If there +are no versions available for the current set of dependencies, the command +will error. + +This flag is a complement to `before`, which accepts an exact date instead +of a relative number of days. + +This config cannot be used with: `before` + +This value is not exported to the environment for child processes. + +### See Also + +* [package spec](/using-npm/package-spec) +* [npm update](/commands/npm-update) +* [npm dist-tag](/commands/npm-dist-tag) +* [npm registry](/using-npm/registry) +* [npm folders](/configuring-npm/folders) +* [npm workspaces](/using-npm/workspaces) diff --git a/node24/node_modules/npm/docs/content/commands/npm-owner.md b/node24/node_modules/npm/docs/content/commands/npm-owner.md new file mode 100644 index 0000000000000000000000000000000000000000..212b84e451a7b7a579aa5985d9c386c6fa0cb21e --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-owner.md @@ -0,0 +1,104 @@ +--- +title: npm-owner +section: 1 +description: Manage package owners +--- + +### Synopsis + +```bash +npm owner add +npm owner rm +npm owner ls + +alias: author +``` + +### Description + +Manage ownership of published packages. + +* ls: List all the users who have access to modify a package and push new versions. +Handy when you need to know who to bug for help. +* add: Add a new user as a maintainer of a package. +This user is enabled to modify metadata, publish new versions, and add other owners. +* rm: Remove a user from the package owner list. +This immediately revokes their privileges. + +Note that there is only one level of access. +Either you can modify a package, or you can't. +Future versions may contain more fine-grained access levels, but that is not implemented at this time. + +If you have two-factor authentication enabled with `auth-and-writes` (see [`npm-profile`](/commands/npm-profile)) then you'll need to go through a second factor flow when changing ownership or include an otp on the command line with `--otp`. + +### Configuration + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +#### `otp` + +* Default: null +* Type: null or String + +This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with `npm access`. + +If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +### See Also + +* [package spec](/using-npm/package-spec) +* [npm profile](/commands/npm-profile) +* [npm publish](/commands/npm-publish) +* [npm registry](/using-npm/registry) +* [npm adduser](/commands/npm-adduser) diff --git a/node24/node_modules/npm/docs/content/commands/npm-pack.md b/node24/node_modules/npm/docs/content/commands/npm-pack.md new file mode 100644 index 0000000000000000000000000000000000000000..ecbdc5d8042febf93eec56e36b866a6a6ba67ef4 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-pack.md @@ -0,0 +1,135 @@ +--- +title: npm-pack +section: 1 +description: Create a tarball from a package +--- + +### Synopsis + +```bash +npm pack +``` + +### Configuration + +#### `dry-run` + +* Default: false +* Type: Boolean + +Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, `install`, `update`, +`dedupe`, `uninstall`, as well as `pack` and `publish`. + +Note: This is NOT honored by other network related commands, eg `dist-tags`, +`owner`, etc. + + + +#### `json` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. + + + +#### `pack-destination` + +* Default: "." +* Type: String + +Directory in which `npm pack` will save tarballs. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +### Description + +For anything that's installable (that is, a package folder, tarball, tarball url, git url, name@tag, name@version, name, or scoped name), this command will fetch it to the cache, copy the tarball to the current working directory as `-.tgz`, and then write the filenames out to stdout. + +If the same package is specified multiple times, then the file will be overwritten the second time. + +If no arguments are supplied, then npm packs the current package folder. + +### See Also + +* [package spec](/using-npm/package-spec) +* [npm-packlist package](http://npm.im/npm-packlist) +* [npm cache](/commands/npm-cache) +* [npm publish](/commands/npm-publish) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) diff --git a/node24/node_modules/npm/docs/content/commands/npm-ping.md b/node24/node_modules/npm/docs/content/commands/npm-ping.md new file mode 100644 index 0000000000000000000000000000000000000000..31e4badd565a90c843e8a88231dee51052f143a0 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-ping.md @@ -0,0 +1,46 @@ +--- +title: npm-ping +section: 1 +description: Ping npm registry +--- + +### Synopsis + +```bash +npm ping +``` + +Note: This command is unaware of workspaces. + +### Description + +Ping the configured or given npm registry and verify authentication. +If it works it will output something like: + +```bash +npm notice PING https://registry.npmjs.org/ +npm notice PONG 255ms +``` +otherwise you will get an error: +```bash +npm notice PING http://foo.com/ +npm ERR! code E404 +npm ERR! 404 Not Found - GET http://www.foo.com/-/ping?write=true +``` + +### Configuration + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +### See Also + +* [npm doctor](/commands/npm-doctor) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) diff --git a/node24/node_modules/npm/docs/content/commands/npm-pkg.md b/node24/node_modules/npm/docs/content/commands/npm-pkg.md new file mode 100644 index 0000000000000000000000000000000000000000..ef84b2e9f3e0d48ebab210beb1435ff0aaba84d6 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-pkg.md @@ -0,0 +1,244 @@ +--- +title: npm-pkg +section: 1 +description: Manages your package.json +--- + +### Synopsis + +```bash +npm pkg set = [= ...] +npm pkg get [ [ ...]] +npm pkg delete [ ...] +npm pkg set [[].= ...] +npm pkg set [[].= ...] +npm pkg fix +``` + +### Description + +A command that automates the management of `package.json` files. +`npm pkg` provide 3 different sub commands that allow you to modify or retrieve values for given object keys in your `package.json`. + +The syntax to retrieve and set fields is a dot separated representation of the nested object properties to be found within your `package.json`, it's the same notation used in [`npm view`](/commands/npm-view) to retrieve information from the registry manifest, below you can find more examples on how to use it. + +Returned values are always in **json** format. + +* `npm pkg get ` + + Retrieves a value `key`, defined in your `package.json` file. + + For example, in order to retrieve the name of the current package, you can run: + + ```bash + npm pkg get name + ``` + + It's also possible to retrieve multiple values at once: + + ```bash + npm pkg get name version + ``` + + You can view child fields by separating them with a period. + To retrieve the value of a test `script` value, you would run the following command: + + ```bash + npm pkg get scripts.test + ``` + + For fields that are arrays, requesting a non-numeric field will return all of the values from the objects in the list. + For example, to get all the contributor emails for a package, you would run: + + ```bash + npm pkg get contributors.email + ``` + + You may also use numeric indices in square braces to specifically select an item in an array field. + To just get the email address of the first contributor in the list, you can run: + + ```bash + npm pkg get contributors[0].email + ``` + + For complex fields you can also name a property in square brackets to specifically select a child field. + This is especially helpful with the exports object: + + ```bash + npm pkg get "exports[.].require" + ``` + +* `npm pkg set =` + + Sets a `value` in your `package.json` based on the `field` value. + When saving to your `package.json` file the same set of rules used during `npm install` and other cli commands that touches the `package.json` file are used, making sure to respect the existing indentation and possibly applying some validation prior to saving values to the file. + + The same syntax used to retrieve values from your package can also be used to define new properties or overriding existing ones, below are some examples of how the dot separated syntax can be used to edit your `package.json` file. + + Defining a new bin named `mynewcommand` in your `package.json` that points to a file `cli.js`: + + ```bash + npm pkg set bin.mynewcommand=cli.js + ``` + + Setting multiple fields at once is also possible: + + ```bash + npm pkg set description='Awesome package' engines.node='>=10' + ``` + + It's also possible to add to array values, for example to add a new contributor entry: + + ```bash + npm pkg set contributors[0].name='Foo' contributors[0].email='foo@bar.ca' + ``` + + You may also append items to the end of an array using the special empty bracket notation: + + ```bash + npm pkg set contributors[].name='Foo' contributors[].name='Bar' + ``` + + It's also possible to parse values as json prior to saving them to your `package.json` file, for example in order to set a `"private": true` property: + + ```bash + npm pkg set private=true --json + ``` + + It also enables saving values as numbers: + + ```bash + npm pkg set tap.timeout=60 --json + ``` + +* `npm pkg delete ` + + Deletes a `key` from your `package.json` + + The same syntax used to set values from your package can also be used to remove existing ones. + For example, in order to remove a script named build: + + ```bash + npm pkg delete scripts.build + ``` + +* `npm pkg fix` + + Auto corrects common errors in your `package.json`. + npm already does this during `publish`, which leads to subtle (mostly harmless) differences between the contents of your `package.json` file and the manifest that npm uses during installation. + +### Workspaces support + +You can set/get/delete items across your configured workspaces by using the [`workspace`](/using-npm/config#workspace) or [`workspaces`](/using-npm/config#workspaces) config options. + +For example, setting a `funding` value across all configured workspaces of a project: + +```bash +npm pkg set funding=https://example.com --ws +``` + +When using `npm pkg get` to retrieve info from your configured workspaces, the returned result will be in a json format in which top level keys are the names of each workspace, the values of these keys will be the result values returned from each of the configured workspaces, e.g: + +``` +npm pkg get name version --ws +{ + "a": { + "name": "a", + "version": "1.0.0" + }, + "b": { + "name": "b", + "version": "1.0.0" + } +} +``` + +### Configuration + +#### `force` + +* Default: false +* Type: Boolean + +Removes various protections against unfortunate side effects, common +mistakes, unnecessary performance degradation, and malicious input. + +* Allow clobbering non-npm files in global installs. +* Allow the `npm version` command to work on an unclean git repository. +* Allow deleting the cache folder with `npm cache clean`. +* Allow installing packages that have an `engines` declaration requiring a + different version of npm. +* Allow installing packages that have an `engines` declaration requiring a + different version of `node`, even if `--engine-strict` is enabled. +* Allow `npm audit fix` to install modules outside your stated dependency + range (including SemVer-major changes). +* Allow unpublishing all versions of a published package. +* Allow conflicting peerDependencies to be installed in the root project. +* Implicitly set `--yes` during `npm init`. +* Allow clobbering existing values in `npm pkg` +* Allow unpublishing of entire packages (not just a single version). + +If you don't have a clear idea of what you want to do, it is strongly +recommended that you do not use this option! + + + +#### `json` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. +## See Also + +* [npm install](/commands/npm-install) +* [npm init](/commands/npm-init) +* [npm config](/commands/npm-config) +* [workspaces](/using-npm/workspaces) diff --git a/node24/node_modules/npm/docs/content/commands/npm-prefix.md b/node24/node_modules/npm/docs/content/commands/npm-prefix.md new file mode 100644 index 0000000000000000000000000000000000000000..85994cba1bbab614820ca1ba5283b0be0a2eb441 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-prefix.md @@ -0,0 +1,58 @@ +--- +title: npm-prefix +section: 1 +description: Display prefix +--- + +### Synopsis + +```bash +npm prefix +``` + +Note: This command is unaware of workspaces. + +### Description + +Print the local prefix to standard output. +This is the closest parent directory to contain a `package.json` file or `node_modules` directory, unless `-g` is also specified. + +If `-g` is specified, this will be the value of the global prefix. +See [`npm config`](/commands/npm-config) for more detail. + +### Example + +```bash +npm prefix +/usr/local/projects/foo +``` + +```bash +npm prefix -g +/usr/local +``` + +### Configuration + +#### `global` + +* Default: false +* Type: Boolean + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +### See Also + +* [npm root](/commands/npm-root) +* [npm folders](/configuring-npm/folders) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) diff --git a/node24/node_modules/npm/docs/content/commands/npm-profile.md b/node24/node_modules/npm/docs/content/commands/npm-profile.md new file mode 100644 index 0000000000000000000000000000000000000000..d57739f0877fc2e02a84cd696c17b26a05362df3 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-profile.md @@ -0,0 +1,115 @@ +--- +title: npm-profile +section: 1 +description: Change settings on your registry profile +--- + +### Synopsis + +```bash +npm profile enable-2fa [auth-only|auth-and-writes] +npm profile disable-2fa +npm profile get [] +npm profile set +``` + +Note: This command is unaware of workspaces. + +### Description + +Change your profile information on the registry. +Note that this command depends on the registry implementation, so third-party registries may not support this interface. + +* `npm profile get []`: Display all of the properties of your profile, or one or more specific properties. +It looks like: + +``` +name: example +email: e@example.com (verified) +two-factor auth: auth-and-writes +fullname: Example User +homepage: +freenode: +twitter: +github: +created: 2015-02-26T01:38:35.892Z +updated: 2017-10-02T21:29:45.922Z +``` + +* `npm profile set `: Set the value of a profile property. +You can set the following properties this way: email, fullname, homepage, freenode, twitter, github + +* `npm profile set password`: Change your password. +This is interactive, you'll be prompted for your current password and a new password. +You'll also be prompted for an OTP if you have two-factor authentication enabled. + +* `npm profile enable-2fa [auth-and-writes|auth-only]`: Enables two-factor authentication. +Defaults to `auth-and-writes` mode. +Modes are: + * `auth-only`: Require an OTP when logging in or making changes to your account's authentication. +The OTP will be required on both the website and the command line. + * `auth-and-writes`: Requires an OTP at all the times `auth-only` does, and also requires one when publishing a module, setting the `latest` dist-tag, or changing access via `npm access` and `npm owner`. + +* `npm profile disable-2fa`: Disables two-factor authentication. + +### Details + +Some of these commands may not be available on non npmjs.com registries. + +### Configuration + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +#### `json` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. + + + +#### `parseable` + +* Default: false +* Type: Boolean + +Output parseable results from commands that write to standard output. For +`npm search`, this will be tab-separated table format. + + + +#### `otp` + +* Default: null +* Type: null or String + +This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with `npm access`. + +If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one. + + + +### See Also + +* [npm adduser](/commands/npm-adduser) +* [npm registry](/using-npm/registry) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [npm owner](/commands/npm-owner) +* [npm whoami](/commands/npm-whoami) +* [npm token](/commands/npm-token) diff --git a/node24/node_modules/npm/docs/content/commands/npm-prune.md b/node24/node_modules/npm/docs/content/commands/npm-prune.md new file mode 100644 index 0000000000000000000000000000000000000000..d1f909defe5970dc563bc6a94cfcb076342117d3 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-prune.md @@ -0,0 +1,191 @@ +--- +title: npm-prune +section: 1 +description: Remove extraneous packages +--- + +### Synopsis + +```bash +npm prune [[<@scope>/]...] +``` + +### Description + +This command removes "extraneous" packages. +If a package name is provided, then only packages matching one of the supplied names are removed. + +Extraneous packages are those present in the `node_modules` folder that are not listed as any package's dependency list. + +If the `--omit=dev` flag is specified or the `NODE_ENV` environment variable is set to `production`, this command will remove the packages specified in your `devDependencies`. + +If the `--dry-run` flag is used then no changes will actually be made. + +If the `--json` flag is used, then the changes `npm prune` made (or would have made with `--dry-run`) are printed as a JSON object. + +In normal operation, extraneous modules are pruned automatically, so you'll only need this command with the `--production` flag. +However, in the real world, operation is not always "normal". When crashes or mistakes happen, this command can help clean up any resulting garbage. + +### Configuration + +#### `omit` + +* Default: 'dev' if the `NODE_ENV` environment variable is set to + 'production'; otherwise, empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) + +Dependency types to omit from the installation tree on disk. + +Note that these dependencies _are_ still resolved and added to the +`package-lock.json` or `npm-shrinkwrap.json` file. They are just not +physically installed on disk. + +If a package type appears in both the `--include` and `--omit` lists, then +it will be included. + +If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment +variable will be set to `'production'` for all lifecycle scripts. + + + +#### `include` + +* Default: +* Type: "prod", "dev", "optional", or "peer" (can be set multiple times) + +Option that allows for defining which types of dependencies to install. + +This is the inverse of `--omit=`. + +Dependency types specified in `--include` will not be omitted, regardless of +the order in which omit/include are specified on the command-line. + + + +#### `dry-run` + +* Default: false +* Type: Boolean + +Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, `install`, `update`, +`dedupe`, `uninstall`, as well as `pack` and `publish`. + +Note: This is NOT honored by other network related commands, eg `dist-tags`, +`owner`, etc. + + + +#### `json` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. + + + +#### `foreground-scripts` + +* Default: `false` unless when using `npm pack` or `npm publish` where it + defaults to `true` +* Type: Boolean + +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. + + + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `install-links` + +* Default: false +* Type: Boolean + +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. + + + +### See Also + +* [npm uninstall](/commands/npm-uninstall) +* [npm folders](/configuring-npm/folders) +* [npm ls](/commands/npm-ls) diff --git a/node24/node_modules/npm/docs/content/commands/npm-publish.md b/node24/node_modules/npm/docs/content/commands/npm-publish.md new file mode 100644 index 0000000000000000000000000000000000000000..52897726f5c9070ab7fb12781c868274a9e851c4 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-publish.md @@ -0,0 +1,245 @@ +--- +title: npm-publish +section: 1 +description: Publish a package +--- + +### Synopsis + +```bash +npm publish +``` + +### Description + +Publishes a package to the registry so that it can be installed by name. + +### Examples + +Publish the package in the current directory: + +```bash +npm publish +``` + +Publish a specific workspace: + +```bash +npm publish --workspace= +``` + +Publish multiple workspaces: + +```bash +npm publish --workspace=workspace-a --workspace=workspace-b +``` + +Publish all workspaces: + +```bash +npm publish --workspaces +``` + +By default npm will publish to the public registry. +This can be overridden by specifying a different default registry or using a [`scope`](/using-npm/scope) in the name, combined with a scope-configured registry (see [`package.json`](/configuring-npm/package-json)). + + +A `package` is interpreted the same way as other commands (like `npm install`) and can be: + +* a) a folder containing a program described by a [`package.json`](/configuring-npm/package-json) file +* b) a gzipped tarball containing (a) +* c) a url that resolves to (b) +* d) a `@` that is published on the registry (see [`registry`](/using-npm/registry)) with (c) +* e) a `@` (see [`npm dist-tag`](/commands/npm-dist-tag)) that points to (d) +* f) a `` that has a "latest" tag satisfying (e) +* g) a `` that resolves to (a) + +If either (a) or (b) is specified as a relative path, it should begin with an explicit `./` prefix. + +The publish will fail if the package name and version combination already exists in the specified registry. + +Once a package is published with a given name and version, that specific name and version combination can never be used again, even if it is removed with [`npm unpublish`](/commands/npm-unpublish). + +As of `npm@5`, both a sha1sum and an integrity field with a sha512sum of the tarball will be submitted to the registry during publication. +Subsequent installs will use the strongest supported algorithm to verify downloads. + +Similar to `--dry-run` see [`npm pack`](/commands/npm-pack), which figures out the files to be included and packs them into a tarball to be uploaded to the registry. + +### Files included in package + +To see what will be included in your package, run `npm pack --dry-run`. +All files are included by default, with the following exceptions: + +- Certain files that are relevant to package installation and distribution are always included. +For example, `package.json`, `README.md`, + `LICENSE`, and so on. + +- If there is a "files" list in [`package.json`](/configuring-npm/package-json), then only the files specified will be included. + (If directories are specified, then they will be walked recursively and their contents included, subject to the same ignore rules.) + +- If there is a `.gitignore` or `.npmignore` file, then ignored files in that and all child directories will be excluded from the package. + If _both_ files exist, then the `.gitignore` is ignored, and only the + `.npmignore` is used. + + `.npmignore` files follow the [same pattern rules](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_ignoring) as `.gitignore` files + +- If the file matches certain patterns, then it will _never_ be included, unless explicitly added to the `"files"` list in `package.json`, or un-ignored with a `!` rule in a `.npmignore` or `.gitignore` file. + +- Symbolic links are never included in npm packages. + + +See [`developers`](/using-npm/developers) for full details on what's included in the published package, as well as details on how the package is built. + +See [`package.json`](/configuring-npm/package-json) for more info on what can and can't be ignored. + +### Configuration + +#### `tag` + +* Default: "latest" +* Type: String + +If you ask npm to install a package and don't tell it a specific version, +then it will install the specified tag. + +It is the tag added to the package@version specified in the `npm dist-tag +add` command, if no explicit tag is given. + +When used by the `npm diff` command, this is the tag used to fetch the +tarball that will be compared with the local files by default. + +If used in the `npm publish` command, this is the tag that will be added to +the package submitted to the registry. + + + +#### `access` + +* Default: 'public' for new packages, existing packages it will not change the + current level +* Type: null, "restricted", or "public" + +If you do not want your scoped package to be publicly viewable (and +installable) set `--access=restricted`. + +Unscoped packages cannot be set to `restricted`. + +Note: This defaults to not changing the current access level for existing +packages. Specifying a value of `restricted` or `public` during publish will +change the access for an existing package the same way that `npm access set +status` would. + + + +#### `dry-run` + +* Default: false +* Type: Boolean + +Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, `install`, `update`, +`dedupe`, `uninstall`, as well as `pack` and `publish`. + +Note: This is NOT honored by other network related commands, eg `dist-tags`, +`owner`, etc. + + + +#### `otp` + +* Default: null +* Type: null or String + +This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with `npm access`. + +If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `provenance` + +* Default: false +* Type: Boolean + +When publishing from a supported cloud CI/CD system, the package will be +publicly linked to where it was built and published from. + +This config cannot be used with: `provenance-file` + +#### `provenance-file` + +* Default: null +* Type: Path + +When publishing, the provenance bundle at the given path will be used. + +This config cannot be used with: `provenance` + +### See Also + +* [package spec](/using-npm/package-spec) +* [npm-packlist package](http://npm.im/npm-packlist) +* [npm registry](/using-npm/registry) +* [npm scope](/using-npm/scope) +* [npm adduser](/commands/npm-adduser) +* [npm owner](/commands/npm-owner) +* [npm deprecate](/commands/npm-deprecate) +* [npm dist-tag](/commands/npm-dist-tag) +* [npm pack](/commands/npm-pack) +* [npm profile](/commands/npm-profile) diff --git a/node24/node_modules/npm/docs/content/commands/npm-query.md b/node24/node_modules/npm/docs/content/commands/npm-query.md new file mode 100644 index 0000000000000000000000000000000000000000..d1e37f4cba211d4336171bacbcf2c3cf642eec05 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-query.md @@ -0,0 +1,267 @@ +--- +title: npm-query +section: 1 +description: Dependency selector query +--- + +### Synopsis + +```bash +npm query +``` + +### Description + +The `npm query` command allows for usage of css selectors in order to retrieve an array of dependency objects. + +### Piping npm query to other commands + +```bash +# find all dependencies with postinstall scripts & uninstall them +npm query ":attr(scripts, [postinstall])" | jq 'map(.name)|join("\n")' -r | xargs -I {} npm uninstall {} + +# find all git dependencies & explain who requires them +npm query ":type(git)" | jq 'map(.name)' | xargs -I {} npm why {} +``` + +### Extended Use Cases & Queries + +```stylus +// all deps +* + +// all direct deps +:root > * + +// direct production deps +:root > .prod + +// direct development deps +:root > .dev + +// any peer dep of a direct deps +:root > * > .peer + +// any workspace dep +.workspace + +// all workspaces that depend on another workspace +.workspace > .workspace + +// all workspaces that have peer deps +.workspace:has(.peer) + +// any dep named "lodash" +// equivalent to [name="lodash"] +#lodash + +// any deps named "lodash" & within semver range ^"1.2.3" +#lodash@^1.2.3 +// equivalent to... +[name="lodash"]:semver(^1.2.3) + +// get the hoisted node for a given semver range +#lodash@^1.2.3:not(:deduped) + +// querying deps with a specific version +#lodash@2.1.5 +// equivalent to... +[name="lodash"][version="2.1.5"] + +// has any deps +:has(*) + +// deps with no other deps (ie. "leaf" nodes) +:empty + +// manually querying git dependencies +[repository^=github:], +[repository^=git:], +[repository^=https://github.com], +[repository^=http://github.com], +[repository^=https://github.com], +[repository^=+git:...] + +// querying for all git dependencies +:type(git) + +// get production dependencies that aren't also dev deps +.prod:not(.dev) + +// get dependencies with specific licenses +[license=MIT], [license=ISC] + +// find all packages that have @ruyadorno as a contributor +:attr(contributors, [email=ruyadorno@github.com]) +``` + +### Example Response Output + +- an array of dependency objects is returned which can contain multiple copies of the same package which may or may not have been linked or deduped + +```json +[ + { + "name": "", + "version": "", + "description": "", + "homepage": "", + "bugs": {}, + "author": {}, + "license": {}, + "funding": {}, + "files": [], + "main": "", + "browser": "", + "bin": {}, + "man": [], + "directories": {}, + "repository": {}, + "scripts": {}, + "config": {}, + "dependencies": {}, + "devDependencies": {}, + "optionalDependencies": {}, + "bundledDependencies": {}, + "peerDependencies": {}, + "peerDependenciesMeta": {}, + "engines": {}, + "os": [], + "cpu": [], + "workspaces": {}, + "keywords": [], + ... + }, + ... +``` + +### Expecting a certain number of results + +One common use of `npm query` is to make sure there is only one version of a certain dependency in your tree. +This is especially common for ecosystems like that rely on `typescript` where having state split across two different but identically-named packages causes bugs. +You can use the `--expect-results` or `--expect-result-count` in your setup to ensure that npm will exit with an exit code if your tree doesn't look like you want it to. + + +```sh +$ npm query '#react' --expect-result-count=1 +``` + +Perhaps you want to quickly check if there are any production dependencies that could be updated: + +```sh +$ npm query ':root>:outdated(in-range).prod' --no-expect-results +``` + +### Package lock only mode + +If package-lock-only is enabled, only the information in the package lock (or shrinkwrap) is loaded. +This means that information from the package.json files of your dependencies will not be included in the result set (e.g. description, homepage, engines). + +### Configuration + +#### `global` + +* Default: false +* Type: Boolean + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `package-lock-only` + +* Default: false +* Type: Boolean + +If set to true, the current operation will only use the `package-lock.json`, +ignoring `node_modules`. + +For `update` this means only the `package-lock.json` will be updated, +instead of checking `node_modules` and downloading dependencies. + +For `list` this means the output will be based on the tree described by the +`package-lock.json`, rather than the contents of `node_modules`. + + + +#### `expect-results` + +* Default: null +* Type: null or Boolean + +Tells npm whether or not to expect results from the command. Can be either +true (expect some results) or false (expect no results). + +This config cannot be used with: `expect-result-count` + +#### `expect-result-count` + +* Default: null +* Type: null or Number + +Tells to expect a specific number of results from the command. + +This config cannot be used with: `expect-results` +## See Also + +* [dependency selectors](/using-npm/dependency-selectors) diff --git a/node24/node_modules/npm/docs/content/commands/npm-rebuild.md b/node24/node_modules/npm/docs/content/commands/npm-rebuild.md new file mode 100644 index 0000000000000000000000000000000000000000..2a073872a4fe91350cf55e524745a177ce519201 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-rebuild.md @@ -0,0 +1,170 @@ +--- +title: npm-rebuild +section: 1 +description: Rebuild a package +--- + +### Synopsis + +```bash +npm rebuild [] ...] + +alias: rb +``` + +### Description + +This command does the following: + +1. Execute lifecycle scripts (`preinstall`, `install`, `postinstall`, `prepare`) +2. Links bins depending on whether bin links are enabled + +This command is particularly useful in scenarios including but not limited to: + +1. Installing a new version of **node.js**, where you need to recompile all your C++ add-ons with the updated binary. +2. Installing with `--ignore-scripts` and `--no-bin-links`, to explicitly choose which packages to build and/or link bins. + +If one or more package specs are provided, then only packages with a name and version matching one of the specifiers will be rebuilt. + +Usually, you should not need to run `npm rebuild` as it is already done for you as part of npm install (unless you suppressed these steps with `--ignore-scripts` or `--no-bin-links`). + +If there is a `binding.gyp` file in the root of your package, then npm will use a default install hook: + +``` +"scripts": { + "install": "node-gyp rebuild" +} +``` + +This default behavior is suppressed if the `package.json` has its own `install` or `preinstall` scripts. +It is also suppressed if the package specifies `"gypfile": false` + +### Configuration + +#### `global` + +* Default: false +* Type: Boolean + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +#### `bin-links` + +* Default: true +* Type: Boolean + +Tells npm to create symlinks (or `.cmd` shims on Windows) for package +executables. + +Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems. + + + +#### `foreground-scripts` + +* Default: `false` unless when using `npm pack` or `npm publish` where it + defaults to `true` +* Type: Boolean + +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. + + + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `install-links` + +* Default: false +* Type: Boolean + +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. + + + +### See Also + +* [package spec](/using-npm/package-spec) +* [npm install](/commands/npm-install) diff --git a/node24/node_modules/npm/docs/content/commands/npm-repo.md b/node24/node_modules/npm/docs/content/commands/npm-repo.md new file mode 100644 index 0000000000000000000000000000000000000000..fb238c81c1bb06b37d57ccc8c7012c001542e613 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-repo.md @@ -0,0 +1,99 @@ +--- +title: npm-repo +section: 1 +description: Open package repository page in the browser +--- + +### Synopsis + +```bash +npm repo [ [ ...]] +``` + +### Description + +This command tries to guess at the likely location of a package's repository URL, and then tries to open it using the [`--browser` config](/using-npm/config#browser) param. +If no package name is provided, it will search for a `package.json` in the current folder and use the `repository` property. + +### Configuration + +#### `browser` + +* Default: macOS: `"open"`, Windows: `"start"`, Others: `"xdg-open"` +* Type: null, Boolean, or String + +The browser that is called by npm commands to open websites. + +Set to `false` to suppress browser behavior and instead print urls to +terminal. + +Set to `true` to use default system URL opener. + + + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +### See Also + +* [npm docs](/commands/npm-docs) +* [npm config](/commands/npm-config) diff --git a/node24/node_modules/npm/docs/content/commands/npm-restart.md b/node24/node_modules/npm/docs/content/commands/npm-restart.md new file mode 100644 index 0000000000000000000000000000000000000000..cd2567abd7ec730b5bef64d51db024f1dc09ccf0 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-restart.md @@ -0,0 +1,68 @@ +--- +title: npm-restart +section: 1 +description: Restart a package +--- + +### Synopsis + +```bash +npm restart [-- ] +``` + +### Description + +This restarts a project. +It is equivalent to running `npm run restart`. + +If the current project has a `"restart"` script specified in `package.json`, then the following scripts will be run: + +1. prerestart +2. restart +3. postrestart + +If it does _not_ have a `"restart"` script specified, but it does have `stop` and/or `start` scripts, then the following scripts will be run: + +1. prerestart +2. prestop +3. stop +4. poststop +6. prestart +7. start +8. poststart +9. postrestart + +### Configuration + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +#### `script-shell` + +* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows +* Type: null or String + +The shell to use for scripts run with the `npm exec`, `npm run` and `npm +init ` commands. + + + +### See Also + +* [npm run](/commands/npm-run) +* [npm scripts](/using-npm/scripts) +* [npm test](/commands/npm-test) +* [npm start](/commands/npm-start) +* [npm stop](/commands/npm-stop) +* [npm restart](/commands/npm-restart) diff --git a/node24/node_modules/npm/docs/content/commands/npm-root.md b/node24/node_modules/npm/docs/content/commands/npm-root.md new file mode 100644 index 0000000000000000000000000000000000000000..4bf2d90aad5fafa4ad18db7de9e2c30f999ac7f6 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-root.md @@ -0,0 +1,51 @@ +--- +title: npm-root +section: 1 +description: Display npm root +--- + +### Synopsis + +```bash +npm root +``` + +Note: This command is unaware of workspaces. + +### Description + +Print the effective `node_modules` folder to standard out. + +Useful for using npm in shell scripts that do things with the `node_modules` folder. +For example: + +```bash +#!/bin/bash +global_node_modules="$(npm root --global)" +echo "Global packages installed in: ${global_node_modules}" +``` + +### Configuration + +#### `global` + +* Default: false +* Type: Boolean + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +### See Also + +* [npm prefix](/commands/npm-prefix) +* [npm folders](/configuring-npm/folders) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) diff --git a/node24/node_modules/npm/docs/content/commands/npm-run.md b/node24/node_modules/npm/docs/content/commands/npm-run.md new file mode 100644 index 0000000000000000000000000000000000000000..10d804c821bca98016dbabfb9545dbe636c495a8 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-run.md @@ -0,0 +1,231 @@ +--- +title: npm-run +section: 1 +description: Run arbitrary package scripts +--- + +### Synopsis + +```bash +npm run [-- ] + +aliases: run-script, rum, urn +``` + +### Description + +This runs an arbitrary command from a package's `"scripts"` object. +If no +`"command"` is provided, it will list the available scripts. + +`run[-script]` is used by the test, start, restart, and stop commands, but can be called directly, as well. +When the scripts in the package are printed out, they're separated into lifecycle (test, start, restart) and directly-run scripts. + +Any positional arguments are passed to the specified script. +Use `--` to pass `-`-prefixed flags and options which would otherwise be parsed by npm. + +For example: + +```bash +npm run test -- --grep="pattern" +``` + +The arguments will only be passed to the script specified after `npm run` and not to any `pre` or `post` script. + +The `env` script is a special built-in command that can be used to list environment variables that will be available to the script at runtime. +If an "env" command is defined in your package, it will take precedence over the built-in. + +In addition to the shell's pre-existing `PATH`, `npm run` adds `node_modules/.bin` to the `PATH` provided to scripts. +Any binaries provided by locally-installed dependencies can be used without the `node_modules/.bin` prefix. +For example, if there is a `devDependency` on `tap` in your package, you should write: + +```bash +"scripts": {"test": "tap test/*.js"} +``` + +instead of + +```bash +"scripts": {"test": "node_modules/.bin/tap test/*.js"} +``` + +The actual shell your script is run within is platform dependent. +By default, on Unix-like systems it is the `/bin/sh` command, on Windows it is `cmd.exe`. +The actual shell referred to by `/bin/sh` also depends on the system. +You can customize the shell with the [`script-shell` config](/using-npm/config#script-shell). + +Scripts are run from the root of the package folder, regardless of what the current working directory is when `npm run` is called. +If you want your script to use different behavior based on what subdirectory you're in, you can use the `INIT_CWD` environment variable, which holds the full path you were in when you ran `npm run`. + +`npm run` sets the `NODE` environment variable to the `node` executable with which `npm` is executed. + +If you try to run a script without having a `node_modules` directory and it fails, you will be given a warning to run `npm install`, just in case you've forgotten. + +### Workspaces support + +You may use the [`workspace`](/using-npm/config#workspace) or [`workspaces`](/using-npm/config#workspaces) configs in order to run an arbitrary command from a package's `"scripts"` object in the context of the specified workspaces. +If no `"command"` is provided, it will list the available scripts for each of these configured workspaces. + +Given a project with configured workspaces, e.g: + +``` +. ++-- package.json +`-- packages + +-- a + | `-- package.json + +-- b + | `-- package.json + `-- c + `-- package.json +``` + +Assuming the workspace configuration is properly set up at the root level `package.json` file. +e.g: + +``` +{ + "workspaces": [ "./packages/*" ] +} +``` + +And that each of the configured workspaces has a configured `test` script, we can run tests in all of them using the [`workspaces` config](/using-npm/config#workspaces): + +``` +npm test --workspaces +``` + +#### Filtering workspaces + +It's also possible to run a script in a single workspace using the `workspace` config along with a name or directory path: + +``` +npm test --workspace=a +``` + +The `workspace` config can also be specified multiple times in order to run a specific script in the context of multiple workspaces. +When defining values for the `workspace` config in the command line, it also possible to use `-w` as a shorthand, e.g: + +``` +npm test -w a -w b +``` + +This last command will run `test` in both `./packages/a` and `./packages/b` packages. + +### Configuration + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `if-present` + +* Default: false +* Type: Boolean + +If true, npm will not exit with an error code when `run` is invoked for a +script that isn't defined in the `scripts` section of `package.json`. This +option can be used when it's desirable to optionally run a script when it's +present and fail if the script fails. This is useful, for example, when +running scripts that may only apply for some builds in an otherwise generic +CI setup. + +This value is not exported to the environment for child processes. + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +#### `foreground-scripts` + +* Default: `false` unless when using `npm pack` or `npm publish` where it + defaults to `true` +* Type: Boolean + +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. + + + +#### `script-shell` + +* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows +* Type: null or String + +The shell to use for scripts run with the `npm exec`, `npm run` and `npm +init ` commands. + + + +### See Also + +* [npm scripts](/using-npm/scripts) +* [npm test](/commands/npm-test) +* [npm start](/commands/npm-start) +* [npm restart](/commands/npm-restart) +* [npm stop](/commands/npm-stop) +* [npm config](/commands/npm-config) +* [npm workspaces](/using-npm/workspaces) diff --git a/node24/node_modules/npm/docs/content/commands/npm-sbom.md b/node24/node_modules/npm/docs/content/commands/npm-sbom.md new file mode 100644 index 0000000000000000000000000000000000000000..0ed6cd1908d32a137cd2c99816f1db900afc7e66 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-sbom.md @@ -0,0 +1,316 @@ +--- +title: npm-sbom +section: 1 +description: Generate a Software Bill of Materials (SBOM) +--- + +### Synopsis + +```bash +npm sbom +``` + +### Description + +The `npm sbom` command generates a Software Bill of Materials (SBOM) listing the dependencies for the current project. +SBOMs can be generated in either [SPDX](https://spdx.dev/) or [CycloneDX](https://cyclonedx.org/) format. + +### Example CycloneDX SBOM + +```json +{ + "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json", + "bomFormat": "CycloneDX", + "specVersion": "1.5", + "serialNumber": "urn:uuid:09f55116-97e1-49cf-b3b8-44d0207e7730", + "version": 1, + "metadata": { + "timestamp": "2023-09-01T00:00:00.001Z", + "lifecycles": [ + { + "phase": "build" + } + ], + "tools": [ + { + "vendor": "npm", + "name": "cli", + "version": "10.1.0" + } + ], + "component": { + "bom-ref": "simple@1.0.0", + "type": "library", + "name": "simple", + "version": "1.0.0", + "scope": "required", + "author": "John Doe", + "description": "simple react app", + "purl": "pkg:npm/simple@1.0.0", + "properties": [ + { + "name": "cdx:npm:package:path", + "value": "" + } + ], + "externalReferences": [], + "licenses": [ + { + "license": { + "id": "MIT" + } + } + ] + } + }, + "components": [ + { + "bom-ref": "lodash@4.17.21", + "type": "library", + "name": "lodash", + "version": "4.17.21", + "scope": "required", + "author": "John-David Dalton", + "description": "Lodash modular utilities.", + "purl": "pkg:npm/lodash@4.17.21", + "properties": [ + { + "name": "cdx:npm:package:path", + "value": "node_modules/lodash" + } + ], + "externalReferences": [ + { + "type": "distribution", + "url": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" + }, + { + "type": "vcs", + "url": "git+https://github.com/lodash/lodash.git" + }, + { + "type": "website", + "url": "https://lodash.com/" + }, + { + "type": "issue-tracker", + "url": "https://github.com/lodash/lodash/issues" + } + ], + "hashes": [ + { + "alg": "SHA-512", + "content": "bf690311ee7b95e713ba568322e3533f2dd1cb880b189e99d4edef13592b81764daec43e2c54c61d5c558dc5cfb35ecb85b65519e74026ff17675b6f8f916f4a" + } + ], + "licenses": [ + { + "license": { + "id": "MIT" + } + } + ] + } + ], + "dependencies": [ + { + "ref": "simple@1.0.0", + "dependsOn": [ + "lodash@4.17.21" + ] + }, + { + "ref": "lodash@4.17.21", + "dependsOn": [] + } + ] +} +``` + +### Example SPDX SBOM + +```json +{ + "spdxVersion": "SPDX-2.3", + "dataLicense": "CC0-1.0", + "SPDXID": "SPDXRef-DOCUMENT", + "name": "simple@1.0.0", + "documentNamespace": "http://spdx.org/spdxdocs/simple-1.0.0-bf81090e-8bbc-459d-bec9-abeb794e096a", + "creationInfo": { + "created": "2023-09-01T00:00:00.001Z", + "creators": [ + "Tool: npm/cli-10.1.0" + ] + }, + "documentDescribes": [ + "SPDXRef-Package-simple-1.0.0" + ], + "packages": [ + { + "name": "simple", + "SPDXID": "SPDXRef-Package-simple-1.0.0", + "versionInfo": "1.0.0", + "packageFileName": "", + "description": "simple react app", + "primaryPackagePurpose": "LIBRARY", + "downloadLocation": "NOASSERTION", + "filesAnalyzed": false, + "homepage": "NOASSERTION", + "licenseDeclared": "MIT", + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceType": "purl", + "referenceLocator": "pkg:npm/simple@1.0.0" + } + ] + }, + { + "name": "lodash", + "SPDXID": "SPDXRef-Package-lodash-4.17.21", + "versionInfo": "4.17.21", + "packageFileName": "node_modules/lodash", + "description": "Lodash modular utilities.", + "downloadLocation": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "filesAnalyzed": false, + "homepage": "https://lodash.com/", + "licenseDeclared": "MIT", + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceType": "purl", + "referenceLocator": "pkg:npm/lodash@4.17.21" + } + ], + "checksums": [ + { + "algorithm": "SHA512", + "checksumValue": "bf690311ee7b95e713ba568322e3533f2dd1cb880b189e99d4edef13592b81764daec43e2c54c61d5c558dc5cfb35ecb85b65519e74026ff17675b6f8f916f4a" + } + ] + } + ], + "relationships": [ + { + "spdxElementId": "SPDXRef-DOCUMENT", + "relatedSpdxElement": "SPDXRef-Package-simple-1.0.0", + "relationshipType": "DESCRIBES" + }, + { + "spdxElementId": "SPDXRef-Package-simple-1.0.0", + "relatedSpdxElement": "SPDXRef-Package-lodash-4.17.21", + "relationshipType": "DEPENDS_ON" + } + ] +} +``` + +### Package lock only mode + +If package-lock-only is enabled, only the information in the package lock (or shrinkwrap) is loaded. +This means that information from the package.json files of your dependencies will not be included in the result set (e.g. +description, homepage, engines). + +### Configuration + +#### `omit` + +* Default: 'dev' if the `NODE_ENV` environment variable is set to + 'production'; otherwise, empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) + +Dependency types to omit from the installation tree on disk. + +Note that these dependencies _are_ still resolved and added to the +`package-lock.json` or `npm-shrinkwrap.json` file. They are just not +physically installed on disk. + +If a package type appears in both the `--include` and `--omit` lists, then +it will be included. + +If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment +variable will be set to `'production'` for all lifecycle scripts. + + + +#### `package-lock-only` + +* Default: false +* Type: Boolean + +If set to true, the current operation will only use the `package-lock.json`, +ignoring `node_modules`. + +For `update` this means only the `package-lock.json` will be updated, +instead of checking `node_modules` and downloading dependencies. + +For `list` this means the output will be based on the tree described by the +`package-lock.json`, rather than the contents of `node_modules`. + + + +#### `sbom-format` + +* Default: null +* Type: "cyclonedx" or "spdx" + +SBOM format to use when generating SBOMs. + + + +#### `sbom-type` + +* Default: "library" +* Type: "library", "application", or "framework" + +The type of package described by the generated SBOM. For SPDX, this is the +value for the `primaryPackagePurpose` field. For CycloneDX, this is the +value for the `type` field. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. +## See Also + +* [package spec](/using-npm/package-spec) +* [dependency selectors](/using-npm/dependency-selectors) +* [package.json](/configuring-npm/package-json) +* [workspaces](/using-npm/workspaces) diff --git a/node24/node_modules/npm/docs/content/commands/npm-search.md b/node24/node_modules/npm/docs/content/commands/npm-search.md new file mode 100644 index 0000000000000000000000000000000000000000..24b89775af7925bdd9b467040cd4352ecd7cff2b --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-search.md @@ -0,0 +1,154 @@ +--- +title: npm-search +section: 1 +description: Search for packages +--- + +### Synopsis + +```bash +npm search [ ...] + +aliases: find, s, se +``` + +Note: This command is unaware of workspaces. + +### Description + +Search the registry for packages matching the search terms. +`npm search` +performs a linear, incremental, lexically-ordered search through package metadata for all files in the registry. +If your terminal has color support, it will further highlight the matches in the results. +This can be disabled with the config item `color` + +Additionally, using the `--searchopts` and `--searchexclude` options paired with more search terms will include and exclude further patterns. +The main difference between `--searchopts` and the standard search terms is that the former does not highlight results in the output and you can use them more fine-grained filtering. +Additionally, you can add both of these to your config to change default search filtering behavior. + +Search also allows targeting of maintainers in search results, by prefixing their npm username with `=`. + +If a term starts with `/`, then it's interpreted as a regular expression and supports standard JavaScript RegExp syntax. +In this case search will ignore a trailing `/` . (Note you must escape or quote many regular expression characters in most shells.) + +### Configuration + +#### `json` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. + + + +#### `color` + +* Default: true unless the NO_COLOR environ is set to something other than '0' +* Type: "always" or Boolean + +If false, never shows colors. If `"always"` then always shows colors. If +true, then only prints color codes for tty file descriptors. + + + +#### `parseable` + +* Default: false +* Type: Boolean + +Output parseable results from commands that write to standard output. For +`npm search`, this will be tab-separated table format. + + + +#### `description` + +* Default: true +* Type: Boolean + +Show the description in `npm search` + + + +#### `searchlimit` + +* Default: 20 +* Type: Number + +Number of items to limit search results to. Will not apply at all to legacy +searches. + + + +#### `searchopts` + +* Default: "" +* Type: String + +Space-separated options that are always passed to search. + + + +#### `searchexclude` + +* Default: "" +* Type: String + +Space-separated options that limit the results from search. + + + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +#### `prefer-online` + +* Default: false +* Type: Boolean + +If true, staleness checks for cached data will be forced, making the CLI +look for updates immediately even for fresh package data. + + + +#### `prefer-offline` + +* Default: false +* Type: Boolean + +If true, staleness checks for cached data will be bypassed, but missing data +will be requested from the server. To force full offline mode, use +`--offline`. + + + +#### `offline` + +* Default: false +* Type: Boolean + +Force offline mode: no network requests will be done during install. To +allow the CLI to fill in missing cache data, see `--prefer-offline`. + + + +### See Also + +* [npm registry](/using-npm/registry) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [npm view](/commands/npm-view) +* [npm cache](/commands/npm-cache) +* https://npm.im/npm-registry-fetch diff --git a/node24/node_modules/npm/docs/content/commands/npm-set.md b/node24/node_modules/npm/docs/content/commands/npm-set.md new file mode 100644 index 0000000000000000000000000000000000000000..184a35a94db350ea86cd49d3a986ec23870205fd --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-set.md @@ -0,0 +1,58 @@ +--- +title: npm-set +section: 1 +description: Set a value in the npm configuration +--- + +### Synopsis + +```bash +npm set = [= ...] (See `npm config`) +``` + +Note: This command is unaware of workspaces. + +### Description + +Set a value in the npm configuration + +### Configuration + +#### `global` + +* Default: false +* Type: Boolean + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +#### `location` + +* Default: "user" unless `--global` is passed, which will also set this value + to "global" +* Type: "global", "user", or "project" + +When passed to `npm config` this refers to which config file to use. + +When set to "global" mode, packages are installed into the `prefix` folder +instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +### See Also + +* [npm help config](/commands/npm-config) diff --git a/node24/node_modules/npm/docs/content/commands/npm-shrinkwrap.md b/node24/node_modules/npm/docs/content/commands/npm-shrinkwrap.md new file mode 100644 index 0000000000000000000000000000000000000000..36f37c9a05a9110bec324db92f615c89081e0ffa --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-shrinkwrap.md @@ -0,0 +1,29 @@ +--- +title: npm-shrinkwrap +section: 1 +description: Lock down dependency versions for publication +--- + +### Synopsis + +```bash +npm shrinkwrap +``` + +Note: This command is unaware of workspaces. + +### Description + +This command repurposes `package-lock.json` into a publishable `npm-shrinkwrap.json` or simply creates a new one. +The file created and updated by this command will then take precedence over any other existing or future `package-lock.json` files. +For a detailed explanation of the design and purpose of package locks in npm, see [package-lock-json](/configuring-npm/package-lock-json). + +### See Also + +* [npm install](/commands/npm-install) +* [npm run](/commands/npm-run) +* [npm scripts](/using-npm/scripts) +* [package.json](/configuring-npm/package-json) +* [package-lock.json](/configuring-npm/package-lock-json) +* [npm-shrinkwrap.json](/configuring-npm/npm-shrinkwrap-json) +* [npm ls](/commands/npm-ls) diff --git a/node24/node_modules/npm/docs/content/commands/npm-star.md b/node24/node_modules/npm/docs/content/commands/npm-star.md new file mode 100644 index 0000000000000000000000000000000000000000..0eb11615485e2d360b96d34504039972ec46fb1f --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-star.md @@ -0,0 +1,79 @@ +--- +title: npm-star +section: 1 +description: Mark your favorite packages +--- + +### Synopsis + +```bash +npm star [...] +``` + +Note: This command is unaware of workspaces. + +### Description + +"Starring" a package means that you have some interest in it. +It's a vaguely positive way to show that you care. + +It's a boolean thing. +Starring repeatedly has no additional effect. + +### More + +There's also these extra commands to help you manage your favorite packages: + +#### Unstar + +You can also "unstar" a package using [`npm unstar`](/commands/npm-unstar) + +"Unstarring" is the same thing, but in reverse. + +#### Listing stars + +You can see all your starred packages using [`npm stars`](/commands/npm-stars) + +### Configuration + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +#### `unicode` + +* Default: false on windows, true on mac/unix systems with a unicode locale, + as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables. +* Type: Boolean + +When set to true, npm uses unicode characters in the tree output. When +false, it uses ascii characters instead of unicode glyphs. + + + +#### `otp` + +* Default: null +* Type: null or String + +This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with `npm access`. + +If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one. + + + +### See Also + +* [package spec](/using-npm/package-spec) +* [npm unstar](/commands/npm-unstar) +* [npm stars](/commands/npm-stars) +* [npm view](/commands/npm-view) +* [npm whoami](/commands/npm-whoami) +* [npm adduser](/commands/npm-adduser) diff --git a/node24/node_modules/npm/docs/content/commands/npm-stars.md b/node24/node_modules/npm/docs/content/commands/npm-stars.md new file mode 100644 index 0000000000000000000000000000000000000000..5cc69526983543194ea0a4e10d69fb8e2fdd708a --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-stars.md @@ -0,0 +1,38 @@ +--- +title: npm-stars +section: 1 +description: View packages marked as favorites +--- + +### Synopsis + +```bash +npm stars [] +``` + +Note: This command is unaware of workspaces. + +### Description + +If you have starred a lot of neat things and want to find them again quickly this command lets you do just that. + +You may also want to see your friend's favorite packages, in this case you will most certainly enjoy this command. + +### Configuration + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +### See Also + +* [npm star](/commands/npm-star) +* [npm unstar](/commands/npm-unstar) +* [npm view](/commands/npm-view) +* [npm whoami](/commands/npm-whoami) +* [npm adduser](/commands/npm-adduser) diff --git a/node24/node_modules/npm/docs/content/commands/npm-start.md b/node24/node_modules/npm/docs/content/commands/npm-start.md new file mode 100644 index 0000000000000000000000000000000000000000..80361e5e567bf46d75111dabdc645cea241c23b9 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-start.md @@ -0,0 +1,76 @@ +--- +title: npm-start +section: 1 +description: Start a package +--- + +### Synopsis + +```bash +npm start [-- ] +``` + +### Description + +This runs a predefined command specified in the `"start"` property of a package's `"scripts"` object. + +If the `"scripts"` object does not define a `"start"` property, npm will run `node server.js`. + +Note that this is different from the default node behavior of running the file specified in a package's `"main"` attribute when evoking with `node .` + +As of [`npm@2.0.0`](https://blog.npmjs.org/post/98131109725/npm-2-0-0), you can use custom arguments when executing scripts. +Refer to [`npm run`](/commands/npm-run) for more details. + +### Example + +```json +{ + "scripts": { + "start": "node foo.js" + } +} +``` + +```bash +npm start + +> npm@x.x.x start +> node foo.js + +(foo.js output would be here) + +``` + +### Configuration + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +#### `script-shell` + +* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows +* Type: null or String + +The shell to use for scripts run with the `npm exec`, `npm run` and `npm +init ` commands. + + + +### See Also + +* [npm run](/commands/npm-run) +* [npm scripts](/using-npm/scripts) +* [npm test](/commands/npm-test) +* [npm restart](/commands/npm-restart) +* [npm stop](/commands/npm-stop) diff --git a/node24/node_modules/npm/docs/content/commands/npm-stop.md b/node24/node_modules/npm/docs/content/commands/npm-stop.md new file mode 100644 index 0000000000000000000000000000000000000000..1359b6c58aa50254efd5d781b1446da7eb68d5cb --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-stop.md @@ -0,0 +1,71 @@ +--- +title: npm-stop +section: 1 +description: Stop a package +--- + +### Synopsis + +```bash +npm stop [-- ] +``` + +### Description + +This runs a predefined command specified in the "stop" property of a package's "scripts" object. + +Unlike with [npm start](/commands/npm-start), there is no default script that will run if the `"stop"` property is not defined. + +### Example + +```json +{ + "scripts": { + "stop": "node bar.js" + } +} +``` + +```bash +npm stop + +> npm@x.x.x stop +> node bar.js + +(bar.js output would be here) + +``` + +### Configuration + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +#### `script-shell` + +* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows +* Type: null or String + +The shell to use for scripts run with the `npm exec`, `npm run` and `npm +init ` commands. + + + +### See Also + +* [npm run](/commands/npm-run) +* [npm scripts](/using-npm/scripts) +* [npm test](/commands/npm-test) +* [npm start](/commands/npm-start) +* [npm restart](/commands/npm-restart) diff --git a/node24/node_modules/npm/docs/content/commands/npm-team.md b/node24/node_modules/npm/docs/content/commands/npm-team.md new file mode 100644 index 0000000000000000000000000000000000000000..44f882a362dfd7b23d18e1857cabe68cb0910569 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-team.md @@ -0,0 +1,144 @@ +--- +title: npm-team +section: 1 +description: Manage organization teams and team memberships +--- + +### Synopsis + +```bash +npm team create [--otp ] +npm team destroy [--otp ] +npm team add [--otp ] +npm team rm [--otp ] +npm team ls | +``` + +Note: This command is unaware of workspaces. + +### Description + +Used to manage teams in organizations, and change team memberships. +Does not handle permissions for packages. + +Teams must always be fully qualified with the organization/scope they belong to when operating on them, separated by a colon (`:`). +That is, if you have a `newteam` team in an `org` organization, you must always refer to that team as `@org:newteam` in these commands. + +If you have two-factor authentication enabled in `auth-and-writes` mode, then you can provide a code from your authenticator with `[--otp ]`. +If you don't include this then you will be taken through a second factor flow based on your `authtype`. + +* create / destroy: + Create a new team, or destroy an existing one. + Note: You cannot remove the `developers` team, [learn more.](https://docs.npmjs.com/about-developers-team) + + Here's how to create a new team `newteam` under the `org` org: + + ```bash + npm team create @org:newteam + ``` + + You should see a confirming message such as: `+@org:newteam` once the new team has been created. + +* add: + Add a user to an existing team. + + Adding a new user `username` to a team named `newteam` under the `org` org: + + ```bash + npm team add @org:newteam username + ``` + + On success, you should see a message: `username added to @org:newteam` + +* rm: + Using `npm team rm` you can also remove users from a team they belong to. + + Here's an example removing user `username` from `newteam` team in `org` organization: + + ```bash + npm team rm @org:newteam username + ``` + + Once the user is removed a confirmation message is displayed: + `username removed from @org:newteam` + +* ls: + If performed on an organization name, will return a list of existing teams under that organization. + If performed on a team, it will instead return a list of all users belonging to that particular team. + + Here's an example of how to list all teams from an org named `org`: + + ```bash + npm team ls @org + ``` + + Example listing all members of a team named `newteam`: + + ```bash + npm team ls @org:newteam + ``` + +### Details + +`npm team` always operates directly on the current registry, configurable from the command line using `--registry=`. + +You must be a *team admin* to create teams and manage team membership, under the given organization. +Listing teams and team memberships may be done by any member of the organization. + +Organization creation and management of team admins and *organization* members is done through the website, not the npm CLI. + +To use teams to manage permissions on packages belonging to your organization, use the `npm access` command to grant or revoke the appropriate permissions. + +### Configuration + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +#### `otp` + +* Default: null +* Type: null or String + +This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with `npm access`. + +If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one. + + + +#### `parseable` + +* Default: false +* Type: Boolean + +Output parseable results from commands that write to standard output. For +`npm search`, this will be tab-separated table format. + + + +#### `json` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. + + + +### See Also + +* [npm access](/commands/npm-access) +* [npm config](/commands/npm-config) +* [npm registry](/using-npm/registry) diff --git a/node24/node_modules/npm/docs/content/commands/npm-test.md b/node24/node_modules/npm/docs/content/commands/npm-test.md new file mode 100644 index 0000000000000000000000000000000000000000..77526728e8cf6351cdf3219fac8b74569287cbb5 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-test.md @@ -0,0 +1,69 @@ +--- +title: npm-test +section: 1 +description: Test a package +--- + +### Synopsis + +```bash +npm test [-- ] + +aliases: tst, t +``` + +### Description + +This runs a predefined command specified in the `"test"` property of a package's `"scripts"` object. + +### Example + +```json +{ + "scripts": { + "test": "node test.js" + } +} +``` + +```bash +npm test +> npm@x.x.x test +> node test.js + +(test.js output would be here) +``` + +### Configuration + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +#### `script-shell` + +* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows +* Type: null or String + +The shell to use for scripts run with the `npm exec`, `npm run` and `npm +init ` commands. + + + +### See Also + +* [npm run](/commands/npm-run) +* [npm scripts](/using-npm/scripts) +* [npm start](/commands/npm-start) +* [npm restart](/commands/npm-restart) +* [npm stop](/commands/npm-stop) diff --git a/node24/node_modules/npm/docs/content/commands/npm-token.md b/node24/node_modules/npm/docs/content/commands/npm-token.md new file mode 100644 index 0000000000000000000000000000000000000000..48bc0a831448c7a14be5feb65d513392e16b38ac --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-token.md @@ -0,0 +1,203 @@ +--- +title: npm-token +section: 1 +description: Manage your authentication tokens +--- + +### Synopsis + +```bash +npm token list +npm token revoke +npm token create +``` + +Note: This command is unaware of workspaces. + +### Description + +This lets you list, create and revoke authentication tokens. + +#### Listing tokens + +When listing tokens, an abbreviated token will be displayed. For security purposes the full token is not displayed. + +#### Generating tokens + +When generating tokens, you will be prompted you for your password and, if you have two-factor authentication enabled, an otp. + +Please refer to the [docs website](https://docs.npmjs.com/creating-and-viewing-access-tokens) for more information on generating tokens for CI/CD. + +#### Revoking tokens + +When revoking a token, you can use the full token (e.g. what you get back from `npm token create`, or as can be found in an `.npmrc` file), or a truncated id. If the given truncated id is not distinct enough to differentiate between multiple existing tokens, you will need to use enough of the id to allow npm to distinguish between them. Full token ids can be found on the [npm website](https://www.npmjs.com), or in the `--parseable` or `--json` output of `npm token list`. This command will NOT accept the truncated token found in the normal `npm token list` output. + +A revoked token will immediately be removed from the registry and you will no longer be able to use it. + +### Configuration + +#### `name` + +* Default: null +* Type: null or String + +When creating a Granular Access Token with `npm token create`, this sets the +name/description for the token. + + + +#### `token-description` + +* Default: null +* Type: null or String + +Description text for the token when using `npm token create`. + + + +#### `expires` + +* Default: null +* Type: null or Number + +When creating a Granular Access Token with `npm token create`, this sets the +expiration in days. If not specified, the server will determine the default +expiration. + + + +#### `packages` + +* Default: +* Type: null or String (can be set multiple times) + +When creating a Granular Access Token with `npm token create`, this limits +the token access to specific packages. + + + +#### `packages-all` + +* Default: false +* Type: Boolean + +When creating a Granular Access Token with `npm token create`, grants the +token access to all packages instead of limiting to specific packages. + + + +#### `scopes` + +* Default: null +* Type: null or String (can be set multiple times) + +When creating a Granular Access Token with `npm token create`, this limits +the token access to specific scopes. Provide a scope name (with or without @ +prefix). + + + +#### `orgs` + +* Default: null +* Type: null or String (can be set multiple times) + +When creating a Granular Access Token with `npm token create`, this limits +the token access to specific organizations. + + + +#### `packages-and-scopes-permission` + +* Default: null +* Type: null, "read-only", "read-write", or "no-access" + +When creating a Granular Access Token with `npm token create`, sets the +permission level for packages and scopes. Options are "read-only", +"read-write", or "no-access". + + + +#### `orgs-permission` + +* Default: null +* Type: null, "read-only", "read-write", or "no-access" + +When creating a Granular Access Token with `npm token create`, sets the +permission level for organizations. Options are "read-only", "read-write", +or "no-access". + + + +#### `cidr` + +* Default: null +* Type: null or String (can be set multiple times) + +This is a list of CIDR address to be used when configuring limited access +tokens with the `npm token create` command. + + + +#### `bypass-2fa` + +* Default: false +* Type: Boolean + +When creating a Granular Access Token with `npm token create`, setting this +to true will allow the token to bypass two-factor authentication. This is +useful for automation and CI/CD workflows. + + + +#### `password` + +* Default: null +* Type: null or String + +Password for authentication. Can be provided via command line when creating +tokens, though it's generally safer to be prompted for it. + + + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +#### `otp` + +* Default: null +* Type: null or String + +This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with `npm access`. + +If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one. + + + +#### `read-only` + +* Default: false +* Type: Boolean + +This is used to mark a token as unable to publish when configuring limited +access tokens with the `npm token create` command. + + + +### See Also + +* [npm adduser](/commands/npm-adduser) +* [npm registry](/using-npm/registry) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [npm owner](/commands/npm-owner) +* [npm whoami](/commands/npm-whoami) +* [npm profile](/commands/npm-profile) diff --git a/node24/node_modules/npm/docs/content/commands/npm-trust.md b/node24/node_modules/npm/docs/content/commands/npm-trust.md new file mode 100644 index 0000000000000000000000000000000000000000..5adf63d3470565086095d2f85f4a03adbf035afd --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-trust.md @@ -0,0 +1,159 @@ +--- +title: npm-trust +section: 1 +description: Manage trusted publishing relationships between packages and CI/CD providers +--- + +### Synopsis + +Note: This command is unaware of workspaces. + +### Prerequisites + +Before using npm trust commands, ensure the following requirements are met: + +* **npm version**: `npm@11.10.0` or above is required. Use `npm install -g npm@^11.10.0` to update if needed. +* **Write permissions on the package**: You must have write access to the package you're configuring. +* **2FA enabled on account**: Two-factor authentication must be enabled at the account level. Even if it's not currently enabled, you must enable it to use trust commands. +* **Supported authentication methods**: Granular Access Tokens (GAT) with the bypass 2FA option are not supported. Legacy basic auth (username and password) credentials will not work for trust commands or endpoints. +* **Package must exist**: The package you're configuring must already exist on the npm registry. + +### Description + +Configure trust relationships between npm packages and CI/CD providers using OpenID Connect (OIDC). This is the command-line equivalent of managing trusted publisher configurations on the npm website. + +For a comprehensive overview of trusted publishing, see the [npm trusted publishers documentation](https://docs.npmjs.com/trusted-publishers). + +The `[package]` argument specifies the package name. If omitted, npm will use the name from the `package.json` in the current directory. + +Each trust relationship has its own set of configuration options and flags based on the OIDC claims provided by that provider. OIDC claims come from the CI/CD provider and include information such as repository name, workflow file, or environment. Since each provider's claims differ, the available flags and configuration keys are not universal—npm matches the claims supported by each provider's OIDC configuration. For specific details on which claims and flags are supported for a given provider, use `npm trust --help`. + +The required options depend on the CI/CD provider you're configuring. Detailed information about each option is available in the [managing trusted publisher configurations](https://docs.npmjs.com/trusted-publishers#managing-trusted-publisher-configurations) section of the npm documentation. If a provider is repository-based and the option is not provided, npm will use the `repository.url` field from your `package.json`, if available. + +Currently, the registry only supports one configuration per package. If you attempt to create a new trust relationship when one already exists, it will result in an error. To replace an existing configuration: + +1. Use `npm trust list [package]` to view the ID of the existing trusted publisher +2. Use `npm trust revoke --id [package]` to remove the existing configuration +3. Then create your new trust relationship + +### Bulk Usage + +For maintainers managing a large number of packages, you can configure trusted publishing in bulk using bash scripting. Create a loop that iterates through package names and their corresponding configuration details, executing the `npm trust ` command with the `--yes` flag for each package. + +The first request will require two-factor authentication. During two-factor authentication, you'll see an option on the npm website to skip two-factor authentication for the next 5 minutes. Enabling this option will allow subsequent `npm trust ` commands to proceed without two-factor authentication, streamlining the bulk configuration process. + +We recommend adding a 2-second sleep between each call to avoid rate limiting. With this approach, you can configure approximately 80 packages within the 5-minute two-factor authentication skip window. + +### Configuration + +### `npm trust github` + +Create a trusted relationship between a package and GitHub Actions + +#### Synopsis + +```bash +npm trust github [package] --file [--repo|--repository] [--env|--environment] [-y|--yes] +``` + +#### Flags + +| Flag | Default | Type | Description | +| --- | --- | --- | --- | +| `--file` | null | String (required) | Name of workflow file within a repositories .GitHub folder (must end in yaml, yml) | +| `--repository`, `--repo` | null | String | Name of the repository in the format owner/repo | +| `--environment`, `--env` | null | String | CI environment name | +| `--dry-run` | false | Boolean | Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, `install`, `update`, `dedupe`, `uninstall`, as well as `pack` and `publish`. Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. | +| `--json` | false | Boolean | Whether or not to output JSON data, rather than the normal output. * In `npm pkg set` it enables parsing set values with JSON.parse() before saving them to your `package.json`. Not supported by all npm commands. | +| `--registry` | "https://registry.npmjs.org/" | URL | The base URL of the npm registry. | +| `--yes`, `-y` | null | null or Boolean | Automatically answer "yes" to any prompts that npm might print on the command line. | + +### `npm trust gitlab` + +Create a trusted relationship between a package and GitLab CI/CD + +#### Synopsis + +```bash +npm trust gitlab [package] --file [--project|--repo|--repository] [--env|--environment] [-y|--yes] +``` + +#### Flags + +| Flag | Default | Type | Description | +| --- | --- | --- | --- | +| `--file` | null | String (required) | Name of pipeline file (e.g., .gitlab-ci.yml) | +| `--project` | null | String | Name of the project in the format group/project or group/subgroup/project | +| `--environment`, `--env` | null | String | CI environment name | +| `--dry-run` | false | Boolean | Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, `install`, `update`, `dedupe`, `uninstall`, as well as `pack` and `publish`. Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. | +| `--json` | false | Boolean | Whether or not to output JSON data, rather than the normal output. * In `npm pkg set` it enables parsing set values with JSON.parse() before saving them to your `package.json`. Not supported by all npm commands. | +| `--registry` | "https://registry.npmjs.org/" | URL | The base URL of the npm registry. | +| `--yes`, `-y` | null | null or Boolean | Automatically answer "yes" to any prompts that npm might print on the command line. | + +### `npm trust circleci` + +Create a trusted relationship between a package and CircleCI + +#### Synopsis + +```bash +npm trust circleci [package] --org-id --project-id --pipeline-definition-id --vcs-origin [--context-id ...] [-y|--yes] +``` + +#### Flags + +| Flag | Default | Type | Description | +| --- | --- | --- | --- | +| `--org-id` | null | String (required) | CircleCI organization UUID | +| `--project-id` | null | String (required) | CircleCI project UUID | +| `--pipeline-definition-id` | null | String (required) | CircleCI pipeline definition UUID | +| `--vcs-origin` | null | String (required) | CircleCI repository origin in format 'provider/owner/repo' | +| `--context-id` | null | null or String (can be set multiple times) | CircleCI context UUID to match | +| `--dry-run` | false | Boolean | Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, `install`, `update`, `dedupe`, `uninstall`, as well as `pack` and `publish`. Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. | +| `--json` | false | Boolean | Whether or not to output JSON data, rather than the normal output. * In `npm pkg set` it enables parsing set values with JSON.parse() before saving them to your `package.json`. Not supported by all npm commands. | +| `--registry` | "https://registry.npmjs.org/" | URL | The base URL of the npm registry. | +| `--yes`, `-y` | null | null or Boolean | Automatically answer "yes" to any prompts that npm might print on the command line. | + +### `npm trust list` + +List trusted relationships for a package + +#### Synopsis + +```bash +npm trust list [package] +``` + +#### Flags + +| Flag | Default | Type | Description | +| --- | --- | --- | --- | +| `--json` | false | Boolean | Whether or not to output JSON data, rather than the normal output. * In `npm pkg set` it enables parsing set values with JSON.parse() before saving them to your `package.json`. Not supported by all npm commands. | +| `--registry` | "https://registry.npmjs.org/" | URL | The base URL of the npm registry. | + +### `npm trust revoke` + +Revoke a trusted relationship for a package + +#### Synopsis + +```bash +npm trust revoke [package] --id= +``` + +#### Flags + +| Flag | Default | Type | Description | +| --- | --- | --- | --- | +| `--id` | null | String (required) | ID of the trusted relationship to revoke | +| `--dry-run` | false | Boolean | Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, `install`, `update`, `dedupe`, `uninstall`, as well as `pack` and `publish`. Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. | +| `--registry` | "https://registry.npmjs.org/" | URL | The base URL of the npm registry. | + + +### See Also + +* [npm publish](/commands/npm-publish) +* [npm token](/commands/npm-token) +* [npm access](/commands/npm-access) +* [npm config](/commands/npm-config) +* [npm registry](/using-npm/registry) diff --git a/node24/node_modules/npm/docs/content/commands/npm-undeprecate.md b/node24/node_modules/npm/docs/content/commands/npm-undeprecate.md new file mode 100644 index 0000000000000000000000000000000000000000..972fde4c656b6130ff4bba52276ce43b81ac1bc2 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-undeprecate.md @@ -0,0 +1,61 @@ +--- +title: npm-undeprecate +section: 1 +description: Undeprecate a version of a package +--- + +### Synopsis + +```bash +npm undeprecate +``` + +Note: This command is unaware of workspaces. + +### Description + +This command will update the npm registry entry for a package, removing any deprecation warnings that currently exist. + +It works in the same way as [npm deprecate](/commands/npm-deprecate), except that this command removes deprecation warnings instead of adding them. + +### Configuration + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +#### `otp` + +* Default: null +* Type: null or String + +This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with `npm access`. + +If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one. + + + +#### `dry-run` + +* Default: false +* Type: Boolean + +Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, `install`, `update`, +`dedupe`, `uninstall`, as well as `pack` and `publish`. + +Note: This is NOT honored by other network related commands, eg `dist-tags`, +`owner`, etc. + + +### See Also + +* [npm deprecate](/commands/npm-deprecate) diff --git a/node24/node_modules/npm/docs/content/commands/npm-uninstall.md b/node24/node_modules/npm/docs/content/commands/npm-uninstall.md new file mode 100644 index 0000000000000000000000000000000000000000..d239a29acad5bfb521122480b2f960de0afeca6d --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-uninstall.md @@ -0,0 +1,151 @@ +--- +title: npm-uninstall +section: 1 +description: Remove a package +--- + +### Synopsis + +```bash +npm uninstall [<@scope>/]... + +aliases: unlink, remove, rm, r, un +``` + +### Description + +This uninstalls a package, completely removing everything npm installed on its behalf. + +It also removes the package from the `dependencies`, `devDependencies`, +`optionalDependencies`, and `peerDependencies` objects in your `package.json`. + +Further, if you have an `npm-shrinkwrap.json` or `package-lock.json`, npm will update those files as well. + +`--no-save` will tell npm not to remove the package from your `package.json`, `npm-shrinkwrap.json`, or `package-lock.json` files. + +`--save` or `-S` will tell npm to remove the package from your `package.json`, `npm-shrinkwrap.json`, and `package-lock.json` files. +This is the default, but you may need to use this if you have for instance `save=false` in your `npmrc` file + +In global mode (ie, with `-g` or `--global` appended to the command), it uninstalls the current package context as a global package. +`--no-save` is ignored in this case. + +Scope is optional and follows the usual rules for [`scope`](/using-npm/scope). + +### Examples + +```bash +npm uninstall sax +``` + +`sax` will no longer be in your `package.json`, `npm-shrinkwrap.json`, or `package-lock.json` files. + +```bash +npm uninstall lodash --no-save +``` + +`lodash` will not be removed from your `package.json`, +`npm-shrinkwrap.json`, or `package-lock.json` files. + +### Configuration + +#### `save` + +* Default: `true` unless when using `npm update` where it defaults to `false` +* Type: Boolean + +Save installed packages to a `package.json` file as dependencies. + +When used with the `npm rm` command, removes the dependency from +`package.json`. + +Will also prevent writing to `package-lock.json` if set to `false`. + + + +#### `global` + +* Default: false +* Type: Boolean + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `install-links` + +* Default: false +* Type: Boolean + +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. + + + +### See Also + +* [npm prune](/commands/npm-prune) +* [npm install](/commands/npm-install) +* [npm folders](/configuring-npm/folders) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) diff --git a/node24/node_modules/npm/docs/content/commands/npm-unpublish.md b/node24/node_modules/npm/docs/content/commands/npm-unpublish.md new file mode 100644 index 0000000000000000000000000000000000000000..1de08f23ebcc52791d5b66163e961af316f463e7 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-unpublish.md @@ -0,0 +1,126 @@ +--- +title: npm-unpublish +section: 1 +description: Remove a package from the registry +--- + +### Synopsis + +```bash +npm unpublish [] +``` + +To learn more about how the npm registry treats unpublish, see our [unpublish policies](https://docs.npmjs.com/policies/unpublish). + +### Warning + +Consider using the [`deprecate`](/commands/npm-deprecate) command instead, if your intent is to encourage users to upgrade, or if you no longer want to maintain a package. + +### Description + +This removes a package version from the registry, deleting its entry and removing the tarball. + +The npm registry will return an error if you are not [logged in](/commands/npm-adduser). + +If you do not specify a package name at all, the name and version to be unpublished will be pulled from the project in the current directory. + +If you specify a package name but do not specify a version or if you remove all of a package's versions then the registry will remove the root package entry entirely. + +Even if you unpublish a package version, that specific name and version combination can never be reused. +In order to publish the package again, you must use a new version number. +If you unpublish the entire package, you may not publish any new versions of that package until 24 hours have passed. + +### Configuration + +#### `dry-run` + +* Default: false +* Type: Boolean + +Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, `install`, `update`, +`dedupe`, `uninstall`, as well as `pack` and `publish`. + +Note: This is NOT honored by other network related commands, eg `dist-tags`, +`owner`, etc. + + + +#### `force` + +* Default: false +* Type: Boolean + +Removes various protections against unfortunate side effects, common +mistakes, unnecessary performance degradation, and malicious input. + +* Allow clobbering non-npm files in global installs. +* Allow the `npm version` command to work on an unclean git repository. +* Allow deleting the cache folder with `npm cache clean`. +* Allow installing packages that have an `engines` declaration requiring a + different version of npm. +* Allow installing packages that have an `engines` declaration requiring a + different version of `node`, even if `--engine-strict` is enabled. +* Allow `npm audit fix` to install modules outside your stated dependency + range (including SemVer-major changes). +* Allow unpublishing all versions of a published package. +* Allow conflicting peerDependencies to be installed in the root project. +* Implicitly set `--yes` during `npm init`. +* Allow clobbering existing values in `npm pkg` +* Allow unpublishing of entire packages (not just a single version). + +If you don't have a clear idea of what you want to do, it is strongly +recommended that you do not use this option! + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +### See Also + +* [package spec](/using-npm/package-spec) +* [npm deprecate](/commands/npm-deprecate) +* [npm publish](/commands/npm-publish) +* [npm registry](/using-npm/registry) +* [npm adduser](/commands/npm-adduser) +* [npm owner](/commands/npm-owner) +* [npm login](/commands/npm-adduser) diff --git a/node24/node_modules/npm/docs/content/commands/npm-unstar.md b/node24/node_modules/npm/docs/content/commands/npm-unstar.md new file mode 100644 index 0000000000000000000000000000000000000000..92505c3a5fa2963f334af59f98d60a4fc56e291b --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-unstar.md @@ -0,0 +1,73 @@ +--- +title: npm-unstar +section: 1 +description: Remove an item from your favorite packages +--- + +### Synopsis + +```bash +npm unstar [...] +``` + +Note: This command is unaware of workspaces. + +### Description + +"Unstarring" a package is the opposite of [`npm star`](/commands/npm-star), it removes an item from your list of favorite packages. + +### More + +There's also these extra commands to help you manage your favorite packages: + +#### Star + +You can "star" a package using [`npm star`](/commands/npm-star) + +#### Listing stars + +You can see all your starred packages using [`npm stars`](/commands/npm-stars) + +### Configuration + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +#### `unicode` + +* Default: false on windows, true on mac/unix systems with a unicode locale, + as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables. +* Type: Boolean + +When set to true, npm uses unicode characters in the tree output. When +false, it uses ascii characters instead of unicode glyphs. + + + +#### `otp` + +* Default: null +* Type: null or String + +This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with `npm access`. + +If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one. + + + +### See Also + +* [npm star](/commands/npm-star) +* [npm stars](/commands/npm-stars) +* [npm view](/commands/npm-view) +* [npm whoami](/commands/npm-whoami) +* [npm adduser](/commands/npm-adduser) + diff --git a/node24/node_modules/npm/docs/content/commands/npm-update.md b/node24/node_modules/npm/docs/content/commands/npm-update.md new file mode 100644 index 0000000000000000000000000000000000000000..9ebb33c6952aeb37b0a937b690346e9403b1127a --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-update.md @@ -0,0 +1,463 @@ +--- +title: npm-update +section: 1 +description: Update packages +--- + +### Synopsis + +```bash +npm update [...] + +aliases: up, upgrade, udpate +``` + +### Description + +This command will update all the packages listed to the latest version (specified by the [`tag` config](/using-npm/config#tag)), respecting the semver constraints of both your package and its dependencies (if they also require the same package). + +It will also install missing packages. + +If the `-g` flag is specified, this command will update globally installed packages. + +If no package name is specified, all packages in the specified location (global or local) will be updated. + +Note that by default `npm update` will not update the semver values of direct dependencies in your project `package.json`. +If you want to also update values in `package.json` you can run: `npm update --save` (or add the `save=true` option to a [configuration file](/configuring-npm/npmrc) to make that the default behavior). + +### Example + +For the examples below, assume that the current package is `app` and it depends on dependencies, `dep1` (`dep2`, .. etc.). +The published versions of `dep1` are: + +```json +{ + "dist-tags": { "latest": "1.2.2" }, + "versions": [ + "1.2.2", + "1.2.1", + "1.2.0", + "1.1.2", + "1.1.1", + "1.0.0", + "0.4.1", + "0.4.0", + "0.2.0" + ] +} +``` + +#### Caret Dependencies + +If `app`'s `package.json` contains: + +```json +"dependencies": { + "dep1": "^1.1.1" +} +``` + +Then `npm update` will install `dep1@1.2.2`, because `1.2.2` is `latest` and +`1.2.2` satisfies `^1.1.1`. + +#### Tilde Dependencies + +However, if `app`'s `package.json` contains: + +```json +"dependencies": { + "dep1": "~1.1.1" +} +``` + +In this case, running `npm update` will install `dep1@1.1.2`. +Even though the `latest` tag points to `1.2.2`, this version does not satisfy `~1.1.1`, which is equivalent to `>=1.1.1 <1.2.0`. +So the highest-sorting version that satisfies +`~1.1.1` is used, which is `1.1.2`. + +#### Caret Dependencies below 1.0.0 + +Suppose `app` has a caret dependency on a version below `1.0.0`, for example: + +```json +"dependencies": { + "dep1": "^0.2.0" +} +``` + +`npm update` will install `dep1@0.2.0`. + +If the dependence were on `^0.4.0`: + +```json +"dependencies": { + "dep1": "^0.4.0" +} +``` + +Then `npm update` will install `dep1@0.4.1`, because that is the highest-sorting version that satisfies `^0.4.0` (`>= 0.4.0 <0.5.0`) + + +#### Subdependencies + +Suppose your app now also has a dependency on `dep2` + +```json +{ + "name": "my-app", + "dependencies": { + "dep1": "^1.0.0", + "dep2": "1.0.0" + } +} +``` + +and `dep2` itself depends on this limited range of `dep1` + +```json +{ +"name": "dep2", + "dependencies": { + "dep1": "~1.1.1" + } +} +``` + +Then `npm update` will install `dep1@1.1.2` because that is the highest version that `dep2` allows. + npm will prioritize having a single version of `dep1` in your tree rather than two when that single version can satisfy the semver requirements of multiple dependencies in your tree. +In this case if you really did need your package to use a newer version you would need to use `npm install`. + + +#### Updating Globally-Installed Packages + +`npm update -g` will apply the `update` action to each globally installed package that is `outdated` -- that is, has a version that is different from `wanted`. + +Note: Globally installed packages are treated as if they are installed with a caret semver range specified. +So if you require to update to `latest` you may need to run `npm install -g [...]` + +NOTE: If a package has been upgraded to a version newer than `latest`, it will be _downgraded_. + +### Configuration + +#### `save` + +* Default: `true` unless when using `npm update` where it defaults to `false` +* Type: Boolean + +Save installed packages to a `package.json` file as dependencies. + +When used with the `npm rm` command, removes the dependency from +`package.json`. + +Will also prevent writing to `package-lock.json` if set to `false`. + + + +#### `global` + +* Default: false +* Type: Boolean + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", "shallow", or "linked" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (experimental) install in node_modules/.store, +link in place, unhoisted. + + + +#### `legacy-bundling` + +* Default: false +* Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` + +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. + + + +#### `global-style` + +* Default: false +* Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` + +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependencies. Sets `--install-strategy=shallow`. + + + +#### `omit` + +* Default: 'dev' if the `NODE_ENV` environment variable is set to + 'production'; otherwise, empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) + +Dependency types to omit from the installation tree on disk. + +Note that these dependencies _are_ still resolved and added to the +`package-lock.json` or `npm-shrinkwrap.json` file. They are just not +physically installed on disk. + +If a package type appears in both the `--include` and `--omit` lists, then +it will be included. + +If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment +variable will be set to `'production'` for all lifecycle scripts. + + + +#### `include` + +* Default: +* Type: "prod", "dev", "optional", or "peer" (can be set multiple times) + +Option that allows for defining which types of dependencies to install. + +This is the inverse of `--omit=`. + +Dependency types specified in `--include` will not be omitted, regardless of +the order in which omit/include are specified on the command-line. + + + +#### `strict-peer-deps` + +* Default: false +* Type: Boolean + +If set to `true`, and `--legacy-peer-deps` is not set, then _any_ +conflicting `peerDependencies` will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships. + +By default, conflicting `peerDependencies` deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's `peerDependencies` object. + +When such an override is performed, a warning is printed, explaining the +conflict and the packages involved. If `--strict-peer-deps` is set, then +this warning is treated as a failure. + + + +#### `package-lock` + +* Default: true +* Type: Boolean + +If set to false, then ignore `package-lock.json` files when installing. This +will also prevent _writing_ `package-lock.json` if `save` is true. + + + +#### `foreground-scripts` + +* Default: `false` unless when using `npm pack` or `npm publish` where it + defaults to `true` +* Type: Boolean + +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. + + + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +#### `audit` + +* Default: true +* Type: Boolean + +When "true" submit audit reports alongside the current npm command to the +default registry and all registries configured for scopes. See the +documentation for [`npm audit`](/commands/npm-audit) for details on what is +submitted. + + + +#### `before` + +* Default: null +* Type: null or Date + +If passed to `npm install`, will rebuild the npm tree such that only +versions that were available **on or before** the given date are installed. +If there are no versions available for the current set of dependencies, the +command will error. + +If the requested version is a `dist-tag` and the given tag does not pass the +`--before` filter, the most recent version less than or equal to that tag +will be used. For example, `foo@latest` might install `foo@1.2` even though +`latest` is `2.0`. + +This config cannot be used with: `min-release-age` + +#### `min-release-age` + +* Default: null +* Type: null or Number + +If set, npm will build the npm tree such that only versions that were +available more than the given number of days ago will be installed. If there +are no versions available for the current set of dependencies, the command +will error. + +This flag is a complement to `before`, which accepts an exact date instead +of a relative number of days. + +This config cannot be used with: `before` + +This value is not exported to the environment for child processes. + +#### `bin-links` + +* Default: true +* Type: Boolean + +Tells npm to create symlinks (or `.cmd` shims on Windows) for package +executables. + +Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems. + + + +#### `fund` + +* Default: true +* Type: Boolean + +When "true" displays the message at the end of each `npm install` +acknowledging the number of dependencies looking for funding. See [`npm +fund`](/commands/npm-fund) for details. + + + +#### `dry-run` + +* Default: false +* Type: Boolean + +Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, `install`, `update`, +`dedupe`, `uninstall`, as well as `pack` and `publish`. + +Note: This is NOT honored by other network related commands, eg `dist-tags`, +`owner`, etc. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `install-links` + +* Default: false +* Type: Boolean + +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. + + + +### See Also + +* [npm install](/commands/npm-install) +* [npm outdated](/commands/npm-outdated) +* [npm shrinkwrap](/commands/npm-shrinkwrap) +* [npm registry](/using-npm/registry) +* [npm folders](/configuring-npm/folders) +* [npm ls](/commands/npm-ls) diff --git a/node24/node_modules/npm/docs/content/commands/npm-version.md b/node24/node_modules/npm/docs/content/commands/npm-version.md new file mode 100644 index 0000000000000000000000000000000000000000..e40c6e1b03510ff3ad9b7909573e57246ace633c --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-version.md @@ -0,0 +1,254 @@ +--- +title: npm-version +section: 1 +description: Bump a package version +--- + +### Synopsis + +```bash +npm version [ | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git] + +alias: verison +``` + +### Configuration + +#### `allow-same-version` + +* Default: false +* Type: Boolean + +Prevents throwing an error when `npm version` is used to set the new version +to the same value as the current version. + + + +#### `commit-hooks` + +* Default: true +* Type: Boolean + +Run git commit hooks when using the `npm version` command. + + + +#### `git-tag-version` + +* Default: true +* Type: Boolean + +Tag the commit when using the `npm version` command. Setting this to false +results in no commit being made at all. + + + +#### `json` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. + + + +#### `preid` + +* Default: "" +* Type: String + +The "prerelease identifier" to use as a prefix for the "prerelease" part of +a semver. Like the `rc` in `1.2.0-rc.8`. + + + +#### `sign-git-tag` + +* Default: false +* Type: Boolean + +If set to true, then the `npm version` command will tag the version using +`-s` to add a signature. + +Note that git requires you to have set up GPG keys in your git configs for +this to work properly. + + + +#### `save` + +* Default: `true` unless when using `npm update` where it defaults to `false` +* Type: Boolean + +Save installed packages to a `package.json` file as dependencies. + +When used with the `npm rm` command, removes the dependency from +`package.json`. + +Will also prevent writing to `package-lock.json` if set to `false`. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `workspaces-update` + +* Default: true +* Type: Boolean + +If set to true, the npm cli will run an update after operations that may +possibly change the workspaces installed to the `node_modules` folder. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +### Description + +Run this in a package directory to bump the version and write the new data back to `package.json`, `package-lock.json`, and, if present, +`npm-shrinkwrap.json`. + +The `newversion` argument should be a valid semver string, a valid second argument to [semver.inc](https://github.com/npm/node-semver#functions) (one of `patch`, `minor`, `major`, `prepatch`, `preminor`, `premajor`, `prerelease`), or `from-git`. +In the second case, the existing version will be incremented by 1 in the specified field. +`from-git` will try to read the latest git tag, and use that as the new npm version. + +**Note:** If the current version is a prerelease version, `patch` will simply remove the prerelease suffix without incrementing the patch version number. For example, `1.2.0-5` becomes `1.2.0` with `npm version patch`, not `1.2.1`. + +If run in a git repo, it will also create a version commit and tag. +This behavior is controlled by `git-tag-version` (see below), and can be disabled on the command line by running `npm --no-git-tag-version version`. +It will fail if the working directory is not clean, unless the `-f` or `--force` flag is set. + +**Note:** Git integration requires a reasonably recent version of git (2.0.0 or later is recommended). If you encounter issues with git commands, ensure your git installation is up to date. + +If supplied with `-m` or [`--message` config](/using-npm/config#message) option, npm will use it as a commit message when creating a version commit. +If the `message` config contains `%s` then that will be replaced with the resulting version number. +For example: + +```bash +npm version patch -m "Upgrade to %s for reasons" +``` + +If the [`sign-git-tag` config](/using-npm/config#sign-git-tag) is set, then the tag will be signed using the `-s` flag to git. +Note that you must have a default GPG key set up in your git config for this to work properly. +For example: + +```bash +$ npm config set sign-git-tag true +$ npm version patch + +You need a passphrase to unlock the secret key for user: "isaacs (http://blog.izs.me/) " +2048-bit RSA key, ID 6C481CF6, created 2010-08-31 + +Enter passphrase: +``` + +If `preversion`, `version`, or `postversion` are in the `scripts` property of the package.json, they will be executed as part of running `npm version`. + +The exact order of execution is as follows: + +1. Check to make sure the git working directory is clean before we get started. + Your scripts may add files to the commit in future steps. + This step is skipped if the `--force` flag is set. +2. Run the `preversion` script. + These scripts have access to the old `version` in package.json. + A typical use would be running your full test suite before deploying. + Any files you want added to the commit should be explicitly added using `git add`. +3. Bump `version` in `package.json` as requested (`patch`, `minor`, `major`, etc). +4. Run the `version` script. + These scripts have access to the new `version` in package.json (so they can incorporate it into file headers in generated files for example). + Again, scripts should explicitly add generated files to the commit using `git add`. +5. Commit and tag. +6. Run the `postversion` script. + Use it to clean up the file system or automatically push the commit and/or tag. + +Take the following example: + +```json +{ + "scripts": { + "preversion": "npm test", + "version": "npm run build && git add -A dist", + "postversion": "git push && git push --tags && rm -rf build/temp" + } +} +``` + +This runs all your tests and proceeds only if they pass. +Then runs your `build` script, and adds everything in the `dist` directory to the commit. +After the commit, it pushes the new commit and tag up to the server, and deletes the `build/temp` directory. + +### See Also + +* [npm init](/commands/npm-init) +* [npm run](/commands/npm-run) +* [npm scripts](/using-npm/scripts) +* [package.json](/configuring-npm/package-json) +* [config](/using-npm/config) diff --git a/node24/node_modules/npm/docs/content/commands/npm-view.md b/node24/node_modules/npm/docs/content/commands/npm-view.md new file mode 100644 index 0000000000000000000000000000000000000000..2c04dfd84031a933275676f694d182a882944dd3 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-view.md @@ -0,0 +1,258 @@ +--- +title: npm-view +section: 1 +description: View registry info +--- + +### Synopsis + +```bash +npm view [] [[.subfield]...] + +aliases: info, show, v +``` + +### Description + +This command shows data about a package and prints it to stdout. + +As an example, to view information about the `connect` package from the registry, you would run: + +```bash +npm view connect +``` + +The default version is `"latest"` if unspecified. + +Field names can be specified after the package descriptor. +For example, to show the dependencies of the `ronn` package at version +`0.3.5`, you could do the following: + +```bash +npm view ronn@0.3.5 dependencies +``` + +By default, `npm view` shows data about the current project context (by looking for a `package.json`). +To show field data for the current project use a file path (i.e. +`.`): + +```bash +npm view . dependencies +``` + +You can view child fields by separating them with a period. +To view the git repository URL for the latest version of `npm`, you would run the following command: + +```bash +npm view npm repository.url +``` + +This makes it easy to view information about a dependency with a bit of shell scripting. +For example, to view all the data about the version of `opts` that `ronn` depends on, you could write the following: + +```bash +npm view opts@$(npm view ronn dependencies.opts) +``` + +For fields that are arrays, requesting a non-numeric field will return all of the values from the objects in the list. +For example, to get all the contributor email addresses for the `express` package, you would run: + +```bash +npm view express contributors.email +``` + +You may also use numeric indices in square braces to specifically select an item in an array field. +To just get the email address of the first contributor in the list, you can run: + +```bash +npm view express contributors[0].email +``` + +If the field value you are querying for is a property of an object, you should run: + +```bash +npm view express time'[4.8.0]' +``` + +Note: When accessing object properties that contain special characters or numeric keys, you need to use quotes around the key name. +For example, to get the publish time of a specific version: + +```bash +npm view express "time[4.17.1]" +``` + +Without quotes, the shell may interpret the square brackets as glob patterns, causing the command to fail. +You can also access the time field for a specific version by specifying the version in the package descriptor: + +```bash +npm view express@4.17.1 time +``` + +This will return all version-time pairs, but the context will be for that specific version. + +Multiple fields may be specified, and will be printed one after another. +For example, to get all the contributor names and email addresses, you can do this: + +```bash +npm view express contributors.name contributors.email +``` + +"Person" fields are shown as a string if they would be shown as an object. +So, for example, this will show the list of `npm` contributors in the shortened string format. + (See [`package.json`](/configuring-npm/package-json) for more on this.) + +```bash +npm view npm contributors +``` + +If a version range is provided, then data will be printed for every matching version of the package. +This will show which version of `jsdom` was required by each matching version of `yui3`: + +```bash +npm view yui3@'>0.5.4' dependencies.jsdom +``` + +To show the `connect` package version history, you can do this: + +```bash +npm view connect versions +``` + +### Field Access Patterns + +The `npm view` command supports different ways to access nested fields and array elements in package metadata. Understanding these patterns makes it easier to extract specific information. + +#### Nested Object Fields + +Use dot notation to access nested object fields: + +```bash +# Access nested properties +npm view npm repository.url +npm view express bugs.url +``` + +#### Array Element Access + +For arrays, use numeric indices in square brackets to access specific elements: + +```bash +# Get the first contributor's email +npm view express contributors[0].email + +# Get the second maintainer's name +npm view express maintainers[1].name +``` + +#### Object Property Access + +For object properties (like accessing specific versions in the `time` field), use bracket notation with the property name in quotes: + +```bash +# Get publish time for a specific version +npm view express "time[4.17.1]" + +# Get dist-tags +npm view express "dist-tags.latest" +``` + +#### Extracting Fields from Arrays + +Request a non-numeric field on an array to get all values from objects in the list: + +```bash +# Get all contributor emails +npm view express contributors.email + +# Get all contributor names +npm view express contributors.name +``` + +### Configuration + +#### `json` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +### Output + +If only a single string field for a single version is output, then it will not be colorized or quoted, to enable piping the output to another command. +If the field is an object, it will be output as a JavaScript object literal. + +If the `--json` flag is given, the outputted fields will be JSON. + +If the version range matches multiple versions then each printed value will be prefixed with the version it applies to. + +If multiple fields are requested, then each of them is prefixed with the field name. + +### See Also + +* [package spec](/using-npm/package-spec) +* [npm search](/commands/npm-search) +* [npm registry](/using-npm/registry) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [npm docs](/commands/npm-docs) diff --git a/node24/node_modules/npm/docs/content/commands/npm-whoami.md b/node24/node_modules/npm/docs/content/commands/npm-whoami.md new file mode 100644 index 0000000000000000000000000000000000000000..718e30cfc5aa1064fad896607a610a0d31c25a2c --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm-whoami.md @@ -0,0 +1,38 @@ +--- +title: npm-whoami +section: 1 +description: Display npm username +--- + +### Synopsis + +```bash +npm whoami +``` + +Note: This command is unaware of workspaces. + +### Description + +Display the npm username of the currently logged-in user. + +If logged into a registry that provides token-based authentication, then connect to the `/-/whoami` registry endpoint to find the username associated with the token, and print to standard output. + +If logged into a registry that uses Basic Auth, then simply print the `username` portion of the authentication string. + +### Configuration + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +### See Also + +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [npm adduser](/commands/npm-adduser) diff --git a/node24/node_modules/npm/docs/content/commands/npm.md b/node24/node_modules/npm/docs/content/commands/npm.md new file mode 100644 index 0000000000000000000000000000000000000000..d936bb39c965de329a218a0b78a1a256e45795e2 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npm.md @@ -0,0 +1,148 @@ +--- +title: npm +section: 1 +description: javascript package manager +--- + +### Synopsis + +```bash +npm +``` + +Note: This command is unaware of workspaces. + +### Version + +11.12.1 + +### Description + +npm is the package manager for the Node JavaScript platform. +It puts modules in place so that node can find them, and manages dependency conflicts intelligently. + +It is extremely configurable to support a variety of use cases. +Most commonly, you use it to publish, discover, install, and develop node programs. + +Run `npm help` to get a list of available commands. + +### Important + +npm comes preconfigured to use npm's public registry at https://registry.npmjs.org by default. +Use of the npm public registry is subject to terms of use available at https://docs.npmjs.com/policies/terms. + +You can configure npm to use any compatible registry you like, and even run your own registry. +Use of someone else's registry is governed by their terms of use. + +### Introduction + +You probably got npm because you want to install stuff. + +The very first thing you will most likely want to run in any node program is `npm install` to install its dependencies. + +You can also run `npm install blerg` to install the latest version of "blerg". Check out [`npm install`](/commands/npm-install) for more info. +It can do a lot of stuff. + +Use the `npm search` command to show everything that's available in the public registry. +Use `npm ls` to show everything you've installed. + +### Dependencies + +If a package lists a dependency using a git URL, npm will install that dependency using the [`git`](https://github.com/git-guides/install-git) command and will generate an error if it is not installed. + +If one of the packages npm tries to install is a native node module and requires compiling of C++ Code, npm will use [node-gyp](https://github.com/nodejs/node-gyp) for that task. +For a Unix system, [node-gyp](https://github.com/nodejs/node-gyp) needs Python, make and a buildchain like GCC. On Windows, Python and Microsoft Visual Studio C++ are needed. +For more information visit [the node-gyp repository](https://github.com/nodejs/node-gyp) and the [node-gyp Wiki](https://github.com/nodejs/node-gyp/wiki). + +### Directories + +See [`folders`](/configuring-npm/folders) to learn about where npm puts stuff. + +In particular, npm has two modes of operation: + +* local mode: + npm installs packages into the current project directory, which defaults to the current working directory. + Packages install to `./node_modules`, and bins to `./node_modules/.bin`. +* global mode: + npm installs packages into the install prefix at `$NPM_CONFIG_PREFIX/lib/node_modules` and bins to `$NPM_CONFIG_PREFIX/bin`. + +Local mode is the default. +Use `-g` or `--global` on any command to run in global mode instead. + +### Developer Usage + +If you're using npm to develop and publish your code, check out the following help topics: + +* json: + Make a package.json file. + See [`package.json`](/configuring-npm/package-json). +* link: + Links your current working code into Node's path, so that you don't have to reinstall every time you make a change. + Use [`npm link`](/commands/npm-link) to do this. +* install: + It's a good idea to install things if you don't need the symbolic link. + Especially, installing other peoples code from the registry is done via [`npm install`](/commands/npm-install) +* adduser: + Create an account or log in. + When you do this, npm will store credentials in the user config file. +* publish: + Use the [`npm publish`](/commands/npm-publish) command to upload your code to the registry. + +#### Configuration + +npm is extremely configurable. +It reads its configuration options from 5 places. + +* Command line switches: + Set a config with `--key val`. + All keys take a value, even if they are booleans (the config parser doesn't know what the options are at the time of parsing). + If you do not provide a value (`--key`) then the option is set to boolean `true`. +* Environment Variables: + Set any config by prefixing the name in an environment variable with `NPM_CONFIG_`. + For example, `export NPM_CONFIG_KEY=val`. +* User Configs: + The file at `$HOME/.npmrc` is an ini-formatted list of configs. + If present, it is parsed. + If the `userconfig` option is set in the cli or env, that file will be used instead. +* Global Configs: + The file found at `./etc/npmrc` (relative to the global prefix will be parsed if it is found. + See [`npm prefix`](/commands/npm-prefix) for more info on the global prefix. + If the `globalconfig` option is set in the cli, env, or user config, then that file is parsed instead. +* Defaults: + npm's default configuration options are defined in `lib/utils/config/definitions.js`. + These must not be changed. + +See [`config`](/using-npm/config) for much, much, more information. + +### Contributions + +Patches welcome! + +If you would like to help, but don't know what to work on, read the [contributing guidelines](https://github.com/npm/cli/blob/latest/CONTRIBUTING.md) and check the issues list. + +### Bugs + +When you find issues, please report them: + + +Please be sure to follow the template and bug reporting guidelines. + +### Feature Requests + +Discuss new feature ideas on our discussion forum: + +* + +Or suggest formal RFC proposals: + +* + +### See Also + +* [npm help](/commands/npm-help) +* [package.json](/configuring-npm/package-json) +* [npmrc](/configuring-npm/npmrc) +* [npm config](/commands/npm-config) +* [npm install](/commands/npm-install) +* [npm prefix](/commands/npm-prefix) +* [npm publish](/commands/npm-publish) diff --git a/node24/node_modules/npm/docs/content/commands/npx.md b/node24/node_modules/npm/docs/content/commands/npx.md new file mode 100644 index 0000000000000000000000000000000000000000..4b8536f119d2a5c7154f46cf809a37a969bd2b47 --- /dev/null +++ b/node24/node_modules/npm/docs/content/commands/npx.md @@ -0,0 +1,139 @@ +--- +title: npx +section: 1 +description: Run a command from a local or remote npm package +--- + +### Synopsis + +```bash +npx -- [@] [args...] +npx --package=[@] -- [args...] +npx -c ' [args...]' +npx --package=foo -c ' [args...]' +``` + +### Description + +This command allows you to run an arbitrary command from an npm package (either one installed locally, or fetched remotely), in a similar context as running it via `npm run`. + +Run this command to execute a package's binary. Any options and arguments after the package name are passed directly to the executed command, not to npx itself. For example, `npx create-react-app my-app --template typescript` will pass `my-app` and `--template typescript` to the `create-react-app` command. To see what options a specific package accepts, consult that package's documentation (e.g., at npmjs.com or in its repository). + +Whatever packages are specified by the `--package` option will be provided in the `PATH` of the executed command, along with any locally installed package executables. +The `--package` option may be specified multiple times, to execute the supplied command in an environment where all specified packages are available. + +If any requested packages are not present in the local project dependencies, then they are installed to a folder in the npm cache, which is added to the `PATH` environment variable in the executed process. +A prompt is printed (which can be suppressed by providing either `--yes` or `--no`). + +Package names provided without a specifier will be matched with whatever version exists in the local project. +Package names with a specifier will only be considered a match if they have the exact same name and version as the local dependency. + +If no `-c` or `--call` option is provided, then the positional arguments are used to generate the command string. +If no `--package` options are provided, then npm will attempt to determine the executable name from the package specifier provided as the first positional argument according to the following heuristic: + +- If the package has a single entry in its `bin` field in `package.json`, or if all entries are aliases of the same command, then that command will be used. +- If the package has multiple `bin` entries, and one of them matches the unscoped portion of the `name` field, then that command will be used. +- If this does not result in exactly one option (either because there are no bin entries, or none of them match the `name` of the package), then + `npm exec` exits with an error. + +To run a binary _other than_ the named binary, specify one or more +`--package` options, which will prevent npm from inferring the package from the first command argument. + +### `npx` vs `npm exec` + +When run via the `npx` binary, all flags and options *must* be set prior to any positional arguments. +When run via `npm exec`, a double-hyphen `--` flag can be used to suppress npm's parsing of switches and options that should be sent to the executed command. + +For example: + +``` +$ npx foo@latest bar --package=@npmcli/foo +``` + +In this case, npm will resolve the `foo` package name, and run the following command: + +``` +$ foo bar --package=@npmcli/foo +``` + +Since the `--package` option comes _after_ the positional arguments, it is treated as an argument to the executed command. + +In contrast, due to npm's argument parsing logic, running this command is different: + +``` +$ npm exec foo@latest bar --package=@npmcli/foo +``` + +In this case, npm will parse the `--package` option first, resolving the +`@npmcli/foo` package. +Then, it will execute the following command in that context: + +``` +$ foo@latest bar +``` + +The double-hyphen character is recommended to explicitly tell npm to stop parsing command line options and switches. +The following command would thus be equivalent to the `npx` command above: + +``` +$ npm exec -- foo@latest bar --package=@npmcli/foo +``` + +### Examples + +Run the version of `tap` in the local dependencies, with the provided arguments: + +``` +$ npm exec -- tap --bail test/foo.js +$ npx tap --bail test/foo.js +``` + +Run a command _other than_ the command whose name matches the package name by specifying a `--package` option: + +``` +$ npm exec --package=foo -- bar --bar-argument +# ~ or ~ +$ npx --package=foo bar --bar-argument +``` + +Run an arbitrary shell script, in the context of the current project: + +``` +$ npm x -c 'eslint && say "hooray, lint passed"' +$ npx -c 'eslint && say "hooray, lint passed"' +``` + +### Compatibility with Older npx Versions + +The `npx` binary was rewritten in npm v7.0.0, and the standalone `npx` package deprecated at that time. + `npx` uses the `npm exec` command instead of a separate argument parser and install process, with some affordances to maintain backwards compatibility with the arguments it accepted in previous versions. + +This resulted in some shifts in its functionality: + +- Any `npm` config value may be provided. +- To prevent security and user-experience problems from mistyping package names, `npx` prompts before installing anything. +Suppress this prompt with the `-y` or `--yes` option. +- The `--no-install` option is deprecated, and will be converted to `--no`. +- Shell fallback functionality is removed, as it is not advisable. +- The `-p` argument is a shorthand for `--parseable` in npm, but shorthand for `--package` in npx. +This is maintained, but only for the `npx` executable. +- The `--ignore-existing` option is removed. +Locally installed bins are always present in the executed process `PATH`. +- The `--npm` option is removed. + `npx` will always use the `npm` it ships with. +- The `--node-arg` and `-n` options have been removed. +Use [`NODE_OPTIONS`](https://nodejs.org/api/cli.html#node_optionsoptions) instead: e.g., + `NODE_OPTIONS="--trace-warnings --trace-exit" npx foo --random=true` +- The `--always-spawn` option is redundant, and thus removed. +- The `--shell` option is replaced with `--script-shell`, but maintained in the `npx` executable for backwards compatibility. + +### See Also + +* [npm run](/commands/npm-run) +* [npm scripts](/using-npm/scripts) +* [npm test](/commands/npm-test) +* [npm start](/commands/npm-start) +* [npm restart](/commands/npm-restart) +* [npm stop](/commands/npm-stop) +* [npm config](/commands/npm-config) +* [npm exec](/commands/npm-exec) diff --git a/node24/node_modules/npm/docs/content/configuring-npm/folders.md b/node24/node_modules/npm/docs/content/configuring-npm/folders.md new file mode 100644 index 0000000000000000000000000000000000000000..8491238c768c20223187037115bcdefc803f783a --- /dev/null +++ b/node24/node_modules/npm/docs/content/configuring-npm/folders.md @@ -0,0 +1,172 @@ +--- +title: Folders +section: 5 +description: Folder structures used by npm +--- + +### Description + +npm puts various things on your computer. +That's its job. + +This document will tell you what it puts where. + +#### tl;dr + +* Local install (default): puts stuff in `./node_modules` of the current package root. +* Global install (with `-g`): puts stuff in /usr/local or wherever node is installed. +* Install it **locally** if you're going to `require()` it. +* Install it **globally** if you're going to run it on the command line. +* If you need both, then install it in both places, or use `npm link`. + +#### prefix Configuration + +The [`prefix` config](/using-npm/config#prefix) defaults to the location where node is installed. +On most systems, this is `/usr/local`. +On Windows, it's `%AppData%\npm`. +On Unix systems, it's one level up, since node is typically installed at `{prefix}/bin/node` rather than `{prefix}/node.exe`. + +When the `global` flag is set, npm installs things into this prefix. +When it is not set, it uses the root of the current package, or the current working directory if not in a package already. + +#### Node Modules + +Packages are dropped into the `node_modules` folder under the `prefix`. +When installing locally, this means that you can `require("packagename")` to load its main module, or `require("packagename/lib/path/to/sub/module")` to load other modules. + +Global installs on Unix systems go to `{prefix}/lib/node_modules`. +Global installs on Windows go to `{prefix}/node_modules` (that is, no `lib` folder.) + +Scoped packages are installed the same way, except they are grouped together in a sub-folder of the relevant `node_modules` folder with the name of that scope prefix by the @ symbol, e.g. `npm install @myorg/package` would place the package in `{prefix}/node_modules/@myorg/package`. +See [`scope`](/using-npm/scope) for more details. + +If you wish to `require()` a package, then install it locally. + +#### Executables + +When in global mode, executables are linked into `{prefix}/bin` on Unix, or directly into `{prefix}` on Windows. +Ensure that path is in your terminal's `PATH` environment to run them. + +When in local mode, executables are linked into `./node_modules/.bin` so that they can be made available to scripts run through npm. +(For example, so that a test runner will be in the path when you run `npm test`.) + +#### Man Pages + +When in global mode, man pages are linked into `{prefix}/share/man`. + +When in local mode, man pages are not installed. + +Man pages are not installed on Windows systems. + +#### Cache + +See [`npm cache`](/commands/npm-cache). +Cache files are stored in `~/.npm` on Posix, or `%LocalAppData%/npm-cache` on Windows. + +This is controlled by the [`cache` config](/using-npm/config#cache) param. + +### More Information + +When installing locally, npm first tries to find an appropriate `prefix` folder. +This is so that `npm install foo@1.2.3` will install to the sensible root of your package, even if you happen to have `cd`ed into some other folder. + +Starting at the $PWD, npm will walk up the folder tree checking for a folder that contains either a `package.json` file, or a `node_modules` folder. +If such a thing is found, then that is treated as the effective "current directory" for the purpose of running npm commands. +(This behavior is inspired by and similar to git's .git-folder seeking logic when running git commands in a working dir.) + +If no package root is found, then the current folder is used. + +When you run `npm install foo@1.2.3`, then the package is loaded into the cache, and then unpacked into `./node_modules/foo`. +Then, any of foo's dependencies are similarly unpacked into `./node_modules/foo/node_modules/...`. + +Any bin files are symlinked to `./node_modules/.bin/`, so that they may be found by npm scripts when necessary. + +#### Global Installation + +If the [`global` config](/using-npm/config#global) is set to true, then npm will install packages "globally". + +For global installation, packages are installed roughly the same way, but using the folders described above. + +#### Cycles, Conflicts, and Folder Parsimony + +Cycles are handled using the property of node's module system that it walks up the directories looking for `node_modules` folders. +So, at every stage, if a package is already installed in an ancestor `node_modules` folder, then it is not installed at the current location. + +Consider the case above, where `foo -> bar -> baz`. +Imagine if, in addition to that, baz depended on bar, so you'd have: +`foo -> bar -> baz -> bar -> baz ...`. +However, since the folder structure is: `foo/node_modules/bar/node_modules/baz`, there's no need to put another copy of bar into `.../baz/node_modules`, since when baz calls `require("bar")`, it will get the copy that is installed in `foo/node_modules/bar`. + +This shortcut is only used if the exact same version would be installed in multiple nested `node_modules` folders. +It is still possible to have `a/node_modules/b/node_modules/a` if the two "a" packages are different versions. +However, without repeating the exact same package multiple times, an infinite regress will always be prevented. + +Another optimization can be made by installing dependencies at the highest level possible, below the localized "target" folder (hoisting). +Since version 3, npm hoists dependencies by default. + +#### Example + +Consider this dependency graph: + +```bash +foo ++-- blerg@1.2.5 ++-- bar@1.2.3 +| +-- blerg@1.x (latest=1.3.7) +| +-- baz@2.x +| | `-- quux@3.x +| | `-- bar@1.2.3 (cycle) +| `-- asdf@* +`-- baz@1.2.3 + `-- quux@3.x + `-- bar +``` + +In this case, we might expect a folder structure like this (with all dependencies hoisted to the highest level possible): + +```bash +foo ++-- node_modules + +-- blerg (1.2.5) <---[A] + +-- bar (1.2.3) <---[B] + | +-- node_modules + | +-- baz (2.0.2) <---[C] + +-- asdf (2.3.4) + +-- baz (1.2.3) <---[D] + +-- quux (3.2.0) <---[E] +``` + +Since foo depends directly on `bar@1.2.3` and `baz@1.2.3`, those are installed in foo's `node_modules` folder. + +Even though the latest copy of blerg is 1.3.7, foo has a specific dependency on version 1.2.5. +So, that gets installed at [A]. +Since the parent installation of blerg satisfies bar's dependency on `blerg@1.x`, it does not install another copy under [B]. + +Bar [B] also has dependencies on baz and asdf. +Because it depends on `baz@2.x`, it cannot re-use the `baz@1.2.3` installed in the parent `node_modules` folder [D], and must install its own copy [C]. +In order to minimize duplication, npm hoists dependencies to the top level by default, so asdf is installed under [A]. + +Underneath bar, the `baz -> quux -> bar` dependency creates a cycle. +However, because bar is already in quux's ancestry [B], it does not unpack another copy of bar into that folder. +Likewise, quux's [E] folder tree is empty, because its dependency on bar is satisfied by the parent folder copy installed at [B]. + +For a graphical breakdown of what is installed where, use `npm ls`. + +#### Publishing + +Upon publishing, npm will look in the `node_modules` folder. +If any of the items there are not in the `bundleDependencies` array, then they will not be included in the package tarball. + +This allows a package maintainer to install all of their dependencies (and dev dependencies) locally, but only re-publish those items that cannot be found elsewhere. +See [`package.json`](/configuring-npm/package-json) for more information. + +### See also + +* [package.json](/configuring-npm/package-json) +* [npm install](/commands/npm-install) +* [npm pack](/commands/npm-pack) +* [npm cache](/commands/npm-cache) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [config](/using-npm/config) +* [npm publish](/commands/npm-publish) diff --git a/node24/node_modules/npm/docs/content/configuring-npm/install.md b/node24/node_modules/npm/docs/content/configuring-npm/install.md new file mode 100644 index 0000000000000000000000000000000000000000..d1842b87d50c054301f776a96cf796d9c3037ffd --- /dev/null +++ b/node24/node_modules/npm/docs/content/configuring-npm/install.md @@ -0,0 +1,53 @@ +--- +title: Install +section: 5 +description: Download and install node and npm +--- + +### Description + +To publish and install packages to and from the public npm registry, you must install Node.js and the npm command line interface using either a Node version manager or a Node installer. +**We strongly recommend using a Node version manager to install Node.js and npm.** We do not recommend using a +Node installer, since the Node installation process installs npm in a directory with local permissions and can cause permissions errors when you run npm packages globally. + +### Overview + +- [Checking your version of npm and Node.js](#checking-your-version-of-npm-and-nodejs) +- [Using a Node version manager to install Node.js and npm](#using-a-node-version-manager-to-install-nodejs-and-npm) +- [Using a Node installer to install Node.js and npm](#using-a-node-installer-to-install-nodejs-and-npm) + +### Checking your version of npm and Node.js + +To see if you already have Node.js and npm installed and check the installed version, run the following commands: + +``` +node -v +npm -v +``` + +### Using a Node version manager to install Node.js and npm + +Node version managers allow you to install and switch between multiple versions of Node.js and npm on your system so you can test your applications on multiple versions of npm to ensure they work for users on different versions. +You can [search for them on GitHub](https://github.com/search?q=node+version+manager+archived%3Afalse&type=repositories&ref=advsearch). + +### Using a Node installer to install Node.js and npm + +If you are unable to use a Node version manager, you can use a Node installer to install both Node.js and npm on your system. + +* [Node.js installer](https://nodejs.org/en/download/) +* [NodeSource installer](https://github.com/nodesource/distributions). +If you use Linux, we recommend that you use a NodeSource installer. + +#### macOS or Windows Node installers + +If you're using macOS or Windows, use one of the installers from the [Node.js download page](https://nodejs.org/en/download/). +Be sure to install the version labeled **LTS**. Other versions have not yet been tested with npm. + +#### Linux or other operating systems Node installers + +If you're using Linux or another operating system, use one of the following installers: + +- [NodeSource installer](https://github.com/nodesource/distributions) (recommended) +- One of the installers on the [Node.js download page](https://nodejs.org/en/download/) + +Or see [this page](https://nodejs.org/en/download/package-manager/) to install npm for Linux in the way many Linux developers prefer. diff --git a/node24/node_modules/npm/docs/content/configuring-npm/npm-shrinkwrap-json.md b/node24/node_modules/npm/docs/content/configuring-npm/npm-shrinkwrap-json.md new file mode 100644 index 0000000000000000000000000000000000000000..a50a1ecd73ee870ed68c08f6fa9f0eb8fb3a08d7 --- /dev/null +++ b/node24/node_modules/npm/docs/content/configuring-npm/npm-shrinkwrap-json.md @@ -0,0 +1,25 @@ +--- +title: npm-shrinkwrap.json +section: 5 +description: A publishable lockfile +--- + +### Description + +`npm-shrinkwrap.json` is a file created by [`npm shrinkwrap`](/commands/npm-shrinkwrap). +It is identical to `package-lock.json`, with one major caveat: Unlike `package-lock.json`, +`npm-shrinkwrap.json` may be included when publishing a package. + +The recommended use-case for `npm-shrinkwrap.json` is applications deployed through the publishing process on the registry: for example, daemons and command-line tools intended as global installs or `devDependencies`. +It's strongly discouraged for library authors to publish this file, since that would prevent end users from having control over transitive dependency updates. + +If both `package-lock.json` and `npm-shrinkwrap.json` are present in a package root, `npm-shrinkwrap.json` will be preferred over the `package-lock.json` file. + +For full details and description of the `npm-shrinkwrap.json` file format, refer to the manual page for [package-lock.json](/configuring-npm/package-lock-json). + +### See also + +* [npm shrinkwrap](/commands/npm-shrinkwrap) +* [package-lock.json](/configuring-npm/package-lock-json) +* [package.json](/configuring-npm/package-json) +* [npm install](/commands/npm-install) diff --git a/node24/node_modules/npm/docs/content/configuring-npm/npmrc.md b/node24/node_modules/npm/docs/content/configuring-npm/npmrc.md new file mode 100644 index 0000000000000000000000000000000000000000..e7b62c91b09753defae368e52959065d89a50d07 --- /dev/null +++ b/node24/node_modules/npm/docs/content/configuring-npm/npmrc.md @@ -0,0 +1,193 @@ +--- +title: .npmrc +section: 5 +description: The npm config files +--- + +### Description + +npm gets its config settings from the command line, environment variables, and `npmrc` files. + +The `npm config` command can be used to update and edit the contents of the user and global npmrc files. + +For a list of available configuration options, see [config](/using-npm/config). + +### Files + +The four relevant files are: + +* per-project config file (`/path/to/my/project/.npmrc`) +* per-user config file (`~/.npmrc`) +* global config file (`$PREFIX/etc/npmrc`) +* npm builtin config file (`/path/to/npm/npmrc`) + +All npm config files are an ini-formatted list of `key = value` parameters. +Environment variables can be replaced using `${VARIABLE_NAME}`. +By default if the variable is not defined, it is left unreplaced. +By adding `?` after variable name they can be forced to evaluate to an empty string instead. +For example: + +```bash +cache = ${HOME}/.npm-packages +node-options = "${NODE_OPTIONS?} --use-system-ca" +``` + +Each of these files is loaded, and config options are resolved in priority order. +For example, a setting in the userconfig file would override the setting in the globalconfig file. + +Array values are specified by adding "[]" after the key name. +For example: + +```bash +key[] = "first value" +key[] = "second value" +``` + +#### Comments + +Lines in `.npmrc` files are interpreted as comments when they begin with a +`;` or `#` character. +`.npmrc` files are parsed by +[npm/ini](https://github.com/npm/ini), which specifies this comment syntax. + +For example: + +```bash +# last modified: 01 Jan 2016 +; Set a new registry for a scoped package +@myscope:registry=https://mycustomregistry.example.org +``` + +#### Per-project config file + +When working locally in a project, a `.npmrc` file in the root of the project (ie, a sibling of `node_modules` and `package.json`) will set config values specific to this project. + +Note that this only applies to the root of the project that you're running npm in. +It has no effect when your module is published. +For example, you can't publish a module that forces itself to install globally, or in a different location. + +Additionally, this file is not read in global mode, such as when running `npm install -g`. + +#### Per-user config file + +`$HOME/.npmrc` (or the `userconfig` param, if set in the environment or on the command line) + +#### Global config file + +`$PREFIX/etc/npmrc` (or the `globalconfig` param, if set above): This file is an ini-file formatted list of `key = value` parameters. +Environment variables can be replaced as above. + +#### Built-in config file + +`path/to/npm/itself/npmrc` + +This is an unchangeable "builtin" configuration file that npm keeps consistent across updates. +Set fields in here using the `./configure` script that comes with npm. +This is primarily for distribution maintainers to override default configs in a standard and consistent manner. + +### Auth related configuration + +The settings `_auth`, `_authToken`, `username`, `_password`, `certfile`, and `keyfile` must all be scoped to a specific registry. +This ensures that `npm` will never send credentials to the wrong host. + +The full list is: + - `_auth` (base64 authentication string) + - `_authToken` (authentication token) + - `username` + - `_password` + - `email` + - `cafile` (path to certificate authority file) + - `certfile` (path to certificate file) + - `keyfile` (path to key file) + +In order to scope these values, they must be prefixed by a URI fragment. +If the credential is meant for any request to a registry on a single host, the scope may look like `//registry.npmjs.org/:`. +If it must be scoped to a specific path on the host that path may also be provided, such as +`//my-custom-registry.org/unique/path:`. + +### Unsupported Custom Configuration Keys + +Starting in npm v11.2.0, npm warns when unknown configuration keys are defined in `.npmrc`. In a future major version of npm, these unknown keys may no longer be accepted. + +Only configuration keys that npm officially supports are recognized. Custom keys intended for third-party tools (for example, `electron-builder`) should not be placed in `.npmrc`. + +If you need package-level configuration for use in scripts, use the `config` field in your `package.json` instead: + +```json +{ + "name": "my-package", + "config": { + "mirror": "https://example.com/" + } +} + +``` + +Values defined in `package.json#config` are exposed to scripts as environment variables prefixed with `npm_package_config_`. For example: + +``` +npm_package_config_mirror +``` + +If you need to pass arguments to a script command, use `--` to separate npm arguments from script arguments: + +``` +npm run build -- --customFlag +``` + +Using environment variables is also recommended for cross-platform configuration instead of defining unsupported keys in `.npmrc`. + + +``` +; bad config +_authToken=MYTOKEN + +; good config +@myorg:registry=https://somewhere-else.com/myorg +@another:registry=https://somewhere-else.com/another +//registry.npmjs.org/:_authToken=MYTOKEN + +; would apply to both @myorg and @another +//somewhere-else.com/:_authToken=MYTOKEN + +; would apply only to @myorg +//somewhere-else.com/myorg/:_authToken=MYTOKEN1 + +; would apply only to @another +//somewhere-else.com/another/:_authToken=MYTOKEN2 +``` + +### Custom / third-party config keys + +npm only recognizes its own [configuration options](/using-npm/config). +If your `.npmrc` contains keys that are not part of npm's config definitions +(for example, `electron_mirror` or `sass_binary_site`), npm will emit a +warning: + +``` +warn Unknown user config "electron_mirror". +This will stop working in the next major version of npm. +``` + +These keys were historically tolerated but are not officially supported. +A future major version of npm will treat unknown top-level keys as errors. + +Some tools (such as `@electron/get` or `node-sass`) read their own +configuration from environment variables or from `.npmrc` by convention. +You can set these values as environment variables instead: + +```bash +export ELECTRON_MIRROR="https://mirrorexample.npmjs.org/mirrors/electron/" +export ELECTRON_CUSTOM_DIR="{{ version }}" +``` + +Environment variables are the most portable approach and work regardless +of `.npmrc` format. + +### See also + +* [npm folders](/configuring-npm/folders) +* [npm config](/commands/npm-config) +* [config](/using-npm/config) +* [package.json](/configuring-npm/package-json) +* [npm](/commands/npm) diff --git a/node24/node_modules/npm/docs/content/configuring-npm/package-json.md b/node24/node_modules/npm/docs/content/configuring-npm/package-json.md new file mode 100644 index 0000000000000000000000000000000000000000..b0939d0e613a7fddc116f53dfda6addfc56ece0b --- /dev/null +++ b/node24/node_modules/npm/docs/content/configuring-npm/package-json.md @@ -0,0 +1,1195 @@ +--- +title: package.json +section: 5 +description: Specifics of npm's package.json handling +--- + +### Description + +This document is all you need to know about what's required in your package.json file. +It must be actual JSON, not just a JavaScript object literal. + +A lot of the behavior described in this document is affected by the config settings described in [`config`](/using-npm/config). + +### name + +If you plan to publish your package, the *most* important things in your package.json are the name and version fields as they will be required. +The name and version together form an identifier that is assumed to be completely unique. +Changes to the package should come along with changes to the version. +If you don't plan to publish your package, the name and version fields are optional. + +The name is what your thing is called. + +Some rules: + +* The name must be less than or equal to 214 characters. + This includes the scope for scoped packages. +* The names of scoped packages can begin with a dot or an underscore. + This is not permitted without a scope. +* New packages must not have uppercase letters in the name. +* The name ends up being part of a URL, an argument on the command line, and a folder name. + Therefore, the name can't contain any non-URL-safe characters. + +Some tips: + +* Don't use the same name as a core Node module. +* Don't put "js" or "node" in the name. + It's assumed that it's js, since you're writing a package.json file, and you can specify the engine using the "[engines](#engines)" field. + (See below.) +* The name will probably be passed as an argument to require(), so it should be something short, but also reasonably descriptive. +* You may want to check the npm registry to see if there's something by that name already, before you get too attached to it. + + +A name can be optionally prefixed by a scope, e.g. `@npm/example`. +See [`scope`](/using-npm/scope) for more detail. + +### version + +If you plan to publish your package, the *most* important things in your package.json are the name and version fields as they will be required. +The name and version together form an identifier that is assumed to be completely unique. +Changes to the package should come along with changes to the version. +If you don't plan to publish your package, the name and version fields are optional. + +Version must be parseable by [node-semver](https://github.com/npm/node-semver), which is bundled with npm as a dependency. +(`npm install semver` to use it yourself.) + +### description + +Put a description in it. +It's a string. +This helps people discover your package, as it's listed in `npm search`. + +### keywords + +Put keywords in it. +It's an array of strings. +This helps people discover your package as it's listed in `npm search`. + +Example: + +```json +"keywords": [ + "node", + "javascript", + "npm" +] +``` + +### homepage + +The URL to the project homepage. + +Example: + +```json +"homepage": "https://github.com/npm/example#readme" +``` + +### bugs + +The URL to your project's issue tracker and / or the email address to which issues should be reported. +These are helpful for people who encounter issues with your package. + +It should look like this: + +```json +{ + "bugs": { + "url": "https://github.com/npm/example/issues", + "email": "example@npmjs.com" + } +} +``` + +You can specify either one or both values. +If you want to provide only a URL, you can specify the value for "bugs" as a simple string instead of an object. + +If a URL is provided, it will be used by the `npm bugs` command. + +### license + +You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you're placing on it. + +If you're using a common license such as BSD-2-Clause or MIT, add a current SPDX license identifier for the license you're using, like this: + +```json +{ + "license" : "BSD-3-Clause" +} +``` + +You can check [the full list of SPDX license IDs](https://spdx.org/licenses/). +Ideally, you should pick one that is [OSI](https://opensource.org/licenses/) approved. + +If your package is licensed under multiple common licenses, use an [SPDX license expression syntax version 2.0 string](https://spdx.dev/specifications/), like this: + +```json +{ + "license" : "(ISC OR GPL-3.0)" +} +``` +If you are using a license that hasn't been assigned an SPDX identifier, or if you are using a custom license, use a string value like this one: + +```json +{ + "license" : "SEE LICENSE IN " +} +``` +Then include a file named `` at the top level of the package. + +Some old packages used license objects or a "licenses" property containing an array of license objects: + +```json +// Not valid metadata +{ + "license" : { + "type" : "ISC", + "url" : "https://opensource.org/licenses/ISC" + } +} + +// Not valid metadata +{ + "licenses" : [ + { + "type": "MIT", + "url": "https://www.opensource.org/licenses/mit-license.php" + }, + { + "type": "Apache-2.0", + "url": "https://opensource.org/licenses/apache2.0.php" + } + ] +} +``` + +Those styles are now deprecated. +Instead, use SPDX expressions, like this: + +```json +{ + "license": "ISC" +} +``` + +```json +{ + "license": "(MIT OR Apache-2.0)" +} +``` + +Finally, if you do not wish to grant others the right to use a private or unpublished package under any terms: + +```json +{ + "license": "UNLICENSED" +} +``` + +Consider also setting `"private": true` to prevent accidental publication. + +### people fields: author, contributors + +The "author" is one person. +"contributors" is an array of people. +A "person" is an object with a "name" field and optionally "url" and "email", like this: + +```json +{ + "name" : "Barney Rubble", + "email" : "barney@npmjs.com", + "url" : "http://barnyrubble.npmjs.com/" +} +``` + +Or you can shorten that all into a single string, and npm will parse it for you: + +```json +{ + "author": "Barney Rubble (http://barnyrubble.npmjs.com/)" +} +``` + +Both email and url are optional either way. + +npm also sets a top-level "maintainers" field with your npm user info. + +### funding + +You can specify an object containing a URL that provides up-to-date information about ways to help fund development of your package, a string URL, or an array of objects and string URLs: + +```json +{ + "funding": { + "type" : "individual", + "url" : "http://npmjs.com/donate" + } +} +``` + +```json +{ + "funding": { + "type" : "patreon", + "url" : "https://www.patreon.com/user" + } +} +``` + +```json +{ + "funding": "http://npmjs.com/donate" +} +``` + +```json +{ + "funding": [ + { + "type" : "individual", + "url" : "http://npmjs.com/donate" + }, + "http://npmjs.com/donate-also", + { + "type" : "patreon", + "url" : "https://www.patreon.com/user" + } + ] +} +``` + +Users can use the `npm fund` subcommand to list the `funding` URLs of all dependencies of their project, direct and indirect. +A shortcut to visit each funding URL is also available when providing the project name such as: +`npm fund ` (when there are multiple URLs, the first one will be visited) + +### files + +The optional `files` field is an array of file patterns that describes the entries to be included when your package is installed as a dependency. +File patterns follow a similar syntax to `.gitignore`, but reversed: including a file, directory, or glob pattern (`*`, `**/*`, and such) will make it so that file is included in the tarball when it's packed. +Omitting the field will make it default to `["*"]`, which means it will include all files. + +Some special files and directories are also included or excluded regardless of whether they exist in the `files` array (see below). + +You can also provide a `.npmignore` file in the root of your package or in subdirectories, which will keep files from being included. +At the root of your package it will not override the "files" field, but in subdirectories it will. +The `.npmignore` file works just like a `.gitignore`. +If there is a `.gitignore` file, and `.npmignore` is missing, `.gitignore`'s contents will be used instead. + +Certain files are always included, regardless of settings: + +* `package.json` +* `README` +* `LICENSE` / `LICENCE` +* The file in the "main" field +* The file(s) in the "bin" field + +`README` & `LICENSE` can have any case and extension. + +Some files are always ignored by default: + +* `*.orig` +* `.*.swp` +* `.DS_Store` +* `._*` +* `.git` +* `.hg` +* `.lock-wscript` +* `.npmrc` +* `.svn` +* `.wafpickle-N` +* `CVS` +* `config.gypi` +* `node_modules` +* `npm-debug.log` +* `package-lock.json` (use [`npm-shrinkwrap.json`](/configuring-npm/npm-shrinkwrap-json) if you wish it to be published) +* `pnpm-lock.yaml` +* `yarn.lock` +* `bun.lockb` + +Most of these ignored files can be included specifically if included in the `files` globs. +Exceptions to this are: + +* `.git` +* `.npmrc` +* `node_modules` +* `package-lock.json` +* `pnpm-lock.yaml` +* `yarn.lock` +* `bun.lockb` + +These cannot be included. + +### exports + +The "exports" provides a modern alternative to "main" allowing multiple entry points to be defined, conditional entry resolution support between environments, and preventing any other entry points besides those defined in "exports". This encapsulation allows module authors to clearly define the public interface for their package. +For more details see the [node.js documentation on package entry points](https://nodejs.org/api/packages.html#package-entry-points) + +### main + +The main field is a module ID that is the primary entry point to your program. +That is, if your package is named `foo`, and a user installs it, and then does `require("foo")`, then your main module's exports object will be returned. + +This should be a module relative to the root of your package folder. + +For most modules, it makes the most sense to have a main script and often not much else. + +If `main` is not set, it defaults to `index.js` in the package's root folder. + +### type + +The `type` field defines how Node.js should interpret `.js` files in your package. This field is not used by npm. + +See the [Node.js documentation on the type field](https://nodejs.org/api/packages.html#type) for more information. + +### browser + +If your module is meant to be used client-side the browser field should be used instead of the main field. +This is helpful to hint users that it might rely on primitives that aren't available in Node.js modules. +(e.g. `window`) + +### bin + +A lot of packages have one or more executable files that they'd like to install into the PATH. npm makes this pretty easy (in fact, it uses this feature to install the "npm" executable.) + +To use this, supply a `bin` field in your package.json which is a map of command name to local file name. +When this package is installed globally, that file will be either linked inside the global bins directory or a cmd (Windows Command File) will be created which executes the specified file in the `bin` field, so it is available to run by `name` or `name.cmd` (on Windows PowerShell). +When this package is installed as a dependency in another package, the file will be linked where it will be available to that package either directly by `npm exec` or by name in other scripts when invoking them via `npm run`. + + +For example, myapp could have this: + +```json +{ + "bin": { + "myapp": "bin/cli.js" + } +} +``` + +So, when you install myapp, in case of unix-like OS it'll create a symlink from the `cli.js` script to `/usr/local/bin/myapp` and in case of windows it will create a cmd file usually at `C:\Users\{Username}\AppData\Roaming\npm\myapp.cmd` which runs the `cli.js` script. + +If you have a single executable, and its name should be the name of the package, then you can just supply it as a string. +For example: + +```json +{ + "name": "my-program", + "version": "1.2.5", + "bin": "path/to/program" +} +``` + +would be the same as this: + +```json +{ + "name": "my-program", + "version": "1.2.5", + "bin": { + "my-program": "path/to/program" + } +} +``` + +Please make sure that your file(s) referenced in `bin` starts with `#!/usr/bin/env node`; otherwise, the scripts are started without the node executable! + +Note that you can also set the executable files using [directories.bin](#directoriesbin). + +See [folders](/configuring-npm/folders#executables) for more info on executables. + +### man + +Specify either a single file or an array of filenames to put in place for the `man` program to find. + +If only a single file is provided, then it's installed such that it is the result from `man `, regardless of its actual filename. +For example: + +```json +{ + "name": "foo", + "version": "1.2.3", + "description": "A packaged foo fooer for fooing foos", + "main": "foo.js", + "man": "./man/doc.1" +} +``` + +would link the `./man/doc.1` file in such that it is the target for `man foo` + +If the filename doesn't start with the package name, then it's prefixed. +So, this: + +```json +{ + "name": "foo", + "version": "1.2.3", + "description": "A packaged foo fooer for fooing foos", + "main": "foo.js", + "man": [ + "./man/foo.1", + "./man/bar.1" + ] +} +``` + +will create files to do `man foo` and `man foo-bar`. + +Man files must end with a number, and optionally a `.gz` suffix if they are compressed. +The number dictates which man section the file is installed into. + +```json +{ + "name": "foo", + "version": "1.2.3", + "description": "A packaged foo fooer for fooing foos", + "main": "foo.js", + "man": [ + "./man/foo.1", + "./man/foo.2" + ] +} +``` + +will create entries for `man foo` and `man 2 foo` + +### directories + +The CommonJS [Packages](http://wiki.commonjs.org/wiki/Packages/1.0) spec details a few ways that you can indicate the structure of your package using a `directories` object. +If you look at [npm's package.json](https://registry.npmjs.org/npm/latest), you'll see that it has directories for doc, lib, and man. + +In the future, this information may be used in other creative ways. + +#### directories.bin + +If you specify a `bin` directory in `directories.bin`, all the files in that folder will be added. + +Because of the way the `bin` directive works, specifying both a `bin` path and setting `directories.bin` is an error. +If you want to specify individual files, use `bin`, and for all the files in an existing `bin` directory, use `directories.bin`. + +#### directories.man + +A folder that is full of man pages. +Sugar to generate a "man" array by walking the folder. + +### repository + +Specify the place where your code lives. +This is helpful for people who want to contribute. +If the git repo is on GitHub, then the `npm repo` command will be able to find you. + +Do it like this: + +```json +{ + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cli.git" + } +} +``` + +The URL should be a publicly available (perhaps read-only) URL that can be handed directly to a VCS program without any modification. +It should not be a URL to an html project page that you put in your browser. +It's for computers. + +For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same shortcut syntax you use for `npm install`: + +```json +{ + "repository": "npm/example", + + "repository": "github:npm/example", + + "repository": "gist:11081aaa281", + + "repository": "bitbucket:user/repo", + + "repository": "gitlab:user/repo" +} +``` + +**Note on normalization:** When you publish a package, npm normalizes the `repository` field to the full object format with a `url` property. If you use a shorthand format (like `"npm/example"`), you'll see a warning during `npm publish` indicating that the field was auto-corrected. While the shorthand format currently works, it's recommended to use the full object format in your `package.json` to avoid warnings and ensure future compatibility: + +```json +{ + "repository": { + "type": "git", + "url": "git+https://github.com/npm/example.git" + } +} +``` + +You can run `npm pkg fix` to automatically convert shorthand formats to the normalized object format. + +If the `package.json` for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives: + +```json +{ + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cli.git", + "directory": "workspaces/libnpmpublish" + } +} +``` + +### scripts + +The "scripts" property is a dictionary containing script commands that are run at various times in the lifecycle of your package. +The key is the lifecycle event, and the value is the command to run at that point. + +See [`scripts`](/using-npm/scripts) to find out more about writing package scripts. + +### gypfile + +If you have a binding.gyp file in the root of your package and you have not defined your own `install` or `preinstall` scripts, npm will default to building your module using node-gyp. + +To prevent npm from automatically building your module with node-gyp, set `gypfile` to `false`: + +```json +{ + "gypfile": false +} +``` + +This is useful for packages that include native addons but want to handle the build process differently, or packages that have a binding.gyp file but should not be built as a native addon. + +### config + +A "config" object can be used to set configuration parameters used in package scripts that persist across upgrades. +For instance, if a package had the following: + +```json +{ + "name": "foo", + "config": { + "port": "8080" + } +} +``` + +It could also have a "start" script that referenced the `npm_package_config_port` environment variable. + +### dependencies + +Dependencies are specified in a simple object that maps a package name to a version range. +The version range is a string which has one or more space-separated descriptors. +Dependencies can also be identified with a tarball or git URL. + +**Please do not put test harnesses or transpilers or other "development" time tools in your `dependencies` object.** +See `devDependencies`, below. + +See [semver](https://github.com/npm/node-semver#versions) for more details about specifying version ranges. + +* `version` Must match `version` exactly +* `>version` Must be greater than `version` +* `>=version` etc +* `=version1 <=version2`. +* `range1 || range2` Passes if either range1 or range2 are satisfied. +* `git...` See 'Git URLs as Dependencies' below +* `user/repo` See 'GitHub URLs' below +* `tag` A specific version tagged and published as `tag` See [`npm dist-tag`](/commands/npm-dist-tag) +* `path/path/path` See [Local Paths](#local-paths) below +* `npm:@scope/pkg@version` Custom alias for a package See [`package-spec`](/using-npm/package-spec#aliases) + +For example, these are all valid: + +```json +{ + "dependencies": { + "foo": "1.0.0 - 2.9999.9999", + "bar": ">=1.0.2 <2.1.2", + "baz": ">1.0.2 <=2.3.4", + "boo": "2.0.1", + "qux": "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0", + "asd": "http://npmjs.com/example.tar.gz", + "til": "~1.2", + "elf": "~1.2.3", + "two": "2.x", + "thr": "3.3.x", + "lat": "latest", + "dyl": "file:../dyl", + "kpg": "npm:pkg@1.0.0" + } +} +``` + +#### URLs as Dependencies + +You may specify a tarball URL in place of a version range. + +This tarball will be downloaded and installed locally to your package at install time. + +#### Git URLs as Dependencies + +Git URLs are of the form: + +```bash +://[[:]@][:][:][/][# | #semver:] +``` + +`` is one of `git`, `git+ssh`, `git+http`, `git+https`, or `git+file`. + +If `#` is provided, it will be used to clone exactly that commit. +If the commit-ish has the format `#semver:`, `` can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. +If neither `#` or `#semver:` is specified, then the default branch is used. + +Examples: + +```bash +git+ssh://git@github.com:npm/cli.git#v1.0.27 +git+ssh://git@github.com:npm/cli#semver:^5.0 +git+https://isaacs@github.com/npm/cli.git +git://github.com/npm/cli.git#v1.0.27 +``` + +When installing from a `git` repository, the presence of certain fields in the `package.json` will cause npm to believe it needs to perform a build. +To do so your repository will be cloned into a temporary directory, all of its deps installed, relevant scripts run, and the resulting directory packed and installed. + +This flow will occur if your git dependency uses `workspaces`, or if any of the following scripts are present: + +* `build` +* `prepare` +* `prepack` +* `preinstall` +* `install` +* `postinstall` + +If your git repository includes pre-built artifacts, you will likely want to make sure that none of the above scripts are defined, or your dependency will be rebuilt for every installation. + +#### GitHub URLs + +As of version 1.1.65, you can refer to GitHub URLs as just "foo": +"user/foo-project". Just as with git URLs, a `commit-ish` suffix can be included. +For example: + +```json +{ + "name": "foo", + "version": "0.0.0", + "dependencies": { + "express": "expressjs/express", + "mocha": "mochajs/mocha#4727d357ea", + "module": "npm/example-github-repo#feature\/branch" + } +} +``` + +#### Local Paths + +As of version 2.0.0 you can provide a path to a local directory that contains a package. +Local paths can be saved using `npm install -S` or `npm install --save`, using any of these forms: + +```bash +../foo/bar +~/foo/bar +./foo/bar +/foo/bar +``` + +in which case they will be normalized to a relative path and added to your `package.json`. +For example: + +```json +{ + "name": "baz", + "dependencies": { + "bar": "file:../foo/bar" + } +} +``` + +This feature is helpful for local offline development and creating tests that require npm installing where you don't want to hit an external server, but should not be used when publishing your package to the public registry. + +*note*: Packages linked by local path will not have their own dependencies installed when `npm install` is run. +You must run `npm install` from inside the local path itself. + +### devDependencies + +If someone is planning on downloading and using your module in their program, then they probably don't want or need to download and build the external test or documentation framework that you use. + +In this case, it's best to map these additional items in a `devDependencies` object. + +These things will be installed when doing `npm link` or `npm install` from the root of a package, and can be managed like any other npm configuration param. +See [`config`](/using-npm/config) for more on the topic. + +For build steps that are not platform-specific, such as compiling CoffeeScript or other languages to JavaScript, use the `prepare` script to do this, and make the required package a devDependency. + +For example: + +```json +{ + "name": "@npm/ethopia-waza", + "description": "a delightfully fruity coffee varietal", + "version": "1.2.3", + "devDependencies": { + "coffee-script": "~1.6.3" + }, + "scripts": { + "prepare": "coffee -o lib/ -c src/waza.coffee" + }, + "main": "lib/waza.js" +} +``` + +The `prepare` script will be run before publishing, so that users can consume the functionality without requiring them to compile it themselves. +In dev mode (ie, locally running `npm install`), it'll run this script as well, so that you can test it easily. + +### peerDependencies + +In some cases, you want to express the compatibility of your package with a host tool or library, while not necessarily doing a `require` of this host. +This is usually referred to as a *plugin*. Notably, your module may be exposing a specific interface, expected and specified by the host documentation. + +For example: + +```json +{ + "name": "@npm/tea-latte", + "version": "1.3.5", + "peerDependencies": { + "@npm/tea": "2.x" + } +} +``` + +This ensures your package `@npm/tea-latte` can be installed *along* with the second major version of the host package `@npm/tea` only. +`npm install tea-latte` could possibly yield the following dependency graph: + +```bash +├── @npm/tea-latte@1.3.5 +└── @npm/tea@2.2.0 +``` + +In npm versions 3 through 6, `peerDependencies` were not automatically installed, and would raise a warning if an invalid version of the peer dependency was found in the tree. +As of npm v7, peerDependencies _are_ installed by default. + +Trying to install another plugin with a conflicting requirement may cause an error if the tree cannot be resolved correctly. +For this reason, make sure your plugin requirement is as broad as possible, and not to lock it down to specific patch versions. + +Assuming the host complies with [semver](https://semver.org/), only changes in the host package's major version will break your plugin. +Thus, if you've worked with every 1.x version of the host package, use `"^1.0"` or `"1.x"` to express this. +If you depend on features introduced in 1.5.2, use `"^1.5.2"`. + +### peerDependenciesMeta + +The `peerDependenciesMeta` field serves to provide npm more information on how your peer dependencies are to be used. +Specifically, it allows peer dependencies to be marked as optional. +Npm will not automatically install optional peer dependencies. +This allows you to integrate and interact with a variety of host packages without requiring all of them to be installed. + +For example: + +```json +{ + "name": "@npm/tea-latte", + "version": "1.3.5", + "peerDependencies": { + "@npm/tea": "2.x", + "@npm/soy-milk": "1.2" + }, + "peerDependenciesMeta": { + "@npm/soy-milk": { + "optional": true + } + } +} +``` + +### bundleDependencies + +This defines an array of package names that will be bundled when publishing the package. + +In cases where you need to preserve npm packages locally or have them available through a single file download, you can bundle the packages in a tarball file by specifying the package names in the `bundleDependencies` array and executing `npm pack`. + +For example: + +If we define a package.json like this: + +```json +{ + "name": "@npm/awesome-web-framework", + "version": "1.0.0", + "bundleDependencies": [ + "@npm/renderized", + "@npm/super-streams" + ] +} +``` + +we can obtain `@npm/awesome-web-framework-1.0.0.tgz` file by running `npm pack`. +This file contains the dependencies `@npm/renderized` and `@npm/super-streams` which can be installed in a new project by executing `npm install awesome-web-framework-1.0.0.tgz`. +Note that the package names do not include any versions, as that information is specified in `dependencies`. + +If this is spelled `"bundledDependencies"`, then that is also honored. + +Alternatively, `"bundleDependencies"` can be defined as a boolean value. +A value of `true` will bundle all dependencies, a value of `false` will bundle none. + +### optionalDependencies + +If a dependency can be used, but you would like npm to proceed if it cannot be found or fails to install, then you may put it in the `optionalDependencies` object. +This is a map of package name to version or URL, just like the `dependencies` object. +The difference is that build failures do not cause installation to fail. +Running `npm install --omit=optional` will prevent these dependencies from being installed. + +It is still your program's responsibility to handle the lack of the dependency. +For example, something like this: + +```js +try { + var foo = require('@npm/foo') + var fooVersion = require('@npm/foo/package.json').version +} catch (er) { + foo = null +} +if ( notGoodFooVersion(fooVersion) ) { + foo = null +} + +// .. then later in your program .. + +if (foo) { + foo.doFooThings() +} +``` + +Entries in `optionalDependencies` will override entries of the same name in `dependencies`, so it's usually best to only put in one place. + +### overrides + +If you need to make specific changes to dependencies of your dependencies, for example replacing the version of a dependency with a known security issue, replacing an existing dependency with a fork, or making sure that the same version of a package is used everywhere, then you may add an override. + +Overrides provide a way to replace a package in your dependency tree with another version, or another package entirely. +These changes can be scoped as specific or as vague as desired. + +Overrides are only considered in the root `package.json` file for a project. +Overrides in installed dependencies (including [workspaces](/using-npm/workspaces)) are not considered in dependency tree resolution. +Published packages may dictate their resolutions by pinning dependencies or using an [`npm-shrinkwrap.json`](/configuring-npm/npm-shrinkwrap-json) file. + +To make sure the package `@npm/foo` is always installed as version `1.0.0` no matter what version your dependencies rely on: + +```json +{ + "overrides": { + "@npm/foo": "1.0.0" + } +} +``` + +The above is a short hand notation, the full object form can be used to allow overriding a package itself as well as a child of the package. +This will cause `@npm/foo` to always be `1.0.0` while also making `@npm/bar` at any depth beyond `@npm/foo` also `1.0.0`: + +```json +{ + "overrides": { + "@npm/foo": { + ".": "1.0.0", + "@npm/bar": "1.0.0" + } + } +} +``` + +To only override `@npm/foo` to be `1.0.0` when it's a child (or grandchild, or great grandchild, etc) of the package `@npm/bar`: + +```json +{ + "overrides": { + "@npm/bar": { + "@npm/foo": "1.0.0" + } + } +} +``` + +Keys can be nested to any arbitrary length. +To override `@npm/foo` only when it's a child of `@npm/bar` and only when `@npm/bar` is a child of `@npm/baz`: + +```json +{ + "overrides": { + "@npm/baz": { + "@npm/bar": { + "@npm/foo": "1.0.0" + } + } + } +} +``` + +The key of an override can also include a version, or range of versions. +To override `@npm/foo` to `1.0.0`, but only when it's a child of `@npm/bar@2.0.0`: + +```json +{ + "overrides": { + "@npm/bar@2.0.0": { + "@npm/foo": "1.0.0" + } + } +} +``` + +You may not set an override for a package that you directly depend on unless both the dependency and the override itself share the exact same spec. +To make this limitation easier to deal with, overrides may also be defined as a reference to a spec for a direct dependency by prefixing the name of the package you wish the version to match with a `$`. + +```json +{ + "dependencies": { + "@npm/foo": "^1.0.0" + }, + "overrides": { + // BAD, will throw an EOVERRIDE error + // "foo": "^2.0.0" + // GOOD, specs match so override is allowed + // "foo": "^1.0.0" + // BEST, the override is defined as a reference to the dependency + "@npm/foo": "$foo", + // the referenced package does not need to match the overridden one + "@npm/bar": "$foo" + } +} +``` + +#### Replacing a dependency with a fork + +You can replace a package with a different package or fork using several methods: + +**Using the `npm:` prefix to replace with a different package name:** + +```json +{ + "overrides": { + "package-name": "npm:@scope/forked-package@1.0.0" + } +} +``` + +**Using a GitHub repository (supports branches, tags, or commit hashes):** + +```json +{ + "overrides": { + "package-name": "github:username/repo#branch-name" + } +} +``` + +**Using a local file path:** + +```json +{ + "overrides": { + "package-name": "file:../local-fork" + } +} +``` + +These replacement methods work for both top-level overrides and nested overrides. +For example, to replace a transitive dependency with a fork: + +```json +{ + "overrides": { + "parent-package": { + "vulnerable-dep": "github:username/patched-fork#v2.0.1" + } + } +} +``` + +### engines + +You can specify the version of node that your stuff works on: + +```json +{ + "engines": { + "node": ">=0.10.3 <15" + } +} +``` + +And, like with dependencies, if you don't specify the version (or if you specify "\*" as the version), then any version of node will do. + +You can also use the "engines" field to specify which versions of npm are capable of properly installing your program. +For example: + +```json +{ + "engines": { + "npm": "~1.0.20" + } +} +``` + +Unless the user has set the [`engine-strict` config](/using-npm/config#engine-strict) flag, this field is advisory only and will only produce warnings when your package is installed as a dependency. + +### os + +You can specify which operating systems your module will run on: + +```json +{ + "os": [ + "darwin", + "linux" + ] +} +``` + +You can also block instead of allowing operating systems, just prepend the blocked os with a '!': + +```json +{ + "os": [ + "!win32" + ] +} +``` + +The host operating system is determined by `process.platform` + +It is allowed to both block and allow an item, although there isn't any good reason to do this. + +### cpu + +If your code only runs on certain cpu architectures, you can specify which ones. + +```json +{ + "cpu": [ + "x64", + "ia32" + ] +} +``` + +Like the `os` option, you can also block architectures: + +```json +{ + "cpu": [ + "!arm", + "!mips" + ] +} +``` + +The host architecture is determined by `process.arch` + +### libc + +If your code only runs or builds in certain versions of libc, you can specify which ones. +This field only applies if `os` is `linux`. + +```json +{ + "os": "linux", + "libc": "glibc" +} +``` + +### devEngines + +The `devEngines` field aids engineers working on a codebase to all be using the same tooling. + +You can specify a `devEngines` property in your `package.json` which will run before `install`, `ci`, and `run` commands. + + +> Note: `engines` and `devEngines` differ in object shape. +They also function very differently. +`engines` is designed to alert the user when a dependency uses a different npm or node version than the project it's being used in, whereas `devEngines` is used to alert people interacting with the source code of a project. + +The supported keys under the `devEngines` property are `cpu`, `os`, `libc`, `runtime`, and `packageManager`. +Each property can be an object or an array of objects. +Objects must contain `name`, and optionally can specify `version`, and `onFail`. +`onFail` can be `warn`, `error`, or `ignore`, and if left undefined is of the same value as `error`. +`npm` will assume that you're running with `node`. +Here's an example of a project that will fail if the environment is not `node` and `npm`. +If you set `runtime.name` or `packageManager.name` to any other string, it will fail within the npm CLI. + +```json +{ + "devEngines": { + "runtime": { + "name": "node", + "onFail": "error" + }, + "packageManager": { + "name": "npm", + "onFail": "error" + } + } +} +``` + +### private + +If you set `"private": true` in your package.json, then npm will refuse to publish it. + +This is a way to prevent accidental publication of private repositories. +If you would like to ensure that a given package is only ever published to a specific registry (for example, an internal registry), then use the `publishConfig` dictionary described below to override the `registry` config param at publish-time. + +### publishConfig + +This is a set of config values that will be used at publish-time. +It's especially handy if you want to set the tag, registry or access, so that you can ensure that a given package is not tagged with "latest", published to the global public registry or that a scoped module is private by default. + +See [`config`](/using-npm/config) to see the list of config options that can be overridden. + +### workspaces + +The optional `workspaces` field is an array of file patterns that describes locations within the local file system that the install client should look up to find each [workspace](/using-npm/workspaces) that needs to be symlinked to the top level `node_modules` folder. + +It can describe either the direct paths of the folders to be used as workspaces or it can define globs that will resolve to these same folders. + +In the following example, all folders located inside the folder `./packages` will be treated as workspaces as long as they have valid `package.json` files inside them: + +```json +{ + "name": "workspace-example", + "workspaces": [ + "./packages/*" + ] +} +``` + +See [`workspaces`](/using-npm/workspaces) for more examples. + +### DEFAULT VALUES + +npm will default some values based on package contents. + +* `"scripts": {"start": "node server.js"}` + + If there is a `server.js` file in the root of your package, then npm will default the `start` command to `node server.js`. + +* `"scripts":{"install": "node-gyp rebuild"}` + + If there is a `binding.gyp` file in the root of your package and you have not defined an `install` or `preinstall` script, npm will default the `install` command to compile using node-gyp. + +* `"contributors": [...]` + + If there is an `AUTHORS` file in the root of your package, npm will treat each line as a `Name (url)` format, where email and url are optional. + Lines which start with a `#` or are blank, will be ignored. + +### SEE ALSO + +* [semver](https://github.com/npm/node-semver#versions) +* [workspaces](/using-npm/workspaces) +* [npm init](/commands/npm-init) +* [npm version](/commands/npm-version) +* [npm config](/commands/npm-config) +* [npm help](/commands/npm-help) +* [npm install](/commands/npm-install) +* [npm publish](/commands/npm-publish) +* [npm uninstall](/commands/npm-uninstall) diff --git a/node24/node_modules/npm/docs/content/configuring-npm/package-lock-json.md b/node24/node_modules/npm/docs/content/configuring-npm/package-lock-json.md new file mode 100644 index 0000000000000000000000000000000000000000..9c4a298080aaa4b774b0fc171cbac3bf712346f7 --- /dev/null +++ b/node24/node_modules/npm/docs/content/configuring-npm/package-lock-json.md @@ -0,0 +1,182 @@ +--- +title: package-lock.json +section: 5 +description: A manifestation of the manifest +--- + +### Description + +`package-lock.json` is automatically generated for any operations where npm modifies either the `node_modules` tree, or `package.json`. +It describes the exact tree that was generated, such that subsequent installs are able to generate identical trees, regardless of intermediate dependency updates. + +This file is intended to be committed into source repositories, and serves various purposes: + +* Describe a single representation of a dependency tree such that teammates, deployments, and continuous integration are guaranteed to install exactly the same dependencies. + +* Provide a facility for users to "time-travel" to previous states of `node_modules` without having to commit the directory itself. + +* Facilitate greater visibility of tree changes through readable source control diffs. + +* Optimize the installation process by allowing npm to skip repeated metadata resolutions for previously-installed packages. + +* As of npm v7, lockfiles include enough information to gain a complete picture of the package tree, reducing the need to read `package.json` files, and allowing for significant performance improvements. + +When `npm` creates or updates `package-lock.json`, it will infer line endings and indentation from `package.json` so that the formatting of both files matches. + +### `package-lock.json` vs `npm-shrinkwrap.json` + +Both of these files have the same format, and perform similar functions in the root of a project. + +The difference is that `package-lock.json` cannot be published, and it will be ignored if found in any place other than the root project. + +In contrast, [npm-shrinkwrap.json](/configuring-npm/npm-shrinkwrap-json) allows publication, and defines the dependency tree from the point encountered. +This is not recommended unless deploying a CLI tool or otherwise using the publication process for producing production packages. + +If both `package-lock.json` and `npm-shrinkwrap.json` are present in the root of a project, `npm-shrinkwrap.json` will take precedence and `package-lock.json` will be ignored. + +### Hidden Lockfiles + +In order to avoid processing the `node_modules` folder repeatedly, npm as of v7 uses a "hidden" lockfile present in `node_modules/.package-lock.json`. +This contains information about the tree, and is used in lieu of reading the entire `node_modules` hierarchy provided that the following conditions are met: + +- All package folders it references exist in the `node_modules` hierarchy. +- No package folders exist in the `node_modules` hierarchy that are not listed in the lockfile. +- The modified time of the file is at least as recent as all of the package folders it references. + +That is, the hidden lockfile will only be relevant if it was created as part of the most recent update to the package tree. +If another CLI mutates the tree in any way, this will be detected, and the hidden lockfile will be ignored. + +Note that it _is_ possible to manually change the _contents_ of a package in such a way that the modified time of the package folder is unaffected. +For example, if you add a file to `node_modules/foo/lib/bar.js`, then the modified time on `node_modules/foo` will not reflect this change. +If you are manually editing files in `node_modules`, it is generally best to delete the file at `node_modules/.package-lock.json`. + +As the hidden lockfile is ignored by older npm versions, it does not contain the backwards compatibility affordances present in "normal" lockfiles. +That is, it is `lockfileVersion: 3`, rather than `lockfileVersion: 2`. + +### Handling Old Lockfiles + +When npm detects a lockfile from npm v6 or before during the package installation process, it is automatically updated to fetch missing information from either the `node_modules` tree or (in the case of empty `node_modules` trees or very old lockfile formats) the npm registry. + +### File Format + +#### `name` + +The name of the package this is a package-lock for. +This will match what's in `package.json`. + +#### `version` + +The version of the package this is a package-lock for. +This will match what's in `package.json`. + +#### `lockfileVersion` + +An integer version, starting at `1` with the version number of this document whose semantics were used when generating this `package-lock.json`. + +Note that the file format changed significantly in npm v7 to track information that would have otherwise required looking in `node_modules` or the npm registry. +Lockfiles generated by npm v7 will contain `lockfileVersion: 2`. + +* No version provided: an "ancient" shrinkwrap file from a version of npm prior to npm v5. +* `1`: The lockfile version used by npm v5 and v6. +* `2`: The lockfile version used by npm v7 and v8. Backwards compatible to v1 lockfiles. +* `3`: The lockfile version used by npm v9 and above. + Backwards compatible to npm v7. + +npm will always attempt to get whatever data it can out of a lockfile, even if it is not a version that it was designed to support. + +#### `packages` + +This is an object that maps package locations to an object containing the information about that package. + +The root project is typically listed with a key of `""`, and all other packages are listed with their relative paths from the root project folder. + +Package descriptors have the following fields: + +* version: The version found in `package.json` + +* resolved: The place where the package was actually resolved from. + In the case of packages fetched from the registry, this will be a url to a tarball. + In the case of git dependencies, this will be the full git url with commit sha. + In the case of link dependencies, this will be the location of the link target. + `registry.npmjs.org` is a magic value meaning "the currently configured registry". + +* integrity: A `sha512` or `sha1` [Standard Subresource Integrity](https://w3c.github.io/webappsec/specs/subresourceintegrity/) string for the artifact that was unpacked in this location. + +* link: A flag to indicate that this is a symbolic link. + If this is present, no other fields are specified, since the link target will also be included in the lockfile. + +* dev, optional, devOptional: If the package is strictly part of the + `devDependencies` tree, then `dev` will be true. + If it is strictly part of the `optionalDependencies` tree, then `optional` will be set. + If it is both a `dev` dependency _and_ an `optional` dependency of a non-dev dependency, then `devOptional` will be set. + (An `optional` dependency of a `dev` dependency will have both `dev` and `optional` set.) + +* inBundle: A flag to indicate that the package is a bundled dependency. + +* hasInstallScript: A flag to indicate that the package has a `preinstall`, `install`, or `postinstall` script. + +* hasShrinkwrap: A flag to indicate that the package has an `npm-shrinkwrap.json` file. + +* bin, license, engines, dependencies, optionalDependencies: fields from `package.json` + +* os: An array of operating systems this package is compatible with, as specified in `package.json`. This field is included when the package specifies OS restrictions. + +* cpu: An array of CPU architectures this package is compatible with, as specified in `package.json`. This field is included when the package specifies CPU restrictions. + +* funding: Funding information for the package, as specified in `package.json`. This field contains details about how to support the package maintainers. + +#### dependencies + +Legacy data for supporting versions of npm that use `lockfileVersion: 1`. +This is a mapping of package names to dependency objects. +Because the object structure is strictly hierarchical, symbolic link dependencies are somewhat challenging to represent in some cases. + +npm v7 ignores this section entirely if a `packages` section is present, but does keep it up to date in order to support switching between npm v6 and npm v7. + +Dependency objects have the following fields: + +* version: a specifier that varies depending on the nature of the package, and is usable in fetching a new copy of it. + Note that for peer dependencies that are not installed, or optional dependencies that are not installed, this field may be omitted. + + * bundled dependencies: Regardless of source, this is a version number that is purely for informational purposes. + * registry sources: This is a version number. + (eg, `1.2.3`) + * git sources: This is a git specifier with resolved committish. + (eg, `git+https://example.com/foo/bar#115311855adb0789a0466714ed48a1499ffea97e`) + * http tarball sources: This is the URL of the tarball. + (eg, `https://example.com/example-1.3.0.tgz`) + * local tarball sources: This is the file URL of the tarball. + (eg `file:///opt/storage/example-1.3.0.tgz`) + * local link sources: This is the file URL of the link. + (eg `file:libs/our-module`) + + **Note:** The `version` field may be omitted for certain types of dependencies, such as optional peer dependencies that are not installed. In these cases, only metadata fields like `dev`, `optional`, and `peer` will be present. + +* integrity: A `sha512` or `sha1` [Standard Subresource Integrity](https://w3c.github.io/webappsec/specs/subresourceintegrity/) string for the artifact that was unpacked in this location. + For git dependencies, this is the commit sha. + +* resolved: For registry sources this is path of the tarball relative to the registry URL. + If the tarball URL isn't on the same server as the registry URL then this is a complete URL. + `registry.npmjs.org` is a magic value meaning "the currently configured registry". + +* bundled: If true, this is the bundled dependency and will be installed by the parent module. + When installing, this module will be extracted from the parent module during the extract phase, not installed as a separate dependency. + +* dev: If true then this dependency is either a development dependency ONLY of the top level module or a transitive dependency of one. + This is false for dependencies that are both a development dependency of the top level and a transitive dependency of a non-development dependency of the top level. + +* optional: If true then this dependency is either an optional dependency ONLY of the top level module or a transitive dependency of one. + This is false for dependencies that are both an optional dependency of the top level and a transitive dependency of a non-optional dependency of the top level. + +* requires: This is a mapping of module name to version. + This is a list of everything this module requires, regardless of where it will be installed. + The version should match via normal matching rules a dependency either in our `dependencies` or in a level higher than us. + +* dependencies: The dependencies of this dependency, exactly as at the top level. + +### See also + +* [npm shrinkwrap](/commands/npm-shrinkwrap) +* [npm-shrinkwrap.json](/configuring-npm/npm-shrinkwrap-json) +* [package.json](/configuring-npm/package-json) +* [npm install](/commands/npm-install) diff --git a/node24/node_modules/npm/docs/content/using-npm/config.md b/node24/node_modules/npm/docs/content/using-npm/config.md new file mode 100644 index 0000000000000000000000000000000000000000..bd344abde39ce01f68c40174e23877c25d6a8849 --- /dev/null +++ b/node24/node_modules/npm/docs/content/using-npm/config.md @@ -0,0 +1,2209 @@ +--- +title: Config +section: 7 +description: About npm configuration +--- + +### Description + +This article details npm configuration in general. +To learn about the `config` command, see [`npm config`](/commands/npm-config). + +npm gets its configuration values from the following sources, sorted by priority: + +#### Command Line Flags + +Putting `--foo bar` on the command line sets the `foo` configuration parameter to `"bar"`. +A `--` argument tells the cli parser to stop reading flags. +Using `--flag` without specifying any value will set the value to `true`. + +Example: `--flag1 --flag2` will set both configuration parameters to `true`, while `--flag1 --flag2 bar` will set `flag1` to `true`, and `flag2` to `bar`. +Finally, `--flag1 --flag2 -- bar` will set both configuration parameters to `true`, and the `bar` is taken as a command argument. + +**Common examples:** + +* `npm install --prefix /path/to/dir` - Runs npm commands in a different directory without changing the current working directory +* `npm install --global` - Installs packages globally (shorthand: `-g`) +* `npm install --save-dev` - Saves to devDependencies (shorthand: `-D`) + +Any configuration option documented in the [Config Settings](#config-settings) section below can be set via command line flags using `--option-name value` syntax. + +#### Environment Variables + +Any environment variables that start with `npm_config_` will be interpreted as a configuration parameter. +For example, putting `npm_config_foo=bar` in your environment will set the `foo` configuration parameter to `bar`. +Any environment configurations that are not given a value will be given the value of `true`. +Config values are case-insensitive, so `NPM_CONFIG_FOO=bar` will work the same. +However, please note that inside [`scripts`](/using-npm/scripts) npm will set its own environment variables and Node will prefer those lowercase versions over any uppercase ones that you might set. +For details see [this issue](https://github.com/npm/npm/issues/14528). + +Notice that you need to use underscores instead of dashes, so `--allow-same-version` would become `npm_config_allow_same_version=true`. + +**Important:** When defining custom configuration keys in `.npmrc` files, use hyphens instead of underscores (e.g., `custom-key=value`). This ensures they can be overridden by environment variables, since npm automatically converts underscores to hyphens when reading environment variables. Keys with underscores in `.npmrc` files cannot be overridden via environment variables. + +#### npmrc Files + +The four relevant files are: + +* per-project configuration file (`/path/to/my/project/.npmrc`) +* per-user configuration file (defaults to `$HOME/.npmrc`; configurable via CLI option `--userconfig` or environment variable `$NPM_CONFIG_USERCONFIG`) +* global configuration file (defaults to `$PREFIX/etc/npmrc`; configurable via CLI option `--globalconfig` or environment variable `$NPM_CONFIG_GLOBALCONFIG`) +* npm's built-in configuration file (`/path/to/npm/npmrc`) + +See [npmrc](/configuring-npm/npmrc) for more details. + +#### Default Configs + +Run `npm config ls -l` to see a set of configuration parameters that are internal to npm, and are defaults if nothing else is specified. + +### Shorthands and Other CLI Niceties + +The following shorthands are parsed on the command-line: + +* `-a`: `--all` +* `--enjoy-by`: `--before` +* `-c`: `--call` +* `--desc`: `--description` +* `-f`: `--force` +* `-g`: `--global` +* `--iwr`: `--include-workspace-root` +* `-L`: `--location` +* `-d`: `--loglevel info` +* `-s`: `--loglevel silent` +* `--silent`: `--loglevel silent` +* `--ddd`: `--loglevel silly` +* `--dd`: `--loglevel verbose` +* `--verbose`: `--loglevel verbose` +* `-q`: `--loglevel warn` +* `--quiet`: `--loglevel warn` +* `-l`: `--long` +* `-m`: `--message` +* `--local`: `--no-global` +* `-n`: `--no-yes` +* `--no`: `--no-yes` +* `-p`: `--parseable` +* `--porcelain`: `--parseable` +* `-C`: `--prefix` +* `--readonly`: `--read-only` +* `--reg`: `--registry` +* `-S`: `--save` +* `-B`: `--save-bundle` +* `-D`: `--save-dev` +* `-E`: `--save-exact` +* `-O`: `--save-optional` +* `-P`: `--save-prod` +* `-?`: `--usage` +* `-h`: `--usage` +* `-H`: `--usage` +* `--help`: `--usage` +* `-v`: `--version` +* `-w`: `--workspace` +* `--ws`: `--workspaces` +* `-y`: `--yes` + +If the specified configuration param resolves unambiguously to a known configuration parameter, then it is expanded to that configuration parameter. +For example: + +```bash +npm ls --par +# same as: +npm ls --parseable +``` + +If multiple single-character shorthands are strung together, and the resulting combination is unambiguously not some other configuration param, then it is expanded to its various component pieces. +For example: + +```bash +npm ls -gpld +# same as: +npm ls --global --parseable --long --loglevel info +``` + +### Config Settings + +#### `_auth` + +* Default: null +* Type: null or String + +A basic-auth string to use when authenticating against the npm registry. +This will ONLY be used to authenticate against the npm registry. For other +registries you will need to scope it like "//other-registry.tld/:_auth" + +Warning: This should generally not be set via a command-line option. It is +safer to use a registry-provided authentication bearer token stored in the +~/.npmrc file by running `npm login`. + + + +#### `access` + +* Default: 'public' for new packages, existing packages it will not change the + current level +* Type: null, "restricted", or "public" + +If you do not want your scoped package to be publicly viewable (and +installable) set `--access=restricted`. + +Unscoped packages cannot be set to `restricted`. + +Note: This defaults to not changing the current access level for existing +packages. Specifying a value of `restricted` or `public` during publish will +change the access for an existing package the same way that `npm access set +status` would. + + + +#### `all` + +* Default: false +* Type: Boolean + +When running `npm outdated` and `npm ls`, setting `--all` will show all +outdated or installed packages, rather than only those directly depended +upon by the current project. + + + +#### `allow-git` + +* Default: "all" +* Type: "all", "none", or "root" + +Limits the ability for npm to fetch dependencies from git references. That +is, dependencies that point to a git repo instead of a version or semver +range. Please note that this could leave your tree incomplete and some +packages may not function as intended or designed. + +`all` allows any git dependencies to be fetched and installed. `none` +prevents any git dependencies from being fetched and installed. `root` only +allows git dependencies defined in your project's package.json to be fetched +installed. Also allows git dependencies to be fetched for other commands +like `npm view` + + + +#### `allow-same-version` + +* Default: false +* Type: Boolean + +Prevents throwing an error when `npm version` is used to set the new version +to the same value as the current version. + + + +#### `audit` + +* Default: true +* Type: Boolean + +When "true" submit audit reports alongside the current npm command to the +default registry and all registries configured for scopes. See the +documentation for [`npm audit`](/commands/npm-audit) for details on what is +submitted. + + + +#### `audit-level` + +* Default: null +* Type: null, "info", "low", "moderate", "high", "critical", or "none" + +The minimum level of vulnerability for `npm audit` to exit with a non-zero +exit code. + + + +#### `auth-type` + +* Default: "web" +* Type: "legacy" or "web" + +What authentication strategy to use with `login`. Note that if an `otp` +config is given, this value will always be set to `legacy`. + + + +#### `before` + +* Default: null +* Type: null or Date + +If passed to `npm install`, will rebuild the npm tree such that only +versions that were available **on or before** the given date are installed. +If there are no versions available for the current set of dependencies, the +command will error. + +If the requested version is a `dist-tag` and the given tag does not pass the +`--before` filter, the most recent version less than or equal to that tag +will be used. For example, `foo@latest` might install `foo@1.2` even though +`latest` is `2.0`. + +This config cannot be used with: `min-release-age` + +#### `bin-links` + +* Default: true +* Type: Boolean + +Tells npm to create symlinks (or `.cmd` shims on Windows) for package +executables. + +Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems. + + + +#### `browser` + +* Default: macOS: `"open"`, Windows: `"start"`, Others: `"xdg-open"` +* Type: null, Boolean, or String + +The browser that is called by npm commands to open websites. + +Set to `false` to suppress browser behavior and instead print urls to +terminal. + +Set to `true` to use default system URL opener. + + + +#### `bypass-2fa` + +* Default: false +* Type: Boolean + +When creating a Granular Access Token with `npm token create`, setting this +to true will allow the token to bypass two-factor authentication. This is +useful for automation and CI/CD workflows. + + + +#### `ca` + +* Default: null +* Type: null or String (can be set multiple times) + +The Certificate Authority signing certificate that is trusted for SSL +connections to the registry. Values should be in PEM format (Windows calls +it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string +"\n". For example: + +```ini +ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----" +``` + +Set to `null` to only allow "known" registrars, or to a specific CA cert to +trust only that specific signing authority. + +Multiple CAs can be trusted by specifying an array of certificates: + +```ini +ca[]="..." +ca[]="..." +``` + +See also the `strict-ssl` config. + + + +#### `cache` + +* Default: Windows: `%LocalAppData%\npm-cache`, Posix: `~/.npm` +* Type: Path + +The location of npm's cache directory. + + + +#### `cafile` + +* Default: null +* Type: Path + +A path to a file containing one or multiple Certificate Authority signing +certificates. Similar to the `ca` setting, but allows for multiple CA's, as +well as for the CA information to be stored in a file on disk. + + + +#### `call` + +* Default: "" +* Type: String + +Optional companion option for `npm exec`, `npx` that allows for specifying a +custom command to be run along with the installed packages. + +```bash +npm exec --package yo --package generator-node --call "yo node" +``` + + + +#### `cidr` + +* Default: null +* Type: null or String (can be set multiple times) + +This is a list of CIDR address to be used when configuring limited access +tokens with the `npm token create` command. + + + +#### `color` + +* Default: true unless the NO_COLOR environ is set to something other than '0' +* Type: "always" or Boolean + +If false, never shows colors. If `"always"` then always shows colors. If +true, then only prints color codes for tty file descriptors. + + + +#### `commit-hooks` + +* Default: true +* Type: Boolean + +Run git commit hooks when using the `npm version` command. + + + +#### `cpu` + +* Default: null +* Type: null or String + +Override CPU architecture of native modules to install. Acceptable values +are same as `cpu` field of package.json, which comes from `process.arch`. + + + +#### `depth` + +* Default: `Infinity` if `--all` is set; otherwise, `0` +* Type: null or Number + +The depth to go when recursing packages for `npm ls`. + +If not set, `npm ls` will show only the immediate dependencies of the root +project. If `--all` is set, then npm will show all dependencies by default. + + + +#### `description` + +* Default: true +* Type: Boolean + +Show the description in `npm search` + + + +#### `diff` + +* Default: +* Type: String (can be set multiple times) + +Define arguments to compare in `npm diff`. + + + +#### `diff-dst-prefix` + +* Default: "b/" +* Type: String + +Destination prefix to be used in `npm diff` output. + + + +#### `diff-ignore-all-space` + +* Default: false +* Type: Boolean + +Ignore whitespace when comparing lines in `npm diff`. + + + +#### `diff-name-only` + +* Default: false +* Type: Boolean + +Prints only filenames when using `npm diff`. + + + +#### `diff-no-prefix` + +* Default: false +* Type: Boolean + +Do not show any source or destination prefix in `npm diff` output. + +Note: this causes `npm diff` to ignore the `--diff-src-prefix` and +`--diff-dst-prefix` configs. + + + +#### `diff-src-prefix` + +* Default: "a/" +* Type: String + +Source prefix to be used in `npm diff` output. + + + +#### `diff-text` + +* Default: false +* Type: Boolean + +Treat all files as text in `npm diff`. + + + +#### `diff-unified` + +* Default: 3 +* Type: Number + +The number of lines of context to print in `npm diff`. + + + +#### `dry-run` + +* Default: false +* Type: Boolean + +Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, `install`, `update`, +`dedupe`, `uninstall`, as well as `pack` and `publish`. + +Note: This is NOT honored by other network related commands, eg `dist-tags`, +`owner`, etc. + + + +#### `editor` + +* Default: The EDITOR or VISUAL environment variables, or + '%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems +* Type: String + +The command to run for `npm edit` and `npm config edit`. + + + +#### `engine-strict` + +* Default: false +* Type: Boolean + +If set to true, then npm will stubbornly refuse to install (or even consider +installing) any package that claims to not be compatible with the current +Node.js version. + +This can be overridden by setting the `--force` flag. + + + +#### `expect-result-count` + +* Default: null +* Type: null or Number + +Tells to expect a specific number of results from the command. + +This config cannot be used with: `expect-results` + +#### `expect-results` + +* Default: null +* Type: null or Boolean + +Tells npm whether or not to expect results from the command. Can be either +true (expect some results) or false (expect no results). + +This config cannot be used with: `expect-result-count` + +#### `expires` + +* Default: null +* Type: null or Number + +When creating a Granular Access Token with `npm token create`, this sets the +expiration in days. If not specified, the server will determine the default +expiration. + + + +#### `fetch-retries` + +* Default: 2 +* Type: Number + +The "retries" config for the `retry` module to use when fetching packages +from the registry. + +npm will retry idempotent read requests to the registry in the case of +network failures or 5xx HTTP errors. + + + +#### `fetch-retry-factor` + +* Default: 10 +* Type: Number + +The "factor" config for the `retry` module to use when fetching packages. + + + +#### `fetch-retry-maxtimeout` + +* Default: 60000 (1 minute) +* Type: Number + +The "maxTimeout" config for the `retry` module to use when fetching +packages. + + + +#### `fetch-retry-mintimeout` + +* Default: 10000 (10 seconds) +* Type: Number + +The "minTimeout" config for the `retry` module to use when fetching +packages. + + + +#### `fetch-timeout` + +* Default: 300000 (5 minutes) +* Type: Number + +The maximum amount of time to wait for HTTP requests to complete. + + + +#### `force` + +* Default: false +* Type: Boolean + +Removes various protections against unfortunate side effects, common +mistakes, unnecessary performance degradation, and malicious input. + +* Allow clobbering non-npm files in global installs. +* Allow the `npm version` command to work on an unclean git repository. +* Allow deleting the cache folder with `npm cache clean`. +* Allow installing packages that have an `engines` declaration requiring a + different version of npm. +* Allow installing packages that have an `engines` declaration requiring a + different version of `node`, even if `--engine-strict` is enabled. +* Allow `npm audit fix` to install modules outside your stated dependency + range (including SemVer-major changes). +* Allow unpublishing all versions of a published package. +* Allow conflicting peerDependencies to be installed in the root project. +* Implicitly set `--yes` during `npm init`. +* Allow clobbering existing values in `npm pkg` +* Allow unpublishing of entire packages (not just a single version). + +If you don't have a clear idea of what you want to do, it is strongly +recommended that you do not use this option! + + + +#### `foreground-scripts` + +* Default: `false` unless when using `npm pack` or `npm publish` where it + defaults to `true` +* Type: Boolean + +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. + + + +#### `format-package-lock` + +* Default: true +* Type: Boolean + +Format `package-lock.json` or `npm-shrinkwrap.json` as a human readable +file. + + + +#### `fund` + +* Default: true +* Type: Boolean + +When "true" displays the message at the end of each `npm install` +acknowledging the number of dependencies looking for funding. See [`npm +fund`](/commands/npm-fund) for details. + + + +#### `git` + +* Default: "git" +* Type: String + +The command to use for git commands. If git is installed on the computer, +but is not in the `PATH`, then set this to the full path to the git binary. + + + +#### `git-tag-version` + +* Default: true +* Type: Boolean + +Tag the commit when using the `npm version` command. Setting this to false +results in no commit being made at all. + + + +#### `global` + +* Default: false +* Type: Boolean + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +#### `globalconfig` + +* Default: The global --prefix setting plus 'etc/npmrc'. For example, + '/usr/local/etc/npmrc' +* Type: Path + +The config file to read for global config options. + + + +#### `heading` + +* Default: "npm" +* Type: String + +The string that starts all the debugging log output. + + + +#### `https-proxy` + +* Default: null +* Type: null or URL + +A proxy to use for outgoing https requests. If the `HTTPS_PROXY` or +`https_proxy` or `HTTP_PROXY` or `http_proxy` environment variables are set, +proxy settings will be honored by the underlying `make-fetch-happen` +library. + + + +#### `if-present` + +* Default: false +* Type: Boolean + +If true, npm will not exit with an error code when `run` is invoked for a +script that isn't defined in the `scripts` section of `package.json`. This +option can be used when it's desirable to optionally run a script when it's +present and fail if the script fails. This is useful, for example, when +running scripts that may only apply for some builds in an otherwise generic +CI setup. + +This value is not exported to the environment for child processes. + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still +run their intended script if `ignore-scripts` is set, but they will *not* +run any pre- or post-scripts. + + + +#### `include` + +* Default: +* Type: "prod", "dev", "optional", or "peer" (can be set multiple times) + +Option that allows for defining which types of dependencies to install. + +This is the inverse of `--omit=`. + +Dependency types specified in `--include` will not be omitted, regardless of +the order in which omit/include are specified on the command-line. + + + +#### `include-attestations` + +* Default: false +* Type: Boolean + +When used with `npm audit signatures --json`, includes the full sigstore +attestation bundles in the JSON output for each verified package. The +bundles contain DSSE envelopes, verification material, and transparency log +entries. + + + +#### `include-staged` + +* Default: false +* Type: Boolean + +Allow installing "staged" published packages, as defined by [npm RFC PR +#92](https://github.com/npm/rfcs/pull/92). + +This is experimental, and not implemented by the npm public registry. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + +#### `init-author-email` + +* Default: "" +* Type: String + +The value `npm init` should use by default for the package author's email. + + + +#### `init-author-name` + +* Default: "" +* Type: String + +The value `npm init` should use by default for the package author's name. + + + +#### `init-author-url` + +* Default: "" +* Type: "" or URL + +The value `npm init` should use by default for the package author's +homepage. + + + +#### `init-license` + +* Default: "ISC" +* Type: String + +The value `npm init` should use by default for the package license. + + + +#### `init-module` + +* Default: "~/.npm-init.js" +* Type: Path + +A module that will be loaded by the `npm init` command. See the +documentation for the +[init-package-json](https://github.com/npm/init-package-json) module for +more information, or [npm init](/commands/npm-init). + + + +#### `init-private` + +* Default: false +* Type: Boolean + +The value `npm init` should use by default for the package's private flag. + + + +#### `init-type` + +* Default: "commonjs" +* Type: String + +The value that `npm init` should use by default for the package.json type +field. + + + +#### `init-version` + +* Default: "1.0.0" +* Type: SemVer string + +The value that `npm init` should use by default for the package version +number, if not already set in package.json. + + + +#### `install-links` + +* Default: false +* Type: Boolean + +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. + + + +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", "shallow", or "linked" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (experimental) install in node_modules/.store, +link in place, unhoisted. + + + +#### `json` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. + + + +#### `legacy-peer-deps` + +* Default: false +* Type: Boolean + +Causes npm to completely ignore `peerDependencies` when building a package +tree, as in npm versions 3 through 6. + +If a package cannot be installed because of overly strict `peerDependencies` +that collide, it provides a way to move forward resolving the situation. + +This differs from `--omit=peer`, in that `--omit=peer` will avoid unpacking +`peerDependencies` on disk, but will still design a tree such that +`peerDependencies` _could_ be unpacked in a correct place. + +Use of `legacy-peer-deps` is not recommended, as it will not enforce the +`peerDependencies` contract that meta-dependencies may rely on. + + + +#### `libc` + +* Default: null +* Type: null or String + +Override libc of native modules to install. Acceptable values are same as +`libc` field of package.json + + + +#### `link` + +* Default: false +* Type: Boolean + +Used with `npm ls`, limiting output to only those packages that are linked. + + + +#### `local-address` + +* Default: null +* Type: IP Address + +The IP address of the local interface to use when making connections to the +npm registry. Must be IPv4 in versions of Node prior to 0.12. + + + +#### `location` + +* Default: "user" unless `--global` is passed, which will also set this value + to "global" +* Type: "global", "user", or "project" + +When passed to `npm config` this refers to which config file to use. + +When set to "global" mode, packages are installed into the `prefix` folder +instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + +#### `lockfile-version` + +* Default: Version 3 if no lockfile, auto-converting v1 lockfiles to v3; + otherwise, maintain current lockfile version. +* Type: null, 1, 2, 3, "1", "2", or "3" + +Set the lockfile format version to be used in package-lock.json and +npm-shrinkwrap-json files. Possible options are: + +1: The lockfile version used by npm versions 5 and 6. Lacks some data that +is used during the install, resulting in slower and possibly less +deterministic installs. Prevents lockfile churn when interoperating with +older npm versions. + +2: The default lockfile version used by npm version 7 and 8. Includes both +the version 1 lockfile data and version 3 lockfile data, for maximum +determinism and interoperability, at the expense of more bytes on disk. + +3: Only the new lockfile information introduced in npm version 7. Smaller on +disk than lockfile version 2, but not interoperable with older npm versions. +Ideal if all users are on npm version 7 and higher. + + + +#### `loglevel` + +* Default: "notice" +* Type: "silent", "error", "warn", "notice", "http", "info", "verbose", or + "silly" + +What level of logs to report. All logs are written to a debug log, with the +path to that file printed if the execution of a command fails. + +Any logs of a higher level than the setting are shown. The default is +"notice". + +See also the `foreground-scripts` config. + + + +#### `logs-dir` + +* Default: A directory named `_logs` inside the cache +* Type: null or Path + +The location of npm's log directory. See [`npm logging`](/using-npm/logging) +for more information. + + + +#### `logs-max` + +* Default: 10 +* Type: Number + +The maximum number of log files to store. + +If set to 0, no log files will be written for the current run. + + + +#### `long` + +* Default: false +* Type: Boolean + +Show extended information in `ls`, `search`, and `help-search`. + + + +#### `maxsockets` + +* Default: 15 +* Type: Number + +The maximum number of connections to use per origin (protocol/host/port +combination). + + + +#### `message` + +* Default: "%s" +* Type: String + +Commit message which is used by `npm version` when creating version commit. + +Any "%s" in the message will be replaced with the version number. + + + +#### `min-release-age` + +* Default: null +* Type: null or Number + +If set, npm will build the npm tree such that only versions that were +available more than the given number of days ago will be installed. If there +are no versions available for the current set of dependencies, the command +will error. + +This flag is a complement to `before`, which accepts an exact date instead +of a relative number of days. + +This config cannot be used with: `before` + +This value is not exported to the environment for child processes. + +#### `name` + +* Default: null +* Type: null or String + +When creating a Granular Access Token with `npm token create`, this sets the +name/description for the token. + + + +#### `node-gyp` + +* Default: The path to the node-gyp bin that ships with npm +* Type: Path + +This is the location of the "node-gyp" bin. By default it uses one that +ships with npm itself. + +You can use this config to specify your own "node-gyp" to run when it is +required to build a package. + + + +#### `node-options` + +* Default: null +* Type: null or String + +Options to pass through to Node.js via the `NODE_OPTIONS` environment +variable. This does not impact how npm itself is executed but it does impact +how lifecycle scripts are called. + + + +#### `noproxy` + +* Default: The value of the NO_PROXY environment variable +* Type: String (can be set multiple times) + +Domain extensions that should bypass any proxies. + +Also accepts a comma-delimited string. + + + +#### `offline` + +* Default: false +* Type: Boolean + +Force offline mode: no network requests will be done during install. To +allow the CLI to fill in missing cache data, see `--prefer-offline`. + + + +#### `omit` + +* Default: 'dev' if the `NODE_ENV` environment variable is set to + 'production'; otherwise, empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) + +Dependency types to omit from the installation tree on disk. + +Note that these dependencies _are_ still resolved and added to the +`package-lock.json` or `npm-shrinkwrap.json` file. They are just not +physically installed on disk. + +If a package type appears in both the `--include` and `--omit` lists, then +it will be included. + +If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment +variable will be set to `'production'` for all lifecycle scripts. + + + +#### `omit-lockfile-registry-resolved` + +* Default: false +* Type: Boolean + +This option causes npm to create lock files without a `resolved` key for +registry dependencies. Subsequent installs will need to resolve tarball +endpoints with the configured registry, likely resulting in a longer install +time. + + + +#### `orgs` + +* Default: null +* Type: null or String (can be set multiple times) + +When creating a Granular Access Token with `npm token create`, this limits +the token access to specific organizations. + + + +#### `orgs-permission` + +* Default: null +* Type: null, "read-only", "read-write", or "no-access" + +When creating a Granular Access Token with `npm token create`, sets the +permission level for organizations. Options are "read-only", "read-write", +or "no-access". + + + +#### `os` + +* Default: null +* Type: null or String + +Override OS of native modules to install. Acceptable values are same as `os` +field of package.json, which comes from `process.platform`. + + + +#### `otp` + +* Default: null +* Type: null or String + +This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with `npm access`. + +If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one. + + + +#### `pack-destination` + +* Default: "." +* Type: String + +Directory in which `npm pack` will save tarballs. + + + +#### `package` + +* Default: +* Type: String (can be set multiple times) + +The package or packages to install for [`npm exec`](/commands/npm-exec) + + + +#### `package-lock` + +* Default: true +* Type: Boolean + +If set to false, then ignore `package-lock.json` files when installing. This +will also prevent _writing_ `package-lock.json` if `save` is true. + + + +#### `package-lock-only` + +* Default: false +* Type: Boolean + +If set to true, the current operation will only use the `package-lock.json`, +ignoring `node_modules`. + +For `update` this means only the `package-lock.json` will be updated, +instead of checking `node_modules` and downloading dependencies. + +For `list` this means the output will be based on the tree described by the +`package-lock.json`, rather than the contents of `node_modules`. + + + +#### `packages` + +* Default: +* Type: null or String (can be set multiple times) + +When creating a Granular Access Token with `npm token create`, this limits +the token access to specific packages. + + + +#### `packages-all` + +* Default: false +* Type: Boolean + +When creating a Granular Access Token with `npm token create`, grants the +token access to all packages instead of limiting to specific packages. + + + +#### `packages-and-scopes-permission` + +* Default: null +* Type: null, "read-only", "read-write", or "no-access" + +When creating a Granular Access Token with `npm token create`, sets the +permission level for packages and scopes. Options are "read-only", +"read-write", or "no-access". + + + +#### `parseable` + +* Default: false +* Type: Boolean + +Output parseable results from commands that write to standard output. For +`npm search`, this will be tab-separated table format. + + + +#### `password` + +* Default: null +* Type: null or String + +Password for authentication. Can be provided via command line when creating +tokens, though it's generally safer to be prompted for it. + + + +#### `prefer-dedupe` + +* Default: false +* Type: Boolean + +Prefer to deduplicate packages if possible, rather than choosing a newer +version of a dependency. + + + +#### `prefer-offline` + +* Default: false +* Type: Boolean + +If true, staleness checks for cached data will be bypassed, but missing data +will be requested from the server. To force full offline mode, use +`--offline`. + + + +#### `prefer-online` + +* Default: false +* Type: Boolean + +If true, staleness checks for cached data will be forced, making the CLI +look for updates immediately even for fresh package data. + + + +#### `prefix` + +* Default: In global mode, the folder where the node executable is installed. + Otherwise, the nearest parent folder containing either a package.json file + or a node_modules folder. +* Type: Path + +The location to install global items. If set on the command line, then it +forces non-global commands to run in the specified folder. + + + +#### `preid` + +* Default: "" +* Type: String + +The "prerelease identifier" to use as a prefix for the "prerelease" part of +a semver. Like the `rc` in `1.2.0-rc.8`. + + + +#### `progress` + +* Default: `true` when not in CI and both stderr and stdout are TTYs and not + in a dumb terminal +* Type: Boolean + +When set to `true`, npm will display a progress bar during time intensive +operations, if `process.stderr` and `process.stdout` are a TTY. + +Set to `false` to suppress the progress bar. + + + +#### `provenance` + +* Default: false +* Type: Boolean + +When publishing from a supported cloud CI/CD system, the package will be +publicly linked to where it was built and published from. + +This config cannot be used with: `provenance-file` + +#### `provenance-file` + +* Default: null +* Type: Path + +When publishing, the provenance bundle at the given path will be used. + +This config cannot be used with: `provenance` + +#### `proxy` + +* Default: null +* Type: null, false, or URL + +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. + + + +#### `read-only` + +* Default: false +* Type: Boolean + +This is used to mark a token as unable to publish when configuring limited +access tokens with the `npm token create` command. + + + +#### `rebuild-bundle` + +* Default: true +* Type: Boolean + +Rebuild bundled dependencies after installation. + + + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + +#### `replace-registry-host` + +* Default: "npmjs" +* Type: "npmjs", "never", "always", or String + +Defines behavior for replacing the registry host in a lockfile with the +configured registry. + +The default behavior is to replace package dist URLs from the default +registry (https://registry.npmjs.org) to the configured registry. If set to +"never", then use the registry value. If set to "always", then replace the +registry host with the configured host every time. + +You may also specify a bare hostname (e.g., "registry.npmjs.org"). + + + +#### `save` + +* Default: `true` unless when using `npm update` where it defaults to `false` +* Type: Boolean + +Save installed packages to a `package.json` file as dependencies. + +When used with the `npm rm` command, removes the dependency from +`package.json`. + +Will also prevent writing to `package-lock.json` if set to `false`. + + + +#### `save-bundle` + +* Default: false +* Type: Boolean + +If a package would be saved at install time by the use of `--save`, +`--save-dev`, or `--save-optional`, then also put it in the +`bundleDependencies` list. + +Ignored if `--save-peer` is set, since peerDependencies cannot be bundled. + + + +#### `save-dev` + +* Default: false +* Type: Boolean + +Save installed packages to a package.json file as `devDependencies`. + +This config cannot be used with: `save-optional`, `save-peer`, `save-prod` + +#### `save-exact` + +* Default: false +* Type: Boolean + +Dependencies saved to package.json will be configured with an exact version +rather than using npm's default semver range operator. + + + +#### `save-optional` + +* Default: false +* Type: Boolean + +Save installed packages to a package.json file as `optionalDependencies`. + +This config cannot be used with: `save-dev`, `save-peer`, `save-prod` + +#### `save-peer` + +* Default: false +* Type: Boolean + +Save installed packages to a package.json file as `peerDependencies` + +This config cannot be used with: `save-dev`, `save-optional`, `save-prod` + +#### `save-prefix` + +* Default: "^" +* Type: String + +Configure how versions of packages installed to a package.json file via +`--save` or `--save-dev` get prefixed. + +For example if a package has version `1.2.3`, by default its version is set +to `^1.2.3` which allows minor upgrades for that package, but after `npm +config set save-prefix='~'` it would be set to `~1.2.3` which only allows +patch upgrades. + + + +#### `save-prod` + +* Default: false +* Type: Boolean + +Save installed packages into `dependencies` specifically. This is useful if +a package already exists in `devDependencies` or `optionalDependencies`, but +you want to move it to be a non-optional production dependency. + +This is the default behavior if `--save` is true, and neither `--save-dev` +or `--save-optional` are true. + +This config cannot be used with: `save-dev`, `save-optional`, `save-peer` + +#### `sbom-format` + +* Default: null +* Type: "cyclonedx" or "spdx" + +SBOM format to use when generating SBOMs. + + + +#### `sbom-type` + +* Default: "library" +* Type: "library", "application", or "framework" + +The type of package described by the generated SBOM. For SPDX, this is the +value for the `primaryPackagePurpose` field. For CycloneDX, this is the +value for the `type` field. + + + +#### `scope` + +* Default: the scope of the current project, if any, or "" +* Type: String + +Associate an operation with a scope for a scoped registry. + +Useful when logging in to or out of a private registry: + +``` +# log in, linking the scope to the custom registry +npm login --scope=@mycorp --registry=https://registry.mycorp.com + +# log out, removing the link and the auth token +npm logout --scope=@mycorp +``` + +This will cause `@mycorp` to be mapped to the registry for future +installation of packages specified according to the pattern +`@mycorp/package`. + +This will also cause `npm init` to create a scoped package. + +``` +# accept all defaults, and create a package named "@foo/whatever", +# instead of just named "whatever" +npm init --scope=@foo --yes +``` + + + +#### `scopes` + +* Default: null +* Type: null or String (can be set multiple times) + +When creating a Granular Access Token with `npm token create`, this limits +the token access to specific scopes. Provide a scope name (with or without @ +prefix). + + + +#### `script-shell` + +* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows +* Type: null or String + +The shell to use for scripts run with the `npm exec`, `npm run` and `npm +init ` commands. + + + +#### `searchexclude` + +* Default: "" +* Type: String + +Space-separated options that limit the results from search. + + + +#### `searchlimit` + +* Default: 20 +* Type: Number + +Number of items to limit search results to. Will not apply at all to legacy +searches. + + + +#### `searchopts` + +* Default: "" +* Type: String + +Space-separated options that are always passed to search. + + + +#### `searchstaleness` + +* Default: 900 +* Type: Number + +The age of the cache, in seconds, before another registry request is made if +using legacy search endpoint. + + + +#### `shell` + +* Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on + Windows +* Type: String + +The shell to run for the `npm explore` command. + + + +#### `sign-git-commit` + +* Default: false +* Type: Boolean + +If set to true, then the `npm version` command will commit the new package +version using `-S` to add a signature. + +Note that git requires you to have set up GPG keys in your git configs for +this to work properly. + + + +#### `sign-git-tag` + +* Default: false +* Type: Boolean + +If set to true, then the `npm version` command will tag the version using +`-s` to add a signature. + +Note that git requires you to have set up GPG keys in your git configs for +this to work properly. + + + +#### `strict-peer-deps` + +* Default: false +* Type: Boolean + +If set to `true`, and `--legacy-peer-deps` is not set, then _any_ +conflicting `peerDependencies` will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships. + +By default, conflicting `peerDependencies` deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's `peerDependencies` object. + +When such an override is performed, a warning is printed, explaining the +conflict and the packages involved. If `--strict-peer-deps` is set, then +this warning is treated as a failure. + + + +#### `strict-ssl` + +* Default: true +* Type: Boolean + +Whether or not to do SSL key validation when making requests to the registry +via https. + +See also the `ca` config. + + + +#### `tag` + +* Default: "latest" +* Type: String + +If you ask npm to install a package and don't tell it a specific version, +then it will install the specified tag. + +It is the tag added to the package@version specified in the `npm dist-tag +add` command, if no explicit tag is given. + +When used by the `npm diff` command, this is the tag used to fetch the +tarball that will be compared with the local files by default. + +If used in the `npm publish` command, this is the tag that will be added to +the package submitted to the registry. + + + +#### `tag-version-prefix` + +* Default: "v" +* Type: String + +If set, alters the prefix used when tagging a new version when performing a +version increment using `npm version`. To remove the prefix altogether, set +it to the empty string: `""`. + +Because other tools may rely on the convention that npm version tags look +like `v1.0.0`, _only use this property if it is absolutely necessary_. In +particular, use care when overriding this setting for public packages. + + + +#### `timing` + +* Default: false +* Type: Boolean + +If true, writes timing information to a process specific json file in the +cache or `logs-dir`. The file name ends with `-timing.json`. + +You can quickly view it with this [json](https://npm.im/json) command line: +`cat ~/.npm/_logs/*-timing.json | npm exec -- json -g`. + +Timing information will also be reported in the terminal. To suppress this +while still writing the timing file, use `--silent`. + + + +#### `token-description` + +* Default: null +* Type: null or String + +Description text for the token when using `npm token create`. + + + +#### `umask` + +* Default: 0 +* Type: Octal numeric string in range 0000..0777 (0..511) + +The "umask" value to use when setting the file creation mode on files and +folders. + +Folders and executables are given a mode which is `0o777` masked against +this value. Other files are given a mode which is `0o666` masked against +this value. + +Note that the underlying system will _also_ apply its own umask value to +files and folders that are created, and npm does not circumvent this, but +rather adds the `--umask` config to it. + +Thus, the effective default umask value on most POSIX systems is 0o22, +meaning that folders and executables are created with a mode of 0o755 and +other files are created with a mode of 0o644. + + + +#### `unicode` + +* Default: false on windows, true on mac/unix systems with a unicode locale, + as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables. +* Type: Boolean + +When set to true, npm uses unicode characters in the tree output. When +false, it uses ascii characters instead of unicode glyphs. + + + +#### `update-notifier` + +* Default: true +* Type: Boolean + +Set to false to suppress the update notification when using an older version +of npm than the latest. + + + +#### `usage` + +* Default: false +* Type: Boolean + +Show short usage output about the command specified. + + + +#### `user-agent` + +* Default: "npm/{npm-version} node/{node-version} {platform} {arch} + workspaces/{workspaces} {ci}" +* Type: String + +Sets the User-Agent request header. The following fields are replaced with +their actual counterparts: + +* `{npm-version}` - The npm version in use +* `{node-version}` - The Node.js version in use +* `{platform}` - The value of `process.platform` +* `{arch}` - The value of `process.arch` +* `{workspaces}` - Set to `true` if the `workspaces` or `workspace` options + are set. +* `{ci}` - The value of the `ci-name` config, if set, prefixed with `ci/`, or + an empty string if `ci-name` is empty. + + + +#### `userconfig` + +* Default: "~/.npmrc" +* Type: Path + +The location of user-level configuration settings. + +This may be overridden by the `npm_config_userconfig` environment variable +or the `--userconfig` command line option, but may _not_ be overridden by +settings in the `globalconfig` file. + + + +#### `version` + +* Default: false +* Type: Boolean + +If true, output the npm version and exit successfully. + +Only relevant when specified explicitly on the command line. + + + +#### `versions` + +* Default: false +* Type: Boolean + +If true, output the npm version as well as node's `process.versions` map and +the version in the current working directory's `package.json` file if one +exists, and exit successfully. + +Only relevant when specified explicitly on the command line. + + + +#### `viewer` + +* Default: "man" on Posix, "browser" on Windows +* Type: String + +The program to use to view help content. + +Set to `"browser"` to view html help content in the default web browser. + + + +#### `which` + +* Default: null +* Type: null or Number + +If there are multiple funding sources, which 1-indexed source URL to open. + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + +#### `workspaces-update` + +* Default: true +* Type: Boolean + +If set to true, the npm cli will run an update after operations that may +possibly change the workspaces installed to the `node_modules` folder. + + + +#### `yes` + +* Default: null +* Type: null or Boolean + +Automatically answer "yes" to any prompts that npm might print on the +command line. + + + +#### `also` + +* Default: null +* Type: null, "dev", or "development" +* DEPRECATED: Please use --include=dev instead. + +When set to `dev` or `development`, this is an alias for `--include=dev`. + + + +#### `cache-max` + +* Default: Infinity +* Type: Number +* DEPRECATED: This option has been deprecated in favor of `--prefer-online` + +`--cache-max=0` is an alias for `--prefer-online` + + + +#### `cache-min` + +* Default: 0 +* Type: Number +* DEPRECATED: This option has been deprecated in favor of `--prefer-offline`. + +`--cache-min=9999 (or bigger)` is an alias for `--prefer-offline`. + + + +#### `cert` + +* Default: null +* Type: null or String +* DEPRECATED: `key` and `cert` are no longer used for most registry + operations. Use registry scoped `keyfile` and `certfile` instead. Example: + //other-registry.tld/:keyfile=/path/to/key.pem + //other-registry.tld/:certfile=/path/to/cert.crt + +A client certificate to pass when accessing the registry. Values should be +in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with +newlines replaced by the string "\n". For example: + +```ini +cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----" +``` + +It is _not_ the path to a certificate file, though you can set a +registry-scoped "certfile" path like +"//other-registry.tld/:certfile=/path/to/cert.pem". + + + +#### `dev` + +* Default: false +* Type: Boolean +* DEPRECATED: Please use --include=dev instead. + +Alias for `--include=dev`. + + + +#### `global-style` + +* Default: false +* Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` + +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependencies. Sets `--install-strategy=shallow`. + + + +#### `init.author.email` + +* Default: "" +* Type: String +* DEPRECATED: Use `--init-author-email` instead. + +Alias for `--init-author-email` + + + +#### `init.author.name` + +* Default: "" +* Type: String +* DEPRECATED: Use `--init-author-name` instead. + +Alias for `--init-author-name` + + + +#### `init.author.url` + +* Default: "" +* Type: "" or URL +* DEPRECATED: Use `--init-author-url` instead. + +Alias for `--init-author-url` + + + +#### `init.license` + +* Default: "ISC" +* Type: String +* DEPRECATED: Use `--init-license` instead. + +Alias for `--init-license` + + + +#### `init.module` + +* Default: "~/.npm-init.js" +* Type: Path +* DEPRECATED: Use `--init-module` instead. + +Alias for `--init-module` + + + +#### `init.version` + +* Default: "1.0.0" +* Type: SemVer string +* DEPRECATED: Use `--init-version` instead. + +Alias for `--init-version` + + + +#### `key` + +* Default: null +* Type: null or String +* DEPRECATED: `key` and `cert` are no longer used for most registry + operations. Use registry scoped `keyfile` and `certfile` instead. Example: + //other-registry.tld/:keyfile=/path/to/key.pem + //other-registry.tld/:certfile=/path/to/cert.crt + +A client key to pass when accessing the registry. Values should be in PEM +format with newlines replaced by the string "\n". For example: + +```ini +key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----" +``` + +It is _not_ the path to a key file, though you can set a registry-scoped +"keyfile" path like "//other-registry.tld/:keyfile=/path/to/key.pem". + + + +#### `legacy-bundling` + +* Default: false +* Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` + +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. + + + +#### `only` + +* Default: null +* Type: null, "prod", or "production" +* DEPRECATED: Use `--omit=dev` to omit dev dependencies from the install. + +When set to `prod` or `production`, this is an alias for `--omit=dev`. + + + +#### `optional` + +* Default: null +* Type: null or Boolean +* DEPRECATED: Use `--omit=optional` to exclude optional dependencies, or + `--include=optional` to include them. + +Default value does install optional deps unless otherwise omitted. + +Alias for --include=optional or --omit=optional + + + +#### `production` + +* Default: null +* Type: null or Boolean +* DEPRECATED: Use `--omit=dev` instead. + +Alias for `--omit=dev` + + + +#### `shrinkwrap` + +* Default: true +* Type: Boolean +* DEPRECATED: Use the --package-lock setting instead. + +Alias for --package-lock + + + +### See also + +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [npm scripts](/using-npm/scripts) +* [npm folders](/configuring-npm/folders) +* [npm](/commands/npm) diff --git a/node24/node_modules/npm/docs/content/using-npm/dependency-selectors.md b/node24/node_modules/npm/docs/content/using-npm/dependency-selectors.md new file mode 100644 index 0000000000000000000000000000000000000000..271f8fb4c6a1a1653b11fedb8b43f96d9e6d7487 --- /dev/null +++ b/node24/node_modules/npm/docs/content/using-npm/dependency-selectors.md @@ -0,0 +1,247 @@ +--- +title: Dependency Selectors +section: 7 +description: Dependency Selector Syntax & Querying +--- + +### Description + +The [`npm query`](/commands/npm-query) command exposes a new dependency selector syntax (informed by & respecting many aspects of the [CSS Selectors 4 Spec](https://dev.w3.org/csswg/selectors4/#relational)) which: + +- Standardizes the shape of, & querying of, dependency graphs with a robust object model, metadata & selector syntax +- Leverages existing, known language syntax & operators from CSS to make disparate package information broadly accessible +- Unlocks the ability to answer complex, multi-faceted questions about dependencies, their relationships & associative metadata +- Consolidates redundant logic of similar query commands in `npm` (ex. +`npm fund`, `npm ls`, `npm outdated`, `npm audit` ...) + +### Dependency Selector Syntax + +#### Overview: + +- there is no "type" or "tag" selectors (ex. +`div, h1, a`) as a dependency/target is the only type of `Node` that can be queried +- the term "dependencies" is in reference to any `Node` found in a `tree` returned by `Arborist` + +#### Combinators + +- `>` direct descendant/child +- ` ` any descendant/child +- `~` sibling + +#### Selectors + +- `*` universal selector +- `#` dependency selector (equivalent to `[name="..."]`) +- `#@` (equivalent to `[name=]:semver()`) +- `,` selector list delimiter +- `.` dependency type selector +- `:` pseudo selector + +#### Dependency Type Selectors + +- `.prod` dependency found in the `dependencies` section of `package.json`, or is a child of said dependency +- `.dev` dependency found in the `devDependencies` section of `package.json`, or is a child of said dependency +- `.optional` dependency found in the `optionalDependencies` section of `package.json`, or has `"optional": true` set in its entry in the `peerDependenciesMeta` section of `package.json`, or a child of said dependency +- `.peer` dependency found in the `peerDependencies` section of `package.json` +- `.workspace` dependency found in the [`workspaces`](https://docs.npmjs.com/cli/v8/using-npm/workspaces) section of `package.json` +- `.bundled` dependency found in the `bundleDependencies` section of `package.json`, or is a child of said dependency + +#### Pseudo Selectors +- [`:not()`](https://developer.mozilla.org/en-US/docs/Web/CSS/:not) +- [`:has()`](https://developer.mozilla.org/en-US/docs/Web/CSS/:has) +- [`:is()`](https://developer.mozilla.org/en-US/docs/Web/CSS/:is) +- [`:root`](https://developer.mozilla.org/en-US/docs/Web/CSS/:root) matches the root node/dependency +- [`:scope`](https://developer.mozilla.org/en-US/docs/Web/CSS/:scope) matches node/dependency it was queried against +- [`:empty`](https://developer.mozilla.org/en-US/docs/Web/CSS/:empty) when a dependency has no dependencies +- [`:private`](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#private) when a dependency is private +- `:link` when a dependency is linked (for instance, workspaces or packages manually [`linked`](https://docs.npmjs.com/cli/v8/commands/npm-link) +- `:deduped` when a dependency has been deduped (note that this does *not* always mean the dependency has been hoisted to the root of node_modules) +- `:overridden` when a dependency has been overridden +- `:extraneous` when a dependency exists but is not defined as a dependency of any node +- `:invalid` when a dependency version is out of its ancestors specified range +- `:missing` when a dependency is not found on disk +- `:semver(, [selector], [function])` match a valid [`node-semver`](https://github.com/npm/node-semver) version or range to a selector +- `:path()` [glob](https://www.npmjs.com/package/glob) matching based on dependencies path relative to the project +- `:type()` [based on currently recognized types](https://github.com/npm/npm-package-arg#result-object). You can also use the aggregate type of `registry` for any registry dependency (e.g. tag, version, range, alias) +- `:outdated()` when a dependency is outdated +- `:vuln()` when a dependency has a known vulnerability + +##### `:semver(, [selector], [function])` + +The `:semver()` pseudo selector allows comparing fields from each node's `package.json` using [semver](https://github.com/npm/node-semver#readme) methods. +It accepts up to 3 parameters, all but the first of which are optional. + +- `spec` a semver version or range +- `selector` an attribute selector for each node (default `[version]`) +- `function` a semver method to apply, one of: `satisfies`, `intersects`, `subset`, `gt`, `gte`, `gtr`, `lt`, `lte`, `ltr`, `eq`, `neq` or the special function `infer` (default `infer`) + +When the special `infer` function is used the `spec` and the actual value from the node are compared. +If both are versions, according to `semver.valid()`, `eq` is used. +If both values are ranges, according to `!semver.valid()`, `intersects` is used. +If the values are mixed types `satisfies` is used. + +Some examples: + +- `:semver(^1.0.0)` returns every node that has a `version` satisfied by the provided range `^1.0.0` +- `:semver(16.0.0, :attr(engines, [node]))` returns every node which has an `engines.node` property satisfying the version `16.0.0` +- `:semver(1.0.0, [version], lt)` every node with a `version` less than `1.0.0` + +##### `:outdated()` + +The `:outdated` pseudo selector retrieves data from the registry and returns information about which of your dependencies are outdated. +The type parameter may be one of the following: + +- `any` (default) a version exists that is greater than the current one +- `in-range` a version exists that is greater than the current one, and satisfies at least one if its parent's dependencies +- `out-of-range` a version exists that is greater than the current one, does not satisfy at least one of its parent's dependencies +- `major` a version exists that is a semver major greater than the current one +- `minor` a version exists that is a semver minor greater than the current one +- `patch` a version exists that is a semver patch greater than the current one + +In addition to the filtering performed by the pseudo selector, some extra data is added to the resulting objects. +The following data can be found under the `queryContext` property of each node. + +- `versions` an array of every available version of the given node +- `outdated.inRange` an array of objects, each with a `from` and `versions`, where `from` is the on-disk location of the node that depends on the current node and `versions` is an array of all available versions that satisfies that dependency. +This is only populated if `:outdated(in-range)` is used. +- `outdated.outOfRange` an array of objects, identical in shape to `inRange`, but where the `versions` array is every available version that does not satisfy the dependency. +This is only populated if `:outdated(out-of-range)` is used. + +Some examples: + +- `:root > :outdated(major)` returns every direct dependency that has a new semver major release +- `.prod:outdated(in-range)` returns production dependencies that have a new release that satisfies at least one of its parent's dependencies + +##### `:vuln` + +The `:vuln` pseudo selector retrieves data from the registry and returns information about which if your dependencies has a known vulnerability. +Only dependencies whose current version matches a vulnerability will be returned. +For example if you have `semver@7.6.0` in your tree, a vulnerability for `semver` which affects versions `<=6.3.1` will not match. + +You can also filter results by certain attributes in advisories. +Currently that includes `severity` and `cwe`. +Note that severity filtering is done per severity, it does not include severities "higher" or "lower" than the one specified. + +In addition to the filtering performed by the pseudo selector, info about each relevant advisory will be added to the `queryContext` attribute of each node under the `advisories` attribute. + +Some examples: + +- `:root > .prod:vuln` returns direct production dependencies with any known vulnerability +- `:vuln([severity=high])` returns only dependencies with a vulnerability with a `high` severity. +- `:vuln([severity=high],[severity=moderate])` returns only dependencies with a vulnerability with a `high` or `moderate` severity. +- `:vuln([cwe=1333])` returns only dependencies with a vulnerability that includes CWE-1333 (ReDoS) + +#### [Attribute Selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) + +The attribute selector evaluates the key/value pairs in `package.json` if they are `String`s. + +- `[]` attribute selector (ie. +existence of attribute) +- `[attribute=value]` attribute value is equivalent... +- `[attribute~=value]` attribute value contains word... +- `[attribute*=value]` attribute value contains string... +- `[attribute|=value]` attribute value is equal to or starts with... +- `[attribute^=value]` attribute value starts with... +- `[attribute$=value]` attribute value ends with... + +#### `Array` & `Object` Attribute Selectors + +The generic `:attr()` pseudo selector standardizes a pattern which can be used for attribute selection of `Object`s, `Array`s or `Arrays` of `Object`s accessible via `Arborist`'s `Node.package` metadata. +This allows for iterative attribute selection beyond top-level `String` evaluation. +The last argument passed to `:attr()` must be an `attribute` selector or a nested `:attr()`. +See examples below: + +#### `Objects` + +```css +/* return dependencies that have a `scripts.test` containing `"tap"` */ +*:attr(scripts, [test~=tap]) +``` + +#### Nested `Objects` + +Nested objects are expressed as sequential arguments to `:attr()`. + +```css +/* return dependencies that have a [testling config](https://ci.testling.com/guide/advanced_configuration) for opera browsers */ +*:attr(testling, browsers, [~=opera]) +``` + +#### `Arrays` + +`Array`s specifically uses a special/reserved `.` character in place of a typical attribute name. +`Arrays` also support exact `value` matching when a `String` is passed to the selector. + +##### Example of an `Array` Attribute Selection: +```css +/* removes the distinction between properties & arrays */ +/* ie. we'd have to check the property & iterate to match selection */ +*:attr([keywords^=react]) +*:attr(contributors, :attr([name~=Jordan])) +``` + +##### Example of an `Array` matching directly to a value: +```css +/* return dependencies that have the exact keyword "react" */ +/* this is equivalent to `*:keywords([value="react"])` */ +*:attr([keywords=react]) +``` + +##### Example of an `Array` of `Object`s: +```css +/* returns */ +*:attr(contributors, [email=ruyadorno@github.com]) +``` + +### Groups + +Dependency groups are defined by the package relationships to their ancestors (ie. +the dependency types that are defined in `package.json`). +This approach is user-centric as the ecosystem has been taught to think about dependencies in these groups first-and-foremost. +Dependencies are allowed to be included in multiple groups (ex. +a `prod` dependency may also be a `dev` dependency (in that it's also required by another `dev` dependency) & may also be `bundled` - a selector for that type of dependency would look like: `*.prod.dev.bundled`). + +- `.prod` +- `.dev` +- `.optional` +- `.peer` +- `.bundled` +- `.workspace` + +Please note that currently `workspace` deps are always `prod` dependencies. +Additionally the `.root` dependency is also considered a `prod` dependency. + +### Programmatic Usage + +- `Arborist`'s `Node` Class has a `.querySelectorAll()` method + - this method will return a filtered, flattened dependency Arborist `Node` list based on a valid query selector + +```js +const Arborist = require('@npmcli/arborist') +const arb = new Arborist({}) +``` + +```js +// root-level +arb.loadActual().then(async (tree) => { + // query all production dependencies + const results = await tree.querySelectorAll('.prod') + console.log(results) +}) +``` + +```js +// iterative +arb.loadActual().then(async (tree) => { + // query for the deduped version of react + const results = await tree.querySelectorAll('#react:not(:deduped)') + // query the deduped react for git deps + const deps = await results[0].querySelectorAll(':type(git)') + console.log(deps) +}) +``` + +## See Also + +* [npm query](/commands/npm-query) +* [@npmcli/arborist](https://npm.im/@npmcli/arborist) diff --git a/node24/node_modules/npm/docs/content/using-npm/developers.md b/node24/node_modules/npm/docs/content/using-npm/developers.md new file mode 100644 index 0000000000000000000000000000000000000000..e02da225d1a6d91373d8ab5cab75f72f1c7a41bb --- /dev/null +++ b/node24/node_modules/npm/docs/content/using-npm/developers.md @@ -0,0 +1,215 @@ +--- +title: Developers +section: 7 +description: Developer guide +--- + +### Description + +So, you've decided to use npm to develop (and maybe publish/deploy) your project. + +Fantastic! + +There are a few things that you need to do above the simple steps that your users will do to install your program. + +### About These Documents + +These are man pages. +If you install npm, you should be able to then do `man npm-thing` to get the documentation on a particular topic, or `npm help thing` to see the same information. + +### What is a Package + +A package is: + +* a) a folder containing a program described by a package.json file +* b) a gzipped tarball containing (a) +* c) a url that resolves to (b) +* d) a `@` that is published on the registry with (c) +* e) a `@` that points to (d) +* f) a `` that has a "latest" tag satisfying (e) +* g) a `git` url that, when cloned, results in (a). + +Even if you never publish your package, you can still get a lot of benefits of using npm if you just want to write a node program (a), and perhaps if you also want to be able to easily install it elsewhere after packing it up into a tarball (b). + +Git urls can be of the form: + +```bash +git://github.com/user/project.git#commit-ish +git+ssh://user@hostname:project.git#commit-ish +git+http://user@hostname/project/blah.git#commit-ish +git+https://user@hostname/project/blah.git#commit-ish +``` + +The `commit-ish` can be any tag, sha, or branch which can be supplied as an argument to `git checkout`. +The default is whatever the repository uses as its default branch. + +### The package.json File + +You need to have a `package.json` file in the root of your project to do much of anything with npm. +That is basically the whole interface. + +See [`package.json`](/configuring-npm/package-json) for details about what goes in that file. +At the very least, you need: + +* name: This should be a string that identifies your project. + Please do not use the name to specify that it runs on node, or is in JavaScript. + You can use the "engines" field to explicitly state the versions of node (or whatever else) that your program requires, and it's pretty well assumed that it's JavaScript. + + It does not necessarily need to match your github repository name. + + So, `node-foo` and `bar-js` are bad names. + `foo` or `bar` are better. + +* version: A semver-compatible version. + +* engines: Specify the versions of node (or whatever else) that your program runs on. + The node API changes a lot, and there may be bugs or new functionality that you depend on. + Be explicit. + +* author: Take some credit. + +* scripts: If you have a special compilation or installation script, then you should put it in the `scripts` object. + You should definitely have at least a basic smoke-test command as the "scripts.test" field. + See [scripts](/using-npm/scripts). + +* main: If you have a single module that serves as the entry point to your program (like what the "foo" package gives you at require("foo")), then you need to specify that in the "main" field. + +* directories: This is an object mapping names to folders. + The best ones to include are "lib" and "doc", but if you use "man" to specify a folder full of man pages, they'll get installed just like these ones. + +You can use `npm init` in the root of your package in order to get you started with a pretty basic package.json file. +See [`npm init`](/commands/npm-init) for more info. + +### Keeping files *out* of your Package + +Use a `.npmignore` file to keep stuff out of your package. +If there's no `.npmignore` file, but there *is* a `.gitignore` file, then npm will ignore the stuff matched by the `.gitignore` file. +If you *want* to include something that is excluded by your `.gitignore` file, you can create an empty `.npmignore` file to override it. +Like `git`, `npm` looks for `.npmignore` and `.gitignore` files in all subdirectories of your package, not only the root directory. + +`.npmignore` files follow the [same pattern rules](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_ignoring) as `.gitignore` files: + +* Blank lines or lines starting with `#` are ignored. +* Standard glob patterns work. +* You can end patterns with a forward slash `/` to specify a directory. +* You can negate a pattern by starting it with an exclamation point `!`. + +By default, some paths and files are ignored, so there's no need to add them to `.npmignore` explicitly. +Some examples are: + +* `.*.swp` +* `._*` +* `.DS_Store` +* `.git` +* `.gitignore` +* `.hg` +* `.npmignore` +* `.npmrc` +* `.lock-wscript` +* `.svn` +* `.wafpickle-*` +* `config.gypi` +* `CVS` +* `npm-debug.log` + +Additionally, everything in `node_modules` is ignored, except for bundled dependencies. +npm automatically handles this for you, so don't bother adding `node_modules` to `.npmignore`. + +The following paths and files are never ignored, so adding them to `.npmignore` is pointless: + +* `package.json` +* `README` (and its variants) +* `LICENSE` / `LICENCE` + +If, given the structure of your project, you find `.npmignore` to be a maintenance headache, you might instead try populating the `files` property of `package.json`, which is an array of file or directory names that should be included in your package. +Sometimes manually picking which items to allow is easier to manage than building a block list. + +See [`package.json`](/configuring-npm/package-json) for more info on what can and can't be ignored. + +#### Testing whether your `.npmignore` or `files` config works + +If you want to double check that your package will include only the files you intend it to when published, you can run the `npm pack` command locally which will generate a tarball in the working directory, the same way it does for publishing. + +### Link Packages + +`npm link` is designed to install a development package and see the changes in real time without having to keep re-installing it. +(You do need to either re-link or `npm rebuild -g` to update compiled packages, of course.) + +More info at [`npm link`](/commands/npm-link). + +### Before Publishing: Make Sure Your Package Installs and Works + +**This is important.** + +If you cannot install it locally, you'll have problems trying to publish it. +Or, worse yet, you'll be able to publish it, but you'll be publishing a broken or pointless package. +So don't do that. + +In the root of your package, do this: + +```bash +npm install . -g +``` + +That'll show you that it's working. +If you'd rather just create a symlink package that points to your working directory, then do this: + +```bash +npm link +``` + +Use `npm ls -g` to see if it's there. + +To test a local install, go into some other folder, and then do: + +```bash +cd ../some-other-folder +npm install ../my-package +``` + +to install it locally into the node_modules folder in that other place. + +Then go into the node-repl, and try using require("my-thing") to bring in your module's main module. + +### Create a User Account + +Create a user with the adduser command. +It works like this: + +```bash +npm adduser +``` + +and then follow the prompts. + +This is documented better in [npm adduser](/commands/npm-adduser). + +### Publish your Package + +This part's easy. +In the root of your folder, do this: + +```bash +npm publish +``` + +You can give publish a url to a tarball, or a filename of a tarball, or a path to a folder. + +Note that pretty much **everything in that folder will be exposed** by default. +So, if you have secret stuff in there, use a `.npmignore` file to list out the globs to ignore, or publish from a fresh checkout. + +### Brag about it + +Send emails, write blogs, blab in IRC. + +Tell the world how easy it is to install your program! + +### See also + +* [npm](/commands/npm) +* [npm init](/commands/npm-init) +* [package.json](/configuring-npm/package-json) +* [npm scripts](/using-npm/scripts) +* [npm publish](/commands/npm-publish) +* [npm adduser](/commands/npm-adduser) +* [npm registry](/using-npm/registry) diff --git a/node24/node_modules/npm/docs/content/using-npm/logging.md b/node24/node_modules/npm/docs/content/using-npm/logging.md new file mode 100644 index 0000000000000000000000000000000000000000..6f4433711c308dbcfac13af4933c524bef6544f2 --- /dev/null +++ b/node24/node_modules/npm/docs/content/using-npm/logging.md @@ -0,0 +1,99 @@ +--- +title: Logging +section: 7 +description: Why, What & How we Log +--- + +### Description + +The `npm` CLI has various mechanisms for showing different levels of information back to end-users for certain commands, configurations & environments. + +### Setting Log File Location + +All logs are written to a debug log, with the path to that file printed if the execution of a command fails. + +The default location of the logs directory is a directory named `_logs` inside the npm cache. +This can be changed with the `logs-dir` config option. + +For example, if you wanted to write all your logs to the current working directory, you could run: `npm install --logs-dir=.`. +This is especially helpful in debugging a specific `npm` issue as you can run a command multiple times with different config values and then diff all the log files. + +Log files will be removed from the `logs-dir` when the number of log files exceeds `logs-max`, with the oldest logs being deleted first. + +To turn off logs completely set `--logs-max=0`. + +### Setting Log Levels + +#### `loglevel` + +`loglevel` is a global argument/config that can be set to determine the type of information to be displayed. + +The default value of `loglevel` is `"notice"` but there are several levels/types of logs available, including: + +- `"silent"` +- `"error"` +- `"warn"` +- `"notice"` +- `"http"` +- `"info"` +- `"verbose"` +- `"silly"` + +All logs pertaining to a level preceding the current setting will be shown. + +##### Aliases + +The log levels listed above have various corresponding aliases, including: + +- `-d`: `--loglevel info` +- `--dd`: `--loglevel verbose` +- `--verbose`: `--loglevel verbose` +- `--ddd`: `--loglevel silly` +- `-q`: `--loglevel warn` +- `--quiet`: `--loglevel warn` +- `-s`: `--loglevel silent` +- `--silent`: `--loglevel silent` + +#### `foreground-scripts` + +The `npm` CLI began hiding the output of lifecycle scripts for `npm install` as of `v7`. +Notably, this means you will not see logs/output from packages that may be using "install scripts" to display information back to you or from your own project's scripts defined in `package.json`. +If you'd like to change this behavior & log this output you can set `foreground-scripts` to `true`. + +### Timing Information + +The [`--timing` config](/using-npm/config#timing) can be set which does a few things: + +1. Always shows the full path to the debug log regardless of command exit status +1. Write timing information to a process specific timing file in the cache or `logs-dir` +1. Output timing information to the terminal + +This file contains a `timers` object where the keys are an identifier for the portion of the process being timed and the value is the number of milliseconds it took to complete. + +Sometimes it is helpful to get timing information without outputting anything to the terminal. +For example, the performance might be affected by writing to the terminal. +In this case you can use +`--timing --silent` which will still write the timing file, but not output anything to the terminal while running. + +### Registry Response Headers + +#### `npm-notice` + +The `npm` CLI reads from & logs any `npm-notice` headers that are returned from the configured registry. +This mechanism can be used by third-party registries to provide useful information when network-dependent requests occur. + +This header is not cached, and will not be logged if the request is served from the cache. + +### Logs and Sensitive Information + +The `npm` CLI makes a best effort to redact the following from terminal output and log files: + +- Passwords inside basic auth URLs +- npm tokens + +However, this behavior should not be relied on to keep all possible sensitive information redacted. +If you are concerned about secrets in your log file or terminal output, you can use `--loglevel=silent` and `--logs-max=0` to ensure no logs are written to your terminal or filesystem. + +### See also + +* [config](/using-npm/config) diff --git a/node24/node_modules/npm/docs/content/using-npm/orgs.md b/node24/node_modules/npm/docs/content/using-npm/orgs.md new file mode 100644 index 0000000000000000000000000000000000000000..f383357efdf05d3cc814eebac8e9b0772ca9d880 --- /dev/null +++ b/node24/node_modules/npm/docs/content/using-npm/orgs.md @@ -0,0 +1,98 @@ +--- +title: Organizations +section: 7 +description: Working with teams & organizations +--- + +### Description + +There are three levels of org users: + +1. Super admin, controls billing & adding people to the org. +2. Team admin, manages team membership & package access. +3. Developer, works on packages they are given access to. + +The super admin is the only person who can add users to the org because it impacts the monthly bill. +The super admin will use the website to manage membership. +Every org has a `developers` team that all users are automatically added to. + +The team admin is the person who manages team creation, team membership, and package access for teams. +The team admin grants package access to teams, not individuals. + +The developer will be able to access packages based on the teams they are on. +Access is either read-write or read-only. + +There are two main commands: + +1. `npm team` see [npm team](/commands/npm-team) for more details +2. `npm access` see [npm access](/commands/npm-access) for more details + +### Team Admins create teams + +* Check who you’ve added to your org: + +```bash +npm team ls :developers +``` + +* Each org is automatically given a `developers` team, so you can see the whole list of team members in your org. +This team automatically gets read-write access to all packages, but you can change that with the `access` command. + +* Create a new team: + +```bash +npm team create +``` + +* Add members to that team: + +```bash +npm team add +``` + +### Publish a package and adjust package access + +* In package directory, run + +```bash +npm init --scope= +``` +to scope it for your org & publish as usual + +* Grant access: + +```bash +npm access grant [] +``` + +* Revoke access: + +```bash +npm access revoke [] +``` + +### Monitor your package access + +* See what org packages a team member can access: + +```bash +npm access list packages +``` + +* See packages available to a specific team: + +```bash +npm access list packages +``` + +* Check which teams are collaborating on a package: + +```bash +npm access list collaborators +``` + +### See also + +* [npm team](/commands/npm-team) +* [npm access](/commands/npm-access) +* [npm scope](/using-npm/scope) diff --git a/node24/node_modules/npm/docs/content/using-npm/package-spec.md b/node24/node_modules/npm/docs/content/using-npm/package-spec.md new file mode 100644 index 0000000000000000000000000000000000000000..36d86c24982364d9c7277fcd7b13aaffa6168e37 --- /dev/null +++ b/node24/node_modules/npm/docs/content/using-npm/package-spec.md @@ -0,0 +1,92 @@ +--- +title: Package spec +section: 7 +description: Package name specifier +--- + +### Description + +Commands like `npm install` and the dependency sections in the `package.json` use a package name specifier. +This can be many different things that all refer to a "package". Examples include a package name, git url, tarball, or local directory. +These will generally be referred to as `` in the help output for the npm commands that use this package name specifier. + +### Package name + +* `[<@scope>/]` +* `[<@scope>/]@` +* `[<@scope>/]@` +* `[<@scope>/]@` + +Refers to a package by name, with or without a scope, and optionally tag, version, or version range. +This is typically used in combination with the [registry](/using-npm/config#registry) config to refer to a package in a registry. + +Examples: +* `npm` +* `@npmcli/arborist` +* `@npmcli/arborist@latest` +* `npm@6.13.1` +* `npm@^4.0.0` + +### Aliases + +* `@npm:` + +Primarily used by commands like `npm install` and in the dependency sections in the `package.json`, this refers to a package by an alias. +The `` is the name of the package as it is reified in the `node_modules` folder, and the `` refers to a package name as found in the configured registry. + +See `Package name` above for more info on referring to a package by name, and [registry](/using-npm/config#registry) for configuring which registry is used when referring to a package by name. + +Examples: +* `semver@npm:@npmcli/semver-with-patch` +* `semver@npm:semver@7.2.2` +* `semver@npm:semver@legacy` + +### Folders + +* `` + +This refers to a package on the local filesystem. +Specifically this is a folder with a `package.json` file in it. +This *should* always be prefixed with a `/` or `./` (or your OS equivalent) to reduce confusion. +npm currently will parse a string with more than one `/` in it as a folder, but this is legacy behavior that may be removed in a future version. + +Examples: + +* `./my-package` +* `/opt/npm/my-package` + +### Tarballs + +* `` +* `` + +Examples: + +* `./my-package.tgz` +* `https://registry.npmjs.org/semver/-/semver-1.0.0.tgz` + +Refers to a package in a tarball format, either on the local filesystem or remotely via url. +This is the format that packages exist in when uploaded to a registry. + +### git urls + +* `` +* `/` + +Refers to a package in a git repo. +This can be a full git url, git shorthand, or a username/package on GitHub. +You can specify a git tag, branch, or other git ref by appending `#ref`. + +Examples: + +* `https://github.com/npm/cli.git` +* `git@github.com:npm/cli.git` +* `git+ssh://git@github.com/npm/cli#v6.0.0` +* `github:npm/cli#HEAD` +* `npm/cli#c12ea07` + +### See also + +* [npm-package-arg](https://npm.im/npm-package-arg) +* [scope](/using-npm/scope) +* [config](/using-npm/config) diff --git a/node24/node_modules/npm/docs/content/using-npm/registry.md b/node24/node_modules/npm/docs/content/using-npm/registry.md new file mode 100644 index 0000000000000000000000000000000000000000..1b1d8f855e2382e9d95c3b385485d4db80715de5 --- /dev/null +++ b/node24/node_modules/npm/docs/content/using-npm/registry.md @@ -0,0 +1,61 @@ +--- +title: Registry +section: 7 +description: The JavaScript Package Registry +--- + +### Description + +To resolve packages by name and version, npm talks to a registry website that implements the CommonJS Package Registry specification for reading package info. + +npm is configured to use the **npm public registry** at + by default. +Use of the npm public registry is subject to terms of use available at . + +You can configure npm to use any compatible registry you like, and even run your own registry. +Use of someone else's registry may be governed by their terms of use. + +npm's package registry implementation supports several write APIs as well, to allow for publishing packages and managing user account information. + +The registry URL used is determined by the scope of the package (see [`scope`](/using-npm/scope). +If no scope is specified, the default registry is used, which is supplied by the [`registry` config](/using-npm/config#registry) parameter. +See [`npm config`](/commands/npm-config), [`npmrc`](/configuring-npm/npmrc), and [`config`](/using-npm/config) for more on managing npm's configuration. +Authentication configuration such as auth tokens and certificates are configured specifically scoped to an individual registry. +See [Auth Related Configuration](/configuring-npm/npmrc#auth-related-configuration) + +When the default registry is used in a package-lock or shrinkwrap it has the special meaning of "the currently configured registry". If you create a lock file while using the default registry you can switch to another registry and npm will install packages from the new registry, but if you create a lock file while using a custom registry packages will be installed from that registry even after you change to another registry. + +### Does npm send any information about me back to the registry? + +Yes. + +When making requests of the registry npm adds two headers with information about your environment: + +* `Npm-Scope` – If your project is scoped, this header will contain its scope. +In the future npm hopes to build registry features that use this information to allow you to customize your experience for your organization. +* `Npm-In-CI` – Set to "true" if npm believes this install is running in a continuous integration environment, "false" otherwise. +This is detected by looking for the following environment variables: `CI`, `TDDIUM`, + `JENKINS_URL`, `bamboo.buildKey`. +If you'd like to learn more you may find the [original PR](https://github.com/npm/npm-registry-client/pull/129) interesting. + This is used to gather better metrics on how npm is used by humans, versus build farms. + +The npm registry does not try to correlate the information in these headers with any authenticated accounts that may be used in the same requests. + +### How can I prevent my package from being published in the official registry? + +Set `"private": true` in your `package.json` to prevent it from being published at all, or +`"publishConfig":{"registry":"http://my-internal-registry.local"}` +to force it to be published only to your internal/private registry. + +See [`package.json`](/configuring-npm/package-json) for more info on what goes in the package.json file. + +### Where can I find my (and others') published packages? + + + +### See also + +* [npm config](/commands/npm-config) +* [config](/using-npm/config) +* [npmrc](/configuring-npm/npmrc) +* [npm developers](/using-npm/developers) diff --git a/node24/node_modules/npm/docs/content/using-npm/removal.md b/node24/node_modules/npm/docs/content/using-npm/removal.md new file mode 100644 index 0000000000000000000000000000000000000000..4dd6a340e330fa772c8fcb25b32ad4476aa6bfcc --- /dev/null +++ b/node24/node_modules/npm/docs/content/using-npm/removal.md @@ -0,0 +1,55 @@ +--- +title: Removal +section: 7 +description: Cleaning the slate +--- + +### Synopsis + +So sad to see you go. + +```bash +sudo npm uninstall npm -g +``` + +Or, if that fails, please proceed to more severe uninstalling methods. + +### More Severe Uninstalling + +Usually, the above instructions are sufficient. +That will remove npm, but leave behind anything you've installed. + +If that doesn't work, or if you require more drastic measures, continue reading. + +Note that this is only necessary for globally-installed packages. +Local installs are completely contained within a project's `node_modules` folder. +Delete that folder, and everything is gone unless a package's install script is particularly ill-behaved. + +This assumes that you installed node and npm in the default place. +If you configured node with a different `--prefix`, or installed npm with a different prefix setting, then adjust the paths accordingly, replacing +`/usr/local` with your install prefix. + +To remove everything npm-related manually: + +```bash +rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm* +``` + +If you installed things *with* npm, then your best bet is to uninstall them with npm first, and then install them again once you have a proper install. +This can help find any symlinks that are lying around: + +```bash +ls -laF /usr/local/{lib/node{,/.npm},bin,share/man} | grep npm +``` + +Prior to version 0.3, npm used shim files for executables and node modules. +To track those down, you can do the following: + +```bash +find /usr/local/{lib/node,bin} -exec grep -l npm \{\} \; ; +``` + +### See also + +* [npm uninstall](/commands/npm-uninstall) +* [npm prune](/commands/npm-prune) diff --git a/node24/node_modules/npm/docs/content/using-npm/scope.md b/node24/node_modules/npm/docs/content/using-npm/scope.md new file mode 100644 index 0000000000000000000000000000000000000000..e5aadae51dad930d416fb985a4fd1ffab1ee67a3 --- /dev/null +++ b/node24/node_modules/npm/docs/content/using-npm/scope.md @@ -0,0 +1,123 @@ +--- +title: Scope +section: 7 +description: Scoped packages +--- + +### Description + +All npm packages have a name. +Some package names also have a scope. +A scope follows the usual rules for package names (URL-safe characters, no leading dots or underscores). +When used in package names, scopes are preceded by an `@` symbol and followed by a slash, e.g. + +```bash +@somescope/somepackagename +``` + +Scopes are a way of grouping related packages together, and also affect a few things about the way npm treats the package. + +Each npm user/organization has their own scope, and only you can add packages in your scope. +This means you don't have to worry about someone taking your package name ahead of you. +Thus it is also a good way to signal official packages for organizations. + +Scoped packages can be published and installed as of `npm@2` and are supported by the primary npm registry. +Unscoped packages can depend on scoped packages and vice versa. +The npm client is backwards-compatible with unscoped registries, so it can be used to work with scoped and unscoped registries at the same time. + +### Installing scoped packages + +Scoped packages are installed to a sub-folder of the regular installation folder, e.g. if your other packages are installed in `node_modules/packagename`, scoped modules will be installed in `node_modules/@myorg/packagename`. +The scope folder (`@myorg`) is simply the name of the scope preceded by an `@` symbol, and can contain any number of scoped packages. + +A scoped package is installed by referencing it by name, preceded by an +`@` symbol, in `npm install`: + +```bash +npm install @myorg/mypackage +``` + +Or in `package.json`: + +```json +"dependencies": { + "@myorg/mypackage": "^1.3.0" +} +``` + +Note that if the `@` symbol is omitted, in either case, npm will instead attempt to install from GitHub; see [`npm install`](/commands/npm-install). + +### Requiring scoped packages + +Because scoped packages are installed into a scope folder, you have to include the name of the scope when requiring them in your code, e.g. + +```javascript +require('@myorg/mypackage') +``` + +There is nothing special about the way Node treats scope folders. +This simply requires the `mypackage` module in the folder named `@myorg`. + +### Publishing scoped packages + +Scoped packages can be published from the CLI as of `npm@2` and can be published to any registry that supports them, including the primary npm registry. + +(As of 2015-04-19, and with npm 2.0 or better, the primary npm registry +**does** support scoped packages.) + +If you wish, you may associate a scope with a registry; see below. + +#### Publishing public scoped packages to the primary npm registry + +Publishing to a scope, you have two options: + +- Publishing to your user scope (example: `@username/module`) +- Publishing to an organization scope (example: `@org/module`) + +If publishing a public module to an organization scope, you must first either create an organization with the name of the scope that you'd like to publish to or be added to an existing organization with the appropriate permissions. +For example, if you'd like to publish to `@org`, you would need to create the `org` organization on npmjs.com prior to trying to publish. + +Scoped packages are not public by default. +You will need to specify +`--access public` with the initial `npm publish` command. +This will publish the package and set access to `public` as if you had run `npm access public` after publishing. +You do not need to do this when publishing new versions of an existing scoped package. + +#### Publishing private scoped packages to the npm registry + +To publish a private scoped package to the npm registry, you must have an [npm Private Modules](https://docs.npmjs.com/private-modules/intro) account. + +You can then publish the module with `npm publish` or `npm publish +--access restricted`, and it will be present in the npm registry, with restricted access. +You can then change the access permissions, if desired, with `npm access` or on the npmjs.com website. + +### Associating a scope with a registry + +Scopes can be associated with a separate registry. +This allows you to seamlessly use a mix of packages from the primary npm registry and one or more private registries, such as [GitHub Packages](https://github.com/features/packages) or the open source [Verdaccio](https://verdaccio.org) project. + +You can associate a scope with a registry at login, e.g. + +```bash +npm login --registry=http://reg.example.com --scope=@myco +``` + +Scopes have a many-to-one relationship with registries: one registry can host multiple scopes, but a scope only ever points to one registry. + +You can also associate a scope with a registry using `npm config`: + +```bash +npm config set @myco:registry=http://reg.example.com +``` + +Once a scope is associated with a registry, any `npm install` for a package with that scope will request packages from that registry instead. +Any +`npm publish` for a package name that contains the scope will be published to +that registry instead. + +### See also + +* [npm install](/commands/npm-install) +* [npm publish](/commands/npm-publish) +* [npm access](/commands/npm-access) +* [npm registry](/using-npm/registry) diff --git a/node24/node_modules/npm/docs/content/using-npm/scripts.md b/node24/node_modules/npm/docs/content/using-npm/scripts.md new file mode 100644 index 0000000000000000000000000000000000000000..9eb8a8224161ffc09fd65afbdac4f127b1ad57e2 --- /dev/null +++ b/node24/node_modules/npm/docs/content/using-npm/scripts.md @@ -0,0 +1,366 @@ +--- +title: Scripts +section: 7 +description: How npm handles the "scripts" field +--- + +### Description + +The `"scripts"` property of your `package.json` file supports a number of built-in scripts and their preset life cycle events as well as arbitrary scripts. +These all can be executed by running `npm run `. +*Pre* and *post* commands with matching names will be run for those as well (e.g. +`premyscript`, +`myscript`, `postmyscript`). +Scripts from dependencies can be run with `npm explore -- npm run `. + +### Pre & Post Scripts + +To create "pre" or "post" scripts for any scripts defined in the +`"scripts"` section of the `package.json`, simply create another script +*with a matching name* and add "pre" or "post" to the beginning of them. + +```json +{ + "scripts": { + "precompress": "{{ executes BEFORE the `compress` script }}", + "compress": "{{ run command to compress files }}", + "postcompress": "{{ executes AFTER `compress` script }}" + } +} +``` + +In this example `npm run compress` would execute these scripts as described. + +### Life Cycle Scripts + +There are some special life cycle scripts that happen only in certain situations. +These scripts happen in addition to the `pre`, `post`, and +`` scripts. + +* `prepare`, `prepublish`, `prepublishOnly`, `prepack`, `postpack`, `dependencies` + +**prepare** (since `npm@4.0.0`) +* Runs BEFORE the package is packed, i.e. +during `npm publish` and `npm pack` +* Runs on local `npm install` without package arguments (runs with flags like `--production` or `--omit=dev`, but does not run when installing specific packages like `npm install express`) +* Runs AFTER `prepublishOnly` and `prepack`, but BEFORE `postpack` +* Runs for a package if it's being installed as a link through `npm install ` + +* NOTE: If a package being installed through git contains a `prepare` script, its `dependencies` and `devDependencies` will be installed, and the prepare script will be run, before the package is packaged and installed. + +* As of `npm@7` these scripts run in the background. + To see the output, run with: `--foreground-scripts`. + +* **In workspaces, prepare scripts run concurrently** across all packages. If you have interdependent packages where one must build before another, consider using `--foreground-scripts` (which can be set in `.npmrc` with `foreground-scripts=true`) to run scripts sequentially, or structure your build differently. + +**prepublish** (DEPRECATED) +* Does not run during `npm publish`, but does run during `npm ci` and `npm install`. +See below for more info. + +**prepublishOnly** +* Runs BEFORE the package is prepared and packed, ONLY on `npm publish`. + +**prepack** +* Runs BEFORE a tarball is packed (on "`npm pack`", "`npm publish`", and when installing a git dependency). +* NOTE: "`npm run pack`" is NOT the same as "`npm pack`". "`npm run pack`" is an arbitrary user defined script name, whereas, "`npm pack`" is a CLI defined command. + +**postpack** +* Runs AFTER the tarball has been generated but before it is moved to its final destination (if at all, publish does not save the tarball locally) + +**dependencies** +* Runs AFTER any operations that modify the `node_modules` directory IF changes occurred. +* Does NOT run in global mode + +#### Prepare and Prepublish + +**Deprecation Note: prepublish** + +Since `npm@1.1.71`, the npm CLI has run the `prepublish` script for both `npm publish` and `npm install`, because it's a convenient way to prepare a package for use (some common use cases are described in the section below). +It has also turned out to be, in practice, [very confusing](https://github.com/npm/npm/issues/10074). +As of `npm@4.0.0`, a new event has been introduced, `prepare`, that preserves this existing behavior. +A _new_ event, `prepublishOnly` has been added as a transitional strategy to allow users to avoid the confusing behavior of existing npm versions and only run on `npm publish` (for instance, running the tests one last time to ensure they're in good shape). + +See for a much lengthier justification, with further reading, for this change. + +**Use Cases** + +Use a `prepare` script to perform build tasks that are platform-independent and need to run before your package is used. +This includes tasks such as: + +* Compiling TypeScript or other source code into JavaScript. +* Creating minified versions of JavaScript source code. +* Fetching remote resources that your package will use. + +Running these build tasks in the `prepare` script ensures they happen once, in a single place, reducing complexity and variability. +Additionally, this means that: + +* You can depend on build tools as `devDependencies`, and thus your users don't need to have them installed. +* You don't need to include minifiers in your package, reducing the size for your users. +* You don't need to rely on your users having `curl` or `wget` or other system tools on the target machines. + +#### Dependencies + +The `dependencies` script is run any time an `npm` command causes changes to the `node_modules` directory. +It is run AFTER the changes have been applied and the `package.json` and `package-lock.json` files have been updated. + +### Life Cycle Operation Order + +#### [`npm cache add`](/commands/npm-cache) + +* `prepare` + +#### [`npm ci`](/commands/npm-ci) + +* `preinstall` +* `install` +* `postinstall` +* `prepublish` +* `preprepare` +* `prepare` +* `postprepare` + +These all run after the actual installation of modules into + `node_modules`, in order, with no internal actions happening in between + +#### [`npm diff`](/commands/npm-diff) + +* `prepare` + +#### [`npm install`](/commands/npm-install) + +These also run when you run `npm install -g ` + +* `preinstall` +* `install` +* `postinstall` +* `prepublish` +* `preprepare` +* `prepare` +* `postprepare` + +If there is a `binding.gyp` file in the root of your package and you haven't defined your own `install` or `preinstall` scripts, npm will default the `install` command to compile using node-gyp via `node-gyp rebuild` + +These are run from the scripts of `` + +#### [`npm pack`](/commands/npm-pack) + +* `prepack` +* `prepare` +* `postpack` + +#### [`npm publish`](/commands/npm-publish) + +* `prepublishOnly` +* `prepack` +* `prepare` +* `postpack` +* `publish` +* `postpublish` + +#### [`npm rebuild`](/commands/npm-rebuild) + +* `preinstall` +* `install` +* `postinstall` +* `prepare` + +`prepare` is only run if the current directory is a symlink (e.g. +with linked packages) + +#### [`npm restart`](/commands/npm-restart) + +If there is a `restart` script defined, these events are run; otherwise, +`stop` and `start` are both run if present, including their `pre` and `post` iterations) + +* `prerestart` +* `restart` +* `postrestart` + +#### [`npm run `](/commands/npm-run) + +* `pre` +* `` +* `post` + +#### [`npm start`](/commands/npm-start) + +* `prestart` +* `start` +* `poststart` + +If there is a `server.js` file in the root of your package, then npm will default the `start` command to `node server.js`. +`prestart` and `poststart` will still run in this case. + +#### [`npm stop`](/commands/npm-stop) + +* `prestop` +* `stop` +* `poststop` + +#### [`npm test`](/commands/npm-test) + +* `pretest` +* `test` +* `posttest` + +#### [`npm version`](/commands/npm-version) + +* `preversion` +* `version` +* `postversion` + +#### A Note on a lack of [`npm uninstall`](/commands/npm-uninstall) scripts + +While npm v6 had `uninstall` lifecycle scripts, npm v7 does not. +Removal of a package can happen for a wide variety of reasons, and there's no clear way to currently give the script enough context to be useful. + + +Reasons for a package removal include: + +* a user directly uninstalled this package +* a user uninstalled a dependent package and so this dependency is being uninstalled +* a user uninstalled a dependent package but another package also depends on this version +* this version has been merged as a duplicate with another version +* etc. + +Due to the lack of necessary context, `uninstall` lifecycle scripts are not implemented and will not function. + +### Working Directory for Scripts + +Scripts are always run from the root of the package folder, regardless of what the current working directory is when `npm` is invoked. +This means your scripts can reliably assume they are running in the package root. + +If you want your script to behave differently based on the directory you were in when you ran `npm`, you can use the `INIT_CWD` environment variable, which holds the full path you were in when you ran `npm run`. + +#### Historical Behavior in Older npm Versions + +For npm v6 and earlier, scripts were generally run from the root of the package, but there were rare cases and bugs in older versions where this was not guaranteed. +If your package must support very old npm versions, you may wish to add a safeguard in your scripts (for example, by checking process.cwd()). + +For more details, see: +- [npm v7 release notes](https://github.com/npm/cli/releases/tag/v7.0.0) +- [Discussion about script working directory reliability in npm v6 and earlier](https://github.com/npm/npm/issues/12356) + +### Environment + +Package scripts run in an environment where many pieces of information are made available regarding the setup of npm and the current state of the process. + +#### path + +If you depend on modules that define executable scripts, like test suites, then those executables will be added to the `PATH` for executing the scripts. +So, if your package.json has this: + +```json +{ + "name" : "foo", + "dependencies" : { + "bar" : "0.1.x" + }, + "scripts": { + "start" : "bar ./test" + } +} +``` + +then you could run `npm start` to execute the `bar` script, which is exported into the `node_modules/.bin` directory on `npm install`. + +#### package.json vars + +npm sets the following environment variables from the package.json: + +* `npm_package_name` - The package name +* `npm_package_version` - The package version +* `npm_package_bin_*` - Each executable defined in the bin field +* `npm_package_engines_*` - Each engine defined in the engines field +* `npm_package_config_*` - Each config value defined in the config field +* `npm_package_json` - The full path to the package.json file + +Additionally, for install scripts (`preinstall`, `install`, `postinstall`), npm sets these environment variables: + +* `npm_package_resolved` - The resolved URL for the package +* `npm_package_integrity` - The integrity hash for the package +* `npm_package_optional` - Set to `"true"` if the package is optional +* `npm_package_dev` - Set to `"true"` if the package is a dev dependency +* `npm_package_peer` - Set to `"true"` if the package is a peer dependency +* `npm_package_dev_optional` - Set to `"true"` if the package is both dev and optional + +For example, if you had `{"name":"foo", "version":"1.2.5"}` in your package.json file, then your package scripts would have the `npm_package_name` environment variable set to "foo", and the `npm_package_version` set to "1.2.5". You can access these variables in your code with `process.env.npm_package_name` and `process.env.npm_package_version`. + +**Note:** In npm 7 and later, most package.json fields are no longer provided as environment variables. Scripts that need access to other package.json fields should read the package.json file directly. The `npm_package_json` environment variable provides the path to the file for this purpose. + +See [`package.json`](/configuring-npm/package-json) for more on package configs. + +#### current lifecycle event + +Lastly, the `npm_lifecycle_event` environment variable is set to whichever stage of the cycle is being executed. +So, you could have a single script used for different parts of the process which switches based on what's currently happening. + +Objects are flattened following this format, so if you had +`{"scripts":{"install":"foo.js"}}` in your package.json, then you'd see this in the script: + +```bash +process.env.npm_package_scripts_install === "foo.js" +``` + +### Examples + +For example, if your package.json contains this: + +```json +{ + "scripts" : { + "prepare" : "scripts/build.js", + "test" : "scripts/test.js" + } +} +``` + +then `scripts/build.js` will be called for the prepare stage of the lifecycle, and you can check the +`npm_lifecycle_event` environment variable if your script needs to behave differently in different contexts. + +If you want to run build commands, you can do so. +This works just fine: + +```json +{ + "scripts" : { + "prepare" : "npm run build", + "build" : "tsc", + "test" : "jest" + } +} +``` + +### Exiting + +Scripts are run by passing the line as a script argument to `/bin/sh` on POSIX systems or `cmd.exe` on Windows. +You can control which shell is used by setting the [`script-shell`](/using-npm/config#script-shell) configuration option. + +If the script exits with a code other than 0, then this will abort the process. + +Note that these script files don't have to be Node.js or even JavaScript programs. +They just have to be some kind of executable file. + +### Best Practices + +* Don't exit with a non-zero error code unless you *really* mean it. + If the failure is minor or only will prevent some optional features, then it's better to just print a warning and exit successfully. +* Try not to use scripts to do what npm can do for you. +Read through [`package.json`](/configuring-npm/package-json) to see all the things that you can specify and enable by simply describing your package appropriately. +In general, this will lead to a more robust and consistent state. +* Inspect the env to determine where to put things. +For instance, if the `NPM_CONFIG_BINROOT` environment variable is set to `/home/user/bin`, then don't try to install executables into `/usr/local/bin`. +The user probably set it up that way for a reason. +* Don't prefix your script commands with "sudo". If root permissions are required for some reason, then it'll fail with that error, and the user will sudo the npm command in question. +* Don't use `install`. +Use a `.gyp` file for compilation, and `prepare` for anything else. +You should almost never have to explicitly set a preinstall or install script. +If you are doing this, please consider if there is another option. +The only valid use of `install` or `preinstall` scripts is for compilation which must be done on the target architecture. + +### See Also + +* [npm run](/commands/npm-run) +* [package.json](/configuring-npm/package-json) +* [npm developers](/using-npm/developers) +* [npm install](/commands/npm-install) diff --git a/node24/node_modules/npm/docs/content/using-npm/workspaces.md b/node24/node_modules/npm/docs/content/using-npm/workspaces.md new file mode 100644 index 0000000000000000000000000000000000000000..3344c3fe306b9fc81e3eb4682de36cd8c6ccff16 --- /dev/null +++ b/node24/node_modules/npm/docs/content/using-npm/workspaces.md @@ -0,0 +1,219 @@ +--- +title: Workspaces +section: 7 +description: Working with workspaces +--- + +### Description + +**Workspaces** is a generic term that refers to the set of features in the npm cli that provides support for managing multiple packages from your local file system from within a singular top-level, root package. + +This set of features makes up for a much more streamlined workflow handling linked packages from the local file system. +It automates the linking process as part of `npm install` and removes the need to manually use `npm link` in order to add references to packages that should be symlinked into the current `node_modules` folder. + +We also refer to these packages being auto-symlinked during `npm install` as a single **workspace**, meaning it's a nested package within the current local file system that is explicitly defined in the [`package.json`](/configuring-npm/package-json#workspaces) +`workspaces` configuration. + +### Defining workspaces + +Workspaces are usually defined via the `workspaces` property of the [`package.json`](/configuring-npm/package-json#workspaces) file, e.g: + +```json +{ + "name": "my-workspaces-powered-project", + "workspaces": [ + "packages/a" + ] +} +``` + +Given the above `package.json` example living at a current working directory `.` that contains a folder named `packages/a` that itself contains a `package.json` inside it, defining a Node.js package, e.g: + +``` +. ++-- package.json +`-- packages + +-- a + | `-- package.json +``` + +The expected result once running `npm install` in this current working directory `.` is that the folder `packages/a` will get symlinked to the `node_modules` folder of the current working dir. + +Below is a post `npm install` example, given that same previous example structure of files and folders: + +``` +. ++-- node_modules +| `-- a -> ../packages/a ++-- package-lock.json ++-- package.json +`-- packages + +-- a + | `-- package.json +``` + +### Getting started with workspaces + +You may automate the required steps to define a new workspace using [npm init](/commands/npm-init). +For example in a project that already has a `package.json` defined you can run: + +``` +npm init -w ./packages/a +``` + +This command will create the missing folders and a new `package.json` file (if needed) while also making sure to properly configure the +`"workspaces"` property of your root project `package.json`. + +### Adding dependencies to a workspace + +It's possible to directly add/remove/update dependencies of your workspaces using the [`workspace` config](/using-npm/config#workspace). + +For example, assuming the following structure: + +``` +. ++-- package.json +`-- packages + +-- a + | `-- package.json + `-- b + `-- package.json +``` + +If you want to add a dependency named `abbrev` from the registry as a dependency of your workspace **a**, you may use the workspace config to tell the npm installer that package should be added as a dependency of the provided workspace: + +``` +npm install abbrev -w a +``` + +**Adding a workspace as a dependency of another workspace:** + +The same approach works when adding one workspace as a dependency of another. +If you want to add workspace **b** as a dependency of workspace **a**, run: + +``` +npm install b -w a +``` + +npm will detect that **b** is a workspace and automatically symlink it rather +than fetching it from the registry. The resulting entry in workspace **a**'s +`package.json` will use a standard version range: + +```json +{ + "dependencies": { + "b": "^1.0.0" + } +} +``` + +Note: other installing commands such as `uninstall`, `ci`, etc will also respect the provided `workspace` configuration. + +### Using workspaces + +Given the [specifics of how Node.js handles module resolution](https://nodejs.org/dist/latest-v14.x/docs/api/modules.html#modules_all_together) it's possible to consume any defined workspace by its declared `package.json` `name`. +Continuing from the example defined above, let's also create a Node.js script that will require the workspace `a` example module, e.g: + +``` +// ./packages/a/index.js +module.exports = 'a' + +// ./lib/index.js +const moduleA = require('a') +console.log(moduleA) // -> a +``` + +When running it with: + +`node lib/index.js` + +This demonstrates how the nature of `node_modules` resolution allows for +**workspaces** to enable a portable workflow for requiring each **workspace** in such a way that is also easy to [publish](/commands/npm-publish) these nested workspaces to be consumed elsewhere. + +### Running commands in the context of workspaces + +You can use the `workspace` configuration option to run commands in the context of a configured workspace. +Additionally, if your current directory is in a workspace, the `workspace` configuration is implicitly set, and `prefix` is set to the root workspace. + +Following is a quick example on how to use the `npm run` command in the context of nested workspaces. +For a project containing multiple workspaces, e.g: + +``` +. ++-- package.json +`-- packages + +-- a + | `-- package.json + `-- b + `-- package.json +``` + +By running a command using the `workspace` option, it's possible to run the given command in the context of that specific workspace. +e.g: + +``` +npm run test --workspace=a +``` + +You could also run the command within the workspace. + +``` +cd packages/a && npm run test +``` + +Either will run the `test` script defined within the +`./packages/a/package.json` file. + +Please note that you can also specify this argument multiple times in the command-line in order to target multiple workspaces, e.g: + +``` +npm run test --workspace=a --workspace=b +``` + +Or run the command for each workspace within the 'packages' folder: +``` +npm run test --workspace=packages +``` + +It's also possible to use the `workspaces` (plural) configuration option to enable the same behavior but running that command in the context of **all** configured workspaces. +e.g: + +``` +npm run test --workspaces +``` + +Will run the `test` script in both `./packages/a` and `./packages/b`. + +Commands will be run in each workspace in the order they appear in your `package.json` + +``` +{ + "workspaces": [ "packages/a", "packages/b" ] +} +``` + +Order of run is different with: + +``` +{ + "workspaces": [ "packages/b", "packages/a" ] +} +``` + +### Ignoring missing scripts + +It is not required for all of the workspaces to implement scripts run with the `npm run` command. + +By running the command with the `--if-present` flag, npm will ignore workspaces missing target script. + +``` +npm run test --workspaces --if-present +``` + +### See also + +* [npm install](/commands/npm-install) +* [npm publish](/commands/npm-publish) +* [npm run](/commands/npm-run) +* [config](/using-npm/config) + diff --git a/node24/node_modules/npm/docs/lib/index.js b/node24/node_modules/npm/docs/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..99506e75c2131989dc0e524a4d03d0a40c01e33a --- /dev/null +++ b/node24/node_modules/npm/docs/lib/index.js @@ -0,0 +1,310 @@ +const localeCompare = require('@isaacs/string-locale-compare')('en') +const { join, basename, resolve } = require('path') +const transformHTML = require('./transform-html.js') +const { version } = require('../../lib/npm.js') +const { aliases } = require('../../lib/utils/cmd-list') +const { shorthands, definitions } = require('@npmcli/config/lib/definitions') + +const DOC_EXT = '.md' + +const TAGS = { + CONFIG: '', + USAGE: '', + SHORTHANDS: '', +} + +const assertPlaceholder = (src, path, placeholder) => { + if (!src.includes(placeholder)) { + throw new Error( + `Cannot replace ${placeholder} in ${path} due to missing placeholder` + ) + } + return placeholder +} + +// Default command loader - loads commands from lib/commands +const defaultCommandLoader = (name) => { + return require(`../../lib/commands/${name}`) +} + +// Load a command using the provided loader or default +const getCommand = (name, commandLoader = defaultCommandLoader) => { + return commandLoader(name) +} + +// Resolve definitions for a command - use definitions if present, otherwise build from params +const resolveDefinitions = (command) => { + // If command has definitions, use them directly (ignore params) + if (command.definitions && Object.keys(command.definitions).length > 0) { + return command.definitions + } + + // Otherwise build from params using global definitions + if (command.params) { + const resolved = {} + for (const param of command.params) { + if (definitions[param]) { + resolved[param] = definitions[param] + } + } + return resolved + } + + return {} +} + +const getCommandByDoc = (docFile, docExt, commandLoader = defaultCommandLoader) => { + // Grab the command name from the *.md filename + // NOTE: We cannot use the name property command file because in the case of + // `npx` the file being used is `lib/commands/exec.js` + const name = basename(docFile, docExt).replace('npm-', '') + + if (name === 'npm') { + return { + name, + definitions: [], + usage: 'npm', + } + } + + // special case for `npx`: + // `npx` is not technically a command in and of itself, + // so it just needs the usage of npm exec + const srcName = name === 'npx' ? 'exec' : name + const command = getCommand(srcName, commandLoader) + const { usage = [''], workspaces } = command + const usagePrefix = name === 'npx' ? 'npx' : `npm ${name}` + + // Resolve definitions - handles exclusive params expansion + const commandDefs = resolveDefinitions(command) + const resolvedDefs = {} + for (const [key, def] of Object.entries(commandDefs)) { + resolvedDefs[key] = def + // Handle exclusive params + if (def.exclusive) { + for (const e of def.exclusive) { + if (!resolvedDefs[e] && definitions[e]) { + resolvedDefs[e] = definitions[e] + } + } + } + } + + return { + name, + workspaces, + definitions: name === 'npx' ? {} : resolvedDefs, + usage: usage?.map(u => `${usagePrefix} ${u}`.trim()).join('\n'), + } +} + +const replaceVersion = (src) => src.replace(/@VERSION@/g, version) + +const replaceUsage = (src, { path, commandLoader }) => { + const replacer = assertPlaceholder(src, path, TAGS.USAGE) + const { usage, name, workspaces } = getCommandByDoc(path, DOC_EXT, commandLoader) + + const synopsis = [] + + if (usage) { + synopsis.push('```bash', usage) + + const cmdAliases = Object.keys(aliases).reduce((p, c) => { + if (aliases[c] === name) { + p.push(c) + } + return p + }, []) + + if (cmdAliases.length === 1) { + synopsis.push('', `alias: ${cmdAliases[0]}`) + } else if (cmdAliases.length > 1) { + synopsis.push('', `aliases: ${cmdAliases.join(', ')}`) + } + + synopsis.push('```') + } + + if (!workspaces) { + if (synopsis.length) { + synopsis.push('') + } + synopsis.push('Note: This command is unaware of workspaces.') + } + + return src.replace(replacer, synopsis.join('\n')) +} + +// Helper to generate a markdown table from definitions +const generateFlagsTable = (definitionPool) => { + const rows = Object.keys(definitionPool).map((n) => { + const def = definitionPool[n] + const flags = [`\`--${def.key}\``] + if (def.alias) { + flags.push(...def.alias.map(a => `\`--${a}\``)) + } + if (def.short) { + flags.push(`\`-${def.short}\``) + } + const flagsStr = flags.join(', ') + let defaultVal = def.defaultDescription + if (!defaultVal) { + defaultVal = String(def.default) + } + let typeVal = def.typeDescription || String(def.type) + if (def.required) { + typeVal = `${typeVal} (required)` + } + const desc = (def.description || '').replace(/\n/g, ' ').trim() + return `| ${flagsStr} | ${defaultVal} | ${typeVal} | ${desc} |` + }) + + return [ + '| Flag | Default | Type | Description |', + '| --- | --- | --- | --- |', + ...rows, + ].join('\n') +} + +const replaceDefinitions = (src, { path, commandLoader }) => { + const { definitions: commandDefs, name } = getCommandByDoc(path, DOC_EXT, commandLoader) + + let subcommands = {} + try { + const command = getCommand(name, commandLoader) + subcommands = command.subcommands || {} + } catch { + // Command doesn't exist + } + + // If no definitions and no subcommands, nothing to replace + if (Object.keys(commandDefs).length === 0 && Object.keys(subcommands).length === 0) { + return src + } + + // Assert placeholder is present + const replacer = assertPlaceholder(src, path, TAGS.CONFIG) + + // If command has subcommands, generate sections for each subcommand + if (Object.keys(subcommands).length > 0) { + const subcommandSections = Object.entries(subcommands).map(([subName, SubCommand]) => { + const subUsage = SubCommand.usage || [] + const subDefs = resolveDefinitions(SubCommand) + + const parts = [`### \`npm ${name} ${subName}\``, ''] + + if (SubCommand.description) { + parts.push(SubCommand.description, '') + } + + // Add usage/synopsis + if (subUsage.length > 0) { + parts.push('#### Synopsis', '', '```bash') + subUsage.forEach(u => { + parts.push(`npm ${name} ${subName} ${u}`.trim()) + }) + parts.push('```', '') + } + + // Add flags section if definitions exist + if (Object.keys(subDefs).length > 0) { + parts.push('#### Flags', '') + parts.push(generateFlagsTable(subDefs), '') + } + + return parts.join('\n') + }) + + return src.replace(replacer, subcommandSections.join('\n')) + } + + // For commands without subcommands - commandDefs must be non-empty here + // (we would have returned early at line 175 if both were empty) + const paramDescriptions = Object.values(commandDefs) + .map(def => def.describe()) + + return src.replace(replacer, paramDescriptions.join('\n\n')) +} + +const replaceConfig = (src, { path }) => { + const replacer = assertPlaceholder(src, path, TAGS.CONFIG) + + // sort not-deprecated ones to the top + /* istanbul ignore next - typically already sorted in the definitions file, + * but this is here so that our help doc will stay consistent if we decide + * to move them around. */ + const sort = ([keya, { deprecated: depa }], [keyb, { deprecated: depb }]) => { + return depa && !depb ? 1 + : !depa && depb ? -1 + : localeCompare(keya, keyb) + } + + const allConfig = Object.entries(definitions).sort(sort) + .map(([, def]) => def.describe()) + .join('\n\n') + + return src.replace(replacer, allConfig) +} + +const replaceShorthands = (src, { path }) => { + const replacer = assertPlaceholder(src, path, TAGS.SHORTHANDS) + + const sh = Object.entries(shorthands) + .sort(([shorta, expansiona], [shortb, expansionb]) => + // sort by what they're short FOR + localeCompare(expansiona.join(' '), expansionb.join(' ')) || localeCompare(shorta, shortb) + ) + .map(([short, expansion]) => { + // XXX: this is incorrect. we have multicharacter flags like `-iwr` that + // can only be set with a single dash + const dash = short.length === 1 ? '-' : '--' + return `* \`${dash}${short}\`: \`${expansion.join(' ')}\`` + }) + + return src.replace(replacer, sh.join('\n')) +} + +const replaceHelpLinks = (src) => { + // replaces markdown links with equivalent-ish npm help commands + return src.replace( + /\[`?([\w\s-]+)`?\]\(\/(?:commands|configuring-npm|using-npm)\/(?:[\w\s-]+)\)/g, + (_, p1) => { + const term = p1.replace(/npm\s/g, '').replace(/\s+/g, ' ').trim() + const help = `npm help ${term.includes(' ') ? `"${term}"` : term}` + return help + } + ) +} + +const transformMan = (src, { data, unified, remarkParse, remarkMan }) => unified() + .use(remarkParse) + .use(remarkMan, { version: `NPM@${version}` }) + .processSync(`# ${data.title}(${data.section}) - ${data.description}\n\n${src}`) + .toString() + +const manPath = (name, { data }) => join(`man${data.section}`, `${name}.${data.section}`) + +const transformMd = (src, { frontmatter }) => ['---', frontmatter, '---', '', src].join('\n') + +module.exports = { + DOC_EXT, + TAGS, + paths: { + content: resolve(__dirname, 'content'), + nav: resolve(__dirname, 'content', 'nav.yml'), + template: resolve(__dirname, 'template.html'), + man: resolve(__dirname, '..', '..', 'man'), + html: resolve(__dirname, '..', 'output'), + md: resolve(__dirname, '..', 'content'), + }, + usage: replaceUsage, + definitions: replaceDefinitions, + config: replaceConfig, + shorthands: replaceShorthands, + version: replaceVersion, + helpLinks: replaceHelpLinks, + man: transformMan, + manPath: manPath, + md: transformMd, + html: transformHTML, +} diff --git a/node24/node_modules/npm/docs/output/commands/npm-access.html b/node24/node_modules/npm/docs/output/commands/npm-access.html new file mode 100644 index 0000000000000000000000000000000000000000..d9e94323197afe6402fb3128a080c39614f69571 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-access.html @@ -0,0 +1,280 @@ + + +npm-access + + + + + +
+
+

+ npm-access + @11.12.1 +

+Set access level on published packages +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm access list packages [<user>|<scope>|<scope:team>] [<package>]
+npm access list collaborators [<package> [<user>]]
+npm access get status [<package>]
+npm access set status=public|private [<package>]
+npm access set mfa=none|publish|automation [<package>]
+npm access grant <read-only|read-write> <scope:team> [<package>]
+npm access revoke <scope:team> [<package>]
+
+

Note: This command is unaware of workspaces.

+

Description

+

Used to set access controls on private packages.

+

For all of the subcommands, npm access will perform actions on the packages in the current working directory if no package name is passed to the subcommand.

+
    +
  • grant / revoke: +Add or remove the ability of users and teams to have read-only or read-write access to a package.
  • +
+

Details

+

npm access always operates directly on the current registry, configurable from the command line using --registry=<registry url>.

+

Unscoped packages are always public.

+

Scoped packages default to restricted, but you can either publish them as public using npm publish --access=public, or set their access as public using npm access set status=public after the initial publish.

+

You must have privileges to set the access of a package:

+
    +
  • You are an owner of an unscoped or scoped package.
  • +
  • You are a member of the team that owns a scope.
  • +
  • You have been given read-write privileges for a package, either as a member of a team or directly as an owner.
  • +
+

If you have two-factor authentication enabled then you'll be prompted to provide a second factor, or may use the --otp=... option to specify it on the command line.

+

If your account is not paid, then attempts to publish scoped packages will fail with an HTTP 402 status code (logically enough), unless you use +--access=public.

+

Management of teams and team memberships is done with the npm team command.

+

Configuration

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

+

otp

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with npm access.

+

If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one.

+

registry

+ +

The base URL of the npm registry.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-adduser.html b/node24/node_modules/npm/docs/output/commands/npm-adduser.html new file mode 100644 index 0000000000000000000000000000000000000000..4e5f25b95c51dfd41923d0ef54136628d15db477 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-adduser.html @@ -0,0 +1,271 @@ + + +npm-adduser + + + + + +
+
+

+ npm-adduser + @11.12.1 +

+Add a registry user account +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm adduser
+
+alias: add-user
+
+

Note: This command is unaware of workspaces.

+

Description

+

Create a new user in the specified registry, and save the credentials to the .npmrc file. +If no registry is specified, the default registry will be used (see registry).

+

When you run npm adduser, the CLI automatically generates a legacy token of publish type. +For more information, see About legacy tokens.

+

When using legacy for your auth-type, the username, password, and email are read in from prompts.

+

Configuration

+

registry

+ +

The base URL of the npm registry.

+

scope

+
    +
  • Default: the scope of the current project, if any, or ""
  • +
  • Type: String
  • +
+

Associate an operation with a scope for a scoped registry.

+

Useful when logging in to or out of a private registry:

+
# log in, linking the scope to the custom registry
+npm login --scope=@mycorp --registry=https://registry.mycorp.com
+
+# log out, removing the link and the auth token
+npm logout --scope=@mycorp
+
+

This will cause @mycorp to be mapped to the registry for future +installation of packages specified according to the pattern +@mycorp/package.

+

This will also cause npm init to create a scoped package.

+
# accept all defaults, and create a package named "@foo/whatever",
+# instead of just named "whatever"
+npm init --scope=@foo --yes
+
+

auth-type

+
    +
  • Default: "web"
  • +
  • Type: "legacy" or "web"
  • +
+

What authentication strategy to use with login. Note that if an otp +config is given, this value will always be set to legacy.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-audit.html b/node24/node_modules/npm/docs/output/commands/npm-audit.html new file mode 100644 index 0000000000000000000000000000000000000000..3bd04cfac45d3b4c00c7927385bada20576310e9 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-audit.html @@ -0,0 +1,528 @@ + + +npm-audit + + + + + +
+
+

+ npm-audit + @11.12.1 +

+Run a security audit +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm audit [fix|signatures]
+
+

Description

+

The audit command submits a description of the dependencies configured in your project to your default registry and asks for a report of known vulnerabilities. +If any vulnerabilities are found, then the impact and appropriate remediation will be calculated. +If the fix argument is provided, then remediations will be applied to the package tree.

+

The command will exit with a 0 exit code if no vulnerabilities were found.

+

Note that some vulnerabilities cannot be fixed automatically and will require manual intervention or review. +Also note that since npm audit fix runs a full-fledged npm install under the hood, all configs that apply to the installer will also apply to npm install -- so things like npm audit fix --package-lock-only will work as expected.

+

By default, the audit command will exit with a non-zero code if any vulnerability is found. +It may be useful in CI environments to include the --audit-level parameter to specify the minimum vulnerability level that will cause the command to fail. +This option does not filter the report output, it simply changes the command's failure threshold.

+

Package lock

+

By default npm requires a package-lock or shrinkwrap in order to run the audit. +You can bypass the package lock with --no-package-lock but be aware the results may be different with every run, since npm will re-build the dependency tree each time.

+

Audit Signatures

+

To ensure the integrity of packages you download from the public npm registry, or any registry that supports signatures, you can verify the registry signatures of downloaded packages using the npm CLI.

+

Registry signatures can be verified using the following audit command:

+
$ npm audit signatures
+
+

The audit signatures command will also verify the provenance attestations of downloaded packages. +Because provenance attestations are such a new feature, security features may be added to (or changed in) the attestation format over time. +To ensure that you're always able to verify attestation signatures check that you're running the latest version of the npm CLI. Please note this often means updating npm beyond the version that ships with Node.js.

+

To include the full sigstore attestation bundles in JSON output, use:

+
$ npm audit signatures --json --include-attestations
+
+

This adds a verified array to the JSON output containing the attestation +bundles (DSSE envelopes, verification material, and transparency log entries) +for each verified package.

+

The npm CLI supports registry signatures and signing keys provided by any registry if the following conventions are followed:

+
    +
  1. Signatures are provided in the package's packument in each published version within the dist object:
  2. +
+
"dist":{
+  "..omitted..": "..omitted..",
+  "signatures": [{
+    "keyid": "SHA256:{{SHA256_PUBLIC_KEY}}",
+    "sig": "a312b9c3cb4a1b693e8ebac5ee1ca9cc01f2661c14391917dcb111517f72370809..."
+  }]
+}
+
+

See this example of a signed package from the public npm registry.

+

The sig is generated using the following template: ${package.name}@${package.version}:${package.dist.integrity} and the keyid has to match one of the public signing keys below.

+
    +
  1. Public signing keys are provided at registry-host.tld/-/npm/v1/keys in the following format:
  2. +
+
{
+  "keys": [{
+    "expires": null,
+    "keyid": "SHA256:{{SHA256_PUBLIC_KEY}}",
+    "keytype": "ecdsa-sha2-nistp256",
+    "scheme": "ecdsa-sha2-nistp256",
+    "key": "{{B64_PUBLIC_KEY}}"
+  }]
+}
+
+

Keys response:

+
    +
  • expires: null or a simplified extended ISO 8601 format: YYYY-MM-DDTHH:mm:ss.sssZ
  • +
  • keyid: sha256 fingerprint of the public key
  • +
  • keytype: only ecdsa-sha2-nistp256 is currently supported by the npm CLI
  • +
  • scheme: only ecdsa-sha2-nistp256 is currently supported by the npm CLI
  • +
  • key: base64 encoded public key
  • +
+

See this example key's response from the public npm registry.

+

Audit Endpoints

+

There are two audit endpoints that npm may use to fetch vulnerability information: the Bulk Advisory endpoint and the Quick Audit endpoint.

+

Bulk Advisory Endpoint

+

As of version 7, npm uses the much faster Bulk Advisory endpoint to optimize the speed of calculating audit results.

+

npm will generate a JSON payload with the name and list of versions of each package in the tree, and POST it to the default configured registry at the path /-/npm/v1/security/advisories/bulk.

+

Any packages in the tree that do not have a version field in their package.json file will be ignored. +If any --omit options are specified (either via the --omit config, or one of the shorthands such as --production, --only=dev, and so on), then packages will be omitted from the submitted payload as appropriate.

+

If the registry responds with an error, or with an invalid response, then npm will attempt to load advisory data from the Quick Audit endpoint.

+

The expected result will contain a set of advisory objects for each dependency that matches the advisory range. +Each advisory object contains a name, url, id, severity, vulnerable_versions, and title.

+

npm then uses these advisory objects to calculate vulnerabilities and meta-vulnerabilities of the dependencies within the tree.

+

Quick Audit Endpoint

+

If the Bulk Advisory endpoint returns an error, or invalid data, npm will attempt to load advisory data from the Quick Audit endpoint, which is considerably slower in most cases.

+

The full package tree as found in package-lock.json is submitted, along with the following pieces of additional metadata:

+
    +
  • npm_version
  • +
  • node_version
  • +
  • platform
  • +
  • arch
  • +
  • node_env
  • +
+

All packages in the tree are submitted to the Quick Audit endpoint. +Omitted dependency types are skipped when generating the report.

+

Scrubbing

+

Out of an abundance of caution, npm versions 5 and 6 would "scrub" any packages from the submitted report if their name contained a / character, so as to avoid leaking the names of potentially private packages or git URLs.

+

However, in practice, this resulted in audits often failing to properly detect meta-vulnerabilities, because the tree would appear to be invalid due to missing dependencies, and prevented the detection of vulnerabilities in package trees that used git dependencies or private modules.

+

This scrubbing has been removed from npm as of version 7.

+

Calculating Meta-Vulnerabilities and Remediations

+

npm uses the @npmcli/metavuln-calculator module to turn a set of security advisories into a set of "vulnerability" objects. +A "meta-vulnerability" is a dependency that is vulnerable by virtue of dependence on vulnerable versions of a vulnerable package.

+

For example, if the package foo is vulnerable in the range >=1.0.2 <2.0.0, and the package bar depends on foo@^1.1.0, then that version of bar can only be installed by installing a vulnerable version of foo. +In this case, bar is a "metavulnerability".

+

Once metavulnerabilities for a given package are calculated, they are cached in the ~/.npm folder and only re-evaluated if the advisory range changes, or a new version of the package is published (in which case, the new version is checked for metavulnerable status as well).

+

If the chain of metavulnerabilities extends all the way to the root project, and it cannot be updated without changing its dependency ranges, then npm audit fix will require the --force option to apply the remediation. +If remediations do not require changes to the dependency ranges, then all vulnerable packages will be updated to a version that does not have an advisory or metavulnerability posted against it.

+

Exit Code

+

The npm audit command will exit with a 0 exit code if no vulnerabilities were found. +The npm audit fix command will exit with 0 exit code if no vulnerabilities are found or if the remediation is able to successfully fix all vulnerabilities.

+

If vulnerabilities were found the exit code will depend on the audit-level config.

+

Examples

+

Scan your project for vulnerabilities and automatically install any compatible updates to vulnerable dependencies:

+
$ npm audit fix
+
+

Run audit fix without modifying node_modules, but still updating the pkglock:

+
$ npm audit fix --package-lock-only
+
+

Skip updating devDependencies:

+
$ npm audit fix --only=prod
+
+

Have audit fix install SemVer-major updates to toplevel dependencies, not just SemVer-compatible ones:

+
$ npm audit fix --force
+
+

Do a dry run to get an idea of what audit fix will do, and also output install information in JSON format:

+
$ npm audit fix --dry-run --json
+
+

Scan your project for vulnerabilities and just show the details, without fixing anything:

+
$ npm audit
+
+

Get the detailed audit report in JSON format:

+
$ npm audit --json
+
+

Fail an audit only if the results include a vulnerability with a level of moderate or higher:

+
$ npm audit --audit-level=moderate
+
+

Configuration

+

audit-level

+
    +
  • Default: null
  • +
  • Type: null, "info", "low", "moderate", "high", "critical", or "none"
  • +
+

The minimum level of vulnerability for npm audit to exit with a non-zero +exit code.

+

dry-run

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, install, update, +dedupe, uninstall, as well as pack and publish.

+

Note: This is NOT honored by other network related commands, eg dist-tags, +owner, etc.

+

force

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Removes various protections against unfortunate side effects, common +mistakes, unnecessary performance degradation, and malicious input.

+
    +
  • Allow clobbering non-npm files in global installs.
  • +
  • Allow the npm version command to work on an unclean git repository.
  • +
  • Allow deleting the cache folder with npm cache clean.
  • +
  • Allow installing packages that have an engines declaration requiring a +different version of npm.
  • +
  • Allow installing packages that have an engines declaration requiring a +different version of node, even if --engine-strict is enabled.
  • +
  • Allow npm audit fix to install modules outside your stated dependency +range (including SemVer-major changes).
  • +
  • Allow unpublishing all versions of a published package.
  • +
  • Allow conflicting peerDependencies to be installed in the root project.
  • +
  • Implicitly set --yes during npm init.
  • +
  • Allow clobbering existing values in npm pkg
  • +
  • Allow unpublishing of entire packages (not just a single version).
  • +
+

If you don't have a clear idea of what you want to do, it is strongly +recommended that you do not use this option!

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

+

package-lock-only

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, the current operation will only use the package-lock.json, +ignoring node_modules.

+

For update this means only the package-lock.json will be updated, +instead of checking node_modules and downloading dependencies.

+

For list this means the output will be based on the tree described by the +package-lock.json, rather than the contents of node_modules.

+

package-lock

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

If set to false, then ignore package-lock.json files when installing. This +will also prevent writing package-lock.json if save is true.

+

omit

+
    +
  • Default: 'dev' if the NODE_ENV environment variable is set to +'production'; otherwise, empty.
  • +
  • Type: "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Dependency types to omit from the installation tree on disk.

+

Note that these dependencies are still resolved and added to the +package-lock.json or npm-shrinkwrap.json file. They are just not +physically installed on disk.

+

If a package type appears in both the --include and --omit lists, then +it will be included.

+

If the resulting omit list includes 'dev', then the NODE_ENV environment +variable will be set to 'production' for all lifecycle scripts.

+

include

+
    +
  • Default:
  • +
  • Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Option that allows for defining which types of dependencies to install.

+

This is the inverse of --omit=<type>.

+

Dependency types specified in --include will not be omitted, regardless of +the order in which omit/include are specified on the command-line.

+

foreground-scripts

+
    +
  • Default: false unless when using npm pack or npm publish where it +defaults to true
  • +
  • Type: Boolean
  • +
+

Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

+

Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging.

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

include-attestations

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When used with npm audit signatures --json, includes the full sigstore +attestation bundles in the JSON output for each verified package. The +bundles contain DSSE envelopes, verification material, and transparency log +entries.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-bugs.html b/node24/node_modules/npm/docs/output/commands/npm-bugs.html new file mode 100644 index 0000000000000000000000000000000000000000..be967b7f1dda7b03c43ced674dc2e55c91cd778d --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-bugs.html @@ -0,0 +1,293 @@ + + +npm-bugs + + + + + +
+
+

+ npm-bugs + @11.12.1 +

+Report bugs for a package in a web browser +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm bugs [<pkgname> [<pkgname> ...]]
+
+alias: issues
+
+

Description

+

This command tries to guess at the likely location of a package's bug tracker URL or the mailto URL of the support email, and then tries to open it using the --browser config param. +If no package name is provided, it will search for a package.json in the current folder and use the name property.

+

Configuration

+

browser

+
    +
  • Default: macOS: "open", Windows: "start", Others: "xdg-open"
  • +
  • Type: null, Boolean, or String
  • +
+

The browser that is called by npm commands to open websites.

+

Set to false to suppress browser behavior and instead print urls to +terminal.

+

Set to true to use default system URL opener.

+

registry

+ +

The base URL of the npm registry.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-cache.html b/node24/node_modules/npm/docs/output/commands/npm-cache.html new file mode 100644 index 0000000000000000000000000000000000000000..2f10dadf39f047c38bf50d6038b7ff77d931a5e6 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-cache.html @@ -0,0 +1,300 @@ + + +npm-cache + + + + + +
+
+

+ npm-cache + @11.12.1 +

+Manipulates packages cache +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm cache add <package-spec>
+npm cache clean [<key>]
+npm cache ls [<name>@<version>]
+npm cache verify
+npm cache npx ls
+npm cache npx rm [<key>...]
+npm cache npx info <key>...
+
+

Note: This command is unaware of workspaces.

+

Description

+

Used to add, list, or clean the npm cache folder. +Also used to view info about entries in the npm exec (aka npx) cache folder.

+

npm cache

+
    +
  • +

    add: +Add the specified packages to the local cache. +This command is primarily intended to be used internally by npm, but it can provide a way to add data to the local installation cache explicitly.

    +
  • +
  • +

    clean: +Delete a single entry or all entries out of the cache folder. +Note that this is typically unnecessary, as npm's cache is self-healing and resistant to data corruption issues.

    +
  • +
  • +

    ls: +List given entries or all entries in the local cache.

    +
  • +
  • +

    verify: +Verify the contents of the cache folder, garbage collecting any unneeded data, and verifying the integrity of the cache index and all cached data.

    +
  • +
+

npm cache npx

+
    +
  • +

    ls: +List all entries in the npx cache.

    +
  • +
  • +

    rm: +Remove given entries or all entries from the npx cache.

    +
  • +
  • +

    info: +Get detailed information about given entries in the npx cache.

    +
  • +
+

Details

+

npm stores cache data in an opaque directory within the configured cache, named _cacache. +This directory is a cacache-based content-addressable cache that stores all http request data as well as other package-related data. +This directory is primarily accessed through pacote, the library responsible for all package fetching as of npm@5.

+

All data that passes through the cache is fully verified for integrity on both insertion and extraction. +Cache corruption will either trigger an error, or signal to pacote that the data must be refetched, which it will do automatically. +For this reason, it should never be necessary to clear the cache for any reason other than reclaiming disk space, thus why clean now requires --force to run.

+

There is currently no method exposed through npm to inspect or directly manage the contents of this cache. +In order to access it, cacache must be used directly.

+

npm will not remove data by itself: the cache will grow as new packages are installed.

+

A note about the cache's design

+

The npm cache is strictly a cache: it should not be relied upon as a persistent and reliable data store for package data. +npm makes no guarantee that a previously-cached piece of data will be available later, and will automatically delete corrupted contents. +The primary guarantee that the cache makes is that, if it does return data, that data will be exactly the data that was inserted.

+

To run an offline verification of existing cache contents, use npm cache verify.

+

Configuration

+

cache

+
    +
  • Default: Windows: %LocalAppData%\npm-cache, Posix: ~/.npm
  • +
  • Type: Path
  • +
+

The location of npm's cache directory.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-ci.html b/node24/node_modules/npm/docs/output/commands/npm-ci.html new file mode 100644 index 0000000000000000000000000000000000000000..ec5e18cfaa3cb4231dcb9bc7a67021e3d0d248d4 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-ci.html @@ -0,0 +1,458 @@ + + +npm-ci + + + + + +
+
+

+ npm-ci + @11.12.1 +

+Clean install a project +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm ci
+
+aliases: clean-install, ic, install-clean, isntall-clean
+
+

Description

+

This command is similar to npm install, except it's meant to be used in automated environments such as test platforms, continuous integration, and deployment -- or any situation where you want to make sure you're doing a clean install of your dependencies.

+

The main differences between using npm install and npm ci are:

+
    +
  • The project must have an existing package-lock.json or +npm-shrinkwrap.json.
  • +
  • If dependencies in the package lock do not match those in package.json, +npm ci will exit with an error, instead of updating the package lock.
  • +
  • npm ci can only install entire projects at a time: individual dependencies cannot be added with this command.
  • +
  • If a node_modules is already present, it will be automatically removed before npm ci begins its install.
  • +
  • It will never write to package.json or any of the package-locks: +installs are essentially frozen.
  • +
+

NOTE: If you create your package-lock.json file by running npm install with flags that can affect the shape of your dependency tree, such as +--legacy-peer-deps or --install-links, you must provide the same flags to npm ci or you are likely to encounter errors. +An easy way to do this is to run, for example, +npm config set legacy-peer-deps=true --location=project and commit the +.npmrc file to your repo.

+

Example

+

Make sure you have a package-lock and an up-to-date install:

+
$ cd ./my/npm/project
+$ npm install
+added 154 packages in 10s
+$ ls | grep package-lock
+
+

Run npm ci in that project

+
$ npm ci
+added 154 packages in 5s
+
+

Configure Travis CI to build using npm ci instead of npm install:

+
# .travis.yml
+install:
+- npm ci
+# keep the npm cache around to speed up installs
+cache:
+  directories:
+  - "$HOME/.npm"
+
+

Configuration

+

install-strategy

+
    +
  • Default: "hoisted"
  • +
  • Type: "hoisted", "nested", "shallow", or "linked"
  • +
+

Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (experimental) install in node_modules/.store, +link in place, unhoisted.

+

legacy-bundling

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: This option has been deprecated in favor of +--install-strategy=nested
  • +
+

Instead of hoisting package installs in node_modules, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets --install-strategy=nested.

+

global-style

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: This option has been deprecated in favor of +--install-strategy=shallow
  • +
+

Only install direct dependencies in the top level node_modules, but hoist +on deeper dependencies. Sets --install-strategy=shallow.

+

omit

+
    +
  • Default: 'dev' if the NODE_ENV environment variable is set to +'production'; otherwise, empty.
  • +
  • Type: "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Dependency types to omit from the installation tree on disk.

+

Note that these dependencies are still resolved and added to the +package-lock.json or npm-shrinkwrap.json file. They are just not +physically installed on disk.

+

If a package type appears in both the --include and --omit lists, then +it will be included.

+

If the resulting omit list includes 'dev', then the NODE_ENV environment +variable will be set to 'production' for all lifecycle scripts.

+

include

+
    +
  • Default:
  • +
  • Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Option that allows for defining which types of dependencies to install.

+

This is the inverse of --omit=<type>.

+

Dependency types specified in --include will not be omitted, regardless of +the order in which omit/include are specified on the command-line.

+

strict-peer-deps

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, and --legacy-peer-deps is not set, then any +conflicting peerDependencies will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships.

+

By default, conflicting peerDependencies deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's peerDependencies object.

+

When such an override is performed, a warning is printed, explaining the +conflict and the packages involved. If --strict-peer-deps is set, then +this warning is treated as a failure.

+

foreground-scripts

+
    +
  • Default: false unless when using npm pack or npm publish where it +defaults to true
  • +
  • Type: Boolean
  • +
+

Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

+

Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging.

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

allow-git

+
    +
  • Default: "all"
  • +
  • Type: "all", "none", or "root"
  • +
+

Limits the ability for npm to fetch dependencies from git references. That +is, dependencies that point to a git repo instead of a version or semver +range. Please note that this could leave your tree incomplete and some +packages may not function as intended or designed.

+

all allows any git dependencies to be fetched and installed. none +prevents any git dependencies from being fetched and installed. root only +allows git dependencies defined in your project's package.json to be fetched +installed. Also allows git dependencies to be fetched for other commands +like npm view

+

audit

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When "true" submit audit reports alongside the current npm command to the +default registry and all registries configured for scopes. See the +documentation for npm audit for details on what is +submitted.

+ +
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Tells npm to create symlinks (or .cmd shims on Windows) for package +executables.

+

Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems.

+

fund

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When "true" displays the message at the end of each npm install +acknowledging the number of dependencies looking for funding. See npm fund for details.

+

dry-run

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, install, update, +dedupe, uninstall, as well as pack and publish.

+

Note: This is NOT honored by other network related commands, eg dist-tags, +owner, etc.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-completion.html b/node24/node_modules/npm/docs/output/commands/npm-completion.html new file mode 100644 index 0000000000000000000000000000000000000000..377368e32c812a8e621507623d15f38f5c02c2c7 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-completion.html @@ -0,0 +1,234 @@ + + +npm-completion + + + + + +
+
+

+ npm-completion + @11.12.1 +

+Tab Completion for npm +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm completion
+
+

Note: This command is unaware of workspaces.

+

Description

+

Enables tab-completion in all npm commands.

+

The synopsis above loads the completions into your current shell. +Adding it to your ~/.bashrc or ~/.zshrc will make the completions available everywhere:

+
npm completion >> ~/.bashrc
+npm completion >> ~/.zshrc
+
+

You may of course also pipe the output of npm completion to a file such as /usr/local/etc/bash_completion.d/npm or +/etc/bash_completion.d/npm if you have a system that will read +that file for you.

+

When COMP_CWORD, COMP_LINE, and COMP_POINT are defined in the environment, npm completion acts in "plumbing mode", and outputs completions based on the arguments.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-config.html b/node24/node_modules/npm/docs/output/commands/npm-config.html new file mode 100644 index 0000000000000000000000000000000000000000..509868c922bb2cc5d061734769e72e3acaf73598 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-config.html @@ -0,0 +1,331 @@ + + +npm-config + + + + + +
+
+

+ npm-config + @11.12.1 +

+Manage the npm configuration files +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm config set <key>=<value> [<key>=<value> ...]
+npm config get [<key> [<key> ...]]
+npm config delete <key> [<key> ...]
+npm config list [--json]
+npm config edit
+npm config fix
+
+alias: c
+
+

Note: This command is unaware of workspaces.

+

Description

+

npm gets its config settings from the command line, environment variables, npmrc files, and in some cases, the package.json file.

+

See npmrc for more information about the npmrc files.

+

See config for a more thorough explanation of the mechanisms involved, and a full list of config options available.

+

The npm config command can be used to update and edit the contents of the user and global npmrc files.

+

Sub-commands

+

Config supports the following sub-commands:

+

set

+
npm config set key=value [key=value...]
+npm set key=value [key=value...]
+
+

Sets each of the config keys to the value provided. +Modifies the user configuration file unless location is passed.

+

If value is omitted, the key will be removed from your config file entirely.

+

Note: for backwards compatibility, npm config set key value is supported as an alias for npm config set key=value.

+

get

+
npm config get [key ...]
+npm get [key ...]
+
+

Echo the config value(s) to stdout.

+

If multiple keys are provided, then the values will be prefixed with the key names.

+

If no keys are provided, then this command behaves the same as npm config list.

+

list

+
npm config list
+
+

Show all the config settings. +Use -l to also show defaults. +Use --json to show the settings in json format.

+

delete

+
npm config delete key [key ...]
+
+

Deletes the specified keys from all configuration files.

+

edit

+
npm config edit
+
+

Opens the config file in an editor. +Use the --global flag to edit the global config.

+

fix

+
npm config fix
+
+

Attempts to repair invalid configuration items. +Usually this means attaching authentication config (i.e. +_auth, _authToken) to the configured registry.

+

Configuration

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Operates in "global" mode, so that packages are installed into the prefix +folder instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

editor

+
    +
  • Default: The EDITOR or VISUAL environment variables, or +'%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems
  • +
  • Type: String
  • +
+

The command to run for npm edit and npm config edit.

+

location

+
    +
  • Default: "user" unless --global is passed, which will also set this value +to "global"
  • +
  • Type: "global", "user", or "project"
  • +
+

When passed to npm config this refers to which config file to use.

+

When set to "global" mode, packages are installed into the prefix folder +instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

long

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Show extended information in ls, search, and help-search.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-dedupe.html b/node24/node_modules/npm/docs/output/commands/npm-dedupe.html new file mode 100644 index 0000000000000000000000000000000000000000..f84a72117a756a4b112c3c45926e683e0c0ce31d --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-dedupe.html @@ -0,0 +1,450 @@ + + +npm-dedupe + + + + + +
+
+

+ npm-dedupe + @11.12.1 +

+Reduce duplication in the package tree +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm dedupe
+
+alias: ddp
+
+

Description

+

Searches the local package tree and attempts to simplify the overall structure by moving dependencies further up the tree, where they can be more effectively shared by multiple dependent packages.

+

For example, consider this dependency graph:

+
a
++-- b <-- depends on c@1.0.x
+|   `-- c@1.0.3
+`-- d <-- depends on c@~1.0.9
+    `-- c@1.0.10
+
+

In this case, npm dedupe will transform the tree to:

+
a
++-- b
++-- d
+`-- c@1.0.10
+
+

Because of the hierarchical nature of node's module lookup, b and d will both get their dependency met by the single c package at the root level of the tree.

+

In some cases, you may have a dependency graph like this:

+
a
++-- b <-- depends on c@1.0.x
++-- c@1.0.3
+`-- d <-- depends on c@1.x
+    `-- c@1.9.9
+
+

During the installation process, the c@1.0.3 dependency for b was placed in the root of the tree. +Though d's dependency on c@1.x could have been satisfied by c@1.0.3, the newer c@1.9.9 dependency was used, because npm favors updates by default, even when doing so causes duplication.

+

Running npm dedupe will cause npm to note the duplication and re-evaluate, deleting the nested c module, because the one in the root is sufficient.

+

To prefer deduplication over novelty during the installation process, run npm install --prefer-dedupe or npm config set prefer-dedupe true.

+

Arguments are ignored. +Dedupe always acts on the entire tree.

+

Note that this operation transforms the dependency tree, but will never result in new modules being installed.

+

Using npm find-dupes will run the command in --dry-run mode.

+

Note: npm dedupe will never update the semver values of direct dependencies in your project package.json, if you want to update values in package.json you can run: npm update --save instead.

+

Configuration

+

install-strategy

+
    +
  • Default: "hoisted"
  • +
  • Type: "hoisted", "nested", "shallow", or "linked"
  • +
+

Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (experimental) install in node_modules/.store, +link in place, unhoisted.

+

legacy-bundling

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: This option has been deprecated in favor of +--install-strategy=nested
  • +
+

Instead of hoisting package installs in node_modules, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets --install-strategy=nested.

+

global-style

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: This option has been deprecated in favor of +--install-strategy=shallow
  • +
+

Only install direct dependencies in the top level node_modules, but hoist +on deeper dependencies. Sets --install-strategy=shallow.

+

strict-peer-deps

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, and --legacy-peer-deps is not set, then any +conflicting peerDependencies will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships.

+

By default, conflicting peerDependencies deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's peerDependencies object.

+

When such an override is performed, a warning is printed, explaining the +conflict and the packages involved. If --strict-peer-deps is set, then +this warning is treated as a failure.

+

package-lock

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

If set to false, then ignore package-lock.json files when installing. This +will also prevent writing package-lock.json if save is true.

+

omit

+
    +
  • Default: 'dev' if the NODE_ENV environment variable is set to +'production'; otherwise, empty.
  • +
  • Type: "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Dependency types to omit from the installation tree on disk.

+

Note that these dependencies are still resolved and added to the +package-lock.json or npm-shrinkwrap.json file. They are just not +physically installed on disk.

+

If a package type appears in both the --include and --omit lists, then +it will be included.

+

If the resulting omit list includes 'dev', then the NODE_ENV environment +variable will be set to 'production' for all lifecycle scripts.

+

include

+
    +
  • Default:
  • +
  • Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Option that allows for defining which types of dependencies to install.

+

This is the inverse of --omit=<type>.

+

Dependency types specified in --include will not be omitted, regardless of +the order in which omit/include are specified on the command-line.

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

allow-git

+
    +
  • Default: "all"
  • +
  • Type: "all", "none", or "root"
  • +
+

Limits the ability for npm to fetch dependencies from git references. That +is, dependencies that point to a git repo instead of a version or semver +range. Please note that this could leave your tree incomplete and some +packages may not function as intended or designed.

+

all allows any git dependencies to be fetched and installed. none +prevents any git dependencies from being fetched and installed. root only +allows git dependencies defined in your project's package.json to be fetched +installed. Also allows git dependencies to be fetched for other commands +like npm view

+

audit

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When "true" submit audit reports alongside the current npm command to the +default registry and all registries configured for scopes. See the +documentation for npm audit for details on what is +submitted.

+ +
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Tells npm to create symlinks (or .cmd shims on Windows) for package +executables.

+

Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems.

+

fund

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When "true" displays the message at the end of each npm install +acknowledging the number of dependencies looking for funding. See npm fund for details.

+

dry-run

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, install, update, +dedupe, uninstall, as well as pack and publish.

+

Note: This is NOT honored by other network related commands, eg dist-tags, +owner, etc.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-deprecate.html b/node24/node_modules/npm/docs/output/commands/npm-deprecate.html new file mode 100644 index 0000000000000000000000000000000000000000..231dde092cfe7229380a8178f18a134e6bb740ac --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-deprecate.html @@ -0,0 +1,267 @@ + + +npm-deprecate + + + + + +
+
+

+ npm-deprecate + @11.12.1 +

+Deprecate a version of a package +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm deprecate <package-spec> <message>
+
+

Note: This command is unaware of workspaces.

+

Description

+

This command will update the npm registry entry for a package, providing a deprecation warning to all who attempt to install it.

+

It works on version ranges as well as specific versions, so you can do something like this:

+
npm deprecate my-thing@"< 0.2.3" "critical bug fixed in v0.2.3"
+
+

SemVer ranges passed to this command are interpreted such that they do include prerelease versions. +For example:

+
npm deprecate my-thing@1.x "1.x is no longer supported"
+
+

In this case, a version my-thing@1.0.0-beta.0 will also be deprecated.

+

You must be the package owner to deprecate something. +See the owner and adduser help topics.

+

To un-deprecate a package, specify an empty string ("") for the message argument. +Note that you must use double quotes with no space between them to format an empty string.

+

Configuration

+

registry

+ +

The base URL of the npm registry.

+

otp

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with npm access.

+

If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one.

+

dry-run

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, install, update, +dedupe, uninstall, as well as pack and publish.

+

Note: This is NOT honored by other network related commands, eg dist-tags, +owner, etc.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-diff.html b/node24/node_modules/npm/docs/output/commands/npm-diff.html new file mode 100644 index 0000000000000000000000000000000000000000..efac19a6fb69db93b8201995f402d63166554774 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-diff.html @@ -0,0 +1,415 @@ + + +npm-diff + + + + + +
+
+

+ npm-diff + @11.12.1 +

+The registry diff command +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm diff [...<paths>]
+
+

Description

+

Similar to its git diff counterpart, this command will print diff patches of files for packages published to the npm registry.

+
    +
  • +

    npm diff --diff=<spec-a> --diff=<spec-b>

    +

    Compares two package versions using their registry specifiers, e.g: npm diff --diff=pkg@1.0.0 --diff=pkg@^2.0.0. +It's also possible to compare across forks of any package, e.g: npm diff --diff=pkg@1.0.0 --diff=pkg-fork@1.0.0.

    +

    Any valid spec can be used, so that it's also possible to compare directories or git repositories, e.g: npm diff --diff=pkg@latest --diff=./packages/pkg

    +

    Here's an example comparing two different versions of a package named abbrev from the registry:

    +
    npm diff --diff=abbrev@1.1.0 --diff=abbrev@1.1.1
    +
    +

    On success, output looks like:

    +
    diff --git a/package.json b/package.json
    +index v1.1.0..v1.1.1 100644
    +--- a/package.json
    ++++ b/package.json
    +@@ -1,6 +1,6 @@
    + {
    +   "name": "abbrev",
    +-  "version": "1.1.0",
    ++  "version": "1.1.1",
    +   "description": "Like ruby's abbrev module, but in js",
    +   "author": "Isaac Z. Schlueter <i@izs.me>",
    +   "main": "abbrev.js",
    +
    +

    Given the flexible nature of npm specs, you can also target local directories or git repos just like when using npm install:

    +
    npm diff --diff=https://github.com/npm/libnpmdiff --diff=./local-path
    +
    +

    In the example above we can compare the contents from the package installed from the git repo at github.com/npm/libnpmdiff with the contents of the ./local-path that contains a valid package, such as a modified copy of the original.

    +
  • +
  • +

    npm diff (in a package directory, no arguments):

    +

    If the package is published to the registry, npm diff will fetch the tarball version tagged as latest (this value can be configured using the tag option) and proceed to compare the contents of files present in that tarball, with the current files in your local file system.

    +

    This workflow provides a handy way for package authors to see what package-tracked files have been changed in comparison with the latest published version of that package.

    +
  • +
  • +

    npm diff --diff=<pkg-name> (in a package directory):

    +

    When using a single package name (with no version or tag specifier) as an argument, npm diff will work in a similar way to npm-outdated and reach for the registry to figure out what current published version of the package named <pkg-name> will satisfy its dependent declared semver-range. +Once that specific version is known npm diff will print diff patches comparing the current version of <pkg-name> found in the local file system with that specific version returned by the registry.

    +

    Given a package named abbrev that is currently installed:

    +
    npm diff --diff=abbrev
    +
    +

    That will request from the registry its most up to date version and will print a diff output comparing the currently installed version to this newer one if the version numbers are not the same.

    +
  • +
  • +

    npm diff --diff=<spec-a> (in a package directory):

    +

    Similar to using only a single package name, it's also possible to declare a full registry specifier version if you wish to compare the local version of an installed package with the specific version/tag/semver-range provided in <spec-a>.

    +

    An example: assuming pkg@1.0.0 is installed in the current node_modules folder, running:

    +
    npm diff --diff=pkg@2.0.0
    +
    +

    It will effectively be an alias to +npm diff --diff=pkg@1.0.0 --diff=pkg@2.0.0.

    +
  • +
  • +

    npm diff --diff=<semver-a> [--diff=<semver-b>] (in a package directory):

    +

    Using npm diff along with semver-valid version numbers is a shorthand to compare different versions of the current package.

    +

    It needs to be run from a package directory, such that for a package named pkg running npm diff --diff=1.0.0 --diff=1.0.1 is the same as running npm diff --diff=pkg@1.0.0 --diff=pkg@1.0.1.

    +

    If only a single argument <version-a> is provided, then the current local file system is going to be compared against that version.

    +

    Here's an example comparing two specific versions (published to the configured registry) of the current project directory:

    +
    npm diff --diff=1.0.0 --diff=1.1.0
    +
    +
  • +
+

Note that tag names are not valid --diff argument values, if you wish to compare to a published tag, you must use the pkg@tagname syntax.

+

Filtering files

+

It's possible to also specify positional arguments using file names or globs pattern matching in order to limit the result of diff patches to only a subset of files for a given package, e.g:

+
npm diff --diff=pkg@2 ./lib/ CHANGELOG.md
+
+

In the example above the diff output is only going to print contents of files located within the folder ./lib/ and changed lines of code within the CHANGELOG.md file.

+

Configuration

+

diff

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Define arguments to compare in npm diff.

+

diff-name-only

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Prints only filenames when using npm diff.

+

diff-unified

+
    +
  • Default: 3
  • +
  • Type: Number
  • +
+

The number of lines of context to print in npm diff.

+

diff-ignore-all-space

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Ignore whitespace when comparing lines in npm diff.

+

diff-no-prefix

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Do not show any source or destination prefix in npm diff output.

+

Note: this causes npm diff to ignore the --diff-src-prefix and +--diff-dst-prefix configs.

+

diff-src-prefix

+
    +
  • Default: "a/"
  • +
  • Type: String
  • +
+

Source prefix to be used in npm diff output.

+

diff-dst-prefix

+
    +
  • Default: "b/"
  • +
  • Type: String
  • +
+

Destination prefix to be used in npm diff output.

+

diff-text

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Treat all files as text in npm diff.

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Operates in "global" mode, so that packages are installed into the prefix +folder instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

tag

+
    +
  • Default: "latest"
  • +
  • Type: String
  • +
+

If you ask npm to install a package and don't tell it a specific version, +then it will install the specified tag.

+

It is the tag added to the package@version specified in the npm dist-tag add command, if no explicit tag is given.

+

When used by the npm diff command, this is the tag used to fetch the +tarball that will be compared with the local files by default.

+

If used in the npm publish command, this is the tag that will be added to +the package submitted to the registry.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-dist-tag.html b/node24/node_modules/npm/docs/output/commands/npm-dist-tag.html new file mode 100644 index 0000000000000000000000000000000000000000..13323fa4afa4a9eefaf05dd23e415069903b358e --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-dist-tag.html @@ -0,0 +1,318 @@ + + +npm-dist-tag + + + + + +
+
+

+ npm-dist-tag + @11.12.1 +

+Modify package distribution tags +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm dist-tag add <package-spec (with version)> [<tag>]
+npm dist-tag rm <package-spec> <tag>
+npm dist-tag ls [<package-spec>]
+
+alias: dist-tags
+
+

Description

+

Add, remove, and enumerate distribution tags on a package:

+
    +
  • +

    add: Tags the specified version of the package with the specified tag, or the --tag config if not specified. +If you have two-factor authentication on auth-and-writes then you’ll need to include a one-time password on the command line with --otp <one-time password>, or go through a second factor flow based on your authtype.

    +
  • +
  • +

    rm: Clear a tag that is no longer in use from the package. +If you have two-factor authentication on auth-and-writes then you’ll need to include a one-time password on the command line with --otp <one-time password>, or go through a second factor flow based on your authtype

    +
  • +
  • +

    ls: Show all of the dist-tags for a package, defaulting to the package in the current prefix. +This is the default action if none is specified.

    +
  • +
+

A tag can be used when installing packages as a reference to a version instead of using a specific version number:

+
npm install <name>@<tag>
+
+

When installing dependencies, a preferred tagged version may be specified:

+
npm install --tag <tag>
+
+

(This also applies to any other commands that resolve and install dependencies, such as npm dedupe, npm update, and npm audit fix.)

+

Publishing a package sets the latest tag to the published version unless the --tag option is used. +For example, npm publish --tag=beta.

+

By default, npm install <pkg> (without any @<version> or @<tag> specifier) installs the latest tag.

+

Purpose

+

Tags can be used to provide an alias instead of version numbers.

+

For example, a project might choose to have multiple streams of development and use a different tag for each stream, e.g., stable, beta, dev, +canary.

+

By default, the latest tag is used by npm to identify the current version of a package, and npm install <pkg> (without any @<version> or @<tag> specifier) installs the latest tag. +Typically, projects only use the latest tag for stable release versions, and use other tags for unstable versions such as prereleases.

+

The next tag is used by some projects to identify the upcoming version.

+

Other than latest, no tag has any special significance to npm itself.

+

Caveats

+

This command used to be known as npm tag, which only created new tags, and so had a different syntax.

+

Tags must share a namespace with version numbers, because they are specified in the same slot: npm install <pkg>@<version> vs npm install <pkg>@<tag>.

+

Tags that can be interpreted as valid semver ranges will be rejected. +For example, v1.4 cannot be used as a tag, because it is interpreted by semver as >=1.4.0 <1.5.0. +See https://github.com/npm/npm/issues/6082.

+

The simplest way to avoid semver problems with tags is to use tags that do not begin with a number or the letter v.

+

Configuration

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-docs.html b/node24/node_modules/npm/docs/output/commands/npm-docs.html new file mode 100644 index 0000000000000000000000000000000000000000..972e5c44046c0876c9f49b233986ac1226e3c793 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-docs.html @@ -0,0 +1,293 @@ + + +npm-docs + + + + + +
+
+

+ npm-docs + @11.12.1 +

+Open documentation for a package in a web browser +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm docs [<pkgname> [<pkgname> ...]]
+
+alias: home
+
+

Description

+

This command tries to guess at the likely location of a package's documentation URL, and then tries to open it using the --browser config param. +You can pass multiple package names at once. +If no package name is provided, it will search for a package.json in the current folder and use the name property.

+

Configuration

+

browser

+
    +
  • Default: macOS: "open", Windows: "start", Others: "xdg-open"
  • +
  • Type: null, Boolean, or String
  • +
+

The browser that is called by npm commands to open websites.

+

Set to false to suppress browser behavior and instead print urls to +terminal.

+

Set to true to use default system URL opener.

+

registry

+ +

The base URL of the npm registry.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-doctor.html b/node24/node_modules/npm/docs/output/commands/npm-doctor.html new file mode 100644 index 0000000000000000000000000000000000000000..1340a03f7f1924b590e4b80df14a9dfaeb0e8740 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-doctor.html @@ -0,0 +1,282 @@ + + +npm-doctor + + + + + +
+
+

+ npm-doctor + @11.12.1 +

+Check the health of your npm environment +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm doctor [connection] [registry] [versions] [environment] [permissions] [cache]
+
+

Note: This command is unaware of workspaces.

+

Description

+

npm doctor runs a set of checks to ensure that your npm installation has what it needs to manage your JavaScript packages. +npm is mostly a standalone tool, but it does have some basic requirements that must be met:

+
    +
  • Node.js and git must be executable by npm.
  • +
  • The primary npm registry, registry.npmjs.com, or another service that uses the registry API, is available.
  • +
  • The directories that npm uses, node_modules (both locally and globally), exist and can be written by the current user.
  • +
  • The npm cache exists, and the package tarballs within it aren't corrupt.
  • +
+

Without all of these working properly, npm may not work properly. +Many issues are often attributable to things that are outside npm's code base, so npm doctor confirms that the npm installation is in a good state.

+

Also, in addition to this, there are also very many issue reports due to using old versions of npm. +Since npm is constantly improving, running npm@latest is better than an old version.

+

npm doctor verifies the following items in your environment, and if there are any recommended changes, it will display them. +By default npm runs all of these checks. +You can limit what checks are ran by specifying them as extra arguments.

+

Connecting to the registry

+

By default, npm installs from the primary npm registry, +registry.npmjs.org. +npm doctor hits a special connection testing endpoint within the registry. +This can also be checked with npm ping. +If this check fails, you may be using a proxy that needs to be configured, or may need to talk to your IT staff to get access over HTTPS to registry.npmjs.org.

+

This check is done against whichever registry you've configured (you can see what that is by running npm config get registry), and if you're using a private registry that doesn't support the /whoami endpoint supported by the primary registry, this check may fail.

+

Checking npm version

+

While Node.js may come bundled with a particular version of npm, it's the policy of the CLI team that we recommend all users run npm@latest if they can. +As the CLI is maintained by a small team of contributors, there are only resources for a single line of development, so npm's own long-term support releases typically only receive critical security and regression fixes. +The team believes that the latest tested version of npm is almost always likely to be the most functional and defect-free version of npm.

+

Checking node version

+

For most users, in most circumstances, the best version of Node will be the latest long-term support (LTS) release. +Those of you who want access to new ECMAscript features or bleeding-edge changes to Node's standard library may be running a newer version, and some may be required to run an older version of Node because of enterprise change control policies. +That's OK! +But in general, the npm team recommends that most users run Node.js LTS.

+

Checking configured npm registry

+

You may be installing from private package registries for your project or company. +That's great! Others may be following tutorials or StackOverflow questions in an effort to troubleshoot problems you may be having. +Sometimes, this may entail changing the registry you're pointing at. +This part of npm doctor just lets you, and maybe whoever's helping you with support, know that you're not using the default registry.

+

Checking for git executable in PATH

+

While it's documented in the README, it may not be obvious that npm needs Git installed to do many of the things that it does. +Also, in some cases – especially on Windows – you may have Git set up in such a way that it's not accessible via your PATH so that npm can find it. +This check ensures that Git is available.

+

Permissions checks

+
    +
  • Your cache must be readable and writable by the user running npm.
  • +
  • Global package binaries must be writable by the user running npm.
  • +
  • Your local node_modules path, if you're running npm doctor with a project directory, must be readable and writable by the user running npm.
  • +
+

Validate the checksums of cached packages

+

When an npm package is published, the publishing process generates a checksum that npm uses at install time to verify that the package didn't get corrupted in transit. +npm doctor uses these checksums to validate the package tarballs in your local cache (you can see where that cache is located with npm config get cache). +In the event that there are corrupt packages in your cache, you should probably run npm cache clean -f and reset the cache.

+

Configuration

+

registry

+ +

The base URL of the npm registry.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-edit.html b/node24/node_modules/npm/docs/output/commands/npm-edit.html new file mode 100644 index 0000000000000000000000000000000000000000..3b0d79ebc05bc4b3f1e9ed80e6ede78a84ddbd35 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-edit.html @@ -0,0 +1,238 @@ + + +npm-edit + + + + + +
+
+

+ npm-edit + @11.12.1 +

+Edit an installed package +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm edit <pkg>[/<subpkg>...]
+
+

Note: This command is unaware of workspaces.

+

Description

+

Selects a dependency in the current project and opens the package folder in the default editor (or whatever you've configured as the npm editor config -- see npm-config.)

+

After it has been edited, the package is rebuilt so as to pick up any changes in compiled packages.

+

For instance, you can do npm install connect to install connect into your package, and then npm edit connect to make a few changes to your locally installed copy.

+

Configuration

+

editor

+
    +
  • Default: The EDITOR or VISUAL environment variables, or +'%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems
  • +
  • Type: String
  • +
+

The command to run for npm edit and npm config edit.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-exec.html b/node24/node_modules/npm/docs/output/commands/npm-exec.html new file mode 100644 index 0000000000000000000000000000000000000000..bac3b4b6d99d8174f9f175f19bda7b5ee2870871 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-exec.html @@ -0,0 +1,436 @@ + + +npm-exec + + + + + +
+
+

+ npm-exec + @11.12.1 +

+Run a command from a local or remote npm package +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm exec -- <pkg>[@<version>] [args...]
+npm exec --package=<pkg>[@<version>] -- <cmd> [args...]
+npm exec -c '<cmd> [args...]'
+npm exec --package=foo -c '<cmd> [args...]'
+
+alias: x
+
+

Description

+

This command allows you to run an arbitrary command from an npm package (either one installed locally, or fetched remotely), in a similar context as running it via npm run.

+

Run without positional arguments or --call, this allows you to interactively run commands in the same sort of shell environment that package.json scripts are run. +Interactive mode is not supported in CI environments when standard input is a TTY, to prevent hangs.

+

Whatever packages are specified by the --package option will be provided in the PATH of the executed command, along with any locally installed package executables. +The --package option may be specified multiple times, to execute the supplied command in an environment where all specified packages are available.

+

If any requested packages are not present in the local project dependencies, then a prompt is printed, which can be suppressed by providing either --yes or --no. +When standard input is not a TTY or a CI environment is detected, --yes is assumed. +The requested packages are installed to a folder in the npm cache, which is added to the PATH environment variable in the executed process.

+

Package names provided without a specifier will be matched with whatever version exists in the local project. +Package names with a specifier will only be considered a match if they have the exact same name and version as the local dependency.

+

If no -c or --call option is provided, then the positional arguments are used to generate the command string. +If no --package options are provided, then npm will attempt to determine the executable name from the package specifier provided as the first positional argument according to the following heuristic:

+
    +
  • If the package has a single entry in its bin field in package.json, or if all entries are aliases of the same command, then that command will be used.
  • +
  • If the package has multiple bin entries, and one of them matches the unscoped portion of the name field, then that command will be used.
  • +
  • If this does not result in exactly one option (either because there are no bin entries, or none of them match the name of the package), then npm exec exits with an error.
  • +
+

To run a binary other than the named binary, specify one or more --package options, which will prevent npm from inferring the package from the first command argument.

+

npx vs npm exec

+

When run via the npx binary, all flags and options must be set prior to any positional arguments. +When run via npm exec, a double-hyphen -- flag can be used to suppress npm's parsing of switches and options that should be sent to the executed command.

+

For example:

+
$ npx foo@latest bar --package=@npmcli/foo
+
+

In this case, npm will resolve the foo package name, and run the following command:

+
$ foo bar --package=@npmcli/foo
+
+

Since the --package option comes after the positional arguments, it is treated as an argument to the executed command.

+

In contrast, due to npm's argument parsing logic, running this command is different:

+
$ npm exec foo@latest bar --package=@npmcli/foo
+
+

In this case, npm will parse the --package option first, resolving the @npmcli/foo package. +Then, it will execute the following command in that context:

+
$ foo@latest bar
+
+

The double-hyphen character is recommended to explicitly tell npm to stop parsing command line options and switches. +The following command would thus be equivalent to the npx command above:

+
$ npm exec -- foo@latest bar --package=@npmcli/foo
+
+

Configuration

+

package

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

The package or packages to install for npm exec

+

call

+
    +
  • Default: ""
  • +
  • Type: String
  • +
+

Optional companion option for npm exec, npx that allows for specifying a +custom command to be run along with the installed packages.

+
npm exec --package yo --package generator-node --call "yo node"
+
+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+

Examples

+

Run the version of tap in the local dependencies, with the provided arguments:

+
$ npm exec -- tap --bail test/foo.js
+$ npx tap --bail test/foo.js
+
+

Run a command other than the command whose name matches the package name by specifying a --package option:

+
$ npm exec --package=foo -- bar --bar-argument
+# ~ or ~
+$ npx --package=foo bar --bar-argument
+
+

Run an arbitrary shell script, in the context of the current project:

+
$ npm x -c 'eslint && say "hooray, lint passed"'
+$ npx -c 'eslint && say "hooray, lint passed"'
+
+

Workspaces support

+

You may use the workspace or workspaces configs in order to run an arbitrary command from an npm package (either one installed locally, or fetched remotely) in the context of the specified workspaces. +If no positional argument or --call option is provided, it will open an interactive subshell in the context of each of these configured workspaces one at a time.

+

Given a project with configured workspaces, e.g:

+
.
++-- package.json
+`-- packages
+   +-- a
+   |   `-- package.json
+   +-- b
+   |   `-- package.json
+   `-- c
+       `-- package.json
+
+

Assuming the workspace configuration is properly set up at the root level package.json file. +e.g:

+
{
+    "workspaces": [ "./packages/*" ]
+}
+
+

You can execute an arbitrary command from a package in the context of each of the configured workspaces when using the workspaces config options, in this example we're using eslint to lint any js file found within each workspace folder:

+
npm exec --ws -- eslint ./*.js
+
+

Filtering workspaces

+

It's also possible to execute a command in a single workspace using the workspace config along with a name or directory path:

+
npm exec --workspace=a -- eslint ./*.js
+
+

The workspace config can also be specified multiple times in order to run a specific script in the context of multiple workspaces. +When defining values for the workspace config in the command line, it also possible to use -w as a shorthand, e.g:

+
npm exec -w a -w b -- eslint ./*.js
+
+

This last command will run the eslint command in both ./packages/a and +./packages/b folders.

+

Compatibility with Older npx Versions

+

The npx binary was rewritten in npm v7.0.0, and the standalone npx package deprecated at that time. +npx uses the npm exec command instead of a separate argument parser and install process, with some affordances to maintain backwards compatibility with the arguments it accepted in previous versions.

+

This resulted in some shifts in its functionality:

+
    +
  • Any npm config value may be provided.
  • +
  • To prevent security and user-experience problems from mistyping package +names, npx prompts before installing anything. +Suppress this prompt with the -y or --yes option.
  • +
  • The --no-install option is deprecated, and will be converted to --no.
  • +
  • Shell fallback functionality is removed, as it is not advisable.
  • +
  • The -p argument is a shorthand for --parseable in npm, but shorthand for --package in npx. +This is maintained, but only for the npx executable.
  • +
  • The --ignore-existing option is removed. +Locally installed bins are always present in the executed process PATH.
  • +
  • The --npm option is removed. +npx will always use the npm it ships with.
  • +
  • The --node-arg and -n options are removed.
  • +
  • The --always-spawn option is redundant, and thus removed.
  • +
  • The --shell option is replaced with --script-shell, but maintained in the npx executable for backwards compatibility.
  • +
+

A note on caching

+

The npm cli utilizes its internal package cache when using the package name specified. +You can use the following to change how and when the cli uses this cache. +See npm cache for more on how the cache works.

+

prefer-online

+

Forces staleness checks for packages, making the cli look for updates immediately even if the package is already in the cache.

+

prefer-offline

+

Bypasses staleness checks for packages. +Missing data will still be requested from the server. +To force full offline mode, use offline.

+

offline

+

Forces full offline mode. +Any packages not locally cached will result in an error.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result to selecting all of the nested workspaces)
  • +
+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Alias: --ws
  • +
  • Type: Boolean
  • +
  • Default: false
  • +
+

Run scripts in the context of all configured workspaces for the current project.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-explain.html b/node24/node_modules/npm/docs/output/commands/npm-explain.html new file mode 100644 index 0000000000000000000000000000000000000000..0d5b9359df908ec1826971fc963d4663f1eed239 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-explain.html @@ -0,0 +1,291 @@ + + +npm-explain + + + + + +
+
+

+ npm-explain + @11.12.1 +

+Explain installed packages +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm explain <package-spec>
+
+alias: why
+
+

Description

+

This command will print the chain of dependencies causing a given package to be installed in the current project.

+

If one or more package specs are provided, then only packages matching one of the specifiers will have their relationships explained.

+

The package spec can also refer to a folder within ./node_modules

+

For example, running npm explain glob within npm's source tree will show:

+
glob@7.1.6
+node_modules/glob
+  glob@"^7.1.4" from the root project
+
+glob@7.1.1 dev
+node_modules/tacks/node_modules/glob
+  glob@"^7.0.5" from rimraf@2.6.2
+  node_modules/tacks/node_modules/rimraf
+    rimraf@"^2.6.2" from tacks@1.3.0
+    node_modules/tacks
+      dev tacks@"^1.3.0" from the root project
+
+

To explain just the package residing at a specific folder, pass that as the argument to the command. +This can be useful when trying to figure out exactly why a given dependency is being duplicated to satisfy conflicting version requirements within the project.

+
$ npm explain node_modules/nyc/node_modules/find-up
+find-up@3.0.0 dev
+node_modules/nyc/node_modules/find-up
+  find-up@"^3.0.0" from nyc@14.1.1
+  node_modules/nyc
+    nyc@"^14.1.1" from tap@14.10.8
+    node_modules/tap
+      dev tap@"^14.10.8" from the root project
+
+

Configuration

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-explore.html b/node24/node_modules/npm/docs/output/commands/npm-explore.html new file mode 100644 index 0000000000000000000000000000000000000000..f9fbd89c80009c2824884957ee54c1c52bdb5231 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-explore.html @@ -0,0 +1,240 @@ + + +npm-explore + + + + + +
+
+

+ npm-explore + @11.12.1 +

+Browse an installed package +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm explore <pkg> [ -- <command>]
+
+

Note: This command is unaware of workspaces.

+

Description

+

Spawn a subshell in the directory of the installed package specified.

+

If a command is specified, then it is run in the subshell, which then immediately terminates.

+

This is particularly handy in the case of git submodules in the node_modules folder:

+
npm explore some-dependency -- git pull origin master
+
+

Note that the package is not automatically rebuilt afterwards, so be sure to use npm rebuild <pkg> if you make any changes.

+

Configuration

+

shell

+
    +
  • Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on +Windows
  • +
  • Type: String
  • +
+

The shell to run for the npm explore command.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-find-dupes.html b/node24/node_modules/npm/docs/output/commands/npm-find-dupes.html new file mode 100644 index 0000000000000000000000000000000000000000..a022cef9c0aa7f0088ab779e9d9cba0e0c2ecfea --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-find-dupes.html @@ -0,0 +1,393 @@ + + +npm-find-dupes + + + + + +
+
+

+ npm-find-dupes + @11.12.1 +

+Find duplication in the package tree +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm find-dupes
+
+

Description

+

Runs npm dedupe in --dry-run mode, making npm only output the duplications, without actually changing the package tree.

+

Configuration

+

install-strategy

+
    +
  • Default: "hoisted"
  • +
  • Type: "hoisted", "nested", "shallow", or "linked"
  • +
+

Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (experimental) install in node_modules/.store, +link in place, unhoisted.

+

legacy-bundling

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: This option has been deprecated in favor of +--install-strategy=nested
  • +
+

Instead of hoisting package installs in node_modules, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets --install-strategy=nested.

+

global-style

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: This option has been deprecated in favor of +--install-strategy=shallow
  • +
+

Only install direct dependencies in the top level node_modules, but hoist +on deeper dependencies. Sets --install-strategy=shallow.

+

strict-peer-deps

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, and --legacy-peer-deps is not set, then any +conflicting peerDependencies will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships.

+

By default, conflicting peerDependencies deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's peerDependencies object.

+

When such an override is performed, a warning is printed, explaining the +conflict and the packages involved. If --strict-peer-deps is set, then +this warning is treated as a failure.

+

package-lock

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

If set to false, then ignore package-lock.json files when installing. This +will also prevent writing package-lock.json if save is true.

+

omit

+
    +
  • Default: 'dev' if the NODE_ENV environment variable is set to +'production'; otherwise, empty.
  • +
  • Type: "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Dependency types to omit from the installation tree on disk.

+

Note that these dependencies are still resolved and added to the +package-lock.json or npm-shrinkwrap.json file. They are just not +physically installed on disk.

+

If a package type appears in both the --include and --omit lists, then +it will be included.

+

If the resulting omit list includes 'dev', then the NODE_ENV environment +variable will be set to 'production' for all lifecycle scripts.

+

include

+
    +
  • Default:
  • +
  • Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Option that allows for defining which types of dependencies to install.

+

This is the inverse of --omit=<type>.

+

Dependency types specified in --include will not be omitted, regardless of +the order in which omit/include are specified on the command-line.

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

audit

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When "true" submit audit reports alongside the current npm command to the +default registry and all registries configured for scopes. See the +documentation for npm audit for details on what is +submitted.

+ +
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Tells npm to create symlinks (or .cmd shims on Windows) for package +executables.

+

Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems.

+

fund

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When "true" displays the message at the end of each npm install +acknowledging the number of dependencies looking for funding. See npm fund for details.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-fund.html b/node24/node_modules/npm/docs/output/commands/npm-fund.html new file mode 100644 index 0000000000000000000000000000000000000000..f22de5cd244a6ab062f2cac79bc964b6c1bd908e --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-fund.html @@ -0,0 +1,311 @@ + + +npm-fund + + + + + +
+
+

+ npm-fund + @11.12.1 +

+Retrieve funding information +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm fund [<package-spec>]
+
+

Description

+

This command retrieves information on how to fund the dependencies of a given project. +If no package name is provided, it will list all dependencies that are looking for funding in a tree structure, listing the type of funding and the url to visit. +If a package name is provided then it tries to open its funding url using the --browser config param; if there are multiple funding sources for the package, the user will be instructed to pass the +--which option to disambiguate.

+

The list will avoid duplicated entries and will stack all packages that share the same url as a single entry. +Thus, the list does not have the same shape of the output from npm ls.

+

Example

+

Workspaces support

+

It's possible to filter the results to only include a single workspace and its dependencies using the workspace config option.

+

Example:

+

Here's an example running npm fund in a project with a configured workspace a:

+
$ npm fund
+test-workspaces-fund@1.0.0
++-- https://example.com/a
+| | `-- a@1.0.0
+| `-- https://example.com/maintainer
+|     `-- foo@1.0.0
++-- https://example.com/npmcli-funding
+|   `-- @npmcli/test-funding
+`-- https://example.com/org
+    `-- bar@2.0.0
+
+

And here is an example of the expected result when filtering only by a specific workspace a in the same project:

+
$ npm fund -w a
+test-workspaces-fund@1.0.0
+`-- https://example.com/a
+  | `-- a@1.0.0
+  `-- https://example.com/maintainer
+      `-- foo@2.0.0
+
+

Configuration

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

+

browser

+
    +
  • Default: macOS: "open", Windows: "start", Others: "xdg-open"
  • +
  • Type: null, Boolean, or String
  • +
+

The browser that is called by npm commands to open websites.

+

Set to false to suppress browser behavior and instead print urls to +terminal.

+

Set to true to use default system URL opener.

+

unicode

+
    +
  • Default: false on windows, true on mac/unix systems with a unicode locale, +as defined by the LC_ALL, LC_CTYPE, or LANG environment variables.
  • +
  • Type: Boolean
  • +
+

When set to true, npm uses unicode characters in the tree output. When +false, it uses ascii characters instead of unicode glyphs.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

which

+
    +
  • Default: null
  • +
  • Type: null or Number
  • +
+

If there are multiple funding sources, which 1-indexed source URL to open.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-get.html b/node24/node_modules/npm/docs/output/commands/npm-get.html new file mode 100644 index 0000000000000000000000000000000000000000..d061b7b2f7e04b582f2934a2cc78bd579b69dd90 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-get.html @@ -0,0 +1,231 @@ + + +npm-get + + + + + +
+
+

+ npm-get + @11.12.1 +

+Get a value from the npm configuration +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm get [<key> ...] (See `npm config`)
+
+

Note: This command is unaware of workspaces.

+

Description

+

Get a value from the npm configuration

+

Configuration

+

long

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Show extended information in ls, search, and help-search.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-help-search.html b/node24/node_modules/npm/docs/output/commands/npm-help-search.html new file mode 100644 index 0000000000000000000000000000000000000000..3e9f1cc6ac613cb1652ceb21c4c6d5cc465d1eae --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-help-search.html @@ -0,0 +1,235 @@ + + +npm-help-search + + + + + +
+
+

+ npm-help-search + @11.12.1 +

+Search npm help documentation +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm help-search <text>
+
+

Note: This command is unaware of workspaces.

+

Description

+

This command will search the npm markdown documentation files for the terms provided, and then list the results, sorted by relevance.

+

If only one result is found, then it will show that help topic.

+

If the argument to npm help is not a known help topic, then it will call help-search. +It is rarely if ever necessary to call this command directly.

+

Configuration

+

long

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Show extended information in ls, search, and help-search.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-help.html b/node24/node_modules/npm/docs/output/commands/npm-help.html new file mode 100644 index 0000000000000000000000000000000000000000..730c820721879a03dfd76067f182f63c6153c3de --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-help.html @@ -0,0 +1,241 @@ + + +npm-help + + + + + +
+
+

+ npm-help + @11.12.1 +

+Get help on npm +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm help <term> [<terms..>]
+
+alias: hlep
+
+

Note: This command is unaware of workspaces.

+

Description

+

If supplied a topic, then show the appropriate documentation page.

+

If the topic does not exist, or if multiple terms are provided, then npm will run the help-search command to find a match. +Note that, if help-search finds a single subject, then it will run help on that topic, so unique matches are equivalent to specifying a topic name.

+

Configuration

+

viewer

+
    +
  • Default: "man" on Posix, "browser" on Windows
  • +
  • Type: String
  • +
+

The program to use to view help content.

+

Set to "browser" to view html help content in the default web browser.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-init.html b/node24/node_modules/npm/docs/output/commands/npm-init.html new file mode 100644 index 0000000000000000000000000000000000000000..042d1297b82d03ac83777d52c22995c5ea5a17a1 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-init.html @@ -0,0 +1,467 @@ + + +npm-init + + + + + +
+
+

+ npm-init + @11.12.1 +

+Create a package.json file +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm init <package-spec> (same as `npx create-<package-spec>`)
+npm init <@scope> (same as `npx <@scope>/create`)
+
+aliases: create, innit
+
+

Description

+

npm init <initializer> can be used to set up a new or existing npm package.

+

initializer in this case is an npm package named create-<initializer>, +which will be installed by npm-exec, and then have its main bin executed -- presumably creating or updating package.json and running any other initialization-related operations.

+

The init command is transformed to a corresponding npm exec operation as follows:

+
    +
  • npm init foo -> npm exec create-foo
  • +
  • npm init @usr/foo -> npm exec @usr/create-foo
  • +
  • npm init @usr -> npm exec @usr/create
  • +
  • npm init @usr@2.0.0 -> npm exec @usr/create@2.0.0
  • +
  • npm init @usr/foo@2.0.0 -> npm exec @usr/create-foo@2.0.0
  • +
+

If the initializer is omitted (by just calling npm init), init will fall back to legacy init behavior. +It will ask you a bunch of questions, and then write a package.json for you. +It will attempt to make reasonable guesses based on existing fields, dependencies, and options selected. +It is strictly additive, so it will keep any fields and values that were already set. +You can also use -y/--yes to skip the questionnaire altogether. +If you pass --scope, it will create a scoped package.

+

Note: if a user already has the create-<initializer> package globally installed, that will be what npm init uses. +If you want npm to use the latest version, or another specific version you must specify it:

+
    +
  • npm init foo@latest # fetches and runs the latest create-foo from the registry
  • +
  • npm init foo@1.2.3 # runs create-foo@1.2.3 specifically
  • +
+

Forwarding additional options

+

Any additional options will be passed directly to the command, so npm init foo -- --hello will map to npm exec -- create-foo --hello.

+

To better illustrate how options are forwarded, here's a more evolved example showing options passed to both the npm cli and a create package, both following commands are equivalent:

+
    +
  • npm init foo -y --registry=<url> -- --hello -a
  • +
  • npm exec -y --registry=<url> -- create-foo --hello -a
  • +
+

Examples

+

Create a new React-based project using create-react-app:

+
$ npm init react-app ./my-react-app
+
+

Create a new esm-compatible package using create-esm:

+
$ mkdir my-esm-lib && cd my-esm-lib
+$ npm init esm --yes
+
+

Generate a plain old package.json using legacy init:

+
$ mkdir my-npm-pkg && cd my-npm-pkg
+$ git init
+$ npm init
+
+

Generate it without having it ask any questions:

+
$ npm init -y
+
+

Set the private flag to true in package.json:

+
$ npm init --init-private -y
+
+

Workspaces support

+

It's possible to create a new workspace within your project by using the workspace config option. +When using npm init -w <dir> the cli will create the folders and boilerplate expected while also adding a reference to your project package.json "workspaces": [] property in order to make sure that new generated workspace is properly set up as such.

+

Given a project with no workspaces, e.g:

+
.
++-- package.json
+
+

You may generate a new workspace using the legacy init:

+
$ npm init -w packages/a
+
+

That will generate a new folder and package.json file, while also updating your top-level package.json to add the reference to this new workspace:

+
.
++-- package.json
+`-- packages
+   `-- a
+       `-- package.json
+
+

The workspaces init also supports the npm init <initializer> -w <dir> syntax, following the same set of rules explained earlier in the initial +Description section of this page. +Similar to the previous example of creating a new React-based project using create-react-app, the following syntax will make sure to create the new react app as a nested workspace within your project and configure your package.json to recognize it as such:

+
npm init -w packages/my-react-app react-app .
+
+

This will make sure to generate your react app as expected, one important consideration to have in mind is that npm exec is going to be run in the context of the newly created folder for that workspace, and that's the reason why in this example the initializer uses the initializer name followed with a dot to represent the current directory in that context, e.g: react-app .:

+
.
++-- package.json
+`-- packages
+   +-- a
+   |   `-- package.json
+   `-- my-react-app
+       +-- README
+       +-- package.json
+       `-- ...
+
+

Configuration

+

init-author-name

+
    +
  • Default: ""
  • +
  • Type: String
  • +
+

The value npm init should use by default for the package author's name.

+

init-author-url

+
    +
  • Default: ""
  • +
  • Type: "" or URL
  • +
+

The value npm init should use by default for the package author's +homepage.

+

init-license

+
    +
  • Default: "ISC"
  • +
  • Type: String
  • +
+

The value npm init should use by default for the package license.

+

init-module

+
    +
  • Default: "~/.npm-init.js"
  • +
  • Type: Path
  • +
+

A module that will be loaded by the npm init command. See the +documentation for the +init-package-json module for +more information, or npm init.

+

init-type

+
    +
  • Default: "commonjs"
  • +
  • Type: String
  • +
+

The value that npm init should use by default for the package.json type +field.

+

init-version

+
    +
  • Default: "1.0.0"
  • +
  • Type: SemVer string
  • +
+

The value that npm init should use by default for the package version +number, if not already set in package.json.

+

init-private

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

The value npm init should use by default for the package's private flag.

+

yes

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Automatically answer "yes" to any prompts that npm might print on the +command line.

+

force

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Removes various protections against unfortunate side effects, common +mistakes, unnecessary performance degradation, and malicious input.

+
    +
  • Allow clobbering non-npm files in global installs.
  • +
  • Allow the npm version command to work on an unclean git repository.
  • +
  • Allow deleting the cache folder with npm cache clean.
  • +
  • Allow installing packages that have an engines declaration requiring a +different version of npm.
  • +
  • Allow installing packages that have an engines declaration requiring a +different version of node, even if --engine-strict is enabled.
  • +
  • Allow npm audit fix to install modules outside your stated dependency +range (including SemVer-major changes).
  • +
  • Allow unpublishing all versions of a published package.
  • +
  • Allow conflicting peerDependencies to be installed in the root project.
  • +
  • Implicitly set --yes during npm init.
  • +
  • Allow clobbering existing values in npm pkg
  • +
  • Allow unpublishing of entire packages (not just a single version).
  • +
+

If you don't have a clear idea of what you want to do, it is strongly +recommended that you do not use this option!

+

scope

+
    +
  • Default: the scope of the current project, if any, or ""
  • +
  • Type: String
  • +
+

Associate an operation with a scope for a scoped registry.

+

Useful when logging in to or out of a private registry:

+
# log in, linking the scope to the custom registry
+npm login --scope=@mycorp --registry=https://registry.mycorp.com
+
+# log out, removing the link and the auth token
+npm logout --scope=@mycorp
+
+

This will cause @mycorp to be mapped to the registry for future +installation of packages specified according to the pattern +@mycorp/package.

+

This will also cause npm init to create a scoped package.

+
# accept all defaults, and create a package named "@foo/whatever",
+# instead of just named "whatever"
+npm init --scope=@foo --yes
+
+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

workspaces-update

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

If set to true, the npm cli will run an update after operations that may +possibly change the workspaces installed to the node_modules folder.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-install-ci-test.html b/node24/node_modules/npm/docs/output/commands/npm-install-ci-test.html new file mode 100644 index 0000000000000000000000000000000000000000..5968050a00e6fe391c83595f53c15a660bb88780 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-install-ci-test.html @@ -0,0 +1,423 @@ + + +npm-install-ci-test + + + + + +
+
+

+ npm-install-ci-test + @11.12.1 +

+Install a project with a clean slate and run tests +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm install-ci-test
+
+aliases: cit, clean-install-test, sit
+
+

Description

+

This command runs npm ci followed immediately by npm test.

+

Configuration

+

install-strategy

+
    +
  • Default: "hoisted"
  • +
  • Type: "hoisted", "nested", "shallow", or "linked"
  • +
+

Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (experimental) install in node_modules/.store, +link in place, unhoisted.

+

legacy-bundling

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: This option has been deprecated in favor of +--install-strategy=nested
  • +
+

Instead of hoisting package installs in node_modules, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets --install-strategy=nested.

+

global-style

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: This option has been deprecated in favor of +--install-strategy=shallow
  • +
+

Only install direct dependencies in the top level node_modules, but hoist +on deeper dependencies. Sets --install-strategy=shallow.

+

omit

+
    +
  • Default: 'dev' if the NODE_ENV environment variable is set to +'production'; otherwise, empty.
  • +
  • Type: "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Dependency types to omit from the installation tree on disk.

+

Note that these dependencies are still resolved and added to the +package-lock.json or npm-shrinkwrap.json file. They are just not +physically installed on disk.

+

If a package type appears in both the --include and --omit lists, then +it will be included.

+

If the resulting omit list includes 'dev', then the NODE_ENV environment +variable will be set to 'production' for all lifecycle scripts.

+

include

+
    +
  • Default:
  • +
  • Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Option that allows for defining which types of dependencies to install.

+

This is the inverse of --omit=<type>.

+

Dependency types specified in --include will not be omitted, regardless of +the order in which omit/include are specified on the command-line.

+

strict-peer-deps

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, and --legacy-peer-deps is not set, then any +conflicting peerDependencies will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships.

+

By default, conflicting peerDependencies deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's peerDependencies object.

+

When such an override is performed, a warning is printed, explaining the +conflict and the packages involved. If --strict-peer-deps is set, then +this warning is treated as a failure.

+

foreground-scripts

+
    +
  • Default: false unless when using npm pack or npm publish where it +defaults to true
  • +
  • Type: Boolean
  • +
+

Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

+

Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging.

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

allow-git

+
    +
  • Default: "all"
  • +
  • Type: "all", "none", or "root"
  • +
+

Limits the ability for npm to fetch dependencies from git references. That +is, dependencies that point to a git repo instead of a version or semver +range. Please note that this could leave your tree incomplete and some +packages may not function as intended or designed.

+

all allows any git dependencies to be fetched and installed. none +prevents any git dependencies from being fetched and installed. root only +allows git dependencies defined in your project's package.json to be fetched +installed. Also allows git dependencies to be fetched for other commands +like npm view

+

audit

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When "true" submit audit reports alongside the current npm command to the +default registry and all registries configured for scopes. See the +documentation for npm audit for details on what is +submitted.

+ +
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Tells npm to create symlinks (or .cmd shims on Windows) for package +executables.

+

Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems.

+

fund

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When "true" displays the message at the end of each npm install +acknowledging the number of dependencies looking for funding. See npm fund for details.

+

dry-run

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, install, update, +dedupe, uninstall, as well as pack and publish.

+

Note: This is NOT honored by other network related commands, eg dist-tags, +owner, etc.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-install-test.html b/node24/node_modules/npm/docs/output/commands/npm-install-test.html new file mode 100644 index 0000000000000000000000000000000000000000..ea03521d59e451b29cc66a779d691e163e7e1461 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-install-test.html @@ -0,0 +1,527 @@ + + +npm-install-test + + + + + +
+
+

+ npm-install-test + @11.12.1 +

+Install package(s) and run tests +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm install-test [<package-spec> ...]
+
+alias: it
+
+

Description

+

This command runs an npm install followed immediately by an npm test. +It takes exactly the same arguments as npm install.

+

Configuration

+

save

+
    +
  • Default: true unless when using npm update where it defaults to false
  • +
  • Type: Boolean
  • +
+

Save installed packages to a package.json file as dependencies.

+

When used with the npm rm command, removes the dependency from +package.json.

+

Will also prevent writing to package-lock.json if set to false.

+

save-exact

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Dependencies saved to package.json will be configured with an exact version +rather than using npm's default semver range operator.

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Operates in "global" mode, so that packages are installed into the prefix +folder instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

install-strategy

+
    +
  • Default: "hoisted"
  • +
  • Type: "hoisted", "nested", "shallow", or "linked"
  • +
+

Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (experimental) install in node_modules/.store, +link in place, unhoisted.

+

legacy-bundling

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: This option has been deprecated in favor of +--install-strategy=nested
  • +
+

Instead of hoisting package installs in node_modules, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets --install-strategy=nested.

+

global-style

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: This option has been deprecated in favor of +--install-strategy=shallow
  • +
+

Only install direct dependencies in the top level node_modules, but hoist +on deeper dependencies. Sets --install-strategy=shallow.

+

omit

+
    +
  • Default: 'dev' if the NODE_ENV environment variable is set to +'production'; otherwise, empty.
  • +
  • Type: "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Dependency types to omit from the installation tree on disk.

+

Note that these dependencies are still resolved and added to the +package-lock.json or npm-shrinkwrap.json file. They are just not +physically installed on disk.

+

If a package type appears in both the --include and --omit lists, then +it will be included.

+

If the resulting omit list includes 'dev', then the NODE_ENV environment +variable will be set to 'production' for all lifecycle scripts.

+

include

+
    +
  • Default:
  • +
  • Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Option that allows for defining which types of dependencies to install.

+

This is the inverse of --omit=<type>.

+

Dependency types specified in --include will not be omitted, regardless of +the order in which omit/include are specified on the command-line.

+

strict-peer-deps

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, and --legacy-peer-deps is not set, then any +conflicting peerDependencies will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships.

+

By default, conflicting peerDependencies deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's peerDependencies object.

+

When such an override is performed, a warning is printed, explaining the +conflict and the packages involved. If --strict-peer-deps is set, then +this warning is treated as a failure.

+

prefer-dedupe

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Prefer to deduplicate packages if possible, rather than choosing a newer +version of a dependency.

+

package-lock

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

If set to false, then ignore package-lock.json files when installing. This +will also prevent writing package-lock.json if save is true.

+

package-lock-only

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, the current operation will only use the package-lock.json, +ignoring node_modules.

+

For update this means only the package-lock.json will be updated, +instead of checking node_modules and downloading dependencies.

+

For list this means the output will be based on the tree described by the +package-lock.json, rather than the contents of node_modules.

+

foreground-scripts

+
    +
  • Default: false unless when using npm pack or npm publish where it +defaults to true
  • +
  • Type: Boolean
  • +
+

Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

+

Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging.

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

allow-git

+
    +
  • Default: "all"
  • +
  • Type: "all", "none", or "root"
  • +
+

Limits the ability for npm to fetch dependencies from git references. That +is, dependencies that point to a git repo instead of a version or semver +range. Please note that this could leave your tree incomplete and some +packages may not function as intended or designed.

+

all allows any git dependencies to be fetched and installed. none +prevents any git dependencies from being fetched and installed. root only +allows git dependencies defined in your project's package.json to be fetched +installed. Also allows git dependencies to be fetched for other commands +like npm view

+

audit

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When "true" submit audit reports alongside the current npm command to the +default registry and all registries configured for scopes. See the +documentation for npm audit for details on what is +submitted.

+

before

+
    +
  • Default: null
  • +
  • Type: null or Date
  • +
+

If passed to npm install, will rebuild the npm tree such that only +versions that were available on or before the given date are installed. +If there are no versions available for the current set of dependencies, the +command will error.

+

If the requested version is a dist-tag and the given tag does not pass the +--before filter, the most recent version less than or equal to that tag +will be used. For example, foo@latest might install foo@1.2 even though +latest is 2.0.

+

This config cannot be used with: min-release-age

+

min-release-age

+
    +
  • Default: null
  • +
  • Type: null or Number
  • +
+

If set, npm will build the npm tree such that only versions that were +available more than the given number of days ago will be installed. If there +are no versions available for the current set of dependencies, the command +will error.

+

This flag is a complement to before, which accepts an exact date instead +of a relative number of days.

+

This config cannot be used with: before

+

This value is not exported to the environment for child processes.

+ +
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Tells npm to create symlinks (or .cmd shims on Windows) for package +executables.

+

Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems.

+

fund

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When "true" displays the message at the end of each npm install +acknowledging the number of dependencies looking for funding. See npm fund for details.

+

dry-run

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, install, update, +dedupe, uninstall, as well as pack and publish.

+

Note: This is NOT honored by other network related commands, eg dist-tags, +owner, etc.

+

cpu

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

Override CPU architecture of native modules to install. Acceptable values +are same as cpu field of package.json, which comes from process.arch.

+

os

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

Override OS of native modules to install. Acceptable values are same as os +field of package.json, which comes from process.platform.

+

libc

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

Override libc of native modules to install. Acceptable values are same as +libc field of package.json

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-install.html b/node24/node_modules/npm/docs/output/commands/npm-install.html new file mode 100644 index 0000000000000000000000000000000000000000..37d7c61d6cdcb4d99ff2f53e22d1d636e930c239 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-install.html @@ -0,0 +1,833 @@ + + +npm-install + + + + + +
+
+

+ npm-install + @11.12.1 +

+Install a package +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm install [<package-spec> ...]
+
+aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall
+
+

Description

+

This command installs a package and any packages that it depends on. +If the package has a package-lock, or an npm shrinkwrap file, or a yarn lock file, the installation of dependencies will be driven by that, respecting the following order of precedence:

+
    +
  • npm-shrinkwrap.json
  • +
  • package-lock.json
  • +
  • yarn.lock
  • +
+

See package-lock.json and npm shrinkwrap.

+

How npm install uses package-lock.json

+

When you run npm install without arguments, npm compares package.json and package-lock.json:

+
    +
  • +

    If the lockfile's resolved versions satisfy the package.json ranges: npm uses the exact versions from package-lock.json to ensure reproducible builds across environments.

    +
  • +
  • +

    If the ranges don't match: npm resolves new versions that satisfy the package.json ranges and updates package-lock.json accordingly. This happens when you modify version ranges in package.json (e.g., changing ^7.0.0 to ^8.0.0). Note that changing a range within the same major version (e.g., ^7.0.0 to ^7.1.0) will only update the metadata in the lockfile if the currently installed version still satisfies the new range.

    +
  • +
+

In essence, package-lock.json locks your dependencies to specific versions, but package.json is the source of truth for acceptable version ranges. When the lockfile's versions satisfy the package.json ranges, the lockfile wins. When they conflict, package.json wins and the lockfile is updated.

+

If you want to install packages while ensuring that package.json is not modified and that both files are strictly in sync, use npm ci instead.

+

A package is:

+
    +
  • a) a folder containing a program described by a package.json file
  • +
  • b) a gzipped tarball containing (a)
  • +
  • c) a url that resolves to (b)
  • +
  • d) a <name>@<version> that is published on the registry (see registry) with (c)
  • +
  • e) a <name>@<tag> (see npm dist-tag) that points to (d)
  • +
  • f) a <name> that has a "latest" tag satisfying (e)
  • +
  • g) a <git remote url> that resolves to (a)
  • +
+

Even if you never publish your package, you can still get a lot of benefits of using npm if you just want to write a node program (a), and perhaps if you also want to be able to easily install it elsewhere after packing it up into a tarball (b).

+
    +
  • +

    npm install (in a package directory, no arguments):

    +

    Install the dependencies to the local node_modules folder.

    +

    In global mode (ie, with -g or --global appended to the command), it installs the current package context (ie, the current working directory) as a global package.

    +

    By default, npm install will install all modules listed as dependencies in package.json.

    +

    With the --production flag (or when the NODE_ENV environment variable is set to production), npm will not install modules listed in devDependencies. +To install all modules listed in both dependencies and devDependencies when NODE_ENV environment variable is set to production, you can use --production=false.

    +
    +

    NOTE: The --production flag has no particular meaning when adding a dependency to a project.

    +
    +
  • +
  • +

    npm install <folder>:

    +

    If <folder> sits inside the root of your project, its dependencies will be installed and may be hoisted to the top-level node_modules as they would for other types of dependencies. +If <folder> sits outside the root of your project, npm will not install the package dependencies in the directory <folder>, but it will create a symlink to <folder>.

    +
    +

    NOTE: If you want to install the content of a directory like a package from the registry instead of creating a link, you would need to use the --install-links option.

    +
    +

    Example:

    +
    npm install ../../other-package --install-links
    +npm install ./sub-package
    +
    +
  • +
  • +

    npm install <tarball file>:

    +

    Install a package that is sitting on the filesystem. +Note: if you just want to link a dev directory into your npm root, you can do this more easily by using npm link.

    +

    Tarball requirements:

    +
      +
    • The filename must use .tar, .tar.gz, or .tgz as the extension.
    • +
    • The package contents should reside in a subfolder inside the tarball (usually it is called package/). +npm strips one directory layer when installing the package (an equivalent of tar x --strip-components=1 is run).
    • +
    • The package must contain a package.json file with name and version properties.
    • +
    +

    Example:

    +
    npm install ./package.tgz
    +
    +
  • +
  • +

    npm install <tarball url>:

    +

    Fetch the tarball url, and then install it. +In order to distinguish between this and other options, the argument must start with "http://" or "https://"

    +

    Example:

    +
    npm install https://github.com/indexzero/forever/tarball/v0.5.6
    +
    +
  • +
  • +

    npm install [<@scope>/]<name>:

    +

    Do a <name>@<tag> install, where <tag> is the "tag" config. +(See config. +The config's default value is latest.)

    +

    In most cases, this will install the version of the modules tagged as latest on the npm registry.

    +

    Note: When installing by name without specifying a version or tag, npm prioritizes versions that match the current Node.js version based on the package's engines field. If the latest tag points to a version incompatible with your current Node.js version, npm will install the newest compatible version instead. To install a specific version regardless of engines compatibility, explicitly specify the version or tag: npm install <name>@latest.

    +

    Example:

    +
    npm install sax
    +
    +

    npm install saves any specified packages into dependencies by default. +Additionally, you can control where and how they get saved with some additional flags:

    +
      +
    • +

      -P, --save-prod: Package will appear in your dependencies. +This is the default unless -D or -O are present.

      +
    • +
    • +

      -D, --save-dev: Package will appear in your devDependencies.

      +
    • +
    • +

      --save-peer: Package will appear in your peerDependencies.

      +
    • +
    • +

      -O, --save-optional: Package will appear in your +optionalDependencies.

      +
    • +
    • +

      --no-save: Prevents saving to dependencies.

      +
    • +
    +

    When using any of the above options to save dependencies to your package.json, there are two additional, optional flags:

    +
      +
    • +

      -E, --save-exact: Saved dependencies will be configured with an exact version rather than using npm's default semver range operator.

      +
    • +
    • +

      -B, --save-bundle: Saved dependencies will also be added to your bundleDependencies list.

      +
    • +
    +

    Further, if you have an npm-shrinkwrap.json or package-lock.json then it will be updated as well.

    +

    <scope> is optional. +The package will be downloaded from the registry associated with the specified scope. +If no registry is associated with the given scope the default registry is assumed. +See scope.

    +

    Note: if you do not include the @-symbol on your scope name, npm will interpret this as a GitHub repository instead, see below. +Scopes names must also be followed by a slash.

    +

    Examples:

    +
    npm install sax
    +npm install githubname/reponame
    +npm install @myorg/privatepackage
    +npm install node-tap --save-dev
    +npm install dtrace-provider --save-optional
    +npm install readable-stream --save-exact
    +npm install ansi-regex --save-bundle
    +
    +
  • +
  • +

    npm install <alias>@npm:<name>:

    +

    Install a package under a custom alias. +Allows multiple versions of a same-name package side-by-side, more convenient import names for packages with otherwise long ones, and using git forks replacements or forked npm packages as replacements. +Aliasing works only on your project and does not rename packages in transitive dependencies. +Aliases should follow the naming conventions stated in validate-npm-package-name.

    +

    Examples:

    +
    npm install my-react@npm:react
    +npm install jquery2@npm:jquery@2
    +npm install jquery3@npm:jquery@3
    +npm install npa@npm:npm-package-arg
    +
    +
  • +
  • +

    npm install [<@scope>/]<name>@<tag>:

    +

    Install the version of the package that is referenced by the specified tag. +If the tag does not exist in the registry data for that package, then this will fail.

    +

    Example:

    +
    npm install sax@latest
    +npm install @myorg/mypackage@latest
    +
    +
  • +
  • +

    npm install [<@scope>/]<name>@<version>:

    +

    Install the specified version of the package. +This will fail if the version has not been published to the registry.

    +

    Example:

    +
    npm install sax@0.1.1
    +npm install @myorg/privatepackage@1.5.0
    +
    +
  • +
  • +

    npm install [<@scope>/]<name>@<version range>:

    +

    Install a version of the package matching the specified version range. +This will follow the same rules for resolving dependencies described in package.json.

    +

    Note that most version ranges must be put in quotes so that your shell will treat it as a single argument.

    +

    Example:

    +
    npm install sax@">=0.1.0 <0.2.0"
    +npm install @myorg/privatepackage@"16 - 17"
    +
    +

    Prerelease versions: By default, version ranges only match stable versions. To include prerelease versions, they must be explicitly specified in the range. Prerelease versions are tied to a specific version triple (major.minor.patch). For example, ^1.2.3-beta.1 will only match prereleases for 1.2.x, not 1.3.x. To match all prereleases for a major version, use a range like ^1.0.0-0, which will include all 1.x.x prereleases.

    +

    Example:

    +
    npm install package@^1.2.3-beta.1  # Matches 1.2.3-beta.1, 1.2.3-beta.2, 1.2.4-beta.1, etc.
    +npm install package@^1.0.0-0       # Matches all 1.x.x prereleases and stable versions
    +
    +
  • +
  • +

    npm install <git remote url>:

    +

    Installs the package from the hosted git provider, cloning it with git. +For a full git remote url, only that URL will be attempted.

    +
    <protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish> | #semver:<semver>]
    +
    +

    <protocol> is one of git, git+ssh, git+http, git+https, or +git+file.

    +

    If #<commit-ish> is provided, it will be used to clone exactly that commit. +If the commit-ish has the format #semver:<semver>, <semver> can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. +If neither #<commit-ish> or #semver:<semver> is specified, then the default branch of the repository is used.

    +

    If the repository makes use of submodules, those submodules will be cloned as well.

    +

    If the package being installed contains a prepare script, its dependencies and devDependencies will be installed, and the prepare script will be run, before the package is packaged and installed.

    +

    The following git environment variables are recognized by npm and will be added to the environment when running git:

    +
      +
    • GIT_ASKPASS
    • +
    • GIT_EXEC_PATH
    • +
    • GIT_PROXY_COMMAND
    • +
    • GIT_SSH
    • +
    • GIT_SSH_COMMAND
    • +
    • GIT_SSL_CAINFO
    • +
    • GIT_SSL_NO_VERIFY
    • +
    +

    See the git man page for details.

    +

    Examples:

    +
    npm install git+ssh://git@github.com:npm/cli.git#v1.0.27
    +npm install git+ssh://git@github.com:npm/cli#pull/273
    +npm install git+ssh://git@github.com:npm/cli#semver:^5.0
    +npm install git+https://isaacs@github.com/npm/cli.git
    +npm install git://github.com/npm/cli.git#v1.0.27
    +GIT_SSH_COMMAND='ssh -i ~/.ssh/custom_ident' npm install git+ssh://git@github.com:npm/cli.git
    +
    +
  • +
  • +

    npm install <githubname>/<githubrepo>[#<commit-ish>]:

    +
  • +
  • +

    npm install github:<githubname>/<githubrepo>[#<commit-ish>]:

    +

    Install the package at https://github.com/githubname/githubrepo by attempting to clone it using git.

    +

    If #<commit-ish> is provided, it will be used to clone exactly that commit. +If the commit-ish has the format #semver:<semver>, <semver> can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. +If neither #<commit-ish> or #semver:<semver> is specified, then the default branch is used.

    +

    As with regular git dependencies, dependencies and devDependencies will be installed if the package has a prepare script before the package is done installing.

    +

    Examples:

    +
    npm install mygithubuser/myproject
    +npm install github:mygithubuser/myproject
    +
    +
  • +
  • +

    npm install gist:[<githubname>/]<gistID>[#<commit-ish>|#semver:<semver>]:

    +

    Install the package at https://gist.github.com/gistID by attempting to clone it using git. +The GitHub username associated with the gist is optional and will not be saved in package.json.

    +

    As with regular git dependencies, dependencies and devDependencies will be installed if the package has a prepare script before the package is done installing.

    +

    Example:

    +
    npm install gist:101a11beef
    +
    +
  • +
  • +

    npm install bitbucket:<bitbucketname>/<bitbucketrepo>[#<commit-ish>]:

    +

    Install the package at https://bitbucket.org/bitbucketname/bitbucketrepo by attempting to clone it using git.

    +

    If #<commit-ish> is provided, it will be used to clone exactly that commit. +If the commit-ish has the format #semver:<semver>, <semver> can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. +If neither #<commit-ish> or #semver:<semver> is specified, then master is used.

    +

    As with regular git dependencies, dependencies and devDependencies will be installed if the package has a prepare script before the package is done installing.

    +

    Example:

    +
    npm install bitbucket:mybitbucketuser/myproject
    +
    +
  • +
  • +

    npm install gitlab:<gitlabname>/<gitlabrepo>[#<commit-ish>]:

    +

    Install the package at https://gitlab.com/gitlabname/gitlabrepo by attempting to clone it using git.

    +

    If #<commit-ish> is provided, it will be used to clone exactly that commit. +If the commit-ish has the format #semver:<semver>, <semver> can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. +If neither #<commit-ish> or #semver:<semver> is specified, then master is used.

    +

    As with regular git dependencies, dependencies and devDependencies will be installed if the package has a prepare script before the package is done installing.

    +

    Example:

    +
    npm install gitlab:mygitlabuser/myproject
    +npm install gitlab:myusr/myproj#semver:^5.0
    +
    +
  • +
+

You may combine multiple arguments and even multiple types of arguments. +For example:

+
npm install sax@">=0.1.0 <0.2.0" bench supervisor
+
+

The --tag argument will apply to all of the specified install targets. +If a tag with the given name exists, the tagged version is preferred over newer versions.

+

Note: The --tag option only affects packages specified on the command line. It does not override version ranges specified in package.json. For example, if package.json specifies "foo": "^1.0.0" and you run npm install --tag beta, npm will still install a version matching ^1.0.0 even if the beta tag points to a different version. To install a tagged version, specify the package explicitly: npm install foo@beta.

+

The --dry-run argument will report in the usual way what the install would have done without actually installing anything.

+

The --package-lock-only argument will only update the package-lock.json, instead of checking node_modules and downloading dependencies.

+

The -f or --force argument will force npm to fetch remote resources even if a local copy exists on disk.

+
npm install sax --force
+
+

Configuration

+

See the config help doc. +Many of the configuration params have some effect on installation, since that's most of what npm does.

+

These are some of the most common options related to installation.

+

save

+
    +
  • Default: true unless when using npm update where it defaults to false
  • +
  • Type: Boolean
  • +
+

Save installed packages to a package.json file as dependencies.

+

When used with the npm rm command, removes the dependency from +package.json.

+

Will also prevent writing to package-lock.json if set to false.

+

save-exact

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Dependencies saved to package.json will be configured with an exact version +rather than using npm's default semver range operator.

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Operates in "global" mode, so that packages are installed into the prefix +folder instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

install-strategy

+
    +
  • Default: "hoisted"
  • +
  • Type: "hoisted", "nested", "shallow", or "linked"
  • +
+

Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (experimental) install in node_modules/.store, +link in place, unhoisted.

+

legacy-bundling

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: This option has been deprecated in favor of +--install-strategy=nested
  • +
+

Instead of hoisting package installs in node_modules, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets --install-strategy=nested.

+

global-style

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: This option has been deprecated in favor of +--install-strategy=shallow
  • +
+

Only install direct dependencies in the top level node_modules, but hoist +on deeper dependencies. Sets --install-strategy=shallow.

+

omit

+
    +
  • Default: 'dev' if the NODE_ENV environment variable is set to +'production'; otherwise, empty.
  • +
  • Type: "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Dependency types to omit from the installation tree on disk.

+

Note that these dependencies are still resolved and added to the +package-lock.json or npm-shrinkwrap.json file. They are just not +physically installed on disk.

+

If a package type appears in both the --include and --omit lists, then +it will be included.

+

If the resulting omit list includes 'dev', then the NODE_ENV environment +variable will be set to 'production' for all lifecycle scripts.

+

include

+
    +
  • Default:
  • +
  • Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Option that allows for defining which types of dependencies to install.

+

This is the inverse of --omit=<type>.

+

Dependency types specified in --include will not be omitted, regardless of +the order in which omit/include are specified on the command-line.

+

strict-peer-deps

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, and --legacy-peer-deps is not set, then any +conflicting peerDependencies will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships.

+

By default, conflicting peerDependencies deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's peerDependencies object.

+

When such an override is performed, a warning is printed, explaining the +conflict and the packages involved. If --strict-peer-deps is set, then +this warning is treated as a failure.

+

prefer-dedupe

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Prefer to deduplicate packages if possible, rather than choosing a newer +version of a dependency.

+

package-lock

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

If set to false, then ignore package-lock.json files when installing. This +will also prevent writing package-lock.json if save is true.

+

package-lock-only

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, the current operation will only use the package-lock.json, +ignoring node_modules.

+

For update this means only the package-lock.json will be updated, +instead of checking node_modules and downloading dependencies.

+

For list this means the output will be based on the tree described by the +package-lock.json, rather than the contents of node_modules.

+

foreground-scripts

+
    +
  • Default: false unless when using npm pack or npm publish where it +defaults to true
  • +
  • Type: Boolean
  • +
+

Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

+

Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging.

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

allow-git

+
    +
  • Default: "all"
  • +
  • Type: "all", "none", or "root"
  • +
+

Limits the ability for npm to fetch dependencies from git references. That +is, dependencies that point to a git repo instead of a version or semver +range. Please note that this could leave your tree incomplete and some +packages may not function as intended or designed.

+

all allows any git dependencies to be fetched and installed. none +prevents any git dependencies from being fetched and installed. root only +allows git dependencies defined in your project's package.json to be fetched +installed. Also allows git dependencies to be fetched for other commands +like npm view

+

audit

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When "true" submit audit reports alongside the current npm command to the +default registry and all registries configured for scopes. See the +documentation for npm audit for details on what is +submitted.

+

before

+
    +
  • Default: null
  • +
  • Type: null or Date
  • +
+

If passed to npm install, will rebuild the npm tree such that only +versions that were available on or before the given date are installed. +If there are no versions available for the current set of dependencies, the +command will error.

+

If the requested version is a dist-tag and the given tag does not pass the +--before filter, the most recent version less than or equal to that tag +will be used. For example, foo@latest might install foo@1.2 even though +latest is 2.0.

+

This config cannot be used with: min-release-age

+

min-release-age

+
    +
  • Default: null
  • +
  • Type: null or Number
  • +
+

If set, npm will build the npm tree such that only versions that were +available more than the given number of days ago will be installed. If there +are no versions available for the current set of dependencies, the command +will error.

+

This flag is a complement to before, which accepts an exact date instead +of a relative number of days.

+

This config cannot be used with: before

+

This value is not exported to the environment for child processes.

+ +
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Tells npm to create symlinks (or .cmd shims on Windows) for package +executables.

+

Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems.

+

fund

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When "true" displays the message at the end of each npm install +acknowledging the number of dependencies looking for funding. See npm fund for details.

+

dry-run

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, install, update, +dedupe, uninstall, as well as pack and publish.

+

Note: This is NOT honored by other network related commands, eg dist-tags, +owner, etc.

+

cpu

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

Override CPU architecture of native modules to install. Acceptable values +are same as cpu field of package.json, which comes from process.arch.

+

os

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

Override OS of native modules to install. Acceptable values are same as os +field of package.json, which comes from process.platform.

+

libc

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

Override libc of native modules to install. Acceptable values are same as +libc field of package.json

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces.

+

Algorithm

+

Given a package{dep} structure: A{B,C}, B{C}, C{D}, the npm install algorithm produces:

+
A
++-- B
++-- C
++-- D
+
+

That is, the dependency from B to C is satisfied by the fact that A already caused C to be installed at a higher level. +D is still installed at the top level because nothing conflicts with it.

+

For A{B,C}, B{C,D@1}, C{D@2}, this algorithm produces:

+
A
++-- B
++-- C
+   `-- D@2
++-- D@1
+
+

Because B's D@1 will be installed in the top-level, C now has to install D@2 privately for itself. +This algorithm is deterministic, but different trees may be produced if two dependencies are requested for installation in a different order.

+

See folders for a more detailed description of the specific folder structures that npm creates.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-link.html b/node24/node_modules/npm/docs/output/commands/npm-link.html new file mode 100644 index 0000000000000000000000000000000000000000..013b61f50b32f09b0b573806cdcb8e149ed648c8 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-link.html @@ -0,0 +1,496 @@ + + +npm-link + + + + + +
+
+

+ npm-link + @11.12.1 +

+Symlink a package folder +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm link [<package-spec>]
+
+alias: ln
+
+

Description

+

This is handy for installing your own stuff, so that you can work on it and test iteratively without having to continually rebuild.

+

Package linking is a two-step process.

+

First, npm link in a package folder with no arguments will create a symlink in the global folder {prefix}/lib/node_modules/<package> that links to the package where the npm link command was executed. +It will also link any bins in the package to {prefix}/bin/{name}. +Note that npm link uses the global prefix (see npm prefix -g for its value).

+

Next, in some other location, npm link package-name will create a symbolic link from globally-installed package-name to node_modules/ of the current folder.

+

Note that package-name is taken from package.json, not from the directory name.

+

The package name can be optionally prefixed with a scope. +See scope. +The scope must be preceded by an @-symbol and followed by a slash.

+

When creating tarballs for npm publish, the linked packages are "snapshotted" to their current state by resolving the symbolic links, if they are included in bundleDependencies.

+

For example:

+
cd ~/projects/node-redis    # go into the package directory
+npm link                    # creates global link
+cd ~/projects/node-bloggy   # go into some other package directory.
+npm link redis              # link-install the package
+
+

Now, any changes to ~/projects/node-redis will be reflected in +~/projects/node-bloggy/node_modules/node-redis/. +Note that the link should be to the package name, not the directory name for that package.

+

You may also shortcut the two steps in one. +For example, to do the above use-case in a shorter way:

+
cd ~/projects/node-bloggy  # go into the dir of your main project
+npm link ../node-redis     # link the dir of your dependency
+
+

The second line is the equivalent of doing:

+
(cd ../node-redis; npm link)
+npm link redis
+
+

That is, it first creates a global link, and then links the global installation target into your project's node_modules folder.

+

Note that in this case, you are referring to the directory name, +node-redis, rather than the package name redis.

+

If your linked package is scoped (see scope) your link command must include that scope, e.g.

+
npm link @myorg/privatepackage
+
+

Caveat

+

Note that package dependencies linked in this way are not saved to package.json by default, on the assumption that the intention is to have a link stand in for a regular non-link dependency. +Otherwise, for example, if you depend on redis@^3.0.1, and ran npm link redis, it would replace the ^3.0.1 dependency with file:../path/to/node-redis, which you probably don't want! Additionally, other users or developers on your project would run into issues if they do not have their folders set up exactly the same as yours.

+

If you are adding a new dependency as a link, you should add it to the relevant metadata by running npm install <dep> --package-lock-only.

+

If you want to save the file: reference in your package.json and package-lock.json files, you can use npm link <dep> --save to do so.

+

Workspace Usage

+

npm link <pkg> --workspace <name> will link the relevant package as a dependency of the specified workspace(s). +Note that It may actually be linked into the parent project's node_modules folder, if there are no conflicting dependencies.

+

npm link --workspace <name> will create a global link to the specified workspace(s).

+

Configuration

+

save

+
    +
  • Default: true unless when using npm update where it defaults to false
  • +
  • Type: Boolean
  • +
+

Save installed packages to a package.json file as dependencies.

+

When used with the npm rm command, removes the dependency from +package.json.

+

Will also prevent writing to package-lock.json if set to false.

+

save-exact

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Dependencies saved to package.json will be configured with an exact version +rather than using npm's default semver range operator.

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Operates in "global" mode, so that packages are installed into the prefix +folder instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

install-strategy

+
    +
  • Default: "hoisted"
  • +
  • Type: "hoisted", "nested", "shallow", or "linked"
  • +
+

Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (experimental) install in node_modules/.store, +link in place, unhoisted.

+

legacy-bundling

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: This option has been deprecated in favor of +--install-strategy=nested
  • +
+

Instead of hoisting package installs in node_modules, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets --install-strategy=nested.

+

global-style

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: This option has been deprecated in favor of +--install-strategy=shallow
  • +
+

Only install direct dependencies in the top level node_modules, but hoist +on deeper dependencies. Sets --install-strategy=shallow.

+

strict-peer-deps

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, and --legacy-peer-deps is not set, then any +conflicting peerDependencies will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships.

+

By default, conflicting peerDependencies deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's peerDependencies object.

+

When such an override is performed, a warning is printed, explaining the +conflict and the packages involved. If --strict-peer-deps is set, then +this warning is treated as a failure.

+

package-lock

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

If set to false, then ignore package-lock.json files when installing. This +will also prevent writing package-lock.json if save is true.

+

omit

+
    +
  • Default: 'dev' if the NODE_ENV environment variable is set to +'production'; otherwise, empty.
  • +
  • Type: "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Dependency types to omit from the installation tree on disk.

+

Note that these dependencies are still resolved and added to the +package-lock.json or npm-shrinkwrap.json file. They are just not +physically installed on disk.

+

If a package type appears in both the --include and --omit lists, then +it will be included.

+

If the resulting omit list includes 'dev', then the NODE_ENV environment +variable will be set to 'production' for all lifecycle scripts.

+

include

+
    +
  • Default:
  • +
  • Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Option that allows for defining which types of dependencies to install.

+

This is the inverse of --omit=<type>.

+

Dependency types specified in --include will not be omitted, regardless of +the order in which omit/include are specified on the command-line.

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

allow-git

+
    +
  • Default: "all"
  • +
  • Type: "all", "none", or "root"
  • +
+

Limits the ability for npm to fetch dependencies from git references. That +is, dependencies that point to a git repo instead of a version or semver +range. Please note that this could leave your tree incomplete and some +packages may not function as intended or designed.

+

all allows any git dependencies to be fetched and installed. none +prevents any git dependencies from being fetched and installed. root only +allows git dependencies defined in your project's package.json to be fetched +installed. Also allows git dependencies to be fetched for other commands +like npm view

+

audit

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When "true" submit audit reports alongside the current npm command to the +default registry and all registries configured for scopes. See the +documentation for npm audit for details on what is +submitted.

+ +
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Tells npm to create symlinks (or .cmd shims on Windows) for package +executables.

+

Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems.

+

fund

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When "true" displays the message at the end of each npm install +acknowledging the number of dependencies looking for funding. See npm fund for details.

+

dry-run

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, install, update, +dedupe, uninstall, as well as pack and publish.

+

Note: This is NOT honored by other network related commands, eg dist-tags, +owner, etc.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-ll.html b/node24/node_modules/npm/docs/output/commands/npm-ll.html new file mode 100644 index 0000000000000000000000000000000000000000..59adb5dce4766afa08eaa54f4c04d9ea91d77bb4 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-ll.html @@ -0,0 +1,381 @@ + + +npm-ll + + + + + +
+
+

+ npm-ll + @11.12.1 +

+List installed packages +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm ll [[<@scope>/]<pkg> ...]
+
+alias: la
+
+

Description

+

List installed packages

+

Configuration

+

all

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When running npm outdated and npm ls, setting --all will show all +outdated or installed packages, rather than only those directly depended +upon by the current project.

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

+

long

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Show extended information in ls, search, and help-search.

+

parseable

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Output parseable results from commands that write to standard output. For +npm search, this will be tab-separated table format.

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Operates in "global" mode, so that packages are installed into the prefix +folder instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

depth

+
    +
  • Default: Infinity if --all is set; otherwise, 0
  • +
  • Type: null or Number
  • +
+

The depth to go when recursing packages for npm ls.

+

If not set, npm ls will show only the immediate dependencies of the root +project. If --all is set, then npm will show all dependencies by default.

+

omit

+
    +
  • Default: 'dev' if the NODE_ENV environment variable is set to +'production'; otherwise, empty.
  • +
  • Type: "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Dependency types to omit from the installation tree on disk.

+

Note that these dependencies are still resolved and added to the +package-lock.json or npm-shrinkwrap.json file. They are just not +physically installed on disk.

+

If a package type appears in both the --include and --omit lists, then +it will be included.

+

If the resulting omit list includes 'dev', then the NODE_ENV environment +variable will be set to 'production' for all lifecycle scripts.

+

include

+
    +
  • Default:
  • +
  • Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Option that allows for defining which types of dependencies to install.

+

This is the inverse of --omit=<type>.

+

Dependency types specified in --include will not be omitted, regardless of +the order in which omit/include are specified on the command-line.

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Used with npm ls, limiting output to only those packages that are linked.

+

package-lock-only

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, the current operation will only use the package-lock.json, +ignoring node_modules.

+

For update this means only the package-lock.json will be updated, +instead of checking node_modules and downloading dependencies.

+

For list this means the output will be based on the tree described by the +package-lock.json, rather than the contents of node_modules.

+

unicode

+
    +
  • Default: false on windows, true on mac/unix systems with a unicode locale, +as defined by the LC_ALL, LC_CTYPE, or LANG environment variables.
  • +
  • Type: Boolean
  • +
+

When set to true, npm uses unicode characters in the tree output. When +false, it uses ascii characters instead of unicode glyphs.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-login.html b/node24/node_modules/npm/docs/output/commands/npm-login.html new file mode 100644 index 0000000000000000000000000000000000000000..a4326c47d6d68aa02e35cf1d720b664701756ce3 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-login.html @@ -0,0 +1,274 @@ + + +npm-login + + + + + +
+
+

+ npm-login + @11.12.1 +

+Login to a registry user account +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm login
+
+

Note: This command is unaware of workspaces.

+

Description

+

Verify a user in the specified registry, and save the credentials to the +.npmrc file. +If no registry is specified, the default registry will be used (see config).

+

When you run npm login, the CLI automatically generates a legacy token of publish type. +For more information, see About legacy tokens.

+

When using legacy for your auth-type, the username and password, are read in from prompts.

+

To reset your password, go to https://www.npmjs.com/forgot

+

To change your email address, go to https://www.npmjs.com/email-edit

+

You may use this command multiple times with the same user account to authorize on a new machine. +When authenticating on a new machine, the username, password and email address must all match with your existing record.

+

Configuration

+

registry

+ +

The base URL of the npm registry.

+

scope

+
    +
  • Default: the scope of the current project, if any, or ""
  • +
  • Type: String
  • +
+

Associate an operation with a scope for a scoped registry.

+

Useful when logging in to or out of a private registry:

+
# log in, linking the scope to the custom registry
+npm login --scope=@mycorp --registry=https://registry.mycorp.com
+
+# log out, removing the link and the auth token
+npm logout --scope=@mycorp
+
+

This will cause @mycorp to be mapped to the registry for future +installation of packages specified according to the pattern +@mycorp/package.

+

This will also cause npm init to create a scoped package.

+
# accept all defaults, and create a package named "@foo/whatever",
+# instead of just named "whatever"
+npm init --scope=@foo --yes
+
+

auth-type

+
    +
  • Default: "web"
  • +
  • Type: "legacy" or "web"
  • +
+

What authentication strategy to use with login. Note that if an otp +config is given, this value will always be set to legacy.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-logout.html b/node24/node_modules/npm/docs/output/commands/npm-logout.html new file mode 100644 index 0000000000000000000000000000000000000000..f4ed04e939b4ab1d3f0935269eeb4d34d64ef8df --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-logout.html @@ -0,0 +1,259 @@ + + +npm-logout + + + + + +
+
+

+ npm-logout + @11.12.1 +

+Log out of the registry +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm logout
+
+

Note: This command is unaware of workspaces.

+

Description

+

When logged into a registry that supports token-based authentication, tell the server to end this token's session. +This will invalidate the token everywhere you're using it, not just for the current environment.

+

When logged into a legacy registry that uses username and password authentication, this will clear the credentials in your user configuration. +In this case, it will only affect the current environment.

+

If --scope is provided, this will find the credentials for the registry connected to that scope, if set.

+

Configuration

+

registry

+ +

The base URL of the npm registry.

+

scope

+
    +
  • Default: the scope of the current project, if any, or ""
  • +
  • Type: String
  • +
+

Associate an operation with a scope for a scoped registry.

+

Useful when logging in to or out of a private registry:

+
# log in, linking the scope to the custom registry
+npm login --scope=@mycorp --registry=https://registry.mycorp.com
+
+# log out, removing the link and the auth token
+npm logout --scope=@mycorp
+
+

This will cause @mycorp to be mapped to the registry for future +installation of packages specified according to the pattern +@mycorp/package.

+

This will also cause npm init to create a scoped package.

+
# accept all defaults, and create a package named "@foo/whatever",
+# instead of just named "whatever"
+npm init --scope=@foo --yes
+
+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-ls.html b/node24/node_modules/npm/docs/output/commands/npm-ls.html new file mode 100644 index 0000000000000000000000000000000000000000..eeb1d5d8628d9a60b01b2683a1d2194182745dae --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-ls.html @@ -0,0 +1,403 @@ + + +npm-ls + + + + + +
+
+

+ npm-ls + @11.12.1 +

+List installed packages +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm ls <package-spec>
+
+alias: list
+
+

Description

+

This command will print to stdout all the versions of packages that are installed, as well as their dependencies when --all is specified, in a tree structure.

+

Note: to get a "bottoms up" view of why a given package is included in the tree at all, use npm explain.

+

Positional arguments are name@version-range identifiers, which will limit the results to only the paths to the packages named. +Note that nested packages will also show the paths to the specified packages. +For example, running npm ls promzard in npm's source tree will show:

+
npm@11.12.1 /path/to/npm
+└─┬ init-package-json@0.0.4
+  └── promzard@0.1.5
+
+

It will print out extraneous, missing, and invalid packages.

+

If a project specifies git urls for dependencies these are shown in parentheses after the name@version to make it easier for users to recognize potential forks of a project.

+

The tree shown is the logical dependency tree, based on package dependencies, not the physical layout of your node_modules folder.

+

When run as ll or la, it shows extended information by default.

+

Configuration

+

all

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When running npm outdated and npm ls, setting --all will show all +outdated or installed packages, rather than only those directly depended +upon by the current project.

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

+

long

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Show extended information in ls, search, and help-search.

+

parseable

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Output parseable results from commands that write to standard output. For +npm search, this will be tab-separated table format.

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Operates in "global" mode, so that packages are installed into the prefix +folder instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

depth

+
    +
  • Default: Infinity if --all is set; otherwise, 0
  • +
  • Type: null or Number
  • +
+

The depth to go when recursing packages for npm ls.

+

If not set, npm ls will show only the immediate dependencies of the root +project. If --all is set, then npm will show all dependencies by default.

+

omit

+
    +
  • Default: 'dev' if the NODE_ENV environment variable is set to +'production'; otherwise, empty.
  • +
  • Type: "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Dependency types to omit from the installation tree on disk.

+

Note that these dependencies are still resolved and added to the +package-lock.json or npm-shrinkwrap.json file. They are just not +physically installed on disk.

+

If a package type appears in both the --include and --omit lists, then +it will be included.

+

If the resulting omit list includes 'dev', then the NODE_ENV environment +variable will be set to 'production' for all lifecycle scripts.

+

include

+
    +
  • Default:
  • +
  • Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Option that allows for defining which types of dependencies to install.

+

This is the inverse of --omit=<type>.

+

Dependency types specified in --include will not be omitted, regardless of +the order in which omit/include are specified on the command-line.

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Used with npm ls, limiting output to only those packages that are linked.

+

package-lock-only

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, the current operation will only use the package-lock.json, +ignoring node_modules.

+

For update this means only the package-lock.json will be updated, +instead of checking node_modules and downloading dependencies.

+

For list this means the output will be based on the tree described by the +package-lock.json, rather than the contents of node_modules.

+

unicode

+
    +
  • Default: false on windows, true on mac/unix systems with a unicode locale, +as defined by the LC_ALL, LC_CTYPE, or LANG environment variables.
  • +
  • Type: Boolean
  • +
+

When set to true, npm uses unicode characters in the tree output. When +false, it uses ascii characters instead of unicode glyphs.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-org.html b/node24/node_modules/npm/docs/output/commands/npm-org.html new file mode 100644 index 0000000000000000000000000000000000000000..ed895422c3669a258a9e9ee44918a50f29d0db88 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-org.html @@ -0,0 +1,283 @@ + + +npm-org + + + + + +
+
+

+ npm-org + @11.12.1 +

+Manage orgs +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm org set orgname username [developer | admin | owner]
+npm org rm orgname username
+npm org ls orgname [<username>]
+
+alias: ogr
+
+

Note: This command is unaware of workspaces.

+

Example

+

Add a new developer to an org:

+
$ npm org set my-org @mx-smith
+
+

Add a new admin to an org (or change a developer to an admin):

+
$ npm org set my-org @mx-santos admin
+
+

Remove a user from an org:

+
$ npm org rm my-org mx-santos
+
+

List all users in an org:

+
$ npm org ls my-org
+
+

List all users in JSON format:

+
$ npm org ls my-org --json
+
+

See what role a user has in an org:

+
$ npm org ls my-org @mx-santos
+
+

Description

+

You can use the npm org commands to manage and view users of an organization. +It supports adding and removing users, changing their roles, listing them, and finding specific ones and their roles.

+

Configuration

+

registry

+ +

The base URL of the npm registry.

+

otp

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with npm access.

+

If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one.

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

+

parseable

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Output parseable results from commands that write to standard output. For +npm search, this will be tab-separated table format.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-outdated.html b/node24/node_modules/npm/docs/output/commands/npm-outdated.html new file mode 100644 index 0000000000000000000000000000000000000000..593dfdab4518f23b2f01aaef424dd051dbba4d52 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-outdated.html @@ -0,0 +1,367 @@ + + +npm-outdated + + + + + +
+
+

+ npm-outdated + @11.12.1 +

+Check for outdated packages +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm outdated [<package-spec> ...]
+
+

Description

+

This command will check the registry to see if any (or, specific) installed packages are currently outdated.

+

By default, only the direct dependencies of the root project and direct dependencies of your configured workspaces are shown. +Use --all to find all outdated meta-dependencies as well.

+

In the output:

+
    +
  • wanted is the maximum version of the package that satisfies the semver range specified in package.json. +If there's no available semver range (i.e. you're running npm outdated --global, or the package isn't included in package.json), then wanted shows the currently-installed version.
  • +
  • latest is the version of the package tagged as latest in the registry. +Running npm publish with no special configuration will publish the package with a dist-tag of latest. +This may or may not be the maximum version of the package, or the most-recently published version of the package, depending on how the package's developer manages the latest dist-tag.
  • +
  • location is where in the physical tree the package is located.
  • +
  • depended by shows which package depends on the displayed dependency
  • +
  • package type (when using --long / -l) tells you whether this package is a dependency or a dev/peer/optional dependency. +Packages not included in package.json are always marked dependencies.
  • +
  • homepage (when using --long / -l) is the homepage value contained in the package's packument
  • +
  • depended by location (when using --long / -l) shows location of the package that depends on the displayed dependency
  • +
  • Red means there's a newer version matching your semver requirements, so you should update now.
  • +
  • Yellow indicates that there's a newer version above your semver requirements (usually new major, or new 0.x minor) so proceed with caution.
  • +
+

An example

+
$ npm outdated
+Package      Current   Wanted   Latest  Location                  Depended by
+glob          5.0.15   5.0.15    6.0.1  node_modules/glob         dependent-package-name
+nothingness    0.0.3      git      git  node_modules/nothingness  dependent-package-name
+npm            3.5.1    3.5.2    3.5.1  node_modules/npm          dependent-package-name
+local-dev      0.0.3   linked   linked  local-dev                 dependent-package-name
+once           1.3.2    1.3.3    1.3.3  node_modules/once         dependent-package-name
+
+

With these dependencies:

+
{
+  "glob": "^5.0.15",
+  "nothingness": "github:othiym23/nothingness#master",
+  "npm": "^3.5.1",
+  "once": "^1.3.1"
+}
+
+

A few things to note:

+
    +
  • glob requires ^5, which prevents npm from installing glob@6, which is outside the semver range.
  • +
  • Git dependencies will always be reinstalled, because of how they're specified. +The installed committish might satisfy the dependency specifier (if it's something immutable, like a commit SHA), or it might not, so npm outdated and npm update have to fetch Git repos to check. +This is why currently doing a reinstall of a Git dependency always forces a new clone and install.
  • +
  • npm@3.5.2 is marked as "wanted", but "latest" is npm@3.5.1 because npm uses dist-tags to manage its latest and next release channels. +npm update will install the newest version, but npm install npm (with no semver range) will install whatever's tagged as latest.
  • +
  • once is just plain out of date. +Reinstalling node_modules from scratch or running npm update will bring it up to spec.
  • +
+

Configuration

+

all

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When running npm outdated and npm ls, setting --all will show all +outdated or installed packages, rather than only those directly depended +upon by the current project.

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

+

long

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Show extended information in ls, search, and help-search.

+

parseable

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Output parseable results from commands that write to standard output. For +npm search, this will be tab-separated table format.

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Operates in "global" mode, so that packages are installed into the prefix +folder instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

before

+
    +
  • Default: null
  • +
  • Type: null or Date
  • +
+

If passed to npm install, will rebuild the npm tree such that only +versions that were available on or before the given date are installed. +If there are no versions available for the current set of dependencies, the +command will error.

+

If the requested version is a dist-tag and the given tag does not pass the +--before filter, the most recent version less than or equal to that tag +will be used. For example, foo@latest might install foo@1.2 even though +latest is 2.0.

+

This config cannot be used with: min-release-age

+

min-release-age

+
    +
  • Default: null
  • +
  • Type: null or Number
  • +
+

If set, npm will build the npm tree such that only versions that were +available more than the given number of days ago will be installed. If there +are no versions available for the current set of dependencies, the command +will error.

+

This flag is a complement to before, which accepts an exact date instead +of a relative number of days.

+

This config cannot be used with: before

+

This value is not exported to the environment for child processes.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-owner.html b/node24/node_modules/npm/docs/output/commands/npm-owner.html new file mode 100644 index 0000000000000000000000000000000000000000..bd8ff9818ab11b26dc75be44f726f13e671e91bb --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-owner.html @@ -0,0 +1,294 @@ + + +npm-owner + + + + + +
+
+

+ npm-owner + @11.12.1 +

+Manage package owners +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm owner add <user> <package-spec>
+npm owner rm <user> <package-spec>
+npm owner ls <package-spec>
+
+alias: author
+
+

Description

+

Manage ownership of published packages.

+
    +
  • ls: List all the users who have access to modify a package and push new versions. +Handy when you need to know who to bug for help.
  • +
  • add: Add a new user as a maintainer of a package. +This user is enabled to modify metadata, publish new versions, and add other owners.
  • +
  • rm: Remove a user from the package owner list. +This immediately revokes their privileges.
  • +
+

Note that there is only one level of access. +Either you can modify a package, or you can't. +Future versions may contain more fine-grained access levels, but that is not implemented at this time.

+

If you have two-factor authentication enabled with auth-and-writes (see npm-profile) then you'll need to go through a second factor flow when changing ownership or include an otp on the command line with --otp.

+

Configuration

+

registry

+ +

The base URL of the npm registry.

+

otp

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with npm access.

+

If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-pack.html b/node24/node_modules/npm/docs/output/commands/npm-pack.html new file mode 100644 index 0000000000000000000000000000000000000000..e1218dfa743b6a263aad0b0b8f25cc82f0fcca27 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-pack.html @@ -0,0 +1,314 @@ + + +npm-pack + + + + + +
+
+

+ npm-pack + @11.12.1 +

+Create a tarball from a package +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm pack <package-spec>
+
+

Configuration

+

dry-run

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, install, update, +dedupe, uninstall, as well as pack and publish.

+

Note: This is NOT honored by other network related commands, eg dist-tags, +owner, etc.

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

+

pack-destination

+
    +
  • Default: "."
  • +
  • Type: String
  • +
+

Directory in which npm pack will save tarballs.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

Description

+

For anything that's installable (that is, a package folder, tarball, tarball url, git url, name@tag, name@version, name, or scoped name), this command will fetch it to the cache, copy the tarball to the current working directory as <name>-<version>.tgz, and then write the filenames out to stdout.

+

If the same package is specified multiple times, then the file will be overwritten the second time.

+

If no arguments are supplied, then npm packs the current package folder.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-ping.html b/node24/node_modules/npm/docs/output/commands/npm-ping.html new file mode 100644 index 0000000000000000000000000000000000000000..17b5de49651366efd6ca3ba552a46bb85833622a --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-ping.html @@ -0,0 +1,242 @@ + + +npm-ping + + + + + +
+
+

+ npm-ping + @11.12.1 +

+Ping npm registry +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm ping
+
+

Note: This command is unaware of workspaces.

+

Description

+

Ping the configured or given npm registry and verify authentication. +If it works it will output something like:

+
npm notice PING https://registry.npmjs.org/
+npm notice PONG 255ms
+
+

otherwise you will get an error:

+
npm notice PING http://foo.com/
+npm ERR! code E404
+npm ERR! 404 Not Found - GET http://www.foo.com/-/ping?write=true
+
+

Configuration

+

registry

+ +

The base URL of the npm registry.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-pkg.html b/node24/node_modules/npm/docs/output/commands/npm-pkg.html new file mode 100644 index 0000000000000000000000000000000000000000..12306b7e62e3aaa24e2464f89cc91ec145f1a746 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-pkg.html @@ -0,0 +1,389 @@ + + +npm-pkg + + + + + +
+
+

+ npm-pkg + @11.12.1 +

+Manages your package.json +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm pkg set <key>=<value> [<key>=<value> ...]
+npm pkg get [<key> [<key> ...]]
+npm pkg delete <key> [<key> ...]
+npm pkg set [<array>[<index>].<key>=<value> ...]
+npm pkg set [<array>[].<key>=<value> ...]
+npm pkg fix
+
+

Description

+

A command that automates the management of package.json files. +npm pkg provide 3 different sub commands that allow you to modify or retrieve values for given object keys in your package.json.

+

The syntax to retrieve and set fields is a dot separated representation of the nested object properties to be found within your package.json, it's the same notation used in npm view to retrieve information from the registry manifest, below you can find more examples on how to use it.

+

Returned values are always in json format.

+
    +
  • +

    npm pkg get <field>

    +

    Retrieves a value key, defined in your package.json file.

    +

    For example, in order to retrieve the name of the current package, you can run:

    +
    npm pkg get name
    +
    +

    It's also possible to retrieve multiple values at once:

    +
    npm pkg get name version
    +
    +

    You can view child fields by separating them with a period. +To retrieve the value of a test script value, you would run the following command:

    +
    npm pkg get scripts.test
    +
    +

    For fields that are arrays, requesting a non-numeric field will return all of the values from the objects in the list. +For example, to get all the contributor emails for a package, you would run:

    +
    npm pkg get contributors.email
    +
    +

    You may also use numeric indices in square braces to specifically select an item in an array field. +To just get the email address of the first contributor in the list, you can run:

    +
    npm pkg get contributors[0].email
    +
    +

    For complex fields you can also name a property in square brackets to specifically select a child field. +This is especially helpful with the exports object:

    +
    npm pkg get "exports[.].require"
    +
    +
  • +
  • +

    npm pkg set <field>=<value>

    +

    Sets a value in your package.json based on the field value. +When saving to your package.json file the same set of rules used during npm install and other cli commands that touches the package.json file are used, making sure to respect the existing indentation and possibly applying some validation prior to saving values to the file.

    +

    The same syntax used to retrieve values from your package can also be used to define new properties or overriding existing ones, below are some examples of how the dot separated syntax can be used to edit your package.json file.

    +

    Defining a new bin named mynewcommand in your package.json that points to a file cli.js:

    +
    npm pkg set bin.mynewcommand=cli.js
    +
    +

    Setting multiple fields at once is also possible:

    +
    npm pkg set description='Awesome package' engines.node='>=10'
    +
    +

    It's also possible to add to array values, for example to add a new contributor entry:

    +
    npm pkg set contributors[0].name='Foo' contributors[0].email='foo@bar.ca'
    +
    +

    You may also append items to the end of an array using the special empty bracket notation:

    +
    npm pkg set contributors[].name='Foo' contributors[].name='Bar'
    +
    +

    It's also possible to parse values as json prior to saving them to your package.json file, for example in order to set a "private": true property:

    +
    npm pkg set private=true --json
    +
    +

    It also enables saving values as numbers:

    +
    npm pkg set tap.timeout=60 --json
    +
    +
  • +
  • +

    npm pkg delete <key>

    +

    Deletes a key from your package.json

    +

    The same syntax used to set values from your package can also be used to remove existing ones. +For example, in order to remove a script named build:

    +
    npm pkg delete scripts.build
    +
    +
  • +
  • +

    npm pkg fix

    +

    Auto corrects common errors in your package.json. +npm already does this during publish, which leads to subtle (mostly harmless) differences between the contents of your package.json file and the manifest that npm uses during installation.

    +
  • +
+

Workspaces support

+

You can set/get/delete items across your configured workspaces by using the workspace or workspaces config options.

+

For example, setting a funding value across all configured workspaces of a project:

+
npm pkg set funding=https://example.com --ws
+
+

When using npm pkg get to retrieve info from your configured workspaces, the returned result will be in a json format in which top level keys are the names of each workspace, the values of these keys will be the result values returned from each of the configured workspaces, e.g:

+
npm pkg get name version --ws
+{
+  "a": {
+    "name": "a",
+    "version": "1.0.0"
+  },
+  "b": {
+    "name": "b",
+    "version": "1.0.0"
+  }
+}
+
+

Configuration

+

force

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Removes various protections against unfortunate side effects, common +mistakes, unnecessary performance degradation, and malicious input.

+
    +
  • Allow clobbering non-npm files in global installs.
  • +
  • Allow the npm version command to work on an unclean git repository.
  • +
  • Allow deleting the cache folder with npm cache clean.
  • +
  • Allow installing packages that have an engines declaration requiring a +different version of npm.
  • +
  • Allow installing packages that have an engines declaration requiring a +different version of node, even if --engine-strict is enabled.
  • +
  • Allow npm audit fix to install modules outside your stated dependency +range (including SemVer-major changes).
  • +
  • Allow unpublishing all versions of a published package.
  • +
  • Allow conflicting peerDependencies to be installed in the root project.
  • +
  • Implicitly set --yes during npm init.
  • +
  • Allow clobbering existing values in npm pkg
  • +
  • Allow unpublishing of entire packages (not just a single version).
  • +
+

If you don't have a clear idea of what you want to do, it is strongly +recommended that you do not use this option!

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-prefix.html b/node24/node_modules/npm/docs/output/commands/npm-prefix.html new file mode 100644 index 0000000000000000000000000000000000000000..b3a38d056630ce4e9cda751d608d75ec515bc220 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-prefix.html @@ -0,0 +1,252 @@ + + +npm-prefix + + + + + +
+
+

+ npm-prefix + @11.12.1 +

+Display prefix +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm prefix
+
+

Note: This command is unaware of workspaces.

+

Description

+

Print the local prefix to standard output. +This is the closest parent directory to contain a package.json file or node_modules directory, unless -g is also specified.

+

If -g is specified, this will be the value of the global prefix. +See npm config for more detail.

+

Example

+
npm prefix
+/usr/local/projects/foo
+
+
npm prefix -g
+/usr/local
+
+

Configuration

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Operates in "global" mode, so that packages are installed into the prefix +folder instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-profile.html b/node24/node_modules/npm/docs/output/commands/npm-profile.html new file mode 100644 index 0000000000000000000000000000000000000000..ca7146d71e446c04ef463761d56bc91f99aaef34 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-profile.html @@ -0,0 +1,309 @@ + + +npm-profile + + + + + +
+
+

+ npm-profile + @11.12.1 +

+Change settings on your registry profile +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm profile enable-2fa [auth-only|auth-and-writes]
+npm profile disable-2fa
+npm profile get [<key>]
+npm profile set <key> <value>
+
+

Note: This command is unaware of workspaces.

+

Description

+

Change your profile information on the registry. +Note that this command depends on the registry implementation, so third-party registries may not support this interface.

+
    +
  • npm profile get [<property>]: Display all of the properties of your profile, or one or more specific properties. +It looks like:
  • +
+
name: example
+email: e@example.com (verified)
+two-factor auth: auth-and-writes
+fullname: Example User
+homepage:
+freenode:
+twitter:
+github:
+created: 2015-02-26T01:38:35.892Z
+updated: 2017-10-02T21:29:45.922Z
+
+
    +
  • +

    npm profile set <property> <value>: Set the value of a profile property. +You can set the following properties this way: email, fullname, homepage, freenode, twitter, github

    +
  • +
  • +

    npm profile set password: Change your password. +This is interactive, you'll be prompted for your current password and a new password. +You'll also be prompted for an OTP if you have two-factor authentication enabled.

    +
  • +
  • +

    npm profile enable-2fa [auth-and-writes|auth-only]: Enables two-factor authentication. +Defaults to auth-and-writes mode. +Modes are:

    +
      +
    • auth-only: Require an OTP when logging in or making changes to your account's authentication. +The OTP will be required on both the website and the command line.
    • +
    • auth-and-writes: Requires an OTP at all the times auth-only does, and also requires one when publishing a module, setting the latest dist-tag, or changing access via npm access and npm owner.
    • +
    +
  • +
  • +

    npm profile disable-2fa: Disables two-factor authentication.

    +
  • +
+

Details

+

Some of these commands may not be available on non npmjs.com registries.

+

Configuration

+

registry

+ +

The base URL of the npm registry.

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

+

parseable

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Output parseable results from commands that write to standard output. For +npm search, this will be tab-separated table format.

+

otp

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with npm access.

+

If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-prune.html b/node24/node_modules/npm/docs/output/commands/npm-prune.html new file mode 100644 index 0000000000000000000000000000000000000000..b165187350f8471b081c2319f57672209ae4bae9 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-prune.html @@ -0,0 +1,352 @@ + + +npm-prune + + + + + +
+
+

+ npm-prune + @11.12.1 +

+Remove extraneous packages +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm prune [[<@scope>/]<pkg>...]
+
+

Description

+

This command removes "extraneous" packages. +If a package name is provided, then only packages matching one of the supplied names are removed.

+

Extraneous packages are those present in the node_modules folder that are not listed as any package's dependency list.

+

If the --omit=dev flag is specified or the NODE_ENV environment variable is set to production, this command will remove the packages specified in your devDependencies.

+

If the --dry-run flag is used then no changes will actually be made.

+

If the --json flag is used, then the changes npm prune made (or would have made with --dry-run) are printed as a JSON object.

+

In normal operation, extraneous modules are pruned automatically, so you'll only need this command with the --production flag. +However, in the real world, operation is not always "normal". When crashes or mistakes happen, this command can help clean up any resulting garbage.

+

Configuration

+

omit

+
    +
  • Default: 'dev' if the NODE_ENV environment variable is set to +'production'; otherwise, empty.
  • +
  • Type: "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Dependency types to omit from the installation tree on disk.

+

Note that these dependencies are still resolved and added to the +package-lock.json or npm-shrinkwrap.json file. They are just not +physically installed on disk.

+

If a package type appears in both the --include and --omit lists, then +it will be included.

+

If the resulting omit list includes 'dev', then the NODE_ENV environment +variable will be set to 'production' for all lifecycle scripts.

+

include

+
    +
  • Default:
  • +
  • Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Option that allows for defining which types of dependencies to install.

+

This is the inverse of --omit=<type>.

+

Dependency types specified in --include will not be omitted, regardless of +the order in which omit/include are specified on the command-line.

+

dry-run

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, install, update, +dedupe, uninstall, as well as pack and publish.

+

Note: This is NOT honored by other network related commands, eg dist-tags, +owner, etc.

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

+

foreground-scripts

+
    +
  • Default: false unless when using npm pack or npm publish where it +defaults to true
  • +
  • Type: Boolean
  • +
+

Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

+

Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging.

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-publish.html b/node24/node_modules/npm/docs/output/commands/npm-publish.html new file mode 100644 index 0000000000000000000000000000000000000000..787e4141d7af48595163985a0ec7393eb1e9cc50 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-publish.html @@ -0,0 +1,396 @@ + + +npm-publish + + + + + +
+
+

+ npm-publish + @11.12.1 +

+Publish a package +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm publish <package-spec>
+
+

Description

+

Publishes a package to the registry so that it can be installed by name.

+

Examples

+

Publish the package in the current directory:

+
npm publish
+
+

Publish a specific workspace:

+
npm publish --workspace=<workspace-name>
+
+

Publish multiple workspaces:

+
npm publish --workspace=workspace-a --workspace=workspace-b
+
+

Publish all workspaces:

+
npm publish --workspaces
+
+

By default npm will publish to the public registry. +This can be overridden by specifying a different default registry or using a scope in the name, combined with a scope-configured registry (see package.json).

+

A package is interpreted the same way as other commands (like npm install) and can be:

+
    +
  • a) a folder containing a program described by a package.json file
  • +
  • b) a gzipped tarball containing (a)
  • +
  • c) a url that resolves to (b)
  • +
  • d) a <name>@<version> that is published on the registry (see registry) with (c)
  • +
  • e) a <name>@<tag> (see npm dist-tag) that points to (d)
  • +
  • f) a <name> that has a "latest" tag satisfying (e)
  • +
  • g) a <git remote url> that resolves to (a)
  • +
+

If either (a) or (b) is specified as a relative path, it should begin with an explicit ./ prefix.

+

The publish will fail if the package name and version combination already exists in the specified registry.

+

Once a package is published with a given name and version, that specific name and version combination can never be used again, even if it is removed with npm unpublish.

+

As of npm@5, both a sha1sum and an integrity field with a sha512sum of the tarball will be submitted to the registry during publication. +Subsequent installs will use the strongest supported algorithm to verify downloads.

+

Similar to --dry-run see npm pack, which figures out the files to be included and packs them into a tarball to be uploaded to the registry.

+

Files included in package

+

To see what will be included in your package, run npm pack --dry-run. +All files are included by default, with the following exceptions:

+
    +
  • +

    Certain files that are relevant to package installation and distribution are always included. +For example, package.json, README.md, +LICENSE, and so on.

    +
  • +
  • +

    If there is a "files" list in package.json, then only the files specified will be included. +(If directories are specified, then they will be walked recursively and their contents included, subject to the same ignore rules.)

    +
  • +
  • +

    If there is a .gitignore or .npmignore file, then ignored files in that and all child directories will be excluded from the package. +If both files exist, then the .gitignore is ignored, and only the +.npmignore is used.

    +

    .npmignore files follow the same pattern rules as .gitignore files

    +
  • +
  • +

    If the file matches certain patterns, then it will never be included, unless explicitly added to the "files" list in package.json, or un-ignored with a ! rule in a .npmignore or .gitignore file.

    +
  • +
  • +

    Symbolic links are never included in npm packages.

    +
  • +
+

See developers for full details on what's included in the published package, as well as details on how the package is built.

+

See package.json for more info on what can and can't be ignored.

+

Configuration

+

tag

+
    +
  • Default: "latest"
  • +
  • Type: String
  • +
+

If you ask npm to install a package and don't tell it a specific version, +then it will install the specified tag.

+

It is the tag added to the package@version specified in the npm dist-tag add command, if no explicit tag is given.

+

When used by the npm diff command, this is the tag used to fetch the +tarball that will be compared with the local files by default.

+

If used in the npm publish command, this is the tag that will be added to +the package submitted to the registry.

+

access

+
    +
  • Default: 'public' for new packages, existing packages it will not change the +current level
  • +
  • Type: null, "restricted", or "public"
  • +
+

If you do not want your scoped package to be publicly viewable (and +installable) set --access=restricted.

+

Unscoped packages cannot be set to restricted.

+

Note: This defaults to not changing the current access level for existing +packages. Specifying a value of restricted or public during publish will +change the access for an existing package the same way that npm access set status would.

+

dry-run

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, install, update, +dedupe, uninstall, as well as pack and publish.

+

Note: This is NOT honored by other network related commands, eg dist-tags, +owner, etc.

+

otp

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with npm access.

+

If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+

provenance

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When publishing from a supported cloud CI/CD system, the package will be +publicly linked to where it was built and published from.

+

This config cannot be used with: provenance-file

+

provenance-file

+
    +
  • Default: null
  • +
  • Type: Path
  • +
+

When publishing, the provenance bundle at the given path will be used.

+

This config cannot be used with: provenance

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-query.html b/node24/node_modules/npm/docs/output/commands/npm-query.html new file mode 100644 index 0000000000000000000000000000000000000000..4f7e90da11bb032d9be0ccc9e047643720e437de --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-query.html @@ -0,0 +1,434 @@ + + +npm-query + + + + + +
+
+

+ npm-query + @11.12.1 +

+Dependency selector query +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm query <selector>
+
+

Description

+

The npm query command allows for usage of css selectors in order to retrieve an array of dependency objects.

+

Piping npm query to other commands

+
# find all dependencies with postinstall scripts & uninstall them
+npm query ":attr(scripts, [postinstall])" | jq 'map(.name)|join("\n")' -r | xargs -I {} npm uninstall {}
+
+# find all git dependencies & explain who requires them
+npm query ":type(git)" | jq 'map(.name)' | xargs -I {} npm why {}
+
+

Extended Use Cases & Queries

+
// all deps
+*
+
+// all direct deps
+:root > *
+
+// direct production deps
+:root > .prod
+
+// direct development deps
+:root > .dev
+
+// any peer dep of a direct deps
+:root > * > .peer
+
+// any workspace dep
+.workspace
+
+// all workspaces that depend on another workspace
+.workspace > .workspace
+
+// all workspaces that have peer deps
+.workspace:has(.peer)
+
+// any dep named "lodash"
+// equivalent to [name="lodash"]
+#lodash
+
+// any deps named "lodash" & within semver range ^"1.2.3"
+#lodash@^1.2.3
+// equivalent to...
+[name="lodash"]:semver(^1.2.3)
+
+// get the hoisted node for a given semver range
+#lodash@^1.2.3:not(:deduped)
+
+// querying deps with a specific version
+#lodash@2.1.5
+// equivalent to...
+[name="lodash"][version="2.1.5"]
+
+// has any deps
+:has(*)
+
+// deps with no other deps (ie. "leaf" nodes)
+:empty
+
+// manually querying git dependencies
+[repository^=github:],
+[repository^=git:],
+[repository^=https://github.com],
+[repository^=http://github.com],
+[repository^=https://github.com],
+[repository^=+git:...]
+
+// querying for all git dependencies
+:type(git)
+
+// get production dependencies that aren't also dev deps
+.prod:not(.dev)
+
+// get dependencies with specific licenses
+[license=MIT], [license=ISC]
+
+// find all packages that have @ruyadorno as a contributor
+:attr(contributors, [email=ruyadorno@github.com])
+
+

Example Response Output

+
    +
  • an array of dependency objects is returned which can contain multiple copies of the same package which may or may not have been linked or deduped
  • +
+
[
+  {
+    "name": "",
+    "version": "",
+    "description": "",
+    "homepage": "",
+    "bugs": {},
+    "author": {},
+    "license": {},
+    "funding": {},
+    "files": [],
+    "main": "",
+    "browser": "",
+    "bin": {},
+    "man": [],
+    "directories": {},
+    "repository": {},
+    "scripts": {},
+    "config": {},
+    "dependencies": {},
+    "devDependencies": {},
+    "optionalDependencies": {},
+    "bundledDependencies": {},
+    "peerDependencies": {},
+    "peerDependenciesMeta": {},
+    "engines": {},
+    "os": [],
+    "cpu": [],
+    "workspaces": {},
+    "keywords": [],
+    ...
+  },
+  ...
+
+

Expecting a certain number of results

+

One common use of npm query is to make sure there is only one version of a certain dependency in your tree. +This is especially common for ecosystems like that rely on typescript where having state split across two different but identically-named packages causes bugs. +You can use the --expect-results or --expect-result-count in your setup to ensure that npm will exit with an exit code if your tree doesn't look like you want it to.

+
$ npm query '#react' --expect-result-count=1
+
+

Perhaps you want to quickly check if there are any production dependencies that could be updated:

+
$ npm query ':root>:outdated(in-range).prod' --no-expect-results
+
+

Package lock only mode

+

If package-lock-only is enabled, only the information in the package lock (or shrinkwrap) is loaded. +This means that information from the package.json files of your dependencies will not be included in the result set (e.g. description, homepage, engines).

+

Configuration

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Operates in "global" mode, so that packages are installed into the prefix +folder instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+

package-lock-only

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, the current operation will only use the package-lock.json, +ignoring node_modules.

+

For update this means only the package-lock.json will be updated, +instead of checking node_modules and downloading dependencies.

+

For list this means the output will be based on the tree described by the +package-lock.json, rather than the contents of node_modules.

+

expect-results

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Tells npm whether or not to expect results from the command. Can be either +true (expect some results) or false (expect no results).

+

This config cannot be used with: expect-result-count

+

expect-result-count

+
    +
  • Default: null
  • +
  • Type: null or Number
  • +
+

Tells to expect a specific number of results from the command.

+

This config cannot be used with: expect-results

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-rebuild.html b/node24/node_modules/npm/docs/output/commands/npm-rebuild.html new file mode 100644 index 0000000000000000000000000000000000000000..da4e478fb846561637028c85359609322b4b303a --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-rebuild.html @@ -0,0 +1,343 @@ + + +npm-rebuild + + + + + +
+
+

+ npm-rebuild + @11.12.1 +

+Rebuild a package +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm rebuild [<package-spec>] ...]
+
+alias: rb
+
+

Description

+

This command does the following:

+
    +
  1. Execute lifecycle scripts (preinstall, install, postinstall, prepare)
  2. +
  3. Links bins depending on whether bin links are enabled
  4. +
+

This command is particularly useful in scenarios including but not limited to:

+
    +
  1. Installing a new version of node.js, where you need to recompile all your C++ add-ons with the updated binary.
  2. +
  3. Installing with --ignore-scripts and --no-bin-links, to explicitly choose which packages to build and/or link bins.
  4. +
+

If one or more package specs are provided, then only packages with a name and version matching one of the specifiers will be rebuilt.

+

Usually, you should not need to run npm rebuild as it is already done for you as part of npm install (unless you suppressed these steps with --ignore-scripts or --no-bin-links).

+

If there is a binding.gyp file in the root of your package, then npm will use a default install hook:

+
"scripts": {
+    "install": "node-gyp rebuild"
+}
+
+

This default behavior is suppressed if the package.json has its own install or preinstall scripts. +It is also suppressed if the package specifies "gypfile": false

+

Configuration

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Operates in "global" mode, so that packages are installed into the prefix +folder instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+ +
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Tells npm to create symlinks (or .cmd shims on Windows) for package +executables.

+

Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems.

+

foreground-scripts

+
    +
  • Default: false unless when using npm pack or npm publish where it +defaults to true
  • +
  • Type: Boolean
  • +
+

Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

+

Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging.

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-repo.html b/node24/node_modules/npm/docs/output/commands/npm-repo.html new file mode 100644 index 0000000000000000000000000000000000000000..b86e7c0445dc29b4886164f4ffeb844a166cdb10 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-repo.html @@ -0,0 +1,286 @@ + + +npm-repo + + + + + +
+
+

+ npm-repo + @11.12.1 +

+Open package repository page in the browser +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm repo [<pkgname> [<pkgname> ...]]
+
+

Description

+

This command tries to guess at the likely location of a package's repository URL, and then tries to open it using the --browser config param. +If no package name is provided, it will search for a package.json in the current folder and use the repository property.

+

Configuration

+

browser

+
    +
  • Default: macOS: "open", Windows: "start", Others: "xdg-open"
  • +
  • Type: null, Boolean, or String
  • +
+

The browser that is called by npm commands to open websites.

+

Set to false to suppress browser behavior and instead print urls to +terminal.

+

Set to true to use default system URL opener.

+

registry

+ +

The base URL of the npm registry.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-restart.html b/node24/node_modules/npm/docs/output/commands/npm-restart.html new file mode 100644 index 0000000000000000000000000000000000000000..e4668c09e9d71e132659a30910bb349ae21806ce --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-restart.html @@ -0,0 +1,263 @@ + + +npm-restart + + + + + +
+
+

+ npm-restart + @11.12.1 +

+Restart a package +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm restart [-- <args>]
+
+

Description

+

This restarts a project. +It is equivalent to running npm run restart.

+

If the current project has a "restart" script specified in package.json, then the following scripts will be run:

+
    +
  1. prerestart
  2. +
  3. restart
  4. +
  5. postrestart
  6. +
+

If it does not have a "restart" script specified, but it does have stop and/or start scripts, then the following scripts will be run:

+
    +
  1. prerestart
  2. +
  3. prestop
  4. +
  5. stop
  6. +
  7. poststop
  8. +
  9. prestart
  10. +
  11. start
  12. +
  13. poststart
  14. +
  15. postrestart
  16. +
+

Configuration

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

script-shell

+
    +
  • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
  • +
  • Type: null or String
  • +
+

The shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-root.html b/node24/node_modules/npm/docs/output/commands/npm-root.html new file mode 100644 index 0000000000000000000000000000000000000000..0d682ea322dbf54119670427b4ca1146c0de70d0 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-root.html @@ -0,0 +1,248 @@ + + +npm-root + + + + + +
+
+

+ npm-root + @11.12.1 +

+Display npm root +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm root
+
+

Note: This command is unaware of workspaces.

+

Description

+

Print the effective node_modules folder to standard out.

+

Useful for using npm in shell scripts that do things with the node_modules folder. +For example:

+
#!/bin/bash
+global_node_modules="$(npm root --global)"
+echo "Global packages installed in: ${global_node_modules}"
+
+

Configuration

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Operates in "global" mode, so that packages are installed into the prefix +folder instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-run.html b/node24/node_modules/npm/docs/output/commands/npm-run.html new file mode 100644 index 0000000000000000000000000000000000000000..d521a1673a401b8400398f00b719c87c2427026b --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-run.html @@ -0,0 +1,376 @@ + + +npm-run + + + + + +
+
+

+ npm-run + @11.12.1 +

+Run arbitrary package scripts +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm run <command> [-- <args>]
+
+aliases: run-script, rum, urn
+
+

Description

+

This runs an arbitrary command from a package's "scripts" object. +If no +"command" is provided, it will list the available scripts.

+

run[-script] is used by the test, start, restart, and stop commands, but can be called directly, as well. +When the scripts in the package are printed out, they're separated into lifecycle (test, start, restart) and directly-run scripts.

+

Any positional arguments are passed to the specified script. +Use -- to pass --prefixed flags and options which would otherwise be parsed by npm.

+

For example:

+
npm run test -- --grep="pattern"
+
+

The arguments will only be passed to the script specified after npm run and not to any pre or post script.

+

The env script is a special built-in command that can be used to list environment variables that will be available to the script at runtime. +If an "env" command is defined in your package, it will take precedence over the built-in.

+

In addition to the shell's pre-existing PATH, npm run adds node_modules/.bin to the PATH provided to scripts. +Any binaries provided by locally-installed dependencies can be used without the node_modules/.bin prefix. +For example, if there is a devDependency on tap in your package, you should write:

+
"scripts": {"test": "tap test/*.js"}
+
+

instead of

+
"scripts": {"test": "node_modules/.bin/tap test/*.js"}
+
+

The actual shell your script is run within is platform dependent. +By default, on Unix-like systems it is the /bin/sh command, on Windows it is cmd.exe. +The actual shell referred to by /bin/sh also depends on the system. +You can customize the shell with the script-shell config.

+

Scripts are run from the root of the package folder, regardless of what the current working directory is when npm run is called. +If you want your script to use different behavior based on what subdirectory you're in, you can use the INIT_CWD environment variable, which holds the full path you were in when you ran npm run.

+

npm run sets the NODE environment variable to the node executable with which npm is executed.

+

If you try to run a script without having a node_modules directory and it fails, you will be given a warning to run npm install, just in case you've forgotten.

+

Workspaces support

+

You may use the workspace or workspaces configs in order to run an arbitrary command from a package's "scripts" object in the context of the specified workspaces. +If no "command" is provided, it will list the available scripts for each of these configured workspaces.

+

Given a project with configured workspaces, e.g:

+
.
++-- package.json
+`-- packages
+   +-- a
+   |   `-- package.json
+   +-- b
+   |   `-- package.json
+   `-- c
+       `-- package.json
+
+

Assuming the workspace configuration is properly set up at the root level package.json file. +e.g:

+
{
+    "workspaces": [ "./packages/*" ]
+}
+
+

And that each of the configured workspaces has a configured test script, we can run tests in all of them using the workspaces config:

+
npm test --workspaces
+
+

Filtering workspaces

+

It's also possible to run a script in a single workspace using the workspace config along with a name or directory path:

+
npm test --workspace=a
+
+

The workspace config can also be specified multiple times in order to run a specific script in the context of multiple workspaces. +When defining values for the workspace config in the command line, it also possible to use -w as a shorthand, e.g:

+
npm test -w a -w b
+
+

This last command will run test in both ./packages/a and ./packages/b packages.

+

Configuration

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+

if-present

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm will not exit with an error code when run is invoked for a +script that isn't defined in the scripts section of package.json. This +option can be used when it's desirable to optionally run a script when it's +present and fail if the script fails. This is useful, for example, when +running scripts that may only apply for some builds in an otherwise generic +CI setup.

+

This value is not exported to the environment for child processes.

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

foreground-scripts

+
    +
  • Default: false unless when using npm pack or npm publish where it +defaults to true
  • +
  • Type: Boolean
  • +
+

Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

+

Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging.

+

script-shell

+
    +
  • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
  • +
  • Type: null or String
  • +
+

The shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-sbom.html b/node24/node_modules/npm/docs/output/commands/npm-sbom.html new file mode 100644 index 0000000000000000000000000000000000000000..d3b538683d7432feb6f5e732c7ca295fdd3bb3e9 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-sbom.html @@ -0,0 +1,490 @@ + + +npm-sbom + + + + + +
+
+

+ npm-sbom + @11.12.1 +

+Generate a Software Bill of Materials (SBOM) +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm sbom
+
+

Description

+

The npm sbom command generates a Software Bill of Materials (SBOM) listing the dependencies for the current project. +SBOMs can be generated in either SPDX or CycloneDX format.

+

Example CycloneDX SBOM

+
{
+  "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
+  "bomFormat": "CycloneDX",
+  "specVersion": "1.5",
+  "serialNumber": "urn:uuid:09f55116-97e1-49cf-b3b8-44d0207e7730",
+  "version": 1,
+  "metadata": {
+    "timestamp": "2023-09-01T00:00:00.001Z",
+    "lifecycles": [
+      {
+        "phase": "build"
+      }
+    ],
+    "tools": [
+      {
+        "vendor": "npm",
+        "name": "cli",
+        "version": "10.1.0"
+      }
+    ],
+    "component": {
+      "bom-ref": "simple@1.0.0",
+      "type": "library",
+      "name": "simple",
+      "version": "1.0.0",
+      "scope": "required",
+      "author": "John Doe",
+      "description": "simple react app",
+      "purl": "pkg:npm/simple@1.0.0",
+      "properties": [
+        {
+          "name": "cdx:npm:package:path",
+          "value": ""
+        }
+      ],
+      "externalReferences": [],
+      "licenses": [
+        {
+          "license": {
+            "id": "MIT"
+          }
+        }
+      ]
+    }
+  },
+  "components": [
+    {
+      "bom-ref": "lodash@4.17.21",
+      "type": "library",
+      "name": "lodash",
+      "version": "4.17.21",
+      "scope": "required",
+      "author": "John-David Dalton",
+      "description": "Lodash modular utilities.",
+      "purl": "pkg:npm/lodash@4.17.21",
+      "properties": [
+        {
+          "name": "cdx:npm:package:path",
+          "value": "node_modules/lodash"
+        }
+      ],
+      "externalReferences": [
+        {
+          "type": "distribution",
+          "url": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz"
+        },
+        {
+          "type": "vcs",
+          "url": "git+https://github.com/lodash/lodash.git"
+        },
+        {
+          "type": "website",
+          "url": "https://lodash.com/"
+        },
+        {
+          "type": "issue-tracker",
+          "url": "https://github.com/lodash/lodash/issues"
+        }
+      ],
+      "hashes": [
+        {
+          "alg": "SHA-512",
+          "content": "bf690311ee7b95e713ba568322e3533f2dd1cb880b189e99d4edef13592b81764daec43e2c54c61d5c558dc5cfb35ecb85b65519e74026ff17675b6f8f916f4a"
+        }
+      ],
+      "licenses": [
+        {
+          "license": {
+            "id": "MIT"
+          }
+        }
+      ]
+    }
+  ],
+  "dependencies": [
+    {
+      "ref": "simple@1.0.0",
+      "dependsOn": [
+        "lodash@4.17.21"
+      ]
+    },
+    {
+      "ref": "lodash@4.17.21",
+      "dependsOn": []
+    }
+  ]
+}
+
+

Example SPDX SBOM

+
{
+  "spdxVersion": "SPDX-2.3",
+  "dataLicense": "CC0-1.0",
+  "SPDXID": "SPDXRef-DOCUMENT",
+  "name": "simple@1.0.0",
+  "documentNamespace": "http://spdx.org/spdxdocs/simple-1.0.0-bf81090e-8bbc-459d-bec9-abeb794e096a",
+  "creationInfo": {
+    "created": "2023-09-01T00:00:00.001Z",
+    "creators": [
+      "Tool: npm/cli-10.1.0"
+    ]
+  },
+  "documentDescribes": [
+    "SPDXRef-Package-simple-1.0.0"
+  ],
+  "packages": [
+    {
+      "name": "simple",
+      "SPDXID": "SPDXRef-Package-simple-1.0.0",
+      "versionInfo": "1.0.0",
+      "packageFileName": "",
+      "description": "simple react app",
+      "primaryPackagePurpose": "LIBRARY",
+      "downloadLocation": "NOASSERTION",
+      "filesAnalyzed": false,
+      "homepage": "NOASSERTION",
+      "licenseDeclared": "MIT",
+      "externalRefs": [
+        {
+          "referenceCategory": "PACKAGE-MANAGER",
+          "referenceType": "purl",
+          "referenceLocator": "pkg:npm/simple@1.0.0"
+        }
+      ]
+    },
+    {
+      "name": "lodash",
+      "SPDXID": "SPDXRef-Package-lodash-4.17.21",
+      "versionInfo": "4.17.21",
+      "packageFileName": "node_modules/lodash",
+      "description": "Lodash modular utilities.",
+      "downloadLocation": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+      "filesAnalyzed": false,
+      "homepage": "https://lodash.com/",
+      "licenseDeclared": "MIT",
+      "externalRefs": [
+        {
+          "referenceCategory": "PACKAGE-MANAGER",
+          "referenceType": "purl",
+          "referenceLocator": "pkg:npm/lodash@4.17.21"
+        }
+      ],
+      "checksums": [
+        {
+          "algorithm": "SHA512",
+          "checksumValue": "bf690311ee7b95e713ba568322e3533f2dd1cb880b189e99d4edef13592b81764daec43e2c54c61d5c558dc5cfb35ecb85b65519e74026ff17675b6f8f916f4a"
+        }
+      ]
+    }
+  ],
+  "relationships": [
+    {
+      "spdxElementId": "SPDXRef-DOCUMENT",
+      "relatedSpdxElement": "SPDXRef-Package-simple-1.0.0",
+      "relationshipType": "DESCRIBES"
+    },
+    {
+      "spdxElementId": "SPDXRef-Package-simple-1.0.0",
+      "relatedSpdxElement": "SPDXRef-Package-lodash-4.17.21",
+      "relationshipType": "DEPENDS_ON"
+    }
+  ]
+}
+
+

Package lock only mode

+

If package-lock-only is enabled, only the information in the package lock (or shrinkwrap) is loaded. +This means that information from the package.json files of your dependencies will not be included in the result set (e.g. +description, homepage, engines).

+

Configuration

+

omit

+
    +
  • Default: 'dev' if the NODE_ENV environment variable is set to +'production'; otherwise, empty.
  • +
  • Type: "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Dependency types to omit from the installation tree on disk.

+

Note that these dependencies are still resolved and added to the +package-lock.json or npm-shrinkwrap.json file. They are just not +physically installed on disk.

+

If a package type appears in both the --include and --omit lists, then +it will be included.

+

If the resulting omit list includes 'dev', then the NODE_ENV environment +variable will be set to 'production' for all lifecycle scripts.

+

package-lock-only

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, the current operation will only use the package-lock.json, +ignoring node_modules.

+

For update this means only the package-lock.json will be updated, +instead of checking node_modules and downloading dependencies.

+

For list this means the output will be based on the tree described by the +package-lock.json, rather than the contents of node_modules.

+

sbom-format

+
    +
  • Default: null
  • +
  • Type: "cyclonedx" or "spdx"
  • +
+

SBOM format to use when generating SBOMs.

+

sbom-type

+
    +
  • Default: "library"
  • +
  • Type: "library", "application", or "framework"
  • +
+

The type of package described by the generated SBOM. For SPDX, this is the +value for the primaryPackagePurpose field. For CycloneDX, this is the +value for the type field.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-search.html b/node24/node_modules/npm/docs/output/commands/npm-search.html new file mode 100644 index 0000000000000000000000000000000000000000..e2901328ea372a256f25e046dd98f9d7cdecc1c4 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-search.html @@ -0,0 +1,320 @@ + + +npm-search + + + + + +
+
+

+ npm-search + @11.12.1 +

+Search for packages +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm search <search term> [<search term> ...]
+
+aliases: find, s, se
+
+

Note: This command is unaware of workspaces.

+

Description

+

Search the registry for packages matching the search terms. +npm search +performs a linear, incremental, lexically-ordered search through package metadata for all files in the registry. +If your terminal has color support, it will further highlight the matches in the results. +This can be disabled with the config item color

+

Additionally, using the --searchopts and --searchexclude options paired with more search terms will include and exclude further patterns. +The main difference between --searchopts and the standard search terms is that the former does not highlight results in the output and you can use them more fine-grained filtering. +Additionally, you can add both of these to your config to change default search filtering behavior.

+

Search also allows targeting of maintainers in search results, by prefixing their npm username with =.

+

If a term starts with /, then it's interpreted as a regular expression and supports standard JavaScript RegExp syntax. +In this case search will ignore a trailing / . (Note you must escape or quote many regular expression characters in most shells.)

+

Configuration

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

+

color

+
    +
  • Default: true unless the NO_COLOR environ is set to something other than '0'
  • +
  • Type: "always" or Boolean
  • +
+

If false, never shows colors. If "always" then always shows colors. If +true, then only prints color codes for tty file descriptors.

+

parseable

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Output parseable results from commands that write to standard output. For +npm search, this will be tab-separated table format.

+

description

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Show the description in npm search

+

searchlimit

+
    +
  • Default: 20
  • +
  • Type: Number
  • +
+

Number of items to limit search results to. Will not apply at all to legacy +searches.

+

searchopts

+
    +
  • Default: ""
  • +
  • Type: String
  • +
+

Space-separated options that are always passed to search.

+

searchexclude

+
    +
  • Default: ""
  • +
  • Type: String
  • +
+

Space-separated options that limit the results from search.

+

registry

+ +

The base URL of the npm registry.

+

prefer-online

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, staleness checks for cached data will be forced, making the CLI +look for updates immediately even for fresh package data.

+

prefer-offline

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, staleness checks for cached data will be bypassed, but missing data +will be requested from the server. To force full offline mode, use +--offline.

+

offline

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Force offline mode: no network requests will be done during install. To +allow the CLI to fill in missing cache data, see --prefer-offline.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-set.html b/node24/node_modules/npm/docs/output/commands/npm-set.html new file mode 100644 index 0000000000000000000000000000000000000000..8d1c559a622c466390c7360f92fb5f43b138de2c --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-set.html @@ -0,0 +1,255 @@ + + +npm-set + + + + + +
+
+

+ npm-set + @11.12.1 +

+Set a value in the npm configuration +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm set <key>=<value> [<key>=<value> ...] (See `npm config`)
+
+

Note: This command is unaware of workspaces.

+

Description

+

Set a value in the npm configuration

+

Configuration

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Operates in "global" mode, so that packages are installed into the prefix +folder instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

location

+
    +
  • Default: "user" unless --global is passed, which will also set this value +to "global"
  • +
  • Type: "global", "user", or "project"
  • +
+

When passed to npm config this refers to which config file to use.

+

When set to "global" mode, packages are installed into the prefix folder +instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-shrinkwrap.html b/node24/node_modules/npm/docs/output/commands/npm-shrinkwrap.html new file mode 100644 index 0000000000000000000000000000000000000000..c2e41857f55d5a2a4dbdd07e6fd7cf1aa26e7f25 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-shrinkwrap.html @@ -0,0 +1,232 @@ + + +npm-shrinkwrap + + + + + +
+
+

+ npm-shrinkwrap + @11.12.1 +

+Lock down dependency versions for publication +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm shrinkwrap
+
+

Note: This command is unaware of workspaces.

+

Description

+

This command repurposes package-lock.json into a publishable npm-shrinkwrap.json or simply creates a new one. +The file created and updated by this command will then take precedence over any other existing or future package-lock.json files. +For a detailed explanation of the design and purpose of package locks in npm, see package-lock-json.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-star.html b/node24/node_modules/npm/docs/output/commands/npm-star.html new file mode 100644 index 0000000000000000000000000000000000000000..74dd0a8be4f333eb083c9424a6deb9f93108d00b --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-star.html @@ -0,0 +1,263 @@ + + +npm-star + + + + + +
+
+

+ npm-star + @11.12.1 +

+Mark your favorite packages +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm star [<package-spec>...]
+
+

Note: This command is unaware of workspaces.

+

Description

+

"Starring" a package means that you have some interest in it. +It's a vaguely positive way to show that you care.

+

It's a boolean thing. +Starring repeatedly has no additional effect.

+

More

+

There's also these extra commands to help you manage your favorite packages:

+

Unstar

+

You can also "unstar" a package using npm unstar

+

"Unstarring" is the same thing, but in reverse.

+

Listing stars

+

You can see all your starred packages using npm stars

+

Configuration

+

registry

+ +

The base URL of the npm registry.

+

unicode

+
    +
  • Default: false on windows, true on mac/unix systems with a unicode locale, +as defined by the LC_ALL, LC_CTYPE, or LANG environment variables.
  • +
  • Type: Boolean
  • +
+

When set to true, npm uses unicode characters in the tree output. When +false, it uses ascii characters instead of unicode glyphs.

+

otp

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with npm access.

+

If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-stars.html b/node24/node_modules/npm/docs/output/commands/npm-stars.html new file mode 100644 index 0000000000000000000000000000000000000000..9840d1b6ca91fac14edc9be6f918e10d8a59f1fb --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-stars.html @@ -0,0 +1,236 @@ + + +npm-stars + + + + + +
+
+

+ npm-stars + @11.12.1 +

+View packages marked as favorites +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm stars [<user>]
+
+

Note: This command is unaware of workspaces.

+

Description

+

If you have starred a lot of neat things and want to find them again quickly this command lets you do just that.

+

You may also want to see your friend's favorite packages, in this case you will most certainly enjoy this command.

+

Configuration

+

registry

+ +

The base URL of the npm registry.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-start.html b/node24/node_modules/npm/docs/output/commands/npm-start.html new file mode 100644 index 0000000000000000000000000000000000000000..016b861322ddec613ba65a69f15267aba959e6ac --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-start.html @@ -0,0 +1,263 @@ + + +npm-start + + + + + +
+
+

+ npm-start + @11.12.1 +

+Start a package +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm start [-- <args>]
+
+

Description

+

This runs a predefined command specified in the "start" property of a package's "scripts" object.

+

If the "scripts" object does not define a "start" property, npm will run node server.js.

+

Note that this is different from the default node behavior of running the file specified in a package's "main" attribute when evoking with node .

+

As of npm@2.0.0, you can use custom arguments when executing scripts. +Refer to npm run for more details.

+

Example

+
{
+  "scripts": {
+    "start": "node foo.js"
+  }
+}
+
+
npm start
+
+> npm@x.x.x start
+> node foo.js
+
+(foo.js output would be here)
+
+
+

Configuration

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

script-shell

+
    +
  • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
  • +
  • Type: null or String
  • +
+

The shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-stop.html b/node24/node_modules/npm/docs/output/commands/npm-stop.html new file mode 100644 index 0000000000000000000000000000000000000000..3934a3ba39faa0e5207e6f4e575b70ca26dd0a1b --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-stop.html @@ -0,0 +1,260 @@ + + +npm-stop + + + + + +
+
+

+ npm-stop + @11.12.1 +

+Stop a package +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm stop [-- <args>]
+
+

Description

+

This runs a predefined command specified in the "stop" property of a package's "scripts" object.

+

Unlike with npm start, there is no default script that will run if the "stop" property is not defined.

+

Example

+
{
+  "scripts": {
+    "stop": "node bar.js"
+  }
+}
+
+
npm stop
+
+> npm@x.x.x stop
+> node bar.js
+
+(bar.js output would be here)
+
+
+

Configuration

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

script-shell

+
    +
  • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
  • +
  • Type: null or String
  • +
+

The shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-team.html b/node24/node_modules/npm/docs/output/commands/npm-team.html new file mode 100644 index 0000000000000000000000000000000000000000..682c67a6f367777f4652dd59d89734889d649df5 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-team.html @@ -0,0 +1,314 @@ + + +npm-team + + + + + +
+
+

+ npm-team + @11.12.1 +

+Manage organization teams and team memberships +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm team create <scope:team> [--otp <otpcode>]
+npm team destroy <scope:team> [--otp <otpcode>]
+npm team add <scope:team> <user> [--otp <otpcode>]
+npm team rm <scope:team> <user> [--otp <otpcode>]
+npm team ls <scope>|<scope:team>
+
+

Note: This command is unaware of workspaces.

+

Description

+

Used to manage teams in organizations, and change team memberships. +Does not handle permissions for packages.

+

Teams must always be fully qualified with the organization/scope they belong to when operating on them, separated by a colon (:). +That is, if you have a newteam team in an org organization, you must always refer to that team as @org:newteam in these commands.

+

If you have two-factor authentication enabled in auth-and-writes mode, then you can provide a code from your authenticator with [--otp <otpcode>]. +If you don't include this then you will be taken through a second factor flow based on your authtype.

+
    +
  • +

    create / destroy: +Create a new team, or destroy an existing one. +Note: You cannot remove the developers team, learn more.

    +

    Here's how to create a new team newteam under the org org:

    +
    npm team create @org:newteam
    +
    +

    You should see a confirming message such as: +@org:newteam once the new team has been created.

    +
  • +
  • +

    add: +Add a user to an existing team.

    +

    Adding a new user username to a team named newteam under the org org:

    +
    npm team add @org:newteam username
    +
    +

    On success, you should see a message: username added to @org:newteam

    +
  • +
  • +

    rm: +Using npm team rm you can also remove users from a team they belong to.

    +

    Here's an example removing user username from newteam team in org organization:

    +
    npm team rm @org:newteam username
    +
    +

    Once the user is removed a confirmation message is displayed: +username removed from @org:newteam

    +
  • +
  • +

    ls: +If performed on an organization name, will return a list of existing teams under that organization. +If performed on a team, it will instead return a list of all users belonging to that particular team.

    +

    Here's an example of how to list all teams from an org named org:

    +
    npm team ls @org
    +
    +

    Example listing all members of a team named newteam:

    +
    npm team ls @org:newteam
    +
    +
  • +
+

Details

+

npm team always operates directly on the current registry, configurable from the command line using --registry=<registry url>.

+

You must be a team admin to create teams and manage team membership, under the given organization. +Listing teams and team memberships may be done by any member of the organization.

+

Organization creation and management of team admins and organization members is done through the website, not the npm CLI.

+

To use teams to manage permissions on packages belonging to your organization, use the npm access command to grant or revoke the appropriate permissions.

+

Configuration

+

registry

+ +

The base URL of the npm registry.

+

otp

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with npm access.

+

If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one.

+

parseable

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Output parseable results from commands that write to standard output. For +npm search, this will be tab-separated table format.

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-test.html b/node24/node_modules/npm/docs/output/commands/npm-test.html new file mode 100644 index 0000000000000000000000000000000000000000..9bd30aca5f30a653f9c190a84e441b2c9bf0d3d1 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-test.html @@ -0,0 +1,259 @@ + + +npm-test + + + + + +
+
+

+ npm-test + @11.12.1 +

+Test a package +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm test [-- <args>]
+
+aliases: tst, t
+
+

Description

+

This runs a predefined command specified in the "test" property of a package's "scripts" object.

+

Example

+
{
+  "scripts": {
+    "test": "node test.js"
+  }
+}
+
+
npm test
+> npm@x.x.x test
+> node test.js
+
+(test.js output would be here)
+
+

Configuration

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

script-shell

+
    +
  • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
  • +
  • Type: null or String
  • +
+

The shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-token.html b/node24/node_modules/npm/docs/output/commands/npm-token.html new file mode 100644 index 0000000000000000000000000000000000000000..f3d2c242847e32be4ebfa7b91eb754e88815a8ed --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-token.html @@ -0,0 +1,351 @@ + + +npm-token + + + + + +
+
+

+ npm-token + @11.12.1 +

+Manage your authentication tokens +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm token list
+npm token revoke <id|token>
+npm token create
+
+

Note: This command is unaware of workspaces.

+

Description

+

This lets you list, create and revoke authentication tokens.

+

Listing tokens

+

When listing tokens, an abbreviated token will be displayed. For security purposes the full token is not displayed.

+

Generating tokens

+

When generating tokens, you will be prompted you for your password and, if you have two-factor authentication enabled, an otp.

+

Please refer to the docs website for more information on generating tokens for CI/CD.

+

Revoking tokens

+

When revoking a token, you can use the full token (e.g. what you get back from npm token create, or as can be found in an .npmrc file), or a truncated id. If the given truncated id is not distinct enough to differentiate between multiple existing tokens, you will need to use enough of the id to allow npm to distinguish between them. Full token ids can be found on the npm website, or in the --parseable or --json output of npm token list. This command will NOT accept the truncated token found in the normal npm token list output.

+

A revoked token will immediately be removed from the registry and you will no longer be able to use it.

+

Configuration

+

name

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

When creating a Granular Access Token with npm token create, this sets the +name/description for the token.

+

token-description

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

Description text for the token when using npm token create.

+

expires

+
    +
  • Default: null
  • +
  • Type: null or Number
  • +
+

When creating a Granular Access Token with npm token create, this sets the +expiration in days. If not specified, the server will determine the default +expiration.

+

packages

+
    +
  • Default:
  • +
  • Type: null or String (can be set multiple times)
  • +
+

When creating a Granular Access Token with npm token create, this limits +the token access to specific packages.

+

packages-all

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When creating a Granular Access Token with npm token create, grants the +token access to all packages instead of limiting to specific packages.

+

scopes

+
    +
  • Default: null
  • +
  • Type: null or String (can be set multiple times)
  • +
+

When creating a Granular Access Token with npm token create, this limits +the token access to specific scopes. Provide a scope name (with or without @ +prefix).

+

orgs

+
    +
  • Default: null
  • +
  • Type: null or String (can be set multiple times)
  • +
+

When creating a Granular Access Token with npm token create, this limits +the token access to specific organizations.

+

packages-and-scopes-permission

+
    +
  • Default: null
  • +
  • Type: null, "read-only", "read-write", or "no-access"
  • +
+

When creating a Granular Access Token with npm token create, sets the +permission level for packages and scopes. Options are "read-only", +"read-write", or "no-access".

+

orgs-permission

+
    +
  • Default: null
  • +
  • Type: null, "read-only", "read-write", or "no-access"
  • +
+

When creating a Granular Access Token with npm token create, sets the +permission level for organizations. Options are "read-only", "read-write", +or "no-access".

+

cidr

+
    +
  • Default: null
  • +
  • Type: null or String (can be set multiple times)
  • +
+

This is a list of CIDR address to be used when configuring limited access +tokens with the npm token create command.

+

bypass-2fa

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When creating a Granular Access Token with npm token create, setting this +to true will allow the token to bypass two-factor authentication. This is +useful for automation and CI/CD workflows.

+

password

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

Password for authentication. Can be provided via command line when creating +tokens, though it's generally safer to be prompted for it.

+

registry

+ +

The base URL of the npm registry.

+

otp

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with npm access.

+

If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one.

+

read-only

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

This is used to mark a token as unable to publish when configuring limited +access tokens with the npm token create command.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-trust.html b/node24/node_modules/npm/docs/output/commands/npm-trust.html new file mode 100644 index 0000000000000000000000000000000000000000..a1e30bbd8febdac906e713d487d0f125b3c820e7 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-trust.html @@ -0,0 +1,508 @@ + + +npm-trust + + + + + +
+
+

+ npm-trust + @11.12.1 +

+Manage trusted publishing relationships between packages and CI/CD providers +
+ +
+

Table of contents

+ +
+ +

Synopsis

+

Note: This command is unaware of workspaces.

+

Prerequisites

+

Before using npm trust commands, ensure the following requirements are met:

+
    +
  • npm version: npm@11.10.0 or above is required. Use npm install -g npm@^11.10.0 to update if needed.
  • +
  • Write permissions on the package: You must have write access to the package you're configuring.
  • +
  • 2FA enabled on account: Two-factor authentication must be enabled at the account level. Even if it's not currently enabled, you must enable it to use trust commands.
  • +
  • Supported authentication methods: Granular Access Tokens (GAT) with the bypass 2FA option are not supported. Legacy basic auth (username and password) credentials will not work for trust commands or endpoints.
  • +
  • Package must exist: The package you're configuring must already exist on the npm registry.
  • +
+

Description

+

Configure trust relationships between npm packages and CI/CD providers using OpenID Connect (OIDC). This is the command-line equivalent of managing trusted publisher configurations on the npm website.

+

For a comprehensive overview of trusted publishing, see the npm trusted publishers documentation.

+

The [package] argument specifies the package name. If omitted, npm will use the name from the package.json in the current directory.

+

Each trust relationship has its own set of configuration options and flags based on the OIDC claims provided by that provider. OIDC claims come from the CI/CD provider and include information such as repository name, workflow file, or environment. Since each provider's claims differ, the available flags and configuration keys are not universal—npm matches the claims supported by each provider's OIDC configuration. For specific details on which claims and flags are supported for a given provider, use npm trust <provider> --help.

+

The required options depend on the CI/CD provider you're configuring. Detailed information about each option is available in the managing trusted publisher configurations section of the npm documentation. If a provider is repository-based and the option is not provided, npm will use the repository.url field from your package.json, if available.

+

Currently, the registry only supports one configuration per package. If you attempt to create a new trust relationship when one already exists, it will result in an error. To replace an existing configuration:

+
    +
  1. Use npm trust list [package] to view the ID of the existing trusted publisher
  2. +
  3. Use npm trust revoke --id <id> [package] to remove the existing configuration
  4. +
  5. Then create your new trust relationship
  6. +
+

Bulk Usage

+

For maintainers managing a large number of packages, you can configure trusted publishing in bulk using bash scripting. Create a loop that iterates through package names and their corresponding configuration details, executing the npm trust <provider> command with the --yes flag for each package.

+

The first request will require two-factor authentication. During two-factor authentication, you'll see an option on the npm website to skip two-factor authentication for the next 5 minutes. Enabling this option will allow subsequent npm trust <provider> commands to proceed without two-factor authentication, streamlining the bulk configuration process.

+

We recommend adding a 2-second sleep between each call to avoid rate limiting. With this approach, you can configure approximately 80 packages within the 5-minute two-factor authentication skip window.

+

Configuration

+

npm trust github

+

Create a trusted relationship between a package and GitHub Actions

+

Synopsis

+
npm trust github [package] --file [--repo|--repository] [--env|--environment] [-y|--yes]
+
+

Flags

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FlagDefaultTypeDescription
--filenullString (required)Name of workflow file within a repositories .GitHub folder (must end in yaml, yml)
--repository, --reponullStringName of the repository in the format owner/repo
--environment, --envnullStringCI environment name
--dry-runfalseBooleanIndicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, install, update, dedupe, uninstall, as well as pack and publish. Note: This is NOT honored by other network related commands, eg dist-tags, owner, etc.
--jsonfalseBooleanWhether or not to output JSON data, rather than the normal output. * In npm pkg set it enables parsing set values with JSON.parse() before saving them to your package.json. Not supported by all npm commands.
--registry"https://registry.npmjs.org/"URLThe base URL of the npm registry.
--yes, -ynullnull or BooleanAutomatically answer "yes" to any prompts that npm might print on the command line.
+

npm trust gitlab

+

Create a trusted relationship between a package and GitLab CI/CD

+

Synopsis

+
npm trust gitlab [package] --file [--project|--repo|--repository] [--env|--environment] [-y|--yes]
+
+

Flags

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FlagDefaultTypeDescription
--filenullString (required)Name of pipeline file (e.g., .gitlab-ci.yml)
--projectnullStringName of the project in the format group/project or group/subgroup/project
--environment, --envnullStringCI environment name
--dry-runfalseBooleanIndicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, install, update, dedupe, uninstall, as well as pack and publish. Note: This is NOT honored by other network related commands, eg dist-tags, owner, etc.
--jsonfalseBooleanWhether or not to output JSON data, rather than the normal output. * In npm pkg set it enables parsing set values with JSON.parse() before saving them to your package.json. Not supported by all npm commands.
--registry"https://registry.npmjs.org/"URLThe base URL of the npm registry.
--yes, -ynullnull or BooleanAutomatically answer "yes" to any prompts that npm might print on the command line.
+

npm trust circleci

+

Create a trusted relationship between a package and CircleCI

+

Synopsis

+
npm trust circleci [package] --org-id <uuid> --project-id <uuid> --pipeline-definition-id <uuid> --vcs-origin <origin> [--context-id <uuid>...] [-y|--yes]
+
+

Flags

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FlagDefaultTypeDescription
--org-idnullString (required)CircleCI organization UUID
--project-idnullString (required)CircleCI project UUID
--pipeline-definition-idnullString (required)CircleCI pipeline definition UUID
--vcs-originnullString (required)CircleCI repository origin in format 'provider/owner/repo'
--context-idnullnull or String (can be set multiple times)CircleCI context UUID to match
--dry-runfalseBooleanIndicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, install, update, dedupe, uninstall, as well as pack and publish. Note: This is NOT honored by other network related commands, eg dist-tags, owner, etc.
--jsonfalseBooleanWhether or not to output JSON data, rather than the normal output. * In npm pkg set it enables parsing set values with JSON.parse() before saving them to your package.json. Not supported by all npm commands.
--registry"https://registry.npmjs.org/"URLThe base URL of the npm registry.
--yes, -ynullnull or BooleanAutomatically answer "yes" to any prompts that npm might print on the command line.
+

npm trust list

+

List trusted relationships for a package

+

Synopsis

+
npm trust list [package]
+
+

Flags

+ + + + + + + + + + + + + + + + + + + + + + + +
FlagDefaultTypeDescription
--jsonfalseBooleanWhether or not to output JSON data, rather than the normal output. * In npm pkg set it enables parsing set values with JSON.parse() before saving them to your package.json. Not supported by all npm commands.
--registry"https://registry.npmjs.org/"URLThe base URL of the npm registry.
+

npm trust revoke

+

Revoke a trusted relationship for a package

+

Synopsis

+
npm trust revoke [package] --id=<trust-id>
+
+

Flags

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FlagDefaultTypeDescription
--idnullString (required)ID of the trusted relationship to revoke
--dry-runfalseBooleanIndicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, install, update, dedupe, uninstall, as well as pack and publish. Note: This is NOT honored by other network related commands, eg dist-tags, owner, etc.
--registry"https://registry.npmjs.org/"URLThe base URL of the npm registry.
+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-undeprecate.html b/node24/node_modules/npm/docs/output/commands/npm-undeprecate.html new file mode 100644 index 0000000000000000000000000000000000000000..bc08448cb26a9bcb9f2d4c9b28954f53c3540060 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-undeprecate.html @@ -0,0 +1,252 @@ + + +npm-undeprecate + + + + + +
+
+

+ npm-undeprecate + @11.12.1 +

+Undeprecate a version of a package +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm undeprecate <package-spec>
+
+

Note: This command is unaware of workspaces.

+

Description

+

This command will update the npm registry entry for a package, removing any deprecation warnings that currently exist.

+

It works in the same way as npm deprecate, except that this command removes deprecation warnings instead of adding them.

+

Configuration

+

registry

+ +

The base URL of the npm registry.

+

otp

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with npm access.

+

If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one.

+

dry-run

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, install, update, +dedupe, uninstall, as well as pack and publish.

+

Note: This is NOT honored by other network related commands, eg dist-tags, +owner, etc.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-uninstall.html b/node24/node_modules/npm/docs/output/commands/npm-uninstall.html new file mode 100644 index 0000000000000000000000000000000000000000..c446a1e93742bd1e22b20769d5518385cc5ce09a --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-uninstall.html @@ -0,0 +1,323 @@ + + +npm-uninstall + + + + + +
+
+

+ npm-uninstall + @11.12.1 +

+Remove a package +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm uninstall [<@scope>/]<pkg>...
+
+aliases: unlink, remove, rm, r, un
+
+

Description

+

This uninstalls a package, completely removing everything npm installed on its behalf.

+

It also removes the package from the dependencies, devDependencies, +optionalDependencies, and peerDependencies objects in your package.json.

+

Further, if you have an npm-shrinkwrap.json or package-lock.json, npm will update those files as well.

+

--no-save will tell npm not to remove the package from your package.json, npm-shrinkwrap.json, or package-lock.json files.

+

--save or -S will tell npm to remove the package from your package.json, npm-shrinkwrap.json, and package-lock.json files. +This is the default, but you may need to use this if you have for instance save=false in your npmrc file

+

In global mode (ie, with -g or --global appended to the command), it uninstalls the current package context as a global package. +--no-save is ignored in this case.

+

Scope is optional and follows the usual rules for scope.

+

Examples

+
npm uninstall sax
+
+

sax will no longer be in your package.json, npm-shrinkwrap.json, or package-lock.json files.

+
npm uninstall lodash --no-save
+
+

lodash will not be removed from your package.json, +npm-shrinkwrap.json, or package-lock.json files.

+

Configuration

+

save

+
    +
  • Default: true unless when using npm update where it defaults to false
  • +
  • Type: Boolean
  • +
+

Save installed packages to a package.json file as dependencies.

+

When used with the npm rm command, removes the dependency from +package.json.

+

Will also prevent writing to package-lock.json if set to false.

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Operates in "global" mode, so that packages are installed into the prefix +folder instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-unpublish.html b/node24/node_modules/npm/docs/output/commands/npm-unpublish.html new file mode 100644 index 0000000000000000000000000000000000000000..9f799fe146c47f8c947d10b676175ee69bfb4d4b --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-unpublish.html @@ -0,0 +1,310 @@ + + +npm-unpublish + + + + + +
+
+

+ npm-unpublish + @11.12.1 +

+Remove a package from the registry +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm unpublish [<package-spec>]
+
+

To learn more about how the npm registry treats unpublish, see our unpublish policies.

+

Warning

+

Consider using the deprecate command instead, if your intent is to encourage users to upgrade, or if you no longer want to maintain a package.

+

Description

+

This removes a package version from the registry, deleting its entry and removing the tarball.

+

The npm registry will return an error if you are not logged in.

+

If you do not specify a package name at all, the name and version to be unpublished will be pulled from the project in the current directory.

+

If you specify a package name but do not specify a version or if you remove all of a package's versions then the registry will remove the root package entry entirely.

+

Even if you unpublish a package version, that specific name and version combination can never be reused. +In order to publish the package again, you must use a new version number. +If you unpublish the entire package, you may not publish any new versions of that package until 24 hours have passed.

+

Configuration

+

dry-run

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, install, update, +dedupe, uninstall, as well as pack and publish.

+

Note: This is NOT honored by other network related commands, eg dist-tags, +owner, etc.

+

force

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Removes various protections against unfortunate side effects, common +mistakes, unnecessary performance degradation, and malicious input.

+
    +
  • Allow clobbering non-npm files in global installs.
  • +
  • Allow the npm version command to work on an unclean git repository.
  • +
  • Allow deleting the cache folder with npm cache clean.
  • +
  • Allow installing packages that have an engines declaration requiring a +different version of npm.
  • +
  • Allow installing packages that have an engines declaration requiring a +different version of node, even if --engine-strict is enabled.
  • +
  • Allow npm audit fix to install modules outside your stated dependency +range (including SemVer-major changes).
  • +
  • Allow unpublishing all versions of a published package.
  • +
  • Allow conflicting peerDependencies to be installed in the root project.
  • +
  • Implicitly set --yes during npm init.
  • +
  • Allow clobbering existing values in npm pkg
  • +
  • Allow unpublishing of entire packages (not just a single version).
  • +
+

If you don't have a clear idea of what you want to do, it is strongly +recommended that you do not use this option!

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-unstar.html b/node24/node_modules/npm/docs/output/commands/npm-unstar.html new file mode 100644 index 0000000000000000000000000000000000000000..8a2062b10f2a92319ddb34e257ff9943c4e7286c --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-unstar.html @@ -0,0 +1,258 @@ + + +npm-unstar + + + + + +
+
+

+ npm-unstar + @11.12.1 +

+Remove an item from your favorite packages +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm unstar [<package-spec>...]
+
+

Note: This command is unaware of workspaces.

+

Description

+

"Unstarring" a package is the opposite of npm star, it removes an item from your list of favorite packages.

+

More

+

There's also these extra commands to help you manage your favorite packages:

+

Star

+

You can "star" a package using npm star

+

Listing stars

+

You can see all your starred packages using npm stars

+

Configuration

+

registry

+ +

The base URL of the npm registry.

+

unicode

+
    +
  • Default: false on windows, true on mac/unix systems with a unicode locale, +as defined by the LC_ALL, LC_CTYPE, or LANG environment variables.
  • +
  • Type: Boolean
  • +
+

When set to true, npm uses unicode characters in the tree output. When +false, it uses ascii characters instead of unicode glyphs.

+

otp

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with npm access.

+

If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-update.html b/node24/node_modules/npm/docs/output/commands/npm-update.html new file mode 100644 index 0000000000000000000000000000000000000000..572291e2647b5e57171abc39d26f96a58a9a3dc1 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-update.html @@ -0,0 +1,549 @@ + + +npm-update + + + + + +
+
+

+ npm-update + @11.12.1 +

+Update packages +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm update [<pkg>...]
+
+aliases: up, upgrade, udpate
+
+

Description

+

This command will update all the packages listed to the latest version (specified by the tag config), respecting the semver constraints of both your package and its dependencies (if they also require the same package).

+

It will also install missing packages.

+

If the -g flag is specified, this command will update globally installed packages.

+

If no package name is specified, all packages in the specified location (global or local) will be updated.

+

Note that by default npm update will not update the semver values of direct dependencies in your project package.json. +If you want to also update values in package.json you can run: npm update --save (or add the save=true option to a configuration file to make that the default behavior).

+

Example

+

For the examples below, assume that the current package is app and it depends on dependencies, dep1 (dep2, .. etc.). +The published versions of dep1 are:

+
{
+  "dist-tags": { "latest": "1.2.2" },
+  "versions": [
+    "1.2.2",
+    "1.2.1",
+    "1.2.0",
+    "1.1.2",
+    "1.1.1",
+    "1.0.0",
+    "0.4.1",
+    "0.4.0",
+    "0.2.0"
+  ]
+}
+
+

Caret Dependencies

+

If app's package.json contains:

+
"dependencies": {
+  "dep1": "^1.1.1"
+}
+
+

Then npm update will install dep1@1.2.2, because 1.2.2 is latest and +1.2.2 satisfies ^1.1.1.

+

Tilde Dependencies

+

However, if app's package.json contains:

+
"dependencies": {
+  "dep1": "~1.1.1"
+}
+
+

In this case, running npm update will install dep1@1.1.2. +Even though the latest tag points to 1.2.2, this version does not satisfy ~1.1.1, which is equivalent to >=1.1.1 <1.2.0. +So the highest-sorting version that satisfies +~1.1.1 is used, which is 1.1.2.

+

Caret Dependencies below 1.0.0

+

Suppose app has a caret dependency on a version below 1.0.0, for example:

+
"dependencies": {
+  "dep1": "^0.2.0"
+}
+
+

npm update will install dep1@0.2.0.

+

If the dependence were on ^0.4.0:

+
"dependencies": {
+  "dep1": "^0.4.0"
+}
+
+

Then npm update will install dep1@0.4.1, because that is the highest-sorting version that satisfies ^0.4.0 (>= 0.4.0 <0.5.0)

+

Subdependencies

+

Suppose your app now also has a dependency on dep2

+
{
+  "name": "my-app",
+  "dependencies": {
+      "dep1": "^1.0.0",
+      "dep2": "1.0.0"
+  }
+}
+
+

and dep2 itself depends on this limited range of dep1

+
{
+"name": "dep2",
+  "dependencies": {
+    "dep1": "~1.1.1"
+  }
+}
+
+

Then npm update will install dep1@1.1.2 because that is the highest version that dep2 allows. +npm will prioritize having a single version of dep1 in your tree rather than two when that single version can satisfy the semver requirements of multiple dependencies in your tree. +In this case if you really did need your package to use a newer version you would need to use npm install.

+

Updating Globally-Installed Packages

+

npm update -g will apply the update action to each globally installed package that is outdated -- that is, has a version that is different from wanted.

+

Note: Globally installed packages are treated as if they are installed with a caret semver range specified. +So if you require to update to latest you may need to run npm install -g [<pkg>...]

+

NOTE: If a package has been upgraded to a version newer than latest, it will be downgraded.

+

Configuration

+

save

+
    +
  • Default: true unless when using npm update where it defaults to false
  • +
  • Type: Boolean
  • +
+

Save installed packages to a package.json file as dependencies.

+

When used with the npm rm command, removes the dependency from +package.json.

+

Will also prevent writing to package-lock.json if set to false.

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Operates in "global" mode, so that packages are installed into the prefix +folder instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

install-strategy

+
    +
  • Default: "hoisted"
  • +
  • Type: "hoisted", "nested", "shallow", or "linked"
  • +
+

Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (experimental) install in node_modules/.store, +link in place, unhoisted.

+

legacy-bundling

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: This option has been deprecated in favor of +--install-strategy=nested
  • +
+

Instead of hoisting package installs in node_modules, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets --install-strategy=nested.

+

global-style

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: This option has been deprecated in favor of +--install-strategy=shallow
  • +
+

Only install direct dependencies in the top level node_modules, but hoist +on deeper dependencies. Sets --install-strategy=shallow.

+

omit

+
    +
  • Default: 'dev' if the NODE_ENV environment variable is set to +'production'; otherwise, empty.
  • +
  • Type: "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Dependency types to omit from the installation tree on disk.

+

Note that these dependencies are still resolved and added to the +package-lock.json or npm-shrinkwrap.json file. They are just not +physically installed on disk.

+

If a package type appears in both the --include and --omit lists, then +it will be included.

+

If the resulting omit list includes 'dev', then the NODE_ENV environment +variable will be set to 'production' for all lifecycle scripts.

+

include

+
    +
  • Default:
  • +
  • Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Option that allows for defining which types of dependencies to install.

+

This is the inverse of --omit=<type>.

+

Dependency types specified in --include will not be omitted, regardless of +the order in which omit/include are specified on the command-line.

+

strict-peer-deps

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, and --legacy-peer-deps is not set, then any +conflicting peerDependencies will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships.

+

By default, conflicting peerDependencies deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's peerDependencies object.

+

When such an override is performed, a warning is printed, explaining the +conflict and the packages involved. If --strict-peer-deps is set, then +this warning is treated as a failure.

+

package-lock

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

If set to false, then ignore package-lock.json files when installing. This +will also prevent writing package-lock.json if save is true.

+

foreground-scripts

+
    +
  • Default: false unless when using npm pack or npm publish where it +defaults to true
  • +
  • Type: Boolean
  • +
+

Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

+

Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging.

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

audit

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When "true" submit audit reports alongside the current npm command to the +default registry and all registries configured for scopes. See the +documentation for npm audit for details on what is +submitted.

+

before

+
    +
  • Default: null
  • +
  • Type: null or Date
  • +
+

If passed to npm install, will rebuild the npm tree such that only +versions that were available on or before the given date are installed. +If there are no versions available for the current set of dependencies, the +command will error.

+

If the requested version is a dist-tag and the given tag does not pass the +--before filter, the most recent version less than or equal to that tag +will be used. For example, foo@latest might install foo@1.2 even though +latest is 2.0.

+

This config cannot be used with: min-release-age

+

min-release-age

+
    +
  • Default: null
  • +
  • Type: null or Number
  • +
+

If set, npm will build the npm tree such that only versions that were +available more than the given number of days ago will be installed. If there +are no versions available for the current set of dependencies, the command +will error.

+

This flag is a complement to before, which accepts an exact date instead +of a relative number of days.

+

This config cannot be used with: before

+

This value is not exported to the environment for child processes.

+ +
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Tells npm to create symlinks (or .cmd shims on Windows) for package +executables.

+

Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems.

+

fund

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When "true" displays the message at the end of each npm install +acknowledging the number of dependencies looking for funding. See npm fund for details.

+

dry-run

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, install, update, +dedupe, uninstall, as well as pack and publish.

+

Note: This is NOT honored by other network related commands, eg dist-tags, +owner, etc.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-version.html b/node24/node_modules/npm/docs/output/commands/npm-version.html new file mode 100644 index 0000000000000000000000000000000000000000..f8915c79fd622919e54f54e7682c8c25799fb9cb --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-version.html @@ -0,0 +1,403 @@ + + +npm-version + + + + + +
+
+

+ npm-version + @11.12.1 +

+Bump a package version +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]
+
+alias: verison
+
+

Configuration

+

allow-same-version

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Prevents throwing an error when npm version is used to set the new version +to the same value as the current version.

+

commit-hooks

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Run git commit hooks when using the npm version command.

+

git-tag-version

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Tag the commit when using the npm version command. Setting this to false +results in no commit being made at all.

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

+

preid

+
    +
  • Default: ""
  • +
  • Type: String
  • +
+

The "prerelease identifier" to use as a prefix for the "prerelease" part of +a semver. Like the rc in 1.2.0-rc.8.

+

sign-git-tag

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, then the npm version command will tag the version using +-s to add a signature.

+

Note that git requires you to have set up GPG keys in your git configs for +this to work properly.

+

save

+
    +
  • Default: true unless when using npm update where it defaults to false
  • +
  • Type: Boolean
  • +
+

Save installed packages to a package.json file as dependencies.

+

When used with the npm rm command, removes the dependency from +package.json.

+

Will also prevent writing to package-lock.json if set to false.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

workspaces-update

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

If set to true, the npm cli will run an update after operations that may +possibly change the workspaces installed to the node_modules folder.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

Description

+

Run this in a package directory to bump the version and write the new data back to package.json, package-lock.json, and, if present, +npm-shrinkwrap.json.

+

The newversion argument should be a valid semver string, a valid second argument to semver.inc (one of patch, minor, major, prepatch, preminor, premajor, prerelease), or from-git. +In the second case, the existing version will be incremented by 1 in the specified field. +from-git will try to read the latest git tag, and use that as the new npm version.

+

Note: If the current version is a prerelease version, patch will simply remove the prerelease suffix without incrementing the patch version number. For example, 1.2.0-5 becomes 1.2.0 with npm version patch, not 1.2.1.

+

If run in a git repo, it will also create a version commit and tag. +This behavior is controlled by git-tag-version (see below), and can be disabled on the command line by running npm --no-git-tag-version version. +It will fail if the working directory is not clean, unless the -f or --force flag is set.

+

Note: Git integration requires a reasonably recent version of git (2.0.0 or later is recommended). If you encounter issues with git commands, ensure your git installation is up to date.

+

If supplied with -m or --message config option, npm will use it as a commit message when creating a version commit. +If the message config contains %s then that will be replaced with the resulting version number. +For example:

+
npm version patch -m "Upgrade to %s for reasons"
+
+

If the sign-git-tag config is set, then the tag will be signed using the -s flag to git. +Note that you must have a default GPG key set up in your git config for this to work properly. +For example:

+
$ npm config set sign-git-tag true
+$ npm version patch
+
+You need a passphrase to unlock the secret key for user: "isaacs (http://blog.izs.me/) <i@izs.me>"
+2048-bit RSA key, ID 6C481CF6, created 2010-08-31
+
+Enter passphrase:
+
+

If preversion, version, or postversion are in the scripts property of the package.json, they will be executed as part of running npm version.

+

The exact order of execution is as follows:

+
    +
  1. Check to make sure the git working directory is clean before we get started. +Your scripts may add files to the commit in future steps. +This step is skipped if the --force flag is set.
  2. +
  3. Run the preversion script. +These scripts have access to the old version in package.json. +A typical use would be running your full test suite before deploying. +Any files you want added to the commit should be explicitly added using git add.
  4. +
  5. Bump version in package.json as requested (patch, minor, major, etc).
  6. +
  7. Run the version script. +These scripts have access to the new version in package.json (so they can incorporate it into file headers in generated files for example). +Again, scripts should explicitly add generated files to the commit using git add.
  8. +
  9. Commit and tag.
  10. +
  11. Run the postversion script. +Use it to clean up the file system or automatically push the commit and/or tag.
  12. +
+

Take the following example:

+
{
+  "scripts": {
+    "preversion": "npm test",
+    "version": "npm run build && git add -A dist",
+    "postversion": "git push && git push --tags && rm -rf build/temp"
+  }
+}
+
+

This runs all your tests and proceeds only if they pass. +Then runs your build script, and adds everything in the dist directory to the commit. +After the commit, it pushes the new commit and tag up to the server, and deletes the build/temp directory.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-view.html b/node24/node_modules/npm/docs/output/commands/npm-view.html new file mode 100644 index 0000000000000000000000000000000000000000..a6afbec507f58062bbae881551255d6c30d7e2cf --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-view.html @@ -0,0 +1,383 @@ + + +npm-view + + + + + +
+
+

+ npm-view + @11.12.1 +

+View registry info +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm view [<package-spec>] [<field>[.subfield]...]
+
+aliases: info, show, v
+
+

Description

+

This command shows data about a package and prints it to stdout.

+

As an example, to view information about the connect package from the registry, you would run:

+
npm view connect
+
+

The default version is "latest" if unspecified.

+

Field names can be specified after the package descriptor. +For example, to show the dependencies of the ronn package at version +0.3.5, you could do the following:

+
npm view ronn@0.3.5 dependencies
+
+

By default, npm view shows data about the current project context (by looking for a package.json). +To show field data for the current project use a file path (i.e. +.):

+
npm view . dependencies
+
+

You can view child fields by separating them with a period. +To view the git repository URL for the latest version of npm, you would run the following command:

+
npm view npm repository.url
+
+

This makes it easy to view information about a dependency with a bit of shell scripting. +For example, to view all the data about the version of opts that ronn depends on, you could write the following:

+
npm view opts@$(npm view ronn dependencies.opts)
+
+

For fields that are arrays, requesting a non-numeric field will return all of the values from the objects in the list. +For example, to get all the contributor email addresses for the express package, you would run:

+
npm view express contributors.email
+
+

You may also use numeric indices in square braces to specifically select an item in an array field. +To just get the email address of the first contributor in the list, you can run:

+
npm view express contributors[0].email
+
+

If the field value you are querying for is a property of an object, you should run:

+
npm view express time'[4.8.0]'
+
+

Note: When accessing object properties that contain special characters or numeric keys, you need to use quotes around the key name. +For example, to get the publish time of a specific version:

+
npm view express "time[4.17.1]"
+
+

Without quotes, the shell may interpret the square brackets as glob patterns, causing the command to fail. +You can also access the time field for a specific version by specifying the version in the package descriptor:

+
npm view express@4.17.1 time
+
+

This will return all version-time pairs, but the context will be for that specific version.

+

Multiple fields may be specified, and will be printed one after another. +For example, to get all the contributor names and email addresses, you can do this:

+
npm view express contributors.name contributors.email
+
+

"Person" fields are shown as a string if they would be shown as an object. +So, for example, this will show the list of npm contributors in the shortened string format. +(See package.json for more on this.)

+
npm view npm contributors
+
+

If a version range is provided, then data will be printed for every matching version of the package. +This will show which version of jsdom was required by each matching version of yui3:

+
npm view yui3@'>0.5.4' dependencies.jsdom
+
+

To show the connect package version history, you can do this:

+
npm view connect versions
+
+

Field Access Patterns

+

The npm view command supports different ways to access nested fields and array elements in package metadata. Understanding these patterns makes it easier to extract specific information.

+

Nested Object Fields

+

Use dot notation to access nested object fields:

+
# Access nested properties
+npm view npm repository.url
+npm view express bugs.url
+
+

Array Element Access

+

For arrays, use numeric indices in square brackets to access specific elements:

+
# Get the first contributor's email
+npm view express contributors[0].email
+
+# Get the second maintainer's name
+npm view express maintainers[1].name
+
+

Object Property Access

+

For object properties (like accessing specific versions in the time field), use bracket notation with the property name in quotes:

+
# Get publish time for a specific version
+npm view express "time[4.17.1]"
+
+# Get dist-tags
+npm view express "dist-tags.latest"
+
+

Extracting Fields from Arrays

+

Request a non-numeric field on an array to get all values from objects in the list:

+
# Get all contributor emails
+npm view express contributors.email
+
+# Get all contributor names
+npm view express contributors.name
+
+

Configuration

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+

Output

+

If only a single string field for a single version is output, then it will not be colorized or quoted, to enable piping the output to another command. +If the field is an object, it will be output as a JavaScript object literal.

+

If the --json flag is given, the outputted fields will be JSON.

+

If the version range matches multiple versions then each printed value will be prefixed with the version it applies to.

+

If multiple fields are requested, then each of them is prefixed with the field name.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm-whoami.html b/node24/node_modules/npm/docs/output/commands/npm-whoami.html new file mode 100644 index 0000000000000000000000000000000000000000..8e16dd28b3346cd482eb1071295c4e62ece6aaf0 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm-whoami.html @@ -0,0 +1,235 @@ + + +npm-whoami + + + + + +
+
+

+ npm-whoami + @11.12.1 +

+Display npm username +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm whoami
+
+

Note: This command is unaware of workspaces.

+

Description

+

Display the npm username of the currently logged-in user.

+

If logged into a registry that provides token-based authentication, then connect to the /-/whoami registry endpoint to find the username associated with the token, and print to standard output.

+

If logged into a registry that uses Basic Auth, then simply print the username portion of the authentication string.

+

Configuration

+

registry

+ +

The base URL of the npm registry.

+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npm.html b/node24/node_modules/npm/docs/output/commands/npm.html new file mode 100644 index 0000000000000000000000000000000000000000..f787088d97813dfa223d83e3c3ab86e7b95543c9 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npm.html @@ -0,0 +1,323 @@ + + +npm + + + + + +
+
+

+ npm + @11.12.1 +

+javascript package manager +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npm
+
+

Note: This command is unaware of workspaces.

+

Version

+

11.12.1

+

Description

+

npm is the package manager for the Node JavaScript platform. +It puts modules in place so that node can find them, and manages dependency conflicts intelligently.

+

It is extremely configurable to support a variety of use cases. +Most commonly, you use it to publish, discover, install, and develop node programs.

+

Run npm help to get a list of available commands.

+

Important

+

npm comes preconfigured to use npm's public registry at https://registry.npmjs.org by default. +Use of the npm public registry is subject to terms of use available at https://docs.npmjs.com/policies/terms.

+

You can configure npm to use any compatible registry you like, and even run your own registry. +Use of someone else's registry is governed by their terms of use.

+

Introduction

+

You probably got npm because you want to install stuff.

+

The very first thing you will most likely want to run in any node program is npm install to install its dependencies.

+

You can also run npm install blerg to install the latest version of "blerg". Check out npm install for more info. +It can do a lot of stuff.

+

Use the npm search command to show everything that's available in the public registry. +Use npm ls to show everything you've installed.

+

Dependencies

+

If a package lists a dependency using a git URL, npm will install that dependency using the git command and will generate an error if it is not installed.

+

If one of the packages npm tries to install is a native node module and requires compiling of C++ Code, npm will use node-gyp for that task. +For a Unix system, node-gyp needs Python, make and a buildchain like GCC. On Windows, Python and Microsoft Visual Studio C++ are needed. +For more information visit the node-gyp repository and the node-gyp Wiki.

+

Directories

+

See folders to learn about where npm puts stuff.

+

In particular, npm has two modes of operation:

+
    +
  • local mode: +npm installs packages into the current project directory, which defaults to the current working directory. +Packages install to ./node_modules, and bins to ./node_modules/.bin.
  • +
  • global mode: +npm installs packages into the install prefix at $NPM_CONFIG_PREFIX/lib/node_modules and bins to $NPM_CONFIG_PREFIX/bin.
  • +
+

Local mode is the default. +Use -g or --global on any command to run in global mode instead.

+

Developer Usage

+

If you're using npm to develop and publish your code, check out the following help topics:

+
    +
  • json: +Make a package.json file. +See package.json.
  • +
  • link: +Links your current working code into Node's path, so that you don't have to reinstall every time you make a change. +Use npm link to do this.
  • +
  • install: +It's a good idea to install things if you don't need the symbolic link. +Especially, installing other peoples code from the registry is done via npm install
  • +
  • adduser: +Create an account or log in. +When you do this, npm will store credentials in the user config file.
  • +
  • publish: +Use the npm publish command to upload your code to the registry.
  • +
+

Configuration

+

npm is extremely configurable. +It reads its configuration options from 5 places.

+
    +
  • Command line switches: +Set a config with --key val. +All keys take a value, even if they are booleans (the config parser doesn't know what the options are at the time of parsing). +If you do not provide a value (--key) then the option is set to boolean true.
  • +
  • Environment Variables: +Set any config by prefixing the name in an environment variable with NPM_CONFIG_. +For example, export NPM_CONFIG_KEY=val.
  • +
  • User Configs: +The file at $HOME/.npmrc is an ini-formatted list of configs. +If present, it is parsed. +If the userconfig option is set in the cli or env, that file will be used instead.
  • +
  • Global Configs: +The file found at ./etc/npmrc (relative to the global prefix will be parsed if it is found. +See npm prefix for more info on the global prefix. +If the globalconfig option is set in the cli, env, or user config, then that file is parsed instead.
  • +
  • Defaults: +npm's default configuration options are defined in lib/utils/config/definitions.js. +These must not be changed.
  • +
+

See config for much, much, more information.

+

Contributions

+

Patches welcome!

+

If you would like to help, but don't know what to work on, read the contributing guidelines and check the issues list.

+

Bugs

+

When you find issues, please report them: +https://github.com/npm/cli/issues

+

Please be sure to follow the template and bug reporting guidelines.

+

Feature Requests

+

Discuss new feature ideas on our discussion forum:

+ +

Or suggest formal RFC proposals:

+ +

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/commands/npx.html b/node24/node_modules/npm/docs/output/commands/npx.html new file mode 100644 index 0000000000000000000000000000000000000000..228e97e1b31603b70ea416de1a3f309126c3ac26 --- /dev/null +++ b/node24/node_modules/npm/docs/output/commands/npx.html @@ -0,0 +1,308 @@ + + +npx + + + + + +
+
+

+ npx + @11.12.1 +

+Run a command from a local or remote npm package +
+ +
+

Table of contents

+ +
+ +

Synopsis

+
npx -- <pkg>[@<version>] [args...]
+npx --package=<pkg>[@<version>] -- <cmd> [args...]
+npx -c '<cmd> [args...]'
+npx --package=foo -c '<cmd> [args...]'
+
+

Description

+

This command allows you to run an arbitrary command from an npm package (either one installed locally, or fetched remotely), in a similar context as running it via npm run.

+

Run this command to execute a package's binary. Any options and arguments after the package name are passed directly to the executed command, not to npx itself. For example, npx create-react-app my-app --template typescript will pass my-app and --template typescript to the create-react-app command. To see what options a specific package accepts, consult that package's documentation (e.g., at npmjs.com or in its repository).

+

Whatever packages are specified by the --package option will be provided in the PATH of the executed command, along with any locally installed package executables. +The --package option may be specified multiple times, to execute the supplied command in an environment where all specified packages are available.

+

If any requested packages are not present in the local project dependencies, then they are installed to a folder in the npm cache, which is added to the PATH environment variable in the executed process. +A prompt is printed (which can be suppressed by providing either --yes or --no).

+

Package names provided without a specifier will be matched with whatever version exists in the local project. +Package names with a specifier will only be considered a match if they have the exact same name and version as the local dependency.

+

If no -c or --call option is provided, then the positional arguments are used to generate the command string. +If no --package options are provided, then npm will attempt to determine the executable name from the package specifier provided as the first positional argument according to the following heuristic:

+
    +
  • If the package has a single entry in its bin field in package.json, or if all entries are aliases of the same command, then that command will be used.
  • +
  • If the package has multiple bin entries, and one of them matches the unscoped portion of the name field, then that command will be used.
  • +
  • If this does not result in exactly one option (either because there are no bin entries, or none of them match the name of the package), then +npm exec exits with an error.
  • +
+

To run a binary other than the named binary, specify one or more +--package options, which will prevent npm from inferring the package from the first command argument.

+

npx vs npm exec

+

When run via the npx binary, all flags and options must be set prior to any positional arguments. +When run via npm exec, a double-hyphen -- flag can be used to suppress npm's parsing of switches and options that should be sent to the executed command.

+

For example:

+
$ npx foo@latest bar --package=@npmcli/foo
+
+

In this case, npm will resolve the foo package name, and run the following command:

+
$ foo bar --package=@npmcli/foo
+
+

Since the --package option comes after the positional arguments, it is treated as an argument to the executed command.

+

In contrast, due to npm's argument parsing logic, running this command is different:

+
$ npm exec foo@latest bar --package=@npmcli/foo
+
+

In this case, npm will parse the --package option first, resolving the +@npmcli/foo package. +Then, it will execute the following command in that context:

+
$ foo@latest bar
+
+

The double-hyphen character is recommended to explicitly tell npm to stop parsing command line options and switches. +The following command would thus be equivalent to the npx command above:

+
$ npm exec -- foo@latest bar --package=@npmcli/foo
+
+

Examples

+

Run the version of tap in the local dependencies, with the provided arguments:

+
$ npm exec -- tap --bail test/foo.js
+$ npx tap --bail test/foo.js
+
+

Run a command other than the command whose name matches the package name by specifying a --package option:

+
$ npm exec --package=foo -- bar --bar-argument
+# ~ or ~
+$ npx --package=foo bar --bar-argument
+
+

Run an arbitrary shell script, in the context of the current project:

+
$ npm x -c 'eslint && say "hooray, lint passed"'
+$ npx -c 'eslint && say "hooray, lint passed"'
+
+

Compatibility with Older npx Versions

+

The npx binary was rewritten in npm v7.0.0, and the standalone npx package deprecated at that time. +npx uses the npm exec command instead of a separate argument parser and install process, with some affordances to maintain backwards compatibility with the arguments it accepted in previous versions.

+

This resulted in some shifts in its functionality:

+
    +
  • Any npm config value may be provided.
  • +
  • To prevent security and user-experience problems from mistyping package names, npx prompts before installing anything. +Suppress this prompt with the -y or --yes option.
  • +
  • The --no-install option is deprecated, and will be converted to --no.
  • +
  • Shell fallback functionality is removed, as it is not advisable.
  • +
  • The -p argument is a shorthand for --parseable in npm, but shorthand for --package in npx. +This is maintained, but only for the npx executable.
  • +
  • The --ignore-existing option is removed. +Locally installed bins are always present in the executed process PATH.
  • +
  • The --npm option is removed. +npx will always use the npm it ships with.
  • +
  • The --node-arg and -n options have been removed. +Use NODE_OPTIONS instead: e.g., +NODE_OPTIONS="--trace-warnings --trace-exit" npx foo --random=true
  • +
  • The --always-spawn option is redundant, and thus removed.
  • +
  • The --shell option is replaced with --script-shell, but maintained in the npx executable for backwards compatibility.
  • +
+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/configuring-npm/folders.html b/node24/node_modules/npm/docs/output/configuring-npm/folders.html new file mode 100644 index 0000000000000000000000000000000000000000..fa5c10e309c78fcbaedb278d89ce67bf9db03872 --- /dev/null +++ b/node24/node_modules/npm/docs/output/configuring-npm/folders.html @@ -0,0 +1,331 @@ + + +Folders + + + + + +
+
+

+ Folders + @11.12.1 +

+Folder structures used by npm +
+ +
+

Table of contents

+ +
+ +

Description

+

npm puts various things on your computer. +That's its job.

+

This document will tell you what it puts where.

+

tl;dr

+
    +
  • Local install (default): puts stuff in ./node_modules of the current package root.
  • +
  • Global install (with -g): puts stuff in /usr/local or wherever node is installed.
  • +
  • Install it locally if you're going to require() it.
  • +
  • Install it globally if you're going to run it on the command line.
  • +
  • If you need both, then install it in both places, or use npm link.
  • +
+

prefix Configuration

+

The prefix config defaults to the location where node is installed. +On most systems, this is /usr/local. +On Windows, it's %AppData%\npm. +On Unix systems, it's one level up, since node is typically installed at {prefix}/bin/node rather than {prefix}/node.exe.

+

When the global flag is set, npm installs things into this prefix. +When it is not set, it uses the root of the current package, or the current working directory if not in a package already.

+

Node Modules

+

Packages are dropped into the node_modules folder under the prefix. +When installing locally, this means that you can require("packagename") to load its main module, or require("packagename/lib/path/to/sub/module") to load other modules.

+

Global installs on Unix systems go to {prefix}/lib/node_modules. +Global installs on Windows go to {prefix}/node_modules (that is, no lib folder.)

+

Scoped packages are installed the same way, except they are grouped together in a sub-folder of the relevant node_modules folder with the name of that scope prefix by the @ symbol, e.g. npm install @myorg/package would place the package in {prefix}/node_modules/@myorg/package. +See scope for more details.

+

If you wish to require() a package, then install it locally.

+

Executables

+

When in global mode, executables are linked into {prefix}/bin on Unix, or directly into {prefix} on Windows. +Ensure that path is in your terminal's PATH environment to run them.

+

When in local mode, executables are linked into ./node_modules/.bin so that they can be made available to scripts run through npm. +(For example, so that a test runner will be in the path when you run npm test.)

+

Man Pages

+

When in global mode, man pages are linked into {prefix}/share/man.

+

When in local mode, man pages are not installed.

+

Man pages are not installed on Windows systems.

+

Cache

+

See npm cache. +Cache files are stored in ~/.npm on Posix, or %LocalAppData%/npm-cache on Windows.

+

This is controlled by the cache config param.

+

More Information

+

When installing locally, npm first tries to find an appropriate prefix folder. +This is so that npm install foo@1.2.3 will install to the sensible root of your package, even if you happen to have cded into some other folder.

+

Starting at the $PWD, npm will walk up the folder tree checking for a folder that contains either a package.json file, or a node_modules folder. +If such a thing is found, then that is treated as the effective "current directory" for the purpose of running npm commands. +(This behavior is inspired by and similar to git's .git-folder seeking logic when running git commands in a working dir.)

+

If no package root is found, then the current folder is used.

+

When you run npm install foo@1.2.3, then the package is loaded into the cache, and then unpacked into ./node_modules/foo. +Then, any of foo's dependencies are similarly unpacked into ./node_modules/foo/node_modules/....

+

Any bin files are symlinked to ./node_modules/.bin/, so that they may be found by npm scripts when necessary.

+

Global Installation

+

If the global config is set to true, then npm will install packages "globally".

+

For global installation, packages are installed roughly the same way, but using the folders described above.

+

Cycles, Conflicts, and Folder Parsimony

+

Cycles are handled using the property of node's module system that it walks up the directories looking for node_modules folders. +So, at every stage, if a package is already installed in an ancestor node_modules folder, then it is not installed at the current location.

+

Consider the case above, where foo -> bar -> baz. +Imagine if, in addition to that, baz depended on bar, so you'd have: +foo -> bar -> baz -> bar -> baz .... +However, since the folder structure is: foo/node_modules/bar/node_modules/baz, there's no need to put another copy of bar into .../baz/node_modules, since when baz calls require("bar"), it will get the copy that is installed in foo/node_modules/bar.

+

This shortcut is only used if the exact same version would be installed in multiple nested node_modules folders. +It is still possible to have a/node_modules/b/node_modules/a if the two "a" packages are different versions. +However, without repeating the exact same package multiple times, an infinite regress will always be prevented.

+

Another optimization can be made by installing dependencies at the highest level possible, below the localized "target" folder (hoisting). +Since version 3, npm hoists dependencies by default.

+

Example

+

Consider this dependency graph:

+
foo
++-- blerg@1.2.5
++-- bar@1.2.3
+|   +-- blerg@1.x (latest=1.3.7)
+|   +-- baz@2.x
+|   |   `-- quux@3.x
+|   |       `-- bar@1.2.3 (cycle)
+|   `-- asdf@*
+`-- baz@1.2.3
+    `-- quux@3.x
+        `-- bar
+
+

In this case, we might expect a folder structure like this (with all dependencies hoisted to the highest level possible):

+
foo
++-- node_modules
+    +-- blerg (1.2.5) <---[A]
+    +-- bar (1.2.3) <---[B]
+    |   +-- node_modules
+    |       +-- baz (2.0.2) <---[C]
+    +-- asdf (2.3.4)
+    +-- baz (1.2.3) <---[D]
+    +-- quux (3.2.0) <---[E]
+
+

Since foo depends directly on bar@1.2.3 and baz@1.2.3, those are installed in foo's node_modules folder.

+

Even though the latest copy of blerg is 1.3.7, foo has a specific dependency on version 1.2.5. +So, that gets installed at [A]. +Since the parent installation of blerg satisfies bar's dependency on blerg@1.x, it does not install another copy under [B].

+

Bar [B] also has dependencies on baz and asdf. +Because it depends on baz@2.x, it cannot re-use the baz@1.2.3 installed in the parent node_modules folder [D], and must install its own copy [C]. +In order to minimize duplication, npm hoists dependencies to the top level by default, so asdf is installed under [A].

+

Underneath bar, the baz -> quux -> bar dependency creates a cycle. +However, because bar is already in quux's ancestry [B], it does not unpack another copy of bar into that folder. +Likewise, quux's [E] folder tree is empty, because its dependency on bar is satisfied by the parent folder copy installed at [B].

+

For a graphical breakdown of what is installed where, use npm ls.

+

Publishing

+

Upon publishing, npm will look in the node_modules folder. +If any of the items there are not in the bundleDependencies array, then they will not be included in the package tarball.

+

This allows a package maintainer to install all of their dependencies (and dev dependencies) locally, but only re-publish those items that cannot be found elsewhere. +See package.json for more information.

+

See also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/configuring-npm/install.html b/node24/node_modules/npm/docs/output/configuring-npm/install.html new file mode 100644 index 0000000000000000000000000000000000000000..d65c8ca368a5a78754f094b19bb73576effacae5 --- /dev/null +++ b/node24/node_modules/npm/docs/output/configuring-npm/install.html @@ -0,0 +1,249 @@ + + +Install + + + + + +
+
+

+ Install + @11.12.1 +

+Download and install node and npm +
+ +
+

Table of contents

+ +
+ +

Description

+

To publish and install packages to and from the public npm registry, you must install Node.js and the npm command line interface using either a Node version manager or a Node installer. +We strongly recommend using a Node version manager to install Node.js and npm. We do not recommend using a +Node installer, since the Node installation process installs npm in a directory with local permissions and can cause permissions errors when you run npm packages globally.

+

Overview

+ +

Checking your version of npm and Node.js

+

To see if you already have Node.js and npm installed and check the installed version, run the following commands:

+
node -v
+npm -v
+
+

Using a Node version manager to install Node.js and npm

+

Node version managers allow you to install and switch between multiple versions of Node.js and npm on your system so you can test your applications on multiple versions of npm to ensure they work for users on different versions. +You can search for them on GitHub.

+

Using a Node installer to install Node.js and npm

+

If you are unable to use a Node version manager, you can use a Node installer to install both Node.js and npm on your system.

+ +

macOS or Windows Node installers

+

If you're using macOS or Windows, use one of the installers from the Node.js download page. +Be sure to install the version labeled LTS. Other versions have not yet been tested with npm.

+

Linux or other operating systems Node installers

+

If you're using Linux or another operating system, use one of the following installers:

+ +

Or see this page to install npm for Linux in the way many Linux developers prefer.

+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/configuring-npm/npm-global.html b/node24/node_modules/npm/docs/output/configuring-npm/npm-global.html new file mode 100644 index 0000000000000000000000000000000000000000..fa5c10e309c78fcbaedb278d89ce67bf9db03872 --- /dev/null +++ b/node24/node_modules/npm/docs/output/configuring-npm/npm-global.html @@ -0,0 +1,331 @@ + + +Folders + + + + + +
+
+

+ Folders + @11.12.1 +

+Folder structures used by npm +
+ +
+

Table of contents

+ +
+ +

Description

+

npm puts various things on your computer. +That's its job.

+

This document will tell you what it puts where.

+

tl;dr

+
    +
  • Local install (default): puts stuff in ./node_modules of the current package root.
  • +
  • Global install (with -g): puts stuff in /usr/local or wherever node is installed.
  • +
  • Install it locally if you're going to require() it.
  • +
  • Install it globally if you're going to run it on the command line.
  • +
  • If you need both, then install it in both places, or use npm link.
  • +
+

prefix Configuration

+

The prefix config defaults to the location where node is installed. +On most systems, this is /usr/local. +On Windows, it's %AppData%\npm. +On Unix systems, it's one level up, since node is typically installed at {prefix}/bin/node rather than {prefix}/node.exe.

+

When the global flag is set, npm installs things into this prefix. +When it is not set, it uses the root of the current package, or the current working directory if not in a package already.

+

Node Modules

+

Packages are dropped into the node_modules folder under the prefix. +When installing locally, this means that you can require("packagename") to load its main module, or require("packagename/lib/path/to/sub/module") to load other modules.

+

Global installs on Unix systems go to {prefix}/lib/node_modules. +Global installs on Windows go to {prefix}/node_modules (that is, no lib folder.)

+

Scoped packages are installed the same way, except they are grouped together in a sub-folder of the relevant node_modules folder with the name of that scope prefix by the @ symbol, e.g. npm install @myorg/package would place the package in {prefix}/node_modules/@myorg/package. +See scope for more details.

+

If you wish to require() a package, then install it locally.

+

Executables

+

When in global mode, executables are linked into {prefix}/bin on Unix, or directly into {prefix} on Windows. +Ensure that path is in your terminal's PATH environment to run them.

+

When in local mode, executables are linked into ./node_modules/.bin so that they can be made available to scripts run through npm. +(For example, so that a test runner will be in the path when you run npm test.)

+

Man Pages

+

When in global mode, man pages are linked into {prefix}/share/man.

+

When in local mode, man pages are not installed.

+

Man pages are not installed on Windows systems.

+

Cache

+

See npm cache. +Cache files are stored in ~/.npm on Posix, or %LocalAppData%/npm-cache on Windows.

+

This is controlled by the cache config param.

+

More Information

+

When installing locally, npm first tries to find an appropriate prefix folder. +This is so that npm install foo@1.2.3 will install to the sensible root of your package, even if you happen to have cded into some other folder.

+

Starting at the $PWD, npm will walk up the folder tree checking for a folder that contains either a package.json file, or a node_modules folder. +If such a thing is found, then that is treated as the effective "current directory" for the purpose of running npm commands. +(This behavior is inspired by and similar to git's .git-folder seeking logic when running git commands in a working dir.)

+

If no package root is found, then the current folder is used.

+

When you run npm install foo@1.2.3, then the package is loaded into the cache, and then unpacked into ./node_modules/foo. +Then, any of foo's dependencies are similarly unpacked into ./node_modules/foo/node_modules/....

+

Any bin files are symlinked to ./node_modules/.bin/, so that they may be found by npm scripts when necessary.

+

Global Installation

+

If the global config is set to true, then npm will install packages "globally".

+

For global installation, packages are installed roughly the same way, but using the folders described above.

+

Cycles, Conflicts, and Folder Parsimony

+

Cycles are handled using the property of node's module system that it walks up the directories looking for node_modules folders. +So, at every stage, if a package is already installed in an ancestor node_modules folder, then it is not installed at the current location.

+

Consider the case above, where foo -> bar -> baz. +Imagine if, in addition to that, baz depended on bar, so you'd have: +foo -> bar -> baz -> bar -> baz .... +However, since the folder structure is: foo/node_modules/bar/node_modules/baz, there's no need to put another copy of bar into .../baz/node_modules, since when baz calls require("bar"), it will get the copy that is installed in foo/node_modules/bar.

+

This shortcut is only used if the exact same version would be installed in multiple nested node_modules folders. +It is still possible to have a/node_modules/b/node_modules/a if the two "a" packages are different versions. +However, without repeating the exact same package multiple times, an infinite regress will always be prevented.

+

Another optimization can be made by installing dependencies at the highest level possible, below the localized "target" folder (hoisting). +Since version 3, npm hoists dependencies by default.

+

Example

+

Consider this dependency graph:

+
foo
++-- blerg@1.2.5
++-- bar@1.2.3
+|   +-- blerg@1.x (latest=1.3.7)
+|   +-- baz@2.x
+|   |   `-- quux@3.x
+|   |       `-- bar@1.2.3 (cycle)
+|   `-- asdf@*
+`-- baz@1.2.3
+    `-- quux@3.x
+        `-- bar
+
+

In this case, we might expect a folder structure like this (with all dependencies hoisted to the highest level possible):

+
foo
++-- node_modules
+    +-- blerg (1.2.5) <---[A]
+    +-- bar (1.2.3) <---[B]
+    |   +-- node_modules
+    |       +-- baz (2.0.2) <---[C]
+    +-- asdf (2.3.4)
+    +-- baz (1.2.3) <---[D]
+    +-- quux (3.2.0) <---[E]
+
+

Since foo depends directly on bar@1.2.3 and baz@1.2.3, those are installed in foo's node_modules folder.

+

Even though the latest copy of blerg is 1.3.7, foo has a specific dependency on version 1.2.5. +So, that gets installed at [A]. +Since the parent installation of blerg satisfies bar's dependency on blerg@1.x, it does not install another copy under [B].

+

Bar [B] also has dependencies on baz and asdf. +Because it depends on baz@2.x, it cannot re-use the baz@1.2.3 installed in the parent node_modules folder [D], and must install its own copy [C]. +In order to minimize duplication, npm hoists dependencies to the top level by default, so asdf is installed under [A].

+

Underneath bar, the baz -> quux -> bar dependency creates a cycle. +However, because bar is already in quux's ancestry [B], it does not unpack another copy of bar into that folder. +Likewise, quux's [E] folder tree is empty, because its dependency on bar is satisfied by the parent folder copy installed at [B].

+

For a graphical breakdown of what is installed where, use npm ls.

+

Publishing

+

Upon publishing, npm will look in the node_modules folder. +If any of the items there are not in the bundleDependencies array, then they will not be included in the package tarball.

+

This allows a package maintainer to install all of their dependencies (and dev dependencies) locally, but only re-publish those items that cannot be found elsewhere. +See package.json for more information.

+

See also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/configuring-npm/npm-json.html b/node24/node_modules/npm/docs/output/configuring-npm/npm-json.html new file mode 100644 index 0000000000000000000000000000000000000000..f2dd403d043cd36a21370de0ad655355d27e4d99 --- /dev/null +++ b/node24/node_modules/npm/docs/output/configuring-npm/npm-json.html @@ -0,0 +1,1086 @@ + + +package.json + + + + + +
+
+

+ package.json + @11.12.1 +

+Specifics of npm's package.json handling +
+ +
+

Table of contents

+ +
+ +

Description

+

This document is all you need to know about what's required in your package.json file. +It must be actual JSON, not just a JavaScript object literal.

+

A lot of the behavior described in this document is affected by the config settings described in config.

+

name

+

If you plan to publish your package, the most important things in your package.json are the name and version fields as they will be required. +The name and version together form an identifier that is assumed to be completely unique. +Changes to the package should come along with changes to the version. +If you don't plan to publish your package, the name and version fields are optional.

+

The name is what your thing is called.

+

Some rules:

+
    +
  • The name must be less than or equal to 214 characters. +This includes the scope for scoped packages.
  • +
  • The names of scoped packages can begin with a dot or an underscore. +This is not permitted without a scope.
  • +
  • New packages must not have uppercase letters in the name.
  • +
  • The name ends up being part of a URL, an argument on the command line, and a folder name. +Therefore, the name can't contain any non-URL-safe characters.
  • +
+

Some tips:

+
    +
  • Don't use the same name as a core Node module.
  • +
  • Don't put "js" or "node" in the name. +It's assumed that it's js, since you're writing a package.json file, and you can specify the engine using the "engines" field. +(See below.)
  • +
  • The name will probably be passed as an argument to require(), so it should be something short, but also reasonably descriptive.
  • +
  • You may want to check the npm registry to see if there's something by that name already, before you get too attached to it. +https://www.npmjs.com/
  • +
+

A name can be optionally prefixed by a scope, e.g. @npm/example. +See scope for more detail.

+

version

+

If you plan to publish your package, the most important things in your package.json are the name and version fields as they will be required. +The name and version together form an identifier that is assumed to be completely unique. +Changes to the package should come along with changes to the version. +If you don't plan to publish your package, the name and version fields are optional.

+

Version must be parseable by node-semver, which is bundled with npm as a dependency. +(npm install semver to use it yourself.)

+

description

+

Put a description in it. +It's a string. +This helps people discover your package, as it's listed in npm search.

+

keywords

+

Put keywords in it. +It's an array of strings. +This helps people discover your package as it's listed in npm search.

+

Example:

+
"keywords": [
+  "node",
+  "javascript",
+  "npm"
+]
+
+

homepage

+

The URL to the project homepage.

+

Example:

+
"homepage": "https://github.com/npm/example#readme"
+
+

bugs

+

The URL to your project's issue tracker and / or the email address to which issues should be reported. +These are helpful for people who encounter issues with your package.

+

It should look like this:

+
{
+  "bugs": {
+    "url": "https://github.com/npm/example/issues",
+    "email": "example@npmjs.com"
+  }
+}
+
+

You can specify either one or both values. +If you want to provide only a URL, you can specify the value for "bugs" as a simple string instead of an object.

+

If a URL is provided, it will be used by the npm bugs command.

+

license

+

You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you're placing on it.

+

If you're using a common license such as BSD-2-Clause or MIT, add a current SPDX license identifier for the license you're using, like this:

+
{
+  "license" : "BSD-3-Clause"
+}
+
+

You can check the full list of SPDX license IDs. +Ideally, you should pick one that is OSI approved.

+

If your package is licensed under multiple common licenses, use an SPDX license expression syntax version 2.0 string, like this:

+
{
+  "license" : "(ISC OR GPL-3.0)"
+}
+
+

If you are using a license that hasn't been assigned an SPDX identifier, or if you are using a custom license, use a string value like this one:

+
{
+  "license" : "SEE LICENSE IN <filename>"
+}
+
+

Then include a file named <filename> at the top level of the package.

+

Some old packages used license objects or a "licenses" property containing an array of license objects:

+
// Not valid metadata
+{
+  "license" : {
+    "type" : "ISC",
+    "url" : "https://opensource.org/licenses/ISC"
+  }
+}
+
+// Not valid metadata
+{
+  "licenses" : [
+    {
+      "type": "MIT",
+      "url": "https://www.opensource.org/licenses/mit-license.php"
+    },
+    {
+      "type": "Apache-2.0",
+      "url": "https://opensource.org/licenses/apache2.0.php"
+    }
+  ]
+}
+
+

Those styles are now deprecated. +Instead, use SPDX expressions, like this:

+
{
+  "license": "ISC"
+}
+
+
{
+  "license": "(MIT OR Apache-2.0)"
+}
+
+

Finally, if you do not wish to grant others the right to use a private or unpublished package under any terms:

+
{
+  "license": "UNLICENSED"
+}
+
+

Consider also setting "private": true to prevent accidental publication.

+

people fields: author, contributors

+

The "author" is one person. +"contributors" is an array of people. +A "person" is an object with a "name" field and optionally "url" and "email", like this:

+
{
+  "name" : "Barney Rubble",
+  "email" : "barney@npmjs.com",
+  "url" : "http://barnyrubble.npmjs.com/"
+}
+
+

Or you can shorten that all into a single string, and npm will parse it for you:

+
{
+  "author": "Barney Rubble <barney@npmjs.com> (http://barnyrubble.npmjs.com/)"
+}
+
+

Both email and url are optional either way.

+

npm also sets a top-level "maintainers" field with your npm user info.

+

funding

+

You can specify an object containing a URL that provides up-to-date information about ways to help fund development of your package, a string URL, or an array of objects and string URLs:

+
{
+  "funding": {
+    "type" : "individual",
+    "url" : "http://npmjs.com/donate"
+  }
+}
+
+
{
+  "funding": {
+    "type" : "patreon",
+    "url" : "https://www.patreon.com/user"
+  }
+}
+
+
{
+  "funding": "http://npmjs.com/donate"
+}
+
+
{
+  "funding": [
+    {
+      "type" : "individual",
+      "url" : "http://npmjs.com/donate"
+    },
+    "http://npmjs.com/donate-also",
+    {
+      "type" : "patreon",
+      "url" : "https://www.patreon.com/user"
+    }
+  ]
+}
+
+

Users can use the npm fund subcommand to list the funding URLs of all dependencies of their project, direct and indirect. +A shortcut to visit each funding URL is also available when providing the project name such as: +npm fund <projectname> (when there are multiple URLs, the first one will be visited)

+

files

+

The optional files field is an array of file patterns that describes the entries to be included when your package is installed as a dependency. +File patterns follow a similar syntax to .gitignore, but reversed: including a file, directory, or glob pattern (*, **/*, and such) will make it so that file is included in the tarball when it's packed. +Omitting the field will make it default to ["*"], which means it will include all files.

+

Some special files and directories are also included or excluded regardless of whether they exist in the files array (see below).

+

You can also provide a .npmignore file in the root of your package or in subdirectories, which will keep files from being included. +At the root of your package it will not override the "files" field, but in subdirectories it will. +The .npmignore file works just like a .gitignore. +If there is a .gitignore file, and .npmignore is missing, .gitignore's contents will be used instead.

+

Certain files are always included, regardless of settings:

+
    +
  • package.json
  • +
  • README
  • +
  • LICENSE / LICENCE
  • +
  • The file in the "main" field
  • +
  • The file(s) in the "bin" field
  • +
+

README & LICENSE can have any case and extension.

+

Some files are always ignored by default:

+
    +
  • *.orig
  • +
  • .*.swp
  • +
  • .DS_Store
  • +
  • ._*
  • +
  • .git
  • +
  • .hg
  • +
  • .lock-wscript
  • +
  • .npmrc
  • +
  • .svn
  • +
  • .wafpickle-N
  • +
  • CVS
  • +
  • config.gypi
  • +
  • node_modules
  • +
  • npm-debug.log
  • +
  • package-lock.json (use npm-shrinkwrap.json if you wish it to be published)
  • +
  • pnpm-lock.yaml
  • +
  • yarn.lock
  • +
  • bun.lockb
  • +
+

Most of these ignored files can be included specifically if included in the files globs. +Exceptions to this are:

+
    +
  • .git
  • +
  • .npmrc
  • +
  • node_modules
  • +
  • package-lock.json
  • +
  • pnpm-lock.yaml
  • +
  • yarn.lock
  • +
  • bun.lockb
  • +
+

These cannot be included.

+

exports

+

The "exports" provides a modern alternative to "main" allowing multiple entry points to be defined, conditional entry resolution support between environments, and preventing any other entry points besides those defined in "exports". This encapsulation allows module authors to clearly define the public interface for their package. +For more details see the node.js documentation on package entry points

+

main

+

The main field is a module ID that is the primary entry point to your program. +That is, if your package is named foo, and a user installs it, and then does require("foo"), then your main module's exports object will be returned.

+

This should be a module relative to the root of your package folder.

+

For most modules, it makes the most sense to have a main script and often not much else.

+

If main is not set, it defaults to index.js in the package's root folder.

+

type

+

The type field defines how Node.js should interpret .js files in your package. This field is not used by npm.

+

See the Node.js documentation on the type field for more information.

+

browser

+

If your module is meant to be used client-side the browser field should be used instead of the main field. +This is helpful to hint users that it might rely on primitives that aren't available in Node.js modules. +(e.g. window)

+

bin

+

A lot of packages have one or more executable files that they'd like to install into the PATH. npm makes this pretty easy (in fact, it uses this feature to install the "npm" executable.)

+

To use this, supply a bin field in your package.json which is a map of command name to local file name. +When this package is installed globally, that file will be either linked inside the global bins directory or a cmd (Windows Command File) will be created which executes the specified file in the bin field, so it is available to run by name or name.cmd (on Windows PowerShell). +When this package is installed as a dependency in another package, the file will be linked where it will be available to that package either directly by npm exec or by name in other scripts when invoking them via npm run.

+

For example, myapp could have this:

+
{
+  "bin": {
+    "myapp": "bin/cli.js"
+  }
+}
+
+

So, when you install myapp, in case of unix-like OS it'll create a symlink from the cli.js script to /usr/local/bin/myapp and in case of windows it will create a cmd file usually at C:\Users\{Username}\AppData\Roaming\npm\myapp.cmd which runs the cli.js script.

+

If you have a single executable, and its name should be the name of the package, then you can just supply it as a string. +For example:

+
{
+  "name": "my-program",
+  "version": "1.2.5",
+  "bin": "path/to/program"
+}
+
+

would be the same as this:

+
{
+  "name": "my-program",
+  "version": "1.2.5",
+  "bin": {
+    "my-program": "path/to/program"
+  }
+}
+
+

Please make sure that your file(s) referenced in bin starts with #!/usr/bin/env node; otherwise, the scripts are started without the node executable!

+

Note that you can also set the executable files using directories.bin.

+

See folders for more info on executables.

+

man

+

Specify either a single file or an array of filenames to put in place for the man program to find.

+

If only a single file is provided, then it's installed such that it is the result from man <pkgname>, regardless of its actual filename. +For example:

+
{
+  "name": "foo",
+  "version": "1.2.3",
+  "description": "A packaged foo fooer for fooing foos",
+  "main": "foo.js",
+  "man": "./man/doc.1"
+}
+
+

would link the ./man/doc.1 file in such that it is the target for man foo

+

If the filename doesn't start with the package name, then it's prefixed. +So, this:

+
{
+  "name": "foo",
+  "version": "1.2.3",
+  "description": "A packaged foo fooer for fooing foos",
+  "main": "foo.js",
+  "man": [
+    "./man/foo.1",
+    "./man/bar.1"
+  ]
+}
+
+

will create files to do man foo and man foo-bar.

+

Man files must end with a number, and optionally a .gz suffix if they are compressed. +The number dictates which man section the file is installed into.

+
{
+  "name": "foo",
+  "version": "1.2.3",
+  "description": "A packaged foo fooer for fooing foos",
+  "main": "foo.js",
+  "man": [
+    "./man/foo.1",
+    "./man/foo.2"
+  ]
+}
+
+

will create entries for man foo and man 2 foo

+

directories

+

The CommonJS Packages spec details a few ways that you can indicate the structure of your package using a directories object. +If you look at npm's package.json, you'll see that it has directories for doc, lib, and man.

+

In the future, this information may be used in other creative ways.

+

directories.bin

+

If you specify a bin directory in directories.bin, all the files in that folder will be added.

+

Because of the way the bin directive works, specifying both a bin path and setting directories.bin is an error. +If you want to specify individual files, use bin, and for all the files in an existing bin directory, use directories.bin.

+

directories.man

+

A folder that is full of man pages. +Sugar to generate a "man" array by walking the folder.

+

repository

+

Specify the place where your code lives. +This is helpful for people who want to contribute. +If the git repo is on GitHub, then the npm repo command will be able to find you.

+

Do it like this:

+
{
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/cli.git"
+  }
+}
+
+

The URL should be a publicly available (perhaps read-only) URL that can be handed directly to a VCS program without any modification. +It should not be a URL to an html project page that you put in your browser. +It's for computers.

+

For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same shortcut syntax you use for npm install:

+
{
+  "repository": "npm/example",
+
+  "repository": "github:npm/example",
+
+  "repository": "gist:11081aaa281",
+
+  "repository": "bitbucket:user/repo",
+
+  "repository": "gitlab:user/repo"
+}
+
+

Note on normalization: When you publish a package, npm normalizes the repository field to the full object format with a url property. If you use a shorthand format (like "npm/example"), you'll see a warning during npm publish indicating that the field was auto-corrected. While the shorthand format currently works, it's recommended to use the full object format in your package.json to avoid warnings and ensure future compatibility:

+
{
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/example.git"
+  }
+}
+
+

You can run npm pkg fix to automatically convert shorthand formats to the normalized object format.

+

If the package.json for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives:

+
{
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/cli.git",
+    "directory": "workspaces/libnpmpublish"
+  }
+}
+
+

scripts

+

The "scripts" property is a dictionary containing script commands that are run at various times in the lifecycle of your package. +The key is the lifecycle event, and the value is the command to run at that point.

+

See scripts to find out more about writing package scripts.

+

gypfile

+

If you have a binding.gyp file in the root of your package and you have not defined your own install or preinstall scripts, npm will default to building your module using node-gyp.

+

To prevent npm from automatically building your module with node-gyp, set gypfile to false:

+
{
+  "gypfile": false
+}
+
+

This is useful for packages that include native addons but want to handle the build process differently, or packages that have a binding.gyp file but should not be built as a native addon.

+

config

+

A "config" object can be used to set configuration parameters used in package scripts that persist across upgrades. +For instance, if a package had the following:

+
{
+  "name": "foo",
+  "config": {
+    "port": "8080"
+  }
+}
+
+

It could also have a "start" script that referenced the npm_package_config_port environment variable.

+

dependencies

+

Dependencies are specified in a simple object that maps a package name to a version range. +The version range is a string which has one or more space-separated descriptors. +Dependencies can also be identified with a tarball or git URL.

+

Please do not put test harnesses or transpilers or other "development" time tools in your dependencies object. +See devDependencies, below.

+

See semver for more details about specifying version ranges.

+
    +
  • version Must match version exactly
  • +
  • >version Must be greater than version
  • +
  • >=version etc
  • +
  • <version
  • +
  • <=version
  • +
  • ~version "Approximately equivalent to version" See semver
  • +
  • ^version "Compatible with version" See semver
  • +
  • 1.2.x 1.2.0, 1.2.1, etc., but not 1.3.0
  • +
  • http://... See 'URLs as Dependencies' below
  • +
  • * Matches any version
  • +
  • "" (just an empty string) Same as *
  • +
  • version1 - version2 Same as >=version1 <=version2.
  • +
  • range1 || range2 Passes if either range1 or range2 are satisfied.
  • +
  • git... See 'Git URLs as Dependencies' below
  • +
  • user/repo See 'GitHub URLs' below
  • +
  • tag A specific version tagged and published as tag See npm dist-tag
  • +
  • path/path/path See Local Paths below
  • +
  • npm:@scope/pkg@version Custom alias for a package See package-spec
  • +
+

For example, these are all valid:

+
{
+  "dependencies": {
+    "foo": "1.0.0 - 2.9999.9999",
+    "bar": ">=1.0.2 <2.1.2",
+    "baz": ">1.0.2 <=2.3.4",
+    "boo": "2.0.1",
+    "qux": "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0",
+    "asd": "http://npmjs.com/example.tar.gz",
+    "til": "~1.2",
+    "elf": "~1.2.3",
+    "two": "2.x",
+    "thr": "3.3.x",
+    "lat": "latest",
+    "dyl": "file:../dyl",
+    "kpg": "npm:pkg@1.0.0"
+  }
+}
+
+

URLs as Dependencies

+

You may specify a tarball URL in place of a version range.

+

This tarball will be downloaded and installed locally to your package at install time.

+

Git URLs as Dependencies

+

Git URLs are of the form:

+
<protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish> | #semver:<semver>]
+
+

<protocol> is one of git, git+ssh, git+http, git+https, or git+file.

+

If #<commit-ish> is provided, it will be used to clone exactly that commit. +If the commit-ish has the format #semver:<semver>, <semver> can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. +If neither #<commit-ish> or #semver:<semver> is specified, then the default branch is used.

+

Examples:

+
git+ssh://git@github.com:npm/cli.git#v1.0.27
+git+ssh://git@github.com:npm/cli#semver:^5.0
+git+https://isaacs@github.com/npm/cli.git
+git://github.com/npm/cli.git#v1.0.27
+
+

When installing from a git repository, the presence of certain fields in the package.json will cause npm to believe it needs to perform a build. +To do so your repository will be cloned into a temporary directory, all of its deps installed, relevant scripts run, and the resulting directory packed and installed.

+

This flow will occur if your git dependency uses workspaces, or if any of the following scripts are present:

+
    +
  • build
  • +
  • prepare
  • +
  • prepack
  • +
  • preinstall
  • +
  • install
  • +
  • postinstall
  • +
+

If your git repository includes pre-built artifacts, you will likely want to make sure that none of the above scripts are defined, or your dependency will be rebuilt for every installation.

+

GitHub URLs

+

As of version 1.1.65, you can refer to GitHub URLs as just "foo": +"user/foo-project". Just as with git URLs, a commit-ish suffix can be included. +For example:

+
{
+  "name": "foo",
+  "version": "0.0.0",
+  "dependencies": {
+    "express": "expressjs/express",
+    "mocha": "mochajs/mocha#4727d357ea",
+    "module": "npm/example-github-repo#feature\/branch"
+  }
+}
+
+

Local Paths

+

As of version 2.0.0 you can provide a path to a local directory that contains a package. +Local paths can be saved using npm install -S or npm install --save, using any of these forms:

+
../foo/bar
+~/foo/bar
+./foo/bar
+/foo/bar
+
+

in which case they will be normalized to a relative path and added to your package.json. +For example:

+
{
+  "name": "baz",
+  "dependencies": {
+    "bar": "file:../foo/bar"
+  }
+}
+
+

This feature is helpful for local offline development and creating tests that require npm installing where you don't want to hit an external server, but should not be used when publishing your package to the public registry.

+

note: Packages linked by local path will not have their own dependencies installed when npm install is run. +You must run npm install from inside the local path itself.

+

devDependencies

+

If someone is planning on downloading and using your module in their program, then they probably don't want or need to download and build the external test or documentation framework that you use.

+

In this case, it's best to map these additional items in a devDependencies object.

+

These things will be installed when doing npm link or npm install from the root of a package, and can be managed like any other npm configuration param. +See config for more on the topic.

+

For build steps that are not platform-specific, such as compiling CoffeeScript or other languages to JavaScript, use the prepare script to do this, and make the required package a devDependency.

+

For example:

+
{
+  "name": "@npm/ethopia-waza",
+  "description": "a delightfully fruity coffee varietal",
+  "version": "1.2.3",
+  "devDependencies": {
+    "coffee-script": "~1.6.3"
+  },
+  "scripts": {
+    "prepare": "coffee -o lib/ -c src/waza.coffee"
+  },
+  "main": "lib/waza.js"
+}
+
+

The prepare script will be run before publishing, so that users can consume the functionality without requiring them to compile it themselves. +In dev mode (ie, locally running npm install), it'll run this script as well, so that you can test it easily.

+

peerDependencies

+

In some cases, you want to express the compatibility of your package with a host tool or library, while not necessarily doing a require of this host. +This is usually referred to as a plugin. Notably, your module may be exposing a specific interface, expected and specified by the host documentation.

+

For example:

+
{
+  "name": "@npm/tea-latte",
+  "version": "1.3.5",
+  "peerDependencies": {
+    "@npm/tea": "2.x"
+  }
+}
+
+

This ensures your package @npm/tea-latte can be installed along with the second major version of the host package @npm/tea only. +npm install tea-latte could possibly yield the following dependency graph:

+
├── @npm/tea-latte@1.3.5
+└── @npm/tea@2.2.0
+
+

In npm versions 3 through 6, peerDependencies were not automatically installed, and would raise a warning if an invalid version of the peer dependency was found in the tree. +As of npm v7, peerDependencies are installed by default.

+

Trying to install another plugin with a conflicting requirement may cause an error if the tree cannot be resolved correctly. +For this reason, make sure your plugin requirement is as broad as possible, and not to lock it down to specific patch versions.

+

Assuming the host complies with semver, only changes in the host package's major version will break your plugin. +Thus, if you've worked with every 1.x version of the host package, use "^1.0" or "1.x" to express this. +If you depend on features introduced in 1.5.2, use "^1.5.2".

+

peerDependenciesMeta

+

The peerDependenciesMeta field serves to provide npm more information on how your peer dependencies are to be used. +Specifically, it allows peer dependencies to be marked as optional. +Npm will not automatically install optional peer dependencies. +This allows you to integrate and interact with a variety of host packages without requiring all of them to be installed.

+

For example:

+
{
+  "name": "@npm/tea-latte",
+  "version": "1.3.5",
+  "peerDependencies": {
+    "@npm/tea": "2.x",
+    "@npm/soy-milk": "1.2"
+  },
+  "peerDependenciesMeta": {
+    "@npm/soy-milk": {
+      "optional": true
+    }
+  }
+}
+
+

bundleDependencies

+

This defines an array of package names that will be bundled when publishing the package.

+

In cases where you need to preserve npm packages locally or have them available through a single file download, you can bundle the packages in a tarball file by specifying the package names in the bundleDependencies array and executing npm pack.

+

For example:

+

If we define a package.json like this:

+
{
+  "name": "@npm/awesome-web-framework",
+  "version": "1.0.0",
+  "bundleDependencies": [
+    "@npm/renderized",
+    "@npm/super-streams"
+  ]
+}
+
+

we can obtain @npm/awesome-web-framework-1.0.0.tgz file by running npm pack. +This file contains the dependencies @npm/renderized and @npm/super-streams which can be installed in a new project by executing npm install awesome-web-framework-1.0.0.tgz. +Note that the package names do not include any versions, as that information is specified in dependencies.

+

If this is spelled "bundledDependencies", then that is also honored.

+

Alternatively, "bundleDependencies" can be defined as a boolean value. +A value of true will bundle all dependencies, a value of false will bundle none.

+

optionalDependencies

+

If a dependency can be used, but you would like npm to proceed if it cannot be found or fails to install, then you may put it in the optionalDependencies object. +This is a map of package name to version or URL, just like the dependencies object. +The difference is that build failures do not cause installation to fail. +Running npm install --omit=optional will prevent these dependencies from being installed.

+

It is still your program's responsibility to handle the lack of the dependency. +For example, something like this:

+
try {
+  var foo = require('@npm/foo')
+  var fooVersion = require('@npm/foo/package.json').version
+} catch (er) {
+  foo = null
+}
+if ( notGoodFooVersion(fooVersion) ) {
+  foo = null
+}
+
+// .. then later in your program ..
+
+if (foo) {
+  foo.doFooThings()
+}
+
+

Entries in optionalDependencies will override entries of the same name in dependencies, so it's usually best to only put in one place.

+

overrides

+

If you need to make specific changes to dependencies of your dependencies, for example replacing the version of a dependency with a known security issue, replacing an existing dependency with a fork, or making sure that the same version of a package is used everywhere, then you may add an override.

+

Overrides provide a way to replace a package in your dependency tree with another version, or another package entirely. +These changes can be scoped as specific or as vague as desired.

+

Overrides are only considered in the root package.json file for a project. +Overrides in installed dependencies (including workspaces) are not considered in dependency tree resolution. +Published packages may dictate their resolutions by pinning dependencies or using an npm-shrinkwrap.json file.

+

To make sure the package @npm/foo is always installed as version 1.0.0 no matter what version your dependencies rely on:

+
{
+  "overrides": {
+    "@npm/foo": "1.0.0"
+  }
+}
+
+

The above is a short hand notation, the full object form can be used to allow overriding a package itself as well as a child of the package. +This will cause @npm/foo to always be 1.0.0 while also making @npm/bar at any depth beyond @npm/foo also 1.0.0:

+
{
+  "overrides": {
+    "@npm/foo": {
+      ".": "1.0.0",
+      "@npm/bar": "1.0.0"
+    }
+  }
+}
+
+

To only override @npm/foo to be 1.0.0 when it's a child (or grandchild, or great grandchild, etc) of the package @npm/bar:

+
{
+  "overrides": {
+    "@npm/bar": {
+      "@npm/foo": "1.0.0"
+    }
+  }
+}
+
+

Keys can be nested to any arbitrary length. +To override @npm/foo only when it's a child of @npm/bar and only when @npm/bar is a child of @npm/baz:

+
{
+  "overrides": {
+    "@npm/baz": {
+      "@npm/bar": {
+        "@npm/foo": "1.0.0"
+      }
+    }
+  }
+}
+
+

The key of an override can also include a version, or range of versions. +To override @npm/foo to 1.0.0, but only when it's a child of @npm/bar@2.0.0:

+
{
+  "overrides": {
+    "@npm/bar@2.0.0": {
+      "@npm/foo": "1.0.0"
+    }
+  }
+}
+
+

You may not set an override for a package that you directly depend on unless both the dependency and the override itself share the exact same spec. +To make this limitation easier to deal with, overrides may also be defined as a reference to a spec for a direct dependency by prefixing the name of the package you wish the version to match with a $.

+
{
+  "dependencies": {
+    "@npm/foo": "^1.0.0"
+  },
+  "overrides": {
+    // BAD, will throw an EOVERRIDE error
+    // "foo": "^2.0.0"
+    // GOOD, specs match so override is allowed
+    // "foo": "^1.0.0"
+    // BEST, the override is defined as a reference to the dependency
+    "@npm/foo": "$foo",
+    // the referenced package does not need to match the overridden one
+    "@npm/bar": "$foo"
+  }
+}
+
+

Replacing a dependency with a fork

+

You can replace a package with a different package or fork using several methods:

+

Using the npm: prefix to replace with a different package name:

+
{
+  "overrides": {
+    "package-name": "npm:@scope/forked-package@1.0.0"
+  }
+}
+
+

Using a GitHub repository (supports branches, tags, or commit hashes):

+
{
+  "overrides": {
+    "package-name": "github:username/repo#branch-name"
+  }
+}
+
+

Using a local file path:

+
{
+  "overrides": {
+    "package-name": "file:../local-fork"
+  }
+}
+
+

These replacement methods work for both top-level overrides and nested overrides. +For example, to replace a transitive dependency with a fork:

+
{
+  "overrides": {
+    "parent-package": {
+      "vulnerable-dep": "github:username/patched-fork#v2.0.1"
+    }
+  }
+}
+
+

engines

+

You can specify the version of node that your stuff works on:

+
{
+  "engines": {
+    "node": ">=0.10.3 <15"
+  }
+}
+
+

And, like with dependencies, if you don't specify the version (or if you specify "*" as the version), then any version of node will do.

+

You can also use the "engines" field to specify which versions of npm are capable of properly installing your program. +For example:

+
{
+  "engines": {
+    "npm": "~1.0.20"
+  }
+}
+
+

Unless the user has set the engine-strict config flag, this field is advisory only and will only produce warnings when your package is installed as a dependency.

+

os

+

You can specify which operating systems your module will run on:

+
{
+  "os": [
+    "darwin",
+    "linux"
+  ]
+}
+
+

You can also block instead of allowing operating systems, just prepend the blocked os with a '!':

+
{
+  "os": [
+    "!win32"
+  ]
+}
+
+

The host operating system is determined by process.platform

+

It is allowed to both block and allow an item, although there isn't any good reason to do this.

+

cpu

+

If your code only runs on certain cpu architectures, you can specify which ones.

+
{
+  "cpu": [
+    "x64",
+    "ia32"
+  ]
+}
+
+

Like the os option, you can also block architectures:

+
{
+  "cpu": [
+    "!arm",
+    "!mips"
+  ]
+}
+
+

The host architecture is determined by process.arch

+

libc

+

If your code only runs or builds in certain versions of libc, you can specify which ones. +This field only applies if os is linux.

+
{
+  "os": "linux",
+  "libc": "glibc"
+}
+
+

devEngines

+

The devEngines field aids engineers working on a codebase to all be using the same tooling.

+

You can specify a devEngines property in your package.json which will run before install, ci, and run commands.

+
+

Note: engines and devEngines differ in object shape. +They also function very differently. +engines is designed to alert the user when a dependency uses a different npm or node version than the project it's being used in, whereas devEngines is used to alert people interacting with the source code of a project.

+
+

The supported keys under the devEngines property are cpu, os, libc, runtime, and packageManager. +Each property can be an object or an array of objects. +Objects must contain name, and optionally can specify version, and onFail. +onFail can be warn, error, or ignore, and if left undefined is of the same value as error. +npm will assume that you're running with node. +Here's an example of a project that will fail if the environment is not node and npm. +If you set runtime.name or packageManager.name to any other string, it will fail within the npm CLI.

+
{
+  "devEngines": {
+    "runtime": {
+      "name": "node",
+      "onFail": "error"
+    },
+    "packageManager": {
+      "name": "npm",
+      "onFail": "error"
+    }
+  }
+}
+
+

private

+

If you set "private": true in your package.json, then npm will refuse to publish it.

+

This is a way to prevent accidental publication of private repositories. +If you would like to ensure that a given package is only ever published to a specific registry (for example, an internal registry), then use the publishConfig dictionary described below to override the registry config param at publish-time.

+

publishConfig

+

This is a set of config values that will be used at publish-time. +It's especially handy if you want to set the tag, registry or access, so that you can ensure that a given package is not tagged with "latest", published to the global public registry or that a scoped module is private by default.

+

See config to see the list of config options that can be overridden.

+

workspaces

+

The optional workspaces field is an array of file patterns that describes locations within the local file system that the install client should look up to find each workspace that needs to be symlinked to the top level node_modules folder.

+

It can describe either the direct paths of the folders to be used as workspaces or it can define globs that will resolve to these same folders.

+

In the following example, all folders located inside the folder ./packages will be treated as workspaces as long as they have valid package.json files inside them:

+
{
+  "name": "workspace-example",
+  "workspaces": [
+    "./packages/*"
+  ]
+}
+
+

See workspaces for more examples.

+

DEFAULT VALUES

+

npm will default some values based on package contents.

+
    +
  • +

    "scripts": {"start": "node server.js"}

    +

    If there is a server.js file in the root of your package, then npm will default the start command to node server.js.

    +
  • +
  • +

    "scripts":{"install": "node-gyp rebuild"}

    +

    If there is a binding.gyp file in the root of your package and you have not defined an install or preinstall script, npm will default the install command to compile using node-gyp.

    +
  • +
  • +

    "contributors": [...]

    +

    If there is an AUTHORS file in the root of your package, npm will treat each line as a Name <email> (url) format, where email and url are optional. +Lines which start with a # or are blank, will be ignored.

    +
  • +
+

SEE ALSO

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/configuring-npm/npm-shrinkwrap-json.html b/node24/node_modules/npm/docs/output/configuring-npm/npm-shrinkwrap-json.html new file mode 100644 index 0000000000000000000000000000000000000000..d39fc801419a9e14d8baac3ed31792662a0d3413 --- /dev/null +++ b/node24/node_modules/npm/docs/output/configuring-npm/npm-shrinkwrap-json.html @@ -0,0 +1,229 @@ + + +npm-shrinkwrap.json + + + + + +
+
+

+ npm-shrinkwrap.json + @11.12.1 +

+A publishable lockfile +
+ +
+

Table of contents

+ +
+ +

Description

+

npm-shrinkwrap.json is a file created by npm shrinkwrap. +It is identical to package-lock.json, with one major caveat: Unlike package-lock.json, +npm-shrinkwrap.json may be included when publishing a package.

+

The recommended use-case for npm-shrinkwrap.json is applications deployed through the publishing process on the registry: for example, daemons and command-line tools intended as global installs or devDependencies. +It's strongly discouraged for library authors to publish this file, since that would prevent end users from having control over transitive dependency updates.

+

If both package-lock.json and npm-shrinkwrap.json are present in a package root, npm-shrinkwrap.json will be preferred over the package-lock.json file.

+

For full details and description of the npm-shrinkwrap.json file format, refer to the manual page for package-lock.json.

+

See also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/configuring-npm/npmrc.html b/node24/node_modules/npm/docs/output/configuring-npm/npmrc.html new file mode 100644 index 0000000000000000000000000000000000000000..b11ceb8d7500aa5a4c96dca856322a97f69a8007 --- /dev/null +++ b/node24/node_modules/npm/docs/output/configuring-npm/npmrc.html @@ -0,0 +1,347 @@ + + +.npmrc + + + + + +
+
+

+ .npmrc + @11.12.1 +

+The npm config files +
+ +
+

Table of contents

+ +
+ +

Description

+

npm gets its config settings from the command line, environment variables, and npmrc files.

+

The npm config command can be used to update and edit the contents of the user and global npmrc files.

+

For a list of available configuration options, see config.

+

Files

+

The four relevant files are:

+
    +
  • per-project config file (/path/to/my/project/.npmrc)
  • +
  • per-user config file (~/.npmrc)
  • +
  • global config file ($PREFIX/etc/npmrc)
  • +
  • npm builtin config file (/path/to/npm/npmrc)
  • +
+

All npm config files are an ini-formatted list of key = value parameters. +Environment variables can be replaced using ${VARIABLE_NAME}. +By default if the variable is not defined, it is left unreplaced. +By adding ? after variable name they can be forced to evaluate to an empty string instead. +For example:

+
cache = ${HOME}/.npm-packages
+node-options = "${NODE_OPTIONS?} --use-system-ca"
+
+

Each of these files is loaded, and config options are resolved in priority order. +For example, a setting in the userconfig file would override the setting in the globalconfig file.

+

Array values are specified by adding "[]" after the key name. +For example:

+
key[] = "first value"
+key[] = "second value"
+
+

Comments

+

Lines in .npmrc files are interpreted as comments when they begin with a +; or # character. +.npmrc files are parsed by +npm/ini, which specifies this comment syntax.

+

For example:

+
# last modified: 01 Jan 2016
+; Set a new registry for a scoped package
+@myscope:registry=https://mycustomregistry.example.org
+
+

Per-project config file

+

When working locally in a project, a .npmrc file in the root of the project (ie, a sibling of node_modules and package.json) will set config values specific to this project.

+

Note that this only applies to the root of the project that you're running npm in. +It has no effect when your module is published. +For example, you can't publish a module that forces itself to install globally, or in a different location.

+

Additionally, this file is not read in global mode, such as when running npm install -g.

+

Per-user config file

+

$HOME/.npmrc (or the userconfig param, if set in the environment or on the command line)

+

Global config file

+

$PREFIX/etc/npmrc (or the globalconfig param, if set above): This file is an ini-file formatted list of key = value parameters. +Environment variables can be replaced as above.

+

Built-in config file

+

path/to/npm/itself/npmrc

+

This is an unchangeable "builtin" configuration file that npm keeps consistent across updates. +Set fields in here using the ./configure script that comes with npm. +This is primarily for distribution maintainers to override default configs in a standard and consistent manner.

+ +

The settings _auth, _authToken, username, _password, certfile, and keyfile must all be scoped to a specific registry. +This ensures that npm will never send credentials to the wrong host.

+

The full list is:

+
    +
  • _auth (base64 authentication string)
  • +
  • _authToken (authentication token)
  • +
  • username
  • +
  • _password
  • +
  • email
  • +
  • cafile (path to certificate authority file)
  • +
  • certfile (path to certificate file)
  • +
  • keyfile (path to key file)
  • +
+

In order to scope these values, they must be prefixed by a URI fragment. +If the credential is meant for any request to a registry on a single host, the scope may look like //registry.npmjs.org/:. +If it must be scoped to a specific path on the host that path may also be provided, such as +//my-custom-registry.org/unique/path:.

+

Unsupported Custom Configuration Keys

+

Starting in npm v11.2.0, npm warns when unknown configuration keys are defined in .npmrc. In a future major version of npm, these unknown keys may no longer be accepted.

+

Only configuration keys that npm officially supports are recognized. Custom keys intended for third-party tools (for example, electron-builder) should not be placed in .npmrc.

+

If you need package-level configuration for use in scripts, use the config field in your package.json instead:

+
{
+  "name": "my-package",
+  "config": {
+    "mirror": "https://example.com/"
+  }
+}
+
+
+

Values defined in package.json#config are exposed to scripts as environment variables prefixed with npm_package_config_. For example:

+
npm_package_config_mirror
+
+

If you need to pass arguments to a script command, use -- to separate npm arguments from script arguments:

+
npm run build -- --customFlag
+
+

Using environment variables is also recommended for cross-platform configuration instead of defining unsupported keys in .npmrc.

+
; bad config
+_authToken=MYTOKEN
+
+; good config
+@myorg:registry=https://somewhere-else.com/myorg
+@another:registry=https://somewhere-else.com/another
+//registry.npmjs.org/:_authToken=MYTOKEN
+
+; would apply to both @myorg and @another
+//somewhere-else.com/:_authToken=MYTOKEN
+
+; would apply only to @myorg
+//somewhere-else.com/myorg/:_authToken=MYTOKEN1
+
+; would apply only to @another
+//somewhere-else.com/another/:_authToken=MYTOKEN2
+
+

Custom / third-party config keys

+

npm only recognizes its own configuration options. +If your .npmrc contains keys that are not part of npm's config definitions +(for example, electron_mirror or sass_binary_site), npm will emit a +warning:

+
warn Unknown user config "electron_mirror".
+This will stop working in the next major version of npm.
+
+

These keys were historically tolerated but are not officially supported. +A future major version of npm will treat unknown top-level keys as errors.

+

Some tools (such as @electron/get or node-sass) read their own +configuration from environment variables or from .npmrc by convention. +You can set these values as environment variables instead:

+
export ELECTRON_MIRROR="https://mirrorexample.npmjs.org/mirrors/electron/"
+export ELECTRON_CUSTOM_DIR="{{ version }}"
+
+

Environment variables are the most portable approach and work regardless +of .npmrc format.

+

See also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/configuring-npm/package-json.html b/node24/node_modules/npm/docs/output/configuring-npm/package-json.html new file mode 100644 index 0000000000000000000000000000000000000000..f2dd403d043cd36a21370de0ad655355d27e4d99 --- /dev/null +++ b/node24/node_modules/npm/docs/output/configuring-npm/package-json.html @@ -0,0 +1,1086 @@ + + +package.json + + + + + +
+
+

+ package.json + @11.12.1 +

+Specifics of npm's package.json handling +
+ +
+

Table of contents

+ +
+ +

Description

+

This document is all you need to know about what's required in your package.json file. +It must be actual JSON, not just a JavaScript object literal.

+

A lot of the behavior described in this document is affected by the config settings described in config.

+

name

+

If you plan to publish your package, the most important things in your package.json are the name and version fields as they will be required. +The name and version together form an identifier that is assumed to be completely unique. +Changes to the package should come along with changes to the version. +If you don't plan to publish your package, the name and version fields are optional.

+

The name is what your thing is called.

+

Some rules:

+
    +
  • The name must be less than or equal to 214 characters. +This includes the scope for scoped packages.
  • +
  • The names of scoped packages can begin with a dot or an underscore. +This is not permitted without a scope.
  • +
  • New packages must not have uppercase letters in the name.
  • +
  • The name ends up being part of a URL, an argument on the command line, and a folder name. +Therefore, the name can't contain any non-URL-safe characters.
  • +
+

Some tips:

+
    +
  • Don't use the same name as a core Node module.
  • +
  • Don't put "js" or "node" in the name. +It's assumed that it's js, since you're writing a package.json file, and you can specify the engine using the "engines" field. +(See below.)
  • +
  • The name will probably be passed as an argument to require(), so it should be something short, but also reasonably descriptive.
  • +
  • You may want to check the npm registry to see if there's something by that name already, before you get too attached to it. +https://www.npmjs.com/
  • +
+

A name can be optionally prefixed by a scope, e.g. @npm/example. +See scope for more detail.

+

version

+

If you plan to publish your package, the most important things in your package.json are the name and version fields as they will be required. +The name and version together form an identifier that is assumed to be completely unique. +Changes to the package should come along with changes to the version. +If you don't plan to publish your package, the name and version fields are optional.

+

Version must be parseable by node-semver, which is bundled with npm as a dependency. +(npm install semver to use it yourself.)

+

description

+

Put a description in it. +It's a string. +This helps people discover your package, as it's listed in npm search.

+

keywords

+

Put keywords in it. +It's an array of strings. +This helps people discover your package as it's listed in npm search.

+

Example:

+
"keywords": [
+  "node",
+  "javascript",
+  "npm"
+]
+
+

homepage

+

The URL to the project homepage.

+

Example:

+
"homepage": "https://github.com/npm/example#readme"
+
+

bugs

+

The URL to your project's issue tracker and / or the email address to which issues should be reported. +These are helpful for people who encounter issues with your package.

+

It should look like this:

+
{
+  "bugs": {
+    "url": "https://github.com/npm/example/issues",
+    "email": "example@npmjs.com"
+  }
+}
+
+

You can specify either one or both values. +If you want to provide only a URL, you can specify the value for "bugs" as a simple string instead of an object.

+

If a URL is provided, it will be used by the npm bugs command.

+

license

+

You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you're placing on it.

+

If you're using a common license such as BSD-2-Clause or MIT, add a current SPDX license identifier for the license you're using, like this:

+
{
+  "license" : "BSD-3-Clause"
+}
+
+

You can check the full list of SPDX license IDs. +Ideally, you should pick one that is OSI approved.

+

If your package is licensed under multiple common licenses, use an SPDX license expression syntax version 2.0 string, like this:

+
{
+  "license" : "(ISC OR GPL-3.0)"
+}
+
+

If you are using a license that hasn't been assigned an SPDX identifier, or if you are using a custom license, use a string value like this one:

+
{
+  "license" : "SEE LICENSE IN <filename>"
+}
+
+

Then include a file named <filename> at the top level of the package.

+

Some old packages used license objects or a "licenses" property containing an array of license objects:

+
// Not valid metadata
+{
+  "license" : {
+    "type" : "ISC",
+    "url" : "https://opensource.org/licenses/ISC"
+  }
+}
+
+// Not valid metadata
+{
+  "licenses" : [
+    {
+      "type": "MIT",
+      "url": "https://www.opensource.org/licenses/mit-license.php"
+    },
+    {
+      "type": "Apache-2.0",
+      "url": "https://opensource.org/licenses/apache2.0.php"
+    }
+  ]
+}
+
+

Those styles are now deprecated. +Instead, use SPDX expressions, like this:

+
{
+  "license": "ISC"
+}
+
+
{
+  "license": "(MIT OR Apache-2.0)"
+}
+
+

Finally, if you do not wish to grant others the right to use a private or unpublished package under any terms:

+
{
+  "license": "UNLICENSED"
+}
+
+

Consider also setting "private": true to prevent accidental publication.

+

people fields: author, contributors

+

The "author" is one person. +"contributors" is an array of people. +A "person" is an object with a "name" field and optionally "url" and "email", like this:

+
{
+  "name" : "Barney Rubble",
+  "email" : "barney@npmjs.com",
+  "url" : "http://barnyrubble.npmjs.com/"
+}
+
+

Or you can shorten that all into a single string, and npm will parse it for you:

+
{
+  "author": "Barney Rubble <barney@npmjs.com> (http://barnyrubble.npmjs.com/)"
+}
+
+

Both email and url are optional either way.

+

npm also sets a top-level "maintainers" field with your npm user info.

+

funding

+

You can specify an object containing a URL that provides up-to-date information about ways to help fund development of your package, a string URL, or an array of objects and string URLs:

+
{
+  "funding": {
+    "type" : "individual",
+    "url" : "http://npmjs.com/donate"
+  }
+}
+
+
{
+  "funding": {
+    "type" : "patreon",
+    "url" : "https://www.patreon.com/user"
+  }
+}
+
+
{
+  "funding": "http://npmjs.com/donate"
+}
+
+
{
+  "funding": [
+    {
+      "type" : "individual",
+      "url" : "http://npmjs.com/donate"
+    },
+    "http://npmjs.com/donate-also",
+    {
+      "type" : "patreon",
+      "url" : "https://www.patreon.com/user"
+    }
+  ]
+}
+
+

Users can use the npm fund subcommand to list the funding URLs of all dependencies of their project, direct and indirect. +A shortcut to visit each funding URL is also available when providing the project name such as: +npm fund <projectname> (when there are multiple URLs, the first one will be visited)

+

files

+

The optional files field is an array of file patterns that describes the entries to be included when your package is installed as a dependency. +File patterns follow a similar syntax to .gitignore, but reversed: including a file, directory, or glob pattern (*, **/*, and such) will make it so that file is included in the tarball when it's packed. +Omitting the field will make it default to ["*"], which means it will include all files.

+

Some special files and directories are also included or excluded regardless of whether they exist in the files array (see below).

+

You can also provide a .npmignore file in the root of your package or in subdirectories, which will keep files from being included. +At the root of your package it will not override the "files" field, but in subdirectories it will. +The .npmignore file works just like a .gitignore. +If there is a .gitignore file, and .npmignore is missing, .gitignore's contents will be used instead.

+

Certain files are always included, regardless of settings:

+
    +
  • package.json
  • +
  • README
  • +
  • LICENSE / LICENCE
  • +
  • The file in the "main" field
  • +
  • The file(s) in the "bin" field
  • +
+

README & LICENSE can have any case and extension.

+

Some files are always ignored by default:

+
    +
  • *.orig
  • +
  • .*.swp
  • +
  • .DS_Store
  • +
  • ._*
  • +
  • .git
  • +
  • .hg
  • +
  • .lock-wscript
  • +
  • .npmrc
  • +
  • .svn
  • +
  • .wafpickle-N
  • +
  • CVS
  • +
  • config.gypi
  • +
  • node_modules
  • +
  • npm-debug.log
  • +
  • package-lock.json (use npm-shrinkwrap.json if you wish it to be published)
  • +
  • pnpm-lock.yaml
  • +
  • yarn.lock
  • +
  • bun.lockb
  • +
+

Most of these ignored files can be included specifically if included in the files globs. +Exceptions to this are:

+
    +
  • .git
  • +
  • .npmrc
  • +
  • node_modules
  • +
  • package-lock.json
  • +
  • pnpm-lock.yaml
  • +
  • yarn.lock
  • +
  • bun.lockb
  • +
+

These cannot be included.

+

exports

+

The "exports" provides a modern alternative to "main" allowing multiple entry points to be defined, conditional entry resolution support between environments, and preventing any other entry points besides those defined in "exports". This encapsulation allows module authors to clearly define the public interface for their package. +For more details see the node.js documentation on package entry points

+

main

+

The main field is a module ID that is the primary entry point to your program. +That is, if your package is named foo, and a user installs it, and then does require("foo"), then your main module's exports object will be returned.

+

This should be a module relative to the root of your package folder.

+

For most modules, it makes the most sense to have a main script and often not much else.

+

If main is not set, it defaults to index.js in the package's root folder.

+

type

+

The type field defines how Node.js should interpret .js files in your package. This field is not used by npm.

+

See the Node.js documentation on the type field for more information.

+

browser

+

If your module is meant to be used client-side the browser field should be used instead of the main field. +This is helpful to hint users that it might rely on primitives that aren't available in Node.js modules. +(e.g. window)

+

bin

+

A lot of packages have one or more executable files that they'd like to install into the PATH. npm makes this pretty easy (in fact, it uses this feature to install the "npm" executable.)

+

To use this, supply a bin field in your package.json which is a map of command name to local file name. +When this package is installed globally, that file will be either linked inside the global bins directory or a cmd (Windows Command File) will be created which executes the specified file in the bin field, so it is available to run by name or name.cmd (on Windows PowerShell). +When this package is installed as a dependency in another package, the file will be linked where it will be available to that package either directly by npm exec or by name in other scripts when invoking them via npm run.

+

For example, myapp could have this:

+
{
+  "bin": {
+    "myapp": "bin/cli.js"
+  }
+}
+
+

So, when you install myapp, in case of unix-like OS it'll create a symlink from the cli.js script to /usr/local/bin/myapp and in case of windows it will create a cmd file usually at C:\Users\{Username}\AppData\Roaming\npm\myapp.cmd which runs the cli.js script.

+

If you have a single executable, and its name should be the name of the package, then you can just supply it as a string. +For example:

+
{
+  "name": "my-program",
+  "version": "1.2.5",
+  "bin": "path/to/program"
+}
+
+

would be the same as this:

+
{
+  "name": "my-program",
+  "version": "1.2.5",
+  "bin": {
+    "my-program": "path/to/program"
+  }
+}
+
+

Please make sure that your file(s) referenced in bin starts with #!/usr/bin/env node; otherwise, the scripts are started without the node executable!

+

Note that you can also set the executable files using directories.bin.

+

See folders for more info on executables.

+

man

+

Specify either a single file or an array of filenames to put in place for the man program to find.

+

If only a single file is provided, then it's installed such that it is the result from man <pkgname>, regardless of its actual filename. +For example:

+
{
+  "name": "foo",
+  "version": "1.2.3",
+  "description": "A packaged foo fooer for fooing foos",
+  "main": "foo.js",
+  "man": "./man/doc.1"
+}
+
+

would link the ./man/doc.1 file in such that it is the target for man foo

+

If the filename doesn't start with the package name, then it's prefixed. +So, this:

+
{
+  "name": "foo",
+  "version": "1.2.3",
+  "description": "A packaged foo fooer for fooing foos",
+  "main": "foo.js",
+  "man": [
+    "./man/foo.1",
+    "./man/bar.1"
+  ]
+}
+
+

will create files to do man foo and man foo-bar.

+

Man files must end with a number, and optionally a .gz suffix if they are compressed. +The number dictates which man section the file is installed into.

+
{
+  "name": "foo",
+  "version": "1.2.3",
+  "description": "A packaged foo fooer for fooing foos",
+  "main": "foo.js",
+  "man": [
+    "./man/foo.1",
+    "./man/foo.2"
+  ]
+}
+
+

will create entries for man foo and man 2 foo

+

directories

+

The CommonJS Packages spec details a few ways that you can indicate the structure of your package using a directories object. +If you look at npm's package.json, you'll see that it has directories for doc, lib, and man.

+

In the future, this information may be used in other creative ways.

+

directories.bin

+

If you specify a bin directory in directories.bin, all the files in that folder will be added.

+

Because of the way the bin directive works, specifying both a bin path and setting directories.bin is an error. +If you want to specify individual files, use bin, and for all the files in an existing bin directory, use directories.bin.

+

directories.man

+

A folder that is full of man pages. +Sugar to generate a "man" array by walking the folder.

+

repository

+

Specify the place where your code lives. +This is helpful for people who want to contribute. +If the git repo is on GitHub, then the npm repo command will be able to find you.

+

Do it like this:

+
{
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/cli.git"
+  }
+}
+
+

The URL should be a publicly available (perhaps read-only) URL that can be handed directly to a VCS program without any modification. +It should not be a URL to an html project page that you put in your browser. +It's for computers.

+

For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same shortcut syntax you use for npm install:

+
{
+  "repository": "npm/example",
+
+  "repository": "github:npm/example",
+
+  "repository": "gist:11081aaa281",
+
+  "repository": "bitbucket:user/repo",
+
+  "repository": "gitlab:user/repo"
+}
+
+

Note on normalization: When you publish a package, npm normalizes the repository field to the full object format with a url property. If you use a shorthand format (like "npm/example"), you'll see a warning during npm publish indicating that the field was auto-corrected. While the shorthand format currently works, it's recommended to use the full object format in your package.json to avoid warnings and ensure future compatibility:

+
{
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/example.git"
+  }
+}
+
+

You can run npm pkg fix to automatically convert shorthand formats to the normalized object format.

+

If the package.json for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives:

+
{
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/cli.git",
+    "directory": "workspaces/libnpmpublish"
+  }
+}
+
+

scripts

+

The "scripts" property is a dictionary containing script commands that are run at various times in the lifecycle of your package. +The key is the lifecycle event, and the value is the command to run at that point.

+

See scripts to find out more about writing package scripts.

+

gypfile

+

If you have a binding.gyp file in the root of your package and you have not defined your own install or preinstall scripts, npm will default to building your module using node-gyp.

+

To prevent npm from automatically building your module with node-gyp, set gypfile to false:

+
{
+  "gypfile": false
+}
+
+

This is useful for packages that include native addons but want to handle the build process differently, or packages that have a binding.gyp file but should not be built as a native addon.

+

config

+

A "config" object can be used to set configuration parameters used in package scripts that persist across upgrades. +For instance, if a package had the following:

+
{
+  "name": "foo",
+  "config": {
+    "port": "8080"
+  }
+}
+
+

It could also have a "start" script that referenced the npm_package_config_port environment variable.

+

dependencies

+

Dependencies are specified in a simple object that maps a package name to a version range. +The version range is a string which has one or more space-separated descriptors. +Dependencies can also be identified with a tarball or git URL.

+

Please do not put test harnesses or transpilers or other "development" time tools in your dependencies object. +See devDependencies, below.

+

See semver for more details about specifying version ranges.

+
    +
  • version Must match version exactly
  • +
  • >version Must be greater than version
  • +
  • >=version etc
  • +
  • <version
  • +
  • <=version
  • +
  • ~version "Approximately equivalent to version" See semver
  • +
  • ^version "Compatible with version" See semver
  • +
  • 1.2.x 1.2.0, 1.2.1, etc., but not 1.3.0
  • +
  • http://... See 'URLs as Dependencies' below
  • +
  • * Matches any version
  • +
  • "" (just an empty string) Same as *
  • +
  • version1 - version2 Same as >=version1 <=version2.
  • +
  • range1 || range2 Passes if either range1 or range2 are satisfied.
  • +
  • git... See 'Git URLs as Dependencies' below
  • +
  • user/repo See 'GitHub URLs' below
  • +
  • tag A specific version tagged and published as tag See npm dist-tag
  • +
  • path/path/path See Local Paths below
  • +
  • npm:@scope/pkg@version Custom alias for a package See package-spec
  • +
+

For example, these are all valid:

+
{
+  "dependencies": {
+    "foo": "1.0.0 - 2.9999.9999",
+    "bar": ">=1.0.2 <2.1.2",
+    "baz": ">1.0.2 <=2.3.4",
+    "boo": "2.0.1",
+    "qux": "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0",
+    "asd": "http://npmjs.com/example.tar.gz",
+    "til": "~1.2",
+    "elf": "~1.2.3",
+    "two": "2.x",
+    "thr": "3.3.x",
+    "lat": "latest",
+    "dyl": "file:../dyl",
+    "kpg": "npm:pkg@1.0.0"
+  }
+}
+
+

URLs as Dependencies

+

You may specify a tarball URL in place of a version range.

+

This tarball will be downloaded and installed locally to your package at install time.

+

Git URLs as Dependencies

+

Git URLs are of the form:

+
<protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish> | #semver:<semver>]
+
+

<protocol> is one of git, git+ssh, git+http, git+https, or git+file.

+

If #<commit-ish> is provided, it will be used to clone exactly that commit. +If the commit-ish has the format #semver:<semver>, <semver> can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. +If neither #<commit-ish> or #semver:<semver> is specified, then the default branch is used.

+

Examples:

+
git+ssh://git@github.com:npm/cli.git#v1.0.27
+git+ssh://git@github.com:npm/cli#semver:^5.0
+git+https://isaacs@github.com/npm/cli.git
+git://github.com/npm/cli.git#v1.0.27
+
+

When installing from a git repository, the presence of certain fields in the package.json will cause npm to believe it needs to perform a build. +To do so your repository will be cloned into a temporary directory, all of its deps installed, relevant scripts run, and the resulting directory packed and installed.

+

This flow will occur if your git dependency uses workspaces, or if any of the following scripts are present:

+
    +
  • build
  • +
  • prepare
  • +
  • prepack
  • +
  • preinstall
  • +
  • install
  • +
  • postinstall
  • +
+

If your git repository includes pre-built artifacts, you will likely want to make sure that none of the above scripts are defined, or your dependency will be rebuilt for every installation.

+

GitHub URLs

+

As of version 1.1.65, you can refer to GitHub URLs as just "foo": +"user/foo-project". Just as with git URLs, a commit-ish suffix can be included. +For example:

+
{
+  "name": "foo",
+  "version": "0.0.0",
+  "dependencies": {
+    "express": "expressjs/express",
+    "mocha": "mochajs/mocha#4727d357ea",
+    "module": "npm/example-github-repo#feature\/branch"
+  }
+}
+
+

Local Paths

+

As of version 2.0.0 you can provide a path to a local directory that contains a package. +Local paths can be saved using npm install -S or npm install --save, using any of these forms:

+
../foo/bar
+~/foo/bar
+./foo/bar
+/foo/bar
+
+

in which case they will be normalized to a relative path and added to your package.json. +For example:

+
{
+  "name": "baz",
+  "dependencies": {
+    "bar": "file:../foo/bar"
+  }
+}
+
+

This feature is helpful for local offline development and creating tests that require npm installing where you don't want to hit an external server, but should not be used when publishing your package to the public registry.

+

note: Packages linked by local path will not have their own dependencies installed when npm install is run. +You must run npm install from inside the local path itself.

+

devDependencies

+

If someone is planning on downloading and using your module in their program, then they probably don't want or need to download and build the external test or documentation framework that you use.

+

In this case, it's best to map these additional items in a devDependencies object.

+

These things will be installed when doing npm link or npm install from the root of a package, and can be managed like any other npm configuration param. +See config for more on the topic.

+

For build steps that are not platform-specific, such as compiling CoffeeScript or other languages to JavaScript, use the prepare script to do this, and make the required package a devDependency.

+

For example:

+
{
+  "name": "@npm/ethopia-waza",
+  "description": "a delightfully fruity coffee varietal",
+  "version": "1.2.3",
+  "devDependencies": {
+    "coffee-script": "~1.6.3"
+  },
+  "scripts": {
+    "prepare": "coffee -o lib/ -c src/waza.coffee"
+  },
+  "main": "lib/waza.js"
+}
+
+

The prepare script will be run before publishing, so that users can consume the functionality without requiring them to compile it themselves. +In dev mode (ie, locally running npm install), it'll run this script as well, so that you can test it easily.

+

peerDependencies

+

In some cases, you want to express the compatibility of your package with a host tool or library, while not necessarily doing a require of this host. +This is usually referred to as a plugin. Notably, your module may be exposing a specific interface, expected and specified by the host documentation.

+

For example:

+
{
+  "name": "@npm/tea-latte",
+  "version": "1.3.5",
+  "peerDependencies": {
+    "@npm/tea": "2.x"
+  }
+}
+
+

This ensures your package @npm/tea-latte can be installed along with the second major version of the host package @npm/tea only. +npm install tea-latte could possibly yield the following dependency graph:

+
├── @npm/tea-latte@1.3.5
+└── @npm/tea@2.2.0
+
+

In npm versions 3 through 6, peerDependencies were not automatically installed, and would raise a warning if an invalid version of the peer dependency was found in the tree. +As of npm v7, peerDependencies are installed by default.

+

Trying to install another plugin with a conflicting requirement may cause an error if the tree cannot be resolved correctly. +For this reason, make sure your plugin requirement is as broad as possible, and not to lock it down to specific patch versions.

+

Assuming the host complies with semver, only changes in the host package's major version will break your plugin. +Thus, if you've worked with every 1.x version of the host package, use "^1.0" or "1.x" to express this. +If you depend on features introduced in 1.5.2, use "^1.5.2".

+

peerDependenciesMeta

+

The peerDependenciesMeta field serves to provide npm more information on how your peer dependencies are to be used. +Specifically, it allows peer dependencies to be marked as optional. +Npm will not automatically install optional peer dependencies. +This allows you to integrate and interact with a variety of host packages without requiring all of them to be installed.

+

For example:

+
{
+  "name": "@npm/tea-latte",
+  "version": "1.3.5",
+  "peerDependencies": {
+    "@npm/tea": "2.x",
+    "@npm/soy-milk": "1.2"
+  },
+  "peerDependenciesMeta": {
+    "@npm/soy-milk": {
+      "optional": true
+    }
+  }
+}
+
+

bundleDependencies

+

This defines an array of package names that will be bundled when publishing the package.

+

In cases where you need to preserve npm packages locally or have them available through a single file download, you can bundle the packages in a tarball file by specifying the package names in the bundleDependencies array and executing npm pack.

+

For example:

+

If we define a package.json like this:

+
{
+  "name": "@npm/awesome-web-framework",
+  "version": "1.0.0",
+  "bundleDependencies": [
+    "@npm/renderized",
+    "@npm/super-streams"
+  ]
+}
+
+

we can obtain @npm/awesome-web-framework-1.0.0.tgz file by running npm pack. +This file contains the dependencies @npm/renderized and @npm/super-streams which can be installed in a new project by executing npm install awesome-web-framework-1.0.0.tgz. +Note that the package names do not include any versions, as that information is specified in dependencies.

+

If this is spelled "bundledDependencies", then that is also honored.

+

Alternatively, "bundleDependencies" can be defined as a boolean value. +A value of true will bundle all dependencies, a value of false will bundle none.

+

optionalDependencies

+

If a dependency can be used, but you would like npm to proceed if it cannot be found or fails to install, then you may put it in the optionalDependencies object. +This is a map of package name to version or URL, just like the dependencies object. +The difference is that build failures do not cause installation to fail. +Running npm install --omit=optional will prevent these dependencies from being installed.

+

It is still your program's responsibility to handle the lack of the dependency. +For example, something like this:

+
try {
+  var foo = require('@npm/foo')
+  var fooVersion = require('@npm/foo/package.json').version
+} catch (er) {
+  foo = null
+}
+if ( notGoodFooVersion(fooVersion) ) {
+  foo = null
+}
+
+// .. then later in your program ..
+
+if (foo) {
+  foo.doFooThings()
+}
+
+

Entries in optionalDependencies will override entries of the same name in dependencies, so it's usually best to only put in one place.

+

overrides

+

If you need to make specific changes to dependencies of your dependencies, for example replacing the version of a dependency with a known security issue, replacing an existing dependency with a fork, or making sure that the same version of a package is used everywhere, then you may add an override.

+

Overrides provide a way to replace a package in your dependency tree with another version, or another package entirely. +These changes can be scoped as specific or as vague as desired.

+

Overrides are only considered in the root package.json file for a project. +Overrides in installed dependencies (including workspaces) are not considered in dependency tree resolution. +Published packages may dictate their resolutions by pinning dependencies or using an npm-shrinkwrap.json file.

+

To make sure the package @npm/foo is always installed as version 1.0.0 no matter what version your dependencies rely on:

+
{
+  "overrides": {
+    "@npm/foo": "1.0.0"
+  }
+}
+
+

The above is a short hand notation, the full object form can be used to allow overriding a package itself as well as a child of the package. +This will cause @npm/foo to always be 1.0.0 while also making @npm/bar at any depth beyond @npm/foo also 1.0.0:

+
{
+  "overrides": {
+    "@npm/foo": {
+      ".": "1.0.0",
+      "@npm/bar": "1.0.0"
+    }
+  }
+}
+
+

To only override @npm/foo to be 1.0.0 when it's a child (or grandchild, or great grandchild, etc) of the package @npm/bar:

+
{
+  "overrides": {
+    "@npm/bar": {
+      "@npm/foo": "1.0.0"
+    }
+  }
+}
+
+

Keys can be nested to any arbitrary length. +To override @npm/foo only when it's a child of @npm/bar and only when @npm/bar is a child of @npm/baz:

+
{
+  "overrides": {
+    "@npm/baz": {
+      "@npm/bar": {
+        "@npm/foo": "1.0.0"
+      }
+    }
+  }
+}
+
+

The key of an override can also include a version, or range of versions. +To override @npm/foo to 1.0.0, but only when it's a child of @npm/bar@2.0.0:

+
{
+  "overrides": {
+    "@npm/bar@2.0.0": {
+      "@npm/foo": "1.0.0"
+    }
+  }
+}
+
+

You may not set an override for a package that you directly depend on unless both the dependency and the override itself share the exact same spec. +To make this limitation easier to deal with, overrides may also be defined as a reference to a spec for a direct dependency by prefixing the name of the package you wish the version to match with a $.

+
{
+  "dependencies": {
+    "@npm/foo": "^1.0.0"
+  },
+  "overrides": {
+    // BAD, will throw an EOVERRIDE error
+    // "foo": "^2.0.0"
+    // GOOD, specs match so override is allowed
+    // "foo": "^1.0.0"
+    // BEST, the override is defined as a reference to the dependency
+    "@npm/foo": "$foo",
+    // the referenced package does not need to match the overridden one
+    "@npm/bar": "$foo"
+  }
+}
+
+

Replacing a dependency with a fork

+

You can replace a package with a different package or fork using several methods:

+

Using the npm: prefix to replace with a different package name:

+
{
+  "overrides": {
+    "package-name": "npm:@scope/forked-package@1.0.0"
+  }
+}
+
+

Using a GitHub repository (supports branches, tags, or commit hashes):

+
{
+  "overrides": {
+    "package-name": "github:username/repo#branch-name"
+  }
+}
+
+

Using a local file path:

+
{
+  "overrides": {
+    "package-name": "file:../local-fork"
+  }
+}
+
+

These replacement methods work for both top-level overrides and nested overrides. +For example, to replace a transitive dependency with a fork:

+
{
+  "overrides": {
+    "parent-package": {
+      "vulnerable-dep": "github:username/patched-fork#v2.0.1"
+    }
+  }
+}
+
+

engines

+

You can specify the version of node that your stuff works on:

+
{
+  "engines": {
+    "node": ">=0.10.3 <15"
+  }
+}
+
+

And, like with dependencies, if you don't specify the version (or if you specify "*" as the version), then any version of node will do.

+

You can also use the "engines" field to specify which versions of npm are capable of properly installing your program. +For example:

+
{
+  "engines": {
+    "npm": "~1.0.20"
+  }
+}
+
+

Unless the user has set the engine-strict config flag, this field is advisory only and will only produce warnings when your package is installed as a dependency.

+

os

+

You can specify which operating systems your module will run on:

+
{
+  "os": [
+    "darwin",
+    "linux"
+  ]
+}
+
+

You can also block instead of allowing operating systems, just prepend the blocked os with a '!':

+
{
+  "os": [
+    "!win32"
+  ]
+}
+
+

The host operating system is determined by process.platform

+

It is allowed to both block and allow an item, although there isn't any good reason to do this.

+

cpu

+

If your code only runs on certain cpu architectures, you can specify which ones.

+
{
+  "cpu": [
+    "x64",
+    "ia32"
+  ]
+}
+
+

Like the os option, you can also block architectures:

+
{
+  "cpu": [
+    "!arm",
+    "!mips"
+  ]
+}
+
+

The host architecture is determined by process.arch

+

libc

+

If your code only runs or builds in certain versions of libc, you can specify which ones. +This field only applies if os is linux.

+
{
+  "os": "linux",
+  "libc": "glibc"
+}
+
+

devEngines

+

The devEngines field aids engineers working on a codebase to all be using the same tooling.

+

You can specify a devEngines property in your package.json which will run before install, ci, and run commands.

+
+

Note: engines and devEngines differ in object shape. +They also function very differently. +engines is designed to alert the user when a dependency uses a different npm or node version than the project it's being used in, whereas devEngines is used to alert people interacting with the source code of a project.

+
+

The supported keys under the devEngines property are cpu, os, libc, runtime, and packageManager. +Each property can be an object or an array of objects. +Objects must contain name, and optionally can specify version, and onFail. +onFail can be warn, error, or ignore, and if left undefined is of the same value as error. +npm will assume that you're running with node. +Here's an example of a project that will fail if the environment is not node and npm. +If you set runtime.name or packageManager.name to any other string, it will fail within the npm CLI.

+
{
+  "devEngines": {
+    "runtime": {
+      "name": "node",
+      "onFail": "error"
+    },
+    "packageManager": {
+      "name": "npm",
+      "onFail": "error"
+    }
+  }
+}
+
+

private

+

If you set "private": true in your package.json, then npm will refuse to publish it.

+

This is a way to prevent accidental publication of private repositories. +If you would like to ensure that a given package is only ever published to a specific registry (for example, an internal registry), then use the publishConfig dictionary described below to override the registry config param at publish-time.

+

publishConfig

+

This is a set of config values that will be used at publish-time. +It's especially handy if you want to set the tag, registry or access, so that you can ensure that a given package is not tagged with "latest", published to the global public registry or that a scoped module is private by default.

+

See config to see the list of config options that can be overridden.

+

workspaces

+

The optional workspaces field is an array of file patterns that describes locations within the local file system that the install client should look up to find each workspace that needs to be symlinked to the top level node_modules folder.

+

It can describe either the direct paths of the folders to be used as workspaces or it can define globs that will resolve to these same folders.

+

In the following example, all folders located inside the folder ./packages will be treated as workspaces as long as they have valid package.json files inside them:

+
{
+  "name": "workspace-example",
+  "workspaces": [
+    "./packages/*"
+  ]
+}
+
+

See workspaces for more examples.

+

DEFAULT VALUES

+

npm will default some values based on package contents.

+
    +
  • +

    "scripts": {"start": "node server.js"}

    +

    If there is a server.js file in the root of your package, then npm will default the start command to node server.js.

    +
  • +
  • +

    "scripts":{"install": "node-gyp rebuild"}

    +

    If there is a binding.gyp file in the root of your package and you have not defined an install or preinstall script, npm will default the install command to compile using node-gyp.

    +
  • +
  • +

    "contributors": [...]

    +

    If there is an AUTHORS file in the root of your package, npm will treat each line as a Name <email> (url) format, where email and url are optional. +Lines which start with a # or are blank, will be ignored.

    +
  • +
+

SEE ALSO

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/configuring-npm/package-lock-json.html b/node24/node_modules/npm/docs/output/configuring-npm/package-lock-json.html new file mode 100644 index 0000000000000000000000000000000000000000..73de20cc061b4e984f3674ee94173d6aff21307a --- /dev/null +++ b/node24/node_modules/npm/docs/output/configuring-npm/package-lock-json.html @@ -0,0 +1,391 @@ + + +package-lock.json + + + + + +
+
+

+ package-lock.json + @11.12.1 +

+A manifestation of the manifest +
+ +
+

Table of contents

+ +
+ +

Description

+

package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json. +It describes the exact tree that was generated, such that subsequent installs are able to generate identical trees, regardless of intermediate dependency updates.

+

This file is intended to be committed into source repositories, and serves various purposes:

+
    +
  • +

    Describe a single representation of a dependency tree such that teammates, deployments, and continuous integration are guaranteed to install exactly the same dependencies.

    +
  • +
  • +

    Provide a facility for users to "time-travel" to previous states of node_modules without having to commit the directory itself.

    +
  • +
  • +

    Facilitate greater visibility of tree changes through readable source control diffs.

    +
  • +
  • +

    Optimize the installation process by allowing npm to skip repeated metadata resolutions for previously-installed packages.

    +
  • +
  • +

    As of npm v7, lockfiles include enough information to gain a complete picture of the package tree, reducing the need to read package.json files, and allowing for significant performance improvements.

    +
  • +
+

When npm creates or updates package-lock.json, it will infer line endings and indentation from package.json so that the formatting of both files matches.

+

package-lock.json vs npm-shrinkwrap.json

+

Both of these files have the same format, and perform similar functions in the root of a project.

+

The difference is that package-lock.json cannot be published, and it will be ignored if found in any place other than the root project.

+

In contrast, npm-shrinkwrap.json allows publication, and defines the dependency tree from the point encountered. +This is not recommended unless deploying a CLI tool or otherwise using the publication process for producing production packages.

+

If both package-lock.json and npm-shrinkwrap.json are present in the root of a project, npm-shrinkwrap.json will take precedence and package-lock.json will be ignored.

+

Hidden Lockfiles

+

In order to avoid processing the node_modules folder repeatedly, npm as of v7 uses a "hidden" lockfile present in node_modules/.package-lock.json. +This contains information about the tree, and is used in lieu of reading the entire node_modules hierarchy provided that the following conditions are met:

+
    +
  • All package folders it references exist in the node_modules hierarchy.
  • +
  • No package folders exist in the node_modules hierarchy that are not listed in the lockfile.
  • +
  • The modified time of the file is at least as recent as all of the package folders it references.
  • +
+

That is, the hidden lockfile will only be relevant if it was created as part of the most recent update to the package tree. +If another CLI mutates the tree in any way, this will be detected, and the hidden lockfile will be ignored.

+

Note that it is possible to manually change the contents of a package in such a way that the modified time of the package folder is unaffected. +For example, if you add a file to node_modules/foo/lib/bar.js, then the modified time on node_modules/foo will not reflect this change. +If you are manually editing files in node_modules, it is generally best to delete the file at node_modules/.package-lock.json.

+

As the hidden lockfile is ignored by older npm versions, it does not contain the backwards compatibility affordances present in "normal" lockfiles. +That is, it is lockfileVersion: 3, rather than lockfileVersion: 2.

+

Handling Old Lockfiles

+

When npm detects a lockfile from npm v6 or before during the package installation process, it is automatically updated to fetch missing information from either the node_modules tree or (in the case of empty node_modules trees or very old lockfile formats) the npm registry.

+

File Format

+

name

+

The name of the package this is a package-lock for. +This will match what's in package.json.

+

version

+

The version of the package this is a package-lock for. +This will match what's in package.json.

+

lockfileVersion

+

An integer version, starting at 1 with the version number of this document whose semantics were used when generating this package-lock.json.

+

Note that the file format changed significantly in npm v7 to track information that would have otherwise required looking in node_modules or the npm registry. +Lockfiles generated by npm v7 will contain lockfileVersion: 2.

+
    +
  • No version provided: an "ancient" shrinkwrap file from a version of npm prior to npm v5.
  • +
  • 1: The lockfile version used by npm v5 and v6.
  • +
  • 2: The lockfile version used by npm v7 and v8. Backwards compatible to v1 lockfiles.
  • +
  • 3: The lockfile version used by npm v9 and above. +Backwards compatible to npm v7.
  • +
+

npm will always attempt to get whatever data it can out of a lockfile, even if it is not a version that it was designed to support.

+

packages

+

This is an object that maps package locations to an object containing the information about that package.

+

The root project is typically listed with a key of "", and all other packages are listed with their relative paths from the root project folder.

+

Package descriptors have the following fields:

+
    +
  • +

    version: The version found in package.json

    +
  • +
  • +

    resolved: The place where the package was actually resolved from. +In the case of packages fetched from the registry, this will be a url to a tarball. +In the case of git dependencies, this will be the full git url with commit sha. +In the case of link dependencies, this will be the location of the link target. +registry.npmjs.org is a magic value meaning "the currently configured registry".

    +
  • +
  • +

    integrity: A sha512 or sha1 Standard Subresource Integrity string for the artifact that was unpacked in this location.

    +
  • +
  • +

    link: A flag to indicate that this is a symbolic link. +If this is present, no other fields are specified, since the link target will also be included in the lockfile.

    +
  • +
  • +

    dev, optional, devOptional: If the package is strictly part of the +devDependencies tree, then dev will be true. +If it is strictly part of the optionalDependencies tree, then optional will be set. +If it is both a dev dependency and an optional dependency of a non-dev dependency, then devOptional will be set. +(An optional dependency of a dev dependency will have both dev and optional set.)

    +
  • +
  • +

    inBundle: A flag to indicate that the package is a bundled dependency.

    +
  • +
  • +

    hasInstallScript: A flag to indicate that the package has a preinstall, install, or postinstall script.

    +
  • +
  • +

    hasShrinkwrap: A flag to indicate that the package has an npm-shrinkwrap.json file.

    +
  • +
  • +

    bin, license, engines, dependencies, optionalDependencies: fields from package.json

    +
  • +
  • +

    os: An array of operating systems this package is compatible with, as specified in package.json. This field is included when the package specifies OS restrictions.

    +
  • +
  • +

    cpu: An array of CPU architectures this package is compatible with, as specified in package.json. This field is included when the package specifies CPU restrictions.

    +
  • +
  • +

    funding: Funding information for the package, as specified in package.json. This field contains details about how to support the package maintainers.

    +
  • +
+

dependencies

+

Legacy data for supporting versions of npm that use lockfileVersion: 1. +This is a mapping of package names to dependency objects. +Because the object structure is strictly hierarchical, symbolic link dependencies are somewhat challenging to represent in some cases.

+

npm v7 ignores this section entirely if a packages section is present, but does keep it up to date in order to support switching between npm v6 and npm v7.

+

Dependency objects have the following fields:

+
    +
  • +

    version: a specifier that varies depending on the nature of the package, and is usable in fetching a new copy of it. +Note that for peer dependencies that are not installed, or optional dependencies that are not installed, this field may be omitted.

    +
      +
    • bundled dependencies: Regardless of source, this is a version number that is purely for informational purposes.
    • +
    • registry sources: This is a version number. +(eg, 1.2.3)
    • +
    • git sources: This is a git specifier with resolved committish. +(eg, git+https://example.com/foo/bar#115311855adb0789a0466714ed48a1499ffea97e)
    • +
    • http tarball sources: This is the URL of the tarball. +(eg, https://example.com/example-1.3.0.tgz)
    • +
    • local tarball sources: This is the file URL of the tarball. +(eg file:///opt/storage/example-1.3.0.tgz)
    • +
    • local link sources: This is the file URL of the link. +(eg file:libs/our-module)
    • +
    +

    Note: The version field may be omitted for certain types of dependencies, such as optional peer dependencies that are not installed. In these cases, only metadata fields like dev, optional, and peer will be present.

    +
  • +
  • +

    integrity: A sha512 or sha1 Standard Subresource Integrity string for the artifact that was unpacked in this location. +For git dependencies, this is the commit sha.

    +
  • +
  • +

    resolved: For registry sources this is path of the tarball relative to the registry URL. +If the tarball URL isn't on the same server as the registry URL then this is a complete URL. +registry.npmjs.org is a magic value meaning "the currently configured registry".

    +
  • +
  • +

    bundled: If true, this is the bundled dependency and will be installed by the parent module. +When installing, this module will be extracted from the parent module during the extract phase, not installed as a separate dependency.

    +
  • +
  • +

    dev: If true then this dependency is either a development dependency ONLY of the top level module or a transitive dependency of one. +This is false for dependencies that are both a development dependency of the top level and a transitive dependency of a non-development dependency of the top level.

    +
  • +
  • +

    optional: If true then this dependency is either an optional dependency ONLY of the top level module or a transitive dependency of one. +This is false for dependencies that are both an optional dependency of the top level and a transitive dependency of a non-optional dependency of the top level.

    +
  • +
  • +

    requires: This is a mapping of module name to version. +This is a list of everything this module requires, regardless of where it will be installed. +The version should match via normal matching rules a dependency either in our dependencies or in a level higher than us.

    +
  • +
  • +

    dependencies: The dependencies of this dependency, exactly as at the top level.

    +
  • +
+

See also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/using-npm/config.html b/node24/node_modules/npm/docs/output/using-npm/config.html new file mode 100644 index 0000000000000000000000000000000000000000..f6b0d35e8c0c7765789a34e2ba58ca8ab64cd248 --- /dev/null +++ b/node24/node_modules/npm/docs/output/using-npm/config.html @@ -0,0 +1,1801 @@ + + +Config + + + + + +
+
+

+ Config + @11.12.1 +

+About npm configuration +
+ +
+

Table of contents

+
+
+ +

Description

+

This article details npm configuration in general. +To learn about the config command, see npm config.

+

npm gets its configuration values from the following sources, sorted by priority:

+

Command Line Flags

+

Putting --foo bar on the command line sets the foo configuration parameter to "bar". +A -- argument tells the cli parser to stop reading flags. +Using --flag without specifying any value will set the value to true.

+

Example: --flag1 --flag2 will set both configuration parameters to true, while --flag1 --flag2 bar will set flag1 to true, and flag2 to bar. +Finally, --flag1 --flag2 -- bar will set both configuration parameters to true, and the bar is taken as a command argument.

+

Common examples:

+
    +
  • npm install --prefix /path/to/dir - Runs npm commands in a different directory without changing the current working directory
  • +
  • npm install --global - Installs packages globally (shorthand: -g)
  • +
  • npm install --save-dev - Saves to devDependencies (shorthand: -D)
  • +
+

Any configuration option documented in the Config Settings section below can be set via command line flags using --option-name value syntax.

+

Environment Variables

+

Any environment variables that start with npm_config_ will be interpreted as a configuration parameter. +For example, putting npm_config_foo=bar in your environment will set the foo configuration parameter to bar. +Any environment configurations that are not given a value will be given the value of true. +Config values are case-insensitive, so NPM_CONFIG_FOO=bar will work the same. +However, please note that inside scripts npm will set its own environment variables and Node will prefer those lowercase versions over any uppercase ones that you might set. +For details see this issue.

+

Notice that you need to use underscores instead of dashes, so --allow-same-version would become npm_config_allow_same_version=true.

+

Important: When defining custom configuration keys in .npmrc files, use hyphens instead of underscores (e.g., custom-key=value). This ensures they can be overridden by environment variables, since npm automatically converts underscores to hyphens when reading environment variables. Keys with underscores in .npmrc files cannot be overridden via environment variables.

+

npmrc Files

+

The four relevant files are:

+
    +
  • per-project configuration file (/path/to/my/project/.npmrc)
  • +
  • per-user configuration file (defaults to $HOME/.npmrc; configurable via CLI option --userconfig or environment variable $NPM_CONFIG_USERCONFIG)
  • +
  • global configuration file (defaults to $PREFIX/etc/npmrc; configurable via CLI option --globalconfig or environment variable $NPM_CONFIG_GLOBALCONFIG)
  • +
  • npm's built-in configuration file (/path/to/npm/npmrc)
  • +
+

See npmrc for more details.

+

Default Configs

+

Run npm config ls -l to see a set of configuration parameters that are internal to npm, and are defaults if nothing else is specified.

+

Shorthands and Other CLI Niceties

+

The following shorthands are parsed on the command-line:

+
    +
  • -a: --all
  • +
  • --enjoy-by: --before
  • +
  • -c: --call
  • +
  • --desc: --description
  • +
  • -f: --force
  • +
  • -g: --global
  • +
  • --iwr: --include-workspace-root
  • +
  • -L: --location
  • +
  • -d: --loglevel info
  • +
  • -s: --loglevel silent
  • +
  • --silent: --loglevel silent
  • +
  • --ddd: --loglevel silly
  • +
  • --dd: --loglevel verbose
  • +
  • --verbose: --loglevel verbose
  • +
  • -q: --loglevel warn
  • +
  • --quiet: --loglevel warn
  • +
  • -l: --long
  • +
  • -m: --message
  • +
  • --local: --no-global
  • +
  • -n: --no-yes
  • +
  • --no: --no-yes
  • +
  • -p: --parseable
  • +
  • --porcelain: --parseable
  • +
  • -C: --prefix
  • +
  • --readonly: --read-only
  • +
  • --reg: --registry
  • +
  • -S: --save
  • +
  • -B: --save-bundle
  • +
  • -D: --save-dev
  • +
  • -E: --save-exact
  • +
  • -O: --save-optional
  • +
  • -P: --save-prod
  • +
  • -?: --usage
  • +
  • -h: --usage
  • +
  • -H: --usage
  • +
  • --help: --usage
  • +
  • -v: --version
  • +
  • -w: --workspace
  • +
  • --ws: --workspaces
  • +
  • -y: --yes
  • +
+

If the specified configuration param resolves unambiguously to a known configuration parameter, then it is expanded to that configuration parameter. +For example:

+
npm ls --par
+# same as:
+npm ls --parseable
+
+

If multiple single-character shorthands are strung together, and the resulting combination is unambiguously not some other configuration param, then it is expanded to its various component pieces. +For example:

+
npm ls -gpld
+# same as:
+npm ls --global --parseable --long --loglevel info
+
+

Config Settings

+

_auth

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

A basic-auth string to use when authenticating against the npm registry. +This will ONLY be used to authenticate against the npm registry. For other +registries you will need to scope it like "//other-registry.tld/:_auth"

+

Warning: This should generally not be set via a command-line option. It is +safer to use a registry-provided authentication bearer token stored in the +~/.npmrc file by running npm login.

+

access

+
    +
  • Default: 'public' for new packages, existing packages it will not change the +current level
  • +
  • Type: null, "restricted", or "public"
  • +
+

If you do not want your scoped package to be publicly viewable (and +installable) set --access=restricted.

+

Unscoped packages cannot be set to restricted.

+

Note: This defaults to not changing the current access level for existing +packages. Specifying a value of restricted or public during publish will +change the access for an existing package the same way that npm access set status would.

+

all

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When running npm outdated and npm ls, setting --all will show all +outdated or installed packages, rather than only those directly depended +upon by the current project.

+

allow-git

+
    +
  • Default: "all"
  • +
  • Type: "all", "none", or "root"
  • +
+

Limits the ability for npm to fetch dependencies from git references. That +is, dependencies that point to a git repo instead of a version or semver +range. Please note that this could leave your tree incomplete and some +packages may not function as intended or designed.

+

all allows any git dependencies to be fetched and installed. none +prevents any git dependencies from being fetched and installed. root only +allows git dependencies defined in your project's package.json to be fetched +installed. Also allows git dependencies to be fetched for other commands +like npm view

+

allow-same-version

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Prevents throwing an error when npm version is used to set the new version +to the same value as the current version.

+

audit

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When "true" submit audit reports alongside the current npm command to the +default registry and all registries configured for scopes. See the +documentation for npm audit for details on what is +submitted.

+

audit-level

+
    +
  • Default: null
  • +
  • Type: null, "info", "low", "moderate", "high", "critical", or "none"
  • +
+

The minimum level of vulnerability for npm audit to exit with a non-zero +exit code.

+

auth-type

+
    +
  • Default: "web"
  • +
  • Type: "legacy" or "web"
  • +
+

What authentication strategy to use with login. Note that if an otp +config is given, this value will always be set to legacy.

+

before

+
    +
  • Default: null
  • +
  • Type: null or Date
  • +
+

If passed to npm install, will rebuild the npm tree such that only +versions that were available on or before the given date are installed. +If there are no versions available for the current set of dependencies, the +command will error.

+

If the requested version is a dist-tag and the given tag does not pass the +--before filter, the most recent version less than or equal to that tag +will be used. For example, foo@latest might install foo@1.2 even though +latest is 2.0.

+

This config cannot be used with: min-release-age

+ +
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Tells npm to create symlinks (or .cmd shims on Windows) for package +executables.

+

Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems.

+

browser

+
    +
  • Default: macOS: "open", Windows: "start", Others: "xdg-open"
  • +
  • Type: null, Boolean, or String
  • +
+

The browser that is called by npm commands to open websites.

+

Set to false to suppress browser behavior and instead print urls to +terminal.

+

Set to true to use default system URL opener.

+

bypass-2fa

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When creating a Granular Access Token with npm token create, setting this +to true will allow the token to bypass two-factor authentication. This is +useful for automation and CI/CD workflows.

+

ca

+
    +
  • Default: null
  • +
  • Type: null or String (can be set multiple times)
  • +
+

The Certificate Authority signing certificate that is trusted for SSL +connections to the registry. Values should be in PEM format (Windows calls +it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string +"\n". For example:

+
ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
+
+

Set to null to only allow "known" registrars, or to a specific CA cert to +trust only that specific signing authority.

+

Multiple CAs can be trusted by specifying an array of certificates:

+
ca[]="..."
+ca[]="..."
+
+

See also the strict-ssl config.

+

cache

+
    +
  • Default: Windows: %LocalAppData%\npm-cache, Posix: ~/.npm
  • +
  • Type: Path
  • +
+

The location of npm's cache directory.

+

cafile

+
    +
  • Default: null
  • +
  • Type: Path
  • +
+

A path to a file containing one or multiple Certificate Authority signing +certificates. Similar to the ca setting, but allows for multiple CA's, as +well as for the CA information to be stored in a file on disk.

+

call

+
    +
  • Default: ""
  • +
  • Type: String
  • +
+

Optional companion option for npm exec, npx that allows for specifying a +custom command to be run along with the installed packages.

+
npm exec --package yo --package generator-node --call "yo node"
+
+

cidr

+
    +
  • Default: null
  • +
  • Type: null or String (can be set multiple times)
  • +
+

This is a list of CIDR address to be used when configuring limited access +tokens with the npm token create command.

+

color

+
    +
  • Default: true unless the NO_COLOR environ is set to something other than '0'
  • +
  • Type: "always" or Boolean
  • +
+

If false, never shows colors. If "always" then always shows colors. If +true, then only prints color codes for tty file descriptors.

+

commit-hooks

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Run git commit hooks when using the npm version command.

+

cpu

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

Override CPU architecture of native modules to install. Acceptable values +are same as cpu field of package.json, which comes from process.arch.

+

depth

+
    +
  • Default: Infinity if --all is set; otherwise, 0
  • +
  • Type: null or Number
  • +
+

The depth to go when recursing packages for npm ls.

+

If not set, npm ls will show only the immediate dependencies of the root +project. If --all is set, then npm will show all dependencies by default.

+

description

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Show the description in npm search

+

diff

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Define arguments to compare in npm diff.

+

diff-dst-prefix

+
    +
  • Default: "b/"
  • +
  • Type: String
  • +
+

Destination prefix to be used in npm diff output.

+

diff-ignore-all-space

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Ignore whitespace when comparing lines in npm diff.

+

diff-name-only

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Prints only filenames when using npm diff.

+

diff-no-prefix

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Do not show any source or destination prefix in npm diff output.

+

Note: this causes npm diff to ignore the --diff-src-prefix and +--diff-dst-prefix configs.

+

diff-src-prefix

+
    +
  • Default: "a/"
  • +
  • Type: String
  • +
+

Source prefix to be used in npm diff output.

+

diff-text

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Treat all files as text in npm diff.

+

diff-unified

+
    +
  • Default: 3
  • +
  • Type: Number
  • +
+

The number of lines of context to print in npm diff.

+

dry-run

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, install, update, +dedupe, uninstall, as well as pack and publish.

+

Note: This is NOT honored by other network related commands, eg dist-tags, +owner, etc.

+

editor

+
    +
  • Default: The EDITOR or VISUAL environment variables, or +'%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems
  • +
  • Type: String
  • +
+

The command to run for npm edit and npm config edit.

+

engine-strict

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, then npm will stubbornly refuse to install (or even consider +installing) any package that claims to not be compatible with the current +Node.js version.

+

This can be overridden by setting the --force flag.

+

expect-result-count

+
    +
  • Default: null
  • +
  • Type: null or Number
  • +
+

Tells to expect a specific number of results from the command.

+

This config cannot be used with: expect-results

+

expect-results

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Tells npm whether or not to expect results from the command. Can be either +true (expect some results) or false (expect no results).

+

This config cannot be used with: expect-result-count

+

expires

+
    +
  • Default: null
  • +
  • Type: null or Number
  • +
+

When creating a Granular Access Token with npm token create, this sets the +expiration in days. If not specified, the server will determine the default +expiration.

+

fetch-retries

+
    +
  • Default: 2
  • +
  • Type: Number
  • +
+

The "retries" config for the retry module to use when fetching packages +from the registry.

+

npm will retry idempotent read requests to the registry in the case of +network failures or 5xx HTTP errors.

+

fetch-retry-factor

+
    +
  • Default: 10
  • +
  • Type: Number
  • +
+

The "factor" config for the retry module to use when fetching packages.

+

fetch-retry-maxtimeout

+
    +
  • Default: 60000 (1 minute)
  • +
  • Type: Number
  • +
+

The "maxTimeout" config for the retry module to use when fetching +packages.

+

fetch-retry-mintimeout

+
    +
  • Default: 10000 (10 seconds)
  • +
  • Type: Number
  • +
+

The "minTimeout" config for the retry module to use when fetching +packages.

+

fetch-timeout

+
    +
  • Default: 300000 (5 minutes)
  • +
  • Type: Number
  • +
+

The maximum amount of time to wait for HTTP requests to complete.

+

force

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Removes various protections against unfortunate side effects, common +mistakes, unnecessary performance degradation, and malicious input.

+
    +
  • Allow clobbering non-npm files in global installs.
  • +
  • Allow the npm version command to work on an unclean git repository.
  • +
  • Allow deleting the cache folder with npm cache clean.
  • +
  • Allow installing packages that have an engines declaration requiring a +different version of npm.
  • +
  • Allow installing packages that have an engines declaration requiring a +different version of node, even if --engine-strict is enabled.
  • +
  • Allow npm audit fix to install modules outside your stated dependency +range (including SemVer-major changes).
  • +
  • Allow unpublishing all versions of a published package.
  • +
  • Allow conflicting peerDependencies to be installed in the root project.
  • +
  • Implicitly set --yes during npm init.
  • +
  • Allow clobbering existing values in npm pkg
  • +
  • Allow unpublishing of entire packages (not just a single version).
  • +
+

If you don't have a clear idea of what you want to do, it is strongly +recommended that you do not use this option!

+

foreground-scripts

+
    +
  • Default: false unless when using npm pack or npm publish where it +defaults to true
  • +
  • Type: Boolean
  • +
+

Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

+

Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging.

+

format-package-lock

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Format package-lock.json or npm-shrinkwrap.json as a human readable +file.

+

fund

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When "true" displays the message at the end of each npm install +acknowledging the number of dependencies looking for funding. See npm fund for details.

+

git

+
    +
  • Default: "git"
  • +
  • Type: String
  • +
+

The command to use for git commands. If git is installed on the computer, +but is not in the PATH, then set this to the full path to the git binary.

+

git-tag-version

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Tag the commit when using the npm version command. Setting this to false +results in no commit being made at all.

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Operates in "global" mode, so that packages are installed into the prefix +folder instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

globalconfig

+
    +
  • Default: The global --prefix setting plus 'etc/npmrc'. For example, +'/usr/local/etc/npmrc'
  • +
  • Type: Path
  • +
+

The config file to read for global config options.

+

heading

+
    +
  • Default: "npm"
  • +
  • Type: String
  • +
+

The string that starts all the debugging log output.

+

https-proxy

+
    +
  • Default: null
  • +
  • Type: null or URL
  • +
+

A proxy to use for outgoing https requests. If the HTTPS_PROXY or +https_proxy or HTTP_PROXY or http_proxy environment variables are set, +proxy settings will be honored by the underlying make-fetch-happen +library.

+

if-present

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm will not exit with an error code when run is invoked for a +script that isn't defined in the scripts section of package.json. This +option can be used when it's desirable to optionally run a script when it's +present and fail if the script fails. This is useful, for example, when +running scripts that may only apply for some builds in an otherwise generic +CI setup.

+

This value is not exported to the environment for child processes.

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run will still +run their intended script if ignore-scripts is set, but they will not +run any pre- or post-scripts.

+

include

+
    +
  • Default:
  • +
  • Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Option that allows for defining which types of dependencies to install.

+

This is the inverse of --omit=<type>.

+

Dependency types specified in --include will not be omitted, regardless of +the order in which omit/include are specified on the command-line.

+

include-attestations

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When used with npm audit signatures --json, includes the full sigstore +attestation bundles in the JSON output for each verified package. The +bundles contain DSSE envelopes, verification material, and transparency log +entries.

+

include-staged

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Allow installing "staged" published packages, as defined by npm RFC PR +#92.

+

This is experimental, and not implemented by the npm public registry.

+

include-workspace-root

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+

init-author-email

+
    +
  • Default: ""
  • +
  • Type: String
  • +
+

The value npm init should use by default for the package author's email.

+

init-author-name

+
    +
  • Default: ""
  • +
  • Type: String
  • +
+

The value npm init should use by default for the package author's name.

+

init-author-url

+
    +
  • Default: ""
  • +
  • Type: "" or URL
  • +
+

The value npm init should use by default for the package author's +homepage.

+

init-license

+
    +
  • Default: "ISC"
  • +
  • Type: String
  • +
+

The value npm init should use by default for the package license.

+

init-module

+
    +
  • Default: "~/.npm-init.js"
  • +
  • Type: Path
  • +
+

A module that will be loaded by the npm init command. See the +documentation for the +init-package-json module for +more information, or npm init.

+

init-private

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

The value npm init should use by default for the package's private flag.

+

init-type

+
    +
  • Default: "commonjs"
  • +
  • Type: String
  • +
+

The value that npm init should use by default for the package.json type +field.

+

init-version

+
    +
  • Default: "1.0.0"
  • +
  • Type: SemVer string
  • +
+

The value that npm init should use by default for the package version +number, if not already set in package.json.

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces.

+

install-strategy

+
    +
  • Default: "hoisted"
  • +
  • Type: "hoisted", "nested", "shallow", or "linked"
  • +
+

Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (experimental) install in node_modules/.store, +link in place, unhoisted.

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

+

legacy-peer-deps

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Causes npm to completely ignore peerDependencies when building a package +tree, as in npm versions 3 through 6.

+

If a package cannot be installed because of overly strict peerDependencies +that collide, it provides a way to move forward resolving the situation.

+

This differs from --omit=peer, in that --omit=peer will avoid unpacking +peerDependencies on disk, but will still design a tree such that +peerDependencies could be unpacked in a correct place.

+

Use of legacy-peer-deps is not recommended, as it will not enforce the +peerDependencies contract that meta-dependencies may rely on.

+

libc

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

Override libc of native modules to install. Acceptable values are same as +libc field of package.json

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Used with npm ls, limiting output to only those packages that are linked.

+

local-address

+
    +
  • Default: null
  • +
  • Type: IP Address
  • +
+

The IP address of the local interface to use when making connections to the +npm registry. Must be IPv4 in versions of Node prior to 0.12.

+

location

+
    +
  • Default: "user" unless --global is passed, which will also set this value +to "global"
  • +
  • Type: "global", "user", or "project"
  • +
+

When passed to npm config this refers to which config file to use.

+

When set to "global" mode, packages are installed into the prefix folder +instead of the current working directory. See +folders for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

lockfile-version

+
    +
  • Default: Version 3 if no lockfile, auto-converting v1 lockfiles to v3; +otherwise, maintain current lockfile version.
  • +
  • Type: null, 1, 2, 3, "1", "2", or "3"
  • +
+

Set the lockfile format version to be used in package-lock.json and +npm-shrinkwrap-json files. Possible options are:

+

1: The lockfile version used by npm versions 5 and 6. Lacks some data that +is used during the install, resulting in slower and possibly less +deterministic installs. Prevents lockfile churn when interoperating with +older npm versions.

+

2: The default lockfile version used by npm version 7 and 8. Includes both +the version 1 lockfile data and version 3 lockfile data, for maximum +determinism and interoperability, at the expense of more bytes on disk.

+

3: Only the new lockfile information introduced in npm version 7. Smaller on +disk than lockfile version 2, but not interoperable with older npm versions. +Ideal if all users are on npm version 7 and higher.

+

loglevel

+
    +
  • Default: "notice"
  • +
  • Type: "silent", "error", "warn", "notice", "http", "info", "verbose", or +"silly"
  • +
+

What level of logs to report. All logs are written to a debug log, with the +path to that file printed if the execution of a command fails.

+

Any logs of a higher level than the setting are shown. The default is +"notice".

+

See also the foreground-scripts config.

+

logs-dir

+
    +
  • Default: A directory named _logs inside the cache
  • +
  • Type: null or Path
  • +
+

The location of npm's log directory. See npm logging +for more information.

+

logs-max

+
    +
  • Default: 10
  • +
  • Type: Number
  • +
+

The maximum number of log files to store.

+

If set to 0, no log files will be written for the current run.

+

long

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Show extended information in ls, search, and help-search.

+

maxsockets

+
    +
  • Default: 15
  • +
  • Type: Number
  • +
+

The maximum number of connections to use per origin (protocol/host/port +combination).

+

message

+
    +
  • Default: "%s"
  • +
  • Type: String
  • +
+

Commit message which is used by npm version when creating version commit.

+

Any "%s" in the message will be replaced with the version number.

+

min-release-age

+
    +
  • Default: null
  • +
  • Type: null or Number
  • +
+

If set, npm will build the npm tree such that only versions that were +available more than the given number of days ago will be installed. If there +are no versions available for the current set of dependencies, the command +will error.

+

This flag is a complement to before, which accepts an exact date instead +of a relative number of days.

+

This config cannot be used with: before

+

This value is not exported to the environment for child processes.

+

name

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

When creating a Granular Access Token with npm token create, this sets the +name/description for the token.

+

node-gyp

+
    +
  • Default: The path to the node-gyp bin that ships with npm
  • +
  • Type: Path
  • +
+

This is the location of the "node-gyp" bin. By default it uses one that +ships with npm itself.

+

You can use this config to specify your own "node-gyp" to run when it is +required to build a package.

+

node-options

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

Options to pass through to Node.js via the NODE_OPTIONS environment +variable. This does not impact how npm itself is executed but it does impact +how lifecycle scripts are called.

+

noproxy

+
    +
  • Default: The value of the NO_PROXY environment variable
  • +
  • Type: String (can be set multiple times)
  • +
+

Domain extensions that should bypass any proxies.

+

Also accepts a comma-delimited string.

+

offline

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Force offline mode: no network requests will be done during install. To +allow the CLI to fill in missing cache data, see --prefer-offline.

+

omit

+
    +
  • Default: 'dev' if the NODE_ENV environment variable is set to +'production'; otherwise, empty.
  • +
  • Type: "dev", "optional", or "peer" (can be set multiple times)
  • +
+

Dependency types to omit from the installation tree on disk.

+

Note that these dependencies are still resolved and added to the +package-lock.json or npm-shrinkwrap.json file. They are just not +physically installed on disk.

+

If a package type appears in both the --include and --omit lists, then +it will be included.

+

If the resulting omit list includes 'dev', then the NODE_ENV environment +variable will be set to 'production' for all lifecycle scripts.

+

omit-lockfile-registry-resolved

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

This option causes npm to create lock files without a resolved key for +registry dependencies. Subsequent installs will need to resolve tarball +endpoints with the configured registry, likely resulting in a longer install +time.

+

orgs

+
    +
  • Default: null
  • +
  • Type: null or String (can be set multiple times)
  • +
+

When creating a Granular Access Token with npm token create, this limits +the token access to specific organizations.

+

orgs-permission

+
    +
  • Default: null
  • +
  • Type: null, "read-only", "read-write", or "no-access"
  • +
+

When creating a Granular Access Token with npm token create, sets the +permission level for organizations. Options are "read-only", "read-write", +or "no-access".

+

os

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

Override OS of native modules to install. Acceptable values are same as os +field of package.json, which comes from process.platform.

+

otp

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with npm access.

+

If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one.

+

pack-destination

+
    +
  • Default: "."
  • +
  • Type: String
  • +
+

Directory in which npm pack will save tarballs.

+

package

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

The package or packages to install for npm exec

+

package-lock

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

If set to false, then ignore package-lock.json files when installing. This +will also prevent writing package-lock.json if save is true.

+

package-lock-only

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, the current operation will only use the package-lock.json, +ignoring node_modules.

+

For update this means only the package-lock.json will be updated, +instead of checking node_modules and downloading dependencies.

+

For list this means the output will be based on the tree described by the +package-lock.json, rather than the contents of node_modules.

+

packages

+
    +
  • Default:
  • +
  • Type: null or String (can be set multiple times)
  • +
+

When creating a Granular Access Token with npm token create, this limits +the token access to specific packages.

+

packages-all

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When creating a Granular Access Token with npm token create, grants the +token access to all packages instead of limiting to specific packages.

+

packages-and-scopes-permission

+
    +
  • Default: null
  • +
  • Type: null, "read-only", "read-write", or "no-access"
  • +
+

When creating a Granular Access Token with npm token create, sets the +permission level for packages and scopes. Options are "read-only", +"read-write", or "no-access".

+

parseable

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Output parseable results from commands that write to standard output. For +npm search, this will be tab-separated table format.

+

password

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

Password for authentication. Can be provided via command line when creating +tokens, though it's generally safer to be prompted for it.

+

prefer-dedupe

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Prefer to deduplicate packages if possible, rather than choosing a newer +version of a dependency.

+

prefer-offline

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, staleness checks for cached data will be bypassed, but missing data +will be requested from the server. To force full offline mode, use +--offline.

+

prefer-online

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, staleness checks for cached data will be forced, making the CLI +look for updates immediately even for fresh package data.

+

prefix

+
    +
  • Default: In global mode, the folder where the node executable is installed. +Otherwise, the nearest parent folder containing either a package.json file +or a node_modules folder.
  • +
  • Type: Path
  • +
+

The location to install global items. If set on the command line, then it +forces non-global commands to run in the specified folder.

+

preid

+
    +
  • Default: ""
  • +
  • Type: String
  • +
+

The "prerelease identifier" to use as a prefix for the "prerelease" part of +a semver. Like the rc in 1.2.0-rc.8.

+

progress

+
    +
  • Default: true when not in CI and both stderr and stdout are TTYs and not +in a dumb terminal
  • +
  • Type: Boolean
  • +
+

When set to true, npm will display a progress bar during time intensive +operations, if process.stderr and process.stdout are a TTY.

+

Set to false to suppress the progress bar.

+

provenance

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

When publishing from a supported cloud CI/CD system, the package will be +publicly linked to where it was built and published from.

+

This config cannot be used with: provenance-file

+

provenance-file

+
    +
  • Default: null
  • +
  • Type: Path
  • +
+

When publishing, the provenance bundle at the given path will be used.

+

This config cannot be used with: provenance

+

proxy

+
    +
  • Default: null
  • +
  • Type: null, false, or URL
  • +
+

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.

+

read-only

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

This is used to mark a token as unable to publish when configuring limited +access tokens with the npm token create command.

+

rebuild-bundle

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Rebuild bundled dependencies after installation.

+

registry

+ +

The base URL of the npm registry.

+

replace-registry-host

+
    +
  • Default: "npmjs"
  • +
  • Type: "npmjs", "never", "always", or String
  • +
+

Defines behavior for replacing the registry host in a lockfile with the +configured registry.

+

The default behavior is to replace package dist URLs from the default +registry (https://registry.npmjs.org) to the configured registry. If set to +"never", then use the registry value. If set to "always", then replace the +registry host with the configured host every time.

+

You may also specify a bare hostname (e.g., "registry.npmjs.org").

+

save

+
    +
  • Default: true unless when using npm update where it defaults to false
  • +
  • Type: Boolean
  • +
+

Save installed packages to a package.json file as dependencies.

+

When used with the npm rm command, removes the dependency from +package.json.

+

Will also prevent writing to package-lock.json if set to false.

+

save-bundle

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If a package would be saved at install time by the use of --save, +--save-dev, or --save-optional, then also put it in the +bundleDependencies list.

+

Ignored if --save-peer is set, since peerDependencies cannot be bundled.

+

save-dev

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Save installed packages to a package.json file as devDependencies.

+

This config cannot be used with: save-optional, save-peer, save-prod

+

save-exact

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Dependencies saved to package.json will be configured with an exact version +rather than using npm's default semver range operator.

+

save-optional

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Save installed packages to a package.json file as optionalDependencies.

+

This config cannot be used with: save-dev, save-peer, save-prod

+

save-peer

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Save installed packages to a package.json file as peerDependencies

+

This config cannot be used with: save-dev, save-optional, save-prod

+

save-prefix

+
    +
  • Default: "^"
  • +
  • Type: String
  • +
+

Configure how versions of packages installed to a package.json file via +--save or --save-dev get prefixed.

+

For example if a package has version 1.2.3, by default its version is set +to ^1.2.3 which allows minor upgrades for that package, but after npm config set save-prefix='~' it would be set to ~1.2.3 which only allows +patch upgrades.

+

save-prod

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Save installed packages into dependencies specifically. This is useful if +a package already exists in devDependencies or optionalDependencies, but +you want to move it to be a non-optional production dependency.

+

This is the default behavior if --save is true, and neither --save-dev +or --save-optional are true.

+

This config cannot be used with: save-dev, save-optional, save-peer

+

sbom-format

+
    +
  • Default: null
  • +
  • Type: "cyclonedx" or "spdx"
  • +
+

SBOM format to use when generating SBOMs.

+

sbom-type

+
    +
  • Default: "library"
  • +
  • Type: "library", "application", or "framework"
  • +
+

The type of package described by the generated SBOM. For SPDX, this is the +value for the primaryPackagePurpose field. For CycloneDX, this is the +value for the type field.

+

scope

+
    +
  • Default: the scope of the current project, if any, or ""
  • +
  • Type: String
  • +
+

Associate an operation with a scope for a scoped registry.

+

Useful when logging in to or out of a private registry:

+
# log in, linking the scope to the custom registry
+npm login --scope=@mycorp --registry=https://registry.mycorp.com
+
+# log out, removing the link and the auth token
+npm logout --scope=@mycorp
+
+

This will cause @mycorp to be mapped to the registry for future +installation of packages specified according to the pattern +@mycorp/package.

+

This will also cause npm init to create a scoped package.

+
# accept all defaults, and create a package named "@foo/whatever",
+# instead of just named "whatever"
+npm init --scope=@foo --yes
+
+

scopes

+
    +
  • Default: null
  • +
  • Type: null or String (can be set multiple times)
  • +
+

When creating a Granular Access Token with npm token create, this limits +the token access to specific scopes. Provide a scope name (with or without @ +prefix).

+

script-shell

+
    +
  • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
  • +
  • Type: null or String
  • +
+

The shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands.

+

searchexclude

+
    +
  • Default: ""
  • +
  • Type: String
  • +
+

Space-separated options that limit the results from search.

+

searchlimit

+
    +
  • Default: 20
  • +
  • Type: Number
  • +
+

Number of items to limit search results to. Will not apply at all to legacy +searches.

+

searchopts

+
    +
  • Default: ""
  • +
  • Type: String
  • +
+

Space-separated options that are always passed to search.

+

searchstaleness

+
    +
  • Default: 900
  • +
  • Type: Number
  • +
+

The age of the cache, in seconds, before another registry request is made if +using legacy search endpoint.

+

shell

+
    +
  • Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on +Windows
  • +
  • Type: String
  • +
+

The shell to run for the npm explore command.

+

sign-git-commit

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, then the npm version command will commit the new package +version using -S to add a signature.

+

Note that git requires you to have set up GPG keys in your git configs for +this to work properly.

+

sign-git-tag

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, then the npm version command will tag the version using +-s to add a signature.

+

Note that git requires you to have set up GPG keys in your git configs for +this to work properly.

+

strict-peer-deps

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, and --legacy-peer-deps is not set, then any +conflicting peerDependencies will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships.

+

By default, conflicting peerDependencies deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's peerDependencies object.

+

When such an override is performed, a warning is printed, explaining the +conflict and the packages involved. If --strict-peer-deps is set, then +this warning is treated as a failure.

+

strict-ssl

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Whether or not to do SSL key validation when making requests to the registry +via https.

+

See also the ca config.

+

tag

+
    +
  • Default: "latest"
  • +
  • Type: String
  • +
+

If you ask npm to install a package and don't tell it a specific version, +then it will install the specified tag.

+

It is the tag added to the package@version specified in the npm dist-tag add command, if no explicit tag is given.

+

When used by the npm diff command, this is the tag used to fetch the +tarball that will be compared with the local files by default.

+

If used in the npm publish command, this is the tag that will be added to +the package submitted to the registry.

+

tag-version-prefix

+
    +
  • Default: "v"
  • +
  • Type: String
  • +
+

If set, alters the prefix used when tagging a new version when performing a +version increment using npm version. To remove the prefix altogether, set +it to the empty string: "".

+

Because other tools may rely on the convention that npm version tags look +like v1.0.0, only use this property if it is absolutely necessary. In +particular, use care when overriding this setting for public packages.

+

timing

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, writes timing information to a process specific json file in the +cache or logs-dir. The file name ends with -timing.json.

+

You can quickly view it with this json command line: +cat ~/.npm/_logs/*-timing.json | npm exec -- json -g.

+

Timing information will also be reported in the terminal. To suppress this +while still writing the timing file, use --silent.

+

token-description

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
+

Description text for the token when using npm token create.

+

umask

+
    +
  • Default: 0
  • +
  • Type: Octal numeric string in range 0000..0777 (0..511)
  • +
+

The "umask" value to use when setting the file creation mode on files and +folders.

+

Folders and executables are given a mode which is 0o777 masked against +this value. Other files are given a mode which is 0o666 masked against +this value.

+

Note that the underlying system will also apply its own umask value to +files and folders that are created, and npm does not circumvent this, but +rather adds the --umask config to it.

+

Thus, the effective default umask value on most POSIX systems is 0o22, +meaning that folders and executables are created with a mode of 0o755 and +other files are created with a mode of 0o644.

+

unicode

+
    +
  • Default: false on windows, true on mac/unix systems with a unicode locale, +as defined by the LC_ALL, LC_CTYPE, or LANG environment variables.
  • +
  • Type: Boolean
  • +
+

When set to true, npm uses unicode characters in the tree output. When +false, it uses ascii characters instead of unicode glyphs.

+

update-notifier

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Set to false to suppress the update notification when using an older version +of npm than the latest.

+

usage

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Show short usage output about the command specified.

+

user-agent

+
    +
  • Default: "npm/{npm-version} node/{node-version} {platform} {arch} +workspaces/{workspaces} {ci}"
  • +
  • Type: String
  • +
+

Sets the User-Agent request header. The following fields are replaced with +their actual counterparts:

+
    +
  • {npm-version} - The npm version in use
  • +
  • {node-version} - The Node.js version in use
  • +
  • {platform} - The value of process.platform
  • +
  • {arch} - The value of process.arch
  • +
  • {workspaces} - Set to true if the workspaces or workspace options +are set.
  • +
  • {ci} - The value of the ci-name config, if set, prefixed with ci/, or +an empty string if ci-name is empty.
  • +
+

userconfig

+
    +
  • Default: "~/.npmrc"
  • +
  • Type: Path
  • +
+

The location of user-level configuration settings.

+

This may be overridden by the npm_config_userconfig environment variable +or the --userconfig command line option, but may not be overridden by +settings in the globalconfig file.

+

version

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, output the npm version and exit successfully.

+

Only relevant when specified explicitly on the command line.

+

versions

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, output the npm version as well as node's process.versions map and +the version in the current working directory's package.json file if one +exists, and exit successfully.

+

Only relevant when specified explicitly on the command line.

+

viewer

+
    +
  • Default: "man" on Posix, "browser" on Windows
  • +
  • Type: String
  • +
+

The program to use to view help content.

+

Set to "browser" to view html help content in the default web browser.

+

which

+
    +
  • Default: null
  • +
  • Type: null or Number
  • +
+

If there are multiple funding sources, which 1-indexed source URL to open.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+

workspaces-update

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

If set to true, the npm cli will run an update after operations that may +possibly change the workspaces installed to the node_modules folder.

+

yes

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Automatically answer "yes" to any prompts that npm might print on the +command line.

+

also

+
    +
  • Default: null
  • +
  • Type: null, "dev", or "development"
  • +
  • DEPRECATED: Please use --include=dev instead.
  • +
+

When set to dev or development, this is an alias for --include=dev.

+

cache-max

+
    +
  • Default: Infinity
  • +
  • Type: Number
  • +
  • DEPRECATED: This option has been deprecated in favor of --prefer-online
  • +
+

--cache-max=0 is an alias for --prefer-online

+

cache-min

+
    +
  • Default: 0
  • +
  • Type: Number
  • +
  • DEPRECATED: This option has been deprecated in favor of --prefer-offline.
  • +
+

--cache-min=9999 (or bigger) is an alias for --prefer-offline.

+

cert

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
  • DEPRECATED: key and cert are no longer used for most registry +operations. Use registry scoped keyfile and certfile instead. Example: +//other-registry.tld/:keyfile=/path/to/key.pem +//other-registry.tld/:certfile=/path/to/cert.crt
  • +
+

A client certificate to pass when accessing the registry. Values should be +in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with +newlines replaced by the string "\n". For example:

+
cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
+
+

It is not the path to a certificate file, though you can set a +registry-scoped "certfile" path like +"//other-registry.tld/:certfile=/path/to/cert.pem".

+

dev

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: Please use --include=dev instead.
  • +
+

Alias for --include=dev.

+

global-style

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: This option has been deprecated in favor of +--install-strategy=shallow
  • +
+

Only install direct dependencies in the top level node_modules, but hoist +on deeper dependencies. Sets --install-strategy=shallow.

+

init.author.email

+
    +
  • Default: ""
  • +
  • Type: String
  • +
  • DEPRECATED: Use --init-author-email instead.
  • +
+

Alias for --init-author-email

+

init.author.name

+
    +
  • Default: ""
  • +
  • Type: String
  • +
  • DEPRECATED: Use --init-author-name instead.
  • +
+

Alias for --init-author-name

+

init.author.url

+
    +
  • Default: ""
  • +
  • Type: "" or URL
  • +
  • DEPRECATED: Use --init-author-url instead.
  • +
+

Alias for --init-author-url

+

init.license

+
    +
  • Default: "ISC"
  • +
  • Type: String
  • +
  • DEPRECATED: Use --init-license instead.
  • +
+

Alias for --init-license

+

init.module

+
    +
  • Default: "~/.npm-init.js"
  • +
  • Type: Path
  • +
  • DEPRECATED: Use --init-module instead.
  • +
+

Alias for --init-module

+

init.version

+
    +
  • Default: "1.0.0"
  • +
  • Type: SemVer string
  • +
  • DEPRECATED: Use --init-version instead.
  • +
+

Alias for --init-version

+

key

+
    +
  • Default: null
  • +
  • Type: null or String
  • +
  • DEPRECATED: key and cert are no longer used for most registry +operations. Use registry scoped keyfile and certfile instead. Example: +//other-registry.tld/:keyfile=/path/to/key.pem +//other-registry.tld/:certfile=/path/to/cert.crt
  • +
+

A client key to pass when accessing the registry. Values should be in PEM +format with newlines replaced by the string "\n". For example:

+
key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----"
+
+

It is not the path to a key file, though you can set a registry-scoped +"keyfile" path like "//other-registry.tld/:keyfile=/path/to/key.pem".

+

legacy-bundling

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
  • DEPRECATED: This option has been deprecated in favor of +--install-strategy=nested
  • +
+

Instead of hoisting package installs in node_modules, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets --install-strategy=nested.

+

only

+
    +
  • Default: null
  • +
  • Type: null, "prod", or "production"
  • +
  • DEPRECATED: Use --omit=dev to omit dev dependencies from the install.
  • +
+

When set to prod or production, this is an alias for --omit=dev.

+

optional

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
  • DEPRECATED: Use --omit=optional to exclude optional dependencies, or +--include=optional to include them.
  • +
+

Default value does install optional deps unless otherwise omitted.

+

Alias for --include=optional or --omit=optional

+

production

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
  • DEPRECATED: Use --omit=dev instead.
  • +
+

Alias for --omit=dev

+

shrinkwrap

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
  • DEPRECATED: Use the --package-lock setting instead.
  • +
+

Alias for --package-lock

+

See also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/using-npm/dependency-selectors.html b/node24/node_modules/npm/docs/output/using-npm/dependency-selectors.html new file mode 100644 index 0000000000000000000000000000000000000000..e0fa135ac575ce23acb23b521dc9f9c02f914c2a --- /dev/null +++ b/node24/node_modules/npm/docs/output/using-npm/dependency-selectors.html @@ -0,0 +1,425 @@ + + +Dependency Selectors + + + + + +
+
+

+ Dependency Selectors + @11.12.1 +

+Dependency Selector Syntax & Querying +
+ +
+

Table of contents

+ +
+ +

Description

+

The npm query command exposes a new dependency selector syntax (informed by & respecting many aspects of the CSS Selectors 4 Spec) which:

+
    +
  • Standardizes the shape of, & querying of, dependency graphs with a robust object model, metadata & selector syntax
  • +
  • Leverages existing, known language syntax & operators from CSS to make disparate package information broadly accessible
  • +
  • Unlocks the ability to answer complex, multi-faceted questions about dependencies, their relationships & associative metadata
  • +
  • Consolidates redundant logic of similar query commands in npm (ex. +npm fund, npm ls, npm outdated, npm audit ...)
  • +
+

Dependency Selector Syntax

+

Overview:

+
    +
  • there is no "type" or "tag" selectors (ex. +div, h1, a) as a dependency/target is the only type of Node that can be queried
  • +
  • the term "dependencies" is in reference to any Node found in a tree returned by Arborist
  • +
+

Combinators

+
    +
  • > direct descendant/child
  • +
  • any descendant/child
  • +
  • ~ sibling
  • +
+

Selectors

+
    +
  • * universal selector
  • +
  • #<name> dependency selector (equivalent to [name="..."])
  • +
  • #<name>@<version> (equivalent to [name=<name>]:semver(<version>))
  • +
  • , selector list delimiter
  • +
  • . dependency type selector
  • +
  • : pseudo selector
  • +
+

Dependency Type Selectors

+
    +
  • .prod dependency found in the dependencies section of package.json, or is a child of said dependency
  • +
  • .dev dependency found in the devDependencies section of package.json, or is a child of said dependency
  • +
  • .optional dependency found in the optionalDependencies section of package.json, or has "optional": true set in its entry in the peerDependenciesMeta section of package.json, or a child of said dependency
  • +
  • .peer dependency found in the peerDependencies section of package.json
  • +
  • .workspace dependency found in the workspaces section of package.json
  • +
  • .bundled dependency found in the bundleDependencies section of package.json, or is a child of said dependency
  • +
+

Pseudo Selectors

+
    +
  • :not(<selector>)
  • +
  • :has(<selector>)
  • +
  • :is(<selector list>)
  • +
  • :root matches the root node/dependency
  • +
  • :scope matches node/dependency it was queried against
  • +
  • :empty when a dependency has no dependencies
  • +
  • :private when a dependency is private
  • +
  • :link when a dependency is linked (for instance, workspaces or packages manually linked
  • +
  • :deduped when a dependency has been deduped (note that this does not always mean the dependency has been hoisted to the root of node_modules)
  • +
  • :overridden when a dependency has been overridden
  • +
  • :extraneous when a dependency exists but is not defined as a dependency of any node
  • +
  • :invalid when a dependency version is out of its ancestors specified range
  • +
  • :missing when a dependency is not found on disk
  • +
  • :semver(<spec>, [selector], [function]) match a valid node-semver version or range to a selector
  • +
  • :path(<path>) glob matching based on dependencies path relative to the project
  • +
  • :type(<type>) based on currently recognized types. You can also use the aggregate type of registry for any registry dependency (e.g. tag, version, range, alias)
  • +
  • :outdated(<type>) when a dependency is outdated
  • +
  • :vuln(<selector>) when a dependency has a known vulnerability
  • +
+
:semver(<spec>, [selector], [function])
+

The :semver() pseudo selector allows comparing fields from each node's package.json using semver methods. +It accepts up to 3 parameters, all but the first of which are optional.

+
    +
  • spec a semver version or range
  • +
  • selector an attribute selector for each node (default [version])
  • +
  • function a semver method to apply, one of: satisfies, intersects, subset, gt, gte, gtr, lt, lte, ltr, eq, neq or the special function infer (default infer)
  • +
+

When the special infer function is used the spec and the actual value from the node are compared. +If both are versions, according to semver.valid(), eq is used. +If both values are ranges, according to !semver.valid(), intersects is used. +If the values are mixed types satisfies is used.

+

Some examples:

+
    +
  • :semver(^1.0.0) returns every node that has a version satisfied by the provided range ^1.0.0
  • +
  • :semver(16.0.0, :attr(engines, [node])) returns every node which has an engines.node property satisfying the version 16.0.0
  • +
  • :semver(1.0.0, [version], lt) every node with a version less than 1.0.0
  • +
+
:outdated(<type>)
+

The :outdated pseudo selector retrieves data from the registry and returns information about which of your dependencies are outdated. +The type parameter may be one of the following:

+
    +
  • any (default) a version exists that is greater than the current one
  • +
  • in-range a version exists that is greater than the current one, and satisfies at least one if its parent's dependencies
  • +
  • out-of-range a version exists that is greater than the current one, does not satisfy at least one of its parent's dependencies
  • +
  • major a version exists that is a semver major greater than the current one
  • +
  • minor a version exists that is a semver minor greater than the current one
  • +
  • patch a version exists that is a semver patch greater than the current one
  • +
+

In addition to the filtering performed by the pseudo selector, some extra data is added to the resulting objects. +The following data can be found under the queryContext property of each node.

+
    +
  • versions an array of every available version of the given node
  • +
  • outdated.inRange an array of objects, each with a from and versions, where from is the on-disk location of the node that depends on the current node and versions is an array of all available versions that satisfies that dependency. +This is only populated if :outdated(in-range) is used.
  • +
  • outdated.outOfRange an array of objects, identical in shape to inRange, but where the versions array is every available version that does not satisfy the dependency. +This is only populated if :outdated(out-of-range) is used.
  • +
+

Some examples:

+
    +
  • :root > :outdated(major) returns every direct dependency that has a new semver major release
  • +
  • .prod:outdated(in-range) returns production dependencies that have a new release that satisfies at least one of its parent's dependencies
  • +
+
:vuln
+

The :vuln pseudo selector retrieves data from the registry and returns information about which if your dependencies has a known vulnerability. +Only dependencies whose current version matches a vulnerability will be returned. +For example if you have semver@7.6.0 in your tree, a vulnerability for semver which affects versions <=6.3.1 will not match.

+

You can also filter results by certain attributes in advisories. +Currently that includes severity and cwe. +Note that severity filtering is done per severity, it does not include severities "higher" or "lower" than the one specified.

+

In addition to the filtering performed by the pseudo selector, info about each relevant advisory will be added to the queryContext attribute of each node under the advisories attribute.

+

Some examples:

+
    +
  • :root > .prod:vuln returns direct production dependencies with any known vulnerability
  • +
  • :vuln([severity=high]) returns only dependencies with a vulnerability with a high severity.
  • +
  • :vuln([severity=high],[severity=moderate]) returns only dependencies with a vulnerability with a high or moderate severity.
  • +
  • :vuln([cwe=1333]) returns only dependencies with a vulnerability that includes CWE-1333 (ReDoS)
  • +
+

Attribute Selectors

+

The attribute selector evaluates the key/value pairs in package.json if they are Strings.

+
    +
  • [] attribute selector (ie. +existence of attribute)
  • +
  • [attribute=value] attribute value is equivalent...
  • +
  • [attribute~=value] attribute value contains word...
  • +
  • [attribute*=value] attribute value contains string...
  • +
  • [attribute|=value] attribute value is equal to or starts with...
  • +
  • [attribute^=value] attribute value starts with...
  • +
  • [attribute$=value] attribute value ends with...
  • +
+

Array & Object Attribute Selectors

+

The generic :attr() pseudo selector standardizes a pattern which can be used for attribute selection of Objects, Arrays or Arrays of Objects accessible via Arborist's Node.package metadata. +This allows for iterative attribute selection beyond top-level String evaluation. +The last argument passed to :attr() must be an attribute selector or a nested :attr(). +See examples below:

+

Objects

+
/* return dependencies that have a `scripts.test` containing `"tap"` */
+*:attr(scripts, [test~=tap])
+
+

Nested Objects

+

Nested objects are expressed as sequential arguments to :attr().

+
/* return dependencies that have a [testling config](https://ci.testling.com/guide/advanced_configuration) for opera browsers */
+*:attr(testling, browsers, [~=opera])
+
+

Arrays

+

Arrays specifically uses a special/reserved . character in place of a typical attribute name. +Arrays also support exact value matching when a String is passed to the selector.

+
Example of an Array Attribute Selection:
+
/* removes the distinction between properties & arrays */
+/* ie. we'd have to check the property & iterate to match selection */
+*:attr([keywords^=react])
+*:attr(contributors, :attr([name~=Jordan]))
+
+
Example of an Array matching directly to a value:
+
/* return dependencies that have the exact keyword "react" */
+/* this is equivalent to `*:keywords([value="react"])` */
+*:attr([keywords=react])
+
+
Example of an Array of Objects:
+
/* returns */
+*:attr(contributors, [email=ruyadorno@github.com])
+
+

Groups

+

Dependency groups are defined by the package relationships to their ancestors (ie. +the dependency types that are defined in package.json). +This approach is user-centric as the ecosystem has been taught to think about dependencies in these groups first-and-foremost. +Dependencies are allowed to be included in multiple groups (ex. +a prod dependency may also be a dev dependency (in that it's also required by another dev dependency) & may also be bundled - a selector for that type of dependency would look like: *.prod.dev.bundled).

+
    +
  • .prod
  • +
  • .dev
  • +
  • .optional
  • +
  • .peer
  • +
  • .bundled
  • +
  • .workspace
  • +
+

Please note that currently workspace deps are always prod dependencies. +Additionally the .root dependency is also considered a prod dependency.

+

Programmatic Usage

+
    +
  • Arborist's Node Class has a .querySelectorAll() method +
      +
    • this method will return a filtered, flattened dependency Arborist Node list based on a valid query selector
    • +
    +
  • +
+
const Arborist = require('@npmcli/arborist')
+const arb = new Arborist({})
+
+
// root-level
+arb.loadActual().then(async (tree) => {
+  // query all production dependencies
+  const results = await tree.querySelectorAll('.prod')
+  console.log(results)
+})
+
+
// iterative
+arb.loadActual().then(async (tree) => {
+  // query for the deduped version of react
+  const results = await tree.querySelectorAll('#react:not(:deduped)')
+  // query the deduped react for git deps
+  const deps = await results[0].querySelectorAll(':type(git)')
+  console.log(deps)
+})
+
+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/using-npm/developers.html b/node24/node_modules/npm/docs/output/using-npm/developers.html new file mode 100644 index 0000000000000000000000000000000000000000..cccd853e5ea73c1c4d0b29f3e01434b4aa70cbad --- /dev/null +++ b/node24/node_modules/npm/docs/output/using-npm/developers.html @@ -0,0 +1,375 @@ + + +Developers + + + + + +
+
+

+ Developers + @11.12.1 +

+Developer guide +
+ +
+

Table of contents

+ +
+ +

Description

+

So, you've decided to use npm to develop (and maybe publish/deploy) your project.

+

Fantastic!

+

There are a few things that you need to do above the simple steps that your users will do to install your program.

+

About These Documents

+

These are man pages. +If you install npm, you should be able to then do man npm-thing to get the documentation on a particular topic, or npm help thing to see the same information.

+

What is a Package

+

A package is:

+
    +
  • a) a folder containing a program described by a package.json file
  • +
  • b) a gzipped tarball containing (a)
  • +
  • c) a url that resolves to (b)
  • +
  • d) a <name>@<version> that is published on the registry with (c)
  • +
  • e) a <name>@<tag> that points to (d)
  • +
  • f) a <name> that has a "latest" tag satisfying (e)
  • +
  • g) a git url that, when cloned, results in (a).
  • +
+

Even if you never publish your package, you can still get a lot of benefits of using npm if you just want to write a node program (a), and perhaps if you also want to be able to easily install it elsewhere after packing it up into a tarball (b).

+

Git urls can be of the form:

+
git://github.com/user/project.git#commit-ish
+git+ssh://user@hostname:project.git#commit-ish
+git+http://user@hostname/project/blah.git#commit-ish
+git+https://user@hostname/project/blah.git#commit-ish
+
+

The commit-ish can be any tag, sha, or branch which can be supplied as an argument to git checkout. +The default is whatever the repository uses as its default branch.

+

The package.json File

+

You need to have a package.json file in the root of your project to do much of anything with npm. +That is basically the whole interface.

+

See package.json for details about what goes in that file. +At the very least, you need:

+
    +
  • +

    name: This should be a string that identifies your project. +Please do not use the name to specify that it runs on node, or is in JavaScript. +You can use the "engines" field to explicitly state the versions of node (or whatever else) that your program requires, and it's pretty well assumed that it's JavaScript.

    +

    It does not necessarily need to match your github repository name.

    +

    So, node-foo and bar-js are bad names. +foo or bar are better.

    +
  • +
  • +

    version: A semver-compatible version.

    +
  • +
  • +

    engines: Specify the versions of node (or whatever else) that your program runs on. +The node API changes a lot, and there may be bugs or new functionality that you depend on. +Be explicit.

    +
  • +
  • +

    author: Take some credit.

    +
  • +
  • +

    scripts: If you have a special compilation or installation script, then you should put it in the scripts object. +You should definitely have at least a basic smoke-test command as the "scripts.test" field. +See scripts.

    +
  • +
  • +

    main: If you have a single module that serves as the entry point to your program (like what the "foo" package gives you at require("foo")), then you need to specify that in the "main" field.

    +
  • +
  • +

    directories: This is an object mapping names to folders. +The best ones to include are "lib" and "doc", but if you use "man" to specify a folder full of man pages, they'll get installed just like these ones.

    +
  • +
+

You can use npm init in the root of your package in order to get you started with a pretty basic package.json file. +See npm init for more info.

+

Keeping files out of your Package

+

Use a .npmignore file to keep stuff out of your package. +If there's no .npmignore file, but there is a .gitignore file, then npm will ignore the stuff matched by the .gitignore file. +If you want to include something that is excluded by your .gitignore file, you can create an empty .npmignore file to override it. +Like git, npm looks for .npmignore and .gitignore files in all subdirectories of your package, not only the root directory.

+

.npmignore files follow the same pattern rules as .gitignore files:

+
    +
  • Blank lines or lines starting with # are ignored.
  • +
  • Standard glob patterns work.
  • +
  • You can end patterns with a forward slash / to specify a directory.
  • +
  • You can negate a pattern by starting it with an exclamation point !.
  • +
+

By default, some paths and files are ignored, so there's no need to add them to .npmignore explicitly. +Some examples are:

+
    +
  • .*.swp
  • +
  • ._*
  • +
  • .DS_Store
  • +
  • .git
  • +
  • .gitignore
  • +
  • .hg
  • +
  • .npmignore
  • +
  • .npmrc
  • +
  • .lock-wscript
  • +
  • .svn
  • +
  • .wafpickle-*
  • +
  • config.gypi
  • +
  • CVS
  • +
  • npm-debug.log
  • +
+

Additionally, everything in node_modules is ignored, except for bundled dependencies. +npm automatically handles this for you, so don't bother adding node_modules to .npmignore.

+

The following paths and files are never ignored, so adding them to .npmignore is pointless:

+
    +
  • package.json
  • +
  • README (and its variants)
  • +
  • LICENSE / LICENCE
  • +
+

If, given the structure of your project, you find .npmignore to be a maintenance headache, you might instead try populating the files property of package.json, which is an array of file or directory names that should be included in your package. +Sometimes manually picking which items to allow is easier to manage than building a block list.

+

See package.json for more info on what can and can't be ignored.

+

Testing whether your .npmignore or files config works

+

If you want to double check that your package will include only the files you intend it to when published, you can run the npm pack command locally which will generate a tarball in the working directory, the same way it does for publishing.

+ +

npm link is designed to install a development package and see the changes in real time without having to keep re-installing it. +(You do need to either re-link or npm rebuild -g to update compiled packages, of course.)

+

More info at npm link.

+

Before Publishing: Make Sure Your Package Installs and Works

+

This is important.

+

If you cannot install it locally, you'll have problems trying to publish it. +Or, worse yet, you'll be able to publish it, but you'll be publishing a broken or pointless package. +So don't do that.

+

In the root of your package, do this:

+
npm install . -g
+
+

That'll show you that it's working. +If you'd rather just create a symlink package that points to your working directory, then do this:

+
npm link
+
+

Use npm ls -g to see if it's there.

+

To test a local install, go into some other folder, and then do:

+
cd ../some-other-folder
+npm install ../my-package
+
+

to install it locally into the node_modules folder in that other place.

+

Then go into the node-repl, and try using require("my-thing") to bring in your module's main module.

+

Create a User Account

+

Create a user with the adduser command. +It works like this:

+
npm adduser
+
+

and then follow the prompts.

+

This is documented better in npm adduser.

+

Publish your Package

+

This part's easy. +In the root of your folder, do this:

+
npm publish
+
+

You can give publish a url to a tarball, or a filename of a tarball, or a path to a folder.

+

Note that pretty much everything in that folder will be exposed by default. +So, if you have secret stuff in there, use a .npmignore file to list out the globs to ignore, or publish from a fresh checkout.

+

Brag about it

+

Send emails, write blogs, blab in IRC.

+

Tell the world how easy it is to install your program!

+

See also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/using-npm/logging.html b/node24/node_modules/npm/docs/output/using-npm/logging.html new file mode 100644 index 0000000000000000000000000000000000000000..b8a9e56286a7bf0b6ac79c0cd292e62f9da0a1c5 --- /dev/null +++ b/node24/node_modules/npm/docs/output/using-npm/logging.html @@ -0,0 +1,284 @@ + + +Logging + + + + + +
+
+

+ Logging + @11.12.1 +

+Why, What & How we Log +
+ +
+

Table of contents

+ +
+ +

Description

+

The npm CLI has various mechanisms for showing different levels of information back to end-users for certain commands, configurations & environments.

+

Setting Log File Location

+

All logs are written to a debug log, with the path to that file printed if the execution of a command fails.

+

The default location of the logs directory is a directory named _logs inside the npm cache. +This can be changed with the logs-dir config option.

+

For example, if you wanted to write all your logs to the current working directory, you could run: npm install --logs-dir=.. +This is especially helpful in debugging a specific npm issue as you can run a command multiple times with different config values and then diff all the log files.

+

Log files will be removed from the logs-dir when the number of log files exceeds logs-max, with the oldest logs being deleted first.

+

To turn off logs completely set --logs-max=0.

+

Setting Log Levels

+

loglevel

+

loglevel is a global argument/config that can be set to determine the type of information to be displayed.

+

The default value of loglevel is "notice" but there are several levels/types of logs available, including:

+
    +
  • "silent"
  • +
  • "error"
  • +
  • "warn"
  • +
  • "notice"
  • +
  • "http"
  • +
  • "info"
  • +
  • "verbose"
  • +
  • "silly"
  • +
+

All logs pertaining to a level preceding the current setting will be shown.

+
Aliases
+

The log levels listed above have various corresponding aliases, including:

+
    +
  • -d: --loglevel info
  • +
  • --dd: --loglevel verbose
  • +
  • --verbose: --loglevel verbose
  • +
  • --ddd: --loglevel silly
  • +
  • -q: --loglevel warn
  • +
  • --quiet: --loglevel warn
  • +
  • -s: --loglevel silent
  • +
  • --silent: --loglevel silent
  • +
+

foreground-scripts

+

The npm CLI began hiding the output of lifecycle scripts for npm install as of v7. +Notably, this means you will not see logs/output from packages that may be using "install scripts" to display information back to you or from your own project's scripts defined in package.json. +If you'd like to change this behavior & log this output you can set foreground-scripts to true.

+

Timing Information

+

The --timing config can be set which does a few things:

+
    +
  1. Always shows the full path to the debug log regardless of command exit status
  2. +
  3. Write timing information to a process specific timing file in the cache or logs-dir
  4. +
  5. Output timing information to the terminal
  6. +
+

This file contains a timers object where the keys are an identifier for the portion of the process being timed and the value is the number of milliseconds it took to complete.

+

Sometimes it is helpful to get timing information without outputting anything to the terminal. +For example, the performance might be affected by writing to the terminal. +In this case you can use +--timing --silent which will still write the timing file, but not output anything to the terminal while running.

+

Registry Response Headers

+

npm-notice

+

The npm CLI reads from & logs any npm-notice headers that are returned from the configured registry. +This mechanism can be used by third-party registries to provide useful information when network-dependent requests occur.

+

This header is not cached, and will not be logged if the request is served from the cache.

+

Logs and Sensitive Information

+

The npm CLI makes a best effort to redact the following from terminal output and log files:

+
    +
  • Passwords inside basic auth URLs
  • +
  • npm tokens
  • +
+

However, this behavior should not be relied on to keep all possible sensitive information redacted. +If you are concerned about secrets in your log file or terminal output, you can use --loglevel=silent and --logs-max=0 to ensure no logs are written to your terminal or filesystem.

+

See also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/using-npm/orgs.html b/node24/node_modules/npm/docs/output/using-npm/orgs.html new file mode 100644 index 0000000000000000000000000000000000000000..d02b9a28370cb9f0c4a11277b6b04af69abde13a --- /dev/null +++ b/node24/node_modules/npm/docs/output/using-npm/orgs.html @@ -0,0 +1,294 @@ + + +Organizations + + + + + +
+
+

+ Organizations + @11.12.1 +

+Working with teams & organizations +
+ +
+

Table of contents

+ +
+ +

Description

+

There are three levels of org users:

+
    +
  1. Super admin, controls billing & adding people to the org.
  2. +
  3. Team admin, manages team membership & package access.
  4. +
  5. Developer, works on packages they are given access to.
  6. +
+

The super admin is the only person who can add users to the org because it impacts the monthly bill. +The super admin will use the website to manage membership. +Every org has a developers team that all users are automatically added to.

+

The team admin is the person who manages team creation, team membership, and package access for teams. +The team admin grants package access to teams, not individuals.

+

The developer will be able to access packages based on the teams they are on. +Access is either read-write or read-only.

+

There are two main commands:

+
    +
  1. npm team see npm team for more details
  2. +
  3. npm access see npm access for more details
  4. +
+

Team Admins create teams

+
    +
  • Check who you’ve added to your org:
  • +
+
npm team ls <org>:developers
+
+
    +
  • +

    Each org is automatically given a developers team, so you can see the whole list of team members in your org. +This team automatically gets read-write access to all packages, but you can change that with the access command.

    +
  • +
  • +

    Create a new team:

    +
  • +
+
npm team create <org:team>
+
+
    +
  • Add members to that team:
  • +
+
npm team add <org:team> <user>
+
+

Publish a package and adjust package access

+
    +
  • In package directory, run
  • +
+
npm init --scope=<org>
+
+

to scope it for your org & publish as usual

+
    +
  • Grant access:
  • +
+
npm access grant <read-only|read-write> <org:team> [<package>]
+
+
    +
  • Revoke access:
  • +
+
npm access revoke <org:team> [<package>]
+
+

Monitor your package access

+
    +
  • See what org packages a team member can access:
  • +
+
npm access list packages <org> <user>
+
+
    +
  • See packages available to a specific team:
  • +
+
npm access list packages <org:team>
+
+
    +
  • Check which teams are collaborating on a package:
  • +
+
npm access list collaborators <pkg>
+
+

See also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/using-npm/package-spec.html b/node24/node_modules/npm/docs/output/using-npm/package-spec.html new file mode 100644 index 0000000000000000000000000000000000000000..d227a68823b28f28ab90a9a116791c311c63a3c4 --- /dev/null +++ b/node24/node_modules/npm/docs/output/using-npm/package-spec.html @@ -0,0 +1,295 @@ + + +Package spec + + + + + +
+
+

+ Package spec + @11.12.1 +

+Package name specifier +
+ +
+

Table of contents

+ +
+ +

Description

+

Commands like npm install and the dependency sections in the package.json use a package name specifier. +This can be many different things that all refer to a "package". Examples include a package name, git url, tarball, or local directory. +These will generally be referred to as <package-spec> in the help output for the npm commands that use this package name specifier.

+

Package name

+
    +
  • [<@scope>/]<pkg>
  • +
  • [<@scope>/]<pkg>@<tag>
  • +
  • [<@scope>/]<pkg>@<version>
  • +
  • [<@scope>/]<pkg>@<version range>
  • +
+

Refers to a package by name, with or without a scope, and optionally tag, version, or version range. +This is typically used in combination with the registry config to refer to a package in a registry.

+

Examples:

+
    +
  • npm
  • +
  • @npmcli/arborist
  • +
  • @npmcli/arborist@latest
  • +
  • npm@6.13.1
  • +
  • npm@^4.0.0
  • +
+

Aliases

+
    +
  • <alias>@npm:<name>
  • +
+

Primarily used by commands like npm install and in the dependency sections in the package.json, this refers to a package by an alias. +The <alias> is the name of the package as it is reified in the node_modules folder, and the <name> refers to a package name as found in the configured registry.

+

See Package name above for more info on referring to a package by name, and registry for configuring which registry is used when referring to a package by name.

+

Examples:

+
    +
  • semver@npm:@npmcli/semver-with-patch
  • +
  • semver@npm:semver@7.2.2
  • +
  • semver@npm:semver@legacy
  • +
+

Folders

+
    +
  • <folder>
  • +
+

This refers to a package on the local filesystem. +Specifically this is a folder with a package.json file in it. +This should always be prefixed with a / or ./ (or your OS equivalent) to reduce confusion. +npm currently will parse a string with more than one / in it as a folder, but this is legacy behavior that may be removed in a future version.

+

Examples:

+
    +
  • ./my-package
  • +
  • /opt/npm/my-package
  • +
+

Tarballs

+
    +
  • <tarball file>
  • +
  • <tarball url>
  • +
+

Examples:

+
    +
  • ./my-package.tgz
  • +
  • https://registry.npmjs.org/semver/-/semver-1.0.0.tgz
  • +
+

Refers to a package in a tarball format, either on the local filesystem or remotely via url. +This is the format that packages exist in when uploaded to a registry.

+

git urls

+
    +
  • <git:// url>
  • +
  • <github username>/<github project>
  • +
+

Refers to a package in a git repo. +This can be a full git url, git shorthand, or a username/package on GitHub. +You can specify a git tag, branch, or other git ref by appending #ref.

+

Examples:

+
    +
  • https://github.com/npm/cli.git
  • +
  • git@github.com:npm/cli.git
  • +
  • git+ssh://git@github.com/npm/cli#v6.0.0
  • +
  • github:npm/cli#HEAD
  • +
  • npm/cli#c12ea07
  • +
+

See also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/using-npm/registry.html b/node24/node_modules/npm/docs/output/using-npm/registry.html new file mode 100644 index 0000000000000000000000000000000000000000..ad01b569eaa143263ddde072fbcebde7ef847ca9 --- /dev/null +++ b/node24/node_modules/npm/docs/output/using-npm/registry.html @@ -0,0 +1,255 @@ + + +Registry + + + + + +
+
+

+ Registry + @11.12.1 +

+The JavaScript Package Registry +
+ +
+

Table of contents

+ +
+ +

Description

+

To resolve packages by name and version, npm talks to a registry website that implements the CommonJS Package Registry specification for reading package info.

+

npm is configured to use the npm public registry at +https://registry.npmjs.org by default. +Use of the npm public registry is subject to terms of use available at https://docs.npmjs.com/policies/terms.

+

You can configure npm to use any compatible registry you like, and even run your own registry. +Use of someone else's registry may be governed by their terms of use.

+

npm's package registry implementation supports several write APIs as well, to allow for publishing packages and managing user account information.

+

The registry URL used is determined by the scope of the package (see scope. +If no scope is specified, the default registry is used, which is supplied by the registry config parameter. +See npm config, npmrc, and config for more on managing npm's configuration. +Authentication configuration such as auth tokens and certificates are configured specifically scoped to an individual registry. +See Auth Related Configuration

+

When the default registry is used in a package-lock or shrinkwrap it has the special meaning of "the currently configured registry". If you create a lock file while using the default registry you can switch to another registry and npm will install packages from the new registry, but if you create a lock file while using a custom registry packages will be installed from that registry even after you change to another registry.

+

Does npm send any information about me back to the registry?

+

Yes.

+

When making requests of the registry npm adds two headers with information about your environment:

+
    +
  • Npm-Scope – If your project is scoped, this header will contain its scope. +In the future npm hopes to build registry features that use this information to allow you to customize your experience for your organization.
  • +
  • Npm-In-CI – Set to "true" if npm believes this install is running in a continuous integration environment, "false" otherwise. +This is detected by looking for the following environment variables: CI, TDDIUM, +JENKINS_URL, bamboo.buildKey. +If you'd like to learn more you may find the original PR interesting. +This is used to gather better metrics on how npm is used by humans, versus build farms.
  • +
+

The npm registry does not try to correlate the information in these headers with any authenticated accounts that may be used in the same requests.

+

How can I prevent my package from being published in the official registry?

+

Set "private": true in your package.json to prevent it from being published at all, or +"publishConfig":{"registry":"http://my-internal-registry.local"} +to force it to be published only to your internal/private registry.

+

See package.json for more info on what goes in the package.json file.

+

Where can I find my (and others') published packages?

+

https://www.npmjs.com/

+

See also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/using-npm/removal.html b/node24/node_modules/npm/docs/output/using-npm/removal.html new file mode 100644 index 0000000000000000000000000000000000000000..37ed14e63fa836026e62b8d111ce725767787550 --- /dev/null +++ b/node24/node_modules/npm/docs/output/using-npm/removal.html @@ -0,0 +1,245 @@ + + +Removal + + + + + +
+
+

+ Removal + @11.12.1 +

+Cleaning the slate +
+ +
+

Table of contents

+ +
+ +

Synopsis

+

So sad to see you go.

+
sudo npm uninstall npm -g
+
+

Or, if that fails, please proceed to more severe uninstalling methods.

+

More Severe Uninstalling

+

Usually, the above instructions are sufficient. +That will remove npm, but leave behind anything you've installed.

+

If that doesn't work, or if you require more drastic measures, continue reading.

+

Note that this is only necessary for globally-installed packages. +Local installs are completely contained within a project's node_modules folder. +Delete that folder, and everything is gone unless a package's install script is particularly ill-behaved.

+

This assumes that you installed node and npm in the default place. +If you configured node with a different --prefix, or installed npm with a different prefix setting, then adjust the paths accordingly, replacing +/usr/local with your install prefix.

+

To remove everything npm-related manually:

+
rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*
+
+

If you installed things with npm, then your best bet is to uninstall them with npm first, and then install them again once you have a proper install. +This can help find any symlinks that are lying around:

+
ls -laF /usr/local/{lib/node{,/.npm},bin,share/man} | grep npm
+
+

Prior to version 0.3, npm used shim files for executables and node modules. +To track those down, you can do the following:

+
find /usr/local/{lib/node,bin} -exec grep -l npm \{\} \; ;
+
+

See also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/using-npm/scope.html b/node24/node_modules/npm/docs/output/using-npm/scope.html new file mode 100644 index 0000000000000000000000000000000000000000..8687903f06c18df6212ce63c8172618b4a88b0de --- /dev/null +++ b/node24/node_modules/npm/docs/output/using-npm/scope.html @@ -0,0 +1,290 @@ + + +Scope + + + + + +
+
+

+ Scope + @11.12.1 +

+Scoped packages +
+ +
+

Table of contents

+ +
+ +

Description

+

All npm packages have a name. +Some package names also have a scope. +A scope follows the usual rules for package names (URL-safe characters, no leading dots or underscores). +When used in package names, scopes are preceded by an @ symbol and followed by a slash, e.g.

+
@somescope/somepackagename
+
+

Scopes are a way of grouping related packages together, and also affect a few things about the way npm treats the package.

+

Each npm user/organization has their own scope, and only you can add packages in your scope. +This means you don't have to worry about someone taking your package name ahead of you. +Thus it is also a good way to signal official packages for organizations.

+

Scoped packages can be published and installed as of npm@2 and are supported by the primary npm registry. +Unscoped packages can depend on scoped packages and vice versa. +The npm client is backwards-compatible with unscoped registries, so it can be used to work with scoped and unscoped registries at the same time.

+

Installing scoped packages

+

Scoped packages are installed to a sub-folder of the regular installation folder, e.g. if your other packages are installed in node_modules/packagename, scoped modules will be installed in node_modules/@myorg/packagename. +The scope folder (@myorg) is simply the name of the scope preceded by an @ symbol, and can contain any number of scoped packages.

+

A scoped package is installed by referencing it by name, preceded by an +@ symbol, in npm install:

+
npm install @myorg/mypackage
+
+

Or in package.json:

+
"dependencies": {
+  "@myorg/mypackage": "^1.3.0"
+}
+
+

Note that if the @ symbol is omitted, in either case, npm will instead attempt to install from GitHub; see npm install.

+

Requiring scoped packages

+

Because scoped packages are installed into a scope folder, you have to include the name of the scope when requiring them in your code, e.g.

+
require('@myorg/mypackage')
+
+

There is nothing special about the way Node treats scope folders. +This simply requires the mypackage module in the folder named @myorg.

+

Publishing scoped packages

+

Scoped packages can be published from the CLI as of npm@2 and can be published to any registry that supports them, including the primary npm registry.

+

(As of 2015-04-19, and with npm 2.0 or better, the primary npm registry +does support scoped packages.)

+

If you wish, you may associate a scope with a registry; see below.

+

Publishing public scoped packages to the primary npm registry

+

Publishing to a scope, you have two options:

+
    +
  • Publishing to your user scope (example: @username/module)
  • +
  • Publishing to an organization scope (example: @org/module)
  • +
+

If publishing a public module to an organization scope, you must first either create an organization with the name of the scope that you'd like to publish to or be added to an existing organization with the appropriate permissions. +For example, if you'd like to publish to @org, you would need to create the org organization on npmjs.com prior to trying to publish.

+

Scoped packages are not public by default. +You will need to specify +--access public with the initial npm publish command. +This will publish the package and set access to public as if you had run npm access public after publishing. +You do not need to do this when publishing new versions of an existing scoped package.

+

Publishing private scoped packages to the npm registry

+

To publish a private scoped package to the npm registry, you must have an npm Private Modules account.

+

You can then publish the module with npm publish or npm publish --access restricted, and it will be present in the npm registry, with restricted access. +You can then change the access permissions, if desired, with npm access or on the npmjs.com website.

+

Associating a scope with a registry

+

Scopes can be associated with a separate registry. +This allows you to seamlessly use a mix of packages from the primary npm registry and one or more private registries, such as GitHub Packages or the open source Verdaccio project.

+

You can associate a scope with a registry at login, e.g.

+
npm login --registry=http://reg.example.com --scope=@myco
+
+

Scopes have a many-to-one relationship with registries: one registry can host multiple scopes, but a scope only ever points to one registry.

+

You can also associate a scope with a registry using npm config:

+
npm config set @myco:registry=http://reg.example.com
+
+

Once a scope is associated with a registry, any npm install for a package with that scope will request packages from that registry instead. +Any +npm publish for a package name that contains the scope will be published to +that registry instead.

+

See also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/using-npm/scripts.html b/node24/node_modules/npm/docs/output/using-npm/scripts.html new file mode 100644 index 0000000000000000000000000000000000000000..43a00e0d7740524f0c8c9c7328c8d551c54108f3 --- /dev/null +++ b/node24/node_modules/npm/docs/output/using-npm/scripts.html @@ -0,0 +1,533 @@ + + +Scripts + + + + + +
+
+

+ Scripts + @11.12.1 +

+How npm handles the "scripts" field +
+ +
+

Table of contents

+ +
+ +

Description

+

The "scripts" property of your package.json file supports a number of built-in scripts and their preset life cycle events as well as arbitrary scripts. +These all can be executed by running npm run <stage>. +Pre and post commands with matching names will be run for those as well (e.g. +premyscript, +myscript, postmyscript). +Scripts from dependencies can be run with npm explore <pkg> -- npm run <stage>.

+

Pre & Post Scripts

+

To create "pre" or "post" scripts for any scripts defined in the +"scripts" section of the package.json, simply create another script +with a matching name and add "pre" or "post" to the beginning of them.

+
{
+  "scripts": {
+    "precompress": "{{ executes BEFORE the `compress` script }}",
+    "compress": "{{ run command to compress files }}",
+    "postcompress": "{{ executes AFTER `compress` script }}"
+  }
+}
+
+

In this example npm run compress would execute these scripts as described.

+

Life Cycle Scripts

+

There are some special life cycle scripts that happen only in certain situations. +These scripts happen in addition to the pre<event>, post<event>, and +<event> scripts.

+
    +
  • prepare, prepublish, prepublishOnly, prepack, postpack, dependencies
  • +
+

prepare (since npm@4.0.0)

+
    +
  • +

    Runs BEFORE the package is packed, i.e. +during npm publish and npm pack

    +
  • +
  • +

    Runs on local npm install without package arguments (runs with flags like --production or --omit=dev, but does not run when installing specific packages like npm install express)

    +
  • +
  • +

    Runs AFTER prepublishOnly and prepack, but BEFORE postpack

    +
  • +
  • +

    Runs for a package if it's being installed as a link through npm install <folder>

    +
  • +
  • +

    NOTE: If a package being installed through git contains a prepare script, its dependencies and devDependencies will be installed, and the prepare script will be run, before the package is packaged and installed.

    +
  • +
  • +

    As of npm@7 these scripts run in the background. +To see the output, run with: --foreground-scripts.

    +
  • +
  • +

    In workspaces, prepare scripts run concurrently across all packages. If you have interdependent packages where one must build before another, consider using --foreground-scripts (which can be set in .npmrc with foreground-scripts=true) to run scripts sequentially, or structure your build differently.

    +
  • +
+

prepublish (DEPRECATED)

+
    +
  • Does not run during npm publish, but does run during npm ci and npm install. +See below for more info.
  • +
+

prepublishOnly

+
    +
  • Runs BEFORE the package is prepared and packed, ONLY on npm publish.
  • +
+

prepack

+
    +
  • Runs BEFORE a tarball is packed (on "npm pack", "npm publish", and when installing a git dependency).
  • +
  • NOTE: "npm run pack" is NOT the same as "npm pack". "npm run pack" is an arbitrary user defined script name, whereas, "npm pack" is a CLI defined command.
  • +
+

postpack

+
    +
  • Runs AFTER the tarball has been generated but before it is moved to its final destination (if at all, publish does not save the tarball locally)
  • +
+

dependencies

+
    +
  • Runs AFTER any operations that modify the node_modules directory IF changes occurred.
  • +
  • Does NOT run in global mode
  • +
+

Prepare and Prepublish

+

Deprecation Note: prepublish

+

Since npm@1.1.71, the npm CLI has run the prepublish script for both npm publish and npm install, because it's a convenient way to prepare a package for use (some common use cases are described in the section below). +It has also turned out to be, in practice, very confusing. +As of npm@4.0.0, a new event has been introduced, prepare, that preserves this existing behavior. +A new event, prepublishOnly has been added as a transitional strategy to allow users to avoid the confusing behavior of existing npm versions and only run on npm publish (for instance, running the tests one last time to ensure they're in good shape).

+

See https://github.com/npm/npm/issues/10074 for a much lengthier justification, with further reading, for this change.

+

Use Cases

+

Use a prepare script to perform build tasks that are platform-independent and need to run before your package is used. +This includes tasks such as:

+
    +
  • Compiling TypeScript or other source code into JavaScript.
  • +
  • Creating minified versions of JavaScript source code.
  • +
  • Fetching remote resources that your package will use.
  • +
+

Running these build tasks in the prepare script ensures they happen once, in a single place, reducing complexity and variability. +Additionally, this means that:

+
    +
  • You can depend on build tools as devDependencies, and thus your users don't need to have them installed.
  • +
  • You don't need to include minifiers in your package, reducing the size for your users.
  • +
  • You don't need to rely on your users having curl or wget or other system tools on the target machines.
  • +
+

Dependencies

+

The dependencies script is run any time an npm command causes changes to the node_modules directory. +It is run AFTER the changes have been applied and the package.json and package-lock.json files have been updated.

+

Life Cycle Operation Order

+

npm cache add

+
    +
  • prepare
  • +
+

npm ci

+
    +
  • preinstall
  • +
  • install
  • +
  • postinstall
  • +
  • prepublish
  • +
  • preprepare
  • +
  • prepare
  • +
  • postprepare
  • +
+

These all run after the actual installation of modules into +node_modules, in order, with no internal actions happening in between

+

npm diff

+
    +
  • prepare
  • +
+

npm install

+

These also run when you run npm install -g <pkg-name>

+
    +
  • preinstall
  • +
  • install
  • +
  • postinstall
  • +
  • prepublish
  • +
  • preprepare
  • +
  • prepare
  • +
  • postprepare
  • +
+

If there is a binding.gyp file in the root of your package and you haven't defined your own install or preinstall scripts, npm will default the install command to compile using node-gyp via node-gyp rebuild

+

These are run from the scripts of <pkg-name>

+

npm pack

+
    +
  • prepack
  • +
  • prepare
  • +
  • postpack
  • +
+

npm publish

+
    +
  • prepublishOnly
  • +
  • prepack
  • +
  • prepare
  • +
  • postpack
  • +
  • publish
  • +
  • postpublish
  • +
+

npm rebuild

+
    +
  • preinstall
  • +
  • install
  • +
  • postinstall
  • +
  • prepare
  • +
+

prepare is only run if the current directory is a symlink (e.g. +with linked packages)

+

npm restart

+

If there is a restart script defined, these events are run; otherwise, +stop and start are both run if present, including their pre and post iterations)

+
    +
  • prerestart
  • +
  • restart
  • +
  • postrestart
  • +
+

npm run <user defined>

+
    +
  • pre<user-defined>
  • +
  • <user-defined>
  • +
  • post<user-defined>
  • +
+

npm start

+
    +
  • prestart
  • +
  • start
  • +
  • poststart
  • +
+

If there is a server.js file in the root of your package, then npm will default the start command to node server.js. +prestart and poststart will still run in this case.

+

npm stop

+
    +
  • prestop
  • +
  • stop
  • +
  • poststop
  • +
+

npm test

+
    +
  • pretest
  • +
  • test
  • +
  • posttest
  • +
+

npm version

+
    +
  • preversion
  • +
  • version
  • +
  • postversion
  • +
+

A Note on a lack of npm uninstall scripts

+

While npm v6 had uninstall lifecycle scripts, npm v7 does not. +Removal of a package can happen for a wide variety of reasons, and there's no clear way to currently give the script enough context to be useful.

+

Reasons for a package removal include:

+
    +
  • a user directly uninstalled this package
  • +
  • a user uninstalled a dependent package and so this dependency is being uninstalled
  • +
  • a user uninstalled a dependent package but another package also depends on this version
  • +
  • this version has been merged as a duplicate with another version
  • +
  • etc.
  • +
+

Due to the lack of necessary context, uninstall lifecycle scripts are not implemented and will not function.

+

Working Directory for Scripts

+

Scripts are always run from the root of the package folder, regardless of what the current working directory is when npm is invoked. +This means your scripts can reliably assume they are running in the package root.

+

If you want your script to behave differently based on the directory you were in when you ran npm, you can use the INIT_CWD environment variable, which holds the full path you were in when you ran npm run.

+

Historical Behavior in Older npm Versions

+

For npm v6 and earlier, scripts were generally run from the root of the package, but there were rare cases and bugs in older versions where this was not guaranteed. +If your package must support very old npm versions, you may wish to add a safeguard in your scripts (for example, by checking process.cwd()).

+

For more details, see:

+ +

Environment

+

Package scripts run in an environment where many pieces of information are made available regarding the setup of npm and the current state of the process.

+

path

+

If you depend on modules that define executable scripts, like test suites, then those executables will be added to the PATH for executing the scripts. +So, if your package.json has this:

+
{
+  "name" : "foo",
+  "dependencies" : {
+    "bar" : "0.1.x"
+  },
+  "scripts": {
+    "start" : "bar ./test"
+  }
+}
+
+

then you could run npm start to execute the bar script, which is exported into the node_modules/.bin directory on npm install.

+

package.json vars

+

npm sets the following environment variables from the package.json:

+
    +
  • npm_package_name - The package name
  • +
  • npm_package_version - The package version
  • +
  • npm_package_bin_* - Each executable defined in the bin field
  • +
  • npm_package_engines_* - Each engine defined in the engines field
  • +
  • npm_package_config_* - Each config value defined in the config field
  • +
  • npm_package_json - The full path to the package.json file
  • +
+

Additionally, for install scripts (preinstall, install, postinstall), npm sets these environment variables:

+
    +
  • npm_package_resolved - The resolved URL for the package
  • +
  • npm_package_integrity - The integrity hash for the package
  • +
  • npm_package_optional - Set to "true" if the package is optional
  • +
  • npm_package_dev - Set to "true" if the package is a dev dependency
  • +
  • npm_package_peer - Set to "true" if the package is a peer dependency
  • +
  • npm_package_dev_optional - Set to "true" if the package is both dev and optional
  • +
+

For example, if you had {"name":"foo", "version":"1.2.5"} in your package.json file, then your package scripts would have the npm_package_name environment variable set to "foo", and the npm_package_version set to "1.2.5". You can access these variables in your code with process.env.npm_package_name and process.env.npm_package_version.

+

Note: In npm 7 and later, most package.json fields are no longer provided as environment variables. Scripts that need access to other package.json fields should read the package.json file directly. The npm_package_json environment variable provides the path to the file for this purpose.

+

See package.json for more on package configs.

+

current lifecycle event

+

Lastly, the npm_lifecycle_event environment variable is set to whichever stage of the cycle is being executed. +So, you could have a single script used for different parts of the process which switches based on what's currently happening.

+

Objects are flattened following this format, so if you had +{"scripts":{"install":"foo.js"}} in your package.json, then you'd see this in the script:

+
process.env.npm_package_scripts_install === "foo.js"
+
+

Examples

+

For example, if your package.json contains this:

+
{
+  "scripts" : {
+    "prepare" : "scripts/build.js",
+    "test" : "scripts/test.js"
+  }
+}
+
+

then scripts/build.js will be called for the prepare stage of the lifecycle, and you can check the +npm_lifecycle_event environment variable if your script needs to behave differently in different contexts.

+

If you want to run build commands, you can do so. +This works just fine:

+
{
+  "scripts" : {
+    "prepare" : "npm run build",
+    "build" : "tsc",
+    "test" : "jest"
+  }
+}
+
+

Exiting

+

Scripts are run by passing the line as a script argument to /bin/sh on POSIX systems or cmd.exe on Windows. +You can control which shell is used by setting the script-shell configuration option.

+

If the script exits with a code other than 0, then this will abort the process.

+

Note that these script files don't have to be Node.js or even JavaScript programs. +They just have to be some kind of executable file.

+

Best Practices

+
    +
  • Don't exit with a non-zero error code unless you really mean it. +If the failure is minor or only will prevent some optional features, then it's better to just print a warning and exit successfully.
  • +
  • Try not to use scripts to do what npm can do for you. +Read through package.json to see all the things that you can specify and enable by simply describing your package appropriately. +In general, this will lead to a more robust and consistent state.
  • +
  • Inspect the env to determine where to put things. +For instance, if the NPM_CONFIG_BINROOT environment variable is set to /home/user/bin, then don't try to install executables into /usr/local/bin. +The user probably set it up that way for a reason.
  • +
  • Don't prefix your script commands with "sudo". If root permissions are required for some reason, then it'll fail with that error, and the user will sudo the npm command in question.
  • +
  • Don't use install. +Use a .gyp file for compilation, and prepare for anything else. +You should almost never have to explicitly set a preinstall or install script. +If you are doing this, please consider if there is another option. +The only valid use of install or preinstall scripts is for compilation which must be done on the target architecture.
  • +
+

See Also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/docs/output/using-npm/workspaces.html b/node24/node_modules/npm/docs/output/using-npm/workspaces.html new file mode 100644 index 0000000000000000000000000000000000000000..41a153e3cf57aa09eb4d1264a71c42ec2578542b --- /dev/null +++ b/node24/node_modules/npm/docs/output/using-npm/workspaces.html @@ -0,0 +1,352 @@ + + +Workspaces + + + + + +
+
+

+ Workspaces + @11.12.1 +

+Working with workspaces +
+ +
+

Table of contents

+ +
+ +

Description

+

Workspaces is a generic term that refers to the set of features in the npm cli that provides support for managing multiple packages from your local file system from within a singular top-level, root package.

+

This set of features makes up for a much more streamlined workflow handling linked packages from the local file system. +It automates the linking process as part of npm install and removes the need to manually use npm link in order to add references to packages that should be symlinked into the current node_modules folder.

+

We also refer to these packages being auto-symlinked during npm install as a single workspace, meaning it's a nested package within the current local file system that is explicitly defined in the package.json +workspaces configuration.

+

Defining workspaces

+

Workspaces are usually defined via the workspaces property of the package.json file, e.g:

+
{
+  "name": "my-workspaces-powered-project",
+  "workspaces": [
+    "packages/a"
+  ]
+}
+
+

Given the above package.json example living at a current working directory . that contains a folder named packages/a that itself contains a package.json inside it, defining a Node.js package, e.g:

+
.
++-- package.json
+`-- packages
+   +-- a
+   |   `-- package.json
+
+

The expected result once running npm install in this current working directory . is that the folder packages/a will get symlinked to the node_modules folder of the current working dir.

+

Below is a post npm install example, given that same previous example structure of files and folders:

+
.
++-- node_modules
+|  `-- a -> ../packages/a
++-- package-lock.json
++-- package.json
+`-- packages
+   +-- a
+   |   `-- package.json
+
+

Getting started with workspaces

+

You may automate the required steps to define a new workspace using npm init. +For example in a project that already has a package.json defined you can run:

+
npm init -w ./packages/a
+
+

This command will create the missing folders and a new package.json file (if needed) while also making sure to properly configure the +"workspaces" property of your root project package.json.

+

Adding dependencies to a workspace

+

It's possible to directly add/remove/update dependencies of your workspaces using the workspace config.

+

For example, assuming the following structure:

+
.
++-- package.json
+`-- packages
+   +-- a
+   |   `-- package.json
+   `-- b
+       `-- package.json
+
+

If you want to add a dependency named abbrev from the registry as a dependency of your workspace a, you may use the workspace config to tell the npm installer that package should be added as a dependency of the provided workspace:

+
npm install abbrev -w a
+
+

Adding a workspace as a dependency of another workspace:

+

The same approach works when adding one workspace as a dependency of another. +If you want to add workspace b as a dependency of workspace a, run:

+
npm install b -w a
+
+

npm will detect that b is a workspace and automatically symlink it rather +than fetching it from the registry. The resulting entry in workspace a's +package.json will use a standard version range:

+
{
+  "dependencies": {
+    "b": "^1.0.0"
+  }
+}
+
+

Note: other installing commands such as uninstall, ci, etc will also respect the provided workspace configuration.

+

Using workspaces

+

Given the specifics of how Node.js handles module resolution it's possible to consume any defined workspace by its declared package.json name. +Continuing from the example defined above, let's also create a Node.js script that will require the workspace a example module, e.g:

+
// ./packages/a/index.js
+module.exports = 'a'
+
+// ./lib/index.js
+const moduleA = require('a')
+console.log(moduleA) // -> a
+
+

When running it with:

+

node lib/index.js

+

This demonstrates how the nature of node_modules resolution allows for +workspaces to enable a portable workflow for requiring each workspace in such a way that is also easy to publish these nested workspaces to be consumed elsewhere.

+

Running commands in the context of workspaces

+

You can use the workspace configuration option to run commands in the context of a configured workspace. +Additionally, if your current directory is in a workspace, the workspace configuration is implicitly set, and prefix is set to the root workspace.

+

Following is a quick example on how to use the npm run command in the context of nested workspaces. +For a project containing multiple workspaces, e.g:

+
.
++-- package.json
+`-- packages
+   +-- a
+   |   `-- package.json
+   `-- b
+       `-- package.json
+
+

By running a command using the workspace option, it's possible to run the given command in the context of that specific workspace. +e.g:

+
npm run test --workspace=a
+
+

You could also run the command within the workspace.

+
cd packages/a && npm run test
+
+

Either will run the test script defined within the +./packages/a/package.json file.

+

Please note that you can also specify this argument multiple times in the command-line in order to target multiple workspaces, e.g:

+
npm run test --workspace=a --workspace=b
+
+

Or run the command for each workspace within the 'packages' folder:

+
npm run test --workspace=packages
+
+

It's also possible to use the workspaces (plural) configuration option to enable the same behavior but running that command in the context of all configured workspaces. +e.g:

+
npm run test --workspaces
+
+

Will run the test script in both ./packages/a and ./packages/b.

+

Commands will be run in each workspace in the order they appear in your package.json

+
{
+  "workspaces": [ "packages/a", "packages/b" ]
+}
+
+

Order of run is different with:

+
{
+  "workspaces": [ "packages/b", "packages/a" ]
+}
+
+

Ignoring missing scripts

+

It is not required for all of the workspaces to implement scripts run with the npm run command.

+

By running the command with the --if-present flag, npm will ignore workspaces missing target script.

+
npm run test --workspaces --if-present
+
+

See also

+
+ + +
+ + + + \ No newline at end of file diff --git a/node24/node_modules/npm/lib/cli/entry.js b/node24/node_modules/npm/lib/cli/entry.js new file mode 100644 index 0000000000000000000000000000000000000000..6965ffb7b7bd0c14d4e88db529e51af2dd69d766 --- /dev/null +++ b/node24/node_modules/npm/lib/cli/entry.js @@ -0,0 +1,72 @@ +// Separated out for easier unit testing +module.exports = async (process, validateEngines) => { + // set it here so that regardless of what happens later, we don't leak any private CLI configs to other programs + process.title = 'npm' + + // Patch the global fs module here at the app level + require('graceful-fs').gracefulify(require('node:fs')) + + const satisfies = require('semver/functions/satisfies') + const ExitHandler = require('./exit-handler.js') + const exitHandler = new ExitHandler({ process }) + const Npm = require('../npm.js') + const npm = new Npm() + exitHandler.setNpm(npm) + + // only log node and npm paths in argv initially since argv can contain sensitive info. a cleaned version will be logged later + const { log, output } = require('proc-log') + log.verbose('cli', process.argv.slice(0, 2).join(' ')) + log.info('using', 'npm@%s', npm.version) + log.info('using', 'node@%s', process.version) + + // At this point we've required a few files and can be pretty sure we don't contain invalid syntax for this version of node. + // It's possible a lazy require would, but that's unlikely enough that it's not worth catching anymore and we attach the more important exit handlers. + validateEngines.off() + exitHandler.registerUncaughtHandlers() + + // It is now safe to log a warning if they are using a version of node that is not going to fail on syntax errors but is still unsupported and untested and might not work reliably. + // This is safe to use the logger now which we want since this will show up in the error log too. + if (!satisfies(validateEngines.node, validateEngines.engines)) { + log.warn('cli', validateEngines.unsupportedMessage) + } + + // Now actually fire up npm and run the command. + // This is how to use npm programmatically: + try { + const { exec, command, args } = await npm.load() + + if (!exec) { + return exitHandler.exit() + } + + if (!command) { + output.standard(npm.usage) + process.exitCode = 1 + return exitHandler.exit() + } + + // Options are prefixed by a hyphen-minus (-, \u2d). + // Other dash-type chars look similar but are invalid. + const nonDashArgs = npm.argv.filter(a => /^[\u2010-\u2015\u2212\uFE58\uFE63\uFF0D]/.test(a)) + if (nonDashArgs.length) { + log.error( + 'arg', + 'Argument starts with non-ascii dash, this is probably invalid:', + require('@npmcli/redact').redactLog(nonDashArgs.join(', ')) + ) + } + + const execPromise = npm.exec(command, args) + + // this is async but we don't await it, since its ok if it doesnt finish before the command finishes running. + // it uses command and argv so it must be initiated here, after the command name is set + const updateNotifier = require('./update-notifier.js') + // eslint-disable-next-line promise/catch-or-return + updateNotifier(npm).then((msg) => (npm.updateNotification = msg)) + + await execPromise + return exitHandler.exit() + } catch (err) { + return exitHandler.exit(err) + } +} diff --git a/node24/node_modules/npm/lib/cli/exit-handler.js b/node24/node_modules/npm/lib/cli/exit-handler.js new file mode 100644 index 0000000000000000000000000000000000000000..dd016b5af73717275afca6bec408f669f7a99ae5 --- /dev/null +++ b/node24/node_modules/npm/lib/cli/exit-handler.js @@ -0,0 +1,168 @@ +const { log, output, META } = require('proc-log') +const { errorMessage, getExitCodeFromError } = require('../utils/error-message.js') + +class ExitHandler { + #npm = null + #process = null + #exited = false + #exitErrorMessage = false + + #noNpmError = false + + get #hasNpm () { + return !!this.#npm + } + + get #loaded () { + return !!this.#npm?.loaded + } + + get #showExitErrorMessage () { + if (!this.#loaded) { + return false + } + if (!this.#exited) { + return true + } + return this.#exitErrorMessage + } + + get #notLoadedOrExited () { + return !this.#loaded && !this.#exited + } + + setNpm (npm) { + this.#npm = npm + } + + constructor ({ process }) { + this.#process = process + this.#process.on('exit', this.#handleProcessExitAndReset) + } + + registerUncaughtHandlers () { + this.#process.on('uncaughtException', this.#handleExit) + this.#process.on('unhandledRejection', this.#handleExit) + } + + exit (err) { + this.#handleExit(err) + } + + #handleProcessExitAndReset = (code) => { + this.#handleProcessExit(code) + + // Reset all the state. This is only relevant for tests since in reality the process fully exits here. + this.#process.off('exit', this.#handleProcessExitAndReset) + this.#process.off('uncaughtException', this.#handleExit) + this.#process.off('unhandledRejection', this.#handleExit) + if (this.#loaded) { + this.#npm.unload() + } + this.#npm = null + this.#exited = false + this.#exitErrorMessage = false + } + + #handleProcessExit (code) { + const numCode = Number(code) || 0 + // Always exit w/ a non-zero code if exit handler was not called + const exitCode = this.#exited ? numCode : (numCode || 1) + this.#process.exitCode = exitCode + + if (this.#notLoadedOrExited) { + // Exit handler was not called and npm was not loaded so we have to log something + this.#logConsoleError(new Error(`Process exited unexpectedly with code: ${exitCode}`)) + return + } + + if (this.#logNoNpmError()) { + return + } + + const os = require('node:os') + log.verbose('cwd', this.#process.cwd()) + log.verbose('os', `${os.type()} ${os.release()}`) + log.verbose('node', this.#process.version) + log.verbose('npm ', `v${this.#npm.version}`) + + // only show the notification if it finished + if (typeof this.#npm.updateNotification === 'string') { + log.notice('', this.#npm.updateNotification, { [META]: true, force: true }) + } + + if (!this.#exited) { + log.error('', 'Exit handler never called!') + log.error('', 'This is an error with npm itself. Please report this error at:') + log.error('', ' ') + if (this.#npm.silent) { + output.error('') + } + } + + log.verbose('exit', exitCode) + + if (exitCode) { + log.verbose('code', exitCode) + } else { + log.info('ok') + } + + if (this.#showExitErrorMessage) { + log.error('', this.#npm.exitErrorMessage()) + } + } + + #logConsoleError (err) { + // Run our error message formatters on all errors even if we have no npm or an unloaded npm. + // This will clean the error and possible return a formatted message about EACCESS or something. + const { summary, detail } = errorMessage(err, this.#npm) + const formatted = [...new Set([...summary, ...detail].flat().filter(Boolean))].join('\n') + // If we didn't get anything from the formatted message then just display the full stack + // eslint-disable-next-line no-console + console.error(formatted === err.message ? err.stack : formatted) + } + + #logNoNpmError (err) { + if (this.#hasNpm) { + return false + } + // Make sure we only log this error once + if (!this.#noNpmError) { + this.#noNpmError = true + this.#logConsoleError( + new Error(`Exit prior to setting npm in exit handler`, err ? { cause: err } : {}) + ) + } + return true + } + + #handleExit = (err) => { + this.#exited = true + + // No npm at all + if (this.#logNoNpmError(err)) { + return this.#process.exit(this.#process.exitCode || getExitCodeFromError(err) || 1) + } + + // npm was never loaded but we still might have a config loading error or something similar that we can run through the error message formatter to give the user a clue as to what happened. + if (!this.#loaded) { + this.#logConsoleError(new Error('Exit prior to config file resolving', { cause: err })) + return this.#process.exit(this.#process.exitCode || getExitCodeFromError(err) || 1) + } + + this.#exitErrorMessage = err?.suppressError === true ? false : !!err + + // Prefer the exit code of the error, then the current process exit code, then set it to 1 if we still have an error. + // Otherwise, we call process.exit with undefined so that it can determine the final exit code + const exitCode = err?.exitCode ?? this.#process.exitCode ?? (err ? 1 : undefined) + + // explicitly call process.exit now so we don't hang on things like the update notifier + // also flush stdout/err beforehand because process.exit doesn't wait for that to happen. + this.#process.stderr.write('', () => this.#process.stdout.write('', () => { + this.#process.exit(exitCode) + })) + } +} + +module.exports = ExitHandler diff --git a/node24/node_modules/npm/lib/cli/update-notifier.js b/node24/node_modules/npm/lib/cli/update-notifier.js new file mode 100644 index 0000000000000000000000000000000000000000..a879a5d9119d44e86b0ad465ee0071f6afcffb4d --- /dev/null +++ b/node24/node_modules/npm/lib/cli/update-notifier.js @@ -0,0 +1,115 @@ +// print a banner telling the user to upgrade npm to latest but not in CI, and not if we're doing that already. + +const ciInfo = require('ci-info') +const gt = require('semver/functions/gt') +const gte = require('semver/functions/gte') +const parse = require('semver/functions/parse') +const { stat, writeFile } = require('node:fs/promises') +const { resolve } = require('node:path') + +// update check frequency +const DAILY = 1000 * 60 * 60 * 24 +const WEEKLY = DAILY * 7 + +// don't put it in the _cacache folder, just in npm's cache +const lastCheckedFile = npm => resolve(npm.flatOptions.cache, '../_update-notifier-last-checked') + +// Actual check for updates. This is a separate function so that we only load this if we are doing the actual update +const updateCheck = async (npm, spec, version, current) => { + const pacote = require('pacote') + + const mani = await pacote.manifest(`npm@${spec}`, { + // always prefer latest, even if doing --tag=whatever on the cmd + defaultTag: 'latest', + ...npm.flatOptions, + cache: false, + }).catch(() => null) + + // if pacote failed, give up + if (!mani) { + return null + } + + const latest = mani.version + + // if the current version is *greater* than latest, we're on a 'next' and should get the updates from that release train. + // Note that this isn't another http request over the network, because the packument will be cached by pacote from previous request. + if (gt(version, latest) && spec === '*') { + return updateNotifier(npm, `^${version}`) + } + + // if we already have something >= the desired spec, then we're done + if (gte(version, latest)) { + return null + } + + const chalk = npm.logChalk + + // ok! notify the user about this update they should get. + // The message is saved for printing at process exit so it will not get lost in any other messages being printed as part of the command. + const update = parse(mani.version) + const type = update.major !== current.major ? 'major' + : update.minor !== current.minor ? 'minor' + : update.patch !== current.patch ? 'patch' + : 'prerelease' + const typec = type === 'major' ? 'red' + : type === 'minor' ? 'yellow' + : 'cyan' + const message = [ + '', + `New ${chalk[typec](type)} version of npm available! ${chalk[typec](current)} -> ${chalk.blue(latest)}`, + `Changelog: ${chalk.blue(`https://github.com/npm/cli/releases/tag/v${latest}`)}`, + `To update run: ${chalk.underline(`npm install -g npm@${latest}`)}`, + '', + ].join('\n') + + return message +} + +const updateNotifier = async (npm, spec = '*') => { + // if we're on a prerelease train, then updates are coming fast check for a new one daily. + // otherwise, weekly. + const { version } = npm + const current = parse(version) + + // if we're on a beta train, always get the next beta + if (current.prerelease.length) { + spec = `^${version}` + } + + // while on a beta train, get updates daily + const duration = current.prerelease.length ? DAILY : WEEKLY + + const t = new Date(Date.now() - duration) + // if we don't have a file, then definitely check it. + const st = await stat(lastCheckedFile(npm)).catch(() => ({ mtime: t - 1 })) + + // if we've already checked within the specified duration, don't check again + if (!(t > st.mtime)) { + return null + } + + // intentional. do not await this. it's a best-effort update. + // if this fails, it's ok. + // might be using /dev/null as the cache or something weird like that. + writeFile(lastCheckedFile(npm), '').catch(() => {}) + + return updateCheck(npm, spec, version, current) +} + +module.exports = async npm => { + if ( + // opted out + !npm.config.get('update-notifier') + // global npm update + || (npm.flatOptions.global && + ['install', 'update'].includes(npm.command) && + npm.argv.some(arg => /^npm(@|$)/.test(arg))) + // CI + || ciInfo.isCI + ) { + return null + } + + return updateNotifier(npm) +} diff --git a/node24/node_modules/npm/lib/cli/validate-engines.js b/node24/node_modules/npm/lib/cli/validate-engines.js new file mode 100644 index 0000000000000000000000000000000000000000..c656a5c0013487d0279e87d071d6171fa3317d5f --- /dev/null +++ b/node24/node_modules/npm/lib/cli/validate-engines.js @@ -0,0 +1,43 @@ +// This is separate to indicate that it should contain code we expect to work in all versions of node >= 6. +// This is a best effort to catch syntax errors to give users a good error message if they are using a node version that doesn't allow syntax we are using such as private properties, etc. +// This file is linted with ecmaVersion=6 so we don't use invalid syntax, which is set in the .eslintrc.local.json file + +const { engines: { node: engines }, version } = require('../../package.json') +const npm = `v${version}` + +module.exports = (process, getCli) => { + const node = process.version + + const unsupportedMessage = `npm ${npm} does not support Node.js ${node}. This version of npm supports the following node versions: \`${engines}\`. You can find the latest version at https://nodejs.org/.` + + const brokenMessage = `ERROR: npm ${npm} is known not to run on Node.js ${node}. This version of npm supports the following node versions: \`${engines}\`. You can find the latest version at https://nodejs.org/.` + + // coverage ignored because this is only hit in very unsupported node versions and it's a best effort attempt to show something nice in those cases + /* istanbul ignore next */ + const syntaxErrorHandler = (err) => { + if (err instanceof SyntaxError) { + // eslint-disable-next-line no-console + console.error(`${brokenMessage}\n\nERROR:`) + // eslint-disable-next-line no-console + console.error(err) + return process.exit(1) + } + throw err + } + + process.on('uncaughtException', syntaxErrorHandler) + process.on('unhandledRejection', syntaxErrorHandler) + + // require this only after setting up the error handlers + const cli = getCli() + return cli(process, { + node, + npm, + engines, + unsupportedMessage, + off: () => { + process.off('uncaughtException', syntaxErrorHandler) + process.off('unhandledRejection', syntaxErrorHandler) + }, + }) +} diff --git a/node24/node_modules/npm/lib/commands/access.js b/node24/node_modules/npm/lib/commands/access.js new file mode 100644 index 0000000000000000000000000000000000000000..21e5cd12253f7f94db12b8b1a1bc3b59eec69c08 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/access.js @@ -0,0 +1,226 @@ +const libnpmaccess = require('libnpmaccess') +const npa = require('npm-package-arg') +const { output } = require('proc-log') +const pkgJson = require('@npmcli/package-json') +const localeCompare = require('@isaacs/string-locale-compare')('en') +const { otplease } = require('../utils/auth.js') +const getIdentity = require('../utils/get-identity.js') +const BaseCommand = require('../base-cmd.js') + +const commands = [ + 'get', + 'grant', + 'list', + 'revoke', + 'set', +] + +const setCommands = [ + 'status=public', + 'status=private', + 'mfa=none', + 'mfa=publish', + 'mfa=automation', + '2fa=none', + '2fa=publish', + '2fa=automation', +] + +class Access extends BaseCommand { + static description = 'Set access level on published packages' + static name = 'access' + static params = [ + 'json', + 'otp', + 'registry', + ] + + static usage = [ + 'list packages [||] []', + 'list collaborators [ []]', + 'get status []', + 'set status=public|private []', + 'set mfa=none|publish|automation []', + 'grant []', + 'revoke []', + ] + + static async completion (opts) { + const argv = opts.conf.argv.remain + if (argv.length === 2) { + return commands + } + + if (argv.length === 3) { + switch (argv[2]) { + case 'grant': + return ['read-only', 'read-write'] + case 'revoke': + return [] + case 'list': + case 'ls': + return ['packages', 'collaborators'] + case 'get': + return ['status'] + case 'set': + return setCommands + default: + throw new Error(argv[2] + ' not recognized') + } + } + } + + async exec ([cmd, subcmd, ...args]) { + if (!cmd) { + throw this.usageError() + } + if (!commands.includes(cmd)) { + throw this.usageError(`${cmd} is not a valid access command`) + } + // All commands take at least one more parameter so we can do this check up front + if (!subcmd) { + throw this.usageError() + } + + switch (cmd) { + case 'grant': + if (!['read-only', 'read-write'].includes(subcmd)) { + throw this.usageError('grant must be either `read-only` or `read-write`') + } + if (!args[0]) { + throw this.usageError('`` argument is required') + } + return this.#grant(subcmd, args[0], args[1]) + case 'revoke': + return this.#revoke(subcmd, args[0]) + case 'list': + case 'ls': + if (subcmd === 'packages') { + return this.#listPackages(args[0], args[1]) + } + if (subcmd === 'collaborators') { + return this.#listCollaborators(args[0], args[1]) + } + throw this.usageError(`list ${subcmd} is not a valid access command`) + case 'get': + if (subcmd !== 'status') { + throw this.usageError(`get ${subcmd} is not a valid access command`) + } + return this.#getStatus(args[0]) + case 'set': + if (!setCommands.includes(subcmd)) { + throw this.usageError(`set ${subcmd} is not a valid access command`) + } + return this.#set(subcmd, args[0]) + } + } + + async #grant (permissions, scope, pkg) { + await otplease(this.npm, this.npm.flatOptions, async (opts) => { + await libnpmaccess.setPermissions(scope, pkg, permissions, opts) + }) + } + + async #revoke (scope, pkg) { + await otplease(this.npm, this.npm.flatOptions, async (opts) => { + await libnpmaccess.removePermissions(scope, pkg, opts) + }) + } + + async #listPackages (owner, pkg) { + if (!owner) { + owner = await getIdentity(this.npm, this.npm.flatOptions) + } + const pkgs = await libnpmaccess.getPackages(owner, this.npm.flatOptions) + this.#output(pkgs, pkg) + } + + async #listCollaborators (pkg, user) { + const pkgName = await this.#getPackage(pkg, false) + const collabs = await libnpmaccess.getCollaborators(pkgName, this.npm.flatOptions) + this.#output(collabs, user) + } + + async #getStatus (pkg) { + const pkgName = await this.#getPackage(pkg, false) + const visibility = await libnpmaccess.getVisibility(pkgName, this.npm.flatOptions) + this.#output({ [pkgName]: visibility.public ? 'public' : 'private' }) + } + + async #set (subcmd, pkg) { + const [subkey, subval] = subcmd.split('=') + switch (subkey) { + case 'mfa': + case '2fa': + return this.#setMfa(pkg, subval) + case 'status': + return this.#setStatus(pkg, subval) + } + } + + async #setMfa (pkg, level) { + const pkgName = await this.#getPackage(pkg, false) + await otplease(this.npm, this.npm.flatOptions, (opts) => { + return libnpmaccess.setMfa(pkgName, level, opts) + }) + } + + async #setStatus (pkg, status) { + // only scoped packages can have their access changed + const pkgName = await this.#getPackage(pkg, true) + if (status === 'private') { + status = 'restricted' + } + await otplease(this.npm, this.npm.flatOptions, (opts) => { + return libnpmaccess.setAccess(pkgName, status, opts) + }) + return this.#getStatus(pkgName) + } + + async #getPackage (name, requireScope) { + if (!name) { + try { + const { content } = await pkgJson.normalize(this.npm.prefix) + name = content.name + } catch (err) { + if (err.code === 'ENOENT') { + throw Object.assign(new Error('no package name given and no package.json found'), { + code: 'ENOENT', + }) + } else { + throw err + } + } + } + + const spec = npa(name) + if (requireScope && !spec.scope) { + throw this.usageError('This command is only available for scoped packages.') + } + return name + } + + #output (items, limiter) { + const outputs = {} + const lookup = { + __proto__: null, + read: 'read-only', + write: 'read-write', + } + for (const item in items) { + const val = items[item] + outputs[item] = lookup[val] || val + } + if (this.npm.config.get('json')) { + output.buffer(outputs) + } else { + for (const item of Object.keys(outputs).sort(localeCompare)) { + if (!limiter || limiter === item) { + output.standard(`${item}: ${outputs[item]}`) + } + } + } + } +} + +module.exports = Access diff --git a/node24/node_modules/npm/lib/commands/adduser.js b/node24/node_modules/npm/lib/commands/adduser.js new file mode 100644 index 0000000000000000000000000000000000000000..3e1ab40b64b004e4a814f4a4088b8f6baf42e158 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/adduser.js @@ -0,0 +1,50 @@ +const { log, output } = require('proc-log') +const { redactLog: replaceInfo } = require('@npmcli/redact') +const auth = require('../utils/auth.js') +const BaseCommand = require('../base-cmd.js') + +class AddUser extends BaseCommand { + static description = 'Add a registry user account' + static name = 'adduser' + static params = [ + 'registry', + 'scope', + 'auth-type', + ] + + async exec () { + const scope = this.npm.config.get('scope') + let registry = this.npm.config.get('registry') + + if (scope) { + const scopedRegistry = this.npm.config.get(`${scope}:registry`) + const cliRegistry = this.npm.config.get('registry', 'cli') + if (scopedRegistry && !cliRegistry) { + registry = scopedRegistry + } + } + + const creds = this.npm.config.getCredentialsByURI(registry) + + log.notice('', `Log in on ${replaceInfo(registry)}`) + + const { message, newCreds } = await auth.adduser(this.npm, { + ...this.npm.flatOptions, + creds, + registry, + }) + + this.npm.config.delete('_token', 'user') // prevent legacy pollution + this.npm.config.setCredentialsByURI(registry, newCreds) + + if (scope) { + this.npm.config.set(scope + ':registry', registry, 'user') + } + + await this.npm.config.save('user') + + output.standard(message) + } +} + +module.exports = AddUser diff --git a/node24/node_modules/npm/lib/commands/audit.js b/node24/node_modules/npm/lib/commands/audit.js new file mode 100644 index 0000000000000000000000000000000000000000..c446e812cfd8e48d21bdfec1b2bcf27fab099f90 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/audit.js @@ -0,0 +1,122 @@ +const npmAuditReport = require('npm-audit-report') +const ArboristWorkspaceCmd = require('../arborist-cmd.js') +const auditError = require('../utils/audit-error.js') +const { log, output } = require('proc-log') +const reifyFinish = require('../utils/reify-finish.js') +const VerifySignatures = require('../utils/verify-signatures.js') + +class Audit extends ArboristWorkspaceCmd { + static description = 'Run a security audit' + static name = 'audit' + static params = [ + 'audit-level', + 'dry-run', + 'force', + 'json', + 'package-lock-only', + 'package-lock', + 'omit', + 'include', + 'foreground-scripts', + 'ignore-scripts', + 'include-attestations', + ...super.params, + ] + + static usage = ['[fix|signatures]'] + + static async completion (opts) { + const argv = opts.conf.argv.remain + + if (argv.length === 2) { + return ['fix', 'signatures'] + } + + switch (argv[2]) { + case 'fix': + case 'signatures': + return [] + default: + throw Object.assign(new Error(`${argv[2]} not recognized`), { + code: 'EUSAGE', + }) + } + } + + async exec (args) { + if (args[0] === 'signatures') { + await this.auditSignatures() + } else { + await this.auditAdvisories(args) + } + } + + async auditAdvisories (args) { + const fix = args[0] === 'fix' + if (this.npm.config.get('package-lock') === false && fix) { + throw this.usageError('fix cannot be used without a package-lock') + } + const reporter = this.npm.config.get('json') ? 'json' : 'detail' + const Arborist = require('@npmcli/arborist') + const opts = { + ...this.npm.flatOptions, + audit: true, + path: this.npm.prefix, + reporter, + workspaces: this.workspaceNames, + } + + const arb = new Arborist(opts) + await arb.audit({ fix }) + if (fix) { + await reifyFinish(this.npm, arb) + } else { + // will throw if there's an error, because this is an audit command + auditError(this.npm, arb.auditReport) + const result = npmAuditReport(arb.auditReport, { + ...opts, + chalk: this.npm.chalk, + }) + process.exitCode = process.exitCode || result.exitCode + output.standard(result.report) + } + } + + async auditSignatures () { + if (this.npm.global) { + throw Object.assign( + new Error('`npm audit signatures` does not support global packages'), { + code: 'EAUDITGLOBAL', + } + ) + } + + log.verbose('audit', 'loading installed dependencies') + const Arborist = require('@npmcli/arborist') + const opts = { + ...this.npm.flatOptions, + path: this.npm.prefix, + workspaces: this.workspaceNames, + } + + const arb = new Arborist(opts) + const tree = await arb.loadActual() + let filterSet = new Set() + if (opts.workspaces && opts.workspaces.length) { + filterSet = + arb.workspaceDependencySet( + tree, + opts.workspaces, + this.npm.flatOptions.includeWorkspaceRoot + ) + } else if (!this.npm.flatOptions.workspacesEnabled) { + filterSet = + arb.excludeWorkspacesDependencySet(tree) + } + + const verify = new VerifySignatures(tree, filterSet, this.npm, { ...opts }) + await verify.run() + } +} + +module.exports = Audit diff --git a/node24/node_modules/npm/lib/commands/bugs.js b/node24/node_modules/npm/lib/commands/bugs.js new file mode 100644 index 0000000000000000000000000000000000000000..11af01e582e7cb04cb7a567ed18a1d8064c9ff3f --- /dev/null +++ b/node24/node_modules/npm/lib/commands/bugs.js @@ -0,0 +1,34 @@ +const PackageUrlCmd = require('../package-url-cmd.js') + +class Bugs extends PackageUrlCmd { + static description = 'Report bugs for a package in a web browser' + static name = 'bugs' + + getUrl (spec, mani) { + if (mani.bugs) { + if (typeof mani.bugs === 'string') { + return mani.bugs + } + + if (typeof mani.bugs === 'object' && mani.bugs.url) { + return mani.bugs.url + } + + if (typeof mani.bugs === 'object' && mani.bugs.email) { + return `mailto:${mani.bugs.email}` + } + } + + // try to get it from the repo, if possible + const info = this.hostedFromMani(mani) + const infoUrl = info?.bugs() + if (infoUrl) { + return infoUrl + } + + // just send them to the website, hopefully that has some info! + return `https://www.npmjs.com/package/${mani.name}` + } +} + +module.exports = Bugs diff --git a/node24/node_modules/npm/lib/commands/cache.js b/node24/node_modules/npm/lib/commands/cache.js new file mode 100644 index 0000000000000000000000000000000000000000..f6e85e0d8ab936a7404f7a6bb0cafd828329f540 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/cache.js @@ -0,0 +1,363 @@ +const fs = require('node:fs/promises') +const { join } = require('node:path') +const cacache = require('cacache') +const pacote = require('pacote') +const semver = require('semver') +const npa = require('npm-package-arg') +const jsonParse = require('json-parse-even-better-errors') +const localeCompare = require('@isaacs/string-locale-compare')('en') +const { log, output } = require('proc-log') +const PkgJson = require('@npmcli/package-json') +const abbrev = require('abbrev') +const BaseCommand = require('../base-cmd.js') + +const searchCachePackage = async (path, parsed, cacheKeys) => { + const searchMFH = new RegExp(`^make-fetch-happen:request-cache:.*(?', + 'clean []', + 'ls [@]', + 'verify', + 'npx ls', + 'npx rm [...]', + 'npx info ...', + ] + + static async completion (opts) { + const argv = opts.conf.argv.remain + if (argv.length === 2) { + return ['add', 'clean', 'verify', 'ls', 'npx'] + } + + // TODO - eventually... + switch (argv[2]) { + case 'verify': + case 'clean': + case 'add': + case 'ls': + return [] + } + } + + async exec (args) { + const cmd = args.shift() + switch (cmd) { + case 'rm': case 'clear': case 'clean': + return await this.clean(args) + case 'add': + return await this.add(args) + case 'verify': case 'check': + return await this.verify() + case 'ls': + return await this.ls(args) + case 'npx': + return await this.npx(args) + default: + throw this.usageError() + } + } + + // npm cache npx + async npx ([cmd, ...keys]) { + switch (cmd) { + case 'ls': + return await this.npxLs(keys) + case 'rm': + return await this.npxRm(keys) + case 'info': + return await this.npxInfo(keys) + default: + throw this.usageError() + } + } + + // npm cache clean [spec]* + async clean (args) { + // this is a derived value + const cachePath = this.npm.flatOptions.cache + if (args.length === 0) { + if (!this.npm.config.get('force')) { + throw new Error(`As of npm@5, the npm cache self-heals from corruption issues by treating integrity mismatches as cache misses. +As a result, data extracted from the cache is guaranteed to be valid. +If you want to make sure everything is consistent, use \`npm cache verify\` instead. +Deleting the cache can only make npm go slower, and is not likely to correct any problems you may be encountering! + +On the other hand, if you're debugging an issue with the installer, or race conditions that depend on the timing of writing to an empty cache, you can use \`npm install --cache /tmp/empty-cache\` to use a temporary cache instead of removing the actual one. + +If you're sure you want to delete the entire cache, rerun this command with --force.`) + } + return fs.rm(cachePath, { recursive: true, force: true }) + } + for (const key of args) { + let entry + try { + entry = await cacache.get(cachePath, key) + } catch { + log.warn('cache', `Not Found: ${key}`) + break + } + output.standard(`Deleted: ${key}`) + await cacache.rm.entry(cachePath, key) + // XXX this could leave other entries without content! + await cacache.rm.content(cachePath, entry.integrity) + } + } + + // npm cache add ... + // npm cache add ... + // npm cache add ... + // npm cache add ... + async add (args) { + log.silly('cache add', 'args', args) + if (args.length === 0) { + throw this.usageError('First argument to `add` is required') + } + + await Promise.all(args.map(async spec => { + log.silly('cache add', 'spec', spec) + // we ask pacote for the thing, and then just throw the data away so that it tee-pipes it into the cache like it does for a normal request. + await pacote.tarball.stream(spec, stream => { + stream.resume() + return stream.promise() + }, { ...this.npm.flatOptions, _isRoot: true }) + + await pacote.manifest(spec, { + ...this.npm.flatOptions, + fullMetadata: true, + _isRoot: true, + }) + })) + } + + async verify () { + // this is a derived value + const cachePath = this.npm.flatOptions.cache + const prefix = cachePath.indexOf(process.env.HOME) === 0 + ? `~${cachePath.slice(process.env.HOME.length)}` + : cachePath + const stats = await cacache.verify(cachePath) + output.standard(`Cache verified and compressed (${prefix})`) + output.standard(`Content verified: ${stats.verifiedContent} (${stats.keptSize} bytes)`) + if (stats.badContentCount) { + output.standard(`Corrupted content removed: ${stats.badContentCount}`) + } + if (stats.reclaimedCount) { + output.standard(`Content garbage-collected: ${stats.reclaimedCount} (${stats.reclaimedSize} bytes)`) + } + if (stats.missingContent) { + output.standard(`Missing content: ${stats.missingContent}`) + } + output.standard(`Index entries: ${stats.totalEntries}`) + output.standard(`Finished in ${stats.runTime.total / 1000}s`) + } + + // npm cache ls [ ...] + async ls (specs) { + // This is a derived value + const { cache: cachePath } = this.npm.flatOptions + const cacheKeys = Object.keys(await cacache.ls(cachePath)) + if (specs.length > 0) { + // get results for each package spec specified + const results = new Set() + for (const spec of specs) { + const parsed = npa(spec) + if (parsed.rawSpec !== '' && parsed.type === 'tag') { + throw this.usageError('Cannot list cache keys for a tagged package.') + } + const keySet = await searchCachePackage(cachePath, parsed, cacheKeys) + for (const key of keySet) { + results.add(key) + } + } + [...results].sort(localeCompare).forEach(key => output.standard(key)) + return + } + cacheKeys.sort(localeCompare).forEach(key => output.standard(key)) + } + + async #npxCache (keys = []) { + // This is a derived value + const { npxCache } = this.npm.flatOptions + let dirs + try { + dirs = await fs.readdir(npxCache, { encoding: 'utf-8' }) + } catch { + output.standard('npx cache does not exist') + return + } + const cache = {} + const { default: pMap } = await import('p-map') + await pMap(dirs, async e => { + const pkgPath = join(npxCache, e) + cache[e] = { + hash: e, + path: pkgPath, + valid: false, + } + try { + const pkgJson = await PkgJson.load(pkgPath) + cache[e].package = pkgJson.content + cache[e].valid = true + } catch { + // Defaults to not valid already + } + }, { concurrency: 20 }) + if (!keys.length) { + return cache + } + const result = {} + const abbrevs = abbrev(Object.keys(cache)) + for (const key of keys) { + if (!abbrevs[key]) { + throw this.usageError(`Invalid npx key ${key}`) + } + result[abbrevs[key]] = cache[abbrevs[key]] + } + return result + } + + async npxLs () { + const cache = await this.#npxCache() + for (const key in cache) { + const { hash, valid, package: pkg } = cache[key] + let result = `${hash}:` + if (!valid) { + result = `${result} (empty/invalid)` + } else if (pkg?._npx) { + result = `${result} ${pkg._npx.packages.join(', ')}` + } else { + result = `${result} (unknown)` + } + output.standard(result) + } + } + + async npxRm (keys) { + if (!keys.length) { + if (!this.npm.config.get('force')) { + throw this.usageError('Please use --force to remove entire npx cache') + } + const { npxCache } = this.npm.flatOptions + if (!this.npm.config.get('dry-run')) { + return fs.rm(npxCache, { recursive: true, force: true }) + } + } + + const cache = await this.#npxCache(keys) + for (const key in cache) { + const { path: cachePath } = cache[key] + output.standard(`Removing npx key at ${cachePath}`) + if (!this.npm.config.get('dry-run')) { + await fs.rm(cachePath, { recursive: true }) + } + } + } + + async npxInfo (keys) { + const chalk = this.npm.chalk + if (!keys.length) { + throw this.usageError() + } + const cache = await this.#npxCache(keys) + const Arborist = require('@npmcli/arborist') + for (const key in cache) { + const { hash, path, package: pkg } = cache[key] + let valid = cache[key].valid + const results = [] + try { + if (valid) { + const arb = new Arborist({ path }) + const tree = await arb.loadVirtual() + if (pkg._npx) { + results.push('packages:') + for (const p of pkg._npx.packages) { + const parsed = npa(p) + if (parsed.type === 'directory') { + // in the tree the spec is relative, even if the dependency spec is absolute, so we can't find it by name or spec. + results.push(`- ${chalk.cyan(p)}`) + } else { + results.push(`- ${chalk.cyan(p)} (${chalk.blue(tree.children.get(parsed.name).pkgid)})`) + } + } + } else { + results.push('packages: (unknown)') + results.push(`dependencies:`) + for (const dep in pkg.dependencies) { + const child = tree.children.get(dep) + if (child.isLink) { + results.push(`- ${chalk.cyan(child.realpath)}`) + } else { + results.push(`- ${chalk.cyan(child.pkgid)}`) + } + } + } + } + } catch (ex) { + valid = false + } + const v = valid ? chalk.green('valid') : chalk.red('invalid') + output.standard(`${v} npx cache entry with key ${chalk.blue(hash)}`) + output.standard(`location: ${chalk.blue(path)}`) + if (valid) { + output.standard(results.join('\n')) + } + output.standard() + } + } +} + +module.exports = Cache diff --git a/node24/node_modules/npm/lib/commands/ci.js b/node24/node_modules/npm/lib/commands/ci.js new file mode 100644 index 0000000000000000000000000000000000000000..782beea2d4b60c8117ebe5e99068840eb9d40bfb --- /dev/null +++ b/node24/node_modules/npm/lib/commands/ci.js @@ -0,0 +1,127 @@ +const reifyFinish = require('../utils/reify-finish.js') +const runScript = require('@npmcli/run-script') +const fs = require('node:fs/promises') +const path = require('node:path') +const { log, time } = require('proc-log') +const validateLockfile = require('../utils/validate-lockfile.js') +const ArboristWorkspaceCmd = require('../arborist-cmd.js') +const getWorkspaces = require('../utils/get-workspaces.js') + +class CI extends ArboristWorkspaceCmd { + static description = 'Clean install a project' + static name = 'ci' + + // These are in the order they will show up in when running "-h" + static params = [ + 'install-strategy', + 'legacy-bundling', + 'global-style', + 'omit', + 'include', + 'strict-peer-deps', + 'foreground-scripts', + 'ignore-scripts', + 'allow-git', + 'audit', + 'bin-links', + 'fund', + 'dry-run', + ...super.params, + ] + + async exec () { + if (this.npm.global) { + throw Object.assign(new Error('`npm ci` does not work for global packages'), { + code: 'ECIGLOBAL', + }) + } + + const dryRun = this.npm.config.get('dry-run') + const ignoreScripts = this.npm.config.get('ignore-scripts') + const where = this.npm.prefix + const Arborist = require('@npmcli/arborist') + const opts = { + ...this.npm.flatOptions, + packageLock: true, // npm ci should never skip lock files + path: where, + save: false, // npm ci should never modify the lockfile or package.json + workspaces: this.workspaceNames, + } + + // generate an inventory from the virtual tree in the lockfile + const virtualArb = new Arborist(opts) + try { + await virtualArb.loadVirtual() + } catch (err) { + log.verbose('loadVirtual', err.stack) + const msg = + 'The `npm ci` command can only install with an existing package-lock.json or\n' + + 'npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or\n' + + 'later to generate a package-lock.json file, then try again.' + throw this.usageError(msg) + } + const virtualInventory = new Map(virtualArb.virtualTree.inventory) + + // Now we make our real Arborist. + // We need a new one because the virtual tree fromt the lockfile can have extraneous dependencies in it that won't install on this platform + const arb = new Arborist(opts) + await arb.buildIdealTree() + + // Verifies that the packages from the ideal tree will match the same versions that are present in the virtual tree (lock file). + const errors = validateLockfile(virtualInventory, arb.idealTree.inventory) + if (errors.length) { + throw this.usageError( + '`npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. ' + + 'Please update your lock file with `npm install` before continuing.\n\n' + + errors.join('\n') + ) + } + + if (!dryRun) { + const workspacePaths = await getWorkspaces([], { + path: this.npm.localPrefix, + includeWorkspaceRoot: true, + }) + + // Only remove node_modules after we've successfully loaded the virtual tree and validated the lockfile + await time.start('npm-ci:rm', async () => { + return await Promise.all([...workspacePaths.values()].map(async modulePath => { + const fullPath = path.join(modulePath, 'node_modules') + // get the list of entries so we can skip the glob for performance + const entries = await fs.readdir(fullPath, null).catch(() => []) + return Promise.all(entries.map(folder => { + return fs.rm(path.join(fullPath, folder), { force: true, recursive: true }) + })) + })) + }) + } + + await arb.reify(opts) + + // run the same set of scripts that `npm install` runs. + if (!ignoreScripts) { + const scripts = [ + 'preinstall', + 'install', + 'postinstall', + 'prepublish', // XXX should we remove this finally?? + 'preprepare', + 'prepare', + 'postprepare', + ] + const scriptShell = this.npm.config.get('script-shell') || undefined + for (const event of scripts) { + await runScript({ + path: where, + args: [], + scriptShell, + stdio: 'inherit', + event, + }) + } + } + await reifyFinish(this.npm, arb) + } +} + +module.exports = CI diff --git a/node24/node_modules/npm/lib/commands/completion.js b/node24/node_modules/npm/lib/commands/completion.js new file mode 100644 index 0000000000000000000000000000000000000000..7d664d291acc1eb78c0863d1c7bb50358bee0b33 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/completion.js @@ -0,0 +1,329 @@ +// Each command has a completion function that takes an options object and a cb The callback gets called with an error and an array of possible completions. +// The options object is built up based on the environment variables set by zsh or bash when calling a function for completion, based on the cursor position and the command line thus far. +// These are: +// COMP_CWORD: the index of the "word" in the command line being completed +// COMP_LINE: the full command line thus far as a string +// COMP_POINT: the cursor index at the point of triggering completion +// +// We parse the command line with nopt, like npm does, and then create an options object containing: +// words: array of words in the command line +// w: the index of the word being completed (ie, COMP_CWORD) +// word: the word being completed +// line: the COMP_LINE +// lineLength +// point: the COMP_POINT, usually equal to line length, but not always, eg if the user has pressed the left-arrow to complete an earlier word +// partialLine: the line up to the point +// partialWord: the word being completed (which might be ''), up to the point +// conf: a nopt parse of the command line +// +// When the implementation completion method returns its list of strings, and arrays of strings, we filter that by any that start with the partialWord, since only those can possibly be valid matches. +// +// Matches are wrapped with ' to escape them, if necessary, and then printed one per line for the shell completion method to consume in IFS=$'\n' mode as an array. + +const fs = require('node:fs/promises') +const nopt = require('nopt') +const { resolve } = require('node:path') +const { output } = require('proc-log') +const Npm = require('../npm.js') +const { definitions, shorthands } = require('@npmcli/config/lib/definitions') +const { commands, aliases, deref } = require('../utils/cmd-list.js') +const { isWindowsShell } = require('../utils/is-windows.js') +const BaseCommand = require('../base-cmd.js') + +const fileExists = (file) => fs.stat(file).then(s => s.isFile()).catch(() => false) + +class Completion extends BaseCommand { + static description = 'Tab Completion for npm' + static name = 'completion' + // Completion command uses args differently - they represent the command line being completed, not actual arguments to this command, so we use an empty definitions object to prevent flag validation + static definitions = [] + + // completion for the completion command + static async completion (opts) { + if (opts.w > 2) { + return + } + + const [bashExists, zshExists] = await Promise.all([ + fileExists(resolve(process.env.HOME, '.bashrc')), + fileExists(resolve(process.env.HOME, '.zshrc')), + ]) + const out = [] + if (zshExists) { + out.push(['>>', '~/.zshrc']) + } + + if (bashExists) { + out.push(['>>', '~/.bashrc']) + } + + return out + } + + async exec (args) { + if (isWindowsShell) { + const msg = 'npm completion supported only in MINGW / Git bash on Windows' + throw Object.assign(new Error(msg), { + code: 'ENOTSUP', + }) + } + + const { COMP_CWORD, COMP_LINE, COMP_POINT, COMP_FISH } = process.env + + // if the COMP_* isn't in the env, then just dump the script. + if (COMP_CWORD === undefined || COMP_LINE === undefined || COMP_POINT === undefined) { + return dumpScript(resolve(this.npm.npmRoot, 'lib', 'utils', 'completion.sh')) + } + + // ok we're actually looking at the envs and outputting the suggestions get the partial line and partial word, if the point isn't at the end. + // ie, tabbing at: npm foo b|ar + const w = +COMP_CWORD + const line = COMP_LINE + // Use COMP_LINE to get words if args doesn't include flags (e.g., in tests) + const hasFlags = line.includes(' -') && !args.some(arg => arg.startsWith('-')) + const words = (hasFlags ? line.split(/\s+/) : args).map(unescape) + const word = words[w] || '' + const point = +COMP_POINT + const partialLine = line.slice(0, point) + const partialWords = words.slice(0, w) + + // figure out where in that last word the point is. + const partialWordRaw = args[w] || '' + let i = partialWordRaw.length + while (partialWordRaw.slice(0, i) !== partialLine.slice(-1 * i) && i > 0) { + i-- + } + + const partialWord = unescape(partialWordRaw.slice(0, i)) + partialWords.push(partialWord) + + const opts = { + isFish: COMP_FISH === 'true', + words, + w, + word, + line, + lineLength: line.length, + point, + partialLine, + partialWords, + partialWord, + raw: args, + } + + // try to find the npm command and subcommand early for flag completion this helps with custom command definitions from subcommands + const types = Object.entries(definitions).reduce((acc, [key, def]) => { + acc[key] = def.type + return acc + }, {}) + const parsed = opts.conf = + nopt(types, shorthands, partialWords.slice(0, -1), 0) + const cmd = parsed.argv.remain[1] + const subCmd = parsed.argv.remain[2] + + if (partialWords.slice(0, -1).indexOf('--') === -1) { + if (word && word.charAt(0) === '-') { + return this.wrap(opts, configCompl(opts, cmd, subCmd, this.npm)) + } + + if (words[w - 1] && + words[w - 1].charAt(0) === '-' && + !isFlag(words[w - 1], cmd, subCmd, this.npm)) { + // awaiting a value for a non-bool config. + // don't even try to do this for now + return this.wrap(opts, configValueCompl(opts)) + } + } + + // check if there's a command already. + if (!cmd) { + return this.wrap(opts, cmdCompl(opts, this.npm)) + } + + Object.keys(parsed).forEach(k => this.npm.config.set(k, parsed[k])) + + // at this point, if words[1] is some kind of npm command, then complete on it. + // otherwise, do nothing + try { + const { completion } = Npm.cmd(cmd) + if (completion) { + const comps = await completion(opts, this.npm) + return this.wrap(opts, comps) + } + } catch { + // it wasn't a valid command, so do nothing + } + } + + // The command should respond with an array. + // Loop over that, wrapping quotes around any that have spaces, and writing them to stdout. + // If any of the items are arrays, then join them with a space. + // e.g. returning ['a', 'b c', ['d', 'e']] would allow it to expand to: 'a', 'b c', or 'd' 'e' + wrap (opts, compls) { + if (opts.partialWord) { + compls = compls.filter(c => c.startsWith(opts.partialWord)) + } + + if (compls.length > 0) { + output.standard(compls.join('\n')) + } + } +} + +const dumpScript = async (p) => { + const d = (await fs.readFile(p, 'utf8')).replace(/^#!.*?\n/, '') + await new Promise((res, rej) => { + let done = false + process.stdout.on('error', er => { + if (done) { + return + } + + done = true + + // Darwin is a pain sometimes. + // + // This is necessary because the "source" or "." program in bash on OS X closes its file argument before reading from it, meaning that you get exactly 1 write, which will work most of the time, and will always raise an EPIPE. + // + // Really, one should not be tossing away EPIPE errors, or any errors, so casually. + // But, without this, `. <(npm completion)` can never ever work on OS X. + // TODO Ignoring coverage, see 'non EPIPE errors cause failures' test. + /* istanbul ignore next */ + if (er.errno === 'EPIPE') { + res() + } else { + rej(er) + } + }) + + process.stdout.write(d, () => { + if (done) { + return + } + + done = true + res() + }) + }) +} + +const unescape = w => w.charAt(0) === '\'' ? w.replace(/^'|'$/g, '') + : w.replace(/\\ /g, ' ') + +// Helper to get custom definitions from a command/subcommand +const getCustomDefinitions = (cmd, subCmd) => { + if (!cmd) { + return [] + } + + try { + const command = Npm.cmd(cmd) + + // Check if the command has subcommands + if (subCmd && command.subcommands && command.subcommands[subCmd]) { + const subcommand = command.subcommands[subCmd] + // All subcommands have definitions + return subcommand.definitions + } + + // Check if the command itself has definitions + if (command.definitions) { + return command.definitions + } + } catch { + // Command not found or no definitions + } + + return [] +} + +// Helper to get all config names including aliases from custom definitions +const getCustomConfigNames = (customDefs) => { + const names = new Set() + for (const def of customDefs) { + names.add(def.key) + if (def.alias && Array.isArray(def.alias)) { + def.alias.forEach(a => names.add(a)) + } + } + return [...names] +} + +// the current word has a dash. +// Return the config names with the same number of dashes as the current word has. +const configCompl = (opts, cmd, subCmd, npm) => { + const word = opts.word + const split = word.match(/^(-+)((?:no-)*)(.*)$/) + const dashes = split[1] + const no = split[2] + + // Get custom definitions from the command/subcommand + const customDefs = getCustomDefinitions(cmd, subCmd, npm) + const customNames = getCustomConfigNames(customDefs) + + // If there are custom definitions, return only those (new feature) + // Otherwise, return empty array (historical behavior - no global flag completion) + if (customNames.length > 0) { + const flags = customNames.filter(name => isFlag(name, cmd, subCmd, npm)) + return customNames.map(c => dashes + c) + .concat(flags.map(f => dashes + (no || 'no-') + f)) + } + + return [] +} + +// expand with the valid values of various config values. +// not yet implemented. +const configValueCompl = () => [] + +// check if the thing is a flag or not. +const isFlag = (word, cmd, subCmd, npm) => { + // shorthands never take args. + const split = word.match(/^(-*)((?:no-)+)?(.*)$/) + const no = split[2] + const conf = split[3] + + // Check custom definitions first + const customDefs = getCustomDefinitions(cmd, subCmd, npm) + + // Check if conf is in custom definitions or is an alias + let customDef = customDefs.find(d => d.key === conf) + if (!customDef) { + // Check if conf is an alias for any of the custom definitions + for (const def of customDefs) { + if (def.alias && Array.isArray(def.alias) && def.alias.includes(conf)) { + customDef = def + break + } + } + } + + if (customDef) { + const { type } = customDef + return no || + type === Boolean || + (Array.isArray(type) && type.includes(Boolean)) + } + + // No custom definitions found, should not reach here in normal flow since configCompl returns empty array when no custom defs exist + return false +} + +// complete against the npm commands +// if they all resolve to the same thing, just return the thing it already is +const cmdCompl = (opts) => { + const allCommands = commands.concat(Object.keys(aliases)) + const matches = allCommands.filter(c => c.startsWith(opts.partialWord)) + if (!matches.length) { + return matches + } + + const derefs = new Set([...matches.map(c => deref(c))]) + if (derefs.size === 1) { + return [...derefs] + } + + return allCommands +} + +module.exports = Completion diff --git a/node24/node_modules/npm/lib/commands/config.js b/node24/node_modules/npm/lib/commands/config.js new file mode 100644 index 0000000000000000000000000000000000000000..5c5f1db40bda28cc5731f7237e5a31e81b981432 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/config.js @@ -0,0 +1,414 @@ +const { mkdir, readFile, writeFile } = require('node:fs/promises') +const { dirname, resolve } = require('node:path') +const { spawn } = require('node:child_process') +const { EOL } = require('node:os') +const localeCompare = require('@isaacs/string-locale-compare')('en') +const pkgJson = require('@npmcli/package-json') +const { defaults, definitions, nerfDarts, proxyEnv } = require('@npmcli/config/lib/definitions') +const { log, output } = require('proc-log') +const BaseCommand = require('../base-cmd.js') +const { redact } = require('@npmcli/redact') + +// These are the config values to swap with "protected". +// It does not catch every single sensitive thing a user may put in the npmrc file but it gets the common ones. +// This is distinct from nerfDarts because that is used to validate valid configs during "npm config set", and folks may have old invalid entries lying around in a config file that we still want to protect when running "npm config list" +// This is a more general list of values to consider protected. +// You cannot "npm config get" them, and they will not display during "npm config list" +const protected = [ + 'auth', + 'authToken', + 'certfile', + 'email', + 'keyfile', + 'password', + 'username', +] + +// take an array of `[key, value, k2=v2, k3, v3, ...]` and turn into { key: value, k2: v2, k3: v3 } +const keyValues = args => { + const kv = {} + for (let i = 0; i < args.length; i++) { + const arg = args[i].split('=') + const key = arg.shift() + const val = arg.length ? arg.join('=') + : i < args.length - 1 ? args[++i] + : '' + kv[key.trim()] = val.trim() + } + return kv +} + +const isProtected = (k) => { + // _password + if (k.startsWith('_')) { + return true + } + if (protected.includes(k)) { + return true + } + // //localhost:8080/:_password + if (k.startsWith('//')) { + if (k.includes(':_')) { + return true + } + // //registry:_authToken or //registry:authToken + for (const p of protected) { + if (k.endsWith(`:${p}`) || k.endsWith(`:_${p}`)) { + return true + } + } + } + return false +} + +// Private fields are either protected or they can redacted info +const isPrivate = (k, v) => isProtected(k) || redact(v) !== v + +const displayVar = (k, v) => + `${k} = ${isProtected(k, v) ? '(protected)' : JSON.stringify(redact(v))}` + +class Config extends BaseCommand { + static description = 'Manage the npm configuration files' + static name = 'config' + static usage = [ + 'set = [= ...]', + 'get [ [ ...]]', + 'delete [ ...]', + 'list [--json]', + 'edit', + 'fix', + ] + + static params = [ + 'json', + 'global', + 'editor', + 'location', + 'long', + ] + + static ignoreImplicitWorkspace = false + + static skipConfigValidation = true + + static async completion (opts) { + const argv = opts.conf.argv.remain + if (argv[1] !== 'config') { + argv.unshift('config') + } + + if (argv.length === 2) { + const cmds = ['get', 'set', 'delete', 'ls', 'rm', 'edit', 'fix'] + if (opts.partialWord !== 'l') { + cmds.push('list') + } + + return cmds + } + + const action = argv[2] + switch (action) { + case 'set': + // TODO: complete with valid values, if possible. + if (argv.length > 3) { + return [] + } + + // fallthrough + /* eslint no-fallthrough:0 */ + case 'get': + case 'delete': + case 'rm': + return Object.keys(definitions) + case 'edit': + case 'list': + case 'ls': + case 'fix': + default: + return [] + } + } + + async exec ([action, ...args]) { + switch (action) { + case 'set': + await this.set(args) + break + case 'get': + await this.get(args) + break + case 'delete': + case 'rm': + case 'del': + await this.del(args) + break + case 'list': + case 'ls': + await (this.npm.flatOptions.json ? this.listJson() : this.list()) + break + case 'edit': + await this.edit() + break + case 'fix': + await this.fix() + break + default: + throw this.usageError() + } + } + + async set (args) { + if (!args.length) { + throw this.usageError() + } + + const where = this.npm.flatOptions.location + for (const [key, val] of Object.entries(keyValues(args))) { + log.info('config', 'set %j %j', key, val) + const baseKey = key.split(':').pop() + if (!this.npm.config.definitions[baseKey] && !nerfDarts.includes(baseKey)) { + throw new Error(`\`${baseKey}\` is not a valid npm option`) + } + const deprecated = this.npm.config.definitions[baseKey]?.deprecated + if (deprecated) { + throw new Error( + `The \`${baseKey}\` option is deprecated, and cannot be set in this way${deprecated}` + ) + } + + if (val === '') { + this.npm.config.delete(key, where) + } else { + this.npm.config.set(key, val, where) + } + + if (!this.npm.config.validate(where)) { + log.warn('config', 'omitting invalid config values') + } + } + + await this.npm.config.save(where) + } + + async get (keys) { + if (!keys.length) { + return this.list() + } + + const out = [] + for (const key of keys) { + const val = this.npm.config.get(key) + if (isPrivate(key, val)) { + throw new Error(`The ${key} option is protected, and cannot be retrieved in this way`) + } + + const pref = keys.length > 1 ? `${key}=` : '' + out.push(pref + val) + } + output.standard(out.join('\n')) + } + + async del (keys) { + if (!keys.length) { + throw this.usageError() + } + + const where = this.npm.flatOptions.location + for (const key of keys) { + this.npm.config.delete(key, where) + } + await this.npm.config.save(where) + } + + async edit () { + const ini = require('ini') + const e = this.npm.flatOptions.editor + const where = this.npm.flatOptions.location + const file = this.npm.config.data.get(where).source + + // save first, just to make sure it's synced up + // this also removes all the comments from the last time we edited it. + await this.npm.config.save(where) + + const data = ( + await readFile(file, 'utf8').catch(() => '') + ).replace(/\r\n/g, '\n') + const entries = Object.entries(defaults) + const defData = entries.reduce((str, [key, val]) => { + const obj = { [key]: val } + const i = ini.stringify(obj) + .replace(/\r\n/g, '\n') // normalizes output from ini.stringify + .replace(/\n$/m, '') + .replace(/^/g, '; ') + .replace(/\n/g, '\n; ') + .split('\n') + return str + '\n' + i + }, '') + + const tmpData = `;;;; +; npm ${where}config file: ${file} +; this is a simple ini-formatted file +; lines that start with semi-colons are comments +; run \`npm help 7 config\` for documentation of the various options +; +; Configs like \`@scope:registry\` map a scope to a given registry url. +; +; Configs like \`///:_authToken\` are auth that is restricted +; to the registry host specified. + +${data.split('\n').sort(localeCompare).join('\n').trim()} + +;;;; +; all available options shown below with default values +;;;; + +${defData} +`.split('\n').join(EOL) + await mkdir(dirname(file), { recursive: true }) + await writeFile(file, tmpData, 'utf8') + await new Promise((res, rej) => { + const [bin, ...args] = e.split(/\s+/) + const editor = spawn(bin, [...args, file], { stdio: 'inherit' }) + editor.on('exit', (code) => { + if (code) { + return rej(new Error(`editor process exited with code: ${code}`)) + } + return res() + }) + }) + } + + async fix () { + let problems + + try { + this.npm.config.validate() + return // if validate doesn't throw we have nothing to do + } catch (err) { + // coverage skipped because we don't need to test rethrowing errors + // istanbul ignore next + if (err.code !== 'ERR_INVALID_AUTH') { + throw err + } + + problems = err.problems + } + + if (!this.npm.config.isDefault('location')) { + problems = problems.filter((problem) => { + return problem.where === this.npm.config.get('location') + }) + } + + this.npm.config.repair(problems) + const locations = [] + + output.standard('The following configuration problems have been repaired:\n') + const summary = problems.map(({ action, from, to, key, where }) => { + // coverage disabled for else branch because it is intentionally omitted + // istanbul ignore else + if (action === 'rename') { + // we keep track of which configs were modified here so we know what to save later + locations.push(where) + return `~ \`${from}\` renamed to \`${to}\` in ${where} config` + } else if (action === 'delete') { + locations.push(where) + return `- \`${key}\` deleted from ${where} config` + } + }).join('\n') + output.standard(summary) + + return await Promise.all(locations.map((location) => this.npm.config.save(location))) + } + + async list () { + const msg = [] + // long does not have a flattener + const long = this.npm.config.get('long') + for (const [where, { data, source }] of this.npm.config.data.entries()) { + if (where === 'default' && !long) { + continue + } + + const entries = Object.entries(data).sort(([a], [b]) => localeCompare(a, b)) + if (!entries.length) { + continue + } + + msg.push(`; "${where}" config from ${source}`, '') + for (const [k, v] of entries) { + const display = displayVar(k, v) + const src = this.npm.config.find(k) + msg.push(src === where ? display : `; ${display} ; overridden by ${src}`) + msg.push() + } + msg.push('') + } + + if (!long) { + const envVars = [] + + const foundEnvVars = new Set() + for (const key of Object.keys(process.env)) { + const lowerKey = key.toLowerCase() + if (proxyEnv.includes(lowerKey) && !foundEnvVars.has(lowerKey)) { + foundEnvVars.add(lowerKey) + envVars.push(`; ${key} = ${JSON.stringify(process.env[key])}`) + } + } + + if (envVars.length > 0) { + msg.push('; environment-related config', '') + msg.push(...envVars) + msg.push('') + } + + msg.push( + `; node bin location = ${process.execPath}`, + `; node version = ${process.version}`, + `; npm local prefix = ${this.npm.localPrefix}`, + `; npm version = ${this.npm.version}`, + `; cwd = ${process.cwd()}`, + `; HOME = ${process.env.HOME}`, + '; Run `npm config ls -l` to show all defaults.' + ) + msg.push('') + } + + if (!this.npm.global) { + const { content } = await pkgJson.normalize(this.npm.prefix).catch(() => ({ content: {} })) + + if (content.publishConfig) { + for (const key in content.publishConfig) { + this.npm.config.checkUnknown('publishConfig', key) + } + const pkgPath = resolve(this.npm.prefix, 'package.json') + msg.push(`; "publishConfig" from ${pkgPath}`) + msg.push('; This set of config values will be used at publish-time.', '') + const entries = Object.entries(content.publishConfig) + .sort(([a], [b]) => localeCompare(a, b)) + for (const [k, value] of entries) { + msg.push(displayVar(k, value)) + } + msg.push('') + } + } + + output.standard(msg.join('\n').trim()) + } + + async listJson () { + const publicConf = {} + for (const key in this.npm.config.list[0]) { + const value = this.npm.config.get(key) + if (isPrivate(key, value)) { + continue + } + + publicConf[key] = value + } + output.buffer(publicConf) + } +} + +module.exports = Config diff --git a/node24/node_modules/npm/lib/commands/dedupe.js b/node24/node_modules/npm/lib/commands/dedupe.js new file mode 100644 index 0000000000000000000000000000000000000000..da5e2db56145426c2bef73f50cbe221b017f11ea --- /dev/null +++ b/node24/node_modules/npm/lib/commands/dedupe.js @@ -0,0 +1,51 @@ +const reifyFinish = require('../utils/reify-finish.js') +const ArboristWorkspaceCmd = require('../arborist-cmd.js') + +// dedupe duplicated packages, or find them in the tree +class Dedupe extends ArboristWorkspaceCmd { + static description = 'Reduce duplication in the package tree' + static name = 'dedupe' + static params = [ + 'install-strategy', + 'legacy-bundling', + 'global-style', + 'strict-peer-deps', + 'package-lock', + 'omit', + 'include', + 'ignore-scripts', + 'allow-git', + 'audit', + 'bin-links', + 'fund', + 'dry-run', + ...super.params, + ] + + async exec () { + if (this.npm.global) { + const er = new Error('`npm dedupe` does not work in global mode.') + er.code = 'EDEDUPEGLOBAL' + throw er + } + + const dryRun = this.npm.config.get('dry-run') + const where = this.npm.prefix + const Arborist = require('@npmcli/arborist') + const opts = { + ...this.npm.flatOptions, + path: where, + dryRun, + // Saving during dedupe would only update if one of your direct dependencies was also duplicated somewhere in your tree. + // It would be confusing if running this were to also update your package.json. + // In order to reduce potential confusion we set this to false. + save: false, + workspaces: this.workspaceNames, + } + const arb = new Arborist(opts) + await arb.dedupe(opts) + await reifyFinish(this.npm, arb) + } +} + +module.exports = Dedupe diff --git a/node24/node_modules/npm/lib/commands/deprecate.js b/node24/node_modules/npm/lib/commands/deprecate.js new file mode 100644 index 0000000000000000000000000000000000000000..4f5f98dd40ec8dea49410fe6a1c40ecc31fba6a9 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/deprecate.js @@ -0,0 +1,86 @@ +const npmFetch = require('npm-registry-fetch') +const { otplease } = require('../utils/auth.js') +const npa = require('npm-package-arg') +const { log } = require('proc-log') +const semver = require('semver') +const getIdentity = require('../utils/get-identity.js') +const libaccess = require('libnpmaccess') +const BaseCommand = require('../base-cmd.js') + +class Deprecate extends BaseCommand { + static description = 'Deprecate a version of a package' + static name = 'deprecate' + static usage = [' '] + static params = [ + 'registry', + 'otp', + 'dry-run', + ] + + static ignoreImplicitWorkspace = true + + static async completion (opts, npm) { + if (opts.conf.argv.remain.length > 1) { + return [] + } + + const username = await getIdentity(npm, npm.flatOptions) + const packages = await libaccess.getPackages(username, npm.flatOptions) + return Object.keys(packages) + .filter((name) => + packages[name] === 'write' && + (opts.conf.argv.remain.length === 0 || + name.startsWith(opts.conf.argv.remain[0]))) + } + + async exec ([pkg, msg]) { + // msg == null because '' is a valid value, it indicates undeprecate + if (!pkg || msg == null) { + throw this.usageError() + } + + // fetch the data and make sure it exists. + const p = npa(pkg) + const spec = p.rawSpec === '*' ? '*' : p.fetchSpec + + if (semver.validRange(spec, true) === null) { + throw new Error(`invalid version range: ${spec}`) + } + + const uri = '/' + p.escapedName + const packument = await npmFetch.json(uri, { + ...this.npm.flatOptions, + spec: p, + query: { write: true }, + }) + + const versions = Object.keys(packument.versions) + .filter(v => semver.satisfies(v, spec, { includePrerelease: true })) + + const dryRun = this.npm.config.get('dry-run') + + if (versions.length) { + for (const v of versions) { + packument.versions[v].deprecated = msg + if (msg) { + log.notice(`deprecating ${packument.name}@${v} with message "${msg}"`) + } else { + log.notice(`undeprecating ${packument.name}@${v}`) + } + } + if (!dryRun) { + return otplease(this.npm, this.npm.flatOptions, opts => npmFetch(uri, { + ...opts, + spec: p, + method: 'PUT', + body: packument, + ignoreBody: true, + })) + } + } else { + log.warn('deprecate', 'No version found for', p.rawSpec) + } + } +} + +module.exports = Deprecate diff --git a/node24/node_modules/npm/lib/commands/diff.js b/node24/node_modules/npm/lib/commands/diff.js new file mode 100644 index 0000000000000000000000000000000000000000..f8a3ac52559b223ee6d183beb6cd663f6b2cc646 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/diff.js @@ -0,0 +1,280 @@ +const { resolve } = require('node:path') +const semver = require('semver') +const libnpmdiff = require('libnpmdiff') +const npa = require('npm-package-arg') +const pacote = require('pacote') +const pickManifest = require('npm-pick-manifest') +const { log, output } = require('proc-log') +const pkgJson = require('@npmcli/package-json') +const BaseCommand = require('../base-cmd.js') + +class Diff extends BaseCommand { + static description = 'The registry diff command' + static name = 'diff' + static usage = [ + '[...]', + ] + + static params = [ + 'diff', + 'diff-name-only', + 'diff-unified', + 'diff-ignore-all-space', + 'diff-no-prefix', + 'diff-src-prefix', + 'diff-dst-prefix', + 'diff-text', + 'global', + 'tag', + 'workspace', + 'workspaces', + 'include-workspace-root', + ] + + static workspaces = true + static ignoreImplicitWorkspace = false + + async exec (args) { + const specs = this.npm.config.get('diff').filter(d => d) + if (specs.length > 2) { + throw this.usageError(`Can't use more than two --diff arguments.`) + } + + // execWorkspaces may have set this already + if (!this.prefix) { + this.prefix = this.npm.prefix + } + + // this is the "top" directory, one up from node_modules in global mode we have to walk one up from globalDir because our node_modules is sometimes under ./lib, and in global mode we're only ever walking through node_modules (because we will have been given a package name already) + if (this.npm.global) { + this.top = resolve(this.npm.globalDir, '..') + } else { + this.top = this.prefix + } + + const [a, b] = await this.retrieveSpecs(specs) + log.info('diff', { src: a, dst: b }) + + const res = await libnpmdiff([a, b], { + ...this.npm.flatOptions, + diffFiles: args, + where: this.top, + }) + return output.standard(res) + } + + async execWorkspaces (args) { + await this.setWorkspaces() + for (const workspacePath of this.workspacePaths) { + this.top = workspacePath + this.prefix = workspacePath + await this.exec(args) + } + } + + // get the package name from the packument at `path` + // throws if no packument is present OR if it does not have `name` attribute + async packageName () { + let name + try { + const { content: pkg } = await pkgJson.normalize(this.prefix) + name = pkg.name + } catch { + log.verbose('diff', 'could not read project dir package.json') + } + + if (!name) { + throw this.usageError('Needs multiple arguments to compare or run from a project dir.') + } + + return name + } + + async retrieveSpecs ([a, b]) { + if (a && b) { + const specs = await this.convertVersionsToSpecs([a, b]) + return this.findVersionsByPackageName(specs) + } + + // no arguments, defaults to comparing cwd to its latest published registry version + if (!a) { + const pkgName = await this.packageName() + return [ + `${pkgName}@${this.npm.config.get('tag')}`, + `file:${this.prefix}`, + ] + } + + // single argument, used to compare wanted versions of an installed dependency or to compare the cwd to a published version + let noPackageJson + let pkgName + try { + const { content: pkg } = await pkgJson.normalize(this.prefix) + pkgName = pkg.name + } catch { + log.verbose('diff', 'could not read project dir package.json') + noPackageJson = true + } + + const missingPackageJson = + this.usageError('Needs multiple arguments to compare or run from a project dir.') + + // using a valid semver range, that means it should just diff the cwd against a published version to the registry using the same project name and the provided semver range + if (semver.validRange(a)) { + if (!pkgName) { + throw missingPackageJson + } + return [ + `${pkgName}@${a}`, + `file:${this.prefix}`, + ] + } + + // when using a single package name as arg and it's part of the current install tree, then retrieve the current installed version and compare it against the same value `npm outdated` would suggest you to update to + const spec = npa(a) + if (spec.registry) { + let actualTree + let node + const Arborist = require('@npmcli/arborist') + try { + const opts = { + ...this.npm.flatOptions, + path: this.top, + } + const arb = new Arborist(opts) + actualTree = await arb.loadActual(opts) + node = actualTree && + actualTree.inventory.query('name', spec.name) + .values().next().value + } catch { + log.verbose('diff', 'failed to load actual install tree') + } + + if (!node || !node.name || !node.package || !node.package.version) { + if (noPackageJson) { + throw missingPackageJson + } + return [ + `${spec.name}@${spec.fetchSpec}`, + `file:${this.prefix}`, + ] + } + + const tryRootNodeSpec = () => + (actualTree && actualTree.edgesOut.get(spec.name) || {}).spec + + const tryAnySpec = () => { + for (const edge of node.edgesIn) { + return edge.spec + } + } + + const aSpec = `file:${node.realpath}` + + // finds what version of the package to compare against + // if an exact version or tag was passed than it should use that + // otherwise, work from the top of the arborist tree to find the original semver range declared in the package that depends on the package. + let bSpec + if (spec.rawSpec !== '*') { + bSpec = spec.rawSpec + } else { + const bTargetVersion = + tryRootNodeSpec() + || tryAnySpec() + + // figure out what to compare against + // follows same logic to npm outdated "Wanted" results + const packument = await pacote.packument(spec, { + ...this.npm.flatOptions, + preferOnline: true, + _isRoot: true, + }) + bSpec = pickManifest( + packument, + bTargetVersion, + { ...this.npm.flatOptions } + ).version + } + + return [ + `${spec.name}@${aSpec}`, + `${spec.name}@${bSpec}`, + ] + } else if (spec.type === 'directory') { + return [ + `file:${spec.fetchSpec}`, + `file:${this.prefix}`, + ] + } else { + throw this.usageError(`Spec type ${spec.type} not supported.`) + } + } + + async convertVersionsToSpecs ([a, b]) { + const semverA = semver.validRange(a) + const semverB = semver.validRange(b) + + // both specs are semver versions, assume current project dir name + if (semverA && semverB) { + let pkgName + try { + const { content: pkg } = await pkgJson.normalize(this.prefix) + pkgName = pkg.name + } catch { + log.verbose('diff', 'could not read project dir package.json') + } + + if (!pkgName) { + throw this.usageError('Needs to be run from a project dir in order to diff two versions.') + } + + return [`${pkgName}@${a}`, `${pkgName}@${b}`] + } + + // otherwise uses the name from the other arg to figure out the spec.name of what to compare + if (!semverA && semverB) { + return [a, `${npa(a).name}@${b}`] + } + + if (semverA && !semverB) { + return [`${npa(b).name}@${a}`, b] + } + + // no valid semver ranges used + return [a, b] + } + + async findVersionsByPackageName (specs) { + let actualTree + const Arborist = require('@npmcli/arborist') + try { + const opts = { + ...this.npm.flatOptions, + path: this.top, + } + const arb = new Arborist(opts) + actualTree = await arb.loadActual(opts) + } catch { + log.verbose('diff', 'failed to load actual install tree') + } + + return specs.map(i => { + const spec = npa(i) + if (spec.rawSpec !== '*') { + return i + } + + const node = actualTree + && actualTree.inventory.query('name', spec.name) + .values().next().value + + const res = !node || !node.package || !node.package.version + ? spec.fetchSpec + : `file:${node.realpath}` + + return `${spec.name}@${res}` + }) + } +} + +module.exports = Diff diff --git a/node24/node_modules/npm/lib/commands/dist-tag.js b/node24/node_modules/npm/lib/commands/dist-tag.js new file mode 100644 index 0000000000000000000000000000000000000000..e21c86f2affee058ab4465ed336e6ad9cde43808 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/dist-tag.js @@ -0,0 +1,207 @@ +const npa = require('npm-package-arg') +const npmFetch = require('npm-registry-fetch') +const semver = require('semver') +const { log, output } = require('proc-log') +const { otplease } = require('../utils/auth.js') +const pkgJson = require('@npmcli/package-json') +const BaseCommand = require('../base-cmd.js') + +class DistTag extends BaseCommand { + static description = 'Modify package distribution tags' + static params = ['workspace', 'workspaces', 'include-workspace-root'] + static name = 'dist-tag' + static usage = [ + 'add []', + 'rm ', + 'ls []', + ] + + static workspaces = true + static ignoreImplicitWorkspace = false + + static async completion (opts) { + const argv = opts.conf.argv.remain + if (argv.length === 2) { + return ['add', 'rm', 'ls'] + } + + switch (argv[2]) { + default: + return [] + } + } + + async exec ([cmdName, pkg, tag]) { + const opts = { + ...this.npm.flatOptions, + } + + if (['add', 'a', 'set', 's'].includes(cmdName)) { + return this.add(pkg, tag, opts) + } + + if (['rm', 'r', 'del', 'd', 'remove'].includes(cmdName)) { + return this.remove(pkg, tag, opts) + } + + if (['ls', 'l', 'sl', 'list'].includes(cmdName)) { + return this.list(pkg, opts) + } + + if (!pkg) { + // when only using the pkg name the default behavior should be listing the existing tags + return this.list(cmdName, opts) + } else { + throw this.usageError() + } + } + + async execWorkspaces ([cmdName, pkg, tag]) { + // cmdName is some form of list + // pkg is one of: + // - unset + // - . + // - .@version + if (['ls', 'l', 'sl', 'list'].includes(cmdName) && (!pkg || pkg === '.' || /^\.@/.test(pkg))) { + return this.listWorkspaces() + } + + // pkg is unset + // cmdName is one of: + // - unset + // - . + // - .@version + if (!pkg && (!cmdName || cmdName === '.' || /^\.@/.test(cmdName))) { + return this.listWorkspaces() + } + + // anything else is just a regular dist-tag command + // so we fall back to the non-workspaces implementation + log.warn('dist-tag', 'Ignoring workspaces for specified package') + return this.exec([cmdName, pkg, tag]) + } + + async add (spec, tag, opts) { + spec = npa(spec || '') + const version = spec.rawSpec + const defaultTag = tag || this.npm.config.get('tag') + + log.verbose('dist-tag add', defaultTag, 'to', spec.name + '@' + version) + + // make sure new spec with tag is valid, this will throw if invalid + npa(`${spec.name}@${defaultTag}`) + + if (!spec.name || !version || !defaultTag) { + throw this.usageError('must provide a spec with a name and version, and a tag to add') + } + + const t = defaultTag.trim() + + if (semver.validRange(t)) { + throw new Error('Tag name must not be a valid SemVer range: ' + t) + } + + const tags = await this.fetchTags(spec, opts) + if (tags[t] === version) { + log.warn('dist-tag add', t, 'is already set to version', version) + return + } + tags[t] = version + const url = + `/-/package/${spec.escapedName}/dist-tags/${encodeURIComponent(t)}` + const reqOpts = { + ...opts, + method: 'PUT', + body: JSON.stringify(version), + headers: { + 'content-type': 'application/json', + }, + spec, + } + await otplease(this.npm, reqOpts, o => npmFetch(url, o)) + output.standard(`+${t}: ${spec.name}@${version}`) + } + + async remove (spec, tag, opts) { + spec = npa(spec || '') + log.verbose('dist-tag del', tag, 'from', spec.name) + + if (!spec.name) { + throw this.usageError() + } + + const tags = await this.fetchTags(spec, opts) + if (!tags[tag]) { + log.info('dist-tag del', tag, 'is not a dist-tag on', spec.name) + throw new Error(tag + ' is not a dist-tag on ' + spec.name) + } + const version = tags[tag] + delete tags[tag] + const url = + `/-/package/${spec.escapedName}/dist-tags/${encodeURIComponent(tag)}` + const reqOpts = { + ...opts, + method: 'DELETE', + spec, + } + await otplease(this.npm, reqOpts, o => npmFetch(url, o)) + output.standard(`-${tag}: ${spec.name}@${version}`) + } + + async list (spec, opts) { + if (!spec) { + if (this.npm.global) { + throw this.usageError() + } + const { content: { name } } = await pkgJson.normalize(this.npm.prefix) + if (!name) { + throw this.usageError() + } + + return this.list(name, opts) + } + spec = npa(spec) + + try { + const tags = await this.fetchTags(spec, opts) + const msg = + Object.keys(tags).map(k => `${k}: ${tags[k]}`).sort().join('\n') + output.standard(msg) + return tags + } catch (err) { + log.error('dist-tag ls', "Couldn't get dist-tag data for", spec) + throw err + } + } + + async listWorkspaces () { + await this.setWorkspaces() + + for (const name of this.workspaceNames) { + try { + output.standard(`${name}:`) + await this.list(npa(name), this.npm.flatOptions) + } catch { + // set the exitCode directly, but ignore the error since it will have already been logged by this.list() + process.exitCode = 1 + } + } + } + + async fetchTags (spec, opts) { + const data = await npmFetch.json( + `/-/package/${spec.escapedName}/dist-tags`, + { ...opts, 'prefer-online': true, spec } + ) + if (data && typeof data === 'object') { + delete data._etag + } + if (!data || !Object.keys(data).length) { + throw new Error('No dist-tags found for ' + spec.name) + } + + return data + } +} + +module.exports = DistTag diff --git a/node24/node_modules/npm/lib/commands/docs.js b/node24/node_modules/npm/lib/commands/docs.js new file mode 100644 index 0000000000000000000000000000000000000000..de2492833690d26e1c73592a361e2eca992ccf07 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/docs.js @@ -0,0 +1,21 @@ +const PackageUrlCmd = require('../package-url-cmd.js') + +class Docs extends PackageUrlCmd { + static description = 'Open documentation for a package in a web browser' + static name = 'docs' + + getUrl (spec, mani) { + if (mani.homepage) { + return mani.homepage + } + + const info = this.hostedFromMani(mani) + if (info) { + return info.docs() + } + + return `https://www.npmjs.com/package/${mani.name}` + } +} + +module.exports = Docs diff --git a/node24/node_modules/npm/lib/commands/doctor.js b/node24/node_modules/npm/lib/commands/doctor.js new file mode 100644 index 0000000000000000000000000000000000000000..255f71f9717683f00a4bf706abb3bfdde0bb4024 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/doctor.js @@ -0,0 +1,343 @@ +const cacache = require('cacache') +const { access, lstat, readdir, constants: { R_OK, W_OK, X_OK } } = require('node:fs/promises') +const npmFetch = require('make-fetch-happen') +const which = require('which') +const pacote = require('pacote') +const { resolve } = require('node:path') +const semver = require('semver') +const { log, output } = require('proc-log') +const ping = require('../utils/ping.js') +const { defaults } = require('@npmcli/config/lib/definitions') +const BaseCommand = require('../base-cmd.js') + +const maskLabel = mask => { + const label = [] + if (mask & R_OK) { + label.push('readable') + } + + if (mask & W_OK) { + label.push('writable') + } + + if (mask & X_OK) { + label.push('executable') + } + + return label.join(', ') +} + +const checks = [ + { + // Ping is left in as a legacy command but is listed as "connection" to make more sense to more people + groups: ['connection', 'ping', 'registry'], + title: 'Connecting to the registry', + cmd: 'checkPing', + }, { + groups: ['versions'], + title: 'Checking npm version', + cmd: 'getLatestNpmVersion', + }, { + groups: ['versions'], + title: 'Checking node version', + cmd: 'getLatestNodejsVersion', + }, { + groups: ['registry'], + title: 'Checking configured npm registry', + cmd: 'checkNpmRegistry', + }, { + groups: ['environment'], + title: 'Checking for git executable in PATH', + cmd: 'getGitPath', + }, { + groups: ['environment'], + title: 'Checking for global bin folder in PATH', + cmd: 'getBinPath', + }, { + groups: ['permissions', 'cache'], + title: 'Checking permissions on cached files (this may take awhile)', + cmd: 'checkCachePermission', + windows: false, + }, { + groups: ['permissions'], + title: 'Checking permissions on local node_modules (this may take awhile)', + cmd: 'checkLocalModulesPermission', + windows: false, + }, { + groups: ['permissions'], + title: 'Checking permissions on global node_modules (this may take awhile)', + cmd: 'checkGlobalModulesPermission', + windows: false, + }, { + groups: ['permissions'], + title: 'Checking permissions on local bin folder', + cmd: 'checkLocalBinPermission', + windows: false, + }, { + groups: ['permissions'], + title: 'Checking permissions on global bin folder', + cmd: 'checkGlobalBinPermission', + windows: false, + }, { + groups: ['cache'], + title: 'Verifying cache contents (this may take awhile)', + cmd: 'verifyCachedFiles', + windows: false, + }, + // TODO: + // group === 'dependencies'? + // - ensure arborist.loadActual() runs without errors and no invalid edges + // - ensure package-lock.json matches loadActual() + // - verify loadActual without hidden lock file matches hidden lockfile + // group === '???' + // - verify all local packages have bins linked + // What is the fix for these? +] + +class Doctor extends BaseCommand { + static description = 'Check the health of your npm environment' + static name = 'doctor' + static params = ['registry'] + static ignoreImplicitWorkspace = false + static usage = [`[${checks.flatMap(s => s.groups) + .filter((value, index, self) => self.indexOf(value) === index && value !== 'ping') + .join('] [')}]`] + + async exec (args) { + log.info('doctor', 'Running checkup') + let allOk = true + + const actions = this.actions(args) + + const chalk = this.npm.chalk + for (const { title, cmd } of actions) { + this.output(title) + // TODO when we have an in progress indicator that could go here + let result + try { + result = await this[cmd]() + this.output(`${chalk.green('Ok')}${result ? `\n${result}` : ''}\n`) + } catch (err) { + allOk = false + this.output(`${chalk.red('Not ok')}\n${chalk.cyan(err)}\n`) + } + } + + if (!allOk) { + if (this.npm.silent) { + throw new Error('Some problems found. Check logs or disable silent mode for recommendations.') + } else { + throw new Error('Some problems found. See above for recommendations.') + } + } + } + + async checkPing () { + log.info('doctor', 'Pinging registry') + try { + await ping({ ...this.npm.flatOptions, retry: false }) + return '' + } catch (er) { + if (/^E\d{3}$/.test(er.code || '')) { + throw er.code.slice(1) + ' ' + er.message + } else { + throw er.message + } + } + } + + async getLatestNpmVersion () { + log.info('doctor', 'Getting npm package information') + const latest = (await pacote.manifest('npm@latest', this.npm.flatOptions)).version + if (semver.gte(this.npm.version, latest)) { + return `current: v${this.npm.version}, latest: v${latest}` + } else { + throw `Use npm v${latest}` + } + } + + async getLatestNodejsVersion () { + // XXX get the latest in the current major as well + const current = process.version + const currentRange = `^${current}` + const url = 'https://nodejs.org/dist/index.json' + log.info('doctor', 'Getting Node.js release information') + const res = await npmFetch(url, { method: 'GET', ...this.npm.flatOptions }) + const data = await res.json() + let maxCurrent = '0.0.0' + let maxLTS = '0.0.0' + for (const { lts, version } of data) { + if (lts && semver.gt(version, maxLTS)) { + maxLTS = version + } + + if (semver.satisfies(version, currentRange) && semver.gt(version, maxCurrent)) { + maxCurrent = version + } + } + const recommended = semver.gt(maxCurrent, maxLTS) ? maxCurrent : maxLTS + if (semver.gte(process.version, recommended)) { + return `current: ${current}, recommended: ${recommended}` + } else { + throw `Use node ${recommended} (current: ${current})` + } + } + + async getBinPath () { + log.info('doctor', 'getBinPath', 'Finding npm global bin in your PATH') + if (!process.env.PATH.includes(this.npm.globalBin)) { + throw new Error(`Add ${this.npm.globalBin} to your $PATH`) + } + return this.npm.globalBin + } + + async checkCachePermission () { + return this.checkFilesPermission(this.npm.cache, true, R_OK) + } + + async checkLocalModulesPermission () { + return this.checkFilesPermission(this.npm.localDir, true, R_OK | W_OK, true) + } + + async checkGlobalModulesPermission () { + return this.checkFilesPermission(this.npm.globalDir, false, R_OK) + } + + async checkLocalBinPermission () { + return this.checkFilesPermission(this.npm.localBin, false, R_OK | W_OK | X_OK, true) + } + + async checkGlobalBinPermission () { + return this.checkFilesPermission(this.npm.globalBin, false, X_OK) + } + + async checkFilesPermission (root, shouldOwn, mask, missingOk) { + let ok = true + + try { + const uid = process.getuid() + const gid = process.getgid() + const files = new Set([root]) + for (const f of files) { + const st = await lstat(f).catch(er => { + // if it can't be missing, or if it can and the error wasn't that it was missing + if (!missingOk || er.code !== 'ENOENT') { + ok = false + log.warn('doctor', 'checkFilesPermission', 'error getting info for ' + f) + } + }) + + if (!st) { + continue + } + + if (shouldOwn && (uid !== st.uid || gid !== st.gid)) { + log.warn('doctor', 'checkFilesPermission', 'should be owner of ' + f) + ok = false + } + + if (!st.isDirectory() && !st.isFile()) { + continue + } + + try { + await access(f, mask) + } catch { + ok = false + const msg = `Missing permissions on ${f} (expect: ${maskLabel(mask)})` + log.error('doctor', 'checkFilesPermission', msg) + continue + } + + if (st.isDirectory()) { + const entries = await readdir(f).catch(() => { + ok = false + log.warn('doctor', 'checkFilesPermission', 'error reading directory ' + f) + return [] + }) + for (const entry of entries) { + files.add(resolve(f, entry)) + } + } + } + } finally { + if (!ok) { + throw ( + `Check the permissions of files in ${root}` + + (shouldOwn ? ' (should be owned by current user)' : '') + ) + } else { + return '' + } + } + } + + async getGitPath () { + log.info('doctor', 'Finding git in your PATH') + return await which('git').catch(er => { + log.warn('doctor', 'getGitPath', er) + throw new Error("Install git and ensure it's in your PATH.") + }) + } + + async verifyCachedFiles () { + log.info('doctor', 'verifyCachedFiles', 'Verifying the npm cache') + + const stats = await cacache.verify(this.npm.flatOptions.cache) + const { badContentCount, reclaimedCount, missingContent, reclaimedSize } = stats + if (badContentCount || reclaimedCount || missingContent) { + if (badContentCount) { + log.warn('doctor', 'verifyCachedFiles', `Corrupted content removed: ${badContentCount}`) + } + + if (reclaimedCount) { + log.warn( + 'doctor', + 'verifyCachedFiles', + `Content garbage-collected: ${reclaimedCount} (${reclaimedSize} bytes)` + ) + } + + if (missingContent) { + log.warn('doctor', 'verifyCachedFiles', `Missing content: ${missingContent}`) + } + + log.warn('doctor', 'verifyCachedFiles', 'Cache issues have been fixed') + } + log.info( + 'doctor', + 'verifyCachedFiles', + `Verification complete. Stats: ${JSON.stringify(stats, null, 2)}` + ) + return `verified ${stats.verifiedContent} tarballs` + } + + async checkNpmRegistry () { + if (this.npm.flatOptions.registry !== defaults.registry) { + throw `Try \`npm config set registry=${defaults.registry}\`` + } else { + return `using default registry (${defaults.registry})` + } + } + + output (...args) { + // TODO display layer should do this + if (!this.npm.silent) { + output.standard(...args) + } + } + + actions (params) { + return checks.filter(subcmd => { + if (process.platform === 'win32' && subcmd.windows === false) { + return false + } + if (params.length) { + return params.some(param => subcmd.groups.includes(param)) + } + return true + }) + } +} + +module.exports = Doctor diff --git a/node24/node_modules/npm/lib/commands/edit.js b/node24/node_modules/npm/lib/commands/edit.js new file mode 100644 index 0000000000000000000000000000000000000000..4308af2cfcf0f346d7e393cdca69c8bba5bb3127 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/edit.js @@ -0,0 +1,62 @@ +const { resolve } = require('node:path') +const { lstat } = require('node:fs/promises') +const cp = require('node:child_process') +const completion = require('../utils/installed-shallow.js') +const BaseCommand = require('../base-cmd.js') + +const splitPackageNames = (path) => path.split('/') +// combine scoped parts + .reduce((parts, part) => { + if (parts.length === 0) { + return [part] + } + + const lastPart = parts[parts.length - 1] + // check if previous part is the first part of a scoped package + if (lastPart[0] === '@' && !lastPart.includes('/')) { + parts[parts.length - 1] += '/' + part + } else { + parts.push(part) + } + + return parts + }, []) + .join('/node_modules/') + .replace(/(\/node_modules)+/, '/node_modules') + +// npm edit +// open the package folder in the $EDITOR +class Edit extends BaseCommand { + static description = 'Edit an installed package' + static name = 'edit' + static usage = ['[/...]'] + static params = ['editor'] + static ignoreImplicitWorkspace = false + + static async completion (opts, npm) { + return completion(npm, opts) + } + + async exec (args) { + if (args.length !== 1) { + throw this.usageError() + } + + const path = splitPackageNames(args[0]) + const dir = resolve(this.npm.dir, path) + + await lstat(dir) + await new Promise((res, rej) => { + const [bin, ...spawnArgs] = this.npm.config.get('editor').split(/\s+/) + const editor = cp.spawn(bin, [...spawnArgs, dir], { stdio: 'inherit' }) + editor.on('exit', async (code) => { + if (code) { + return rej(new Error(`editor process exited with code: ${code}`)) + } + await this.npm.exec('rebuild', [dir]).then(res).catch(rej) + }) + }) + } +} + +module.exports = Edit diff --git a/node24/node_modules/npm/lib/commands/exec.js b/node24/node_modules/npm/lib/commands/exec.js new file mode 100644 index 0000000000000000000000000000000000000000..9b59199498c93c0755189a569e3cbb71f135650d --- /dev/null +++ b/node24/node_modules/npm/lib/commands/exec.js @@ -0,0 +1,107 @@ +const { resolve } = require('node:path') +const libexec = require('libnpmexec') +const BaseCommand = require('../base-cmd.js') + +class Exec extends BaseCommand { + static description = 'Run a command from a local or remote npm package' + static params = [ + 'package', + 'call', + 'workspace', + 'workspaces', + 'include-workspace-root', + ] + + static name = 'exec' + static usage = [ + '-- [@] [args...]', + '--package=[@] -- [args...]', + '-c \' [args...]\'', + '--package=foo -c \' [args...]\'', + ] + + static workspaces = true + static ignoreImplicitWorkspace = false + static isShellout = true + + async exec (args) { + return this.callExec(args) + } + + async execWorkspaces (args) { + await this.setWorkspaces() + + for (const [name, path] of this.workspaces) { + const locationMsg = + `in workspace ${this.npm.chalk.green(name)} at location:\n${this.npm.chalk.dim(path)}` + await this.callExec(args, { name, locationMsg, runPath: path }) + } + } + + async callExec (args, { name, locationMsg, runPath } = {}) { + let localBin = this.npm.localBin + let pkgPath = this.npm.localPrefix + + // This is where libnpmexec will actually run the scripts from + if (!runPath) { + runPath = process.cwd() + } else { + // We have to consider if the workspace has its own separate versions libnpmexec will walk up to localDir after looking here + localBin = resolve(this.npm.localDir, name, 'node_modules', '.bin') + // We also need to look for `bin` entries in the workspace package.json + // libnpmexec will NOT look in the project root for the bin entry + pkgPath = runPath + } + + const call = this.npm.config.get('call') + let globalPath + const { + flatOptions, + globalBin, + globalDir, + chalk, + } = this.npm + const scriptShell = this.npm.config.get('script-shell') || undefined + const packages = this.npm.config.get('package') + const yes = this.npm.config.get('yes') + // --prefix sets both of these to the same thing, meaning the global prefix is invalid (i.e. no lib/node_modules). + // This is not a trivial thing to untangle and fix so we work around it here. + if (this.npm.localPrefix !== this.npm.globalPrefix) { + globalPath = resolve(globalDir, '..') + } + + if (call && args.length) { + throw this.usageError() + } + + return libexec({ + ...flatOptions, + // we explicitly set packageLockOnly to false because if it's true when we try to install a missing package, we won't actually install it + packageLockOnly: false, + // what the user asked to run args[0] is run by default + args: [...args], // copy args so they don't get mutated + // specify a custom command to be run instead of args[0] + call, + chalk, + // where to look for bins globally, if a file matches call or args[0] it is called + globalBin, + // where to look for packages globally, if a package matches call or args[0] it is called + globalPath, + // where to look for bins locally, if a file matches call or args[0] it is called + localBin, + locationMsg, + // packages that need to be installed + packages, + // path where node_modules is + path: this.npm.localPrefix, + // where to look for package.json#bin entries first + pkgPath, + // cwd to run from + runPath, + scriptShell, + yes, + }) + } +} + +module.exports = Exec diff --git a/node24/node_modules/npm/lib/commands/explain.js b/node24/node_modules/npm/lib/commands/explain.js new file mode 100644 index 0000000000000000000000000000000000000000..2539b264fdf3eb6db0a0cd39ccc5ea6241185c7f --- /dev/null +++ b/node24/node_modules/npm/lib/commands/explain.js @@ -0,0 +1,128 @@ +const { explainNode } = require('../utils/explain-dep.js') +const npa = require('npm-package-arg') +const semver = require('semver') +const { relative, resolve } = require('node:path') +const validName = require('validate-npm-package-name') +const { output } = require('proc-log') +const ArboristWorkspaceCmd = require('../arborist-cmd.js') + +class Explain extends ArboristWorkspaceCmd { + static description = 'Explain installed packages' + static name = 'explain' + static usage = [''] + static params = [ + 'json', + 'workspace', + ] + + static ignoreImplicitWorkspace = false + + static async completion (opts, npm) { + const completion = require('../utils/installed-deep.js') + return completion(npm, opts) + } + + async exec (args) { + if (!args.length) { + throw this.usageError() + } + + const Arborist = require('@npmcli/arborist') + const arb = new Arborist({ path: this.npm.prefix, ...this.npm.flatOptions }) + const tree = await arb.loadActual() + + if (this.npm.flatOptions.workspacesEnabled + && this.workspaceNames + && this.workspaceNames.length + ) { + this.filterSet = arb.workspaceDependencySet(tree, this.workspaceNames) + } else if (!this.npm.flatOptions.workspacesEnabled) { + this.filterSet = + arb.excludeWorkspacesDependencySet(tree) + } + + const nodes = new Set() + for (const arg of args) { + for (const node of this.getNodes(tree, arg)) { + const filteredOut = this.filterSet + && this.filterSet.size > 0 + && !this.filterSet.has(node) + if (!filteredOut) { + nodes.add(node) + } + } + } + if (nodes.size === 0) { + throw new Error(`No dependencies found matching ${args.join(', ')}`) + } + + const expls = [] + for (const node of nodes) { + const { extraneous, dev, optional, devOptional, peer, inBundle, overridden } = node + const expl = node.explain() + if (extraneous) { + expl.extraneous = true + } else { + expl.dev = dev + expl.optional = optional + expl.devOptional = devOptional + expl.peer = peer + expl.bundled = inBundle + expl.overridden = overridden + } + expls.push(expl) + } + + if (this.npm.flatOptions.json) { + output.buffer(expls) + } else { + output.standard(expls.map(expl => { + return explainNode(expl, Infinity, this.npm.chalk) + }).join('\n\n')) + } + } + + getNodes (tree, arg) { + // if it's just a name, return packages by that name + const { validForOldPackages: valid } = validName(arg) + if (valid) { + return tree.inventory.query('packageName', arg) + } + + // if it's a location, get that node + const maybeLoc = arg.replace(/\\/g, '/').replace(/(? { + return node.package.name === spec.name && + semver.satisfies(node.package.version, spec.rawSpec) + }) + } +} + +module.exports = Explain diff --git a/node24/node_modules/npm/lib/commands/explore.js b/node24/node_modules/npm/lib/commands/explore.js new file mode 100644 index 0000000000000000000000000000000000000000..3ae9ec0fda96aa1a71bc02476e8b24ac5e0c4f24 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/explore.js @@ -0,0 +1,70 @@ +const pkgJson = require('@npmcli/package-json') +const runScript = require('@npmcli/run-script') +const { join, relative } = require('node:path') +const { log, output } = require('proc-log') +const completion = require('../utils/installed-shallow.js') +const BaseCommand = require('../base-cmd.js') + +// npm explore [@] +// open a subshell to the package folder. +class Explore extends BaseCommand { + static description = 'Browse an installed package' + static name = 'explore' + static usage = [' [ -- ]'] + static params = ['shell'] + static ignoreImplicitWorkspace = false + + static async completion (opts, npm) { + return completion(npm, opts) + } + + async exec (args) { + if (args.length < 1 || !args[0]) { + throw this.usageError() + } + + const pkgname = args.shift() + + // detect and prevent any .. shenanigans + const path = join(this.npm.dir, join('/', pkgname)) + if (relative(path, this.npm.dir) === '') { + throw this.usageError() + } + + // run as if running a script named '_explore', which we set to either the set of arguments, or the shell config, and let @npmcli/run-script handle all the escaping and PATH setup stuff. + + const { content: pkg } = await pkgJson.normalize(path).catch(er => { + log.error('explore', `It doesn't look like ${pkgname} is installed.`) + throw er + }) + + const { shell } = this.npm.flatOptions + pkg.scripts = { + ...(pkg.scripts || {}), + _explore: args.join(' ').trim() || shell, + } + + if (!args.length) { + output.standard(`\nExploring ${path}\nType 'exit' or ^D when finished\n`) + } + + return runScript({ + ...this.npm.flatOptions, + pkg, + path, + event: '_explore', + stdio: 'inherit', + }).catch(er => { + process.exitCode = typeof er.code === 'number' && er.code !== 0 ? er.code + : 1 + // if it's not an exit error, or non-interactive, throw it + const isProcExit = er.message === 'command failed' && + (typeof er.code === 'number' || /^SIG/.test(er.signal || '')) + if (args.length || !isProcExit) { + throw er + } + }) + } +} + +module.exports = Explore diff --git a/node24/node_modules/npm/lib/commands/find-dupes.js b/node24/node_modules/npm/lib/commands/find-dupes.js new file mode 100644 index 0000000000000000000000000000000000000000..54e80885ecc8f093d2ad187db1056b5240adacc1 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/find-dupes.js @@ -0,0 +1,27 @@ +const ArboristWorkspaceCmd = require('../arborist-cmd.js') + +class FindDupes extends ArboristWorkspaceCmd { + static description = 'Find duplication in the package tree' + static name = 'find-dupes' + static params = [ + 'install-strategy', + 'legacy-bundling', + 'global-style', + 'strict-peer-deps', + 'package-lock', + 'omit', + 'include', + 'ignore-scripts', + 'audit', + 'bin-links', + 'fund', + ...super.params, + ] + + async exec () { + this.npm.config.set('dry-run', true) + return this.npm.exec('dedupe', []) + } +} + +module.exports = FindDupes diff --git a/node24/node_modules/npm/lib/commands/fund.js b/node24/node_modules/npm/lib/commands/fund.js new file mode 100644 index 0000000000000000000000000000000000000000..8a567a057f5c942405a494238f4d1bb48f838710 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/fund.js @@ -0,0 +1,215 @@ +const archy = require('archy') +const pacote = require('pacote') +const semver = require('semver') +const { output } = require('proc-log') +const npa = require('npm-package-arg') +const { depth } = require('treeverse') +const { readTree: getFundingInfo, normalizeFunding, isValidFunding } = require('libnpmfund') +const { openUrl } = require('../utils/open-url.js') +const ArboristWorkspaceCmd = require('../arborist-cmd.js') + +const getPrintableName = ({ name, version }) => { + const printableVersion = version ? `@${version}` : '' + return `${name}${printableVersion}` +} + +const errCode = (msg, code) => Object.assign(new Error(msg), { code }) + +class Fund extends ArboristWorkspaceCmd { + static description = 'Retrieve funding information' + static name = 'fund' + static params = ['json', 'browser', 'unicode', 'workspace', 'which'] + static usage = ['[]'] + + // XXX: maybe worth making this generic for all commands? + usageMessage (paramsObj = {}) { + let msg = `\`npm ${this.constructor.name}` + const params = Object.entries(paramsObj) + if (params.length) { + msg += ` ${this.constructor.usage}` + } + for (const [key, value] of params) { + msg += ` --${key}=${value}` + } + return `${msg}\`` + } + + static async completion (opts, npm) { + const completion = require('../utils/installed-deep.js') + return completion(npm, opts) + } + + async exec (args) { + const spec = args[0] + + let fundingSourceNumber = this.npm.config.get('which') + if (fundingSourceNumber != null) { + fundingSourceNumber = parseInt(fundingSourceNumber, 10) + if (isNaN(fundingSourceNumber) || fundingSourceNumber < 1) { + throw errCode( + `${this.usageMessage({ which: 'fundingSourceNumber' })} must be given a positive integer`, + 'EFUNDNUMBER' + ) + } + } + + if (this.npm.global) { + throw errCode( + `${this.usageMessage()} does not support global packages`, + 'EFUNDGLOBAL' + ) + } + + const where = this.npm.prefix + const Arborist = require('@npmcli/arborist') + const arb = new Arborist({ ...this.npm.flatOptions, path: where }) + const tree = await arb.loadActual() + + if (spec) { + await this.openFundingUrl({ + path: where, + tree, + spec, + fundingSourceNumber, + }) + return + } + + // TODO: add !workspacesEnabled option handling to libnpmfund + const fundingInfo = getFundingInfo(tree, { + ...this.flatOptions, + Arborist, + workspaces: this.workspaceNames, + }) + + if (this.npm.config.get('json')) { + output.buffer(fundingInfo) + } else { + output.standard(this.printHuman(fundingInfo)) + } + } + + printHuman (fundingInfo) { + const unicode = this.npm.config.get('unicode') + const seenUrls = new Map() + + const tree = obj => archy(obj, '', { unicode }) + + const result = depth({ + tree: fundingInfo, + + // composes human readable package name and creates a new archy item for readable output + visit: ({ name, version, funding }) => { + const [fundingSource] = [].concat(normalizeFunding(funding)).filter(isValidFunding) + const { url } = fundingSource || {} + const pkgRef = getPrintableName({ name, version }) + + if (!url) { + return { label: pkgRef } + } + let item + if (seenUrls.has(url)) { + item = seenUrls.get(url) + item.label += `${this.npm.chalk.dim(',')} ${pkgRef}` + return null + } + item = { + label: tree({ + label: this.npm.chalk.blue(url), + nodes: [pkgRef], + }).trim(), + } + + // stacks all packages together under the same item + seenUrls.set(url, item) + return item + }, + + // puts child nodes back into returned archy output while also filtering out missing items + leave: (item, children) => { + if (item) { + item.nodes = children.filter(Boolean) + } + + return item + }, + + // turns tree-like object return by libnpmfund into children to be properly read by treeverse + getChildren: node => + Object.keys(node.dependencies || {}).map(key => ({ + name: key, + ...node.dependencies[key], + })), + }) + + const res = tree(result) + return res + } + + async openFundingUrl ({ path, tree, spec, fundingSourceNumber }) { + const arg = npa(spec, path) + + const retrievePackageMetadata = () => { + if (arg.type === 'directory') { + if (tree.path === arg.fetchSpec) { + // matches cwd, e.g: npm fund . + return tree.package + } else { + // matches any file path within current arborist inventory + for (const item of tree.inventory.values()) { + if (item.path === arg.fetchSpec) { + return item.package + } + } + } + } else { + // tries to retrieve a package from arborist inventory by matching resulted package name from the provided spec + const [item] = [...tree.inventory.query('name', arg.name)] + .filter(i => semver.valid(i.package.version)) + .sort((a, b) => semver.rcompare(a.package.version, b.package.version)) + + if (item) { + return item.package + } + } + } + + const { funding } = + retrievePackageMetadata() || + (await pacote.manifest(arg, this.npm.flatOptions).catch(() => ({}))) + + const validSources = [].concat(normalizeFunding(funding)).filter(isValidFunding) + + if (!validSources.length) { + throw errCode(`No valid funding method available for: ${spec}`, 'ENOFUND') + } + + const fundSource = fundingSourceNumber + ? validSources[fundingSourceNumber - 1] + : validSources.length === 1 ? validSources[0] + : null + + if (fundSource) { + return openUrl(this.npm, ...this.urlMessage(fundSource)) + } + + const ambiguousUrlMsg = [ + ...validSources.map((s, i) => `${i + 1}: ${this.urlMessage(s).reverse().join(': ')}`), + `Run ${this.usageMessage({ which: '1' })}` + + ', for example, to open the first funding URL listed in that package', + ] + if (fundingSourceNumber) { + ambiguousUrlMsg.unshift(`--which=${fundingSourceNumber} is not a valid index`) + } + output.standard(ambiguousUrlMsg.join('\n')) + } + + urlMessage (source) { + const { type, url } = source + const typePrefix = type ? `${type} funding` : 'Funding' + const message = `${typePrefix} available at the following URL` + return [url, message] + } +} + +module.exports = Fund diff --git a/node24/node_modules/npm/lib/commands/get.js b/node24/node_modules/npm/lib/commands/get.js new file mode 100644 index 0000000000000000000000000000000000000000..1bbd6ca376adae7e770fdc2692636b39b37cc96d --- /dev/null +++ b/node24/node_modules/npm/lib/commands/get.js @@ -0,0 +1,21 @@ +const Npm = require('../npm.js') +const BaseCommand = require('../base-cmd.js') + +class Get extends BaseCommand { + static description = 'Get a value from the npm configuration' + static name = 'get' + static usage = ['[ ...] (See `npm config`)'] + static params = ['long'] + static ignoreImplicitWorkspace = false + + static async completion (opts) { + const Config = Npm.cmd('config') + return Config.completion(opts) + } + + async exec (args) { + return this.npm.exec('config', ['get'].concat(args)) + } +} + +module.exports = Get diff --git a/node24/node_modules/npm/lib/commands/help-search.js b/node24/node_modules/npm/lib/commands/help-search.js new file mode 100644 index 0000000000000000000000000000000000000000..e4e7f27bb7b10bcf03fee0b860f5db9a65325928 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/help-search.js @@ -0,0 +1,194 @@ +const { readFile } = require('node:fs/promises') +const path = require('node:path') +const { glob } = require('glob') +const { output } = require('proc-log') +const BaseCommand = require('../base-cmd.js') + +const globify = pattern => pattern.split('\\').join('/') + +class HelpSearch extends BaseCommand { + static description = 'Search npm help documentation' + static name = 'help-search' + static usage = [''] + static params = ['long'] + + async exec (args) { + if (!args.length) { + throw this.usageError() + } + + const docPath = path.resolve(this.npm.npmRoot, 'docs/content') + let files = await glob(`${globify(docPath)}/*/*.md`) + // preserve glob@8 behavior + files = files.sort((a, b) => a.localeCompare(b, 'en')) + const data = await this.readFiles(files) + const results = await this.searchFiles(args, data) + const formatted = this.formatResults(args, results) + if (!formatted.trim()) { + output.standard(`No matches in help for: ${args.join(' ')}\n`) + } else { + output.standard(formatted) + } + } + + async readFiles (files) { + const res = {} + await Promise.all(files.map(async file => { + res[file] = (await readFile(file, 'utf8')) + .replace(/^---\n(.*\n)*?---\n/, '').trim() + })) + return res + } + + async searchFiles (args, data) { + const results = [] + for (const [file, content] of Object.entries(data)) { + const lowerCase = content.toLowerCase() + // skip if no matches at all + if (!args.some(a => lowerCase.includes(a.toLowerCase()))) { + continue + } + + const lines = content.split(/\n+/) + + // if a line has a search term, then skip it and the next line. + // if the next line has a search term, then skip all 3 + // otherwise, set the line to null + // finally, remove the nulls + for (let i = 0; i < lines.length; i++) { + const line = lines[i] + const nextLine = lines[i + 1] + let match = false + if (nextLine) { + match = args.some(a => + nextLine.toLowerCase().includes(a.toLowerCase())) + if (match) { + // skip over the next line, and the line after it. + i += 2 + continue + } + } + + match = args.some(a => line.toLowerCase().includes(a.toLowerCase())) + + if (match) { + // skip over the next line + i++ + continue + } + + lines[i] = null + } + + // now squish any string of nulls into a single null + const pruned = lines.reduce((l, r) => { + if (!(r === null && l[l.length - 1] === null)) { + l.push(r) + } + + return l + }, []) + + if (pruned[pruned.length - 1] === null) { + pruned.pop() + } + + if (pruned[0] === null) { + pruned.shift() + } + + // now count how many args were found + const found = {} + let totalHits = 0 + for (const line of pruned) { + for (const arg of args) { + const hit = (line || '').toLowerCase() + .split(arg.toLowerCase()).length - 1 + + if (hit > 0) { + found[arg] = (found[arg] || 0) + hit + totalHits += hit + } + } + } + + const cmd = 'npm help ' + + path.basename(file, '.md').replace(/^npm-/, '') + results.push({ + file, + cmd, + lines: pruned, + found: Object.keys(found), + hits: found, + totalHits, + }) + } + + // sort results by number of results found, then by number of hits then by number of matching lines + + // coverage is ignored here because the contents of results are nondeterministic due to either glob or readFiles or Object.entries + return results.sort(/* istanbul ignore next */ (a, b) => + a.found.length > b.found.length ? -1 + : a.found.length < b.found.length ? 1 + : a.totalHits > b.totalHits ? -1 + : a.totalHits < b.totalHits ? 1 + : a.lines.length > b.lines.length ? -1 + : a.lines.length < b.lines.length ? 1 + : 0).slice(0, 10) + } + + formatResults (args, results) { + const cols = Math.min(process.stdout.columns || Infinity, 80) + 1 + + const formattedOutput = results.map(res => { + const out = [res.cmd] + const r = Object.keys(res.hits) + .map(k => `${k}:${res.hits[k]}`) + .sort((a, b) => a > b ? 1 : -1) + .join(' ') + + out.push(' '.repeat((Math.max(1, cols - out.join(' ').length - r.length - 1)))) + out.push(r) + + if (!this.npm.config.get('long')) { + return out.join('') + } + + out.unshift('\n\n') + out.push('\n') + out.push('-'.repeat(cols - 1) + '\n') + res.lines.forEach((line, i) => { + if (line === null || i > 3) { + return + } + + const highlightLine = [] + for (const arg of args) { + const finder = line.toLowerCase().split(arg.toLowerCase()) + let p = 0 + for (const f of finder) { + highlightLine.push(line.slice(p, p + f.length)) + const word = line.slice(p + f.length, p + f.length + arg.length) + highlightLine.push(this.npm.chalk.blue(word)) + p += f.length + arg.length + } + } + out.push(highlightLine.join('') + '\n') + }) + + return out.join('') + }).join('\n') + + const finalOut = results.length && !this.npm.config.get('long') + ? 'Top hits for ' + (args.map(JSON.stringify).join(' ')) + '\n' + + '—'.repeat(cols - 1) + '\n' + + formattedOutput + '\n' + + '—'.repeat(cols - 1) + '\n' + + '(run with -l or --long to see more context)' + : formattedOutput + + return finalOut.trim() + } +} + +module.exports = HelpSearch diff --git a/node24/node_modules/npm/lib/commands/help.js b/node24/node_modules/npm/lib/commands/help.js new file mode 100644 index 0000000000000000000000000000000000000000..6c130b291794f0032f24eb97aedd9bbd4b2aa607 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/help.js @@ -0,0 +1,113 @@ +const spawn = require('@npmcli/promise-spawn') +const path = require('node:path') +const { openUrl } = require('../utils/open-url.js') +const { glob } = require('glob') +const { output, input } = require('proc-log') +const localeCompare = require('@isaacs/string-locale-compare')('en') +const { deref } = require('../utils/cmd-list.js') +const BaseCommand = require('../base-cmd.js') + +const globify = pattern => pattern.split('\\').join('/') + +// Strips out the number from foo.7 or foo.7. or foo.7.tgz +// We don't currently compress our man pages but if we ever did this would seamlessly continue supporting it +const manNumberRegex = /\.(\d+)(\.[^/\\]*)?$/ +// hardcoded names for man sections +// XXX: these are used in the docs workspace and should be exported from npm so section names can changed more easily +const manSectionNames = { + 1: 'commands', + 5: 'configuring-npm', + 7: 'using-npm', +} + +class Help extends BaseCommand { + static description = 'Get help on npm' + static name = 'help' + static usage = [' []'] + static params = ['viewer'] + + static async completion (opts, npm) { + if (opts.conf.argv.remain.length > 2) { + return [] + } + const g = path.resolve(npm.npmRoot, 'man/man[0-9]/*.[0-9]') + let files = await glob(globify(g)) + // preserve glob@8 behavior + files = files.sort((a, b) => a.localeCompare(b, 'en')) + + return Object.keys(files.reduce(function (acc, file) { + file = path.basename(file).replace(/\.[0-9]+$/, '') + file = file.replace(/^npm-/, '') + acc[file] = true + return acc + }, { help: true })) + } + + async exec (args) { + // By default we search all of our man subdirectories, but if the user has asked for a specific one we limit the search to just there + const manSearch = /^\d+$/.test(args[0]) ? `man${args.shift()}` : 'man*' + + if (!args.length) { + return output.standard(this.npm.usage) + } + + // npm help foo bar baz: search topics + if (args.length > 1) { + return this.helpSearch(args) + } + + // `npm help package.json` + const arg = (deref(args[0]) || args[0]).replace('.json', '-json') + + // find either section.n or npm-section.n + const f = globify(path.resolve(this.npm.npmRoot, `man/${manSearch}/?(npm-)${arg}.[0-9]*`)) + + const [man] = await glob(f).then(r => r.sort((a, b) => { + // Because the glob is (subtly) different from manNumberRegex, we can't rely on it passing. + const aManNumberMatch = a.match(manNumberRegex)?.[1] || 999 + const bManNumberMatch = b.match(manNumberRegex)?.[1] || 999 + if (aManNumberMatch !== bManNumberMatch) { + return aManNumberMatch - bManNumberMatch + } + return localeCompare(a, b) + })) + + return man ? this.viewMan(man) : this.helpSearch(args) + } + + helpSearch (args) { + return this.npm.exec('help-search', args) + } + + async viewMan (man) { + const viewer = this.npm.config.get('viewer') + + if (viewer === 'browser') { + return openUrl(this.npm, this.htmlMan(man), 'help available at the following URL', true) + } + + let args = ['man', [man]] + if (viewer === 'woman') { + args = ['emacsclient', ['-e', `(woman-find-file '${man}')`]] + } + + try { + await input.start(() => spawn(...args, { stdio: 'inherit' })) + } catch (err) { + if (err.code) { + throw new Error(`help process exited with code: ${err.code}`) + } else { + throw err + } + } + } + + // Returns the path to the html version of the man page + htmlMan (man) { + const sect = manSectionNames[man.match(manNumberRegex)[1]] + const f = path.basename(man).replace(manNumberRegex, '') + return 'file:///' + path.resolve(this.npm.npmRoot, `docs/output/${sect}/${f}.html`) + } +} + +module.exports = Help diff --git a/node24/node_modules/npm/lib/commands/init.js b/node24/node_modules/npm/lib/commands/init.js new file mode 100644 index 0000000000000000000000000000000000000000..c777075440f62f91a44074377c7c9d32c78dc608 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/init.js @@ -0,0 +1,240 @@ +const { statSync } = require('node:fs') +const { relative, resolve } = require('node:path') +const { mkdir } = require('node:fs/promises') +const initJson = require('init-package-json') +const npa = require('npm-package-arg') +const libexec = require('libnpmexec') +const mapWorkspaces = require('@npmcli/map-workspaces') +const PackageJson = require('@npmcli/package-json') +const { log, output, input } = require('proc-log') +const updateWorkspaces = require('../utils/update-workspaces.js') +const BaseCommand = require('../base-cmd.js') + +const posixPath = p => p.split('\\').join('/') + +class Init extends BaseCommand { + static description = 'Create a package.json file' + static params = [ + 'init-author-name', + 'init-author-url', + 'init-license', + 'init-module', + 'init-type', + 'init-version', + 'init-private', + 'yes', + 'force', + 'scope', + 'workspace', + 'workspaces', + 'workspaces-update', + 'include-workspace-root', + ] + + static name = 'init' + static usage = [ + ' (same as `npx create-`)', + '<@scope> (same as `npx <@scope>/create`)', + ] + + static workspaces = true + static ignoreImplicitWorkspace = false + + async exec (args) { + // npm exec style + if (args.length) { + return await this.execCreate(args) + } + + // no args, uses classic init-package-json boilerplate + await this.template() + } + + async execWorkspaces (args) { + // if the root package is uninitiated, take care of it first + if (this.npm.flatOptions.includeWorkspaceRoot) { + await this.exec(args) + } + + // reads package.json for the top-level folder first + // by doing this we ensure the command throw if no package.json is found before trying to create a workspace package.json file or its folders + const { content: pkg } = await PackageJson.normalize(this.npm.localPrefix).catch(err => { + if (err.code === 'ENOENT') { + log.warn('init', 'Missing package.json. Try with `--include-workspace-root`.') + } + throw err + }) + + // these are workspaces that are being created, so we can't use this.setWorkspaces() + const filters = this.npm.config.get('workspace') + const wPath = filterArg => resolve(this.npm.localPrefix, filterArg) + + const workspacesPaths = [] + // npm-exec style, runs in the context of each workspace filter + if (args.length) { + for (const filterArg of filters) { + const path = wPath(filterArg) + await mkdir(path, { recursive: true }) + workspacesPaths.push(path) + await this.execCreate(args, path) + await this.setWorkspace(pkg, path) + } + return + } + + // no args, uses classic init-package-json boilerplate + for (const filterArg of filters) { + const path = wPath(filterArg) + await mkdir(path, { recursive: true }) + workspacesPaths.push(path) + await this.template(path) + await this.setWorkspace(pkg, path) + } + + // reify packages once all workspaces have been initialized + await this.update(workspacesPaths) + } + + async execCreate (args, runPath = process.cwd()) { + const [initerName, ...otherArgs] = args + let packageName = initerName + + // Only a scope, possibly with a version + if (/^@[^/]+$/.test(initerName)) { + const [, scope, version] = initerName.split('@') + packageName = `@${scope}/create` + if (version) { + packageName = `${packageName}@${version}` + } + } else { + const req = npa(initerName) + if (req.type === 'git' && req.hosted) { + const { user, project } = req.hosted + packageName = initerName.replace(`${user}/${project}`, `${user}/create-${project}`) + } else if (req.registry) { + packageName = `${req.name.replace(/^(@[^/]+\/)?/, '$1create-')}@${req.rawSpec}` + } else { + throw Object.assign(new Error( + 'Unrecognized initializer: ' + initerName + + '\nFor more package binary executing power check out `npx`:' + + '\nhttps://docs.npmjs.com/cli/commands/npx' + ), { code: 'EUNSUPPORTED' }) + } + } + + const newArgs = [packageName, ...otherArgs] + const { + flatOptions, + localBin, + globalBin, + chalk, + } = this.npm + const scriptShell = this.npm.config.get('script-shell') || undefined + const yes = this.npm.config.get('yes') + + // only send the init-private flag if it is set + const opts = { ...flatOptions } + if (this.npm.config.isDefault('init-private')) { + delete opts.initPrivate + } + + await libexec({ + ...opts, + args: newArgs, + localBin, + globalBin, + output, + chalk, + path: this.npm.localPrefix, + runPath, + scriptShell, + yes, + }) + } + + async template (path = process.cwd()) { + const initFile = this.npm.config.get('init-module') + if (!this.npm.config.get('yes') && !this.npm.config.get('force')) { + output.standard([ + 'This utility will walk you through creating a package.json file.', + 'It only covers the most common items, and tries to guess sensible defaults.', + '', + 'See `npm help init` for definitive documentation on these fields and exactly what they do.', + '', + 'Use `npm install ` afterwards to install a package and save it as a dependency in the package.json file.', + '', + 'Press ^C at any time to quit.', + ].join('\n')) + } + + try { + const data = await input.read(() => initJson(path, initFile, this.npm.config)) + log.silly('package data', data) + return data + } catch (er) { + if (er.message === 'canceled') { + output.flush() + log.warn('init', 'canceled') + } else { + throw er + } + } + } + + async setWorkspace (pkg, workspacePath) { + const workspaces = await mapWorkspaces({ cwd: this.npm.localPrefix, pkg }) + + // skip setting workspace if current package.json glob already satisfies it + for (const wPath of workspaces.values()) { + if (wPath === workspacePath) { + return + } + } + + // if a create-pkg didn't generate a package.json at the workspace folder level, it might not be recognized as a workspace by mapWorkspaces, so we're just going to avoid touching the top-level package.json + try { + statSync(resolve(workspacePath, 'package.json')) + } catch { + return + } + + const pkgJson = await PackageJson.load(this.npm.localPrefix) + + pkgJson.update({ + workspaces: [ + ...(pkgJson.content.workspaces || []), + posixPath(relative(this.npm.localPrefix, workspacePath)), + ], + }) + + await pkgJson.save() + } + + async update (workspacesPaths) { + // translate workspaces paths into an array containing workspaces names + const workspaces = [] + for (const path of workspacesPaths) { + const { content: { name } } = await PackageJson.normalize(path).catch(() => ({ content: {} })) + + if (name) { + workspaces.push(name) + } + } + + const { + config, + flatOptions, + localPrefix, + } = this.npm + + await updateWorkspaces({ + config, + flatOptions, + localPrefix, + npm: this.npm, + workspaces, + }) + } +} + +module.exports = Init diff --git a/node24/node_modules/npm/lib/commands/install-ci-test.js b/node24/node_modules/npm/lib/commands/install-ci-test.js new file mode 100644 index 0000000000000000000000000000000000000000..cb09deb02009595f0dd0e7abfdca4cb294da4bf2 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/install-ci-test.js @@ -0,0 +1,13 @@ +const CI = require('./ci.js') + +class InstallCITest extends CI { + static description = 'Install a project with a clean slate and run tests' + static name = 'install-ci-test' + + async exec (args) { + await this.npm.exec('ci', args) + return this.npm.exec('test', []) + } +} + +module.exports = InstallCITest diff --git a/node24/node_modules/npm/lib/commands/install-test.js b/node24/node_modules/npm/lib/commands/install-test.js new file mode 100644 index 0000000000000000000000000000000000000000..c572060c63a281940897cb4adb19db540b082b48 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/install-test.js @@ -0,0 +1,13 @@ +const Install = require('./install.js') + +class InstallTest extends Install { + static description = 'Install package(s) and run tests' + static name = 'install-test' + + async exec (args) { + await this.npm.exec('install', args) + return this.npm.exec('test', []) + } +} + +module.exports = InstallTest diff --git a/node24/node_modules/npm/lib/commands/install.js b/node24/node_modules/npm/lib/commands/install.js new file mode 100644 index 0000000000000000000000000000000000000000..bf9aaa186d23f962c92fe328e5444ce30bd56a76 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/install.js @@ -0,0 +1,172 @@ +const { readdir } = require('node:fs/promises') +const { resolve, join } = require('node:path') +const { log } = require('proc-log') +const runScript = require('@npmcli/run-script') +const pacote = require('pacote') +const checks = require('npm-install-checks') +const reifyFinish = require('../utils/reify-finish.js') +const ArboristWorkspaceCmd = require('../arborist-cmd.js') + +class Install extends ArboristWorkspaceCmd { + static description = 'Install a package' + static name = 'install' + + // These are in the order they will show up in when running "-h" If adding to this list, consider adding also to ci.js + static params = [ + 'save', + 'save-exact', + 'global', + 'install-strategy', + 'legacy-bundling', + 'global-style', + 'omit', + 'include', + 'strict-peer-deps', + 'prefer-dedupe', + 'package-lock', + 'package-lock-only', + 'foreground-scripts', + 'ignore-scripts', + 'allow-git', + 'audit', + 'before', + 'min-release-age', + 'bin-links', + 'fund', + 'dry-run', + 'cpu', + 'os', + 'libc', + ...super.params, + ] + + static usage = ['[ ...]'] + + static async completion (opts) { + const { partialWord } = opts + // install can complete to a folder with a package.json, or any package. + // if it has a slash, then it's gotta be a folder + // if it starts with https?://, then just give up, because it's a url + if (/^https?:\/\//.test(partialWord)) { + // do not complete to URLs + return [] + } + + if (/\//.test(partialWord)) { + // Complete fully to folder if there is exactly one match and it is a folder containing a package.json file. + // If that is not the case we return 0 matches, which will trigger the default bash complete. + const lastSlashIdx = partialWord.lastIndexOf('/') + const partialName = partialWord.slice(lastSlashIdx + 1) + const partialPath = partialWord.slice(0, lastSlashIdx) || '/' + + const isDirMatch = async sibling => { + if (sibling.slice(0, partialName.length) !== partialName) { + return false + } + + try { + const contents = await readdir(join(partialPath, sibling)) + const result = (contents.indexOf('package.json') !== -1) + return result + } catch { + return false + } + } + + try { + const siblings = await readdir(partialPath) + const matches = [] + for (const sibling of siblings) { + if (await isDirMatch(sibling)) { + matches.push(sibling) + } + } + if (matches.length === 1) { + return [join(partialPath, matches[0])] + } + // no matches + return [] + } catch { + return [] // invalid dir: no matching + } + } + // Note: there used to be registry completion here, but it stopped making sense somewhere around 50,000 packages on the registry + } + + async exec (args) { + // the /path/to/node_modules/.. + const globalTop = resolve(this.npm.globalDir, '..') + const ignoreScripts = this.npm.config.get('ignore-scripts') + const isGlobalInstall = this.npm.global + const where = isGlobalInstall ? globalTop : this.npm.prefix + const forced = this.npm.config.get('force') + const scriptShell = this.npm.config.get('script-shell') || undefined + + // be very strict about engines when trying to update npm itself + const npmInstall = args.find(arg => arg.startsWith('npm@') || arg === 'npm') + if (isGlobalInstall && npmInstall) { + const npmOptions = this.npm.flatOptions + const npmManifest = await pacote.manifest(npmInstall, npmOptions) + try { + checks.checkEngine(npmManifest, npmManifest.version, process.version) + } catch (e) { + if (forced) { + log.warn( + 'install', + `Forcing global npm install with incompatible version ${npmManifest.version} into node ${process.version}` + ) + } else { + throw e + } + } + } + + // don't try to install the prefix into itself + args = args.filter(a => resolve(a) !== this.npm.prefix) + + // `npm i -g` => "install this package globally" + if (isGlobalInstall && !args.length) { + args = ['.'] + } + + // throw usage error if trying to install empty package name to global space, e.g: `npm i -g ""` + if (where === globalTop && !args.every(Boolean)) { + throw this.usageError() + } + + const Arborist = require('@npmcli/arborist') + const opts = { + ...this.npm.flatOptions, + auditLevel: null, + path: where, + add: args, + workspaces: this.workspaceNames, + } + const arb = new Arborist(opts) + await arb.reify(opts) + + if (!args.length && !isGlobalInstall && !ignoreScripts) { + const scripts = [ + 'preinstall', + 'install', + 'postinstall', + 'prepublish', // XXX(npm9) should we remove this finally?? + 'preprepare', + 'prepare', + 'postprepare', + ] + for (const event of scripts) { + await runScript({ + path: where, + args: [], + scriptShell, + stdio: 'inherit', + event, + }) + } + } + await reifyFinish(this.npm, arb) + } +} + +module.exports = Install diff --git a/node24/node_modules/npm/lib/commands/link.js b/node24/node_modules/npm/lib/commands/link.js new file mode 100644 index 0000000000000000000000000000000000000000..c97ec5ae0d41766b1419ecc7d6199658bcf1d055 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/link.js @@ -0,0 +1,185 @@ +const { readdir } = require('node:fs/promises') +const { resolve } = require('node:path') +const npa = require('npm-package-arg') +const pkgJson = require('@npmcli/package-json') +const semver = require('semver') +const reifyFinish = require('../utils/reify-finish.js') +const ArboristWorkspaceCmd = require('../arborist-cmd.js') + +class Link extends ArboristWorkspaceCmd { + static description = 'Symlink a package folder' + static name = 'link' + static usage = [ + '[]', + ] + + static params = [ + 'save', + 'save-exact', + 'global', + 'install-strategy', + 'legacy-bundling', + 'global-style', + 'strict-peer-deps', + 'package-lock', + 'omit', + 'include', + 'ignore-scripts', + 'allow-git', + 'audit', + 'bin-links', + 'fund', + 'dry-run', + ...super.params, + ] + + static async completion (opts, npm) { + const dir = npm.globalDir + const files = await readdir(dir) + return files.filter(f => !/^[._-]/.test(f)) + } + + async exec (args) { + if (this.npm.global) { + throw Object.assign( + new Error( + 'link should never be --global.\n' + + 'Please re-run this command with --local' + ), + { code: 'ELINKGLOBAL' } + ) + } + // install-links is implicitly false when running `npm link` + this.npm.config.set('install-links', false) + + // link with no args: symlink the folder to the global location + // link with package arg: symlink the global to the local + args = args.filter(a => resolve(a) !== this.npm.prefix) + return args.length + ? this.linkInstall(args) + : this.linkPkg() + } + + async linkInstall (args) { + // load current packages from the global space, and then add symlinks installs locally + const globalTop = resolve(this.npm.globalDir, '..') + const Arborist = require('@npmcli/arborist') + const globalOpts = { + ...this.npm.flatOptions, + Arborist, + path: globalTop, + global: true, + prune: false, + } + const globalArb = new Arborist(globalOpts) + + // get only current top-level packages from the global space + const globals = await globalArb.loadActual({ + filter: (node, kid) => + !node.isRoot || args.some(a => npa(a).name === kid), + }) + + // any extra arg that is missing from the current global space should be reified there first + const missing = this.missingArgsFromTree(globals, args) + if (missing.length) { + await globalArb.reify({ + ...globalOpts, + add: missing, + }) + } + + // get a list of module names that should be linked in the local prefix + const names = [] + for (const a of args) { + const arg = npa(a) + if (arg.type === 'directory') { + const { content } = await pkgJson.normalize(arg.fetchSpec) + names.push(content.name) + } else { + names.push(arg.name) + } + } + + // npm link should not save=true by default unless you're using any of --save-dev or other types + const save = + Boolean( + (this.npm.config.find('save') !== 'default' && + this.npm.config.get('save')) || + this.npm.config.get('save-optional') || + this.npm.config.get('save-peer') || + this.npm.config.get('save-dev') || + this.npm.config.get('save-prod') + ) + // create a new arborist instance for the local prefix and + // reify all the pending names as symlinks there + const localArb = new Arborist({ + ...this.npm.flatOptions, + prune: false, + path: this.npm.prefix, + save, + }) + await localArb.reify({ + ...this.npm.flatOptions, + prune: false, + path: this.npm.prefix, + add: names.map(l => `file:${resolve(globalTop, 'node_modules', l)}`), + save, + workspaces: this.workspaceNames, + }) + + await reifyFinish(this.npm, localArb) + } + + async linkPkg () { + const wsp = this.workspacePaths + const paths = wsp && wsp.length ? wsp : [this.npm.prefix] + const add = paths.map(path => `file:${path}`) + const globalTop = resolve(this.npm.globalDir, '..') + const Arborist = require('@npmcli/arborist') + const arb = new Arborist({ + ...this.npm.flatOptions, + Arborist, + path: globalTop, + global: true, + }) + await arb.reify({ + add, + }) + await reifyFinish(this.npm, arb) + } + + // Returns a list of items that can't be fulfilled by things found in the current arborist inventory + missingArgsFromTree (tree, args) { + if (tree.isLink) { + return this.missingArgsFromTree(tree.target, args) + } + + const foundNodes = [] + const missing = args.filter(a => { + const arg = npa(a) + const nodes = tree.children.values() + const argFound = [...nodes].every(node => { + // TODO: write tests for unmatching version specs + // this is hard to test atm but should be simple once we have a mocked registry again + if (arg.name !== node.name /* istanbul ignore next */ || ( + arg.version && + /* istanbul ignore next */ + !semver.satisfies(node.version, arg.version) + )) { + foundNodes.push(node) + return true + } + }) + return argFound + }) + + // remote nodes from the loaded tree in order to avoid dropping them later when reifying + for (const node of foundNodes) { + node.parent = null + } + + return missing + } +} + +module.exports = Link diff --git a/node24/node_modules/npm/lib/commands/ll.js b/node24/node_modules/npm/lib/commands/ll.js new file mode 100644 index 0000000000000000000000000000000000000000..c405eebf0f5da2c5f38bfbbb0ebec3da34204fe8 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/ll.js @@ -0,0 +1,13 @@ +const LS = require('./ls.js') + +class LL extends LS { + static name = 'll' + static usage = ['[[<@scope>/] ...]'] + + async exec (args) { + this.npm.config.set('long', true) + return super.exec(args) + } +} + +module.exports = LL diff --git a/node24/node_modules/npm/lib/commands/login.js b/node24/node_modules/npm/lib/commands/login.js new file mode 100644 index 0000000000000000000000000000000000000000..6c32729760c6a3046d1ae241a77b7eda5ea0752b --- /dev/null +++ b/node24/node_modules/npm/lib/commands/login.js @@ -0,0 +1,50 @@ +const { log, output } = require('proc-log') +const { redactLog: replaceInfo } = require('@npmcli/redact') +const auth = require('../utils/auth.js') +const BaseCommand = require('../base-cmd.js') + +class Login extends BaseCommand { + static description = 'Login to a registry user account' + static name = 'login' + static params = [ + 'registry', + 'scope', + 'auth-type', + ] + + async exec () { + const scope = this.npm.config.get('scope') + let registry = this.npm.config.get('registry') + + if (scope) { + const scopedRegistry = this.npm.config.get(`${scope}:registry`) + const cliRegistry = this.npm.config.get('registry', 'cli') + if (scopedRegistry && !cliRegistry) { + registry = scopedRegistry + } + } + + const creds = this.npm.config.getCredentialsByURI(registry) + + log.notice('', `Log in on ${replaceInfo(registry)}`) + + const { message, newCreds } = await auth.login(this.npm, { + ...this.npm.flatOptions, + creds, + registry, + }) + + this.npm.config.delete('_token', 'user') // prevent legacy pollution + this.npm.config.setCredentialsByURI(registry, newCreds) + + if (scope) { + this.npm.config.set(scope + ':registry', registry, 'user') + } + + await this.npm.config.save('user') + + output.standard(message) + } +} + +module.exports = Login diff --git a/node24/node_modules/npm/lib/commands/logout.js b/node24/node_modules/npm/lib/commands/logout.js new file mode 100644 index 0000000000000000000000000000000000000000..8bab8009f65fa2e068c0e053593a3767d5d31f46 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/logout.js @@ -0,0 +1,50 @@ +const npmFetch = require('npm-registry-fetch') +const { getAuth } = npmFetch +const { log } = require('proc-log') +const BaseCommand = require('../base-cmd.js') + +class Logout extends BaseCommand { + static description = 'Log out of the registry' + static name = 'logout' + static params = [ + 'registry', + 'scope', + ] + + async exec () { + const registry = this.npm.config.get('registry') + const scope = this.npm.config.get('scope') + const regRef = scope ? `${scope}:registry` : 'registry' + const reg = this.npm.config.get(regRef) || registry + + const auth = getAuth(reg, this.npm.flatOptions) + + const level = this.npm.config.find(`${auth.regKey}:${auth.authKey}`) + + // find the config level and only delete from there + if (auth.token) { + log.verbose('logout', `clearing token for ${reg}`) + await npmFetch(`/-/user/token/${encodeURIComponent(auth.token)}`, { + ...this.npm.flatOptions, + registry: reg, + method: 'DELETE', + ignoreBody: true, + }) + } else if (auth.isBasicAuth) { + log.verbose('logout', `clearing user credentials for ${reg}`) + } else { + const msg = `not logged in to ${reg}, so can't log out!` + throw Object.assign(new Error(msg), { code: 'ENEEDAUTH' }) + } + + if (scope) { + this.npm.config.delete(regRef, level) + } + + this.npm.config.clearCredentialsByURI(reg, level) + + await this.npm.config.save(level) + } +} + +module.exports = Logout diff --git a/node24/node_modules/npm/lib/commands/ls.js b/node24/node_modules/npm/lib/commands/ls.js new file mode 100644 index 0000000000000000000000000000000000000000..1befb1e0a41f91330c62ff4db5eaa07b72174b26 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/ls.js @@ -0,0 +1,588 @@ +const { resolve, relative, sep } = require('node:path') +const archy = require('archy') +const { breadth } = require('treeverse') +const npa = require('npm-package-arg') +const { output } = require('proc-log') +const ArboristWorkspaceCmd = require('../arborist-cmd.js') +const localeCompare = require('@isaacs/string-locale-compare')('en') + +const relativePrefix = `.${sep}` + +const _depth = Symbol('depth') +const _dedupe = Symbol('dedupe') +const _filteredBy = Symbol('filteredBy') +const _include = Symbol('include') +const _invalid = Symbol('invalid') +const _name = Symbol('name') +const _missing = Symbol('missing') +const _parent = Symbol('parent') +const _problems = Symbol('problems') +const _required = Symbol('required') +const _type = Symbol('type') + +class LS extends ArboristWorkspaceCmd { + static description = 'List installed packages' + static name = 'ls' + static usage = [''] + static params = [ + 'all', + 'json', + 'long', + 'parseable', + 'global', + 'depth', + 'omit', + 'include', + 'link', + 'package-lock-only', + 'unicode', + ...super.params, + ] + + static async completion (opts, npm) { + const completion = require('../utils/installed-deep.js') + return completion(npm, opts) + } + + async exec (args) { + const all = this.npm.config.get('all') + const chalk = this.npm.chalk + const depth = this.npm.config.get('depth') + const global = this.npm.global + const json = this.npm.config.get('json') + const link = this.npm.config.get('link') + const long = this.npm.config.get('long') + const omit = this.npm.flatOptions.omit + const parseable = this.npm.config.get('parseable') + const unicode = this.npm.config.get('unicode') + const packageLockOnly = this.npm.config.get('package-lock-only') + const workspacesEnabled = this.npm.flatOptions.workspacesEnabled + const installStrategy = this.npm.flatOptions.installStrategy + + const path = global ? resolve(this.npm.globalDir, '..') : this.npm.prefix + + const Arborist = require('@npmcli/arborist') + + const arb = new Arborist({ + global, + ...this.npm.flatOptions, + legacyPeerDeps: false, + path, + }) + const tree = await this.initTree({ arb, args, packageLockOnly }) + + // filters by workspaces nodes when using -w + // We only have to filter the first layer of edges, so we don't explore anything that isn't part of the selected workspace set. + let wsNodes + if (this.workspaceNames && this.workspaceNames.length) { + wsNodes = arb.workspaceNodes(tree, this.workspaceNames) + } + const filterBySelectedWorkspaces = edge => { + if (!workspacesEnabled + && edge.from.isProjectRoot + && edge.to.isWorkspace + ) { + return false + } + + if (!wsNodes || !wsNodes.length) { + return true + } + + if (this.npm.flatOptions.includeWorkspaceRoot + && edge.to && !edge.to.isWorkspace) { + return true + } + + if (edge.from.isProjectRoot) { + return (edge.to + && edge.to.isWorkspace + && wsNodes.includes(edge.to.target)) + } + + return true + } + + const seenItems = new Set() + const seenNodes = new Map() + const problems = new Set() + + // defines special handling of printed depth when filtering with args + const filterDefaultDepth = depth === null ? Infinity : depth + const depthToPrint = (all || args.length) + ? filterDefaultDepth + : (depth || 0) + + // add root node of tree to list of seenNodes + seenNodes.set(tree.path, tree) + + // tree traversal happens here, using treeverse.breadth + const result = await breadth({ + tree, + // recursive method, `node` is going to be the current elem (starting from the `tree` obj) that was just visited in the `visit` method below `nodeResult` is going to be the returned `item` from `visit` + getChildren (node, nodeResult) { + const seenPaths = new Set() + const workspace = node.isWorkspace + const currentDepth = workspace ? 0 : node[_depth] + const shouldSkipChildren = + !(node instanceof Arborist.Node) || (currentDepth > depthToPrint) + return (shouldSkipChildren) + ? [] + : [...(node.target).edgesOut.values()] + .filter(filterBySelectedWorkspaces) + .filter(currentDepth === 0 ? filterByEdgesTypes({ + link, + omit, + }) : () => true) + .filter(installStrategy === 'linked' + ? filterLinkedStrategyEdges({ node, currentDepth }) + : () => true) + .map(mapEdgesToNodes({ seenPaths })) + .concat(appendExtraneousChildren({ node, seenPaths })) + .sort(sortAlphabetically) + .map(augmentNodesWithMetadata({ + args, + currentDepth, + nodeResult, + seenNodes, + })) + }, + // visit each `node` of the `tree`, returning an `item` - these are the elements that will be used to build the final output + visit (node) { + node[_problems] = getProblems(node, { global }) + + const item = json + ? getJsonOutputItem(node, { global, long }) + : parseable + ? null + : getHumanOutputItem(node, { args, chalk, global, long }) + + // loop through list of node problems to add them to global list + if (node[_include]) { + for (const problem of node[_problems]) { + problems.add(problem) + } + } + + seenItems.add(item) + + // return a promise so we don't blow the stack + return Promise.resolve(item) + }, + }) + + // handle the special case of a broken package.json in the root folder + const [rootError] = tree.errors.filter(e => + e.code === 'EJSONPARSE' && e.path === resolve(path, 'package.json')) + + if (json) { + output.buffer(jsonOutput({ path, problems, result, rootError, seenItems })) + } else { + output.standard(parseable + ? parseableOutput({ seenNodes, global, long }) + : humanOutput({ chalk, result, seenItems, unicode }) + ) + } + + // if filtering items, should exit with error code on no results + if (result && !result[_include] && args.length) { + process.exitCode = 1 + } + + if (rootError) { + throw Object.assign( + new Error('Failed to parse root package.json'), + { code: 'EJSONPARSE' } + ) + } + + const shouldThrow = problems.size && + ![...problems].every(problem => problem.startsWith('extraneous:')) + + if (shouldThrow) { + throw Object.assign( + new Error([...problems].join('\n')), + { code: 'ELSPROBLEMS' } + ) + } + } + + async initTree ({ arb, args, packageLockOnly }) { + const tree = await ( + packageLockOnly + ? arb.loadVirtual() + : arb.loadActual() + ) + + tree[_include] = args.length === 0 + tree[_depth] = 0 + + return tree + } +} + +module.exports = LS + +const isGitNode = (node) => { + if (!node.resolved) { + return + } + + try { + const { type } = npa(node.resolved) + return type === 'git' || type === 'hosted' + } catch { + return false + } +} + +const isOptional = (node) => + node[_type] === 'optional' || node[_type] === 'peerOptional' + +const isExtraneous = (node, { global }) => + node.extraneous && !global + +const getProblems = (node, { global }) => { + const problems = new Set() + + if (node[_missing] && !isOptional(node)) { + problems.add(`missing: ${node.pkgid}, required by ${node[_missing]}`) + } + + if (node[_invalid]) { + problems.add(`invalid: ${node.pkgid} ${node.path}`) + } + + if (isExtraneous(node, { global })) { + problems.add(`extraneous: ${node.pkgid} ${node.path}`) + } + + return problems +} + +// annotates _parent and _include metadata into the resulting item obj allowing for filtering out results during output +const augmentItemWithIncludeMetadata = (node, item) => { + item[_parent] = node[_parent] + item[_include] = node[_include] + + // append current item to its parent.nodes which is the structure expected by archy in order to print tree + if (node[_include]) { + // includes all ancestors of included node + let p = node[_parent] + while (p) { + p[_include] = true + p = p[_parent] + } + } + + return item +} + +const getHumanOutputItem = (node, { args, chalk, global, long }) => { + const { pkgid, path } = node + const workspacePkgId = chalk.blueBright(pkgid) + let printable = node.isWorkspace ? workspacePkgId : pkgid + + // special formatting for top-level package name + if (node.isRoot) { + const hasNoPackageJson = !Object.keys(node.package).length + if (hasNoPackageJson || global) { + printable = path + } else { + printable += `${long ? '\n' : ' '}${path}` + } + } + + // TODO there is a LOT of overlap with lib/utils/explain-dep.js here + + const highlightDepName = args.length && node[_filteredBy] + const missingColor = isOptional(node) + ? chalk.yellow + : chalk.red + const missingMsg = `UNMET ${isOptional(node) ? 'OPTIONAL ' : ''}DEPENDENCY` + const targetLocation = node.root + ? relative(node.root.realpath, node.realpath) + : node.targetLocation + const invalid = node[_invalid] + ? `invalid: ${node[_invalid]}` + : '' + const label = + ( + node[_missing] + ? missingColor(missingMsg) + ' ' + : '' + ) + + `${highlightDepName ? chalk.yellow(printable) : printable}` + + ( + node[_dedupe] + ? ' ' + chalk.dim('deduped') + : '' + ) + + ( + invalid + ? ' ' + chalk.red(invalid) + : '' + ) + + ( + isExtraneous(node, { global }) + ? ' ' + chalk.red('extraneous') + : '' + ) + + ( + node.overridden + ? ' ' + chalk.dim('overridden') + : '' + ) + + (isGitNode(node) ? ` (${node.resolved})` : '') + + (node.isLink ? ` -> ${relativePrefix}${targetLocation}` : '') + + (long ? `\n${node.package.description || ''}` : '') + + return augmentItemWithIncludeMetadata(node, { label, nodes: [] }) +} + +const getJsonOutputItem = (node, { global, long }) => { + const item = {} + + if (node.version) { + item.version = node.version + } + + if (node.resolved) { + item.resolved = node.resolved + } + + // if the node is the project root, do not add the overridden flag. + // the project root can't be overridden anyway, and if we add the flag it causes undesirable behavior when `npm ls --json` is ran in an empty directory since we end up printing an object with only an overridden prop + if (!node.isProjectRoot) { + item.overridden = node.overridden + } + + item[_name] = node.name + + // special formatting for top-level package name + const hasPackageJson = + node && node.package && Object.keys(node.package).length + if (node.isRoot && hasPackageJson) { + item.name = node.package.name || node.name + } + + if (long && !node[_missing]) { + item.name = item[_name] + const { dependencies, ...packageInfo } = node.package + Object.assign(item, packageInfo) + item.extraneous = false + item.path = node.path + item._dependencies = { + ...node.package.dependencies, + ...node.package.optionalDependencies, + } + item.devDependencies = node.package.devDependencies || {} + item.peerDependencies = node.package.peerDependencies || {} + } + + // augment json output items with extra metadata + if (isExtraneous(node, { global })) { + item.extraneous = true + } + + if (node[_invalid]) { + item.invalid = node[_invalid] + } + + if (node[_missing] && !isOptional(node)) { + item.required = node[_required] + item.missing = true + } + if (node[_include] && node[_problems] && node[_problems].size) { + item.problems = [...node[_problems]] + } + + return augmentItemWithIncludeMetadata(node, item) +} + +// In linked strategy, two types of edges produce false UNMET DEPENDENCYs: +// 1. Workspace edges for undeclared workspaces: the lockfile records edges from root to ALL workspaces, but only declared workspaces are hoisted to root/node_modules in linked mode. Undeclared ones are intentionally absent. +// 2. Dev edges on non-root packages: store package link targets have no parent in the node tree, so they are treated as "top" nodes and their devDependencies are loaded as edges. Those devDeps are never installed. +const filterLinkedStrategyEdges = ({ node, currentDepth }) => { + const declaredDeps = new Set(Object.keys(Object.assign({}, + node.target.package.dependencies, + node.target.package.devDependencies, + node.target.package.optionalDependencies, + node.target.package.peerDependencies + ))) + + return (edge) => { + // Skip workspace edges for undeclared workspaces at root level + if (currentDepth === 0 && edge.type === 'workspace' && edge.missing) { + if (!declaredDeps.has(edge.name)) { + return false + } + } + + // Skip dev edges for non-root packages (store packages) + if (currentDepth > 0 && edge.dev) { + return false + } + + return true + } +} + +const filterByEdgesTypes = ({ link, omit }) => (edge) => { + for (const omitType of omit) { + if (edge[omitType]) { + return false + } + } + return link ? edge.to && edge.to.isLink : true +} + +const appendExtraneousChildren = ({ node, seenPaths }) => + // extraneous children are not represented + // in edges out, so here we add them to the list: + [...node.children.values()] + .filter(i => !seenPaths.has(i.path) && i.extraneous) + +const mapEdgesToNodes = ({ seenPaths }) => (edge) => { + let node = edge.to + + // if the edge is linking to a missing node, we go ahead and create a new obj that will represent the missing node + if (edge.missing || (edge.optional && !node)) { + const { name, spec } = edge + const pkgid = `${name}@${spec}` + node = { name, pkgid, [_missing]: edge.from.pkgid } + } + + // keeps track of a set of seen paths to avoid the edge case in which a tree item would appear twice given that it's a children of an extraneous item + // so it's marked extraneous but it will ALSO show up in edgesOuts of its parent so it ends up as two diff nodes if we don't track it + if (node.path) { + seenPaths.add(node.path) + } + + node[_required] = edge.spec || '*' + node[_type] = edge.type + + if (edge.invalid) { + const spec = JSON.stringify(node[_required]) + const from = edge.from.location || 'the root project' + node[_invalid] = (node[_invalid] ? node[_invalid] + ', ' : '') + + (`${spec} from ${from}`) + } + + return node +} + +const filterByPositionalArgs = (args, { node }) => + args.length > 0 ? args.some( + (spec) => (node.satisfies && node.satisfies(spec)) + ) : true + +const augmentNodesWithMetadata = ({ + args, + currentDepth, + nodeResult, + seenNodes, +}) => (node) => { + // if the original edge was a deduped dep, treeverse will fail to revisit that node in tree traversal logic, so we make it so that we have a diff obj for deduped nodes: + if (seenNodes.has(node.path)) { + const { realpath, root } = node + const targetLocation = root ? relative(root.realpath, realpath) + : node.targetLocation + node = { + name: node.name, + version: node.version, + pkgid: node.pkgid, + package: node.package, + path: node.path, + isLink: node.isLink, + realpath: node.realpath, + targetLocation, + [_type]: node[_type], + [_invalid]: node[_invalid], + [_missing]: node[_missing], + // if it's missing, it's not deduped, it's just missing + [_dedupe]: !node[_missing], + } + } else { + // keeps track of already seen nodes in order to check for dedupes + seenNodes.set(node.path, node) + } + + // _parent is going to be a ref to a treeverse-visited node (returned from getHumanOutputItem, getJsonOutputItem, etc) so that we have an easy shortcut to place new nodes in their right place during tree traversal + node[_parent] = nodeResult + // _include is the property that allow us to filter based on position args + // e.g: `npm ls foo`, `npm ls simple-output@2` + // _filteredBy is used to apply extra color info to the item that was used in args in order to filter + node[_filteredBy] = node[_include] = + filterByPositionalArgs(args, { node: seenNodes.get(node.path) }) + // _depth keeps track of how many levels deep tree traversal currently is so that we can `npm ls --depth=1` + node[_depth] = currentDepth + 1 + + return node +} + +const sortAlphabetically = ({ pkgid: a }, { pkgid: b }) => localeCompare(a, b) + +const humanOutput = ({ chalk, result, seenItems, unicode }) => { + // we need to traverse the entire tree in order to determine which items should be included (since a nested transitive included dep will make it so that all its ancestors should be displayed) + // here is where we put items in their expected place for archy output + for (const item of seenItems) { + if (item[_include] && item[_parent]) { + item[_parent].nodes.push(item) + } + } + + if (!result.nodes.length) { + result.nodes = ['(empty)'] + } + + const archyOutput = archy(result, '', { unicode }) + return chalk.reset(archyOutput) +} + +const jsonOutput = ({ path, problems, result, rootError, seenItems }) => { + if (problems.size) { + result.problems = [...problems] + } + + if (rootError) { + result.problems = [ + ...(result.problems || []), + ...[`error in ${path}: Failed to parse root package.json`], + ] + result.invalid = true + } + + // we need to traverse the entire tree in order to determine which items should be included (since a nested transitive included dep will make it so that all its ancestors should be displayed) + // here is where we put items in their expected place for json output + for (const item of seenItems) { + // append current item to its parent item.dependencies obj in order to provide a json object structure that represents the installed tree + if (item[_include] && item[_parent]) { + if (!item[_parent].dependencies) { + item[_parent].dependencies = {} + } + + item[_parent].dependencies[item[_name]] = item + } + } + + return result +} + +const parseableOutput = ({ global, long, seenNodes }) => { + let out = '' + for (const node of seenNodes.values()) { + if (node.path && node[_include]) { + out += node.path + if (long) { + out += `:${node.pkgid}` + out += node.path !== node.realpath ? `:${node.realpath}` : '' + out += isExtraneous(node, { global }) ? ':EXTRANEOUS' : '' + out += node[_invalid] ? ':INVALID' : '' + out += node.overridden ? ':OVERRIDDEN' : '' + } + out += '\n' + } + } + return out.trim() +} diff --git a/node24/node_modules/npm/lib/commands/org.js b/node24/node_modules/npm/lib/commands/org.js new file mode 100644 index 0000000000000000000000000000000000000000..21af23228bd579f11376ed56c8fa89b10c84d67c --- /dev/null +++ b/node24/node_modules/npm/lib/commands/org.js @@ -0,0 +1,148 @@ +const liborg = require('libnpmorg') +const { otplease } = require('../utils/auth.js') +const BaseCommand = require('../base-cmd.js') +const { output } = require('proc-log') + +class Org extends BaseCommand { + static description = 'Manage orgs' + static name = 'org' + static usage = [ + 'set orgname username [developer | admin | owner]', + 'rm orgname username', + 'ls orgname []', + ] + + static params = ['registry', 'otp', 'json', 'parseable'] + + static async completion (opts) { + const argv = opts.conf.argv.remain + if (argv.length === 2) { + return ['set', 'rm', 'ls'] + } + + switch (argv[2]) { + case 'ls': + case 'add': + case 'rm': + case 'set': + return [] + default: + throw new Error(argv[2] + ' not recognized') + } + } + + async exec ([cmd, orgname, username, role]) { + return otplease(this.npm, { + ...this.npm.flatOptions, + }, opts => { + switch (cmd) { + case 'add': + case 'set': + return this.set(orgname, username, role, opts) + case 'rm': + return this.rm(orgname, username, opts) + case 'ls': + return this.ls(orgname, username, opts) + default: + throw this.usageError() + } + }) + } + + async set (org, user, role, opts) { + role = role || 'developer' + if (!org) { + throw new Error('First argument `orgname` is required.') + } + + if (!user) { + throw new Error('Second argument `username` is required.') + } + + if (!['owner', 'admin', 'developer'].find(x => x === role)) { + throw new Error( + 'Third argument `role` must be one of `owner`, `admin`, or `developer`, with `developer` being the default value if omitted.' + ) + } + + const memDeets = await liborg.set(org, user, role, opts) + if (opts.json) { + output.standard(JSON.stringify(memDeets, null, 2)) + } else if (opts.parseable) { + output.standard(['org', 'orgsize', 'user', 'role'].join('\t')) + output.standard( + [memDeets.org.name, memDeets.org.size, memDeets.user, memDeets.role].join('\t') + ) + } else if (!this.npm.silent) { + output.standard( + `Added ${memDeets.user} as ${memDeets.role} to ${memDeets.org.name}. You now have ${ + memDeets.org.size + } member${memDeets.org.size === 1 ? '' : 's'} in this org.` + ) + } + + return memDeets + } + + async rm (org, user, opts) { + if (!org) { + throw new Error('First argument `orgname` is required.') + } + + if (!user) { + throw new Error('Second argument `username` is required.') + } + + await liborg.rm(org, user, opts) + const roster = await liborg.ls(org, opts) + user = user.replace(/^[~@]?/, '') + org = org.replace(/^[~@]?/, '') + const userCount = Object.keys(roster).length + if (opts.json) { + output.buffer({ + user, + org, + userCount, + deleted: true, + }) + } else if (opts.parseable) { + output.standard(['user', 'org', 'userCount', 'deleted'].join('\t')) + output.standard([user, org, userCount, true].join('\t')) + } else if (!this.npm.silent) { + output.standard( + `Successfully removed ${user} from ${org}. You now have ${userCount} member${userCount === 1 ? '' : 's'} in this org.` + ) + } + } + + async ls (org, user, opts) { + if (!org) { + throw new Error('First argument `orgname` is required.') + } + + let roster = await liborg.ls(org, opts) + if (user) { + const newRoster = {} + if (roster[user]) { + newRoster[user] = roster[user] + } + + roster = newRoster + } + if (opts.json) { + output.buffer(roster) + } else if (opts.parseable) { + output.standard(['user', 'role'].join('\t')) + Object.keys(roster).forEach(u => { + output.standard([u, roster[u]].join('\t')) + }) + } else if (!this.npm.silent) { + const chalk = this.npm.chalk + for (const u of Object.keys(roster).sort()) { + output.standard(`${u} - ${chalk.cyan(roster[u])}`) + } + } + } +} + +module.exports = Org diff --git a/node24/node_modules/npm/lib/commands/outdated.js b/node24/node_modules/npm/lib/commands/outdated.js new file mode 100644 index 0000000000000000000000000000000000000000..d1ef0091308c77a39ced522bd0746430810f8223 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/outdated.js @@ -0,0 +1,285 @@ +const { resolve } = require('node:path') +const { stripVTControlCharacters } = require('node:util') +const pacote = require('pacote') +const table = require('text-table') +const npa = require('npm-package-arg') +const pickManifest = require('npm-pick-manifest') +const { output } = require('proc-log') +const localeCompare = require('@isaacs/string-locale-compare')('en') +const ArboristWorkspaceCmd = require('../arborist-cmd.js') + +const safeNpa = (spec) => { + try { + return npa(spec) + } catch { + return null + } +} + +// This string is load bearing and is shared with Arborist +const MISSING = 'MISSING' + +class Outdated extends ArboristWorkspaceCmd { + static description = 'Check for outdated packages' + static name = 'outdated' + static usage = ['[ ...]'] + static params = [ + 'all', + 'json', + 'long', + 'parseable', + 'global', + 'workspace', + 'before', + ] + + #tree + #list = [] + #edges = new Set() + #filterSet + + async exec (args) { + const Arborist = require('@npmcli/arborist') + const arb = new Arborist({ + ...this.npm.flatOptions, + path: this.npm.global ? resolve(this.npm.globalDir, '..') : this.npm.prefix, + }) + this.#tree = await arb.loadActual() + + if (this.workspaceNames?.length) { + this.#filterSet = arb.workspaceDependencySet( + this.#tree, + this.workspaceNames, + this.npm.flatOptions.includeWorkspaceRoot + ) + } else if (!this.npm.flatOptions.workspacesEnabled) { + this.#filterSet = arb.excludeWorkspacesDependencySet(this.#tree) + } + + if (args.length) { + for (const arg of args) { + // specific deps + this.#getEdges(this.#tree.inventory.query('name', arg), 'edgesIn') + } + } else { + if (this.npm.config.get('all')) { + // all deps in tree + this.#getEdges(this.#tree.inventory.values(), 'edgesOut') + } + // top-level deps + this.#getEdges() + } + + await Promise.all([...this.#edges].map((e) => this.#getOutdatedInfo(e))) + + // sorts list alphabetically by name and then dependent + const outdated = this.#list + .sort((a, b) => localeCompare(a.name, b.name) || localeCompare(a.dependent, b.dependent)) + + if (outdated.length) { + process.exitCode = 1 + } + + if (this.npm.config.get('json')) { + output.buffer(this.#json(outdated)) + return + } + + const res = this.npm.config.get('parseable') + ? this.#parseable(outdated) + : this.#pretty(outdated) + + if (res) { + output.standard(res) + } + } + + #getEdges (nodes, type) { + // when no nodes are provided then it should only read direct deps from the root node and its workspaces direct dependencies + if (!nodes) { + this.#getEdgesOut(this.#tree) + this.#getWorkspacesEdges() + return + } + + for (const node of nodes) { + if (type === 'edgesOut') { + this.#getEdgesOut(node) + } else { + this.#getEdgesIn(node) + } + } + } + + #getEdgesIn (node) { + for (const edge of node.edgesIn) { + this.#trackEdge(edge) + } + } + + #getEdgesOut (node) { + // TODO: normalize usage of edges and avoid looping through nodes here + const edges = this.npm.global ? node.children.values() : node.edgesOut.values() + for (const edge of edges) { + this.#trackEdge(edge) + } + } + + #trackEdge (edge) { + if (edge.from && this.#filterSet?.size > 0 && !this.#filterSet.has(edge.from.target)) { + return + } + this.#edges.add(edge) + } + + #getWorkspacesEdges () { + if (this.npm.global) { + return + } + + for (const edge of this.#tree.edgesOut.values()) { + if (edge?.to?.target?.isWorkspace) { + this.#getEdgesOut(edge.to.target) + } + } + } + + async #getPackument (spec) { + return pacote.packument(spec, { + ...this.npm.flatOptions, + fullMetadata: this.npm.config.get('long'), + preferOnline: true, + }) + } + + async #getOutdatedInfo (edge) { + const alias = safeNpa(edge.spec)?.subSpec + const spec = npa(alias ? alias.name : edge.name) + const node = edge.to || edge + const { path, location, package: { version: current } = {} } = node + + const type = edge.optional ? 'optionalDependencies' + : edge.peer ? 'peerDependencies' + : edge.dev ? 'devDependencies' + : 'dependencies' + + for (const omitType of this.npm.flatOptions.omit) { + if (node[omitType]) { + return + } + } + + // deps different from prod not currently on disk are not included in the output + if (edge.error === MISSING && type !== 'dependencies') { + return + } + + // if it's not a range, version, or tag, skip it + if (!safeNpa(`${edge.name}@${edge.spec}`)?.registry) { + return null + } + + try { + const packument = await this.#getPackument(spec) + const expected = alias ? alias.fetchSpec : edge.spec + const wanted = pickManifest(packument, expected, this.npm.flatOptions) + const latest = pickManifest(packument, '*', this.npm.flatOptions) + if (!current || current !== wanted.version || wanted.version !== latest.version) { + this.#list.push({ + name: alias ? edge.spec.replace('npm', edge.name) : edge.name, + path, + type, + current, + location, + wanted: wanted.version, + latest: latest.version, + workspaceDependent: edge.from?.isWorkspace ? edge.from.pkgid : null, + dependedByLocation: edge.from?.name + ? edge.from?.location + : 'global', + dependent: edge.from?.name ?? 'global', + homepage: packument.homepage, + }) + } + } catch (err) { + // silently catch and ignore ETARGET, E403 & E404 errors + // deps are just skipped + if (!['ETARGET', 'E404', 'E404'].includes(err.code)) { + throw err + } + } + } + + // formatting functions + + #pretty (list) { + if (!list.length) { + return + } + + const long = this.npm.config.get('long') + const { bold, yellow, red, cyan, blue } = this.npm.chalk + + return table([ + [ + 'Package', + 'Current', + 'Wanted', + 'Latest', + 'Location', + 'Depended by', + ...long ? ['Package Type', 'Homepage', 'Depended By Location'] : [], + ].map(h => bold.underline(h)), + ...list.map((d) => [ + d.current === d.wanted ? yellow(d.name) : red(d.name), + d.current ?? 'MISSING', + cyan(d.wanted), + blue(d.latest), + d.location ?? '-', + d.workspaceDependent ? blue(d.workspaceDependent) : d.dependent, + ...long ? [d.type, blue(d.homepage ?? ''), d.dependedByLocation] : [], + ]), + ], { + align: ['l', 'r', 'r', 'r', 'l'], + stringLength: s => stripVTControlCharacters(s).length, + }) + } + + // --parseable creates output like this: + // :::: + #parseable (list) { + return list.map(d => [ + d.path, + `${d.name}@${d.wanted}`, + d.current ? `${d.name}@${d.current}` : 'MISSING', + `${d.name}@${d.latest}`, + d.dependent, + ...this.npm.config.get('long') ? [d.type, d.homepage, d.dependedByLocation] : [], + ].join(':')).join('\n') + } + + #json (list) { + // TODO(BREAKING_CHANGE): this should just return an array. + // It's a list and turning it into an object with keys is lossy since multiple items in the list could have the same key. For now we hack that by only changing top level values into arrays if they have multiple outdated items + return list.reduce((acc, d) => { + const dep = { + current: d.current, + wanted: d.wanted, + latest: d.latest, + dependent: d.dependent, + location: d.path, + ...this.npm.config.get('long') ? { + type: d.type, + homepage: d.homepage, + dependedByLocation: d.dependedByLocation } : {}, + } + acc[d.name] = acc[d.name] + // If this item already has an outdated dep then we turn it into an array + ? (Array.isArray(acc[d.name]) ? acc[d.name] : [acc[d.name]]).concat(dep) + : dep + return acc + }, {}) + } +} + +module.exports = Outdated diff --git a/node24/node_modules/npm/lib/commands/owner.js b/node24/node_modules/npm/lib/commands/owner.js new file mode 100644 index 0000000000000000000000000000000000000000..f056dd004b9bc6b097ce8bac702317638c5f7e4f --- /dev/null +++ b/node24/node_modules/npm/lib/commands/owner.js @@ -0,0 +1,241 @@ +const npa = require('npm-package-arg') +const npmFetch = require('npm-registry-fetch') +const pacote = require('pacote') +const { log, output } = require('proc-log') +const { otplease } = require('../utils/auth.js') +const pkgJson = require('@npmcli/package-json') +const BaseCommand = require('../base-cmd.js') +const { redact } = require('@npmcli/redact') + +const readJson = async (path) => { + try { + const { content } = await pkgJson.normalize(path) + return content + } catch { + return {} + } +} + +class Owner extends BaseCommand { + static description = 'Manage package owners' + static name = 'owner' + static params = [ + 'registry', + 'otp', + 'workspace', + 'workspaces', + ] + + static usage = [ + 'add ', + 'rm ', + 'ls ', + ] + + static workspaces = true + static ignoreImplicitWorkspace = false + + static async completion (opts, npm) { + const argv = opts.conf.argv.remain + if (argv.length > 3) { + return [] + } + + if (argv[1] !== 'owner') { + argv.unshift('owner') + } + + if (argv.length === 2) { + return ['add', 'rm', 'ls'] + } + + // reaches registry in order to autocomplete rm + if (argv[2] === 'rm') { + if (npm.global) { + return [] + } + const { name } = await readJson(npm.prefix) + if (!name) { + return [] + } + + const spec = npa(name) + const data = await pacote.packument(spec, { + ...npm.flatOptions, + fullMetadata: true, + _isRoot: true, + }) + if (data && data.maintainers && data.maintainers.length) { + return data.maintainers.map(m => m.name) + } + } + return [] + } + + async exec ([action, ...args]) { + if (action === 'ls' || action === 'list') { + await this.ls(args[0]) + } else if (action === 'add') { + await this.changeOwners(args[0], args[1], 'add') + } else if (action === 'rm' || action === 'remove') { + await this.changeOwners(args[0], args[1], 'rm') + } else { + throw this.usageError() + } + } + + async execWorkspaces ([action, ...args]) { + await this.setWorkspaces() + // ls pkg or owner add/rm package + if ((action === 'ls' && args.length > 0) || args.length > 1) { + const implicitWorkspaces = this.npm.config.get('workspace', 'default') + if (implicitWorkspaces.length === 0) { + log.warn(`Ignoring specified workspace(s)`) + } + return this.exec([action, ...args]) + } + + for (const [name] of this.workspaces) { + if (action === 'ls' || action === 'list') { + await this.ls(name) + } else if (action === 'add') { + await this.changeOwners(args[0], name, 'add') + } else if (action === 'rm' || action === 'remove') { + await this.changeOwners(args[0], name, 'rm') + } else { + throw this.usageError() + } + } + } + + async ls (pkg) { + pkg = await this.getPkg(this.npm.prefix, pkg) + const spec = npa(pkg) + + try { + const packumentOpts = { + ...this.npm.flatOptions, + fullMetadata: + true, + preferOnline: true, + _isRoot: true, + } + const { maintainers } = await pacote.packument(spec, packumentOpts) + if (!maintainers || !maintainers.length) { + output.standard('no admin found') + } else { + output.standard(maintainers.map(m => `${m.name} <${m.email}>`).join('\n')) + } + } catch (err) { + log.error('owner ls', "Couldn't get owner data", redact(pkg)) + throw err + } + } + + async getPkg (prefix, pkg) { + if (!pkg) { + if (this.npm.global) { + throw this.usageError() + } + const { name } = await readJson(prefix) + if (!name) { + throw this.usageError() + } + + return name + } + return pkg + } + + async changeOwners (user, pkg, addOrRm) { + if (!user) { + throw this.usageError() + } + + pkg = await this.getPkg(this.npm.prefix, pkg) + log.verbose(`owner ${addOrRm}`, '%s to %s', user, pkg) + + const spec = npa(pkg) + const uri = `/-/user/org.couchdb.user:${encodeURIComponent(user)}` + let u + + try { + u = await npmFetch.json(uri, this.npm.flatOptions) + } catch (err) { + log.error('owner mutate', `Error getting user data for ${user}`) + throw err + } + + // normalize user data + u = { name: u.name, email: u.email } + + const data = await pacote.packument(spec, { + ...this.npm.flatOptions, + fullMetadata: true, + preferOnline: true, + _isRoot: true, + }) + + const owners = data.maintainers || [] + let maintainers + if (addOrRm === 'add') { + const existing = owners.find(o => o.name === u.name) + if (existing) { + log.info( + 'owner add', + `Already a package owner: ${existing.name} <${existing.email}>` + ) + return + } + maintainers = [ + ...owners, + u, + ] + } else { + maintainers = owners.filter(o => o.name !== u.name) + + if (maintainers.length === owners.length) { + log.info('owner rm', 'Not a package owner: ' + u.name) + return false + } + + if (!maintainers.length) { + throw Object.assign( + new Error( + 'Cannot remove all owners of a package. Add someone else first.' + ), + { code: 'EOWNERRM' } + ) + } + } + + const dataPath = `/${spec.escapedName}/-rev/${encodeURIComponent(data._rev)}` + try { + const res = await otplease(this.npm, this.npm.flatOptions, opts => { + return npmFetch.json(dataPath, { + ...opts, + method: 'PUT', + body: { + _id: data._id, + _rev: data._rev, + maintainers, + }, + spec, + }) + }) + if (addOrRm === 'add') { + output.standard(`+ ${user} (${spec.name})`) + } else { + output.standard(`- ${user} (${spec.name})`) + } + return res + } catch (err) { + throw Object.assign( + new Error('Failed to update package: ' + JSON.stringify(err.message)), + { code: 'EOWNERMUTATE' } + ) + } + } +} + +module.exports = Owner diff --git a/node24/node_modules/npm/lib/commands/pack.js b/node24/node_modules/npm/lib/commands/pack.js new file mode 100644 index 0000000000000000000000000000000000000000..90fcf92f544705c39c06059e8575fe949d7f2d05 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/pack.js @@ -0,0 +1,89 @@ +const pacote = require('pacote') +const libpack = require('libnpmpack') +const npa = require('npm-package-arg') +const { log, output } = require('proc-log') +const { getContents, logTar } = require('../utils/tar.js') +const BaseCommand = require('../base-cmd.js') + +class Pack extends BaseCommand { + static description = 'Create a tarball from a package' + static name = 'pack' + static params = [ + 'dry-run', + 'json', + 'pack-destination', + 'workspace', + 'workspaces', + 'include-workspace-root', + 'ignore-scripts', + ] + + static usage = [''] + static workspaces = true + static ignoreImplicitWorkspace = false + + async exec (args) { + if (args.length === 0) { + args = ['.'] + } + + const unicode = this.npm.config.get('unicode') + const json = this.npm.config.get('json') + + const Arborist = require('@npmcli/arborist') + // Get the manifests and filenames first so we can bail early on manifest errors before making any tarballs + const manifests = [] + for (const arg of args) { + const spec = npa(arg) + const manifest = await pacote.manifest(spec, { + ...this.npm.flatOptions, + Arborist, + preferOnline: true, + _isRoot: true, + }) + if (!manifest._id) { + throw new Error('Invalid package, must have name and version') + } + manifests.push({ arg, manifest }) + } + + // Load tarball names up for printing afterward to isolate from the noise generated during packing + const tarballs = [] + for (const { arg, manifest } of manifests) { + const tarballData = await libpack(arg, { + ...this.npm.flatOptions, + foregroundScripts: this.npm.config.isDefault('foreground-scripts') + ? true + : this.npm.config.get('foreground-scripts'), + preferOnline: true, + prefix: this.npm.localPrefix, + workspaces: this.workspacePaths, + }) + tarballs.push(await getContents(manifest, tarballData)) + } + + for (const [index, tar] of Object.entries(tarballs)) { + // XXX(BREAKING_CHANGE): publish outputs a json object with package names as keys. + // Pack should do the same here instead of an array + logTar(tar, { unicode, json, key: index }) + if (!json) { + output.standard(tar.filename.replace(/^@/, '').replace(/\//, '-')) + } + } + } + + async execWorkspaces (args) { + // If they either ask for nothing, or explicitly include '.' in the args, we effectively translate that into each workspace requested + const useWorkspaces = args.length === 0 || args.includes('.') + + if (!useWorkspaces) { + log.warn('Ignoring workspaces for specified package(s)') + return this.exec(args) + } + + await this.setWorkspaces() + return this.exec([...this.workspacePaths, ...args.filter(a => a !== '.')]) + } +} + +module.exports = Pack diff --git a/node24/node_modules/npm/lib/commands/ping.js b/node24/node_modules/npm/lib/commands/ping.js new file mode 100644 index 0000000000000000000000000000000000000000..988fbcaec421555b160c4dfee71d4e73b4ba137a --- /dev/null +++ b/node24/node_modules/npm/lib/commands/ping.js @@ -0,0 +1,30 @@ +const { redact } = require('@npmcli/redact') +const { log, output } = require('proc-log') +const pingUtil = require('../utils/ping.js') +const BaseCommand = require('../base-cmd.js') + +class Ping extends BaseCommand { + static description = 'Ping npm registry' + static params = ['registry'] + static name = 'ping' + + async exec () { + const cleanRegistry = redact(this.npm.config.get('registry')) + log.notice('PING', cleanRegistry) + const start = Date.now() + const details = await pingUtil({ ...this.npm.flatOptions }) + const time = Date.now() - start + log.notice('PONG', `${time}ms`) + if (this.npm.config.get('json')) { + output.buffer({ + registry: cleanRegistry, + time, + details, + }) + } else if (Object.keys(details).length) { + log.notice('PONG', JSON.stringify(details, null, 2)) + } + } +} + +module.exports = Ping diff --git a/node24/node_modules/npm/lib/commands/pkg.js b/node24/node_modules/npm/lib/commands/pkg.js new file mode 100644 index 0000000000000000000000000000000000000000..486af5bb5d242836a8181fff40d2648f0553a820 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/pkg.js @@ -0,0 +1,127 @@ +const { output } = require('proc-log') +const PackageJson = require('@npmcli/package-json') +const BaseCommand = require('../base-cmd.js') +const Queryable = require('../utils/queryable.js') + +class Pkg extends BaseCommand { + static description = 'Manages your package.json' + static name = 'pkg' + static usage = [ + 'set = [= ...]', + 'get [ [ ...]]', + 'delete [ ...]', + 'set [[].= ...]', + 'set [[].= ...]', + 'fix', + ] + + static params = [ + 'force', + 'json', + 'workspace', + 'workspaces', + ] + + static workspaces = true + static ignoreImplicitWorkspace = false + + async exec (args, { path = this.npm.localPrefix, workspace } = {}) { + if (this.npm.global) { + throw Object.assign( + new Error(`There's no package.json file to manage on global mode`), + { code: 'EPKGGLOBAL' } + ) + } + + const [cmd, ..._args] = args + switch (cmd) { + case 'get': + return this.get(_args, { path, workspace }) + case 'set': + return this.set(_args, { path, workspace }).then(p => p.save()) + case 'delete': + return this.delete(_args, { path, workspace }).then(p => p.save()) + case 'fix': + return PackageJson.fix(path).then(p => p.save()) + default: + throw this.usageError() + } + } + + async execWorkspaces (args) { + await this.setWorkspaces() + for (const [workspace, path] of this.workspaces.entries()) { + await this.exec(args, { path, workspace }) + } + } + + async get (args, { path, workspace }) { + this.npm.config.set('json', true) + const pkgJson = await PackageJson.load(path) + + let result = pkgJson.content + + if (args.length) { + result = new Queryable(result).query(args) + // in case there's only a single argument and a single result from the query just prints that one element to stdout. + // TODO(BREAKING_CHANGE): much like other places where we unwrap single item arrays this should go away. + // it makes the behavior unknown for users who don't already know the shape of the data. + if (Object.keys(result).length === 1 && args.length === 1) { + result = result[args] + } + } + + // The display layer is responsible for calling JSON.stringify on the result + // TODO: https://github.com/npm/cli/issues/5508 a raw mode has been requested similar to jq -r. + // If that was added then this method should no longer set `json:true` all the time + output.buffer(workspace ? { [workspace]: result } : result) + } + + async set (args, { path }) { + const setError = () => + this.usageError('npm pkg set expects a key=value pair of args.') + + if (!args.length) { + throw setError() + } + + const force = this.npm.config.get('force') + const json = this.npm.config.get('json') + const pkgJson = await PackageJson.load(path) + const q = new Queryable(pkgJson.content) + for (const arg of args) { + const [key, ...rest] = arg.split('=') + const value = rest.join('=') + if (!key || !value) { + throw setError() + } + + q.set(key, json ? JSON.parse(value) : value, { force }) + } + + return pkgJson.update(q.toJSON()) + } + + async delete (args, { path }) { + const setError = () => + this.usageError('npm pkg delete expects key args.') + + if (!args.length) { + throw setError() + } + + const pkgJson = await PackageJson.load(path) + const q = new Queryable(pkgJson.content) + for (const key of args) { + if (!key) { + throw setError() + } + + q.delete(key) + } + + return pkgJson.update(q.toJSON()) + } +} + +module.exports = Pkg diff --git a/node24/node_modules/npm/lib/commands/prefix.js b/node24/node_modules/npm/lib/commands/prefix.js new file mode 100644 index 0000000000000000000000000000000000000000..6d1d89c5ca3662fbdc66e8cd9df6b1b94d6846c2 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/prefix.js @@ -0,0 +1,14 @@ +const { output } = require('proc-log') +const BaseCommand = require('../base-cmd.js') + +class Prefix extends BaseCommand { + static description = 'Display prefix' + static name = 'prefix' + static params = ['global'] + + async exec () { + return output.standard(this.npm.prefix) + } +} + +module.exports = Prefix diff --git a/node24/node_modules/npm/lib/commands/profile.js b/node24/node_modules/npm/lib/commands/profile.js new file mode 100644 index 0000000000000000000000000000000000000000..ea5de9508092aeef932294c32a9e10445d211cbe --- /dev/null +++ b/node24/node_modules/npm/lib/commands/profile.js @@ -0,0 +1,366 @@ +const { inspect } = require('node:util') +const { URL } = require('node:url') +const { log, output } = require('proc-log') +const { get, set, createToken } = require('npm-profile') +const qrcodeTerminal = require('qrcode-terminal') +const { otplease } = require('../utils/auth.js') +const readUserInfo = require('../utils/read-user-info.js') +const BaseCommand = require('../base-cmd.js') + +const qrcode = url => + new Promise((resolve) => qrcodeTerminal.generate(url, resolve)) + +const knownProfileKeys = [ + 'name', + 'email', + 'two-factor auth', + 'fullname', + 'homepage', + 'freenode', + 'twitter', + 'github', + 'created', + 'updated', +] + +const writableProfileKeys = [ + 'email', + 'password', + 'fullname', + 'homepage', + 'freenode', + 'twitter', + 'github', +] + +class Profile extends BaseCommand { + static description = 'Change settings on your registry profile' + static name = 'profile' + static usage = [ + 'enable-2fa [auth-only|auth-and-writes]', + 'disable-2fa', + 'get []', + 'set ', + ] + + static params = [ + 'registry', + 'json', + 'parseable', + 'otp', + ] + + static async completion (opts) { + var argv = opts.conf.argv.remain + + if (!argv[2]) { + return ['enable-2fa', 'disable-2fa', 'get', 'set'] + } + + switch (argv[2]) { + case 'enable-2fa': + case 'enable-tfa': + return ['auth-and-writes', 'auth-only'] + + case 'disable-2fa': + case 'disable-tfa': + case 'get': + case 'set': + return [] + default: + throw new Error(argv[2] + ' not recognized') + } + } + + async exec (args) { + if (args.length === 0) { + throw this.usageError() + } + + const [subcmd, ...opts] = args + + switch (subcmd) { + case 'enable-2fa': + case 'enable-tfa': + case 'enable2fa': + case 'enabletfa': + return this.enable2fa(opts) + case 'disable-2fa': + case 'disable-tfa': + case 'disable2fa': + case 'disabletfa': + return this.disable2fa() + case 'get': + return this.get(opts) + case 'set': + return this.set(opts) + default: + throw new Error('Unknown profile command: ' + subcmd) + } + } + + async get (args) { + const tfa = 'two-factor auth' + const info = await get({ ...this.npm.flatOptions }) + + if (!info.cidr_whitelist) { + delete info.cidr_whitelist + } + + if (this.npm.config.get('json')) { + output.buffer(info) + return + } + + // clean up and format key/values for output + const cleaned = {} + for (const key of knownProfileKeys) { + cleaned[key] = info[key] || '' + } + + const unknownProfileKeys = Object.keys(info).filter((k) => !(k in cleaned)) + for (const key of unknownProfileKeys) { + cleaned[key] = info[key] || '' + } + + delete cleaned.tfa + delete cleaned.email_verified + cleaned.email += info.email_verified ? ' (verified)' : '(unverified)' + + if (info.tfa && !info.tfa.pending) { + cleaned[tfa] = info.tfa.mode + } else { + cleaned[tfa] = 'disabled' + } + + if (args.length) { + const values = args // comma or space separated + .join(',') + .split(/,/) + .filter((arg) => arg.trim() !== '') + .map((arg) => cleaned[arg]) + .join('\t') + output.standard(values) + } else { + if (this.npm.config.get('parseable')) { + for (const key of Object.keys(info)) { + if (key === 'tfa') { + output.standard(`${key}\t${cleaned[tfa]}`) + } else { + output.standard(`${key}\t${info[key]}`) + } + } + } else { + for (const [key, value] of Object.entries(cleaned)) { + output.standard(`${key}: ${value}`) + } + } + } + } + + async set (args) { + const conf = { ...this.npm.flatOptions } + const prop = (args[0] || '').toLowerCase().trim() + + let value = args.length > 1 ? args.slice(1).join(' ') : null + + const readPasswords = async () => { + const newpassword = await readUserInfo.password('New password: ') + const confirmedpassword = await readUserInfo.password(' Again: ') + + if (newpassword !== confirmedpassword) { + log.warn('profile', 'Passwords do not match, please try again.') + return readPasswords() + } + + return newpassword + } + + if (prop !== 'password' && value === null) { + throw new Error('npm profile set ') + } + + if (prop === 'password' && value !== null) { + throw new Error( + 'npm profile set password\n' + + 'Do not include your current or new passwords on the command line.') + } + + if (writableProfileKeys.indexOf(prop) === -1) { + throw new Error(`"${prop}" is not a property we can set. ` + + `Valid properties are: ` + writableProfileKeys.join(', ')) + } + + if (prop === 'password') { + const current = await readUserInfo.password('Current password: ') + const newpassword = await readPasswords() + + value = { old: current, new: newpassword } + } + + // FIXME: Work around to not clear everything other than what we're setting + const user = await get(conf) + const newUser = {} + + for (const key of writableProfileKeys) { + newUser[key] = user[key] + } + + newUser[prop] = value + + const result = await otplease(this.npm, conf, c => set(newUser, c)) + + if (this.npm.config.get('json')) { + output.buffer({ [prop]: result[prop] }) + } else if (this.npm.config.get('parseable')) { + output.standard(prop + '\t' + result[prop]) + } else if (result[prop] != null) { + output.standard('Set', prop, 'to', result[prop]) + } else { + output.standard('Set', prop) + } + } + + async enable2fa (args) { + const conf = { ...this.npm.flatOptions } + + if (args.length > 1) { + throw new Error('npm profile enable-2fa [auth-and-writes|auth-only]') + } + + const mode = args[0] || 'auth-and-writes' + if (mode !== 'auth-only' && mode !== 'auth-and-writes') { + throw new Error( + `Invalid two-factor authentication mode "${mode}".\n` + + 'Valid modes are:\n' + + ' auth-only - Require two-factor authentication only when logging in\n' + + ' auth-and-writes - Require two-factor authentication when logging in ' + + 'AND when publishing' + ) + } + + if (this.npm.config.get('json') || this.npm.config.get('parseable')) { + throw new Error( + 'Enabling two-factor authentication is an interactive operation and ' + + (this.npm.config.get('json') ? 'JSON' : 'parseable') + ' output mode is not available' + ) + } + + const userInfo = await get(conf) + + if (!userInfo?.tfa?.pending && userInfo?.tfa?.mode === mode) { + output.standard('Two factor authentication is already enabled and set to ' + mode) + return + } + + const info = { + tfa: { + mode, + }, + } + + // if they're using legacy auth currently then we have to update them to a bearer token before continuing. + const creds = this.npm.config.getCredentialsByURI(this.npm.config.get('registry')) + const auth = {} + + if (creds.token) { + auth.token = creds.token + } else if (creds.username) { + auth.basic = { username: creds.username, password: creds.password } + } else if (creds.auth) { + const basic = Buffer.from(creds.auth, 'base64').toString().split(':', 2) + auth.basic = { username: basic[0], password: basic[1] } + } + + if (!auth.basic && !auth.token) { + throw new Error( + 'You need to be logged in to registry ' + + `${this.npm.config.get('registry')} in order to enable 2fa` + ) + } + + if (auth.basic) { + log.info('profile', 'Updating authentication to bearer token') + const result = await createToken( + auth.basic.password, false, [], { ...this.npm.flatOptions } + ) + + if (!result.token) { + throw new Error(`Your registry ${this.npm.config.get('registry')} does not seem to support bearer tokens. Bearer tokens are required for two-factor authentication.`) + } + + this.npm.config.setCredentialsByURI( + this.npm.config.get('registry'), + { token: result.token } + ) + await this.npm.config.save('user') + } + + log.notice('profile', 'Enabling two factor authentication for ' + mode) + const password = await readUserInfo.password() + info.tfa.password = password + + if (userInfo && userInfo.tfa && userInfo.tfa.pending) { + log.info('profile', 'Resetting two-factor authentication') + await set({ tfa: { password, mode: 'disable' } }, conf) + } + + log.info('profile', 'Setting two-factor authentication to ' + mode) + const challenge = await otplease(this.npm, conf, o => set(info, o)) + + if (challenge.tfa && challenge.tfa.mode) { + output.standard('Two factor authentication mode changed to: ' + mode) + return + } + + const badResponse = typeof challenge.tfa !== 'string' + || !/^otpauth:[/][/]/.test(challenge.tfa) + if (badResponse) { + throw new Error(`Unknown error enabling two-factor authentication. Expected otpauth URL, got: ${inspect(challenge.tfa)}`) + } + + const otpauth = new URL(challenge.tfa) + const secret = otpauth.searchParams.get('secret') + const code = await qrcode(challenge.tfa) + + output.standard('Scan into your authenticator app:\n' + code + '\n Or enter code:', secret) + + const interactiveOTP = await readUserInfo.otp('And an OTP code from your authenticator: ') + + log.info('profile', 'Finalizing two-factor authentication') + + const result = await set({ tfa: [interactiveOTP] }, conf) + + output.standard('2FA successfully enabled. Below are your recovery codes, please print these out.') + output.standard('You will need these to recover access to your account if you lose your authentication device.') + + for (const tfaCode of result.tfa) { + output.standard('\t' + tfaCode) + } + } + + async disable2fa () { + const opts = { ...this.npm.flatOptions } + const info = await get(opts) + + if (!info.tfa || info.tfa.pending) { + output.standard('Two factor authentication not enabled.') + return + } + + const password = await readUserInfo.password() + + log.info('profile', 'disabling tfa') + await otplease(this.npm, opts, o => set({ tfa: { password: password, mode: 'disable' } }, o)) + + if (this.npm.config.get('json')) { + output.buffer({ tfa: false }) + } else if (this.npm.config.get('parseable')) { + output.standard('tfa\tfalse') + } else { + output.standard('Two factor authentication disabled.') + } + } +} + +module.exports = Profile diff --git a/node24/node_modules/npm/lib/commands/prune.js b/node24/node_modules/npm/lib/commands/prune.js new file mode 100644 index 0000000000000000000000000000000000000000..243f9d229559fac8de5b5c8909ee7565c72a3605 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/prune.js @@ -0,0 +1,33 @@ +const reifyFinish = require('../utils/reify-finish.js') +const ArboristWorkspaceCmd = require('../arborist-cmd.js') + +class Prune extends ArboristWorkspaceCmd { + static description = 'Remove extraneous packages' + static name = 'prune' + static params = [ + 'omit', + 'include', + 'dry-run', + 'json', + 'foreground-scripts', + 'ignore-scripts', + ...super.params, + ] + + static usage = ['[[<@scope>/]...]'] + + async exec () { + const where = this.npm.prefix + const Arborist = require('@npmcli/arborist') + const opts = { + ...this.npm.flatOptions, + path: where, + workspaces: this.workspaceNames, + } + const arb = new Arborist(opts) + await arb.prune(opts) + await reifyFinish(this.npm, arb) + } +} + +module.exports = Prune diff --git a/node24/node_modules/npm/lib/commands/publish.js b/node24/node_modules/npm/lib/commands/publish.js new file mode 100644 index 0000000000000000000000000000000000000000..f9d7c8c213ee1f66c0ad5b2a63358a81f2ec0b14 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/publish.js @@ -0,0 +1,277 @@ +const { log, output } = require('proc-log') +const semver = require('semver') +const pack = require('libnpmpack') +const libpub = require('libnpmpublish').publish +const runScript = require('@npmcli/run-script') +const pacote = require('pacote') +const npa = require('npm-package-arg') +const npmFetch = require('npm-registry-fetch') +const { redactLog: replaceInfo } = require('@npmcli/redact') +const { otplease } = require('../utils/auth.js') +const { getContents, logTar } = require('../utils/tar.js') +// for historical reasons, publishConfig in package.json can contain ANY config keys that npm supports in .npmrc files and elsewhere. +// We *may* want to revisit this at some point, and have a minimal set that's a SemVer-major change that ought to get a RFC written on it. +const { flatten } = require('@npmcli/config/lib/definitions') +const pkgJson = require('@npmcli/package-json') +const BaseCommand = require('../base-cmd.js') +const { oidc } = require('../../lib/utils/oidc.js') + +class Publish extends BaseCommand { + static description = 'Publish a package' + static name = 'publish' + static params = [ + 'tag', + 'access', + 'dry-run', + 'otp', + 'workspace', + 'workspaces', + 'include-workspace-root', + 'provenance', + ] + + static usage = [''] + static workspaces = true + static ignoreImplicitWorkspace = false + + async exec (args) { + if (args.length === 0) { + args = ['.'] + } + if (args.length !== 1) { + throw this.usageError() + } + + await this.#publish(args) + } + + async execWorkspaces (args) { + const useWorkspaces = args.length === 0 || args.includes('.') + if (!useWorkspaces) { + log.warn('Ignoring workspaces for specified package(s)') + return this.exec(args) + } + await this.setWorkspaces() + + for (const [name, workspace] of this.workspaces.entries()) { + try { + await this.#publish([workspace], { workspace: name }) + } catch (err) { + if (err.code !== 'EPRIVATE') { + throw err + } + log.warn('publish', `Skipping workspace ${this.npm.chalk.cyan(name)}, marked as ${this.npm.chalk.bold('private')}`) + } + } + } + + async #publish (args, { workspace } = {}) { + log.verbose('publish', replaceInfo(args)) + + const unicode = this.npm.config.get('unicode') + const dryRun = this.npm.config.get('dry-run') + const json = this.npm.config.get('json') + const defaultTag = this.npm.config.get('tag') + const ignoreScripts = this.npm.config.get('ignore-scripts') + const { silent } = this.npm + + if (semver.validRange(defaultTag)) { + throw new Error('Tag name must not be a valid SemVer range: ' + defaultTag.trim()) + } + + const opts = { ...this.npm.flatOptions, progress: false } + + // you can publish name@version, ./foo.tgz, etc even though the default is the 'file:.' cwd. + const spec = npa(args[0]) + let manifest = await this.#getManifest(spec, opts) + + // only run scripts for directory type publishes + if (spec.type === 'directory' && !ignoreScripts) { + await runScript({ + event: 'prepublishOnly', + path: spec.fetchSpec, + stdio: 'inherit', + pkg: manifest, + }) + } + + // we pass dryRun: true to libnpmpack so it doesn't write the file to disk + const tarballData = await pack(spec, { + ...opts, + foregroundScripts: this.npm.config.isDefault('foreground-scripts') + ? true + : this.npm.config.get('foreground-scripts'), + dryRun: true, + prefix: this.npm.localPrefix, + workspaces: this.workspacePaths, + }) + const pkgContents = await getContents(manifest, tarballData) + const logPkg = () => logTar(pkgContents, { unicode, json, key: workspace }) + + // The purpose of re-reading the manifest is in case it changed, so that we send the latest and greatest thing to the registry note that publishConfig might have changed as well! + manifest = await this.#getManifest(spec, opts, true) + const force = this.npm.config.get('force') + const isDefaultTag = this.npm.config.isDefault('tag') && !manifest.publishConfig?.tag + + if (!force) { + const isPreRelease = Boolean(semver.parse(manifest.version).prerelease.length) + if (isPreRelease && isDefaultTag) { + throw new Error('You must specify a tag using --tag when publishing a prerelease version.') + } + } + + // If we are not in JSON mode then we show the user the contents of the tarball before it is published so they can see it while their otp is pending + if (!json) { + logPkg() + } + + const resolved = npa.resolve(manifest.name, manifest.version) + + // make sure tag is valid, this will throw if invalid + npa(`${manifest.name}@${defaultTag}`) + + const registry = npmFetch.pickRegistry(resolved, opts) + + await oidc({ packageName: manifest.name, registry, opts, config: this.npm.config }) + + const creds = this.npm.config.getCredentialsByURI(registry) + const noCreds = !(creds.token || creds.username || creds.certfile && creds.keyfile) + const outputRegistry = replaceInfo(registry) + + // if a workspace package is marked private then we skip it + if (workspace && manifest.private) { + throw Object.assign( + new Error(`This package has been marked as private + Remove the 'private' field from the package.json to publish it.`), + { code: 'EPRIVATE' } + ) + } + + if (noCreds) { + const msg = `This command requires you to be logged in to ${outputRegistry}` + if (dryRun) { + log.warn('', `${msg} (dry-run)`) + } else { + throw Object.assign(new Error(msg), { code: 'ENEEDAUTH' }) + } + } + + if (!force) { + const { highestVersion, versions } = await this.#registryVersions(resolved, registry) + /* eslint-disable-next-line max-len */ + const highestVersionIsGreater = !!highestVersion && semver.gte(highestVersion, manifest.version) + + if (versions.includes(manifest.version)) { + throw new Error(`You cannot publish over the previously published versions: ${manifest.version}.`) + } + + if (highestVersionIsGreater && isDefaultTag) { + throw new Error(`Cannot implicitly apply the "latest" tag because previously published version ${highestVersion} is higher than the new version ${manifest.version}. You must specify a tag using --tag.`) + } + } + + const access = opts.access === null ? 'default' : opts.access + let msg = `Publishing to ${outputRegistry} with tag ${defaultTag} and ${access} access` + if (dryRun) { + msg = `${msg} (dry-run)` + } + + log.notice('', msg) + + if (!dryRun) { + await otplease(this.npm, opts, o => libpub(manifest, tarballData, o)) + } + + // In json mode we don't log until the publish has completed as this will add it to the output only if completes successfully + if (json) { + logPkg() + } + + if (spec.type === 'directory' && !ignoreScripts) { + await runScript({ + event: 'publish', + path: spec.fetchSpec, + stdio: 'inherit', + pkg: manifest, + }) + + await runScript({ + event: 'postpublish', + path: spec.fetchSpec, + stdio: 'inherit', + pkg: manifest, + }) + } + + if (!json && !silent) { + output.standard(`+ ${pkgContents.id}`) + } + } + + async #registryVersions (spec, registry) { + try { + const packument = await pacote.packument(spec, { + ...this.npm.flatOptions, + preferOnline: true, + registry, + _isRoot: true, + }) + if (typeof packument?.versions === 'undefined') { + return { versions: [], highestVersion: null } + } + const ordered = Object.keys(packument?.versions) + .flatMap(v => { + const s = new semver.SemVer(v) + if ((s.prerelease.length > 0) || packument.versions[v].deprecated) { + return [] + } + return s + }) + .sort((a, b) => b.compare(a)) + const highestVersion = ordered.length >= 1 ? ordered[0].version : null + const versions = ordered.map(v => v.version) + return { versions, highestVersion } + } catch (e) { + return { versions: [], highestVersion: null } + } + } + + // if it's a directory, read it from the file system + // otherwise, get the full metadata from whatever it is + // XXX can't pacote read the manifest from a directory? + async #getManifest (spec, opts, logWarnings = false) { + let manifest + if (spec.type === 'directory') { + const changes = [] + const pkg = await pkgJson.fix(spec.fetchSpec, { changes }) + if (changes.length && logWarnings) { + log.warn('publish', 'npm auto-corrected some errors in your package.json when publishing. Please run "npm pkg fix" to address these errors.') + log.warn('publish', `errors corrected:\n${changes.join('\n')}`) + } + // Prepare is the special function for publishing, different than normalize + const { content } = await pkg.prepare() + manifest = content + } else { + manifest = await pacote.manifest(spec, { + ...opts, + fullmetadata: true, + fullReadJson: true, + }) + } + if (manifest.publishConfig) { + const cliFlags = this.npm.config.data.get('cli').raw + // Filter out properties set in CLI flags to prioritize them over corresponding `publishConfig` settings + const filteredPublishConfig = Object.fromEntries( + Object.entries(manifest.publishConfig).filter(([key]) => !(key in cliFlags))) + if (logWarnings) { + for (const key in filteredPublishConfig) { + this.npm.config.checkUnknown('publishConfig', key) + } + } + flatten(filteredPublishConfig, opts) + } + return manifest + } +} + +module.exports = Publish diff --git a/node24/node_modules/npm/lib/commands/query.js b/node24/node_modules/npm/lib/commands/query.js new file mode 100644 index 0000000000000000000000000000000000000000..a9cd2129e96eba41a4aff43d184e19615a08621e --- /dev/null +++ b/node24/node_modules/npm/lib/commands/query.js @@ -0,0 +1,139 @@ +const { resolve } = require('node:path') +const BaseCommand = require('../base-cmd.js') +const { log, output } = require('proc-log') + +class QuerySelectorItem { + constructor (node) { + // all enumerable properties from the target + Object.assign(this, node.target.package) + + // append extra info + this.pkgid = node.target.pkgid + this.location = node.target.location + this.path = node.target.path + this.realpath = node.target.realpath + this.resolved = node.target.resolved + this.from = [] + this.to = [] + this.dev = node.target.dev + this.inBundle = node.target.inBundle + this.deduped = this.from.length > 1 + this.overridden = node.overridden + this.queryContext = node.queryContext + for (const edge of node.target.edgesIn) { + this.from.push(edge.from.location) + } + for (const [, edge] of node.target.edgesOut) { + if (edge.to) { + this.to.push(edge.to.location) + } + } + } +} + +class Query extends BaseCommand { + #response = [] // response is the query response + #seen = new Set() // paths we've seen so we can keep response deduped + + static description = 'Retrieve a filtered list of packages' + static name = 'query' + static usage = [''] + + static workspaces = true + static ignoreImplicitWorkspace = false + + static params = [ + 'global', + 'workspace', + 'workspaces', + 'include-workspace-root', + 'package-lock-only', + 'expect-results', + ] + + constructor (...args) { + super(...args) + this.npm.config.set('json', true) + } + + async exec (args) { + const packageLockOnly = this.npm.config.get('package-lock-only') + const Arborist = require('@npmcli/arborist') + const arb = new Arborist({ + ...this.npm.flatOptions, + // one dir up from wherever node_modules lives + path: resolve(this.npm.dir, '..'), + forceActual: !packageLockOnly, + }) + let tree + if (packageLockOnly) { + try { + tree = await arb.loadVirtual() + } catch (err) { + log.verbose('loadVirtual', err.stack) + throw this.usageError( + 'A package lock or shrinkwrap file is required in package-lock-only mode' + ) + } + } else { + tree = await arb.loadActual() + } + await this.#queryTree(tree, args[0]) + this.#output() + } + + async execWorkspaces (args) { + await this.setWorkspaces() + const packageLockOnly = this.npm.config.get('package-lock-only') + const Arborist = require('@npmcli/arborist') + const arb = new Arborist({ + ...this.npm.flatOptions, + path: this.npm.prefix, + forceActual: !packageLockOnly, + }) + let tree + if (packageLockOnly) { + try { + tree = await arb.loadVirtual() + } catch (err) { + log.verbose('loadVirtual', err.stack) + throw this.usageError( + 'A package lock or shrinkwrap file is required in package-lock-only mode' + ) + } + } else { + tree = await arb.loadActual() + } + for (const path of this.workspacePaths) { + const wsTree = path === tree.root.path + ? tree // --includes-workspace-root + : await tree.querySelectorAll(`.workspace:path(${path})`).then(r => r[0]?.target) + if (wsTree) { + await this.#queryTree(wsTree, args[0]) + } + } + this.#output() + } + + #output () { + this.checkExpected(this.#response.length) + output.buffer(this.#response) + } + + // builds a normalized inventory + async #queryTree (tree, arg) { + const items = await tree.querySelectorAll(arg, this.npm.flatOptions) + for (const node of items) { + const { location } = node.target + if (!location || !this.#seen.has(location)) { + const item = new QuerySelectorItem(node) + this.#response.push(item) + if (location) { + this.#seen.add(item.location) + } + } + } + } +} + +module.exports = Query diff --git a/node24/node_modules/npm/lib/commands/rebuild.js b/node24/node_modules/npm/lib/commands/rebuild.js new file mode 100644 index 0000000000000000000000000000000000000000..801c5e19db6a6db9a34bc16c685e2354433fdc29 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/rebuild.js @@ -0,0 +1,82 @@ +const { resolve } = require('node:path') +const { output } = require('proc-log') +const npa = require('npm-package-arg') +const semver = require('semver') +const ArboristWorkspaceCmd = require('../arborist-cmd.js') + +class Rebuild extends ArboristWorkspaceCmd { + static description = 'Rebuild a package' + static name = 'rebuild' + static params = [ + 'global', + 'bin-links', + 'foreground-scripts', + 'ignore-scripts', + ...super.params, + ] + + static usage = ['[] ...]'] + + static async completion (opts, npm) { + const completion = require('../utils/installed-deep.js') + return completion(npm, opts) + } + + async exec (args) { + const globalTop = resolve(this.npm.globalDir, '..') + const where = this.npm.global ? globalTop : this.npm.prefix + const Arborist = require('@npmcli/arborist') + const arb = new Arborist({ + ...this.npm.flatOptions, + path: where, + // TODO when extending ReifyCmd + // workspaces: this.workspaceNames, + }) + + if (args.length) { + // get the set of nodes matching the name that we want rebuilt + const tree = await arb.loadActual() + const specs = args.map(arg => { + const spec = npa(arg) + if (spec.rawSpec === '*') { + return spec + } + + if (spec.type !== 'range' && spec.type !== 'version' && spec.type !== 'directory') { + throw new Error('`npm rebuild` only supports SemVer version/range specifiers') + } + + return spec + }) + const nodes = tree.inventory.filter(node => this.isNode(specs, node)) + + await arb.rebuild({ nodes }) + } else { + await arb.rebuild() + } + + output.standard('rebuilt dependencies successfully') + } + + isNode (specs, node) { + return specs.some(spec => { + if (spec.type === 'directory') { + return node.path === spec.fetchSpec + } + + if (spec.name !== node.name) { + return false + } + + if (spec.rawSpec === '' || spec.rawSpec === '*') { + return true + } + + const { version } = node.package + // TODO: add tests for a package with missing version + return semver.satisfies(version, spec.fetchSpec) + }) + } +} + +module.exports = Rebuild diff --git a/node24/node_modules/npm/lib/commands/repo.js b/node24/node_modules/npm/lib/commands/repo.js new file mode 100644 index 0000000000000000000000000000000000000000..572e51710e843e03b0ac8e5eda308fa4c415403f --- /dev/null +++ b/node24/node_modules/npm/lib/commands/repo.js @@ -0,0 +1,55 @@ +const { URL } = require('node:url') +const PackageUrlCmd = require('../package-url-cmd.js') + +class Repo extends PackageUrlCmd { + static description = 'Open package repository page in the browser' + static name = 'repo' + + getUrl (spec, mani) { + const r = mani.repository + const rurl = !r ? null + : typeof r === 'string' ? r + : typeof r === 'object' && typeof r.url === 'string' ? r.url + : null + + if (!rurl) { + throw Object.assign(new Error('no repository'), { + pkgid: spec, + }) + } + + const info = this.hostedFromMani(mani) + const url = info ? + info.browse(mani.repository.directory) : unknownHostedUrl(rurl) + + if (!url) { + throw Object.assign(new Error('no repository: could not get url'), { + pkgid: spec, + }) + } + return url + } +} + +module.exports = Repo + +const unknownHostedUrl = url => { + try { + const { + protocol, + hostname, + pathname, + } = new URL(url) + + /* istanbul ignore next - URL ctor should prevent this */ + if (!protocol || !hostname) { + return null + } + + const proto = /(git\+)http:$/.test(protocol) ? 'http:' : 'https:' + const path = pathname.replace(/\.git$/, '') + return `${proto}//${hostname}${path}` + } catch { + return null + } +} diff --git a/node24/node_modules/npm/lib/commands/restart.js b/node24/node_modules/npm/lib/commands/restart.js new file mode 100644 index 0000000000000000000000000000000000000000..5d20973919643f7dad5904e34c3d6c6f14e6ce56 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/restart.js @@ -0,0 +1,13 @@ +const LifecycleCmd = require('../lifecycle-cmd.js') + +// This ends up calling run(['restart', ...args]) +class Restart extends LifecycleCmd { + static description = 'Restart a package' + static name = 'restart' + static params = [ + 'ignore-scripts', + 'script-shell', + ] +} + +module.exports = Restart diff --git a/node24/node_modules/npm/lib/commands/root.js b/node24/node_modules/npm/lib/commands/root.js new file mode 100644 index 0000000000000000000000000000000000000000..cabddb38881e01ba2e76638dff0237901949e6b8 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/root.js @@ -0,0 +1,14 @@ +const { output } = require('proc-log') +const BaseCommand = require('../base-cmd.js') + +class Root extends BaseCommand { + static description = 'Display npm root' + static name = 'root' + static params = ['global'] + + async exec () { + output.standard(this.npm.dir) + } +} + +module.exports = Root diff --git a/node24/node_modules/npm/lib/commands/run.js b/node24/node_modules/npm/lib/commands/run.js new file mode 100644 index 0000000000000000000000000000000000000000..bc018c700e2ba1f497fc539ae4092d806552dc56 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/run.js @@ -0,0 +1,222 @@ +const { output } = require('proc-log') +const pkgJson = require('@npmcli/package-json') +const BaseCommand = require('../base-cmd.js') +const { getError } = require('../utils/error-message.js') +const { outputError } = require('../utils/output-error.js') + +class RunScript extends BaseCommand { + static description = 'Run arbitrary package scripts' + static params = [ + 'workspace', + 'workspaces', + 'include-workspace-root', + 'if-present', + 'ignore-scripts', + 'foreground-scripts', + 'script-shell', + ] + + static name = 'run' + static usage = [' [-- ]'] + static workspaces = true + static ignoreImplicitWorkspace = false + static isShellout = true + static checkDevEngines = true + + static async completion (opts, npm) { + const argv = opts.conf.argv.remain + if (argv.length === 2) { + const workspacePrefixes = npm.config.get('workspace', 'default') + const localPrefix = workspacePrefixes.length + ? workspacePrefixes[0] + : npm.localPrefix + const { content: { scripts = {} } } = await pkgJson.normalize(localPrefix) + .catch(() => ({ content: {} })) + if (opts.isFish) { + return Object.keys(scripts).map(s => `${s}\t${scripts[s].slice(0, 30)}`) + } + return Object.keys(scripts) + } + } + + async exec (args) { + if (args.length) { + await this.#run(args, { path: this.npm.localPrefix }) + } else { + await this.#list(this.npm.localPrefix) + } + } + + async execWorkspaces (args) { + await this.setWorkspaces() + + const ws = [...this.workspaces.entries()] + for (const [workspace, path] of ws) { + const last = path === ws.at(-1)[1] + + if (!args.length) { + const newline = await this.#list(path, { workspace }) + if (newline && !last) { + output.standard() + } + continue + } + + const pkg = await pkgJson.normalize(path).then(p => p.content) + try { + await this.#run(args, { path, pkg, workspace }) + } catch (e) { + const err = getError(e, { npm: this.npm, command: null }) + outputError({ + ...err, + error: [ + ['', `Lifecycle script \`${args[0]}\` failed with error:`], + ...err.error, + ['workspace', pkg._id || pkg.name], + ['location', path], + ], + }) + process.exitCode = err.exitCode + if (!last) { + output.error('') + } + } + } + } + + async #run ([event, ...args], { path, pkg, workspace }) { + const runScript = require('@npmcli/run-script') + + pkg ??= await pkgJson.normalize(path).then(p => p.content) + + const { scripts = {} } = pkg + + if (event === 'restart' && !scripts.restart) { + scripts.restart = 'npm stop --if-present && npm start' + } else if (event === 'env' && !scripts.env) { + const { isWindowsShell } = require('../utils/is-windows.js') + scripts.env = isWindowsShell ? 'SET' : 'env' + } + + pkg.scripts = scripts + + if ( + !Object.prototype.hasOwnProperty.call(scripts, event) && + !(event === 'start' && (await runScript.isServerPackage(path))) + ) { + if (this.npm.config.get('if-present')) { + return + } + + const suggestions = require('../utils/did-you-mean.js')(pkg, event) + const wsArg = workspace && path !== this.npm.localPrefix + ? ` --workspace=${pkg._id || pkg.name}` + : '' + throw new Error([ + `Missing script: "${event}"${suggestions}`, + '', + 'To see a list of scripts, run:', + ` npm run${wsArg}`, + ].join('\n')) + } + + // positional args only added to the main event, not pre/post + const events = [[event, args]] + if (!this.npm.config.get('ignore-scripts')) { + if (scripts[`pre${event}`]) { + events.unshift([`pre${event}`, []]) + } + + if (scripts[`post${event}`]) { + events.push([`post${event}`, []]) + } + } + + for (const [ev, evArgs] of events) { + await runScript({ + args: evArgs, + event: ev, + nodeGyp: this.npm.config.get('node-gyp'), + path, + pkg, + // || undefined is because runScript will be unhappy with the default null value + scriptShell: this.npm.config.get('script-shell') || undefined, + stdio: 'inherit', + }) + } + } + + async #list (path, { workspace } = {}) { + const { scripts = {}, name, _id } = await pkgJson.normalize(path).then(p => p.content) + const scriptEntries = Object.entries(scripts) + + if (this.npm.silent) { + return + } + + if (this.npm.config.get('json')) { + output.buffer(workspace ? { [workspace]: scripts } : scripts) + return + } + + if (!scriptEntries.length) { + return + } + + if (this.npm.config.get('parseable')) { + output.standard(scriptEntries + .map((s) => (workspace ? [workspace, ...s] : s).join(':')) + .join('\n') + .trim()) + return + } + + const cmdList = [ + 'prepare', 'prepublishOnly', + 'prepack', 'postpack', + 'dependencies', + 'preinstall', 'install', 'postinstall', + 'prepublish', 'publish', 'postpublish', + 'prerestart', 'restart', 'postrestart', + 'prestart', 'start', 'poststart', + 'prestop', 'stop', 'poststop', + 'pretest', 'test', 'posttest', + 'preuninstall', 'uninstall', 'postuninstall', + 'preversion', 'version', 'postversion', + ] + const [cmds, runScripts] = scriptEntries.reduce((acc, s) => { + acc[cmdList.includes(s[0]) ? 0 : 1].push(s) + return acc + }, [[], []]) + + const { reset, bold, cyan, dim, blue } = this.npm.chalk + const pkgId = `in ${cyan(_id || name)}` + const title = (t) => reset(bold(t)) + + if (cmds.length) { + output.standard(`${title('Lifecycle scripts')} included ${pkgId}:`) + for (const [k, v] of cmds) { + output.standard(` ${k}`) + output.standard(` ${dim(v)}`) + } + } + + if (runScripts.length) { + const via = `via \`${blue('npm run')}\`:` + if (!cmds.length) { + output.standard(`${title('Scripts')} available ${pkgId} ${via}`) + } else { + output.standard(`available ${via}`) + } + for (const [k, v] of runScripts) { + output.standard(` ${k}`) + output.standard(` ${dim(v)}`) + } + } + + // Return true to indicate that something was output for this path that should be separated from others + return true + } +} + +module.exports = RunScript diff --git a/node24/node_modules/npm/lib/commands/sbom.js b/node24/node_modules/npm/lib/commands/sbom.js new file mode 100644 index 0000000000000000000000000000000000000000..84bc515d75267394b1f99738a8f25cbcaf1baf58 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/sbom.js @@ -0,0 +1,130 @@ +const localeCompare = require('@isaacs/string-locale-compare')('en') +const BaseCommand = require('../base-cmd.js') +const { log, output, META } = require('proc-log') +const { cyclonedxOutput } = require('../utils/sbom-cyclonedx.js') +const { spdxOutput } = require('../utils/sbom-spdx.js') + +const SBOM_FORMATS = ['cyclonedx', 'spdx'] + +class SBOM extends BaseCommand { + #response = {} // response is the sbom response + + static description = 'Generate a Software Bill of Materials (SBOM)' + static name = 'sbom' + static workspaces = true + + static params = [ + 'omit', + 'package-lock-only', + 'sbom-format', + 'sbom-type', + 'workspace', + 'workspaces', + ] + + async exec () { + const sbomFormat = this.npm.config.get('sbom-format') + const packageLockOnly = this.npm.config.get('package-lock-only') + + if (!sbomFormat) { + throw this.usageError(`Must specify --sbom-format flag with one of: ${SBOM_FORMATS.join(', ')}.`) + } + + const opts = { + ...this.npm.flatOptions, + path: this.npm.prefix, + forceActual: true, + } + const Arborist = require('@npmcli/arborist') + const arb = new Arborist(opts) + + const tree = packageLockOnly ? await arb.loadVirtual(opts).catch(() => { + throw this.usageError('A package lock or shrinkwrap file is required in package-lock-only mode') + }) : await arb.loadActual(opts) + + // Collect the list of selected workspaces in the project + const wsNodes = this.workspaceNames?.length + ? arb.workspaceNodes(tree, this.workspaceNames) + : null + + // Build the selector and query the tree for the list of nodes + const selector = this.#buildSelector({ wsNodes }) + log.info('sbom', `Using dependency selector: ${selector}`) + const items = await tree.querySelectorAll(selector) + + const errors = items.flatMap(node => detectErrors(node)) + if (errors.length) { + throw Object.assign(new Error([...new Set(errors)].join('\n')), { + code: 'ESBOMPROBLEMS', + }) + } + + // Populate the response with the list of unique nodes (sorted by location) + this.#buildResponse(items.sort((a, b) => localeCompare(a.location, b.location))) + + // TODO(BREAKING_CHANGE): all sbom output is in json mode but setting it before any of the errors will cause those to be thrown in json mode. + this.npm.config.set('json', true) + output.standard(JSON.stringify(this.#response, null, 2), { [META]: true, redact: false }) + } + + async execWorkspaces (args) { + await this.setWorkspaces() + return this.exec(args) + } + + // Build the selector from all of the specified filter options + #buildSelector ({ wsNodes }) { + let selector + const omit = this.npm.flatOptions.omit + const workspacesEnabled = this.npm.flatOptions.workspacesEnabled + + // If omit is specified, omit all nodes and their children which match the specified selectors + const omits = omit.reduce((acc, o) => `${acc}:not(.${o})`, '') + + if (!workspacesEnabled) { + // If workspaces are disabled, omit all workspace nodes and their children + selector = `:root > :not(.workspace)${omits},:root > :not(.workspace) *${omits},:extraneous` + } else if (wsNodes && wsNodes.length > 0) { + // If one or more workspaces are selected, select only those workspaces and their children + selector = wsNodes.map(ws => `#${ws.name},#${ws.name} *${omits}`).join(',') + } else { + selector = `:root *${omits},:extraneous` + } + + // Always include the root node + return `:root,${selector}` + } + + // builds a normalized inventory + #buildResponse (items) { + const sbomFormat = this.npm.config.get('sbom-format') + const packageType = this.npm.config.get('sbom-type') + const packageLockOnly = this.npm.config.get('package-lock-only') + + this.#response = sbomFormat === 'cyclonedx' + ? cyclonedxOutput({ npm: this.npm, nodes: items, packageType, packageLockOnly }) + : spdxOutput({ npm: this.npm, nodes: items, packageType }) + } +} + +const detectErrors = (node) => { + const errors = [] + + // Look for missing dependencies (that are NOT optional), or invalid dependencies + for (const edge of node.edgesOut.values()) { + if (edge.missing && !(edge.type === 'optional' || edge.type === 'peerOptional')) { + errors.push(`missing: ${edge.name}@${edge.spec}, required by ${edge.from.pkgid}`) + } + + if (edge.invalid) { + /* istanbul ignore next */ + const spec = edge.spec || '*' + const from = edge.from.pkgid + errors.push(`invalid: ${edge.to.pkgid}, ${spec} required by ${from}`) + } + } + + return errors +} + +module.exports = SBOM diff --git a/node24/node_modules/npm/lib/commands/search.js b/node24/node_modules/npm/lib/commands/search.js new file mode 100644 index 0000000000000000000000000000000000000000..6d2e3b4d66f10d3a458bc26074dc08ce8b4726d3 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/search.js @@ -0,0 +1,70 @@ +const Pipeline = require('minipass-pipeline') +const libSearch = require('libnpmsearch') +const { log, output } = require('proc-log') +const formatSearchStream = require('../utils/format-search-stream.js') +const BaseCommand = require('../base-cmd.js') + +class Search extends BaseCommand { + static description = 'Search for packages' + static name = 'search' + static params = [ + 'json', + 'color', + 'parseable', + 'description', + 'searchlimit', + 'searchopts', + 'searchexclude', + 'registry', + 'prefer-online', + 'prefer-offline', + 'offline', + ] + + static usage = [' [ ...]'] + + async exec (args) { + const opts = { + ...this.npm.flatOptions, + ...this.npm.flatOptions.search, + include: args.map(s => s.toLowerCase()).filter(Boolean), + exclude: this.npm.flatOptions.search.exclude.split(/\s+/), + } + + if (opts.include.length === 0) { + throw new Error('search must be called with arguments') + } + + // Used later to figure out whether we had any packages go out + let anyOutput = false + + // Grab a configured output stream that will spit out packages in the desired format. + const outputStream = formatSearchStream({ + args, // --searchinclude options are not highlighted + ...opts, + npm: this.npm, + }) + + log.silly('search', 'searching packages') + const p = new Pipeline( + libSearch.stream(opts.include, opts), + outputStream + ) + + p.on('data', chunk => { + if (!anyOutput) { + anyOutput = true + } + output.standard(chunk.toString('utf8')) + }) + + await p.promise() + if (!anyOutput && !this.npm.config.get('json') && !this.npm.config.get('parseable')) { + output.standard('No matches found for ' + (args.map(JSON.stringify).join(' '))) + } + + log.silly('search', 'search completed') + } +} + +module.exports = Search diff --git a/node24/node_modules/npm/lib/commands/set.js b/node24/node_modules/npm/lib/commands/set.js new file mode 100644 index 0000000000000000000000000000000000000000..bf54ba070affa175d8cc26454a4a376e6474a3ea --- /dev/null +++ b/node24/node_modules/npm/lib/commands/set.js @@ -0,0 +1,24 @@ +const Npm = require('../npm.js') +const BaseCommand = require('../base-cmd.js') + +class Set extends BaseCommand { + static description = 'Set a value in the npm configuration' + static name = 'set' + static usage = ['= [= ...] (See `npm config`)'] + static params = ['global', 'location'] + static ignoreImplicitWorkspace = false + + static async completion (opts) { + const Config = Npm.cmd('config') + return Config.completion(opts) + } + + async exec (args) { + if (!args.length) { + throw this.usageError() + } + return this.npm.exec('config', ['set'].concat(args)) + } +} + +module.exports = Set diff --git a/node24/node_modules/npm/lib/commands/shrinkwrap.js b/node24/node_modules/npm/lib/commands/shrinkwrap.js new file mode 100644 index 0000000000000000000000000000000000000000..447bb3c8ef997fb8e99f03a90e5a848c39445a3c --- /dev/null +++ b/node24/node_modules/npm/lib/commands/shrinkwrap.js @@ -0,0 +1,70 @@ +const { resolve, basename } = require('node:path') +const { unlink } = require('node:fs/promises') +const { log } = require('proc-log') +const BaseCommand = require('../base-cmd.js') + +class Shrinkwrap extends BaseCommand { + static description = 'Lock down dependency versions for publication' + static name = 'shrinkwrap' + static ignoreImplicitWorkspace = false + + async exec () { + // if has a npm-shrinkwrap.json, nothing to do + // if has a package-lock.json, rename to npm-shrinkwrap.json + // if has neither, load the actual tree and save that as npm-shrinkwrap.json + // + // loadVirtual, fall back to loadActual + // rename shrinkwrap file type, and tree.meta.save() + if (this.npm.global) { + const er = new Error('`npm shrinkwrap` does not work for global packages') + er.code = 'ESHRINKWRAPGLOBAL' + throw er + } + + const Arborist = require('@npmcli/arborist') + const path = this.npm.prefix + const sw = resolve(path, 'npm-shrinkwrap.json') + const arb = new Arborist({ ...this.npm.flatOptions, path }) + const tree = await arb.loadVirtual().catch(() => arb.loadActual()) + const { meta } = tree + const newFile = meta.hiddenLockfile || !meta.loadedFromDisk + const oldFilename = meta.filename + const notSW = !newFile && basename(oldFilename) !== 'npm-shrinkwrap.json' + + // The computed lockfile version of a hidden lockfile is always 3 even if the actual value of the property is a different. + // When shrinkwrap is run with only a hidden lockfile we want to set the shrinkwrap lockfile version as whatever was explicitly requested with a fallback to the actual value from the hidden + // lockfile. + if (meta.hiddenLockfile) { + meta.lockfileVersion = arb.options.lockfileVersion || + meta.originalLockfileVersion + } + meta.hiddenLockfile = false + meta.filename = sw + await meta.save() + + const updatedVersion = meta.originalLockfileVersion !== meta.lockfileVersion + ? meta.lockfileVersion + : null + + if (newFile) { + let message = 'created a lockfile as npm-shrinkwrap.json' + if (updatedVersion) { + message += ` with version ${updatedVersion}` + } + log.notice('', message) + } else if (notSW) { + await unlink(oldFilename) + let message = 'package-lock.json has been renamed to npm-shrinkwrap.json' + if (updatedVersion) { + message += ` and updated to version ${updatedVersion}` + } + log.notice('', message) + } else if (updatedVersion) { + log.notice('', `npm-shrinkwrap.json updated to version ${updatedVersion}`) + } else { + log.notice('', 'npm-shrinkwrap.json up to date') + } + } +} + +module.exports = Shrinkwrap diff --git a/node24/node_modules/npm/lib/commands/star.js b/node24/node_modules/npm/lib/commands/star.js new file mode 100644 index 0000000000000000000000000000000000000000..06c6826c62cde7c69a371daa9b1f8120a5a00101 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/star.js @@ -0,0 +1,72 @@ +const npmFetch = require('npm-registry-fetch') +const npa = require('npm-package-arg') +const { log, output } = require('proc-log') +const getIdentity = require('../utils/get-identity') +const BaseCommand = require('../base-cmd.js') + +class Star extends BaseCommand { + static description = 'Mark your favorite packages' + static name = 'star' + static usage = ['[...]'] + static params = [ + 'registry', + 'unicode', + 'otp', + ] + + static ignoreImplicitWorkspace = false + + async exec (args) { + if (!args.length) { + throw this.usageError() + } + + // if we're unstarring, then show an empty star image + // otherwise, show the full star image + const unicode = this.npm.config.get('unicode') + const full = unicode ? '\u2605 ' : '(*)' + const empty = unicode ? '\u2606 ' : '( )' + const show = this.name === 'star' ? full : empty + + const pkgs = args.map(npa) + const username = await getIdentity(this.npm, this.npm.flatOptions) + + for (const pkg of pkgs) { + const fullData = await npmFetch.json(pkg.escapedName, { + ...this.npm.flatOptions, + spec: pkg, + query: { write: true }, + preferOnline: true, + }) + + const body = { + _id: fullData._id, + _rev: fullData._rev, + users: fullData.users || {}, + } + + if (this.name === 'star') { + log.info('star', 'starring', body._id) + body.users[username] = true + log.verbose('star', 'starring', body) + } else { + delete body.users[username] + log.info('unstar', 'unstarring', body._id) + log.verbose('unstar', 'unstarring', body) + } + + const data = await npmFetch.json(pkg.escapedName, { + ...this.npm.flatOptions, + spec: pkg, + method: 'PUT', + body, + }) + + output.standard(show + ' ' + pkg.name) + log.verbose('star', data) + return data + } + } +} + +module.exports = Star diff --git a/node24/node_modules/npm/lib/commands/stars.js b/node24/node_modules/npm/lib/commands/stars.js new file mode 100644 index 0000000000000000000000000000000000000000..cb219677489874f44619c8b705c8c40ef5921d6e --- /dev/null +++ b/node24/node_modules/npm/lib/commands/stars.js @@ -0,0 +1,39 @@ +const npmFetch = require('npm-registry-fetch') +const { log, output } = require('proc-log') +const getIdentity = require('../utils/get-identity.js') +const BaseCommand = require('../base-cmd.js') + +class Stars extends BaseCommand { + static description = 'View packages marked as favorites' + static name = 'stars' + static usage = ['[]'] + static params = ['registry'] + static ignoreImplicitWorkspace = false + + async exec ([user]) { + try { + if (!user) { + user = await getIdentity(this.npm, this.npm.flatOptions) + } + + const { rows } = await npmFetch.json('/-/_view/starredByUser', { + ...this.npm.flatOptions, + query: { key: `"${user}"` }, + }) + if (rows.length === 0) { + log.warn('stars', 'user has not starred any packages') + } + + for (const row of rows) { + output.standard(row.value) + } + } catch (err) { + if (err.code === 'ENEEDAUTH') { + log.warn('stars', 'auth is required to look up your username') + } + throw err + } + } +} + +module.exports = Stars diff --git a/node24/node_modules/npm/lib/commands/start.js b/node24/node_modules/npm/lib/commands/start.js new file mode 100644 index 0000000000000000000000000000000000000000..bc7634273c85feb9fd1550a680840c3b36abd6c1 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/start.js @@ -0,0 +1,13 @@ +const LifecycleCmd = require('../lifecycle-cmd.js') + +// This ends up calling run(['start', ...args]) +class Start extends LifecycleCmd { + static description = 'Start a package' + static name = 'start' + static params = [ + 'ignore-scripts', + 'script-shell', + ] +} + +module.exports = Start diff --git a/node24/node_modules/npm/lib/commands/stop.js b/node24/node_modules/npm/lib/commands/stop.js new file mode 100644 index 0000000000000000000000000000000000000000..714bac7ee552191c0935a63a6b94e8880594eba9 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/stop.js @@ -0,0 +1,13 @@ +const LifecycleCmd = require('../lifecycle-cmd.js') + +// This ends up calling run(['stop', ...args]) +class Stop extends LifecycleCmd { + static description = 'Stop a package' + static name = 'stop' + static params = [ + 'ignore-scripts', + 'script-shell', + ] +} + +module.exports = Stop diff --git a/node24/node_modules/npm/lib/commands/team.js b/node24/node_modules/npm/lib/commands/team.js new file mode 100644 index 0000000000000000000000000000000000000000..444a6a8e4ef640642dbd2907c62e2b237000fe4c --- /dev/null +++ b/node24/node_modules/npm/lib/commands/team.js @@ -0,0 +1,158 @@ +const libteam = require('libnpmteam') +const { output } = require('proc-log') +const { otplease } = require('../utils/auth.js') + +const BaseCommand = require('../base-cmd.js') +class Team extends BaseCommand { + static description = 'Manage organization teams and team memberships' + static name = 'team' + static usage = [ + 'create [--otp ]', + 'destroy [--otp ]', + 'add [--otp ]', + 'rm [--otp ]', + 'ls |', + ] + + static params = [ + 'registry', + 'otp', + 'parseable', + 'json', + ] + + static ignoreImplicitWorkspace = false + + static async completion (opts) { + const { conf: { argv: { remain: argv } } } = opts + const subcommands = ['create', 'destroy', 'add', 'rm', 'ls'] + + if (argv.length === 2) { + return subcommands + } + + if (subcommands.includes(argv[2])) { + return [] + } + + throw new Error(argv[2] + ' not recognized') + } + + async exec ([cmd, entity = '', user = '']) { + // Entities are in the format : + // XXX: "description" option to libnpmteam is used as a description of the team, but in npm's options + // this is a boolean meaning "show the description in npm search output". + // Hence its being set to null here. + await otplease(this.npm, { ...this.npm.flatOptions }, opts => { + entity = entity.replace(/^@/, '') + switch (cmd) { + case 'create': return this.create(entity, opts) + case 'destroy': return this.destroy(entity, opts) + case 'add': return this.add(entity, user, opts) + case 'rm': return this.rm(entity, user, opts) + case 'ls': { + const match = entity.match(/[^:]+:.+/) + if (match) { + return this.listUsers(entity, opts) + } else { + return this.listTeams(entity, opts) + } + } + default: + throw this.usageError() + } + }) + } + + async create (entity, opts) { + await libteam.create(entity, opts) + if (opts.json) { + output.buffer({ + created: true, + team: entity, + }) + } else if (opts.parseable) { + output.standard(`${entity}\tcreated`) + } else if (!this.npm.silent) { + output.standard(`+@${entity}`) + } + } + + async destroy (entity, opts) { + await libteam.destroy(entity, opts) + if (opts.json) { + output.buffer({ + deleted: true, + team: entity, + }) + } else if (opts.parseable) { + output.standard(`${entity}\tdeleted`) + } else if (!this.npm.silent) { + output.standard(`-@${entity}`) + } + } + + async add (entity, user, opts) { + await libteam.add(user, entity, opts) + if (opts.json) { + output.buffer({ + added: true, + team: entity, + user, + }) + } else if (opts.parseable) { + output.standard(`${user}\t${entity}\tadded`) + } else if (!this.npm.silent) { + output.standard(`${user} added to @${entity}`) + } + } + + async rm (entity, user, opts) { + await libteam.rm(user, entity, opts) + if (opts.json) { + output.buffer({ + removed: true, + team: entity, + user, + }) + } else if (opts.parseable) { + output.standard(`${user}\t${entity}\tremoved`) + } else if (!this.npm.silent) { + output.standard(`${user} removed from @${entity}`) + } + } + + async listUsers (entity, opts) { + const users = (await libteam.lsUsers(entity, opts)).sort() + if (opts.json) { + output.buffer(users) + } else if (opts.parseable) { + output.standard(users.join('\n')) + } else if (!this.npm.silent) { + const plural = users.length === 1 ? '' : 's' + const more = users.length === 0 ? '' : ':' + output.standard(`@${entity} has ${users.length} user${plural}${more}`) + for (const user of users) { + output.standard(user) + } + } + } + + async listTeams (entity, opts) { + const teams = (await libteam.lsTeams(entity, opts)).sort() + if (opts.json) { + output.buffer(teams) + } else if (opts.parseable) { + output.standard(teams.join('\n')) + } else if (!this.npm.silent) { + const plural = teams.length === 1 ? '' : 's' + const more = teams.length === 0 ? '' : ':' + output.standard(`@${entity} has ${teams.length} team${plural}${more}`) + for (const team of teams) { + output.standard(`@${team}`) + } + } + } +} + +module.exports = Team diff --git a/node24/node_modules/npm/lib/commands/test.js b/node24/node_modules/npm/lib/commands/test.js new file mode 100644 index 0000000000000000000000000000000000000000..7d26e12ec143f3108a83ca242e1547c505f1d72a --- /dev/null +++ b/node24/node_modules/npm/lib/commands/test.js @@ -0,0 +1,13 @@ +const LifecycleCmd = require('../lifecycle-cmd.js') + +// This ends up calling run(['test', ...args]) +class Test extends LifecycleCmd { + static description = 'Test a package' + static name = 'test' + static params = [ + 'ignore-scripts', + 'script-shell', + ] +} + +module.exports = Test diff --git a/node24/node_modules/npm/lib/commands/token.js b/node24/node_modules/npm/lib/commands/token.js new file mode 100644 index 0000000000000000000000000000000000000000..d34d0e7b918657a6eec79ef4cff9dfcc5559294a --- /dev/null +++ b/node24/node_modules/npm/lib/commands/token.js @@ -0,0 +1,281 @@ +const { log, output, META } = require('proc-log') +const fetch = require('npm-registry-fetch') +const { otplease } = require('../utils/auth.js') +const readUserInfo = require('../utils/read-user-info.js') +const BaseCommand = require('../base-cmd.js') + +async function paginate (href, opts, items = []) { + while (href) { + const result = await fetch.json(href, opts) + items = items.concat(result.objects) + href = result.urls.next + } + return items +} + +class Token extends BaseCommand { + static description = 'Manage your authentication tokens' + static name = 'token' + static usage = ['list', 'revoke ', 'create'] + static params = ['name', + 'token-description', + 'expires', + 'packages', + 'packages-all', + 'scopes', + 'orgs', + 'packages-and-scopes-permission', + 'orgs-permission', + 'cidr', + 'bypass-2fa', + 'password', + 'registry', + 'otp', + 'read-only', + ] + + static async completion (opts) { + const argv = opts.conf.argv.remain + const subcommands = ['list', 'revoke', 'create'] + if (argv.length === 2) { + return subcommands + } + + if (subcommands.includes(argv[2])) { + return [] + } + + throw new Error(argv[2] + ' not recognized') + } + + async exec (args) { + if (args.length === 0) { + return this.list() + } + switch (args[0]) { + case 'list': + case 'ls': + return this.list() + case 'rm': + case 'delete': + case 'revoke': + case 'remove': + return this.rm(args.slice(1)) + case 'create': + return this.create(args.slice(1)) + default: + throw this.usageError(`${args[0]} is not a recognized subcommand.`) + } + } + + async list () { + const json = this.npm.config.get('json') + const parseable = this.npm.config.get('parseable') + log.info('token', 'getting list') + const tokens = await paginate('/-/npm/v1/tokens', this.npm.flatOptions) + if (json) { + output.buffer(tokens) + return + } + if (parseable) { + output.standard(['key', 'token', 'created', 'readonly', 'CIDR whitelist'].join('\t')) + tokens.forEach(token => { + output.standard( + [ + token.key, + token.token, + token.created, + token.readonly ? 'true' : 'false', + token.cidr_whitelist ? token.cidr_whitelist.join(',') : '', + ].join('\t') + ) + }) + return + } + this.generateTokenIds(tokens, 6) + const chalk = this.npm.chalk + for (const token of tokens) { + const created = String(token.created).slice(0, 10) + output.standard(`${chalk.blue('Token')} ${token.token}… with id ${chalk.cyan(token.id)} created ${created}`) + if (token.cidr_whitelist) { + output.standard(`with IP whitelist: ${chalk.green(token.cidr_whitelist.join(','))}`) + } + output.standard() + } + } + + async rm (args) { + if (args.length === 0) { + throw this.usageError('`` argument is required.') + } + + const json = this.npm.config.get('json') + const parseable = this.npm.config.get('parseable') + const toRemove = [] + log.info('token', `removing ${toRemove.length} tokens`) + const tokens = await paginate('/-/npm/v1/tokens', this.npm.flatOptions) + for (const id of args) { + const matches = tokens.filter(token => token.key.indexOf(id) === 0) + if (matches.length === 1) { + toRemove.push(matches[0].key) + } else if (matches.length > 1) { + throw new Error( + `Token ID "${id}" was ambiguous, a new token may have been created since you last ran \`npm token list\`.` + ) + } else { + const tokenMatches = tokens.some(t => id.indexOf(t.token) === 0) + if (!tokenMatches) { + throw new Error(`Unknown token id or value "${id}".`) + } + + toRemove.push(id) + } + } + for (const tokenKey of toRemove) { + await otplease(this.npm, this.npm.flatOptions, opts => + fetch(`/-/npm/v1/tokens/token/${tokenKey}`, { + ...opts, + method: 'DELETE', + ignoreBody: true, + }) + ) + } + if (json) { + output.buffer(toRemove) + } else if (parseable) { + output.standard(toRemove.join('\t')) + } else { + output.standard('Removed ' + toRemove.length + ' token' + (toRemove.length !== 1 ? 's' : '')) + } + } + + async create () { + const json = this.npm.config.get('json') + const parseable = this.npm.config.get('parseable') + const cidr = this.npm.config.get('cidr') + const name = this.npm.config.get('name') + const tokenDescription = this.npm.config.get('token-description') + const expires = this.npm.config.get('expires') + const packages = this.npm.config.get('packages') + const packagesAll = this.npm.config.get('packages-all') + const scopes = this.npm.config.get('scopes') + const orgs = this.npm.config.get('orgs') + const packagesAndScopesPermission = this.npm.config.get('packages-and-scopes-permission') + const orgsPermission = this.npm.config.get('orgs-permission') + const bypassTwoFactor = this.npm.config.get('bypass-2fa') + let password = this.npm.config.get('password') + + const validCIDR = await this.validateCIDRList(cidr) + + /* istanbul ignore if - skip testing read input */ + if (!password) { + password = await readUserInfo.password() + } + + const tokenData = { + name: name, + password: password, + } + + if (tokenDescription) { + tokenData.description = tokenDescription + } + + if (packages?.length > 0) { + tokenData.packages = packages + } + if (packagesAll) { + tokenData.packages_all = true + } + if (scopes?.length > 0) { + tokenData.scopes = scopes + } + if (orgs?.length > 0) { + tokenData.orgs = orgs + } + + if (packagesAndScopesPermission) { + tokenData.packages_and_scopes_permission = packagesAndScopesPermission + } + if (orgsPermission) { + tokenData.orgs_permission = orgsPermission + } + + // Add expiration in days + if (expires) { + tokenData.expires = parseInt(expires, 10) + } + + // Add optional fields + if (validCIDR?.length > 0) { + tokenData.cidr_whitelist = validCIDR + } + if (bypassTwoFactor) { + tokenData.bypass_2fa = true + } + + log.info('token', 'creating') + const result = await otplease(this.npm, this.npm.flatOptions, opts => + fetch.json('/-/npm/v1/tokens', { + ...opts, + method: 'POST', + body: tokenData, + }) + ) + delete result.key + delete result.updated + if (json) { + output.buffer(result) + } else if (parseable) { + Object.keys(result).forEach(k => output.standard(k + '\t' + result[k])) + } else { + const chalk = this.npm.chalk + output.standard(`Created token ${result.token}`, { [META]: true, redact: false }) + if (result.cidr_whitelist?.length) { + output.standard(`with IP whitelist: ${chalk.green(result.cidr_whitelist.join(','))}`) + } + if (result.expires) { + output.standard(`expires: ${result.expires}`) + } + } + } + + invalidCIDRError (msg) { + return Object.assign(new Error(msg), { code: 'EINVALIDCIDR' }) + } + + generateTokenIds (tokens, minLength) { + for (const token of tokens) { + token.id = token.key + for (let ii = minLength; ii < token.key.length; ++ii) { + const match = tokens.some( + ot => ot !== token && ot.key.slice(0, ii) === token.key.slice(0, ii) + ) + if (!match) { + token.id = token.key.slice(0, ii) + break + } + } + } + } + + async validateCIDRList (cidrs) { + const { v4: isCidrV4, v6: isCidrV6 } = await import('is-cidr') + const maybeList = [].concat(cidrs).filter(Boolean) + const list = maybeList.length === 1 ? maybeList[0].split(/,\s*/) : maybeList + for (const cidr of list) { + if (isCidrV6(cidr)) { + throw this.invalidCIDRError( + `CIDR whitelist can only contain IPv4 addresses, ${cidr} is IPv6` + ) + } + + if (!isCidrV4(cidr)) { + throw this.invalidCIDRError(`CIDR whitelist contains invalid CIDR entry: ${cidr}`) + } + } + return list + } +} + +module.exports = Token diff --git a/node24/node_modules/npm/lib/commands/trust/circleci.js b/node24/node_modules/npm/lib/commands/trust/circleci.js new file mode 100644 index 0000000000000000000000000000000000000000..2d5259807b2b5c469993a492490f6783b646e936 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/trust/circleci.js @@ -0,0 +1,179 @@ +const Definition = require('@npmcli/config/lib/definitions/definition.js') +const globalDefinitions = require('@npmcli/config/lib/definitions/definitions.js') +const TrustCommand = require('../../trust-cmd.js') + +// UUID validation regex +const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i + +class TrustCircleCI extends TrustCommand { + static description = 'Create a trusted relationship between a package and CircleCI' + static name = 'circleci' + static positionals = 1 // expects at most 1 positional (package name) + static providerName = 'CircleCI' + static providerEntity = 'CircleCI pipeline' + + static usage = [ + '[package] --org-id --project-id --pipeline-definition-id --vcs-origin [--context-id ...] [-y|--yes]', + ] + + static definitions = [ + new Definition('org-id', { + default: null, + type: String, + required: true, + description: 'CircleCI organization UUID', + }), + new Definition('project-id', { + default: null, + type: String, + required: true, + description: 'CircleCI project UUID', + }), + new Definition('pipeline-definition-id', { + default: null, + type: String, + required: true, + description: 'CircleCI pipeline definition UUID', + }), + new Definition('vcs-origin', { + default: null, + type: String, + required: true, + description: "CircleCI repository origin in format 'provider/owner/repo'", + }), + new Definition('context-id', { + default: null, + type: [null, String, Array], + description: 'CircleCI context UUID to match', + }), + // globals are alphabetical + globalDefinitions['dry-run'], + globalDefinitions.json, + globalDefinitions.registry, + globalDefinitions.yes, + ] + + validateUuid (value, fieldName) { + if (!UUID_REGEX.test(value)) { + throw new Error(`${fieldName} must be a valid UUID`) + } + } + + validateVcsOrigin (value) { + // Expected format: provider/owner/repo (e.g., github.com/owner/repo, bitbucket.org/owner/repo) + if (value.includes('://')) { + throw new Error("vcs-origin must not include a scheme (e.g., use 'github.com/owner/repo' not 'https://github.com/owner/repo')") + } + const parts = value.split('/') + if (parts.length < 3) { + throw new Error("vcs-origin must be in format 'provider/owner/repo'") + } + } + + // Generate a URL from vcs-origin (e.g., github.com/npm/repo -> https://github.com/npm/repo) + getVcsOriginUrl (vcsOrigin) { + if (!vcsOrigin) { + return null + } + // vcs-origin format: github.com/owner/repo or bitbucket.org/owner/repo + return `https://${vcsOrigin}` + } + + static optionsToBody (options) { + const { orgId, projectId, pipelineDefinitionId, vcsOrigin, contextIds } = options + const trustConfig = { + type: 'circleci', + claims: { + 'oidc.circleci.com/org-id': orgId, + 'oidc.circleci.com/project-id': projectId, + 'oidc.circleci.com/pipeline-definition-id': pipelineDefinitionId, + 'oidc.circleci.com/vcs-origin': vcsOrigin, + }, + } + if (contextIds && contextIds.length > 0) { + trustConfig.claims['oidc.circleci.com/context-ids'] = contextIds + } + return trustConfig + } + + static bodyToOptions (body) { + return { + ...(body.id) && { id: body.id }, + ...(body.type) && { type: body.type }, + ...(body.claims?.['oidc.circleci.com/org-id']) && { orgId: body.claims['oidc.circleci.com/org-id'] }, + ...(body.claims?.['oidc.circleci.com/project-id']) && { projectId: body.claims['oidc.circleci.com/project-id'] }, + ...(body.claims?.['oidc.circleci.com/pipeline-definition-id']) && { + pipelineDefinitionId: body.claims['oidc.circleci.com/pipeline-definition-id'], + }, + ...(body.claims?.['oidc.circleci.com/vcs-origin']) && { vcsOrigin: body.claims['oidc.circleci.com/vcs-origin'] }, + ...(body.claims?.['oidc.circleci.com/context-ids']) && { contextIds: body.claims['oidc.circleci.com/context-ids'] }, + } + } + + // Override flagsToOptions since CircleCI doesn't use file/entity pattern + async flagsToOptions ({ positionalArgs, flags }) { + const content = await this.optionalPkgJson() + const pkgName = positionalArgs[0] || content.name + + if (!pkgName) { + throw new Error('Package name must be specified either as an argument or in package.json file') + } + + const orgId = flags['org-id'] + const projectId = flags['project-id'] + const pipelineDefinitionId = flags['pipeline-definition-id'] + const vcsOrigin = flags['vcs-origin'] + const contextIds = flags['context-id'] + + // Validate required flags + if (!orgId) { + throw new Error('org-id is required') + } + if (!projectId) { + throw new Error('project-id is required') + } + if (!pipelineDefinitionId) { + throw new Error('pipeline-definition-id is required') + } + if (!vcsOrigin) { + throw new Error('vcs-origin is required') + } + + // Validate formats + this.validateUuid(orgId, 'org-id') + this.validateUuid(projectId, 'project-id') + this.validateUuid(pipelineDefinitionId, 'pipeline-definition-id') + this.validateVcsOrigin(vcsOrigin) + if (contextIds?.length > 0) { + for (const contextId of contextIds) { + this.validateUuid(contextId, 'context-id') + } + } + + return { + values: { + package: pkgName, + orgId, + projectId, + pipelineDefinitionId, + vcsOrigin, + ...(contextIds?.length > 0 && { contextIds }), + }, + fromPackageJson: {}, + warnings: [], + urls: { + package: this.getFrontendUrl({ pkgName }), + vcsOrigin: this.getVcsOriginUrl(vcsOrigin), + }, + } + } + + async exec (positionalArgs, flags) { + await this.createConfigCommand({ + positionalArgs, + flags, + }) + } +} + +module.exports = TrustCircleCI diff --git a/node24/node_modules/npm/lib/commands/trust/github.js b/node24/node_modules/npm/lib/commands/trust/github.js new file mode 100644 index 0000000000000000000000000000000000000000..d417820f2a0e61e4e583bb1012a70e333810a20a --- /dev/null +++ b/node24/node_modules/npm/lib/commands/trust/github.js @@ -0,0 +1,104 @@ +const Definition = require('@npmcli/config/lib/definitions/definition.js') +const globalDefinitions = require('@npmcli/config/lib/definitions/definitions.js') +const TrustCommand = require('../../trust-cmd.js') +const path = require('node:path') + +class TrustGitHub extends TrustCommand { + static description = 'Create a trusted relationship between a package and GitHub Actions' + static name = 'github' + static positionals = 1 // expects at most 1 positional (package name) + static providerName = 'GitHub Actions' + static providerEntity = 'GitHub repository' + static providerFile = 'GitHub Actions Workflow' + static providerHostname = 'https://github.com' + + // entity means project / repository + static entityKey = 'repository' + + static usage = [ + '[package] --file [--repo|--repository] [--env|--environment] [-y|--yes]', + ] + + static definitions = [ + new Definition('file', { + default: null, + type: String, + required: true, + description: 'Name of workflow file within a repositories .GitHub folder (must end in yaml, yml)', + }), + new Definition('repository', { + default: null, + type: String, + description: 'Name of the repository in the format owner/repo', + alias: ['repo'], + }), + new Definition('environment', { + default: null, + type: String, + description: 'CI environment name', + alias: ['env'], + }), + // globals are alphabetical + globalDefinitions['dry-run'], + globalDefinitions.json, + globalDefinitions.registry, + globalDefinitions.yes, + ] + + getEntityUrl ({ providerHostname, file, entity }) { + if (file) { + return new URL(`${entity}/blob/HEAD/.github/workflows/${file}`, providerHostname).toString() + } + return new URL(entity, providerHostname).toString() + } + + validateEntity (entity) { + if (entity.split('/').length !== 2) { + throw new Error(`${this.constructor.providerEntity} must be specified in the format owner/repository`) + } + } + + validateFile (file) { + if (file !== path.basename(file)) { + throw new Error('GitHub Actions workflow must be just a file not a path') + } + } + + static optionsToBody (options) { + const { file, repository, environment } = options + const trustConfig = { + type: 'github', + claims: { + repository, + workflow_ref: { + file, + }, + ...(environment) && { environment }, + }, + } + return trustConfig + } + + // Convert API response body to options + static bodyToOptions (body) { + const file = body.claims?.workflow_ref?.file + const repository = body.claims?.repository + const environment = body.claims?.environment + return { + ...(body.id) && { id: body.id }, + ...(body.type) && { type: body.type }, + ...(file) && { file }, + ...(repository) && { repository }, + ...(environment) && { environment }, + } + } + + async exec (positionalArgs, flags) { + await this.createConfigCommand({ + positionalArgs, + flags, + }) + } +} + +module.exports = TrustGitHub diff --git a/node24/node_modules/npm/lib/commands/trust/gitlab.js b/node24/node_modules/npm/lib/commands/trust/gitlab.js new file mode 100644 index 0000000000000000000000000000000000000000..74a4ed5dd54aafe88f00c5c22977c2261edf32db --- /dev/null +++ b/node24/node_modules/npm/lib/commands/trust/gitlab.js @@ -0,0 +1,105 @@ +const Definition = require('@npmcli/config/lib/definitions/definition.js') +const globalDefinitions = require('@npmcli/config/lib/definitions/definitions.js') +const TrustCommand = require('../../trust-cmd.js') +const path = require('node:path') + +class TrustGitLab extends TrustCommand { + static description = 'Create a trusted relationship between a package and GitLab CI/CD' + static name = 'gitlab' + static positionals = 1 // expects at most 1 positional (package name) + static providerName = 'GitLab CI/CD' + static providerEntity = 'GitLab project' + static providerFile = 'GitLab CI/CD Pipeline' + static providerHostname = 'https://gitlab.com' + + // entity means project / repository + static entityKey = 'project' + + static usage = [ + '[package] --file [--project|--repo|--repository] [--env|--environment] [-y|--yes]', + ] + + static definitions = [ + new Definition('file', { + default: null, + type: String, + required: true, + description: 'Name of pipeline file (e.g., .gitlab-ci.yml)', + }), + new Definition('project', { + default: null, + type: String, + description: 'Name of the project in the format group/project or group/subgroup/project', + }), + new Definition('environment', { + default: null, + type: String, + description: 'CI environment name', + alias: ['env'], + }), + // globals are alphabetical + globalDefinitions['dry-run'], + globalDefinitions.json, + globalDefinitions.registry, + globalDefinitions.yes, + ] + + getEntityUrl ({ providerHostname, file, entity }) { + if (file) { + return new URL(`${entity}/-/blob/HEAD/${file}`, providerHostname).toString() + } + return new URL(entity, providerHostname).toString() + } + + validateEntity (entity) { + if (entity.split('/').length < 2) { + throw new Error(`${this.constructor.providerEntity} must be specified in the format group/project or group/subgroup/project`) + } + } + + validateFile (file) { + if (file !== path.basename(file)) { + throw new Error('GitLab CI/CD pipeline file must be just a file not a path') + } + } + + static optionsToBody (options) { + const { file, project, environment } = options + const trustConfig = { + type: 'gitlab', + claims: { + project_path: project, + // this looks off, but this is correct + /** The ref path to the top-level pipeline definition, for example, gitlab.example.com/my-group/my-project//.gitlab-ci.yml@refs/heads/main. Introduced in GitLab 16.2. This claim is null unless the pipeline definition is located in the same project. */ + ci_config_ref_uri: { + file, + }, + ...(environment) && { environment }, + }, + } + return trustConfig + } + + // Convert API response body to options + static bodyToOptions (body) { + const file = body.claims?.ci_config_ref_uri?.file + const project = body.claims?.project_path + const environment = body.claims?.environment + return { + ...(body.id) && { id: body.id }, + ...(body.type) && { type: body.type }, + ...(file) && { file }, + ...(project) && { project }, + ...(environment) && { environment }, + } + } + + async exec (positionalArgs, flags) { + await this.createConfigCommand({ + positionalArgs, + flags, + }) + } +} + +module.exports = TrustGitLab diff --git a/node24/node_modules/npm/lib/commands/trust/index.js b/node24/node_modules/npm/lib/commands/trust/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e76ff65486aeb81dfbebca6eb7aaf2194ba2bc89 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/trust/index.js @@ -0,0 +1,25 @@ +const BaseCommand = require('../../base-cmd.js') + +class Trust extends BaseCommand { + static description = 'Create a trusted relationship between a package and a OIDC provider' + static name = 'trust' + static usage = null + + static subcommands = { + github: require('./github.js'), + gitlab: require('./gitlab.js'), + circleci: require('./circleci.js'), + list: require('./list.js'), + revoke: require('./revoke.js'), + } + + static async completion (opts) { + const argv = opts.conf.argv.remain + if (argv.length === 2) { + return Object.keys(Trust.subcommands) + } + return [] + } +} + +module.exports = Trust diff --git a/node24/node_modules/npm/lib/commands/trust/list.js b/node24/node_modules/npm/lib/commands/trust/list.js new file mode 100644 index 0000000000000000000000000000000000000000..1baa795206f2a98ae108d7229c6ccbe54c31b63b --- /dev/null +++ b/node24/node_modules/npm/lib/commands/trust/list.js @@ -0,0 +1,50 @@ +const { otplease } = require('../../utils/auth.js') +const npmFetch = require('npm-registry-fetch') +const npa = require('npm-package-arg') +const TrustCircleCI = require('./circleci.js') +const TrustGithub = require('./github.js') +const TrustGitlab = require('./gitlab.js') +const TrustCommand = require('../../trust-cmd.js') +const globalDefinitions = require('@npmcli/config/lib/definitions/definitions.js') + +class TrustList extends TrustCommand { + static description = 'List trusted relationships for a package' + static name = 'list' + static positionals = 1 // expects at most 1 positional (package name) + + static usage = [ + '[package]', + ] + + static definitions = [ + globalDefinitions.json, + globalDefinitions.registry, + ] + + static bodyToOptions (body) { + if (body.type === 'circleci') { + return TrustCircleCI.bodyToOptions(body) + } else if (body.type === 'github') { + return TrustGithub.bodyToOptions(body) + } else if (body.type === 'gitlab') { + return TrustGitlab.bodyToOptions(body) + } + return TrustCommand.bodyToOptions(body) + } + + async exec (positionalArgs) { + const packageName = positionalArgs[0] || (await this.optionalPkgJson()).name + if (!packageName) { + throw new Error('Package name must be specified either as an argument or in the package.json file') + } + const spec = npa(packageName) + const uri = `/-/package/${spec.escapedName}/trust` + const body = await otplease(this.npm, this.npm.flatOptions, opts => npmFetch.json(uri, { + ...opts, + method: 'GET', + })) + this.displayResponseBody({ body, packageName }) + } +} + +module.exports = TrustList diff --git a/node24/node_modules/npm/lib/commands/trust/revoke.js b/node24/node_modules/npm/lib/commands/trust/revoke.js new file mode 100644 index 0000000000000000000000000000000000000000..bf4c23ac84aa2a8cb99311e1659b042537fd9a20 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/trust/revoke.js @@ -0,0 +1,52 @@ +const globalDefinitions = require('@npmcli/config/lib/definitions/definitions.js') +const Definition = require('@npmcli/config/lib/definitions/definition.js') +const { otplease } = require('../../utils/auth.js') +const npmFetch = require('npm-registry-fetch') +const npa = require('npm-package-arg') +const TrustCommand = require('../../trust-cmd.js') + +class TrustRevoke extends TrustCommand { + static description = 'Revoke a trusted relationship for a package' + static name = 'revoke' + static positionals = 1 // expects at most 1 positional (package name) + + static usage = [ + '[package] --id=', + ] + + static definitions = [ + new Definition('id', { + default: null, + type: String, + description: 'ID of the trusted relationship to revoke', + required: true, + }), + globalDefinitions['dry-run'], + globalDefinitions.registry, + ] + + async exec (positionalArgs, flags) { + const dryRun = this.config.get('dry-run') + const pkgName = positionalArgs[0] || (await this.optionalPkgJson()).name + if (!pkgName) { + throw new Error('Package name must be specified either as an argument or in the package.json file') + } + const { id } = flags + if (!id) { + throw new Error('ID of the trusted relationship to revoke must be specified with the --id option') + } + this.dialogue`Attempting to revoke trusted configuration for package ${pkgName} with id ${id}` + if (dryRun) { + return + } + const spec = npa(pkgName) + const uri = `/-/package/${spec.escapedName}/trust/${encodeURIComponent(id)}` + await otplease(this.npm, this.npm.flatOptions, opts => npmFetch(uri, { + ...opts, + method: 'DELETE', + })) + this.dialogue`Revoked trusted configuration for package ${pkgName} with id ${id}` + } +} + +module.exports = TrustRevoke diff --git a/node24/node_modules/npm/lib/commands/undeprecate.js b/node24/node_modules/npm/lib/commands/undeprecate.js new file mode 100644 index 0000000000000000000000000000000000000000..13f40eb206590dd37b2efd818fe7d29116567c96 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/undeprecate.js @@ -0,0 +1,13 @@ +const Deprecate = require('./deprecate.js') + +class Undeprecate extends Deprecate { + static description = 'Undeprecate a version of a package' + static name = 'undeprecate' + static usage = [''] + + async exec ([pkg]) { + return super.exec([pkg, '']) + } +} + +module.exports = Undeprecate diff --git a/node24/node_modules/npm/lib/commands/uninstall.js b/node24/node_modules/npm/lib/commands/uninstall.js new file mode 100644 index 0000000000000000000000000000000000000000..ee91bd3491cb077b9673b0d2bb786ca0cea8df64 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/uninstall.js @@ -0,0 +1,54 @@ +const { resolve } = require('node:path') +const pkgJson = require('@npmcli/package-json') +const reifyFinish = require('../utils/reify-finish.js') +const completion = require('../utils/installed-shallow.js') +const ArboristWorkspaceCmd = require('../arborist-cmd.js') + +class Uninstall extends ArboristWorkspaceCmd { + static description = 'Remove a package' + static name = 'uninstall' + static params = ['save', 'global', ...super.params] + static usage = ['[<@scope>/]...'] + static ignoreImplicitWorkspace = false + + static async completion (opts, npm) { + return completion(npm, opts) + } + + async exec (args) { + if (!args.length) { + if (!this.npm.global) { + throw new Error('Must provide a package name to remove') + } else { + try { + const { content: pkg } = await pkgJson.normalize(this.npm.localPrefix) + args.push(pkg.name) + } catch (er) { + if (er.code !== 'ENOENT' && er.code !== 'ENOTDIR') { + throw er + } else { + throw this.usageError() + } + } + } + } + + // the /path/to/node_modules/.. + const path = this.npm.global + ? resolve(this.npm.globalDir, '..') + : this.npm.localPrefix + + const Arborist = require('@npmcli/arborist') + const opts = { + ...this.npm.flatOptions, + path, + rm: args, + workspaces: this.workspaceNames, + } + const arb = new Arborist(opts) + await arb.reify(opts) + await reifyFinish(this.npm, arb) + } +} + +module.exports = Uninstall diff --git a/node24/node_modules/npm/lib/commands/unpublish.js b/node24/node_modules/npm/lib/commands/unpublish.js new file mode 100644 index 0000000000000000000000000000000000000000..3ba0608fb71e8e8725f8e0aedbbc395024b825db --- /dev/null +++ b/node24/node_modules/npm/lib/commands/unpublish.js @@ -0,0 +1,163 @@ +const libaccess = require('libnpmaccess') +const libunpub = require('libnpmpublish').unpublish +const npa = require('npm-package-arg') +const pacote = require('pacote') +const { output, log } = require('proc-log') +const pkgJson = require('@npmcli/package-json') +const { flatten } = require('@npmcli/config/lib/definitions') +const getIdentity = require('../utils/get-identity.js') +const { otplease } = require('../utils/auth.js') +const BaseCommand = require('../base-cmd.js') + +const LAST_REMAINING_VERSION_ERROR = 'Refusing to delete the last version of the package. It will block from republishing a new version for 24 hours.\nRun with --force to do this.' + +class Unpublish extends BaseCommand { + static description = 'Remove a package from the registry' + static name = 'unpublish' + static params = ['dry-run', 'force', 'workspace', 'workspaces'] + static usage = ['[]'] + static workspaces = true + static ignoreImplicitWorkspace = false + + static async getKeysOfVersions (name, opts) { + const packument = await pacote.packument(name, { + ...opts, + spec: name, + query: { write: true }, + _isRoot: true, + }) + return Object.keys(packument.versions) + } + + static async completion (args, npm) { + const { partialWord, conf } = args + + if (conf.argv.remain.length >= 3) { + return [] + } + + const opts = { ...npm.flatOptions } + const username = await getIdentity(npm, { ...opts }).catch(() => null) + if (!username) { + return [] + } + + const access = await libaccess.getPackages(username, opts) + // do a bit of filtering at this point, so that we don't need to fetch versions for more than one thing, but also don't accidentally unpublish a whole project + let pkgs = Object.keys(access) + if (!partialWord || !pkgs.length) { + return pkgs + } + + const pp = npa(partialWord).name + pkgs = pkgs.filter(p => !p.indexOf(pp)) + if (pkgs.length > 1) { + return pkgs + } + + const versions = await Unpublish.getKeysOfVersions(pkgs[0], opts) + if (!versions.length) { + return pkgs + } else { + return versions.map(v => `${pkgs[0]}@${v}`) + } + } + + async exec (args, { localPrefix } = {}) { + if (args.length > 1) { + throw this.usageError() + } + + // workspace mode + if (!localPrefix) { + localPrefix = this.npm.localPrefix + } + + const force = this.npm.config.get('force') + const { silent } = this.npm + const dryRun = this.npm.config.get('dry-run') + + let spec + if (args.length) { + spec = npa(args[0]) + if (spec.type !== 'version' && spec.rawSpec !== '*') { + throw this.usageError('Can only unpublish a single version, or the entire project.\nTags and ranges are not supported.') + } + } + + log.silly('unpublish', 'args[0]', args[0]) + log.silly('unpublish', 'spec', spec) + + if (spec?.rawSpec === '*' && !force) { + throw this.usageError('Refusing to delete entire project.\nRun with --force to do this.') + } + + const opts = { ...this.npm.flatOptions } + + let manifest + try { + const { content } = await pkgJson.prepare(localPrefix) + manifest = content + } catch (err) { + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') { + if (!spec) { + // We needed a local package.json to figure out what package to unpublish + throw this.usageError() + } + } else { + // folks should know if ANY local package.json had a parsing error. + // They may be relying on `publishConfig` to be loading and we don't want to ignore errors in that case. + throw err + } + } + + let pkgVersion // for cli output + if (spec) { + pkgVersion = spec.type === 'version' ? `@${spec.rawSpec}` : '' + } else { + spec = npa.resolve(manifest.name, manifest.version) + log.verbose('unpublish', manifest) + pkgVersion = manifest.version ? `@${manifest.version}` : '' + if (!manifest.version && !force) { + throw this.usageError('Refusing to delete entire project.\nRun with --force to do this.') + } + } + + // If localPrefix has a package.json with a name that matches the package being unpublished, load up the publishConfig + if (manifest?.name === spec.name && manifest.publishConfig) { + const cliFlags = this.npm.config.data.get('cli').raw + // Filter out properties set in CLI flags to prioritize them over corresponding `publishConfig` settings + const filteredPublishConfig = Object.fromEntries( + Object.entries(manifest.publishConfig).filter(([key]) => !(key in cliFlags))) + for (const key in filteredPublishConfig) { + this.npm.config.checkUnknown('publishConfig', key) + } + flatten(filteredPublishConfig, opts) + } + + const versions = await Unpublish.getKeysOfVersions(spec.name, opts) + if (versions.length === 1 && spec.rawSpec === versions[0] && !force) { + throw this.usageError(LAST_REMAINING_VERSION_ERROR) + } + if (versions.length === 1) { + pkgVersion = '' + } + + if (!dryRun) { + await otplease(this.npm, opts, o => libunpub(spec, o)) + } + if (!silent) { + output.standard(`- ${spec.name}${pkgVersion}`) + } + } + + async execWorkspaces (args) { + await this.setWorkspaces() + + for (const path of this.workspacePaths) { + await this.exec(args, { localPrefix: path }) + } + } +} + +module.exports = Unpublish diff --git a/node24/node_modules/npm/lib/commands/unstar.js b/node24/node_modules/npm/lib/commands/unstar.js new file mode 100644 index 0000000000000000000000000000000000000000..e152e9bad4cf09960c0d2e286fc0804a509160fe --- /dev/null +++ b/node24/node_modules/npm/lib/commands/unstar.js @@ -0,0 +1,8 @@ +const Star = require('./star.js') + +class Unstar extends Star { + static description = 'Remove an item from your favorite packages' + static name = 'unstar' +} + +module.exports = Unstar diff --git a/node24/node_modules/npm/lib/commands/update.js b/node24/node_modules/npm/lib/commands/update.js new file mode 100644 index 0000000000000000000000000000000000000000..d30411bc6b79425a35ecf85c2f53b698b5abed1a --- /dev/null +++ b/node24/node_modules/npm/lib/commands/update.js @@ -0,0 +1,66 @@ +const path = require('node:path') +const { log } = require('proc-log') +const reifyFinish = require('../utils/reify-finish.js') +const ArboristWorkspaceCmd = require('../arborist-cmd.js') + +class Update extends ArboristWorkspaceCmd { + static description = 'Update packages' + static name = 'update' + + static params = [ + 'save', + 'global', + 'install-strategy', + 'legacy-bundling', + 'global-style', + 'omit', + 'include', + 'strict-peer-deps', + 'package-lock', + 'foreground-scripts', + 'ignore-scripts', + 'audit', + 'before', + 'bin-links', + 'fund', + 'dry-run', + ...super.params, + ] + + static usage = ['[...]'] + + static async completion (opts, npm) { + const completion = require('../utils/installed-deep.js') + return completion(npm, opts) + } + + async exec (args) { + const update = args.length === 0 ? true : args + const global = path.resolve(this.npm.globalDir, '..') + const where = this.npm.global ? global : this.npm.prefix + + // In the context of `npm update` the save config value should default to `false` + const save = this.npm.config.isDefault('save') + ? false + : this.npm.config.get('save') + + if (this.npm.config.get('depth')) { + log.warn('update', 'The --depth option no longer has any effect. See RFC0019.\n' + + 'https://github.com/npm/rfcs/blob/latest/implemented/0019-remove-update-depth-option.md') + } + + const Arborist = require('@npmcli/arborist') + const opts = { + ...this.npm.flatOptions, + path: where, + save, + workspaces: this.workspaceNames, + } + const arb = new Arborist(opts) + + await arb.reify({ ...opts, update }) + await reifyFinish(this.npm, arb) + } +} + +module.exports = Update diff --git a/node24/node_modules/npm/lib/commands/version.js b/node24/node_modules/npm/lib/commands/version.js new file mode 100644 index 0000000000000000000000000000000000000000..4c4b9dd30ee972db8dfd6756d15dc0824382f4db --- /dev/null +++ b/node24/node_modules/npm/lib/commands/version.js @@ -0,0 +1,152 @@ +const { resolve } = require('node:path') +const { readFile } = require('node:fs/promises') +const { output } = require('proc-log') +const BaseCommand = require('../base-cmd.js') + +class Version extends BaseCommand { + static description = 'Bump a package version' + static name = 'version' + static params = [ + 'allow-same-version', + 'commit-hooks', + 'git-tag-version', + 'json', + 'preid', + 'sign-git-tag', + 'save', + 'workspace', + 'workspaces', + 'workspaces-update', + 'include-workspace-root', + 'ignore-scripts', + ] + + static workspaces = true + static ignoreImplicitWorkspace = false + + static usage = ['[ | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]'] + + static async completion (opts) { + const { + conf: { + argv: { remain }, + }, + } = opts + if (remain.length > 2) { + return [] + } + + return [ + 'major', + 'minor', + 'patch', + 'premajor', + 'preminor', + 'prepatch', + 'prerelease', + 'from-git', + ] + } + + async exec (args) { + switch (args.length) { + case 0: + return this.list() + case 1: + return this.change(args) + default: + throw this.usageError() + } + } + + async execWorkspaces (args) { + switch (args.length) { + case 0: + return this.listWorkspaces() + case 1: + return this.changeWorkspaces(args) + default: + throw this.usageError() + } + } + + async change (args) { + const libnpmversion = require('libnpmversion') + const prefix = this.npm.config.get('tag-version-prefix') + const version = await libnpmversion(args[0], { + ...this.npm.flatOptions, + path: this.npm.prefix, + }) + return output.standard(`${prefix}${version}`) + } + + async changeWorkspaces (args) { + const updateWorkspaces = require('../utils/update-workspaces.js') + const libnpmversion = require('libnpmversion') + const prefix = this.npm.config.get('tag-version-prefix') + const { + config, + flatOptions, + localPrefix, + } = this.npm + await this.setWorkspaces() + const updatedWorkspaces = [] + for (const [name, path] of this.workspaces) { + output.standard(name) + const version = await libnpmversion(args[0], { + ...flatOptions, + 'git-tag-version': false, + path, + }) + updatedWorkspaces.push(name) + output.standard(`${prefix}${version}`) + } + return updateWorkspaces({ + config, + flatOptions, + localPrefix, + npm: this.npm, + workspaces: updatedWorkspaces, + }) + } + + async list (results = {}) { + const pj = resolve(this.npm.prefix, 'package.json') + + const pkg = await readFile(pj, 'utf8') + .then(data => JSON.parse(data)) + .catch(() => ({})) + + if (pkg.name && pkg.version) { + results[pkg.name] = pkg.version + } + + results.npm = this.npm.version + for (const [key, version] of Object.entries(process.versions)) { + results[key] = version + } + + if (this.npm.config.get('json')) { + output.buffer(results) + } else { + output.standard(results) + } + } + + async listWorkspaces () { + const results = {} + await this.setWorkspaces() + for (const path of this.workspacePaths) { + const pj = resolve(path, 'package.json') + // setWorkspaces has already parsed package.json so we know it won't error + const pkg = await readFile(pj, 'utf8').then(data => JSON.parse(data)) + + if (pkg.name && pkg.version) { + results[pkg.name] = pkg.version + } + } + return this.list(results) + } +} + +module.exports = Version diff --git a/node24/node_modules/npm/lib/commands/view.js b/node24/node_modules/npm/lib/commands/view.js new file mode 100644 index 0000000000000000000000000000000000000000..1ed17fea2fbcdace228d0965fd9d3fc1d57e0399 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/view.js @@ -0,0 +1,488 @@ +const { readFile } = require('node:fs/promises') +const jsonParse = require('json-parse-even-better-errors') +const { log, output, META } = require('proc-log') +const npa = require('npm-package-arg') +const { resolve } = require('node:path') +const formatBytes = require('../utils/format-bytes.js') +const relativeDate = require('tiny-relative-date') +const semver = require('semver') +const { inspect } = require('node:util') +const { packument } = require('pacote') +const Queryable = require('../utils/queryable.js') +const BaseCommand = require('../base-cmd.js') +const { getError } = require('../utils/error-message.js') +const { jsonError, outputError } = require('../utils/output-error.js') + +const readJson = file => readFile(file, 'utf8').then(jsonParse) + +class View extends BaseCommand { + static description = 'View registry info' + static name = 'view' + static params = [ + 'json', + 'workspace', + 'workspaces', + 'include-workspace-root', + ] + + static workspaces = true + static ignoreImplicitWorkspace = false + static usage = ['[] [[.subfield]...]'] + + static async completion (opts, npm) { + if (opts.conf.argv.remain.length <= 2) { + // There used to be registry completion here, but it stopped making sense somewhere around 50,000 packages on the registry + return + } + // have the package, get the fields + const config = { + ...npm.flatOptions, + fullMetadata: true, + preferOnline: true, + _isRoot: true, + } + const spec = npa(opts.conf.argv.remain[2]) + const pckmnt = await packument(spec, config) + const defaultTag = npm.config.get('tag') + const dv = pckmnt.versions[pckmnt['dist-tags'][defaultTag]] + pckmnt.versions = Object.keys(pckmnt.versions).sort(semver.compareLoose) + + return getCompletionFields(pckmnt).concat(getCompletionFields(dv)) + } + + async exec (args) { + let { pkg, local, rest } = parseArgs(args) + + if (local) { + if (this.npm.global) { + throw new Error('Cannot use view command in global mode.') + } + const dir = this.npm.prefix + const manifest = await readJson(resolve(dir, 'package.json')) + if (!manifest.name) { + throw new Error('Invalid package.json, no "name" field') + } + // put the version back if it existed + pkg = `${manifest.name}${pkg.slice(1)}` + } + + await this.#viewPackage(pkg, rest) + } + + async execWorkspaces (args) { + const { pkg, local, rest } = parseArgs(args) + + if (!local) { + log.warn('Ignoring workspaces for specified package(s)') + return this.exec([pkg, ...rest]) + } + + const json = this.npm.config.get('json') + await this.setWorkspaces() + + for (const name of this.workspaceNames) { + try { + await this.#viewPackage(`${name}${pkg.slice(1)}`, rest, { workspace: true }) + } catch (e) { + const err = getError(e, { npm: this.npm, command: this }) + if (err.code !== 'E404') { + throw e + } + if (json) { + output.buffer({ [META]: true, jsonError: { [name]: jsonError(err, this.npm) } }) + } else { + outputError(err) + } + process.exitCode = err.exitCode + } + } + } + + async #viewPackage (name, args, { workspace } = {}) { + const wholePackument = !args.length + const json = this.npm.config.get('json') + + // If we are viewing many packages and outputting individual fields then output the name before doing any async activity + if (!json && !wholePackument && workspace) { + output.standard(`${name}:`) + } + + const [pckmnt, data] = await this.#getData(name, args, wholePackument) + + if (!json && wholePackument) { + // pretty view (entire packument) + for (const v of data) { + output.standard(this.#prettyView(pckmnt, Object.values(v)[0][Queryable.ALL])) + } + return + } + + const res = this.#packageOutput(cleanData(data, wholePackument), pckmnt._id) + if (res) { + if (json) { + output.buffer(workspace ? { [name]: res } : res) + } else { + output.standard(res) + } + } + } + + async #getData (pkg, args) { + const spec = npa(pkg) + + const pckmnt = await packument(spec, { + ...this.npm.flatOptions, + preferOnline: true, + fullMetadata: true, + _isRoot: true, + }) + + // get the data about this package + let version = this.npm.config.get('tag') + // rawSpec is the git url if this is from git + if (spec.type !== 'git' && spec.type !== 'directory' && spec.rawSpec !== '*') { + version = spec.rawSpec + } + + if (pckmnt['dist-tags']?.[version]) { + version = pckmnt['dist-tags'][version] + } + + if (pckmnt.time?.unpublished) { + const u = pckmnt.time.unpublished + throw Object.assign(new Error(`Unpublished on ${u.time}`), { + statusCode: 404, + code: 'E404', + pkgid: pckmnt._id, + }) + } + + const versions = pckmnt.versions || {} + pckmnt.versions = Object.keys(versions).filter(v => { + if (semver.valid(v)) { + return true + } + log.info('view', `Ignoring invalid version: ${v}`) + return false + }).sort(semver.compareLoose) + + // remove readme unless we asked for it + if (args.indexOf('readme') === -1) { + delete pckmnt.readme + } + + const data = Object.entries(versions) + .filter(([v]) => semver.satisfies(v, version, true)) + .flatMap(([, v]) => { + // remove readme unless we asked for it + if (args.indexOf('readme') !== -1) { + delete v.readme + } + return showFields({ + data: pckmnt, + version: v, + fields: args, + json: this.npm.config.get('json'), + }) + }) + + // No data has been pushed because no data is matching the specified version + if (!data.length && version !== 'latest') { + throw Object.assign(new Error(`No match found for version ${version}`), { + statusCode: 404, + code: 'E404', + pkgid: `${pckmnt._id}@${version}`, + }) + } + + return [pckmnt, data] + } + + #packageOutput (data, name) { + const json = this.npm.config.get('json') + const versions = Object.keys(data) + const includeVersions = versions.length > 1 + + let includeFields + const res = versions.flatMap((v) => { + const fields = Object.entries(data[v]) + + includeFields ||= (fields.length > 1) + + const msg = json ? {} : [] + + for (let [f, d] of fields) { + d = cleanup(d) + + if (json) { + msg[f] = d + continue + } + + if (includeVersions || includeFields || typeof d !== 'string') { + d = inspect(d, { + showHidden: false, + depth: 5, + colors: this.npm.color, + maxArrayLength: null, + }) + } + + if (f && includeFields) { + f += ' = ' + } + + msg.push(`${includeVersions ? `${name}@${v} ` : ''}${includeFields ? f : ''}${d}`) + } + + return msg + }) + + if (json) { + // TODO(BREAKING_CHANGE): all unwrapping should be removed. + // Users should know based on their arguments if they can expect an array or an object. + // And this unwrapping can break that assumption. + // e.g. `npm view abbrev@^2` should always return an array, but currently since there is only one version matching `^2` this will return a single object instead. + const first = Object.keys(res[0] || {}) + const jsonRes = first.length === 1 ? res.map(m => m[first[0]]) : res + if (jsonRes.length === 0) { + return + } + if (jsonRes.length === 1) { + return jsonRes[0] + } + return jsonRes + } + + return res.join('\n').trim() + } + + #prettyView (packu, manifest) { + // More modern, pretty printing of default view + const unicode = this.npm.config.get('unicode') + const chalk = this.npm.chalk + const deps = Object.entries(manifest.dependencies || {}).map(([k, dep]) => + `${chalk.blue(k)}: ${dep}` + ) + + // Sort dist-tags by publish time when available, then by tag name, keeping `latest` at the top of the list. + const distTags = Object.entries(packu['dist-tags']) + .sort(([aTag, aVer], [bTag, bVer]) => { + const timeMap = packu.time || {} + const aTime = aTag === 'latest' ? Infinity : Date.parse(timeMap[aVer] || 0) + const bTime = bTag === 'latest' ? Infinity : Date.parse(timeMap[bVer] || 0) + if (aTime === bTime) { + return aTag > bTag ? -1 : 1 + } + return aTime > bTime ? -1 : 1 + }) + .map(([k, t]) => `${chalk.blue(k)}: ${t}`) + + const site = manifest.homepage?.url || manifest.homepage + const bins = Object.keys(manifest.bin || {}) + const licenseField = manifest.license || 'Proprietary' + const license = typeof licenseField === 'string' + ? licenseField + : (licenseField.type || 'Proprietary') + + const res = [] + + res.push('') + res.push([ + chalk.underline.cyan(`${manifest.name}@${manifest.version}`), + license.toLowerCase().trim() === 'proprietary' + ? chalk.red(license) + : chalk.green(license), + `deps: ${deps.length ? chalk.cyan(deps.length) : chalk.cyan('none')}`, + `versions: ${chalk.cyan(packu.versions.length + '')}`, + ].join(' | ')) + + manifest.description && res.push(manifest.description) + if (site) { + res.push(chalk.blue(site)) + } + + manifest.deprecated && res.push( + `\n${chalk.redBright('DEPRECATED')}${unicode ? ' ⚠️ ' : '!!'} - ${manifest.deprecated}` + ) + + if (packu.keywords?.length) { + res.push(`\nkeywords: ${ + packu.keywords.map(k => chalk.cyan(k)).join(', ') + }`) + } + + if (bins.length) { + res.push(`\nbin: ${chalk.cyan(bins.join(', '))}`) + } + + res.push('\ndist') + res.push(`.tarball: ${chalk.blue(manifest.dist.tarball)}`) + res.push(`.shasum: ${chalk.green(manifest.dist.shasum)}`) + if (manifest.dist.integrity) { + res.push(`.integrity: ${chalk.green(manifest.dist.integrity)}`) + } + if (manifest.dist.unpackedSize) { + res.push(`.unpackedSize: ${chalk.blue(formatBytes(manifest.dist.unpackedSize, true))}`) + } + + if (deps.length) { + const maxDeps = 24 + res.push('\ndependencies:') + res.push(deps.slice(0, maxDeps).join(', ')) + if (deps.length > maxDeps) { + res.push(chalk.dim(`(...and ${deps.length - maxDeps} more.)`)) + } + } + + if (packu.maintainers?.length) { + res.push('\nmaintainers:') + packu.maintainers.forEach(u => + res.push(`- ${unparsePerson({ + name: chalk.blue(u.name), + email: chalk.dim(u.email) })}`) + ) + } + + res.push('\ndist-tags:') + const maxTags = 5 + res.push(distTags.slice(0, maxTags).join('\n')) + if (distTags.length > maxTags) { + res.push(chalk.dim(`(...and ${distTags.length - maxTags} more.)`)) + } + + const publisher = manifest._npmUser && unparsePerson({ + name: chalk.blue(manifest._npmUser.name), + email: chalk.dim(manifest._npmUser.email), + }) + if (publisher || packu.time) { + let publishInfo = 'published' + if (packu.time?.[manifest.version]) { + publishInfo += ` ${chalk.cyan(relativeDate(packu.time[manifest.version]))}` + } + if (publisher) { + publishInfo += ` by ${publisher}` + } + res.push('') + res.push(publishInfo) + } + + return res.join('\n') + } +} + +module.exports = View + +function parseArgs (args) { + if (!args.length) { + args = ['.'] + } + + const pkg = args.shift() + + return { + pkg, + local: /^\.@/.test(pkg) || pkg === '.', + rest: args, + } +} + +function cleanData (obj, wholePackument) { + // JSON formatted output (JSON or specific attributes from packument) + const data = obj.reduce((acc, cur) => { + if (cur) { + Object.entries(cur).forEach(([k, v]) => { + acc[k] ||= {} + Object.keys(v).forEach((t) => { + acc[k][t] = cur[k][t] + }) + }) + } + return acc + }, {}) + + if (wholePackument) { + const cleaned = Object.entries(data).reduce((acc, [k, v]) => { + acc[k] = v[Queryable.ALL] + return acc + }, {}) + log.silly('view', cleaned) + return cleaned + } + + return data +} + +// return whatever was printed +function showFields ({ data, version, fields, json }) { + const o = [data, version].reduce((acc, s) => { + Object.entries(s).forEach(([k, v]) => { + acc[k] = v + }) + return acc + }, {}) + + const queryable = new Queryable(o) + + if (!fields.length) { + return { [version.version]: queryable.query(Queryable.ALL) } + } + + return fields.map((field) => { + const s = queryable.query(field, { unwrapSingleItemArrays: !json }) + if (s) { + return { [version.version]: s } + } + }) +} + +function cleanup (data) { + if (Array.isArray(data)) { + return data.map(cleanup) + } + + if (!data || typeof data !== 'object') { + return data + } + + const keys = Object.keys(data) + + if (keys.length <= 3 && data.name && ( + (keys.length === 1) || + (keys.length === 3 && data.email && data.url) || + (keys.length === 2 && (data.email || data.url)) || + data.trustedPublisher + )) { + data = unparsePerson(data) + } + + return data +} + +const unparsePerson = (d) => + `${d.name}${d.email ? ` <${d.email}>` : ''}${d.url ? ` (${d.url})` : ''}` + +function getCompletionFields (d, f = [], pref = []) { + Object.entries(d).forEach(([k, v]) => { + if (k.charAt(0) === '_' || k.indexOf('.') !== -1) { + return + } + const p = pref.concat(k).join('.') + f.push(p) + if (Array.isArray(v)) { + v.forEach((val, i) => { + const pi = p + '[' + i + ']' + if (val && typeof val === 'object') { + getCompletionFields(val, f, [p]) + } else { + f.push(pi) + } + }) + return + } + if (typeof v === 'object') { + getCompletionFields(v, f, [p]) + } + }) + return f +} diff --git a/node24/node_modules/npm/lib/commands/whoami.js b/node24/node_modules/npm/lib/commands/whoami.js new file mode 100644 index 0000000000000000000000000000000000000000..dbeb9160b3d78da022327e6085a92b862a3852d9 --- /dev/null +++ b/node24/node_modules/npm/lib/commands/whoami.js @@ -0,0 +1,20 @@ +const { output } = require('proc-log') +const getIdentity = require('../utils/get-identity.js') +const BaseCommand = require('../base-cmd.js') + +class Whoami extends BaseCommand { + static description = 'Display npm username' + static name = 'whoami' + static params = ['registry'] + + async exec () { + const username = await getIdentity(this.npm, { ...this.npm.flatOptions }) + if (this.npm.config.get('json')) { + output.buffer(username) + } else { + output.standard(username) + } + } +} + +module.exports = Whoami diff --git a/node24/node_modules/npm/lib/utils/audit-error.js b/node24/node_modules/npm/lib/utils/audit-error.js new file mode 100644 index 0000000000000000000000000000000000000000..60c8824baa0c9adb85b30c7de43148c7ef5777dc --- /dev/null +++ b/node24/node_modules/npm/lib/utils/audit-error.js @@ -0,0 +1,40 @@ +const { log, output } = require('proc-log') +const { redactLog: replaceInfo } = require('@npmcli/redact') + +// Print an error or just nothing if the audit report has an error. +// This is called by the audit command, and by the reify-output util prints a JSON version of the error if it's --json. +// Returns 'true' if there was an error, false otherwise. + +const auditError = (npm, report) => { + if (!report?.error) { + return false + } + + if (npm.command !== 'audit') { + return true + } + + const { error } = report + + // ok, we care about it, then + log.warn('audit', error.message) + const { body: errBody } = error + const body = Buffer.isBuffer(errBody) ? errBody.toString() : errBody + if (npm.flatOptions.json) { + output.buffer({ + message: error.message, + method: error.method, + uri: replaceInfo(error.uri), + headers: error.headers, + statusCode: error.statusCode, + body, + }) + } else { + output.standard(body) + } + + // XXX we should throw a real error here + throw 'audit endpoint returned an error' +} + +module.exports = auditError diff --git a/node24/node_modules/npm/lib/utils/auth.js b/node24/node_modules/npm/lib/utils/auth.js new file mode 100644 index 0000000000000000000000000000000000000000..ad1cb61b496515baeaffc8e68a41ef41b843e1e3 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/auth.js @@ -0,0 +1,108 @@ +const { webAuthOpener, adduserWeb, loginWeb, loginCouch, adduserCouch } = require('npm-profile') +const { log } = require('proc-log') +const { createOpener } = require('../utils/open-url.js') +const read = require('../utils/read-user-info.js') + +const otplease = async (npm, opts, fn) => { + try { + return await fn(opts) + } catch (err) { + if (!process.stdin.isTTY || !process.stdout.isTTY) { + throw err + } + + // web otp + if (err.code === 'EOTP' && err.body?.authUrl && err.body?.doneUrl) { + const { token: otp } = await webAuthOpener( + createOpener(npm, 'Authenticate your account at'), + err.body.authUrl, + err.body.doneUrl, + opts + ) + return await fn({ ...opts, otp }) + } + + // classic otp + if (err.code === 'EOTP' || (err.code === 'E401' && /one-time pass/.test(err.body))) { + const otp = await read.otp('This operation requires a one-time password.\nEnter OTP:') + return await fn({ ...opts, otp }) + } + + throw err + } +} + +const adduser = async (npm, { creds, ...opts }) => { + const authType = npm.config.get('auth-type') + let res + if (authType === 'web') { + try { + res = await adduserWeb(createOpener(npm, 'Create your account at'), opts) + } catch (err) { + if (err.code === 'ENYI') { + log.verbose('web add user not supported, trying couch') + } else { + throw err + } + } + } + + // auth type !== web or ENYI error w/ web adduser + if (!res) { + const username = await read.username('Username:', creds.username) + const password = await read.password('Password:', creds.password) + const email = await read.email('Email (this will be public):', creds.email) + // npm registry quirk: + // If you "add" an existing user with their current password, it's effectively a login, and if that account has otp you'll be prompted for it. + res = await otplease(npm, opts, (reqOpts) => adduserCouch(username, email, password, reqOpts)) + } + + // We don't know the username if it was a web login, all we can reliably log is scope and registry + const message = `Logged in${opts.scope ? ` to scope ${opts.scope}` : ''} on ${opts.registry}.` + + log.info('adduser', message) + + return { + message, + newCreds: { token: res.token }, + } +} + +const login = async (npm, { creds, ...opts }) => { + const authType = npm.config.get('auth-type') + let res + if (authType === 'web') { + try { + res = await loginWeb(createOpener(npm, 'Login at'), opts) + } catch (err) { + if (err.code === 'ENYI') { + log.verbose('web login not supported, trying couch') + } else { + throw err + } + } + } + + // auth type !== web or ENYI error w/ web login + if (!res) { + const username = await read.username('Username:', creds.username) + const password = await read.password('Password:', creds.password) + res = await otplease(npm, opts, (reqOpts) => loginCouch(username, password, reqOpts)) + } + + // We don't know the username if it was a web login, all we can reliably log is scope and registry + const message = `Logged in${opts.scope ? ` to scope ${opts.scope}` : ''} on ${opts.registry}.` + + log.info('login', message) + + return { + message, + newCreds: { token: res.token }, + } +} + +module.exports = { + adduser, + login, + otplease, +} diff --git a/node24/node_modules/npm/lib/utils/cmd-list.js b/node24/node_modules/npm/lib/utils/cmd-list.js new file mode 100644 index 0000000000000000000000000000000000000000..0eeaae08892de7cfd8200e9bfba8f66acc832736 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/cmd-list.js @@ -0,0 +1,178 @@ +const abbrev = require('abbrev') + +// These correspond to filenames in lib/commands +// Please keep this list sorted alphabetically +const commands = [ + 'access', + 'adduser', + 'audit', + 'bugs', + 'cache', + 'ci', + 'completion', + 'config', + 'dedupe', + 'deprecate', + 'diff', + 'dist-tag', + 'docs', + 'doctor', + 'edit', + 'exec', + 'explain', + 'explore', + 'find-dupes', + 'fund', + 'get', + 'help', + 'help-search', + 'init', + 'install', + 'install-ci-test', + 'install-test', + 'link', + 'll', + 'login', + 'logout', + 'ls', + 'org', + 'outdated', + 'owner', + 'pack', + 'ping', + 'pkg', + 'prefix', + 'profile', + 'prune', + 'publish', + 'query', + 'rebuild', + 'repo', + 'restart', + 'root', + 'run', + 'sbom', + 'search', + 'set', + 'shrinkwrap', + 'star', + 'stars', + 'start', + 'stop', + 'team', + 'test', + 'token', + 'trust', + 'undeprecate', + 'uninstall', + 'unpublish', + 'unstar', + 'update', + 'version', + 'view', + 'whoami', +] + +// These must resolve to an entry in commands +const aliases = { + + // aliases + author: 'owner', + home: 'docs', + issues: 'bugs', + info: 'view', + show: 'view', + find: 'search', + add: 'install', + unlink: 'uninstall', + remove: 'uninstall', + rm: 'uninstall', + r: 'uninstall', + + // short names for common things + un: 'uninstall', + rb: 'rebuild', + list: 'ls', + ln: 'link', + create: 'init', + i: 'install', + it: 'install-test', + cit: 'install-ci-test', + up: 'update', + c: 'config', + s: 'search', + se: 'search', + tst: 'test', + t: 'test', + ddp: 'dedupe', + v: 'view', + 'run-script': 'run', + 'clean-install': 'ci', + 'clean-install-test': 'install-ci-test', + x: 'exec', + why: 'explain', + la: 'll', + verison: 'version', + ic: 'ci', + + // typos + innit: 'init', + // manually abbrev so that install-test doesn't make insta stop working + in: 'install', + ins: 'install', + inst: 'install', + insta: 'install', + instal: 'install', + isnt: 'install', + isnta: 'install', + isntal: 'install', + isntall: 'install', + 'install-clean': 'ci', + 'isntall-clean': 'ci', + hlep: 'help', + 'dist-tags': 'dist-tag', + upgrade: 'update', + udpate: 'update', + rum: 'run', + sit: 'install-ci-test', + urn: 'run', + ogr: 'org', + 'add-user': 'adduser', +} + +const deref = (c) => { + if (!c) { + return + } + + // Translate camelCase to snake-case (i.e. installTest to install-test) + if (c.match(/[A-Z]/)) { + c = c.replace(/([A-Z])/g, m => '-' + m.toLowerCase()) + } + + // if they asked for something exactly we are done + if (commands.includes(c)) { + return c + } + + // if they asked for a direct alias + if (aliases[c]) { + return aliases[c] + } + + const abbrevs = abbrev(commands.concat(Object.keys(aliases))) + + // first deref the abbrev, + // if there is one then resolve any aliases so `npm install-cl` will resolve to `install-clean` then to `ci` + let a = abbrevs[c] + while (aliases[a]) { + a = aliases[a] + } + return a +} + +module.exports = { + aliases, + commands, + deref, +} diff --git a/node24/node_modules/npm/lib/utils/completion.fish b/node24/node_modules/npm/lib/utils/completion.fish new file mode 100644 index 0000000000000000000000000000000000000000..c83d43a7787c1b02f9eaf2882a7895cef861883b --- /dev/null +++ b/node24/node_modules/npm/lib/utils/completion.fish @@ -0,0 +1,40 @@ +# npm completions for Fish shell +# This script is a work in progress and does not fall under the normal semver contract as the rest of npm. + +# __fish_npm_needs_command taken from: +# https://stackoverflow.com/questions/16657803/creating-autocomplete-script-with-sub-commands +function __fish_npm_needs_command + set -l cmd (commandline -opc) + + if test (count $cmd) -eq 1 + return 0 + end + + return 1 +end + +# Taken from https://github.com/fish-shell/fish-shell/blob/HEAD/share/completions/npm.fish +function __fish_complete_npm -d "Complete the commandline using npm's 'completion' tool" + # tell npm we are fish shell + set -lx COMP_FISH true + if command -sq npm + # npm completion is bash-centric, so we need to translate fish's "commandline" stuff to bash's $COMP_* stuff + # COMP_LINE is an array with the words in the commandline + set -lx COMP_LINE (commandline -opc) + # COMP_CWORD is the index of the current word in COMP_LINE + # bash starts arrays with 0, so subtract 1 + set -lx COMP_CWORD (math (count $COMP_LINE) - 1) + # COMP_POINT is the index of point/cursor when the commandline is viewed as a string + set -lx COMP_POINT (commandline -C) + # If the cursor is after the last word, the empty token will disappear in the expansion + # Readd it + if test (commandline -ct) = "" + set COMP_CWORD (math $COMP_CWORD + 1) + set COMP_LINE $COMP_LINE "" + end + command npm completion -- $COMP_LINE 2>/dev/null + end +end + +# flush out what ships with fish +complete -e npm diff --git a/node24/node_modules/npm/lib/utils/completion.sh b/node24/node_modules/npm/lib/utils/completion.sh new file mode 100644 index 0000000000000000000000000000000000000000..c7d72ee9663f496886b236530ed54abe1788d25b --- /dev/null +++ b/node24/node_modules/npm/lib/utils/completion.sh @@ -0,0 +1,70 @@ +#!/bin/bash +###-begin-npm-completion-### +# +# npm command completion script +# +# Installation: npm completion >> ~/.bashrc (or ~/.zshrc) +# Or, maybe: npm completion > /usr/local/etc/bash_completion.d/npm +# + +if type complete &>/dev/null; then + _npm_completion () { + local words cword + if type _get_comp_words_by_ref &>/dev/null; then + _get_comp_words_by_ref -n = -n @ -n : -w words -i cword + else + cword="$COMP_CWORD" + words=("${COMP_WORDS[@]}") + fi + + local si="$IFS" + if ! IFS=$'\n' COMPREPLY=($(COMP_CWORD="$cword" \ + COMP_LINE="$COMP_LINE" \ + COMP_POINT="$COMP_POINT" \ + npm completion -- "${words[@]}" \ + 2>/dev/null)); then + local ret=$? + IFS="$si" + return $ret + fi + IFS="$si" + if type __ltrim_colon_completions &>/dev/null; then + __ltrim_colon_completions "${words[cword]}" + fi + } + complete -o default -F _npm_completion npm +elif type compdef &>/dev/null; then + _npm_completion() { + local si=$IFS + compadd -- $(COMP_CWORD=$((CURRENT-1)) \ + COMP_LINE=$BUFFER \ + COMP_POINT=0 \ + npm completion -- "${words[@]}" \ + 2>/dev/null) + IFS=$si + } + compdef _npm_completion npm +elif type compctl &>/dev/null; then + _npm_completion () { + local cword line point words si + read -Ac words + read -cn cword + let cword-=1 + read -l line + read -ln point + si="$IFS" + if ! IFS=$'\n' reply=($(COMP_CWORD="$cword" \ + COMP_LINE="$line" \ + COMP_POINT="$point" \ + npm completion -- "${words[@]}" \ + 2>/dev/null)); then + + local ret=$? + IFS="$si" + return $ret + fi + IFS="$si" + } + compctl -K _npm_completion npm +fi +###-end-npm-completion-### diff --git a/node24/node_modules/npm/lib/utils/did-you-mean.js b/node24/node_modules/npm/lib/utils/did-you-mean.js new file mode 100644 index 0000000000000000000000000000000000000000..fb96320ceff157a8f2c72b270db6ed8d2f7c75e8 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/did-you-mean.js @@ -0,0 +1,33 @@ +const Npm = require('../npm') +const { distance } = require('fastest-levenshtein') +const { commands } = require('./cmd-list.js') + +const runScripts = ['stop', 'start', 'test', 'restart'] + +const isClose = (scmd, cmd) => distance(scmd, cmd) < scmd.length * 0.4 + +const didYouMean = (pkg, scmd) => { + const { scripts = {}, bin = {} } = pkg || {} + + const best = [ + ...commands + .filter(cmd => isClose(scmd, cmd) && scmd !== cmd) + .map(str => [str, Npm.cmd(str).description]), + ...Object.keys(scripts) + // We would already be suggesting this in `npm x` so omit them here + .filter(cmd => isClose(scmd, cmd) && !runScripts.includes(cmd)) + .map(str => [`run ${str}`, `run the "${str}" package script`]), + ...Object.keys(bin) + .filter(cmd => isClose(scmd, cmd)) + .map(str => [`exec ${str}`, `run the "${str}" command from either this or a remote npm package`]), + ] + + if (best.length === 0) { + return '' + } + + return `\n\nDid you mean ${best.length === 1 ? 'this' : 'one of these'}?\n` + + best.slice(0, 3).map(([msg, comment]) => ` npm ${msg} # ${comment}`).join('\n') +} + +module.exports = didYouMean diff --git a/node24/node_modules/npm/lib/utils/display.js b/node24/node_modules/npm/lib/utils/display.js new file mode 100644 index 0000000000000000000000000000000000000000..84230aa88713acf8965269d8e8d4e3501cbcd0f2 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/display.js @@ -0,0 +1,553 @@ +const { log, output, input, META } = require('proc-log') +const { explain } = require('./explain-eresolve.js') +const { formatWithOptions } = require('./format') + +// This is the general approach to color: +// Eventually this will be exposed somewhere we can refer to these by name. +// Foreground colors only. Never set the background color. +/* + * Black # (Don't use) + * Red # Danger + * Green # Success + * Yellow # Warning + * Blue # Accent + * Magenta # Done + * Cyan # Emphasis + * White # (Don't use) + */ + +// Translates log levels to chalk colors +const COLOR_PALETTE = ({ chalk: c }) => ({ + heading: c.bold, + title: c.blueBright, + timing: c.magentaBright, + // loglevels + error: c.red, + warn: c.yellow, + notice: c.cyanBright, + http: c.green, + info: c.cyan, + verbose: c.blue, + silly: c.blue.dim, +}) + +const LEVEL_OPTIONS = { + silent: { + index: 0, + }, + error: { + index: 1, + }, + warn: { + index: 2, + }, + notice: { + index: 3, + }, + http: { + index: 4, + }, + info: { + index: 5, + }, + verbose: { + index: 6, + }, + silly: { + index: 7, + }, +} + +const LEVEL_METHODS = { + ...LEVEL_OPTIONS, + [log.KEYS.timing]: { + show: ({ timing, index }) => !!timing && index !== 0, + }, +} + +const setBlocking = (stream) => { + // Copied from https://github.com/yargs/set-blocking + // https://raw.githubusercontent.com/yargs/set-blocking/master/LICENSE.txt + /* istanbul ignore next - we trust that this works */ + if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === 'function') { + stream._handle.setBlocking(true) + } + return stream +} + +// This is the key that is returned to the user for errors +const ERROR_KEY = 'error' +// This is the key producers use to indicate that there is a json error that should be merged into the finished output +const JSON_ERROR_KEY = 'jsonError' + +const isPlainObject = (v) => v && typeof v === 'object' && !Array.isArray(v) + +const getArrayOrObject = (items) => { + if (items.length) { + const foundNonObject = items.find(o => !isPlainObject(o)) + // Non-objects and arrays cant be merged, so just return the first item + if (foundNonObject) { + return foundNonObject + } + // We use objects with 0,1,2,etc keys to merge array + if (items.every((o, i) => Object.hasOwn(o, i))) { + return Object.assign([], ...items) + } + } + // Otherwise its an object with all object items merged together + return Object.assign({}, ...items.filter(o => isPlainObject(o))) +} + +const getJsonBuffer = ({ [JSON_ERROR_KEY]: metaError }, buffer) => { + const items = [] + // meta also contains the meta object passed to flush + const errors = metaError ? [metaError] : [] + // index 1 is the meta, 2 is the logged argument + for (const [, { [JSON_ERROR_KEY]: error }, obj] of buffer) { + if (obj) { + items.push(obj) + } + if (error) { + errors.push(error) + } + } + + if (!items.length && !errors.length) { + return null + } + + const res = getArrayOrObject(items) + + // This skips any error checking since we can only set an error property on an object that can be stringified + // XXX(BREAKING_CHANGE): remove this in favor of always returning an object with result and error keys + if (isPlainObject(res) && errors.length) { + // This is not ideal. + // JSON output has always been keyed at the root with an `error` key, so we cant change that without it being a breaking change. At the same time some commands output arbitrary keys at the top level of the output, such as package names. + // So the output could already have the same key. The choice here is to overwrite it with our error since that is (probably?) more important. + // XXX(BREAKING_CHANGE): all json output should be keyed under well known keys, eg `result` and `error` + if (res[ERROR_KEY]) { + log.warn('', `overwriting existing ${ERROR_KEY} on json output`) + } + res[ERROR_KEY] = getArrayOrObject(errors) + } + + return res +} + +const withMeta = (handler) => (level, ...args) => { + let meta = {} + const last = args.at(-1) + if (last && typeof last === 'object' && Object.hasOwn(last, META)) { + meta = args.pop() + } + return handler(level, meta, ...args) +} + +class Display { + #logState = { + buffering: true, + buffer: [], + } + + #outputState = { + buffering: true, + buffer: [], + } + + // colors + #noColorChalk + #stdoutChalk + #stdoutColor + #stderrChalk + #stderrColor + #logColors + + // progress + #progress + + // options + #command + #levelIndex + #timing + #json + #heading + #silent + + // display streams + #stdout + #stderr + + #seenNotices = new Set() + + constructor ({ stdout, stderr }) { + this.#stdout = setBlocking(stdout) + this.#stderr = setBlocking(stderr) + + // Handlers are set immediately so they can buffer all events + process.on('log', this.#logHandler) + process.on('output', this.#outputHandler) + process.on('input', this.#inputHandler) + this.#progress = new Progress({ stream: stderr }) + } + + off () { + process.off('log', this.#logHandler) + this.#logState.buffer.length = 0 + process.off('output', this.#outputHandler) + this.#outputState.buffer.length = 0 + process.off('input', this.#inputHandler) + this.#progress.off() + this.#seenNotices.clear() + } + + get chalk () { + return { + noColor: this.#noColorChalk, + stdout: this.#stdoutChalk, + stderr: this.#stderrChalk, + } + } + + async load ({ + command, + heading, + json, + loglevel, + progress, + stderrColor, + stdoutColor, + timing, + unicode, + }) { + const [{ Chalk }, { createSupportsColor }] = await Promise.all([ + import('chalk'), + import('supports-color'), + ]) + // We get the chalk level based on a null stream, meaning chalk will only use what it knows about the environment to get color support since we already determined in our definitions that we want to show colors. + const level = Math.max(createSupportsColor(null).level, 1) + this.#noColorChalk = new Chalk({ level: 0 }) + this.#stdoutColor = stdoutColor + this.#stdoutChalk = stdoutColor ? new Chalk({ level }) : this.#noColorChalk + this.#stderrColor = stderrColor + this.#stderrChalk = stderrColor ? new Chalk({ level }) : this.#noColorChalk + this.#logColors = COLOR_PALETTE({ chalk: this.#stderrChalk }) + + this.#command = command + this.#levelIndex = LEVEL_OPTIONS[loglevel].index + this.#timing = timing + this.#json = json + this.#heading = heading + this.#silent = this.#levelIndex <= 0 + + // Emit resume event on the logs which will flush output + log.resume() + output.flush() + this.#progress.load({ + unicode, + enabled: !!progress && !this.#silent, + }) + } + + // STREAM WRITES + + // Write formatted and (non-)colorized output to streams + #write (stream, options, ...args) { + const colors = stream === this.#stdout ? this.#stdoutColor : this.#stderrColor + const value = formatWithOptions({ colors, ...options }, ...args) + this.#progress.write(() => stream.write(value)) + } + + // HANDLERS + + // Arrow function assigned to a private class field so it can be passed directly as a listener and still reference "this" + #logHandler = withMeta((level, meta, ...args) => { + switch (level) { + case log.KEYS.resume: + this.#logState.buffering = false + this.#logState.buffer.forEach((item) => this.#tryWriteLog(...item)) + this.#logState.buffer.length = 0 + break + + case log.KEYS.pause: + this.#logState.buffering = true + break + + default: + if (this.#logState.buffering) { + this.#logState.buffer.push([level, meta, ...args]) + } else { + this.#tryWriteLog(level, meta, ...args) + } + break + } + }) + + // Arrow function assigned to a private class field so it can be passed directly as a listener and still reference "this" + #outputHandler = withMeta((level, meta, ...args) => { + this.#json = typeof meta.json === 'boolean' ? meta.json : this.#json + switch (level) { + case output.KEYS.flush: { + this.#outputState.buffering = false + if (this.#json) { + const json = getJsonBuffer(meta, this.#outputState.buffer) + if (json) { + this.#writeOutput(output.KEYS.standard, meta, JSON.stringify(json, null, 2)) + } + } else { + this.#outputState.buffer.forEach((item) => this.#writeOutput(...item)) + } + this.#outputState.buffer.length = 0 + break + } + + case output.KEYS.buffer: + this.#outputState.buffer.push([output.KEYS.standard, meta, ...args]) + break + + default: + if (this.#outputState.buffering) { + this.#outputState.buffer.push([level, meta, ...args]) + } else { + // XXX: Check if the argument looks like a run-script banner. This should be replaced with proc-log.META in @npmcli/run-script + if (typeof args[0] === 'string' && args[0].startsWith('\n> ') && args[0].endsWith('\n')) { + if (this.#silent || ['exec', 'explore'].includes(this.#command)) { + // Silent mode and some specific commands always hide run script banners + break + } else if (this.#json) { + // In json mode, change output to stderr since we don't want to break json parsing on stdout if the user is piping to jq or something. + // XXX: in a future (breaking?) change it might make sense for run-script to always output these banners with proc-log.output.error if we think they align closer with "logging" instead of "output". + level = output.KEYS.error + } + } + this.#writeOutput(level, meta, ...args) + } + break + } + }) + + #inputHandler = withMeta((level, meta, ...args) => { + switch (level) { + case input.KEYS.start: + log.pause() + this.#outputState.buffering = true + this.#progress.off() + break + + case input.KEYS.end: { + log.resume() + // For silent prompts (like password), add newline to preserve output + if (meta?.silent) { + output.standard() + } + output.flush() + this.#progress.resume() + break + } + + case input.KEYS.read: { + // The convention when calling input.read is to pass in a single fn that returns the promise to await. Resolve and reject are provided by proc-log. + const [res, rej, p] = args + + // Use sequential input management to avoid race condition which causes issues with spinner and adding newlines. + input.start() + + return p() + .then((result) => { + // If user hits enter, process end event and return input. + input.end({ [META]: true, silent: meta?.silent }) + res(result) + return result + }) + .catch((error) => { + // If user hits ctrl+c, add newline to preserve output. + output.standard() + input.end() + rej(error) + }) + } + } + }) + + // OUTPUT + + #writeOutput (level, meta, ...args) { + switch (level) { + case output.KEYS.standard: + this.#write(this.#stdout, meta, ...args) + break + + case output.KEYS.error: + this.#write(this.#stderr, meta, ...args) + break + } + } + + // LOGS + + #tryWriteLog (level, meta, ...args) { + try { + // Also (and this is a really inexcusable kludge), we patch the log.warn() method so that when we see a peerDep override explanation from Arborist, we can replace the object with a highly abbreviated explanation of what's being overridden. + // TODO: this could probably be moved to arborist now that display is refactored + const [heading, message, expl] = args + if (level === log.KEYS.warn && heading === 'ERESOLVE' && expl && typeof expl === 'object') { + this.#writeLog(level, meta, heading, message) + this.#writeLog(level, meta, '', explain(expl, this.#stderrChalk, 2)) + return + } + this.#writeLog(level, meta, ...args) + } catch (ex) { + try { + // if it crashed once, it might again! + this.#writeLog(log.KEYS.verbose, meta, '', `attempt to log crashed`, ...args, ex) + } catch (ex2) { + // This happens if the object has an inspect method that crashes so just console.error with the errors but don't do anything else that might error again. + // eslint-disable-next-line no-console + console.error(`attempt to log crashed`, ex, ex2) + } + } + } + + #writeLog (level, meta, ...args) { + const levelOpts = LEVEL_METHODS[level] + const show = levelOpts.show ?? (({ index }) => levelOpts.index <= index) + const force = meta.force && !this.#silent + + if (force || show({ index: this.#levelIndex, timing: this.#timing })) { + // this mutates the array so we can pass args directly to format later + const title = args.shift() + const prefix = [ + this.#logColors.heading(this.#heading), + this.#logColors[level](level), + title ? this.#logColors.title(title) : null, + ] + const writeOpts = { prefix } + // notice logs typically come from `npm-notice` headers in responses. Some of them have 2fa login links so we skip redaction. + if (level === 'notice') { + writeOpts.redact = false + // Deduplicate notices within a single command execution, unless in verbose mode + if (this.#levelIndex < LEVEL_OPTIONS.verbose.index) { + const noticeKey = JSON.stringify([title, ...args]) + if (this.#seenNotices.has(noticeKey)) { + return + } + this.#seenNotices.add(noticeKey) + } + } + this.#write(this.#stderr, writeOpts, ...args) + } + } +} + +class Progress { + // Taken from https://github.com/sindresorhus/cli-spinners + // MIT License + // Copyright (c) Sindre Sorhus (https://sindresorhus.com) + static dots = { duration: 80, frames: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'] } + static lines = { duration: 130, frames: ['-', '\\', '|', '/'] } + + #enabled = false + #frameIndex = 0 + #interval + #lastUpdate = 0 + #spinner + #stream + // Initial timeout to wait to start rendering + #timeout + #rendered = false + + // We are rendering if enabled option is set and we are not waiting for the render timeout + get #rendering () { + return this.#enabled && !this.#timeout + } + + // We are spinning if enabled option is set and the render interval has been set + get #spinning () { + return this.#enabled && this.#interval + } + + constructor ({ stream }) { + this.#stream = stream + } + + load ({ enabled, unicode }) { + this.#enabled = enabled + this.#spinner = unicode ? Progress.dots : Progress.lines + // Wait 200 ms so we don't render the spinner for short durations + this.#timeout = setTimeout(() => { + this.#timeout = null + this.#render() + }, 200) + // Make sure this timeout does not keep the process open + this.#timeout.unref() + } + + off () { + if (!this.#enabled) { + return + } + clearTimeout(this.#timeout) + this.#timeout = null + clearInterval(this.#interval) + this.#interval = null + this.#frameIndex = 0 + this.#lastUpdate = 0 + this.#clearSpinner() + } + + resume () { + this.#render(true) + } + + // If we are currently rendering the spinner we clear it before writing our line and then re-render the spinner after. + // If not then all we need to do is write the line. + write (write) { + if (this.#spinning) { + this.#clearSpinner() + } + write() + if (this.#spinning) { + this.#render() + } + } + + #render (resuming) { + if (!this.#rendering) { + return + } + // We always attempt to render immediately but we only request to move to the next frame if it has been longer than our spinner frame duration since our last update + this.#renderFrame(Date.now() - this.#lastUpdate >= this.#spinner.duration, resuming) + if (!this.#interval) { + this.#interval = setInterval(() => this.#renderFrame(true), this.#spinner.duration) + // Make sure this timeout does not keep the process open + this.#interval.unref() + } + this.#interval.refresh() + } + + #renderFrame (next, resuming) { + if (next) { + this.#lastUpdate = Date.now() + this.#frameIndex++ + if (this.#frameIndex >= this.#spinner.frames.length) { + this.#frameIndex = 0 + } + } + if (!resuming) { + this.#clearSpinner() + } + this.#stream.write(this.#spinner.frames[this.#frameIndex]) + this.#rendered = true + } + + #clearSpinner () { + if (!this.#rendered) { + return + } + // Move to the start of the line and clear the rest of the line + this.#stream.cursorTo(0) + this.#stream.clearLine(1) + this.#rendered = false + } +} + +module.exports = Display diff --git a/node24/node_modules/npm/lib/utils/error-message.js b/node24/node_modules/npm/lib/utils/error-message.js new file mode 100644 index 0000000000000000000000000000000000000000..096a10233f724828864292f10b894e0949e8f92e --- /dev/null +++ b/node24/node_modules/npm/lib/utils/error-message.js @@ -0,0 +1,453 @@ +const { format } = require('node:util') +const { resolve } = require('node:path') +const { redactLog: replaceInfo } = require('@npmcli/redact') +const { log } = require('proc-log') + +const errorMessage = (er, npm) => { + const summary = [] + const detail = [] + const files = [] + let json + + er.message &&= replaceInfo(er.message) + er.stack &&= replaceInfo(er.stack) + + switch (er.code) { + case 'ERESOLVE': { + const { report } = require('./explain-eresolve.js') + summary.push(['ERESOLVE', er.message]) + detail.push(['', '']) + // XXX(display): error messages are logged so we use the logColor since that is based on stderr. + // This should be handled solely by the display layer so it could also be printed to stdout if necessary. + const { explanation, file } = report(er, npm.logChalk, npm.noColorChalk) + detail.push(['', explanation]) + files.push(['eresolve-report.txt', file]) + break + } + + case 'ENOLOCK': { + const cmd = npm.command || '' + summary.push([cmd, 'This command requires an existing lockfile.']) + detail.push([cmd, 'Try creating one first with: npm i --package-lock-only']) + detail.push([cmd, `Original error: ${er.message}`]) + break + } + + case 'ENOAUDIT': + summary.push(['audit', er.message]) + break + + case 'ECONNREFUSED': + summary.push(['', er]) + detail.push(['', [ + '', + `If you are behind a proxy, please make sure that the 'proxy' config is set properly. See: 'npm help config'`, + ].join('\n')]) + break + + case 'EACCES': + case 'EPERM': { + const isCachePath = + typeof er.path === 'string' && npm.loaded && er.path.startsWith(npm.config.get('cache')) + const isCacheDest = + typeof er.dest === 'string' && npm.loaded && er.dest.startsWith(npm.config.get('cache')) + + if (process.platform !== 'win32' && (isCachePath || isCacheDest)) { + // user probably doesn't need this, but still add it to the debug log + log.verbose(er.stack) + summary.push(['', [ + '', + 'Your cache folder contains root-owned files, due to a bug in previous versions of npm which has since been addressed.', + '', + 'To permanently fix this problem, please run:', + ` sudo chown -R ${process.getuid()}:${process.getgid()} "${npm.config.get('cache')}"`, + ].join('\n')]) + } else { + summary.push(['', er]) + detail.push(['', [ + '', + 'The operation was rejected by your operating system.', + ...process.platform === 'win32' ? [ + `It's possible that the file was already in use (by a text editor or antivirus), or that you lack permissions to access it.`, + ] : [ + 'It is likely you do not have the permissions to access this file as the current user', + ], + '', + 'If you believe this might be a permissions issue, please double-check the permissions of the file and its containing directories, or try running the command again as root/Administrator.', + ].join('\n')]) + } + break + } + + case 'EALLOWGIT': + summary.push(['', er.message]) + detail.push(['', `Refusing to fetch "${er.package}"`]) + break + + case 'ENOGIT': + summary.push(['', er.message]) + detail.push(['', [ + '', + 'Failed using git.', + 'Please check if you have git installed and in your PATH.', + ].join('\n')]) + break + + case 'EJSONPARSE': + // Check whether we ran into a conflict in our own package.json + if (er.path === resolve(npm.prefix, 'package.json')) { + const { isDiff } = require('parse-conflict-json') + const txt = require('node:fs').readFileSync(er.path, 'utf8').replace(/\r\n/g, '\n') + if (isDiff(txt)) { + detail.push(['', [ + 'Merge conflict detected in your package.json.', + '', + 'Please resolve the package.json conflict and retry.', + ].join('\n')]) + break + } + } + summary.push(['JSON.parse', er.message]) + detail.push(['JSON.parse', [ + 'Failed to parse JSON data.', + 'Note: package.json must be actual JSON, not just JavaScript.', + ].join('\n')]) + break + + case 'EOTP': + case 'E401': + // E401 is for places where we accidentally neglect OTP stuff + if (er.code === 'EOTP' || /one-time pass/.test(er.message)) { + const authUrl = er.body?.authUrl + const doneUrl = er.body?.doneUrl + if (authUrl && doneUrl) { + json = { authUrl, doneUrl } + summary.push(['', 'This operation requires a one-time password.']) + detail.push(['', `Open this URL in your browser to authenticate:`]) + detail.push(['', ` ${authUrl}`]) + detail.push(['', '']) + detail.push(['', `After authenticating, your token can be retrieved from:`]) + detail.push(['', ` ${doneUrl}`]) + } else { + summary.push(['', 'This operation requires a one-time password from your authenticator.']) + detail.push(['', [ + 'You can provide a one-time password by passing --otp= to the command you ran.', + 'If you already provided a one-time password then it is likely that you either typoed it, or it timed out. Please try again.', + ].join('\n')]) + } + } else { + // npm ERR! code E401 + // npm ERR! Unable to authenticate, need: Basic + const auth = !er.headers || !er.headers['www-authenticate'] + ? [] + : er.headers['www-authenticate'].map(au => au.split(/[,\s]+/))[0] + + if (auth.includes('Bearer')) { + summary.push(['', + 'Unable to authenticate, your authentication token seems to be invalid.', + ]) + detail.push(['', [ + 'To correct this please try logging in again with:', + ' npm login', + ].join('\n')]) + } else if (auth.includes('Basic')) { + summary.push(['', 'Incorrect or missing password.']) + detail.push(['', [ + 'If you were trying to login, change your password, create an authentication token or enable two-factor authentication then that means you likely typed your password in incorrectly.', + 'Please try again, or recover your password at:', + ' https://www.npmjs.com/forgot', + '', + 'If you were doing some other operation then your saved credentials are probably out of date.', + 'To correct this please try logging in again with:', + ' npm login', + ].join('\n')]) + } else { + summary.push(['', er.message || er]) + } + } + break + + case 'E404': + // There's no need to have 404 in the message as well. + summary.push(['404', er.message.replace(/^404\s+/, '')]) + if (er.pkgid && er.pkgid !== '-') { + const pkg = er.pkgid.replace(/(?!^)@.*$/, '') + + detail.push(['404', '']) + detail.push([ + '404', + '', + `The requested resource '${replaceInfo(er.pkgid)}' could not be found or you do not have permission to access it.`, + ]) + + const nameValidator = require('validate-npm-package-name') + const valResult = nameValidator(pkg) + + if (!valResult.validForNewPackages) { + detail.push(['404', 'This package name is not valid, because', '']) + + const errorsArray = [...(valResult.errors || []), ...(valResult.warnings || [])] + errorsArray.forEach((item, idx) => detail.push(['404', ' ' + (idx + 1) + '. ' + item])) + } + + detail.push(['404', '']) + detail.push(['404', 'Note that you can also install from a']) + detail.push(['404', 'tarball, folder, http url, or git url.']) + } + break + + case 'EPUBLISHCONFLICT': + summary.push(['publish fail', 'Cannot publish over existing version.']) + detail.push(['publish fail', `Update the 'version' field in package.json and try again.`]) + detail.push(['publish fail', '']) + detail.push(['publish fail', 'To automatically increment version numbers, see:']) + detail.push(['publish fail', ' npm help version']) + break + + case 'EISGIT': + summary.push(['git', er.message]) + summary.push(['git', ` ${er.path}`]) + detail.push(['git', [ + 'Refusing to remove it. Update manually, or move it out of the way first.', + ].join('\n')]) + break + + case 'EBADDEVENGINES': { + const { current, required } = er + summary.push(['EBADDEVENGINES', er.message]) + detail.push(['EBADDEVENGINES', { current, required }]) + break + } + + case 'EBADPLATFORM': { + const actual = er.current + const expected = { ...er.required } + const checkedKeys = [] + for (const key in expected) { + if (Array.isArray(expected[key]) && expected[key].length > 0) { + expected[key] = expected[key].join(',') + checkedKeys.push(key) + } else if (expected[key] === undefined || + Array.isArray(expected[key]) && expected[key].length === 0) { + delete expected[key] + delete actual[key] + } else { + checkedKeys.push(key) + } + } + + const longestKey = Math.max(...checkedKeys.map((key) => key.length)) + const detailEntry = [] + for (const key of checkedKeys) { + const padding = key.length === longestKey + ? 1 + : 1 + (longestKey - key.length) + + // padding + 1 because 'actual' is longer than 'valid' + detailEntry.push(`Valid ${key}:${' '.repeat(padding + 1)}${expected[key]}`) + detailEntry.push(`Actual ${key}:${' '.repeat(padding)}${actual[key]}`) + } + + summary.push(['notsup', format( + 'Unsupported platform for %s: wanted %j (current: %j)', + er.pkgid, + expected, + actual + )]) + detail.push(['notsup', detailEntry.join('\n')]) + break + } + + case 'EEXIST': + summary.push(['', er.message]) + summary.push(['', 'File exists: ' + (er.dest || er.path)]) + detail.push(['', 'Remove the existing file and try again, or run npm']) + detail.push(['', 'with --force to overwrite files recklessly.']) + break + + case 'ENEEDAUTH': + summary.push(['need auth', er.message]) + detail.push(['need auth', 'You need to authorize this machine using `npm adduser`']) + break + + case 'ECONNRESET': + case 'ENOTFOUND': + case 'ETIMEDOUT': + case 'ERR_SOCKET_TIMEOUT': + case 'EAI_FAIL': + summary.push(['network', er.message]) + detail.push(['network', [ + 'This is a problem related to network connectivity.', + 'In most cases you are behind a proxy or have bad network settings.', + '', + `If you are behind a proxy, please make sure that the 'proxy' config is set properly. See: 'npm help config'`, + ].join('\n')]) + break + + case 'ETARGET': + summary.push(['notarget', er.message]) + detail.push(['notarget', [ + `In most cases you or one of your dependencies are requesting a package version that doesn't exist.`, + ].join('\n')]) + break + + case 'E403': + summary.push(['403', er.message]) + detail.push(['403', [ + 'In most cases, you or one of your dependencies are requesting a package version that is forbidden by your security policy, or on a server you do not have access to.', + ].join('\n')]) + break + + case 'EBADENGINE': + summary.push(['engine', er.message]) + summary.push(['engine', 'Not compatible with your version of node/npm: ' + er.pkgid]) + detail.push(['notsup', [ + 'Not compatible with your version of node/npm: ' + er.pkgid, + 'Required: ' + JSON.stringify(er.required), + 'Actual: ' + + JSON.stringify({ node: process.version, npm: npm.version }), + ].join('\n')]) + break + + case 'ENOSPC': + summary.push(['nospc', er.message]) + detail.push(['nospc', [ + 'There appears to be insufficient space on your system to finish.', + 'Clear up some disk space and try again.', + ].join('\n')]) + break + + case 'EROFS': + summary.push(['rofs', er.message]) + detail.push(['rofs', [ + `Often virtualized file systems, or other file systems that don't support symlinks, give this error.`, + ].join('\n')]) + break + + case 'ENOENT': + summary.push(['enoent', er.message]) + detail.push(['enoent', [ + 'This is related to npm not being able to find a file.', + er.file ? `\nCheck if the file '${er.file}' is present.` : '', + ].join('\n')]) + break + + case 'EMISSINGARG': + case 'EUNKNOWNTYPE': + case 'EINVALIDTYPE': + case 'ETOOMANYARGS': + summary.push(['typeerror', er.stack]) + detail.push(['typeerror', [ + 'This is an error with npm itself. Please report this error at:', + 'https://github.com/npm/cli/issues', + ].join('\n')]) + break + + default: + summary.push(['', er.message || er]) + if (er.cause) { + detail.push(['cause', er.cause.message]) + } + if (er.signal) { + detail.push(['signal', er.signal]) + } + if (er.cmd && Array.isArray(er.args)) { + detail.push(['command', ...[er.cmd, ...er.args.map(replaceInfo)]]) + } + if (er.stdout) { + detail.push(['', er.stdout.trim()]) + } + if (er.stderr) { + detail.push(['', er.stderr.trim()]) + } + break + } + + return { + summary, + detail, + files, + json, + } +} + +const getExitCodeFromError = (err) => { + if (typeof err?.errno === 'number') { + return err.errno + } else if (typeof err?.code === 'number') { + return err.code + } +} + +const getError = (err, { npm, command, pkg }) => { + // if we got a command that just shells out to something else, then it will presumably print its own errors and exit with a proper status code if there's a problem. + // If we got an error with a code=0, then... something else went wrong along the way, so maybe an npm problem? + if (command?.constructor?.isShellout && typeof err.code === 'number' && err.code) { + return { + exitCode: err.code, + suppressError: true, + } + } + + // XXX: we should stop throwing strings + if (typeof err === 'string') { + return { + exitCode: 1, + suppressError: true, + summary: [['', err]], + } + } + + // XXX: we should stop throwing other non-errors + if (!(err instanceof Error)) { + return { + exitCode: 1, + suppressError: true, + summary: [['weird error', err]], + } + } + + if (err.code === 'EUNKNOWNCOMMAND') { + const suggestions = require('./did-you-mean.js')(pkg, err.command) + return { + exitCode: 1, + suppressError: true, + standard: [ + `Unknown command: "${err.command}"`, + suggestions, + 'To see a list of supported npm commands, run:', + ' npm help', + ], + } + } + + // Anything after this is not suppressed and gets more logged information + + // add a code to the error if it doesnt have one and mutate some properties so they have redacted information + err.code ??= err.message.match(/^(?:Error: )?(E[A-Z]+)/)?.[1] + // this mutates the error and redacts stack/message + const { summary, detail, files, json } = errorMessage(err, npm) + + return { + err, + code: err.code, + exitCode: getExitCodeFromError(err) || 1, + suppressError: false, + summary, + detail, + files, + json, + verbose: ['type', 'stack', 'statusCode', 'pkgid'] + .filter(k => err[k]) + .map(k => [k, replaceInfo(err[k])]), + error: ['code', 'syscall', 'file', 'path', 'dest', 'errno'] + .filter(k => err[k]) + .map(k => [k, err[k]]), + } +} + +module.exports = { + getExitCodeFromError, + errorMessage, + getError, +} diff --git a/node24/node_modules/npm/lib/utils/explain-dep.js b/node24/node_modules/npm/lib/utils/explain-dep.js new file mode 100644 index 0000000000000000000000000000000000000000..a76d11e224c9b2c3c1138e39b616ba6f9a2af812 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/explain-dep.js @@ -0,0 +1,116 @@ +const { relative } = require('node:path') + +const explainNode = (node, depth, chalk, seen = new Set()) => + printNode(node, chalk) + + explainDependents(node, depth, chalk, seen) + + explainLinksIn(node, depth, chalk, seen) + +const colorType = (type, chalk) => { + const style = type === 'extraneous' ? chalk.red + : type === 'dev' ? chalk.blue + : type === 'optional' ? chalk.magenta + : type === 'peer' ? chalk.magentaBright + : type === 'bundled' ? chalk.underline.cyan + : type === 'workspace' ? chalk.blueBright + : type === 'overridden' ? chalk.dim + : /* istanbul ignore next */ s => s + return style(type) +} + +const printNode = (node, chalk) => { + const extra = [] + + for (const meta of ['extraneous', 'dev', 'optional', 'peer', 'bundled', 'overridden']) { + if (node[meta]) { + extra.push(` ${colorType(meta, chalk)}`) + } + } + + const pkgid = node.isWorkspace + ? chalk.blueBright(`${node.name}@${node.version}`) + : `${node.name}@${node.version}` + + return `${pkgid}${extra.join('')}` + + (node.location ? chalk.dim(`\n${node.location}`) : '') +} + +const explainLinksIn = ({ linksIn }, depth, chalk, seen) => { + if (!linksIn || !linksIn.length || depth <= 0) { + return '' + } + + const messages = linksIn.map(link => explainNode(link, depth - 1, chalk, seen)) + const str = '\n' + messages.join('\n') + return str.split('\n').join('\n ') +} + +const explainDependents = ({ dependents }, depth, chalk, seen) => { + if (!dependents || !dependents.length || depth <= 0) { + return '' + } + + const max = Math.ceil(depth / 2) + const messages = dependents.slice(0, max) + .map(edge => explainEdge(edge, depth, chalk, seen)) + + // show just the names of the first 5 deps that overflowed the list + if (dependents.length > max) { + let len = 0 + const maxLen = 50 + const showNames = [] + for (let i = max; i < dependents.length; i++) { + const { from: { name: depName = 'the root project' } } = dependents[i] + len += depName.length + if (len >= maxLen && i < dependents.length - 1) { + showNames.push('...') + break + } + showNames.push(depName) + } + const show = `(${showNames.join(', ')})` + messages.push(`${dependents.length - max} more ${show}`) + } + + const str = '\n' + messages.join('\n') + return str.split('\n').join('\n ') +} + +const explainEdge = ( + { name, type, bundled, from, spec, rawSpec, overridden }, + depth, chalk, seen = new Set() +) => { + let dep = type === 'workspace' + ? chalk.bold(relative(from.location, spec.slice('file:'.length))) + : `${name}@"${spec}"` + if (overridden) { + dep = `${colorType('overridden', chalk)} ${dep} (was "${rawSpec}")` + } + + const fromMsg = ` from ${explainFrom(from, depth, chalk, seen)}` + + return (type === 'prod' ? '' : `${colorType(type, chalk)} `) + + (bundled ? `${colorType('bundled', chalk)} ` : '') + + `${dep}${fromMsg}` +} + +const explainFrom = (from, depth, chalk, seen) => { + if (!from.name && !from.version) { + return 'the root project' + } + + // Prevent infinite recursion from cycles in the dependency graph (e.g. linked strategy store nodes). Use stack-based tracking so diamond dependencies (same node reached via different paths) are still explained, but recursive cycles are broken. + const nodeId = `${from.name}@${from.version}:${from.location}` + if (seen.has(nodeId)) { + return printNode(from, chalk) + } + seen.add(nodeId) + + const result = printNode(from, chalk) + + explainDependents(from, depth - 1, chalk, seen) + + explainLinksIn(from, depth - 1, chalk, seen) + + seen.delete(nodeId) + return result +} + +module.exports = { explainNode, printNode, explainEdge } diff --git a/node24/node_modules/npm/lib/utils/explain-eresolve.js b/node24/node_modules/npm/lib/utils/explain-eresolve.js new file mode 100644 index 0000000000000000000000000000000000000000..f4b7aa527bbda233bf64fc3b52cedca7cbf056d1 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/explain-eresolve.js @@ -0,0 +1,64 @@ +// this is called when an ERESOLVE error is caught in the exit-handler, or when there's a log.warn('eresolve', msg, explanation), to turn it into a human-intelligible explanation of what's wrong and how to fix. +const { explainEdge, explainNode, printNode } = require('./explain-dep.js') + +// expl is an explanation object that comes from Arborist. +// Depth is how far we want to want to descend into the object making a report. +// The full report (ie, depth=Infinity) is always written to the cache folder at ${cache}/eresolve-report.txt along with full json. +const explain = (expl, chalk, depth) => { + const { edge, dep, current, peerConflict, currentEdge } = expl + + const out = [] + const whileInstalling = dep && dep.whileInstalling || + current && current.whileInstalling || + edge && edge.from && edge.from.whileInstalling + if (whileInstalling) { + out.push('While resolving: ' + printNode(whileInstalling, chalk)) + } + + // it "should" be impossible for an ERESOLVE explanation to lack both current and currentEdge, but better to have a less helpful error than a crashing failure. + if (current) { + out.push('Found: ' + explainNode(current, depth, chalk)) + } else if (peerConflict && peerConflict.current) { + out.push('Found: ' + explainNode(peerConflict.current, depth, chalk)) + } else if (currentEdge) { + out.push('Found: ' + explainEdge(currentEdge, depth, chalk)) + } else /* istanbul ignore else - should always have one */ if (edge) { + out.push('Found: ' + explainEdge(edge, depth, chalk)) + } + + out.push('\nCould not resolve dependency:\n' + + explainEdge(edge, depth, chalk)) + + if (peerConflict) { + const heading = '\nConflicting peer dependency:' + const pc = explainNode(peerConflict.peer, depth, chalk) + out.push(heading + ' ' + pc) + } + + return out.join('\n') +} + +// generate a full verbose report and tell the user how to fix it +const report = (expl, chalk, noColorChalk) => { + const flags = [ + expl.strictPeerDeps ? '--no-strict-peer-deps' : '', + '--force', + '--legacy-peer-deps', + ].filter(Boolean) + + const or = (arr) => arr.length <= 2 + ? arr.join(' or ') : + arr.map((v, i, l) => i + 1 === l.length ? `or ${v}` : v).join(', ') + + const fix = `Fix the upstream dependency conflict, or retry this command with ${or(flags)} to accept an incorrect (and potentially broken) dependency resolution.` + + return { + explanation: `${explain(expl, chalk, 4)}\n\n${fix}`, + file: `# npm resolution error report\n\n${explain(expl, noColorChalk, Infinity)}\n\n${fix}`, + } +} + +module.exports = { + explain, + report, +} diff --git a/node24/node_modules/npm/lib/utils/format-bytes.js b/node24/node_modules/npm/lib/utils/format-bytes.js new file mode 100644 index 0000000000000000000000000000000000000000..32866df34cfa5a5013e988fe3e5c2400265f371c --- /dev/null +++ b/node24/node_modules/npm/lib/utils/format-bytes.js @@ -0,0 +1,29 @@ +// Convert bytes to printable output, for file reporting in tarballs +// Only supports up to GB because that's way larger than anything the registry supports anyways. + +const formatBytes = (bytes, space = true) => { + let spacer = '' + if (space) { + spacer = ' ' + } + + if (bytes < 1000) { + // B + return `${bytes}${spacer}B` + } + + if (bytes < 999950) { + // kB + return `${(bytes / 1000).toFixed(1)}${spacer}kB` + } + + if (bytes < 999950000) { + // MB + return `${(bytes / 1000000).toFixed(1)}${spacer}MB` + } + + // GB + return `${(bytes / 1000000000).toFixed(1)}${spacer}GB` +} + +module.exports = formatBytes diff --git a/node24/node_modules/npm/lib/utils/format-search-stream.js b/node24/node_modules/npm/lib/utils/format-search-stream.js new file mode 100644 index 0000000000000000000000000000000000000000..c92b3c5aab3c29c123562234a8b97c0af9cb6ad4 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/format-search-stream.js @@ -0,0 +1,175 @@ +const { stripVTControlCharacters: strip } = require('node:util') +const { Minipass } = require('minipass') + +// This module consumes package data in the following format: +// +// { +// name: String, +// description: String, +// maintainers: [{ username: String, email: String }], +// keywords: String | [String], +// version: String, +// date: Date // can be null, +// } +// +// The returned stream will format this package data into a byte stream of formatted, displayable output. + +function filter (data, exclude) { + const words = [data.name] + .concat(data.maintainers.map(m => m.username)) + .concat(data.keywords || []) + .map(f => f?.trim?.()) + .filter(Boolean) + .join(' ') + .toLowerCase() + + if (exclude.find(pattern => { + // Treats both /foo and /foo/ as regex searches + if (pattern.startsWith('/')) { + if (pattern.endsWith('/')) { + pattern = pattern.slice(0, -1) + } + return words.match(new RegExp(pattern.slice(1))) + } + return words.includes(pattern) + })) { + return false + } + + return true +} + +module.exports = (opts) => { + return opts.json ? new JSONOutputStream(opts) : new TextOutputStream(opts) +} + +class JSONOutputStream extends Minipass { + #didFirst = false + #exclude + + constructor (opts) { + super() + this.#exclude = opts.exclude + } + + write (obj) { + if (!filter(obj, this.#exclude)) { + return + } + if (!this.#didFirst) { + super.write('[\n') + this.#didFirst = true + } else { + super.write('\n,\n') + } + + return super.write(JSON.stringify(obj)) + } + + end () { + super.write(this.#didFirst ? ']\n' : '\n[]\n') + super.end() + } +} + +class TextOutputStream extends Minipass { + #args + #chalk + #exclude + #parseable + + constructor (opts) { + super() + // Consider a search for "cowboys" and "boy". + // If we highlight "boys" first the "cowboys" string will no longer string match because of the ansi highlighting added to "boys". + // If we highlight "boy" second then the ansi reset at the end will make the highlighting only on "cowboy" with a normal "s". + // Neither is perfect but at least the first option doesn't do partial highlighting. So, we sort strings smaller to larger + this.#args = opts.args + .map(s => s.toLowerCase()) + .filter(Boolean) + .sort((a, b) => a.length - b.length) + this.#chalk = opts.npm.chalk + this.#exclude = opts.exclude + this.#parseable = opts.parseable + } + + write (data) { + if (!filter(data, this.#exclude)) { + return + } + // Normalize + const pkg = { + authors: data.maintainers.map((m) => `${strip(m.username)}`).join(' '), + publisher: strip(data.publisher?.username || ''), + date: data.date ? data.date.toISOString().slice(0, 10) : 'prehistoric', + description: strip(data.description ?? ''), + keywords: [], + name: strip(data.name), + version: data.version, + } + if (Array.isArray(data.keywords)) { + pkg.keywords = data.keywords.map(strip) + } else if (typeof data.keywords === 'string') { + pkg.keywords = strip(data.keywords.replace(/[,\s]+/, ' ')).split(' ') + } + + let output + if (this.#parseable) { + output = [pkg.name, pkg.description, pkg.author, pkg.date, pkg.version, pkg.keywords] + .filter(Boolean) + .map(col => ('' + col).replace(/\t/g, ' ')).join('\t') + return super.write(output) + } + + const keywords = pkg.keywords.map(k => { + if (this.#args.includes(k)) { + return this.#chalk.cyan(k) + } else { + return k + } + }).join(' ') + + const description = this.#highlight(pkg.description) + let name + if (this.#args.includes(pkg.name)) { + name = this.#chalk.cyan(pkg.name) + } else { + name = this.#highlight(pkg.name) + name = this.#chalk.blue(name) + } + + if (description.length) { + output = `${name}\n${description}\n` + } else { + output = `${name}\n` + } + if (pkg.publisher) { + output += `Version ${this.#chalk.blue(pkg.version)} published ${this.#chalk.blue(pkg.date)} by ${this.#chalk.blue(pkg.publisher)}\n` + } else { + output += `Version ${this.#chalk.blue(pkg.version)} published ${this.#chalk.blue(pkg.date)} by ${this.#chalk.yellow('???')}\n` + } + output += `Maintainers: ${pkg.authors}\n` + if (keywords) { + output += `Keywords: ${keywords}\n` + } + output += `${this.#chalk.blue(`https://npm.im/${pkg.name}`)}\n` + return super.write(output) + } + + #highlight (input) { + let output = input + for (const arg of this.#args) { + let i = output.toLowerCase().indexOf(arg) + while (i > -1) { + const highlit = this.#chalk.cyan(output.slice(i, i + arg.length)) + output = [ + output.slice(0, i), + highlit, + output.slice(i + arg.length), + ].join('') + i = output.toLowerCase().indexOf(arg, i + highlit.length) + } + } + return output + } +} diff --git a/node24/node_modules/npm/lib/utils/format.js b/node24/node_modules/npm/lib/utils/format.js new file mode 100644 index 0000000000000000000000000000000000000000..4d56b23a05dfbc1cffcda8497d051e72c45d5295 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/format.js @@ -0,0 +1,56 @@ +// All logging goes through here, both to console and log files + +const { formatWithOptions: baseFormatWithOptions } = require('node:util') +const { redactLog } = require('@npmcli/redact') + +// These are most assuredly not a mistake +// https://eslint.org/docs/latest/rules/no-control-regex +// \x00 through \x1f, \x7f through \x9f, not including \x09 \x0a \x0b \x0d +/* eslint-disable-next-line no-control-regex */ +const HAS_C01 = /[\x00-\x08\x0c\x0e-\x1f\x7f-\x9f]/ + +// Allows everything up to '[38;5;255m' in 8 bit notation +const ALLOWED_SGR = /^\[[0-9;]{0,8}m/ + +// '[38;5;255m'.length +const SGR_MAX_LEN = 10 + +// Strips all ANSI C0 and C1 control characters (except for SGR up to 8 bit) +function STRIP_C01 (str) { + if (!HAS_C01.test(str)) { + return str + } + let result = '' + for (let i = 0; i < str.length; i++) { + const char = str[i] + const code = char.charCodeAt(0) + if (!HAS_C01.test(char)) { + // Most characters are in this set so continue early if we can + result = `${result}${char}` + } else if (code === 27 && ALLOWED_SGR.test(str.slice(i + 1, i + SGR_MAX_LEN + 1))) { + // \x1b with allowed SGR + result = `${result}\x1b` + } else if (code <= 31) { + // escape all other C0 control characters besides \x7f + result = `${result}^${String.fromCharCode(code + 64)}` + } else { + // hasC01 ensures this is now a C1 control character or \x7f + result = `${result}^${String.fromCharCode(code - 64)}` + } + } + return result +} + +const formatWithOptions = ({ prefix: prefixes = [], eol = '\n', redact = true, ...options }, ...args) => { + const prefix = prefixes.filter(p => p != null).join(' ') + let formatted = STRIP_C01(baseFormatWithOptions(options, ...args)) + if (redact) { + formatted = redactLog(formatted) + } + // Splitting could be changed to only `\n` once we are sure we only emit unix newlines. + // The eol param to this function will put the correct newlines in place for the returned string. + const lines = formatted.split(/\r?\n/) + return lines.reduce((acc, l) => `${acc}${prefix}${prefix && l ? ' ' : ''}${l}${eol}`, '') +} + +module.exports = { formatWithOptions } diff --git a/node24/node_modules/npm/lib/utils/get-identity.js b/node24/node_modules/npm/lib/utils/get-identity.js new file mode 100644 index 0000000000000000000000000000000000000000..e2480792ec33999c29cacf13cc0b6e964e07bae7 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/get-identity.js @@ -0,0 +1,25 @@ +const npmFetch = require('npm-registry-fetch') + +module.exports = async (npm, opts) => { + const { registry } = opts + + // First, check if we have a user/pass-based auth + const creds = npm.config.getCredentialsByURI(registry) + if (creds.username) { + return creds.username + } + + // No username, but we have other credentials; fetch the username from registry + if (creds.token || creds.certfile && creds.keyfile) { + const registryData = await npmFetch.json('/-/whoami', { ...opts }) + if (typeof registryData?.username === 'string') { + return registryData.username + } + } + + // At this point, even if they have a credentials object, it doesn't have a valid token. + throw Object.assign( + new Error('This command requires you to be logged in.'), + { code: 'ENEEDAUTH' } + ) +} diff --git a/node24/node_modules/npm/lib/utils/get-workspaces.js b/node24/node_modules/npm/lib/utils/get-workspaces.js new file mode 100644 index 0000000000000000000000000000000000000000..ef462da3f127dfcae96768ca0ebf44a363bb7fe3 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/get-workspaces.js @@ -0,0 +1,54 @@ +const { resolve, relative } = require('node:path') +const mapWorkspaces = require('@npmcli/map-workspaces') +const { minimatch } = require('minimatch') +const pkgJson = require('@npmcli/package-json') + +// minimatch wants forward slashes only for glob patterns +const globify = pattern => pattern.split('\\').join('/') + +// Returns an Map of paths to workspaces indexed by workspace name +// { foo => '/path/to/foo' } +const getWorkspaces = async (filters, { path, includeWorkspaceRoot, relativeFrom }) => { + // TODO we need a better error to be bubbled up here if this call fails + const { content: pkg } = await pkgJson.normalize(path) + const workspaces = await mapWorkspaces({ cwd: path, pkg }) + let res = new Map() + if (includeWorkspaceRoot) { + res.set(pkg.name, path) + } + + if (!filters.length) { + res = new Map([...res, ...workspaces]) + } + + for (const filterArg of filters) { + for (const [workspaceName, workspacePath] of workspaces.entries()) { + let relativePath = relative(relativeFrom, workspacePath) + if (filterArg.startsWith('./')) { + relativePath = `./${relativePath}` + } + const relativeFilter = relative(path, filterArg) + if (filterArg === workspaceName + || resolve(relativeFrom, filterArg) === workspacePath + || minimatch(relativePath, `${globify(relativeFilter)}/*`) + || minimatch(relativePath, `${globify(filterArg)}/*`) + ) { + res.set(workspaceName, workspacePath) + } + } + } + + if (!res.size) { + let msg = '!' + if (filters.length) { + msg = `:\n ${filters.reduce( + (acc, filterArg) => `${acc} --workspace=${filterArg}`, '')}` + } + + throw new Error(`No workspaces found${msg}`) + } + + return res +} + +module.exports = getWorkspaces diff --git a/node24/node_modules/npm/lib/utils/installed-deep.js b/node24/node_modules/npm/lib/utils/installed-deep.js new file mode 100644 index 0000000000000000000000000000000000000000..7ccf098b91ff6267232620f4755bb827ed2a6ed3 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/installed-deep.js @@ -0,0 +1,45 @@ +const { resolve } = require('node:path') +const localeCompare = require('@isaacs/string-locale-compare')('en') + +const installedDeep = async (npm) => { + const Arborist = require('@npmcli/arborist') + const { + depth, + global, + prefix, + workspacesEnabled, + } = npm.flatOptions + + const getValues = (tree) => + [...tree.inventory.values()] + .filter(i => i.location !== '' && !i.isRoot) + .map(i => { + return i + }) + .filter(i => (i.depth - 1) <= depth) + .sort((a, b) => (a.depth - b.depth) || localeCompare(a.name, b.name)) + + const res = new Set() + const gArb = new Arborist({ + global: true, + path: resolve(npm.globalDir, '..'), + workspacesEnabled, + }) + const gTree = await gArb.loadActual({ global: true }) + + for (const node of getValues(gTree)) { + res.add(global ? node.name : [node.name, '-g']) + } + + if (!global) { + const arb = new Arborist({ global: false, path: prefix, workspacesEnabled }) + const tree = await arb.loadActual() + for (const node of getValues(tree)) { + res.add(node.name) + } + } + + return [...res] +} + +module.exports = installedDeep diff --git a/node24/node_modules/npm/lib/utils/installed-shallow.js b/node24/node_modules/npm/lib/utils/installed-shallow.js new file mode 100644 index 0000000000000000000000000000000000000000..f77fa7e06b32544262e3e8aa5e65d7f8de3c4236 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/installed-shallow.js @@ -0,0 +1,19 @@ +const { readdirScoped } = require('@npmcli/fs') + +const installedShallow = async (npm, opts) => { + const names = async global => { + const paths = await readdirScoped(global ? npm.globalDir : npm.localDir) + return paths.map(p => p.replace(/\\/g, '/')) + } + const { conf: { argv: { remain } } } = opts + if (remain.length > 3) { + return null + } + + const { global } = npm.flatOptions + const locals = global ? [] : await names(false) + const globals = (await names(true)).map(n => global ? n : `${n} -g`) + return [...locals, ...globals] +} + +module.exports = installedShallow diff --git a/node24/node_modules/npm/lib/utils/is-windows.js b/node24/node_modules/npm/lib/utils/is-windows.js new file mode 100644 index 0000000000000000000000000000000000000000..e2704d22d832b808ccbe54b8ce3417b090f73b06 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/is-windows.js @@ -0,0 +1,4 @@ +const isWindowsShell = (process.platform === 'win32') && + !/^MINGW(32|64)$/.test(process.env.MSYSTEM) && process.env.TERM !== 'cygwin' + +exports.isWindowsShell = isWindowsShell diff --git a/node24/node_modules/npm/lib/utils/log-file.js b/node24/node_modules/npm/lib/utils/log-file.js new file mode 100644 index 0000000000000000000000000000000000000000..6f81b496d4b62b9c1c66219054ea8e6de116af1a --- /dev/null +++ b/node24/node_modules/npm/lib/utils/log-file.js @@ -0,0 +1,247 @@ +const os = require('node:os') +const { join, dirname, basename } = require('node:path') +const fsMiniPass = require('fs-minipass') +const fs = require('node:fs/promises') +const { log } = require('proc-log') +const { formatWithOptions } = require('./format') + +const padZero = (n, length) => n.toString().padStart(length.toString().length, '0') + +class LogFiles { + // Default to an array so we can buffer + // initial writes before we know the cache location + #logStream = [] + + // We cap log files at a certain number of log events per file. + // Note that each log event can write more than one line to the file. + // Then we rotate log files once this number of events is reached + #MAX_LOGS_PER_FILE = null + + // Now that we write logs continuously we need to have a backstop here for infinite loops that still log. + // This is also partially handled by the config.get('max-files') option, but this is a failsafe to prevent runaway log file creation + #MAX_FILES_PER_PROCESS = null + + #fileLogCount = 0 + #totalLogCount = 0 + #path = null + #logsMax = null + #files = [] + #timing = false + + constructor ({ + maxLogsPerFile = 50_000, + maxFilesPerProcess = 5, + } = {}) { + this.#MAX_LOGS_PER_FILE = maxLogsPerFile + this.#MAX_FILES_PER_PROCESS = maxFilesPerProcess + this.on() + } + + on () { + process.on('log', this.#logHandler) + } + + off () { + process.off('log', this.#logHandler) + this.#endStream() + } + + load ({ command, path, logsMax = Infinity, timing } = {}) { + if (['completion'].includes(command)) { + return + } + + // dir is user configurable and is required to exist so this can error if the dir is missing or not configured correctly + this.#path = path + this.#logsMax = logsMax + this.#timing = timing + + // Log stream has already ended + if (!this.#logStream) { + return + } + + log.verbose('logfile', `logs-max:${logsMax} dir:${this.#path}`) + + // Write the contents of our array buffer to our new file stream and set that as the new log logstream for future writes + // if logs max is 0 then the user does not want a log file + if (this.#logsMax > 0) { + const initialFile = this.#openLogFile() + if (initialFile) { + for (const item of this.#logStream) { + const formatted = this.#formatLogItem(...item) + if (formatted !== null) { + initialFile.write(formatted) + } + } + this.#logStream = initialFile + } + } + + log.verbose('logfile', this.files[0] || 'no logfile created') + + // Kickoff cleaning process, even if we aren't writing a logfile. + // This is async but it will always ignore the current logfile + // Return the result so it can be awaited in tests + return this.#cleanLogs() + } + + get files () { + return this.#files + } + + get #isBuffered () { + return Array.isArray(this.#logStream) + } + + #endStream (output) { + if (this.#logStream && !this.#isBuffered) { + this.#logStream.end(output) + this.#logStream = null + } + } + + #logHandler = (level, ...args) => { + // Ignore pause and resume events since we write everything to the log file + if (level === 'pause' || level === 'resume') { + return + } + + // If the stream is ended then do nothing + if (!this.#logStream) { + return + } + + if (this.#isBuffered) { + // Cant do anything but buffer the output if we don't have a file stream yet + this.#logStream.push([level, ...args]) + return + } + + const logOutput = this.#formatLogItem(level, ...args) + if (logOutput === null) { + return + } + + // Open a new log file if we've written too many logs to this one + if (this.#fileLogCount >= this.#MAX_LOGS_PER_FILE) { + // Write last chunk to the file and close it + this.#endStream(logOutput) + if (this.#files.length >= this.#MAX_FILES_PER_PROCESS) { + // but if its way too many then we just stop listening + this.off() + } else { + // otherwise we are ready for a new file for the next event + this.#logStream = this.#openLogFile() + } + } else { + this.#logStream.write(logOutput) + } + } + + #formatLogItem (level, title, ...args) { + // Only right timing logs to logfile if explicitly requests + if (level === log.KEYS.timing && !this.#timing) { + return null + } + + this.#fileLogCount += 1 + const prefix = [this.#totalLogCount++, level, title || null] + return formatWithOptions({ prefix, eol: os.EOL, colors: false }, ...args) + } + + #getLogFilePath (count = '') { + return `${this.#path}debug-${count}.log` + } + + #openLogFile () { + // Count in filename will be 0 indexed + const count = this.#files.length + + try { + // Pad with zeros so that our log files are always sorted properly + // We never want to write files ending in `-9.log` and `-10.log` because log file cleaning is done by deleting the oldest. + // So in this example `-10.log` would be deleted next. + const f = this.#getLogFilePath(padZero(count, this.#MAX_FILES_PER_PROCESS)) + // Some effort was made to make the async, but we need to write logs during process.on('exit') which has to be synchronous. + // So in order to never drop log messages, it is easiest to make it sync all the time and this was measured to be about 1.5% slower for 40k lines of output + const logStream = new fsMiniPass.WriteStreamSync(f, { flags: 'a' }) + if (count > 0) { + // Reset file log count if we are opening after our first file + this.#fileLogCount = 0 + } + this.#files.push(logStream.path) + return logStream + } catch (e) { + // If the user has a readonly logdir then we don't want to warn this on every command so it should be verbose + log.verbose('logfile', `could not be created: ${e}`) + } + } + + async #cleanLogs () { + // module to clean out the old log files this is a best-effort attempt. + // if a rm fails, we just log a message about it and move on. + // We do return a Promise that succeeds when we've tried to delete everything, just for the benefit of testing this function properly. + + try { + const logPath = this.#getLogFilePath() + const patternFileName = basename(logPath) + // tell glob to only match digits + .replace(/\d/g, 'd') + // Handle the old (prior to 8.2.0) log file names which did not have a counter suffix + .replace('-.log', '') + + let files = await fs.readdir( + dirname(logPath), { + withFileTypes: true, + encoding: 'utf-8', + }) + files = files.sort((a, b) => basename(a.name).localeCompare(basename(b.name), 'en')) + + const logFiles = [] + + for (const file of files) { + if (!file.isFile()) { + continue + } + + const genericFileName = file.name.replace(/\d/g, 'd') + const filePath = join(dirname(logPath), basename(file.name)) + + // Always ignore the currently written files + if ( + genericFileName.includes(patternFileName) + && genericFileName.endsWith('.log') + && !this.#files.includes(filePath) + ) { + logFiles.push(filePath) + } + } + + const toDelete = logFiles.length - this.#logsMax + + if (toDelete <= 0) { + return + } + + log.silly('logfile', `start cleaning logs, removing ${toDelete} files`) + + for (const file of logFiles.slice(0, toDelete)) { + try { + await fs.rm(file, { force: true }) + } catch (e) { + log.silly('logfile', 'error removing log file', file, e) + } + } + } catch (e) { + // Disable cleanup failure warnings when log writing is disabled + if (this.#logsMax > 0) { + log.verbose('logfile', 'error cleaning log files', e) + } + } finally { + log.silly('logfile', 'done cleaning log files') + } + } +} + +module.exports = LogFiles diff --git a/node24/node_modules/npm/lib/utils/npm-usage.js b/node24/node_modules/npm/lib/utils/npm-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..877a5ed04330c91521715ff3db7f2f01c8c1d36d --- /dev/null +++ b/node24/node_modules/npm/lib/utils/npm-usage.js @@ -0,0 +1,74 @@ +const { commands } = require('./cmd-list') + +const COL_MAX = 60 +const COL_MIN = 24 +const COL_GUTTER = 16 +const INDENT = 4 + +const indent = (repeat = INDENT) => ' '.repeat(repeat) +const indentNewline = (repeat) => `\n${indent(repeat)}` + +module.exports = (npm) => { + const browser = npm.config.get('viewer') === 'browser' ? ' (in a browser)' : '' + const allCommands = npm.config.get('long') ? cmdUsages(npm.constructor) : cmdNames() + + return `npm + +Usage: + +npm install install all the dependencies in your project +npm install add the dependency to your project +npm test run this project's tests +npm run run the script named +npm -h quick help on +npm -l display usage info for all commands +npm help search for help on ${browser} +npm help npm more involved overview${browser} + +All commands: +${allCommands} + +Specify configs in the ini-formatted file: +${indent() + npm.config.get('userconfig')} +or on the command line via: npm --key=value + +More configuration info: npm help config +Configuration fields: npm help 7 config + +npm@${npm.version} ${npm.npmRoot}` +} + +const cmdNames = () => { + const out = [''] + + const line = !process.stdout.columns ? COL_MAX + : Math.min(COL_MAX, Math.max(process.stdout.columns - COL_GUTTER, COL_MIN)) + + let l = 0 + for (const c of commands) { + if (out[l].length + c.length + 2 < line) { + out[l] += ', ' + c + } else { + out[l++] += ',' + out[l] = c + } + } + + return indentNewline() + out.join(indentNewline()).slice(2) +} + +const cmdUsages = (Npm) => { + // return a string of : + let maxLen = 0 + const set = [] + for (const c of commands) { + set.push([c, Npm.cmd(c).getUsage(null, false).split('\n')]) + maxLen = Math.max(maxLen, c.length) + } + + return set.map(([name, usageLines]) => { + const gutter = indent(maxLen - name.length + 1) + const usage = usageLines.join(indentNewline(INDENT + maxLen + 1)) + return indentNewline() + name + gutter + usage + }).join('\n') +} diff --git a/node24/node_modules/npm/lib/utils/oidc.js b/node24/node_modules/npm/lib/utils/oidc.js new file mode 100644 index 0000000000000000000000000000000000000000..f29ea438d6f4c2172bfb7cf0836d75d44a42c11a --- /dev/null +++ b/node24/node_modules/npm/lib/utils/oidc.js @@ -0,0 +1,177 @@ +const { log } = require('proc-log') +const npmFetch = require('npm-registry-fetch') +const ciInfo = require('ci-info') +const fetch = require('make-fetch-happen') +const npa = require('npm-package-arg') +const libaccess = require('libnpmaccess') + +/** + * Handles OpenID Connect (OIDC) token retrieval and exchange for CI environments. + * + * This function is designed to work in Continuous Integration (CI) environments such as GitHub Actions, GitLab, and CircleCI. + * It retrieves an OIDC token from the CI environment, exchanges it for an npm token, and sets the token in the provided configuration for authentication with the npm registry. + * + * This function is intended to never throw, as it mutates the state of the `opts` and `config` objects on success. + * OIDC is always an optional feature, and the function should not throw if OIDC is not configured by the registry. + * + * @see https://github.com/watson/ci-info for CI environment detection. + * @see https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect for GitHub Actions OIDC. + * @see https://circleci.com/docs/openid-connect-tokens/ for CircleCI OIDC. + */ +async function oidc ({ packageName, registry, opts, config }) { + /* + * This code should never run when people try to publish locally on their machines. + * It is designed to execute only in Continuous Integration (CI) environments. + */ + + try { + if (!( + /** @see https://github.com/watson/ci-info/blob/v4.2.0/vendors.json#L152 */ + ciInfo.GITHUB_ACTIONS || + /** @see https://github.com/watson/ci-info/blob/v4.2.0/vendors.json#L161C13-L161C22 */ + ciInfo.GITLAB || + /** @see https://github.com/watson/ci-info/blob/v4.2.0/vendors.json#L78 */ + ciInfo.CIRCLE + )) { + return undefined + } + + /** + * Check if the environment variable `NPM_ID_TOKEN` is set. + * In GitLab CI, the ID token is provided via an environment variable, + * with `NPM_ID_TOKEN` serving as a predefined default. For consistency, + * all supported CI environments are expected to support this variable. + * In contrast, GitHub Actions uses a request-based approach to retrieve the ID token. + * The presence of this token within GitHub Actions will override the request-based approach. + * This variable follows the prefix/suffix convention from sigstore (e.g., `SIGSTORE_ID_TOKEN`). + * @see https://docs.sigstore.dev/cosign/signing/overview/ + */ + let idToken = process.env.NPM_ID_TOKEN + + if (!idToken && ciInfo.GITHUB_ACTIONS) { + /** + * GitHub Actions provides these environment variables: + * - `ACTIONS_ID_TOKEN_REQUEST_URL`: The URL to request the ID token. + * - `ACTIONS_ID_TOKEN_REQUEST_TOKEN`: The token to authenticate the request. + * Only when a workflow has the following permissions: + * ``` + * permissions: + * id-token: write + * ``` + * @see https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/configuring-openid-connect-in-cloud-providers#adding-permissions-settings + */ + if (!( + process.env.ACTIONS_ID_TOKEN_REQUEST_URL && + process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN + )) { + log.silly('oidc', 'Skipped because incorrect permissions for id-token within GitHub workflow') + return undefined + } + + /** + * The specification for an audience is `npm:registry.npmjs.org`, where "registry.npmjs.org" can be any supported registry. + */ + const audience = `npm:${new URL(registry).hostname}` + const url = new URL(process.env.ACTIONS_ID_TOKEN_REQUEST_URL) + url.searchParams.append('audience', audience) + const startTime = Date.now() + const response = await fetch(url.href, { + retry: opts.retry, + headers: { + Accept: 'application/json', + Authorization: `Bearer ${process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN}`, + }, + }) + + const elapsedTime = Date.now() - startTime + + log.http( + 'fetch', + `GET ${url.href} ${response.status} ${elapsedTime}ms` + ) + + const json = await response.json() + + if (!response.ok) { + log.verbose('oidc', `Failed to fetch id_token from GitHub: received an invalid response`) + return undefined + } + + if (!json.value) { + log.verbose('oidc', `Failed to fetch id_token from GitHub: missing value`) + return undefined + } + + idToken = json.value + } + + if (!idToken) { + log.silly('oidc', 'Skipped because no id_token available') + return undefined + } + + const parsedRegistry = new URL(registry) + const regKey = `//${parsedRegistry.host}${parsedRegistry.pathname}` + const authTokenKey = `${regKey}:_authToken` + + const escapedPackageName = npa(packageName).escapedName + let response + try { + response = await npmFetch.json(new URL(`/-/npm/v1/oidc/token/exchange/package/${escapedPackageName}`, registry), { + ...opts, + [authTokenKey]: idToken, // Use the idToken as the auth token for the request + method: 'POST', + }) + } catch (error) { + log.verbose('oidc', `Failed token exchange request with body message: ${error?.body?.message || 'Unknown error'}`) + return undefined + } + + if (!response?.token) { + log.verbose('oidc', 'Failed because token exchange was missing the token in the response body') + return undefined + } + + /* + * The "opts" object is a clone of npm.flatOptions and is passed through the `publish` command, eventually reaching `otplease`. + * To ensure the token is accessible during the publishing process, it must be directly attached to the `opts` object. + * Additionally, the token is required by the "live" configuration or getters within `config`. + */ + opts[authTokenKey] = response.token + config.set(authTokenKey, response.token, 'user') + log.verbose('oidc', `Successfully retrieved and set token`) + + try { + const isDefaultProvenance = config.isDefault('provenance') + // CircleCI doesn't support provenance yet, so skip the auto-enable logic + if (isDefaultProvenance && !ciInfo.CIRCLE) { + const [headerB64, payloadB64] = idToken.split('.') + if (headerB64 && payloadB64) { + const payloadJson = Buffer.from(payloadB64, 'base64').toString('utf8') + const payload = JSON.parse(payloadJson) + if ( + (ciInfo.GITHUB_ACTIONS && payload.repository_visibility === 'public') || + // only set provenance for gitlab if the repo is public and SIGSTORE_ID_TOKEN is available + (ciInfo.GITLAB && payload.project_visibility === 'public' && process.env.SIGSTORE_ID_TOKEN) + ) { + const visibility = await libaccess.getVisibility(packageName, opts) + if (visibility?.public) { + log.verbose('oidc', `Enabling provenance`) + opts.provenance = true + config.set('provenance', true, 'user') + } + } + } + } + } catch (error) { + log.verbose('oidc', `Failed to set provenance with message: ${error?.message || 'Unknown error'}`) + } + } catch (error) { + log.verbose('oidc', `Failure with message: ${error?.message || 'Unknown error'}`) + } + return undefined +} + +module.exports = { + oidc, +} diff --git a/node24/node_modules/npm/lib/utils/open-url.js b/node24/node_modules/npm/lib/utils/open-url.js new file mode 100644 index 0000000000000000000000000000000000000000..80ee4b3e5da3debdd1b1f511e46f555a3edb04b5 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/open-url.js @@ -0,0 +1,97 @@ +const { open } = require('@npmcli/promise-spawn') +const { output, input, META } = require('proc-log') +const { URL } = require('node:url') +const readline = require('node:readline/promises') +const { once } = require('node:events') + +const assertValidUrl = (url) => { + try { + if (!/^https?:$/.test(new URL(url).protocol)) { + throw new Error() + } + } catch { + throw new Error('Invalid URL: ' + url) + } +} + +const outputMsg = (json, title, url) => { + if (json) { + output.buffer({ title, url }) + } else { + // These urls are sometimes specifically login urls so we have to turn off redaction to standard output + output.standard(`${title}:\n${url}`, { [META]: true, redact: false }) + } +} + +// attempt to open URL in web-browser, print address otherwise: +const openUrl = async (npm, url, title, isFile) => { + url = encodeURI(url) + const browser = npm.config.get('browser') + const json = npm.config.get('json') + + if (browser === false) { + outputMsg(json, title, url) + return + } + + // We pass this in as true from the help command so we know we don't have to check the protocol + if (!isFile) { + assertValidUrl(url) + } + + try { + await input.start(() => open(url, { + command: browser === true ? null : browser, + })) + } catch (err) { + if (err.code !== 127) { + throw err + } + outputMsg(json, title, url) + } +} + +// Prompt to open URL in browser if possible +const openUrlPrompt = async (npm, url, title, prompt, { signal }) => { + const browser = npm.config.get('browser') + const json = npm.config.get('json') + + assertValidUrl(url) + outputMsg(json, title, url) + + if (browser === false || !process.stdin.isTTY || !process.stdout.isTTY) { + return + } + + const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout, + }) + + try { + await input.read(() => Promise.race([ + rl.question(prompt, { signal }), + once(rl, 'error'), + once(rl, 'SIGINT').then(() => { + throw new Error('canceled') + }), + ])) + rl.close() + await openUrl(npm, url, 'Browser unavailable. Please open the URL manually') + } catch (err) { + rl.close() + if (err.name !== 'AbortError') { + throw err + } + } +} + +// Rearrange arguments and return a function that takes the two arguments returned from the npm-profile methods that take an opener +const createOpener = (npm, title, prompt = 'Press ENTER to open in the browser...') => + (url, opts) => openUrlPrompt(npm, url, title, prompt, opts) + +module.exports = { + openUrl, + openUrlPrompt, + createOpener, +} diff --git a/node24/node_modules/npm/lib/utils/output-error.js b/node24/node_modules/npm/lib/utils/output-error.js new file mode 100644 index 0000000000000000000000000000000000000000..20e983187e5bc949c8e8702068835482611fb74e --- /dev/null +++ b/node24/node_modules/npm/lib/utils/output-error.js @@ -0,0 +1,30 @@ +const { log, output } = require('proc-log') + +const outputError = ({ standard = [], verbose = [], error = [], summary = [], detail = [] }) => { + for (const line of standard) { + // Each output line is just a single string + output.standard(line) + } + for (const line of verbose) { + log.verbose(...line) + } + for (const line of [...error, ...summary, ...detail]) { + log.error(...line) + } +} + +const jsonError = (error, npm) => { + if (error && npm?.loaded && npm?.config.get('json')) { + return { + code: error.code, + summary: (error.summary || []).map(l => l.slice(1).join(' ')).join('\n').trim(), + detail: (error.detail || []).map(l => l.slice(1).join(' ')).join('\n').trim(), + ...error.json, + } + } +} + +module.exports = { + outputError, + jsonError, +} diff --git a/node24/node_modules/npm/lib/utils/ping.js b/node24/node_modules/npm/lib/utils/ping.js new file mode 100644 index 0000000000000000000000000000000000000000..1c42cb9ce21d3cf119bd8c6f880b5c0975d77673 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/ping.js @@ -0,0 +1,6 @@ +// ping the npm registry used by the ping and doctor commands +const npmFetch = require('npm-registry-fetch') +module.exports = async (flatOptions) => { + const res = await npmFetch('/-/ping', { ...flatOptions, cache: false }) + return res.json().catch(() => ({})) +} diff --git a/node24/node_modules/npm/lib/utils/queryable.js b/node24/node_modules/npm/lib/utils/queryable.js new file mode 100644 index 0000000000000000000000000000000000000000..5b5253448ea6b0446b39506a0060fbf5612db833 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/queryable.js @@ -0,0 +1,287 @@ +const util = require('node:util') +const _delete = Symbol('delete') +const _append = Symbol('append') + +const sqBracketsMatcher = str => str.match(/(.+)\[([^\]]+)\]\.?(.*)$/) + +// replaces any occurrence of an empty-brackets (e.g: []) with a special Symbol(append) to represent it +// this is going to be useful for the setter method that will push values to the end of the array when finding these +const replaceAppendSymbols = str => { + const matchEmptyBracket = str.match(/^(.*)\[\]\.?(.*)$/) + + if (matchEmptyBracket) { + const [, pre, post] = matchEmptyBracket + return [...replaceAppendSymbols(pre), _append, post].filter(Boolean) + } + + return [str] +} + +const parseKeys = key => { + const sqBracketItems = new Set() + sqBracketItems.add(_append) + const parseSqBrackets = str => { + const index = sqBracketsMatcher(str) + + // once we find square brackets, we recursively parse all these + if (index) { + const preSqBracketPortion = index[1] + + // we want to have a `new String` wrapper here in order to differentiate between multiple occurrences of the same string, + // e.g: foo.bar[foo.bar] should split into { foo: { bar: { 'foo.bar': {} } } + /* eslint-disable-next-line no-new-wrappers */ + const foundKey = new String(index[2]) + const postSqBracketPortion = index[3] + + // we keep track of items found during this step to make sure we don't try to split-separate keys that were defined within square brackets, since the key name itself might contain dots + sqBracketItems.add(foundKey) + + // returns an array that contains either dot-separate items (that will be split apart during the next step OR the fully parsed keys read from square brackets + // e.g: foo.bar[1.0.0].a.b -> ['foo.bar', '1.0.0', 'a.b'] + return [ + ...parseSqBrackets(preSqBracketPortion), + foundKey, + ...(postSqBracketPortion ? parseSqBrackets(postSqBracketPortion) : []), + ] + } + + // at the end of parsing, any usage of the special empty-bracket syntax (e.g: foo.array[]) has not yet been parsed + // here we'll take care of parsing it and adding a special symbol to represent it in the resulting list of keys + return replaceAppendSymbols(str) + } + + const res = [] + // starts by parsing items defined as square brackets + // those might be representing properties that have a dot in the name or just array indexes + // e.g: foo[1.0.0] or list[0] + const sqBracketKeys = parseSqBrackets(key.trim()) + + for (const k of sqBracketKeys) { + // keys parsed from square brackets should just be added to list of resulting keys as they might have dots as part of the key + if (sqBracketItems.has(k)) { + res.push(k) + } else { + // splits the dot-sep property names and add them to the list of keys + /* eslint-disable-next-line no-new-wrappers */ + for (const splitKey of k.split('.')) { + res.push(String(splitKey)) + } + } + } + + // returns an ordered list of strings in which each entry represents a key in an object defined by the previous entry + return res +} + +const getter = ({ data, key }, { unwrapSingleItemArrays = true } = {}) => { + // keys are a list in which each entry represents the name of a property that should be walked through the object in order to return the final found value + const keys = parseKeys(key) + let _data = data + let label = '' + + for (const k of keys) { + // empty-bracket-shortcut-syntax is not supported on getter + if (k === _append) { + throw Object.assign(new Error('Empty brackets are not valid syntax for retrieving values.'), { + code: 'EINVALIDSYNTAX', + }) + } + + // extra logic to take into account printing array, along with its special syntax in which using a dot-sep property name after an array will expand it's results + // e.g: arr.name -> arr[0].name=value, arr[1].name=value, ... + const maybeIndex = Number(k) + if (Array.isArray(_data) && !Number.isInteger(maybeIndex)) { + _data = _data.reduce((acc, i, index) => { + acc[`${label}[${index}].${k}`] = i[k] + return acc + }, {}) + return _data + } else { + if (!Object.hasOwn(_data, k)) { + return undefined + } + _data = _data[k] + } + + label += k + } + + // these are some legacy expectations from the old API consumed by lib/view.js + if (unwrapSingleItemArrays && Array.isArray(_data) && _data.length <= 1) { + _data = _data[0] + } + + return { + [key]: _data, + } +} + +const setter = ({ data, key, value, force }) => { + // setter goes to recursively transform the provided data obj + // setting properties from the list of parsed keys + // e.g: ['foo', 'bar', 'baz'] -> { foo: { bar: { baz: {} } } + const keys = parseKeys(key) + const setKeys = (_data, _key) => { + // handles array indexes, converting valid integers to numbers + // note that occurrences of Symbol(append) will throw so we just ignore these for now + let maybeIndex = Number.NaN + try { + maybeIndex = Number(_key) + } catch { + // leave it NaN + } + if (!Number.isNaN(maybeIndex)) { + _key = maybeIndex + } + + // creates new array in case key is an index and the array obj is not yet defined + const keyIsAnArrayIndex = _key === maybeIndex || _key === _append + const dataHasNoItems = !Object.keys(_data).length + if (keyIsAnArrayIndex && dataHasNoItems && !Array.isArray(_data)) { + _data = [] + } + + // converting from array to an object is also possible, in case the user is using force mode + // we should also convert existing arrays to an empty object if the current _data is an array + if (force && Array.isArray(_data) && !keyIsAnArrayIndex) { + _data = { ..._data } + } + + // the _append key is a special key that is used to represent the empty-bracket notation + // e.g: arr[] -> arr[arr.length] + if (_key === _append) { + if (!Array.isArray(_data)) { + throw Object.assign(new Error(`Can't use append syntax in non-Array element`), { + code: 'ENOAPPEND', + }) + } + _key = _data.length + } + + // retrieves the next data object to recursively iterate on + // throws if trying to override a literal value or add props to an array + const next = () => { + const haveContents = !force && _data[_key] != null && value !== _delete + const shouldNotOverrideLiteralValue = !(typeof _data[_key] === 'object') + // if the next obj to recurse is an array and the next key to be appended to the resulting obj is not an array index, then it should throw since we can't append arbitrary props to arrays + const shouldNotAddPropsToArrays = + typeof keys[0] !== 'symbol' && Array.isArray(_data[_key]) && Number.isNaN(Number(keys[0])) + + const overrideError = haveContents && shouldNotOverrideLiteralValue + if (overrideError) { + throw Object.assign( + new Error(`Property ${_key} already exists and is not an Array or Object.`), + { code: 'EOVERRIDEVALUE' } + ) + } + + const addPropsToArrayError = haveContents && shouldNotAddPropsToArrays + if (addPropsToArrayError) { + throw Object.assign(new Error(`Can't add property ${key} to an Array.`), { + code: 'ENOADDPROP', + }) + } + + return typeof _data[_key] === 'object' ? _data[_key] || {} : {} + } + + // sets items from the parsed array of keys as objects, recurses to setKeys in case there are still items to be handled + // otherwise, it just sets the original value set by the user + if (keys.length) { + _data[_key] = setKeys(next(), keys.shift()) + } else { + // handles special deletion cases for obj props / array items + if (value === _delete) { + if (Array.isArray(_data)) { + _data.splice(_key, 1) + } else { + delete _data[_key] + } + } else { + // finally, sets the value in its right place + _data[_key] = value + } + } + + return _data + } + + setKeys(data, keys.shift()) +} + +class Queryable { + static ALL = '' + + #data = null + + constructor (obj) { + if (!obj || typeof obj !== 'object') { + throw Object.assign(new Error('Queryable needs an object to query properties from.'), { + code: 'ENOQUERYABLEOBJ', + }) + } + + this.#data = obj + } + + query (queries, opts) { + // this ugly interface here is meant to be a compatibility layer with the legacy API lib/view.js is consuming + // if at some point we refactor that command then we can revisit making this nicer + if (queries === Queryable.ALL) { + return { [Queryable.ALL]: this.#data } + } + + const q = query => + getter({ + data: this.#data, + key: query, + }, opts) + + if (Array.isArray(queries)) { + let res = {} + for (const query of queries) { + res = { ...res, ...q(query) } + } + return res + } else { + return q(queries) + } + } + + // return the value for a single query if found; otherwise, returns undefined + get (query) { + const obj = this.query(query) + if (obj) { + return obj[query] + } + } + + // creates objects along the way for the provided `query` parameter and assigns `value` to the last property of the query chain + set (query, value, { force } = {}) { + setter({ + data: this.#data, + key: query, + value, + force, + }) + } + + // deletes the value of the property found at `query` + delete (query) { + setter({ + data: this.#data, + key: query, + value: _delete, + }) + } + + toJSON () { + return this.#data + } + + [util.inspect.custom] () { + return this.toJSON() + } +} + +module.exports = Queryable diff --git a/node24/node_modules/npm/lib/utils/read-user-info.js b/node24/node_modules/npm/lib/utils/read-user-info.js new file mode 100644 index 0000000000000000000000000000000000000000..cdf3eaa164750b03dac5a4a40d1202e7307f9562 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/read-user-info.js @@ -0,0 +1,69 @@ +const { read: _read } = require('read') +const userValidate = require('npm-user-validate') +const { log, input, META } = require('proc-log') + +const otpPrompt = `This command requires a one-time password (OTP) from your authenticator app. +Enter one below. You can also pass one on the command line by appending --otp=123456. +For more information, see: +https://docs.npmjs.com/getting-started/using-two-factor-authentication +Enter OTP: ` +const passwordPrompt = 'npm password: ' +const usernamePrompt = 'npm username: ' +const emailPrompt = 'email (this will be public): ' + +// Pass options through so we can differentiate between regular and silent prompts +const read = (options) => + input.read(() => _read(options), { [META]: true, silent: options?.silent }) + +function readOTP (msg = otpPrompt, otp, isRetry) { + if (isRetry && otp && /^[\d ]+$|^[A-Fa-f0-9]{64,64}$/.test(otp)) { + return otp.replace(/\s+/g, '') + } + + return read({ prompt: msg, default: otp || '' }) + .then((rOtp) => readOTP(msg, rOtp, true)) +} + +function readPassword (msg = passwordPrompt, password, isRetry) { + if (isRetry && password) { + return password + } + + return read({ prompt: msg, silent: true, default: password || '' }) + .then((rPassword) => readPassword(msg, rPassword, true)) +} + +function readUsername (msg = usernamePrompt, username, isRetry) { + if (isRetry && username) { + const error = userValidate.username(username) + if (error) { + log.warn(error.message) + } else { + return Promise.resolve(username.trim()) + } + } + + return read({ prompt: msg, default: username || '' }) + .then((rUsername) => readUsername(msg, rUsername, true)) +} + +function readEmail (msg = emailPrompt, email, isRetry) { + if (isRetry && email) { + const error = userValidate.email(email) + if (error) { + log.warn(error.message) + } else { + return email.trim() + } + } + + return read({ prompt: msg, default: email || '' }) + .then((username) => readEmail(msg, username, true)) +} + +module.exports = { + otp: readOTP, + password: readPassword, + username: readUsername, + email: readEmail, +} diff --git a/node24/node_modules/npm/lib/utils/reify-finish.js b/node24/node_modules/npm/lib/utils/reify-finish.js new file mode 100644 index 0000000000000000000000000000000000000000..4b806662cabec99817614408d314a6fe94fd2f58 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/reify-finish.js @@ -0,0 +1,21 @@ +const reifyOutput = require('./reify-output.js') +const ini = require('ini') +const { writeFile } = require('node:fs/promises') +const { resolve } = require('node:path') + +const reifyFinish = async (npm, arb) => { + // if we are using a builtin config, and just installed npm as a top-level global package, we have to preserve that config. + if (arb.options.global) { + const npmNode = arb.actualTree.inventory.get('node_modules/npm') + if (npmNode) { + const builtinConf = npm.config.data.get('builtin') + if (!builtinConf.loadError) { + const content = ini.stringify(builtinConf.raw).trim() + '\n' + await writeFile(resolve(npmNode.path, 'npmrc'), content) + } + } + } + reifyOutput(npm, arb) +} + +module.exports = reifyFinish diff --git a/node24/node_modules/npm/lib/utils/reify-output.js b/node24/node_modules/npm/lib/utils/reify-output.js new file mode 100644 index 0000000000000000000000000000000000000000..45763f46431e9efbee8e31a98b8d59eb19cd9533 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/reify-output.js @@ -0,0 +1,220 @@ +// pass in an arborist object, and it'll output the data about what +// was done, what was audited, etc. +// +// added ## packages, removed ## packages, and audited ## packages in 19.157s +// +// 1 package is looking for funding +// run `npm fund` for details +// +// found 37 vulnerabilities (5 low, 7 moderate, 25 high) +// run `npm audit fix` to fix them, or `npm audit` for details + +const { log, output } = require('proc-log') +const { depth } = require('treeverse') +const ms = require('ms') +const npmAuditReport = require('npm-audit-report') +const { readTree: getFundingInfo } = require('libnpmfund') +const auditError = require('./audit-error.js') + +// TODO: output JSON if flatOptions.json is true +const reifyOutput = (npm, arb) => { + const { diff, actualTree } = arb + + // note: fails and crashes if we're running audit fix and there was an error which is a good thing, because there's no point printing all this other stuff in that case! + const auditReport = auditError(npm, arb.auditReport) ? null : arb.auditReport + + // don't print any info in --silent mode, but we still need to set the exitCode properly from the audit report, if we have one. + if (npm.silent) { + getAuditReport(npm, auditReport) + return + } + + const summary = { + add: [], + added: 0, + // audit gets added later + audited: auditReport && !auditReport.error ? actualTree.inventory.size : 0, + change: [], + changed: 0, + funding: 0, + remove: [], + removed: 0, + } + + if (diff) { + const showDiff = npm.config.get('dry-run') || npm.config.get('long') + const chalk = npm.chalk + + depth({ + tree: diff, + visit: d => { + switch (d.action) { + case 'REMOVE': + if (showDiff) { + output.standard(`${chalk.blue('remove')} ${d.actual.name} ${d.actual.package.version}`) + } + summary.removed++ + summary.remove.push({ + name: d.actual.name, + version: d.actual.package.version, + path: d.actual.path, + }) + break + case 'ADD': + if (showDiff) { + output.standard(`${chalk.green('add')} ${d.ideal.name} ${d.ideal.package.version}`) + } + if (actualTree.inventory.has(d.ideal)) { + summary.added++ + summary.add.push({ + name: d.ideal.name, + version: d.ideal.package.version, + path: d.ideal.path, + }) + } + break + case 'CHANGE': + if (showDiff) { + output.standard(`${chalk.cyan('change')} ${d.actual.name} ${d.actual.package.version} => ${d.ideal.package.version}`) + } + summary.changed++ + summary.change.push({ + from: { + name: d.actual.name, + version: d.actual.package.version, + path: d.actual.path, + }, + to: { + name: d.ideal.name, + version: d.ideal.package.version, + path: d.ideal.path, + }, + }) + break + default: + return + } + const node = d.actual || d.ideal + log.silly(d.action, node.location) + }, + getChildren: d => d.children, + }) + } + + if (npm.flatOptions.fund) { + const fundingInfo = getFundingInfo(actualTree, { countOnly: true }) + summary.funding = fundingInfo.length + } + + if (npm.flatOptions.json) { + if (auditReport) { + // call this to set the exit code properly + getAuditReport(npm, auditReport) + summary.audit = npm.command === 'audit' ? auditReport + : auditReport.toJSON().metadata + } + output.buffer(summary) + } else { + packagesChangedMessage(npm, summary) + packagesFundingMessage(npm, summary) + printAuditReport(npm, auditReport) + } +} + +// if we're running `npm audit fix`, then we print the full audit report at the end if there's still stuff, because it's silly for `npm audit` to tell you to run `npm audit` for details. +// otherwise, use the summary report. +// if we get here, we know it's not quiet or json. +// If the loglevel is silent, then we just run the report to get the exitCode set appropriately. +const printAuditReport = (npm, report) => { + const res = getAuditReport(npm, report) + if (!res || !res.report) { + return + } + output.standard(`\n${res.report}`) +} + +const getAuditReport = (npm, report) => { + if (!report) { + return + } + + // when in silent mode, we print nothing. + // the JSON output is going to just JSON.stringify() the report object. + const reporter = npm.silent ? 'quiet' + : npm.flatOptions.json ? 'quiet' + : npm.command !== 'audit' ? 'install' + : 'detail' + const defaultAuditLevel = npm.command !== 'audit' ? 'none' : 'low' + const auditLevel = npm.flatOptions.auditLevel || defaultAuditLevel + + const res = npmAuditReport(report, { + reporter, + ...npm.flatOptions, + auditLevel, + chalk: npm.chalk, + }) + if (npm.command === 'audit') { + process.exitCode = process.exitCode || res.exitCode + } + return res +} + +const packagesChangedMessage = (npm, { added, removed, changed, audited }) => { + const msg = ['\n'] + if (added === 0 && removed === 0 && changed === 0) { + msg.push('up to date') + if (audited) { + msg.push(', ') + } + } else { + if (added) { + msg.push(`added ${added} package${added === 1 ? '' : 's'}`) + } + + if (removed) { + if (added) { + msg.push(', ') + } + + if (added && !audited && !changed) { + msg.push('and ') + } + + msg.push(`removed ${removed} package${removed === 1 ? '' : 's'}`) + } + if (changed) { + if (added || removed) { + msg.push(', ') + } + + if (!audited && (added || removed)) { + msg.push('and ') + } + + msg.push(`changed ${changed} package${changed === 1 ? '' : 's'}`) + } + if (audited) { + msg.push(', and ') + } + } + if (audited) { + msg.push(`audited ${audited} package${audited === 1 ? '' : 's'}`) + } + + msg.push(` in ${ms(Date.now() - npm.started)}`) + output.standard(msg.join('')) +} + +const packagesFundingMessage = (npm, { funding }) => { + if (!funding) { + return + } + + output.standard() + const pkg = funding === 1 ? 'package' : 'packages' + const is = funding === 1 ? 'is' : 'are' + output.standard(`${funding} ${pkg} ${is} looking for funding`) + output.standard(' run `npm fund` for details') +} + +module.exports = reifyOutput diff --git a/node24/node_modules/npm/lib/utils/sbom-cyclonedx.js b/node24/node_modules/npm/lib/utils/sbom-cyclonedx.js new file mode 100644 index 0000000000000000000000000000000000000000..16d21eeb64d0c73c3e348f3bf2f3b2fda6e2aaf3 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/sbom-cyclonedx.js @@ -0,0 +1,203 @@ +const crypto = require('node:crypto') +const parseLicense = require('spdx-expression-parse') +const PackageJson = require('@npmcli/package-json') +const npa = require('npm-package-arg') +const ssri = require('ssri') + +const CYCLONEDX_SCHEMA = 'http://cyclonedx.org/schema/bom-1.5.schema.json' +const CYCLONEDX_FORMAT = 'CycloneDX' +const CYCLONEDX_SCHEMA_VERSION = '1.5' + +const PROP_BUNDLED = 'cdx:npm:package:bundled' +const PROP_DEVELOPMENT = 'cdx:npm:package:development' +const PROP_EXTRANEOUS = 'cdx:npm:package:extraneous' +const PROP_PRIVATE = 'cdx:npm:package:private' + +const REF_VCS = 'vcs' +const REF_WEBSITE = 'website' +const REF_ISSUE_TRACKER = 'issue-tracker' +const REF_DISTRIBUTION = 'distribution' + +const ALGO_MAP = { + sha1: 'SHA-1', + sha256: 'SHA-256', + sha384: 'SHA-384', + sha512: 'SHA-512', +} + +const cyclonedxOutput = ({ npm, nodes, packageType, packageLockOnly }) => { + const rootNode = nodes.find(node => node.isRoot) + const childNodes = nodes.filter(node => !node.isRoot && !node.isLink) + const uuid = crypto.randomUUID() + + // Create list of child nodes w/ unique IDs + const childNodeMap = new Map() + for (const item of childNodes) { + const id = toCyclonedxID(item) + if (!childNodeMap.has(id)) { + childNodeMap.set(id, item) + } + } + const uniqueChildNodes = Array.from(childNodeMap.values()) + + const deps = [rootNode, ...uniqueChildNodes] + .map(node => toCyclonedxDependency(node, nodes)) + + const bom = { + $schema: CYCLONEDX_SCHEMA, + bomFormat: CYCLONEDX_FORMAT, + specVersion: CYCLONEDX_SCHEMA_VERSION, + serialNumber: `urn:uuid:${uuid}`, + version: 1, + metadata: { + timestamp: new Date().toISOString(), + lifecycles: [ + { phase: packageLockOnly ? 'pre-build' : 'build' }, + ], + tools: [ + { + vendor: 'npm', + name: 'cli', + version: npm.version, + }, + ], + component: toCyclonedxItem(rootNode, { packageType }), + }, + components: uniqueChildNodes.map(toCyclonedxItem), + dependencies: deps, + } + + return bom +} + +const toCyclonedxItem = (node, { packageType }) => { + packageType = packageType || 'library' + + // Calculate purl from package spec + let spec = npa(node.pkgid) + spec = (spec.type === 'alias') ? spec.subSpec : spec + const purl = npa.toPurl(spec) + (isGitNode(node) ? `?vcs_url=${node.resolved}` : '') + + if (node.package) { + const toNormalize = new PackageJson() + toNormalize.fromContent(node.package).normalize({ steps: ['normalizeData'] }) + node.package = toNormalize.content + } + + let license = node.package?.license + if (license) { + if (typeof license === 'object') { + license = license.type + } + } else if (Array.isArray(node.package?.licenses)) { + license = node.package.licenses + .map(l => (typeof l === 'object' ? l.type : l)) + .filter(Boolean) + .join(' OR ') + } + + let parsedLicense + try { + parsedLicense = parseLicense(license) + } catch { + parsedLicense = null + } + + const component = { + 'bom-ref': toCyclonedxID(node), + type: packageType, + name: node.name, + version: node.version, + scope: (node.optional || node.devOptional) ? 'optional' : 'required', + author: (typeof node.package?.author === 'object') + ? node.package.author.name + : (node.package?.author || undefined), + description: node.package?.description || undefined, + purl: purl, + properties: [], + externalReferences: [], + } + + if (node.integrity) { + const integrity = ssri.parse(node.integrity, { single: true }) + component.hashes = [{ + alg: ALGO_MAP[integrity.algorithm] || /* istanbul ignore next */ 'SHA-512', + content: integrity.hexDigest(), + }] + } + + if (node.dev === true) { + component.properties.push(prop(PROP_DEVELOPMENT)) + } + + if (node.package?.private === true) { + component.properties.push(prop(PROP_PRIVATE)) + } + + if (node.extraneous === true) { + component.properties.push(prop(PROP_EXTRANEOUS)) + } + + if (node.inBundle === true) { + component.properties.push(prop(PROP_BUNDLED)) + } + + if (!node.isLink && node.resolved) { + component.externalReferences.push(extRef(REF_DISTRIBUTION, node.resolved)) + } + + if (node.package?.repository?.url) { + component.externalReferences.push(extRef(REF_VCS, node.package.repository.url)) + } + + if (node.package?.homepage) { + component.externalReferences.push(extRef(REF_WEBSITE, node.package.homepage)) + } + + if (node.package?.bugs?.url) { + component.externalReferences.push(extRef(REF_ISSUE_TRACKER, node.package.bugs.url)) + } + + // If license is a single SPDX license, use the license field + if (parsedLicense?.license) { + component.licenses = [{ license: { id: parsedLicense.license } }] + // If license is a conjunction, use the expression field + } else if (parsedLicense?.conjunction) { + component.licenses = [{ expression: license }] + } + + return component +} + +const toCyclonedxDependency = (node, nodes) => { + return { + ref: toCyclonedxID(node), + dependsOn: [...node.edgesOut.values()] + // Filter out edges that are linking to nodes not in the list + .filter(edge => nodes.find(n => n === edge.to)) + .map(edge => toCyclonedxID(edge.to)) + .filter(id => id), + } +} + +const toCyclonedxID = (node) => `${node.packageName}@${node.version}` + +const prop = (name) => ({ name, value: 'true' }) + +const extRef = (type, url) => ({ type, url }) + +const isGitNode = (node) => { + if (!node.resolved) { + return + } + + try { + const { type } = npa(node.resolved) + return type === 'git' || type === 'hosted' + } catch { + /* istanbul ignore next */ + return false + } +} + +module.exports = { cyclonedxOutput } diff --git a/node24/node_modules/npm/lib/utils/sbom-spdx.js b/node24/node_modules/npm/lib/utils/sbom-spdx.js new file mode 100644 index 0000000000000000000000000000000000000000..2e9ea638577365d21e3223721a9108a7da963498 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/sbom-spdx.js @@ -0,0 +1,199 @@ + +const crypto = require('node:crypto') +const PackageJson = require('@npmcli/package-json') +const npa = require('npm-package-arg') +const ssri = require('ssri') + +const SPDX_SCHEMA_VERSION = 'SPDX-2.3' +const SPDX_DATA_LICENSE = 'CC0-1.0' +const SPDX_IDENTIFER = 'SPDXRef-DOCUMENT' + +const NO_ASSERTION = 'NOASSERTION' + +const REL_DESCRIBES = 'DESCRIBES' +const REL_PREREQ = 'PREREQUISITE_FOR' +const REL_OPTIONAL = 'OPTIONAL_DEPENDENCY_OF' +const REL_DEV = 'DEV_DEPENDENCY_OF' +const REL_DEP = 'DEPENDENCY_OF' + +const REF_CAT_PACKAGE_MANAGER = 'PACKAGE-MANAGER' +const REF_TYPE_PURL = 'purl' + +const spdxOutput = ({ npm, nodes, packageType }) => { + const rootNode = nodes.find(node => node.isRoot) + const childNodes = nodes.filter(node => !node.isRoot && !node.isLink) + const rootID = rootNode.pkgid + const uuid = crypto.randomUUID() + const ns = `http://spdx.org/spdxdocs/${npa(rootID).escapedName}-${rootNode.version}-${uuid}` + + // Create list of child nodes w/ unique IDs + const childNodeMap = new Map() + for (const item of childNodes) { + const id = toSpdxID(item) + if (!childNodeMap.has(id)) { + childNodeMap.set(id, item) + } + } + const uniqueChildNodes = Array.from(childNodeMap.values()) + + const relationships = [] + const seen = new Set() + for (let node of nodes) { + if (node.isLink) { + node = node.target + } + + if (seen.has(node)) { + continue + } + seen.add(node) + + const rels = [...node.edgesOut.values()] + // Filter out edges that are linking to nodes not in the list + .filter(edge => nodes.find(n => n === edge.to)) + .map(edge => toSpdxRelationship(node, edge)) + .filter(rel => rel) + + relationships.push(...rels) + } + + const extraRelationships = nodes.filter(node => node.extraneous) + .map(node => toSpdxRelationship(rootNode, { to: node, type: 'optional' })) + + relationships.push(...extraRelationships) + + const bom = { + spdxVersion: SPDX_SCHEMA_VERSION, + dataLicense: SPDX_DATA_LICENSE, + SPDXID: SPDX_IDENTIFER, + name: rootID, + documentNamespace: ns, + creationInfo: { + created: new Date().toISOString(), + creators: [ + `Tool: npm/cli-${npm.version}`, + ], + }, + documentDescribes: [toSpdxID(rootNode)], + packages: [toSpdxItem(rootNode, { packageType }), ...uniqueChildNodes.map(toSpdxItem)], + relationships: [ + { + spdxElementId: SPDX_IDENTIFER, + relatedSpdxElement: toSpdxID(rootNode), + relationshipType: REL_DESCRIBES, + }, + ...relationships, + ], + } + + return bom +} + +const toSpdxItem = (node, { packageType }) => { + const toNormalize = new PackageJson() + toNormalize.fromContent(node.package).normalize({ steps: ['normalizeData'] }) + node.package = toNormalize.content + + // Calculate purl from package spec + let spec = npa(node.pkgid) + spec = (spec.type === 'alias') ? spec.subSpec : spec + const purl = npa.toPurl(spec) + (isGitNode(node) ? `?vcs_url=${node.resolved}` : '') + + /* For workspace nodes, use the location from their linkNode */ + let location = node.location + if (node.isWorkspace && node.linksIn.size > 0) { + location = node.linksIn.values().next().value.location + } + + let license = node.package?.license + if (license) { + if (typeof license === 'object') { + license = license.type + } + } else if (Array.isArray(node.package?.licenses)) { + license = node.package.licenses + .map(l => (typeof l === 'object' ? l.type : l)) + .filter(Boolean) + .join(' OR ') + } + + const pkg = { + name: node.packageName, + SPDXID: toSpdxID(node), + versionInfo: node.version, + packageFileName: location, + description: node.package?.description || undefined, + primaryPackagePurpose: packageType ? packageType.toUpperCase() : undefined, + downloadLocation: (node.isLink ? undefined : node.resolved) || NO_ASSERTION, + filesAnalyzed: false, + homepage: node.package?.homepage || NO_ASSERTION, + licenseDeclared: license || NO_ASSERTION, + externalRefs: [ + { + referenceCategory: REF_CAT_PACKAGE_MANAGER, + referenceType: REF_TYPE_PURL, + referenceLocator: purl, + }, + ], + } + + if (node.integrity) { + const integrity = ssri.parse(node.integrity, { single: true }) + pkg.checksums = [{ + algorithm: integrity.algorithm.toUpperCase(), + checksumValue: integrity.hexDigest(), + }] + } + return pkg +} + +const toSpdxRelationship = (node, edge) => { + let type + switch (edge.type) { + case 'peer': + type = REL_PREREQ + break + case 'optional': + type = REL_OPTIONAL + break + case 'dev': + type = REL_DEV + break + default: + type = REL_DEP + } + + return { + spdxElementId: toSpdxID(edge.to), + relatedSpdxElement: toSpdxID(node), + relationshipType: type, + } +} + +const toSpdxID = (node) => { + let name = node.packageName + + // Strip leading @ for scoped packages + name = name.replace(/^@/, '') + + // Replace slashes with dots + name = name.replace(/\//g, '.') + + return `SPDXRef-Package-${name}-${node.version}` +} + +const isGitNode = (node) => { + if (!node.resolved) { + return + } + + try { + const { type } = npa(node.resolved) + return type === 'git' || type === 'hosted' + } catch { + /* istanbul ignore next */ + return false + } +} + +module.exports = { spdxOutput } diff --git a/node24/node_modules/npm/lib/utils/tar.js b/node24/node_modules/npm/lib/utils/tar.js new file mode 100644 index 0000000000000000000000000000000000000000..14ad3db0aeb1bb7c941b96cb701c243fd358aeec --- /dev/null +++ b/node24/node_modules/npm/lib/utils/tar.js @@ -0,0 +1,109 @@ +const tar = require('tar') +const ssri = require('ssri') +const { log, output } = require('proc-log') +const formatBytes = require('./format-bytes.js') +const localeCompare = require('@isaacs/string-locale-compare')('en', { + sensitivity: 'case', + numeric: true, +}) + +const logTar = (tarball, { unicode = false, json, key } = {}) => { + if (json) { + output.buffer(key == null ? tarball : { [key]: tarball }) + return + } + log.notice('') + log.notice('', `${unicode ? '📦 ' : 'package:'} ${tarball.name}@${tarball.version}`) + log.notice('Tarball Contents') + if (tarball.files.length) { + log.notice( + '', + tarball.files.map(f => + /^node_modules\//.test(f.path) ? null : `${formatBytes(f.size, false)} ${f.path}` + ).filter(f => f).join('\n') + ) + } + if (tarball.bundled.length) { + log.notice('Bundled Dependencies') + tarball.bundled.forEach(name => log.notice('', name)) + } + log.notice('Tarball Details') + log.notice('', `name: ${tarball.name}`) + log.notice('', `version: ${tarball.version}`) + if (tarball.filename) { + log.notice('', `filename: ${tarball.filename}`) + } + log.notice('', `package size: ${formatBytes(tarball.size)}`) + log.notice('', `unpacked size: ${formatBytes(tarball.unpackedSize)}`) + log.notice('', `shasum: ${tarball.shasum}`) + log.notice('', `integrity: ${tarball.integrity.toString().slice(0, 20)}[...]${tarball.integrity.toString().slice(80)}`) + if (tarball.bundled.length) { + log.notice('', `bundled deps: ${tarball.bundled.length}`) + log.notice('', `bundled files: ${tarball.entryCount - tarball.files.length}`) + log.notice('', `own files: ${tarball.files.length}`) + } + log.notice('', `total files: ${tarball.entryCount}`) + log.notice('', '') +} + +const getContents = async (manifest, tarball) => { + const files = [] + const bundled = new Set() + let totalEntries = 0 + let totalEntrySize = 0 + + // reads contents of tarball + const stream = tar.t({ + onentry (entry) { + totalEntries++ + totalEntrySize += entry.size + const p = entry.path + if (p.startsWith('package/node_modules/') && p !== 'package/node_modules/') { + const name = p.match(/^package\/node_modules\/((?:@[^/]+\/)?[^/]+)/)[1] + bundled.add(name) + } + files.push({ + path: entry.path.replace(/^package\//, ''), + size: entry.size, + mode: entry.mode, + }) + }, + }) + stream.end(tarball) + + const integrity = ssri.fromData(tarball, { + algorithms: ['sha1', 'sha512'], + }) + + const comparator = ({ path: a }, { path: b }) => localeCompare(a, b) + + const isUpper = str => { + const ch = str.charAt(0) + return ch === ch.toUpperCase() + } + + const uppers = files.filter(file => isUpper(file.path)) + const others = files.filter(file => !isUpper(file.path)) + + uppers.sort(comparator) + others.sort(comparator) + + const shasum = integrity.sha1[0].hexDigest() + return { + id: manifest._id || `${manifest.name}@${manifest.version}`, + name: manifest.name, + version: manifest.version, + size: tarball.length, + unpackedSize: totalEntrySize, + shasum, + integrity: ssri.parse(integrity.sha512[0]), + // @scope/packagename.tgz => scope-packagename.tgz + // we can safely use these global replace rules due to npm package naming rules + filename: `${manifest.name.replace('@', '').replace('/', '-')}-${manifest.version}.tgz`, + files: uppers.concat(others), + entryCount: totalEntries, + bundled: Array.from(bundled), + } +} + +module.exports = { logTar, getContents } diff --git a/node24/node_modules/npm/lib/utils/timers.js b/node24/node_modules/npm/lib/utils/timers.js new file mode 100644 index 0000000000000000000000000000000000000000..3274474000a99d2e389c5e0317a4756fedd6d33a --- /dev/null +++ b/node24/node_modules/npm/lib/utils/timers.js @@ -0,0 +1,89 @@ +const EE = require('node:events') +const fs = require('node:fs') +const { log, time } = require('proc-log') + +const INITIAL_TIMER = 'npm' + +class Timers extends EE { + #file + #timing + + #unfinished = new Map() + #finished = {} + + constructor () { + super() + this.on() + time.start(INITIAL_TIMER) + this.started = this.#unfinished.get(INITIAL_TIMER) + } + + on () { + process.on('time', this.#timeHandler) + } + + off () { + process.off('time', this.#timeHandler) + } + + load ({ path, timing } = {}) { + this.#timing = timing + this.#file = `${path}timing.json` + } + + finish (metadata) { + time.end(INITIAL_TIMER) + + for (const [name, timer] of this.#unfinished) { + log.silly('unfinished npm timer', name, timer) + } + + if (!this.#timing) { + // Not in timing mode, nothing else to do here + return + } + + try { + this.#writeFile(metadata) + log.info('timing', `Timing info written to: ${this.#file}`) + } catch (e) { + log.warn('timing', `could not write timing file: ${e}`) + } + } + + #writeFile (metadata) { + const globalStart = this.started + const globalEnd = this.#finished[INITIAL_TIMER] + const content = { + metadata, + timers: this.#finished, + // add any unfinished timers with their relative start/end + unfinishedTimers: [...this.#unfinished.entries()].reduce((acc, [name, start]) => { + acc[name] = [start - globalStart, globalEnd - globalStart] + return acc + }, {}), + } + fs.writeFileSync(this.#file, JSON.stringify(content) + '\n') + } + + #timeHandler = (level, name) => { + const now = Date.now() + switch (level) { + case time.KEYS.start: + this.#unfinished.set(name, now) + break + case time.KEYS.end: { + if (this.#unfinished.has(name)) { + const ms = now - this.#unfinished.get(name) + this.#finished[name] = ms + this.#unfinished.delete(name) + log.timing(name, `Completed in ${ms}ms`) + } else { + log.silly('timing', `Tried to end timer that doesn't exist: ${name}`) + } + } + } + } +} + +module.exports = Timers diff --git a/node24/node_modules/npm/lib/utils/update-workspaces.js b/node24/node_modules/npm/lib/utils/update-workspaces.js new file mode 100644 index 0000000000000000000000000000000000000000..4fc9467d5671a855a63c5f4b04093effb98d21a4 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/update-workspaces.js @@ -0,0 +1,37 @@ +'use strict' + +const reifyFinish = require('../utils/reify-finish.js') + +async function updateWorkspaces ({ + config, + flatOptions, + localPrefix, + npm, + workspaces, +}) { + if (!flatOptions.workspacesUpdate || !workspaces.length) { + return + } + + // default behavior is to not save by default in order to avoid race condition problems when publishing multiple workspaces that have dependencies on one another + // it might still be useful in some cases, which then need to set --save + const save = config.isDefault('save') + ? false + : config.get('save') + + // runs a minimalistic reify update, targeting only the workspaces that had version updates and skipping fund/audit/save + const opts = { + ...flatOptions, + audit: false, + fund: false, + path: localPrefix, + save, + } + const Arborist = require('@npmcli/arborist') + const arb = new Arborist(opts) + + await arb.reify({ ...opts, update: workspaces }) + await reifyFinish(npm, arb) +} + +module.exports = updateWorkspaces diff --git a/node24/node_modules/npm/lib/utils/validate-lockfile.js b/node24/node_modules/npm/lib/utils/validate-lockfile.js new file mode 100644 index 0000000000000000000000000000000000000000..addd6e2944523b70039ff5b3fda6e16b6f0cdf3b --- /dev/null +++ b/node24/node_modules/npm/lib/utils/validate-lockfile.js @@ -0,0 +1,29 @@ +// compares the inventory of package items in the tree +// that is about to be installed (idealTree) with the inventory +// of items stored in the package-lock file (virtualTree) +// +// Returns empty array if no errors found or an array populated +// with an entry for each validation error found. +function validateLockfile (virtualTree, idealTree) { + const errors = [] + + // loops through the inventory of packages resulted by ideal tree, + // for each package compares the versions with the version stored in the + // package-lock and adds an error to the list in case of mismatches + for (const [key, entry] of idealTree.entries()) { + const lock = virtualTree.get(key) + + if (!lock) { + errors.push(`Missing: ${entry.name}@${entry.version} from lock file`) + continue + } + + if (entry.version !== lock.version) { + errors.push(`Invalid: lock file's ${lock.name}@${lock.version} does ` + + `not satisfy ${entry.name}@${entry.version}`) + } + } + return errors +} + +module.exports = validateLockfile diff --git a/node24/node_modules/npm/lib/utils/verify-signatures.js b/node24/node_modules/npm/lib/utils/verify-signatures.js new file mode 100644 index 0000000000000000000000000000000000000000..a3691941dbc64dd84f2eefa10ce83907751c3a43 --- /dev/null +++ b/node24/node_modules/npm/lib/utils/verify-signatures.js @@ -0,0 +1,392 @@ +const npmFetch = require('npm-registry-fetch') +const localeCompare = require('@isaacs/string-locale-compare')('en') +const npa = require('npm-package-arg') +const pacote = require('pacote') +const tufClient = require('@sigstore/tuf') +const { log, output } = require('proc-log') + +const sortAlphabetically = (a, b) => localeCompare(a.name, b.name) + +class VerifySignatures { + constructor (tree, filterSet, npm, opts) { + this.tree = tree + this.filterSet = filterSet + this.npm = npm + this.opts = opts + this.keys = new Map() + this.invalid = [] + this.missing = [] + this.checkedPackages = new Set() + this.verified = [] + this.auditedWithKeysCount = 0 + this.verifiedSignatureCount = 0 + this.verifiedAttestationCount = 0 + this.exitCode = 0 + } + + async run () { + const start = process.hrtime.bigint() + const { default: pMap } = await import('p-map') + + // Find all deps in tree + const { edges, registries } = this.getEdgesOut(this.tree.inventory.values(), this.filterSet) + if (edges.size === 0) { + throw new Error('found no installed dependencies to audit') + } + + const tuf = await tufClient.initTUF({ + cachePath: this.opts.tufCache, + retry: this.opts.retry, + timeout: this.opts.timeout, + }) + await Promise.all([...registries].map(registry => this.setKeys({ registry, tuf }))) + + log.verbose('verifying registry signatures') + await pMap(edges, (e) => this.getVerifiedInfo(e), { concurrency: 20, stopOnError: true }) + + // Didn't find any dependencies that could be verified, e.g. only local deps, missing version, not on a registry etc. + if (!this.auditedWithKeysCount && !this.verifiedAttestationCount) { + throw new Error('found no dependencies to audit that were installed from ' + + 'a supported registry') + } + + const invalid = this.invalid.sort(sortAlphabetically) + const missing = this.missing.sort(sortAlphabetically) + + const hasNoInvalidOrMissing = invalid.length === 0 && missing.length === 0 + + if (!hasNoInvalidOrMissing) { + process.exitCode = 1 + } + + if (this.npm.config.get('json')) { + const result = { invalid, missing } + if (this.npm.config.get('include-attestations')) { + result.verified = this.verified + } + output.buffer(result) + return + } + const end = process.hrtime.bigint() + const elapsed = end - start + + const auditedPlural = this.auditedWithKeysCount > 1 ? 's' : '' + const timing = `audited ${this.auditedWithKeysCount} package${auditedPlural} in ` + + `${Math.floor(Number(elapsed) / 1e9)}s` + output.standard(timing) + output.standard() + + const verifiedBold = this.npm.chalk.bold('verified') + if (this.verifiedSignatureCount) { + if (this.verifiedSignatureCount === 1) { + output.standard(`${this.verifiedSignatureCount} package has a ${verifiedBold} registry signature`) + } else { + output.standard(`${this.verifiedSignatureCount} packages have ${verifiedBold} registry signatures`) + } + output.standard() + } + + if (this.verifiedAttestationCount) { + if (this.verifiedAttestationCount === 1) { + output.standard(`${this.verifiedAttestationCount} package has a ${verifiedBold} attestation`) + } else { + output.standard(`${this.verifiedAttestationCount} packages have ${verifiedBold} attestations`) + } + if (!this.npm.config.get('include-attestations')) { + output.standard('(use --json --include-attestations to view attestation details)') + } + output.standard() + } + + if (missing.length) { + const missingClr = this.npm.chalk.redBright('missing') + if (missing.length === 1) { + output.standard(`1 package has a ${missingClr} registry signature but the registry is providing signing keys:`) + } else { + output.standard(`${missing.length} packages have ${missingClr} registry signatures but the registry is providing signing keys:`) + } + output.standard() + missing.map(m => + output.standard(`${this.npm.chalk.red(`${m.name}@${m.version}`)} (${m.registry})`) + ) + } + + if (invalid.length) { + if (missing.length) { + output.standard() + } + const invalidClr = this.npm.chalk.redBright('invalid') + // We can have either invalid signatures or invalid provenance + const invalidSignatures = this.invalid.filter(i => i.code === 'EINTEGRITYSIGNATURE') + if (invalidSignatures.length) { + if (invalidSignatures.length === 1) { + output.standard(`1 package has an ${invalidClr} registry signature:`) + } else { + output.standard(`${invalidSignatures.length} packages have ${invalidClr} registry signatures:`) + } + output.standard() + invalidSignatures.map(i => + output.standard(`${this.npm.chalk.red(`${i.name}@${i.version}`)} (${i.registry})`) + ) + output.standard() + } + + const invalidAttestations = this.invalid.filter(i => i.code === 'EATTESTATIONVERIFY') + if (invalidAttestations.length) { + if (invalidAttestations.length === 1) { + output.standard(`1 package has an ${invalidClr} attestation:`) + } else { + output.standard(`${invalidAttestations.length} packages have ${invalidClr} attestations:`) + } + output.standard() + invalidAttestations.map(i => + output.standard(`${this.npm.chalk.red(`${i.name}@${i.version}`)} (${i.registry})`) + ) + output.standard() + } + + if (invalid.length === 1) { + output.standard(`Someone might have tampered with this package since it was published on the registry!`) + } else { + output.standard(`Someone might have tampered with these packages since they were published on the registry!`) + } + output.standard() + } + } + + getEdgesOut (nodes, filterSet) { + const edges = new Set() + const registries = new Set() + for (const node of nodes) { + for (const edge of node.edgesOut.values()) { + const filteredOut = + edge.from + && filterSet + && filterSet.size > 0 + && !filterSet.has(edge.from.target) + + if (!filteredOut) { + const spec = this.getEdgeSpec(edge) + if (spec) { + // Prefetch and cache public keys from used registries + registries.add(this.getSpecRegistry(spec)) + } + edges.add(edge) + } + } + } + return { edges, registries } + } + + async setKeys ({ registry, tuf }) { + const { host, pathname } = new URL(registry) + // Strip any trailing slashes from pathname + const regKey = `${host}${pathname.replace(/\/$/, '')}/keys.json` + let keys = await tuf.getTarget(regKey) + .then((target) => JSON.parse(target)) + .then(({ keys: ks }) => ks.map((key) => ({ + ...key, + keyid: key.keyId, + pemkey: `-----BEGIN PUBLIC KEY-----\n${key.publicKey.rawBytes}\n-----END PUBLIC KEY-----`, + expires: key.publicKey.validFor.end || null, + }))).catch(err => { + if (err.code === 'TUF_FIND_TARGET_ERROR') { + return null + } else { + throw err + } + }) + + // If keys not found in Sigstore TUF repo, fall back to registry keys API + if (!keys) { + log.warn(`Fetching verification keys using TUF failed. Fetching directly from ${registry}.`) + keys = await npmFetch.json('/-/npm/v1/keys', { + ...this.npm.flatOptions, + registry, + }).then(({ keys: ks }) => ks.map((key) => ({ + ...key, + pemkey: `-----BEGIN PUBLIC KEY-----\n${key.key}\n-----END PUBLIC KEY-----`, + }))).catch(err => { + if (err.code === 'E404' || err.code === 'E400') { + return null + } else { + throw err + } + }) + } + + if (keys) { + this.keys.set(registry, keys) + } + } + + getEdgeType (edge) { + return edge.optional ? 'optionalDependencies' + : edge.peer ? 'peerDependencies' + : edge.dev ? 'devDependencies' + : 'dependencies' + } + + getEdgeSpec (edge) { + let name = edge.name + try { + name = npa(edge.spec).subSpec.name + } catch { + // leave it as edge.name + } + try { + return npa(`${name}@${edge.spec}`) + } catch { + // Skip packages with invalid spec + } + } + + buildRegistryConfig (registry) { + const keys = this.keys.get(registry) || [] + const parsedRegistry = new URL(registry) + const regKey = `//${parsedRegistry.host}${parsedRegistry.pathname}` + return { + [`${regKey}:_keys`]: keys, + } + } + + getSpecRegistry (spec) { + return npmFetch.pickRegistry(spec, this.npm.flatOptions) + } + + getValidPackageInfo (edge) { + const type = this.getEdgeType(edge) + // Skip potentially optional packages that are not on disk, as these could + // be omitted during install + if (edge.error === 'MISSING' && type !== 'dependencies') { + return + } + + const spec = this.getEdgeSpec(edge) + // Skip invalid version requirements + if (!spec) { + return + } + const node = edge.to || edge + const { version } = node.package || {} + + if (node.isWorkspace || // Skip local workspaces packages + !version || // Skip packages that don't have an installed version, e.g. optional dependencies + !spec.registry) { // Skip if not from registry, e.g. git package + return + } + + for (const omitType of this.npm.config.get('omit')) { + if (node[omitType]) { + return + } + } + + return { + name: spec.name, + version, + type, + location: node.location, + registry: this.getSpecRegistry(spec), + } + } + + async verifySignatures (name, version, registry) { + const { + _integrity: integrity, + _signatures, + _attestations, + _attestationBundles, + _resolved: resolved, + } = await pacote.manifest(`${name}@${version}`, { + verifySignatures: true, + verifyAttestations: true, + ...this.buildRegistryConfig(registry), + ...this.npm.flatOptions, + }) + const signatures = _signatures || [] + const result = { + integrity, + signatures, + attestations: _attestations, + attestationBundles: _attestationBundles, + resolved, + } + return result + } + + async getVerifiedInfo (edge) { + const info = this.getValidPackageInfo(edge) + if (!info) { + return + } + const { name, version, location, registry, type } = info + if (this.checkedPackages.has(location)) { + // we already did or are doing this one + return + } + this.checkedPackages.add(location) + + // We only "audit" or verify the signature, or the presence of it, on packages whose registry returns signing keys + const keys = this.keys.get(registry) || [] + if (keys.length) { + this.auditedWithKeysCount += 1 + } + + try { + const { integrity, signatures, attestations, attestationBundles, resolved } = + await this.verifySignatures(name, version, registry) + + // Currently we only care about missing signatures on registries that provide a public key + // We could make this configurable in the future with a strict/paranoid mode + if (signatures.length) { + this.verifiedSignatureCount += 1 + } else if (keys.length) { + this.missing.push({ + integrity, + location, + name, + registry, + resolved, + version, + }) + } + + // Track verified attestations separately to registry signatures, as all packages on registries with signing keys are expected to have registry signatures, but not all packages have provenance and publish attestations. + if (attestations) { + this.verifiedAttestationCount += 1 + if (this.npm.config.get('include-attestations')) { + this.verified.push({ + name, + version, + location, + registry, + attestations, + attestationBundles, + }) + } + } + } catch (e) { + if (e.code === 'EINTEGRITYSIGNATURE' || e.code === 'EATTESTATIONVERIFY') { + this.invalid.push({ + code: e.code, + message: e.message, + integrity: e.integrity, + keyid: e.keyid, + location, + name, + registry, + resolved: e.resolved, + signature: e.signature, + predicateType: e.predicateType, + type, + version, + }) + } else { + throw e + } + } + } +} + +module.exports = VerifySignatures diff --git a/node24/node_modules/npm/man/man1/npm-access.1 b/node24/node_modules/npm/man/man1/npm-access.1 new file mode 100644 index 0000000000000000000000000000000000000000..f847572e1ac0b9aad9dd45741a0a1e24273b5a21 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-access.1 @@ -0,0 +1,105 @@ +.TH "NPM-ACCESS" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-access\fR - Set access level on published packages +.SS "Synopsis" +.P +.RS 2 +.nf +npm access list packages \[lB]||\[rB] \[lB]\[rB] +npm access list collaborators \[lB] \[lB]\[rB]\[rB] +npm access get status \[lB]\[rB] +npm access set status=public|private \[lB]\[rB] +npm access set mfa=none|publish|automation \[lB]\[rB] +npm access grant \[lB]\[rB] +npm access revoke \[lB]\[rB] +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +Used to set access controls on private packages. +.P +For all of the subcommands, \fBnpm access\fR will perform actions on the packages in the current working directory if no package name is passed to the subcommand. +.RS 0 +.IP \(bu 4 +grant / revoke: Add or remove the ability of users and teams to have read-only or read-write access to a package. +.RE 0 + +.SS "Details" +.P +\fBnpm access\fR always operates directly on the current registry, configurable from the command line using \fB--registry=\fR. +.P +Unscoped packages are \fIalways public\fR. +.P +Scoped packages \fIdefault to restricted\fR, but you can either publish them as public using \fBnpm publish --access=public\fR, or set their access as public using \fBnpm access set status=public\fR after the initial publish. +.P +You must have privileges to set the access of a package: +.RS 0 +.IP \(bu 4 +You are an owner of an unscoped or scoped package. +.IP \(bu 4 +You are a member of the team that owns a scope. +.IP \(bu 4 +You have been given read-write privileges for a package, either as a member of a team or directly as an owner. +.RE 0 + +.P +If you have two-factor authentication enabled then you'll be prompted to provide a second factor, or may use the \fB--otp=...\fR option to specify it on the command line. +.P +If your account is not paid, then attempts to publish scoped packages will fail with an HTTP 402 status code (logically enough), unless you use \fB--access=public\fR. +.P +Management of teams and team memberships is done with the \fBnpm team\fR command. +.SS "Configuration" +.SS "\fBjson\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to output JSON data, rather than the normal output. +.RS 0 +.IP \(bu 4 +In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. +.RE 0 + +.P +Not supported by all npm commands. +.SS "\fBotp\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with \fBnpm access\fR. +.P +If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "See Also" +.RS 0 +.IP \(bu 4 +\fB\[rs]fBlibnpmaccess\[rs]fR\fR \fI\(lahttps://npm.im/libnpmaccess\(ra\fR +.IP \(bu 4 +npm help team +.IP \(bu 4 +npm help publish +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help registry +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-adduser.1 b/node24/node_modules/npm/man/man1/npm-adduser.1 new file mode 100644 index 0000000000000000000000000000000000000000..dc0877e30ad69d84bbbcaad1be3f440753c0f894 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-adduser.1 @@ -0,0 +1,93 @@ +.TH "NPM-ADDUSER" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-adduser\fR - Add a registry user account +.SS "Synopsis" +.P +.RS 2 +.nf +npm adduser + +alias: add-user +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +Create a new user in the specified registry, and save the credentials to the \fB.npmrc\fR file. If no registry is specified, the default registry will be used (see npm help registry). +.P +When you run \fBnpm adduser\fR, the CLI automatically generates a legacy token of \fBpublish\fR type. For more information, see \fBAbout legacy tokens\fR \fI\(la/about-access-tokens#about-legacy-tokens\(ra\fR. +.P +When using \fBlegacy\fR for your \fBauth-type\fR, the username, password, and email are read in from prompts. +.SS "Configuration" +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "\fBscope\fR" +.RS 0 +.IP \(bu 4 +Default: the scope of the current project, if any, or "" +.IP \(bu 4 +Type: String +.RE 0 + +.P +Associate an operation with a scope for a scoped registry. +.P +Useful when logging in to or out of a private registry: +.P +.RS 2 +.nf +# log in, linking the scope to the custom registry +npm login --scope=@mycorp --registry=https://registry.mycorp.com + +# log out, removing the link and the auth token +npm logout --scope=@mycorp +.fi +.RE +.P +This will cause \fB@mycorp\fR to be mapped to the registry for future installation of packages specified according to the pattern \fB@mycorp/package\fR. +.P +This will also cause \fBnpm init\fR to create a scoped package. +.P +.RS 2 +.nf +# accept all defaults, and create a package named "@foo/whatever", +# instead of just named "whatever" +npm init --scope=@foo --yes +.fi +.RE +.SS "\fBauth-type\fR" +.RS 0 +.IP \(bu 4 +Default: "web" +.IP \(bu 4 +Type: "legacy" or "web" +.RE 0 + +.P +What authentication strategy to use with \fBlogin\fR. Note that if an \fBotp\fR config is given, this value will always be set to \fBlegacy\fR. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help registry +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +npm help owner +.IP \(bu 4 +npm help whoami +.IP \(bu 4 +npm help token +.IP \(bu 4 +npm help profile +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-audit.1 b/node24/node_modules/npm/man/man1/npm-audit.1 new file mode 100644 index 0000000000000000000000000000000000000000..1e7e9efcfc15834e5adb5f160c94fa9b02e35143 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-audit.1 @@ -0,0 +1,466 @@ +.TH "NPM-AUDIT" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-audit\fR - Run a security audit +.SS "Synopsis" +.P +.RS 2 +.nf +npm audit \[lB]fix|signatures\[rB] +.fi +.RE +.SS "Description" +.P +The audit command submits a description of the dependencies configured in your project to your default registry and asks for a report of known vulnerabilities. If any vulnerabilities are found, then the impact and appropriate remediation will be calculated. If the \fBfix\fR argument is provided, then remediations will be applied to the package tree. +.P +The command will exit with a 0 exit code if no vulnerabilities were found. +.P +Note that some vulnerabilities cannot be fixed automatically and will require manual intervention or review. Also note that since \fBnpm audit fix\fR runs a full-fledged \fBnpm install\fR under the hood, all configs that apply to the installer will also apply to \fBnpm install\fR -- so things like \fBnpm audit fix --package-lock-only\fR will work as expected. +.P +By default, the audit command will exit with a non-zero code if any vulnerability is found. It may be useful in CI environments to include the \fB--audit-level\fR parameter to specify the minimum vulnerability level that will cause the command to fail. This option does not filter the report output, it simply changes the command's failure threshold. +.SS "Package lock" +.P +By default npm requires a package-lock or shrinkwrap in order to run the audit. You can bypass the package lock with \fB--no-package-lock\fR but be aware the results may be different with every run, since npm will re-build the dependency tree each time. +.SS "Audit Signatures" +.P +To ensure the integrity of packages you download from the public npm registry, or any registry that supports signatures, you can verify the registry signatures of downloaded packages using the npm CLI. +.P +Registry signatures can be verified using the following \fBaudit\fR command: +.P +.RS 2 +.nf +$ npm audit signatures +.fi +.RE +.P +The \fBaudit signatures\fR command will also verify the provenance attestations of downloaded packages. Because provenance attestations are such a new feature, security features may be added to (or changed in) the attestation format over time. To ensure that you're always able to verify attestation signatures check that you're running the latest version of the npm CLI. Please note this often means updating npm beyond the version that ships with Node.js. +.P +To include the full sigstore attestation bundles in JSON output, use: +.P +.RS 2 +.nf +$ npm audit signatures --json --include-attestations +.fi +.RE +.P +This adds a \fBverified\fR array to the JSON output containing the attestation bundles (DSSE envelopes, verification material, and transparency log entries) for each verified package. +.P +The npm CLI supports registry signatures and signing keys provided by any registry if the following conventions are followed: +.RS 0 +.IP 1. 4 +Signatures are provided in the package's \fBpackument\fR in each published version within the \fBdist\fR object: +.RE 0 + +.P +.RS 2 +.nf +"dist":{ + "..omitted..": "..omitted..", + "signatures": \[lB]{ + "keyid": "SHA256:{{SHA256_PUBLIC_KEY}}", + "sig": "a312b9c3cb4a1b693e8ebac5ee1ca9cc01f2661c14391917dcb111517f72370809..." + }\[rB] +} +.fi +.RE +.P +See this \fBexample\fR \fI\(lahttps://registry.npmjs.org/light-cycle/1.4.3\(ra\fR of a signed package from the public npm registry. +.P +The \fBsig\fR is generated using the following template: \fB${package.name}@${package.version}:${package.dist.integrity}\fR and the \fBkeyid\fR has to match one of the public signing keys below. +.RS 0 +.IP 2. 4 +Public signing keys are provided at \fBregistry-host.tld/-/npm/v1/keys\fR in the following format: +.RE 0 + +.P +.RS 2 +.nf +{ + "keys": \[lB]{ + "expires": null, + "keyid": "SHA256:{{SHA256_PUBLIC_KEY}}", + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "key": "{{B64_PUBLIC_KEY}}" + }\[rB] +} +.fi +.RE +.P +Keys response: +.RS 0 +.IP \(bu 4 +\fBexpires\fR: null or a simplified extended \fBISO 8601 format\fR \fI\(lahttps://en.wikipedia.org/wiki/ISO_8601\(ra\fR: \fBYYYY-MM-DDTHH:mm:ss.sssZ\fR +.IP \(bu 4 +\fBkeyid\fR: sha256 fingerprint of the public key +.IP \(bu 4 +\fBkeytype\fR: only \fBecdsa-sha2-nistp256\fR is currently supported by the npm CLI +.IP \(bu 4 +\fBscheme\fR: only \fBecdsa-sha2-nistp256\fR is currently supported by the npm CLI +.IP \(bu 4 +\fBkey\fR: base64 encoded public key +.RE 0 + +.P +See this \fBexample key's response from the public npm registry\fR \fI\(lahttps://registry.npmjs.org/-/npm/v1/keys\(ra\fR. +.SS "Audit Endpoints" +.P +There are two audit endpoints that npm may use to fetch vulnerability information: the \fBBulk Advisory\fR endpoint and the \fBQuick Audit\fR endpoint. +.SS "Bulk Advisory Endpoint" +.P +As of version 7, npm uses the much faster \fBBulk Advisory\fR endpoint to optimize the speed of calculating audit results. +.P +npm will generate a JSON payload with the name and list of versions of each package in the tree, and POST it to the default configured registry at the path \fB/-/npm/v1/security/advisories/bulk\fR. +.P +Any packages in the tree that do not have a \fBversion\fR field in their package.json file will be ignored. If any \fB--omit\fR options are specified (either via the \fB\[rs]fB--omit\[rs]fR config\fR \fI\(la/using-npm/config#omit\(ra\fR, or one of the shorthands such as \fB--production\fR, \fB--only=dev\fR, and so on), then packages will be omitted from the submitted payload as appropriate. +.P +If the registry responds with an error, or with an invalid response, then npm will attempt to load advisory data from the \fBQuick Audit\fR endpoint. +.P +The expected result will contain a set of advisory objects for each dependency that matches the advisory range. Each advisory object contains a \fBname\fR, \fBurl\fR, \fBid\fR, \fBseverity\fR, \fBvulnerable_versions\fR, and \fBtitle\fR. +.P +npm then uses these advisory objects to calculate vulnerabilities and meta-vulnerabilities of the dependencies within the tree. +.SS "Quick Audit Endpoint" +.P +If the \fBBulk Advisory\fR endpoint returns an error, or invalid data, npm will attempt to load advisory data from the \fBQuick Audit\fR endpoint, which is considerably slower in most cases. +.P +The full package tree as found in \fBpackage-lock.json\fR is submitted, along with the following pieces of additional metadata: +.RS 0 +.IP \(bu 4 +\fBnpm_version\fR +.IP \(bu 4 +\fBnode_version\fR +.IP \(bu 4 +\fBplatform\fR +.IP \(bu 4 +\fBarch\fR +.IP \(bu 4 +\fBnode_env\fR +.RE 0 + +.P +All packages in the tree are submitted to the Quick Audit endpoint. Omitted dependency types are skipped when generating the report. +.SS "Scrubbing" +.P +Out of an abundance of caution, npm versions 5 and 6 would "scrub" any packages from the submitted report if their name contained a \fB/\fR character, so as to avoid leaking the names of potentially private packages or git URLs. +.P +However, in practice, this resulted in audits often failing to properly detect meta-vulnerabilities, because the tree would appear to be invalid due to missing dependencies, and prevented the detection of vulnerabilities in package trees that used git dependencies or private modules. +.P +This scrubbing has been removed from npm as of version 7. +.SS "Calculating Meta-Vulnerabilities and Remediations" +.P +npm uses the \fB\[rs]fB@npmcli/metavuln-calculator\[rs]fR\fR \fI\(lahttp://npm.im/@npmcli/metavuln-calculator\(ra\fR module to turn a set of security advisories into a set of "vulnerability" objects. A "meta-vulnerability" is a dependency that is vulnerable by virtue of dependence on vulnerable versions of a vulnerable package. +.P +For example, if the package \fBfoo\fR is vulnerable in the range \fB>=1.0.2 <2.0.0\fR, and the package \fBbar\fR depends on \fBfoo@^1.1.0\fR, then that version of \fBbar\fR can only be installed by installing a vulnerable version of \fBfoo\fR. In this case, \fBbar\fR is a "metavulnerability". +.P +Once metavulnerabilities for a given package are calculated, they are cached in the \fB~/.npm\fR folder and only re-evaluated if the advisory range changes, or a new version of the package is published (in which case, the new version is checked for metavulnerable status as well). +.P +If the chain of metavulnerabilities extends all the way to the root project, and it cannot be updated without changing its dependency ranges, then \fBnpm audit fix\fR will require the \fB--force\fR option to apply the remediation. If remediations do not require changes to the dependency ranges, then all vulnerable packages will be updated to a version that does not have an advisory or metavulnerability posted against it. +.SS "Exit Code" +.P +The \fBnpm audit\fR command will exit with a 0 exit code if no vulnerabilities were found. The \fBnpm audit fix\fR command will exit with 0 exit code if no vulnerabilities are found \fIor\fR if the remediation is able to successfully fix all vulnerabilities. +.P +If vulnerabilities were found the exit code will depend on the \fB\[rs]fBaudit-level\[rs]fR config\fR \fI\(la/using-npm/config#audit-level\(ra\fR. +.SS "Examples" +.P +Scan your project for vulnerabilities and automatically install any compatible updates to vulnerable dependencies: +.P +.RS 2 +.nf +$ npm audit fix +.fi +.RE +.P +Run \fBaudit fix\fR without modifying \fBnode_modules\fR, but still updating the pkglock: +.P +.RS 2 +.nf +$ npm audit fix --package-lock-only +.fi +.RE +.P +Skip updating \fBdevDependencies\fR: +.P +.RS 2 +.nf +$ npm audit fix --only=prod +.fi +.RE +.P +Have \fBaudit fix\fR install SemVer-major updates to toplevel dependencies, not just SemVer-compatible ones: +.P +.RS 2 +.nf +$ npm audit fix --force +.fi +.RE +.P +Do a dry run to get an idea of what \fBaudit fix\fR will do, and \fIalso\fR output install information in JSON format: +.P +.RS 2 +.nf +$ npm audit fix --dry-run --json +.fi +.RE +.P +Scan your project for vulnerabilities and just show the details, without fixing anything: +.P +.RS 2 +.nf +$ npm audit +.fi +.RE +.P +Get the detailed audit report in JSON format: +.P +.RS 2 +.nf +$ npm audit --json +.fi +.RE +.P +Fail an audit only if the results include a vulnerability with a level of moderate or higher: +.P +.RS 2 +.nf +$ npm audit --audit-level=moderate +.fi +.RE +.SS "Configuration" +.SS "\fBaudit-level\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null, "info", "low", "moderate", "high", "critical", or "none" +.RE 0 + +.P +The minimum level of vulnerability for \fBnpm audit\fR to exit with a non-zero exit code. +.SS "\fBdry-run\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. +.P +Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. +.SS "\fBforce\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Removes various protections against unfortunate side effects, common mistakes, unnecessary performance degradation, and malicious input. +.RS 0 +.IP \(bu 4 +Allow clobbering non-npm files in global installs. +.IP \(bu 4 +Allow the \fBnpm version\fR command to work on an unclean git repository. +.IP \(bu 4 +Allow deleting the cache folder with \fBnpm cache clean\fR. +.IP \(bu 4 +Allow installing packages that have an \fBengines\fR declaration requiring a different version of npm. +.IP \(bu 4 +Allow installing packages that have an \fBengines\fR declaration requiring a different version of \fBnode\fR, even if \fB--engine-strict\fR is enabled. +.IP \(bu 4 +Allow \fBnpm audit fix\fR to install modules outside your stated dependency range (including SemVer-major changes). +.IP \(bu 4 +Allow unpublishing all versions of a published package. +.IP \(bu 4 +Allow conflicting peerDependencies to be installed in the root project. +.IP \(bu 4 +Implicitly set \fB--yes\fR during \fBnpm init\fR. +.IP \(bu 4 +Allow clobbering existing values in \fBnpm pkg\fR +.IP \(bu 4 +Allow unpublishing of entire packages (not just a single version). +.RE 0 + +.P +If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! +.SS "\fBjson\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to output JSON data, rather than the normal output. +.RS 0 +.IP \(bu 4 +In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. +.RE 0 + +.P +Not supported by all npm commands. +.SS "\fBpackage-lock-only\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to true, the current operation will only use the \fBpackage-lock.json\fR, ignoring \fBnode_modules\fR. +.P +For \fBupdate\fR this means only the \fBpackage-lock.json\fR will be updated, instead of checking \fBnode_modules\fR and downloading dependencies. +.P +For \fBlist\fR this means the output will be based on the tree described by the \fBpackage-lock.json\fR, rather than the contents of \fBnode_modules\fR. +.SS "\fBpackage-lock\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to false, then ignore \fBpackage-lock.json\fR files when installing. This will also prevent \fIwriting\fR \fBpackage-lock.json\fR if \fBsave\fR is true. +.SS "\fBomit\fR" +.RS 0 +.IP \(bu 4 +Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production'; otherwise, empty. +.IP \(bu 4 +Type: "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Dependency types to omit from the installation tree on disk. +.P +Note that these dependencies \fIare\fR still resolved and added to the \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR file. They are just not physically installed on disk. +.P +If a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included. +.P +If the resulting omit list includes \fB'dev'\fR, then the \fBNODE_ENV\fR environment variable will be set to \fB'production'\fR for all lifecycle scripts. +.SS "\fBinclude\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: "prod", "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Option that allows for defining which types of dependencies to install. +.P +This is the inverse of \fB--omit=\fR. +.P +Dependency types specified in \fB--include\fR will not be omitted, regardless of the order in which omit/include are specified on the command-line. +.SS "\fBforeground-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: \fBfalse\fR unless when using \fBnpm pack\fR or \fBnpm publish\fR where it defaults to \fBtrue\fR +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Run all build scripts (ie, \fBpreinstall\fR, \fBinstall\fR, and \fBpostinstall\fR) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process. +.P +Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "\fBinclude-attestations\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When used with \fBnpm audit signatures --json\fR, includes the full sigstore attestation bundles in the JSON output for each verified package. The bundles contain DSSE envelopes, verification material, and transparency log entries. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBinstall-links\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help config +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-bugs.1 b/node24/node_modules/npm/man/man1/npm-bugs.1 new file mode 100644 index 0000000000000000000000000000000000000000..4f43c9533a063c3f1ff547da0230c6d7340e0b43 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-bugs.1 @@ -0,0 +1,115 @@ +.TH "NPM-BUGS" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-bugs\fR - Report bugs for a package in a web browser +.SS "Synopsis" +.P +.RS 2 +.nf +npm bugs \[lB] \[lB] ...\[rB]\[rB] + +alias: issues +.fi +.RE +.SS "Description" +.P +This command tries to guess at the likely location of a package's bug tracker URL or the \fBmailto\fR URL of the support email, and then tries to open it using the \fB\[rs]fB--browser\[rs]fR config\fR \fI\(la/using-npm/config#browser\(ra\fR param. If no package name is provided, it will search for a \fBpackage.json\fR in the current folder and use the \fBname\fR property. +.SS "Configuration" +.SS "\fBbrowser\fR" +.RS 0 +.IP \(bu 4 +Default: macOS: \fB"open"\fR, Windows: \fB"start"\fR, Others: \fB"xdg-open"\fR +.IP \(bu 4 +Type: null, Boolean, or String +.RE 0 + +.P +The browser that is called by npm commands to open websites. +.P +Set to \fBfalse\fR to suppress browser behavior and instead print urls to terminal. +.P +Set to \fBtrue\fR to use default system URL opener. +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help docs +.IP \(bu 4 +npm help view +.IP \(bu 4 +npm help publish +.IP \(bu 4 +npm help registry +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +\fBpackage.json\fR \fI\(la/configuring-npm/package-json\(ra\fR +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-cache.1 b/node24/node_modules/npm/man/man1/npm-cache.1 new file mode 100644 index 0000000000000000000000000000000000000000..6cd49eea12993705ffdac651ff394ec47fc93362 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-cache.1 @@ -0,0 +1,95 @@ +.TH "NPM-CACHE" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-cache\fR - Manipulates packages cache +.SS "Synopsis" +.P +.RS 2 +.nf +npm cache add +npm cache clean \[lB]\[rB] +npm cache ls \[lB]@\[rB] +npm cache verify +npm cache npx ls +npm cache npx rm \[lB]...\[rB] +npm cache npx info ... +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +Used to add, list, or clean the \fBnpm cache\fR folder. Also used to view info about entries in the \fBnpm exec\fR (aka \fBnpx\fR) cache folder. +.SS "\fBnpm cache\fR" +.RS 0 +.IP \(bu 4 +add: Add the specified packages to the local cache. This command is primarily intended to be used internally by npm, but it can provide a way to add data to the local installation cache explicitly. +.IP \(bu 4 +clean: Delete a single entry or all entries out of the cache folder. Note that this is typically unnecessary, as npm's cache is self-healing and resistant to data corruption issues. +.IP \(bu 4 +ls: List given entries or all entries in the local cache. +.IP \(bu 4 +verify: Verify the contents of the cache folder, garbage collecting any unneeded data, and verifying the integrity of the cache index and all cached data. +.RE 0 + +.SS "\fBnpm cache npx\fR" +.RS 0 +.IP \(bu 4 +ls: List all entries in the npx cache. +.IP \(bu 4 +rm: Remove given entries or all entries from the npx cache. +.IP \(bu 4 +info: Get detailed information about given entries in the npx cache. +.RE 0 + +.SS "Details" +.P +npm stores cache data in an opaque directory within the configured \fBcache\fR, named \fB_cacache\fR. This directory is a \fB\[rs]fBcacache\[rs]fR\fR \fI\(lahttp://npm.im/cacache\(ra\fR-based content-addressable cache that stores all http request data as well as other package-related data. This directory is primarily accessed through \fBpacote\fR, the library responsible for all package fetching as of npm@5. +.P +All data that passes through the cache is fully verified for integrity on both insertion and extraction. Cache corruption will either trigger an error, or signal to \fBpacote\fR that the data must be refetched, which it will do automatically. For this reason, it should never be necessary to clear the cache for any reason other than reclaiming disk space, thus why \fBclean\fR now requires \fB--force\fR to run. +.P +There is currently no method exposed through npm to inspect or directly manage the contents of this cache. In order to access it, \fBcacache\fR must be used directly. +.P +npm will not remove data by itself: the cache will grow as new packages are installed. +.SS "A note about the cache's design" +.P +The npm cache is strictly a cache: it should not be relied upon as a persistent and reliable data store for package data. npm makes no guarantee that a previously-cached piece of data will be available later, and will automatically delete corrupted contents. The primary guarantee that the cache makes is that, if it does return data, that data will be exactly the data that was inserted. +.P +To run an offline verification of existing cache contents, use \fBnpm cache verify\fR. +.SS "Configuration" +.SS "\fBcache\fR" +.RS 0 +.IP \(bu 4 +Default: Windows: \fB%LocalAppData%\[rs]npm-cache\fR, Posix: \fB~/.npm\fR +.IP \(bu 4 +Type: Path +.RE 0 + +.P +The location of npm's cache directory. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "package spec" +.IP \(bu 4 +npm help folders +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help publish +.IP \(bu 4 +npm help pack +.IP \(bu 4 +npm help exec +.IP \(bu 4 +https://npm.im/cacache +.IP \(bu 4 +https://npm.im/pacote +.IP \(bu 4 +https://npm.im/@npmcli/arborist +.IP \(bu 4 +https://npm.im/make-fetch-happen +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-ci.1 b/node24/node_modules/npm/man/man1/npm-ci.1 new file mode 100644 index 0000000000000000000000000000000000000000..a2bc3fa210c4a3882f82a069b643e51c7416311b --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-ci.1 @@ -0,0 +1,301 @@ +.TH "NPM-CI" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-ci\fR - Clean install a project +.SS "Synopsis" +.P +.RS 2 +.nf +npm ci + +aliases: clean-install, ic, install-clean, isntall-clean +.fi +.RE +.SS "Description" +.P +This command is similar to npm help install, except it's meant to be used in automated environments such as test platforms, continuous integration, and deployment -- or any situation where you want to make sure you're doing a clean install of your dependencies. +.P +The main differences between using \fBnpm install\fR and \fBnpm ci\fR are: +.RS 0 +.IP \(bu 4 +The project \fBmust\fR have an existing \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR. +.IP \(bu 4 +If dependencies in the package lock do not match those in \fBpackage.json\fR, \fBnpm ci\fR will exit with an error, instead of updating the package lock. +.IP \(bu 4 +\fBnpm ci\fR can only install entire projects at a time: individual dependencies cannot be added with this command. +.IP \(bu 4 +If a \fBnode_modules\fR is already present, it will be automatically removed before \fBnpm ci\fR begins its install. +.IP \(bu 4 +It will never write to \fBpackage.json\fR or any of the package-locks: installs are essentially frozen. +.RE 0 + +.P +NOTE: If you create your \fBpackage-lock.json\fR file by running \fBnpm install\fR with flags that can affect the shape of your dependency tree, such as \fB--legacy-peer-deps\fR or \fB--install-links\fR, you \fImust\fR provide the same flags to \fBnpm ci\fR or you are likely to encounter errors. An easy way to do this is to run, for example, \fBnpm config set legacy-peer-deps=true --location=project\fR and commit the \fB.npmrc\fR file to your repo. +.SS "Example" +.P +Make sure you have a package-lock and an up-to-date install: +.P +.RS 2 +.nf +$ cd ./my/npm/project +$ npm install +added 154 packages in 10s +$ ls | grep package-lock +.fi +.RE +.P +Run \fBnpm ci\fR in that project +.P +.RS 2 +.nf +$ npm ci +added 154 packages in 5s +.fi +.RE +.P +Configure Travis CI to build using \fBnpm ci\fR instead of \fBnpm install\fR: +.P +.RS 2 +.nf +# .travis.yml +install: +- npm ci +# keep the npm cache around to speed up installs +cache: + directories: + - "$HOME/.npm" +.fi +.RE +.SS "Configuration" +.SS "\fBinstall-strategy\fR" +.RS 0 +.IP \(bu 4 +Default: "hoisted" +.IP \(bu 4 +Type: "hoisted", "nested", "shallow", or "linked" +.RE 0 + +.P +Sets the strategy for installing packages in node_modules. hoisted (default): Install non-duplicated in top-level, and duplicated as necessary within directory structure. nested: (formerly --legacy-bundling) install in place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. +.SS "\fBlegacy-bundling\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=nested\fR +.RE 0 + +.P +Instead of hoisting package installs in \fBnode_modules\fR, install packages in the same manner that they are depended on. This may cause very deep directory structures and duplicate package installs as there is no de-duplicating. Sets \fB--install-strategy=nested\fR. +.SS "\fBglobal-style\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=shallow\fR +.RE 0 + +.P +Only install direct dependencies in the top level \fBnode_modules\fR, but hoist on deeper dependencies. Sets \fB--install-strategy=shallow\fR. +.SS "\fBomit\fR" +.RS 0 +.IP \(bu 4 +Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production'; otherwise, empty. +.IP \(bu 4 +Type: "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Dependency types to omit from the installation tree on disk. +.P +Note that these dependencies \fIare\fR still resolved and added to the \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR file. They are just not physically installed on disk. +.P +If a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included. +.P +If the resulting omit list includes \fB'dev'\fR, then the \fBNODE_ENV\fR environment variable will be set to \fB'production'\fR for all lifecycle scripts. +.SS "\fBinclude\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: "prod", "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Option that allows for defining which types of dependencies to install. +.P +This is the inverse of \fB--omit=\fR. +.P +Dependency types specified in \fB--include\fR will not be omitted, regardless of the order in which omit/include are specified on the command-line. +.SS "\fBstrict-peer-deps\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to \fBtrue\fR, and \fB--legacy-peer-deps\fR is not set, then \fIany\fR conflicting \fBpeerDependencies\fR will be treated as an install failure, even if npm could reasonably guess the appropriate resolution based on non-peer dependency relationships. +.P +By default, conflicting \fBpeerDependencies\fR deep in the dependency graph will be resolved using the nearest non-peer dependency specification, even if doing so will result in some packages receiving a peer dependency outside the range set in their package's \fBpeerDependencies\fR object. +.P +When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If \fB--strict-peer-deps\fR is set, then this warning is treated as a failure. +.SS "\fBforeground-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: \fBfalse\fR unless when using \fBnpm pack\fR or \fBnpm publish\fR where it defaults to \fBtrue\fR +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Run all build scripts (ie, \fBpreinstall\fR, \fBinstall\fR, and \fBpostinstall\fR) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process. +.P +Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "\fBallow-git\fR" +.RS 0 +.IP \(bu 4 +Default: "all" +.IP \(bu 4 +Type: "all", "none", or "root" +.RE 0 + +.P +Limits the ability for npm to fetch dependencies from git references. That is, dependencies that point to a git repo instead of a version or semver range. Please note that this could leave your tree incomplete and some packages may not function as intended or designed. +.P +\fBall\fR allows any git dependencies to be fetched and installed. \fBnone\fR prevents any git dependencies from being fetched and installed. \fBroot\fR only allows git dependencies defined in your project's package.json to be fetched installed. Also allows git dependencies to be fetched for other commands like \fBnpm view\fR +.SS "\fBaudit\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When "true" submit audit reports alongside the current npm command to the default registry and all registries configured for scopes. See the documentation for npm help audit for details on what is submitted. +.SS "\fBbin-links\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Tells npm to create symlinks (or \fB.cmd\fR shims on Windows) for package executables. +.P +Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems. +.SS "\fBfund\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When "true" displays the message at the end of each \fBnpm install\fR acknowledging the number of dependencies looking for funding. See npm help fund for details. +.SS "\fBdry-run\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. +.P +Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBinstall-links\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help install +.IP \(bu 4 +\fBpackage-lock.json\fR \fI\(la/configuring-npm/package-lock-json\(ra\fR +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-completion.1 b/node24/node_modules/npm/man/man1/npm-completion.1 new file mode 100644 index 0000000000000000000000000000000000000000..953cc91ad0e044c3a2e9857e4536935a406260ba --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-completion.1 @@ -0,0 +1,35 @@ +.TH "NPM-COMPLETION" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-completion\fR - Tab Completion for npm +.SS "Synopsis" +.P +.RS 2 +.nf +npm completion +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +Enables tab-completion in all npm commands. +.P +The synopsis above loads the completions into your current shell. Adding it to your ~/.bashrc or ~/.zshrc will make the completions available everywhere: +.P +.RS 2 +.nf +npm completion >> ~/.bashrc +npm completion >> ~/.zshrc +.fi +.RE +.P +You may of course also pipe the output of \fBnpm completion\fR to a file such as \fB/usr/local/etc/bash_completion.d/npm\fR or \fB/etc/bash_completion.d/npm\fR if you have a system that will read that file for you. +.P +When \fBCOMP_CWORD\fR, \fBCOMP_LINE\fR, and \fBCOMP_POINT\fR are defined in the environment, \fBnpm completion\fR acts in "plumbing mode", and outputs completions based on the arguments. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help developers +.IP \(bu 4 +npm help npm +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-config.1 b/node24/node_modules/npm/man/man1/npm-config.1 new file mode 100644 index 0000000000000000000000000000000000000000..cecc2aca97db6794eca2a22db269350a3b5067e8 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-config.1 @@ -0,0 +1,186 @@ +.TH "NPM-CONFIG" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-config\fR - Manage the npm configuration files +.SS "Synopsis" +.P +.RS 2 +.nf +npm config set = \[lB]= ...\[rB] +npm config get \[lB] \[lB] ...\[rB]\[rB] +npm config delete \[lB] ...\[rB] +npm config list \[lB]--json\[rB] +npm config edit +npm config fix + +alias: c +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +npm gets its config settings from the command line, environment variables, \fBnpmrc\fR files, and in some cases, the \fBpackage.json\fR file. +.P +See npm help npmrc for more information about the npmrc files. +.P +See npm help config for a more thorough explanation of the mechanisms involved, and a full list of config options available. +.P +The \fBnpm config\fR command can be used to update and edit the contents of the user and global npmrc files. +.SS "Sub-commands" +.P +Config supports the following sub-commands: +.SS "set" +.P +.RS 2 +.nf +npm config set key=value \[lB]key=value...\[rB] +npm set key=value \[lB]key=value...\[rB] +.fi +.RE +.P +Sets each of the config keys to the value provided. Modifies the user configuration file unless \fB\[rs]fBlocation\[rs]fR\fR \fI\(la/commands/npm-config#location\(ra\fR is passed. +.P +If value is omitted, the key will be removed from your config file entirely. +.P +Note: for backwards compatibility, \fBnpm config set key value\fR is supported as an alias for \fBnpm config set key=value\fR. +.SS "get" +.P +.RS 2 +.nf +npm config get \[lB]key ...\[rB] +npm get \[lB]key ...\[rB] +.fi +.RE +.P +Echo the config value(s) to stdout. +.P +If multiple keys are provided, then the values will be prefixed with the key names. +.P +If no keys are provided, then this command behaves the same as \fBnpm config list\fR. +.SS "list" +.P +.RS 2 +.nf +npm config list +.fi +.RE +.P +Show all the config settings. Use \fB-l\fR to also show defaults. Use \fB--json\fR to show the settings in json format. +.SS "delete" +.P +.RS 2 +.nf +npm config delete key \[lB]key ...\[rB] +.fi +.RE +.P +Deletes the specified keys from all configuration files. +.SS "edit" +.P +.RS 2 +.nf +npm config edit +.fi +.RE +.P +Opens the config file in an editor. Use the \fB--global\fR flag to edit the global config. +.SS "fix" +.P +.RS 2 +.nf +npm config fix +.fi +.RE +.P +Attempts to repair invalid configuration items. Usually this means attaching authentication config (i.e. \fB_auth\fR, \fB_authToken\fR) to the configured \fBregistry\fR. +.SS "Configuration" +.SS "\fBjson\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to output JSON data, rather than the normal output. +.RS 0 +.IP \(bu 4 +In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. +.RE 0 + +.P +Not supported by all npm commands. +.SS "\fBglobal\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "\fBeditor\fR" +.RS 0 +.IP \(bu 4 +Default: The EDITOR or VISUAL environment variables, or '%SYSTEMROOT%\[rs]notepad.exe' on Windows, or 'vi' on Unix systems +.IP \(bu 4 +Type: String +.RE 0 + +.P +The command to run for \fBnpm edit\fR and \fBnpm config edit\fR. +.SS "\fBlocation\fR" +.RS 0 +.IP \(bu 4 +Default: "user" unless \fB--global\fR is passed, which will also set this value to "global" +.IP \(bu 4 +Type: "global", "user", or "project" +.RE 0 + +.P +When passed to \fBnpm config\fR this refers to which config file to use. +.P +When set to "global" mode, packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "\fBlong\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Show extended information in \fBls\fR, \fBsearch\fR, and \fBhelp-search\fR. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help folders +.IP \(bu 4 +npm help config +.IP \(bu 4 +\fBpackage.json\fR \fI\(la/configuring-npm/package-json\(ra\fR +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +npm help npm +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-dedupe.1 b/node24/node_modules/npm/man/man1/npm-dedupe.1 new file mode 100644 index 0000000000000000000000000000000000000000..95117b59fcc93169d9e29459bbcc904f299ffa5a --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-dedupe.1 @@ -0,0 +1,302 @@ +.TH "NPM-DEDUPE" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-dedupe\fR - Reduce duplication in the package tree +.SS "Synopsis" +.P +.RS 2 +.nf +npm dedupe + +alias: ddp +.fi +.RE +.SS "Description" +.P +Searches the local package tree and attempts to simplify the overall structure by moving dependencies further up the tree, where they can be more effectively shared by multiple dependent packages. +.P +For example, consider this dependency graph: +.P +.RS 2 +.nf +a ++-- b <-- depends on c@1.0.x +| `-- c@1.0.3 +`-- d <-- depends on c@~1.0.9 + `-- c@1.0.10 +.fi +.RE +.P +In this case, \fBnpm dedupe\fR will transform the tree to: +.P +.RS 2 +.nf +a ++-- b ++-- d +`-- c@1.0.10 +.fi +.RE +.P +Because of the hierarchical nature of node's module lookup, b and d will both get their dependency met by the single c package at the root level of the tree. +.P +In some cases, you may have a dependency graph like this: +.P +.RS 2 +.nf +a ++-- b <-- depends on c@1.0.x ++-- c@1.0.3 +`-- d <-- depends on c@1.x + `-- c@1.9.9 +.fi +.RE +.P +During the installation process, the \fBc@1.0.3\fR dependency for \fBb\fR was placed in the root of the tree. Though \fBd\fR's dependency on \fBc@1.x\fR could have been satisfied by \fBc@1.0.3\fR, the newer \fBc@1.9.9\fR dependency was used, because npm favors updates by default, even when doing so causes duplication. +.P +Running \fBnpm dedupe\fR will cause npm to note the duplication and re-evaluate, deleting the nested \fBc\fR module, because the one in the root is sufficient. +.P +To prefer deduplication over novelty during the installation process, run \fBnpm install --prefer-dedupe\fR or \fBnpm config set prefer-dedupe true\fR. +.P +Arguments are ignored. Dedupe always acts on the entire tree. +.P +Note that this operation transforms the dependency tree, but will never result in new modules being installed. +.P +Using \fBnpm find-dupes\fR will run the command in \fB--dry-run\fR mode. +.P +Note: \fBnpm dedupe\fR will never update the semver values of direct dependencies in your project \fBpackage.json\fR, if you want to update values in \fBpackage.json\fR you can run: \fBnpm update --save\fR instead. +.SS "Configuration" +.SS "\fBinstall-strategy\fR" +.RS 0 +.IP \(bu 4 +Default: "hoisted" +.IP \(bu 4 +Type: "hoisted", "nested", "shallow", or "linked" +.RE 0 + +.P +Sets the strategy for installing packages in node_modules. hoisted (default): Install non-duplicated in top-level, and duplicated as necessary within directory structure. nested: (formerly --legacy-bundling) install in place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. +.SS "\fBlegacy-bundling\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=nested\fR +.RE 0 + +.P +Instead of hoisting package installs in \fBnode_modules\fR, install packages in the same manner that they are depended on. This may cause very deep directory structures and duplicate package installs as there is no de-duplicating. Sets \fB--install-strategy=nested\fR. +.SS "\fBglobal-style\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=shallow\fR +.RE 0 + +.P +Only install direct dependencies in the top level \fBnode_modules\fR, but hoist on deeper dependencies. Sets \fB--install-strategy=shallow\fR. +.SS "\fBstrict-peer-deps\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to \fBtrue\fR, and \fB--legacy-peer-deps\fR is not set, then \fIany\fR conflicting \fBpeerDependencies\fR will be treated as an install failure, even if npm could reasonably guess the appropriate resolution based on non-peer dependency relationships. +.P +By default, conflicting \fBpeerDependencies\fR deep in the dependency graph will be resolved using the nearest non-peer dependency specification, even if doing so will result in some packages receiving a peer dependency outside the range set in their package's \fBpeerDependencies\fR object. +.P +When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If \fB--strict-peer-deps\fR is set, then this warning is treated as a failure. +.SS "\fBpackage-lock\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to false, then ignore \fBpackage-lock.json\fR files when installing. This will also prevent \fIwriting\fR \fBpackage-lock.json\fR if \fBsave\fR is true. +.SS "\fBomit\fR" +.RS 0 +.IP \(bu 4 +Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production'; otherwise, empty. +.IP \(bu 4 +Type: "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Dependency types to omit from the installation tree on disk. +.P +Note that these dependencies \fIare\fR still resolved and added to the \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR file. They are just not physically installed on disk. +.P +If a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included. +.P +If the resulting omit list includes \fB'dev'\fR, then the \fBNODE_ENV\fR environment variable will be set to \fB'production'\fR for all lifecycle scripts. +.SS "\fBinclude\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: "prod", "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Option that allows for defining which types of dependencies to install. +.P +This is the inverse of \fB--omit=\fR. +.P +Dependency types specified in \fB--include\fR will not be omitted, regardless of the order in which omit/include are specified on the command-line. +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "\fBallow-git\fR" +.RS 0 +.IP \(bu 4 +Default: "all" +.IP \(bu 4 +Type: "all", "none", or "root" +.RE 0 + +.P +Limits the ability for npm to fetch dependencies from git references. That is, dependencies that point to a git repo instead of a version or semver range. Please note that this could leave your tree incomplete and some packages may not function as intended or designed. +.P +\fBall\fR allows any git dependencies to be fetched and installed. \fBnone\fR prevents any git dependencies from being fetched and installed. \fBroot\fR only allows git dependencies defined in your project's package.json to be fetched installed. Also allows git dependencies to be fetched for other commands like \fBnpm view\fR +.SS "\fBaudit\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When "true" submit audit reports alongside the current npm command to the default registry and all registries configured for scopes. See the documentation for npm help audit for details on what is submitted. +.SS "\fBbin-links\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Tells npm to create symlinks (or \fB.cmd\fR shims on Windows) for package executables. +.P +Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems. +.SS "\fBfund\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When "true" displays the message at the end of each \fBnpm install\fR acknowledging the number of dependencies looking for funding. See npm help fund for details. +.SS "\fBdry-run\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. +.P +Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBinstall-links\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help find-dupes +.IP \(bu 4 +npm help ls +.IP \(bu 4 +npm help update +.IP \(bu 4 +npm help install +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-deprecate.1 b/node24/node_modules/npm/man/man1/npm-deprecate.1 new file mode 100644 index 0000000000000000000000000000000000000000..dc2c79238bbdf6e1870eddc64e986200d32f04d6 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-deprecate.1 @@ -0,0 +1,85 @@ +.TH "NPM-DEPRECATE" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-deprecate\fR - Deprecate a version of a package +.SS "Synopsis" +.P +.RS 2 +.nf +npm deprecate +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +This command will update the npm registry entry for a package, providing a deprecation warning to all who attempt to install it. +.P +It works on \fBversion ranges\fR \fI\(lahttps://semver.npmjs.com/\(ra\fR as well as specific versions, so you can do something like this: +.P +.RS 2 +.nf +npm deprecate my-thing@"< 0.2.3" "critical bug fixed in v0.2.3" +.fi +.RE +.P +SemVer ranges passed to this command are interpreted such that they \fIdo\fR include prerelease versions. For example: +.P +.RS 2 +.nf +npm deprecate my-thing@1.x "1.x is no longer supported" +.fi +.RE +.P +In this case, a version \fBmy-thing@1.0.0-beta.0\fR will also be deprecated. +.P +You must be the package owner to deprecate something. See the \fBowner\fR and \fBadduser\fR help topics. +.P +To un-deprecate a package, specify an empty string (\fB""\fR) for the \fBmessage\fR argument. Note that you must use double quotes with no space between them to format an empty string. +.SS "Configuration" +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "\fBotp\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with \fBnpm access\fR. +.P +If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. +.SS "\fBdry-run\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. +.P +Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "package spec" +.IP \(bu 4 +npm help publish +.IP \(bu 4 +npm help registry +.IP \(bu 4 +npm help owner +.IP \(bu 4 +npm help adduser +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-diff.1 b/node24/node_modules/npm/man/man1/npm-diff.1 new file mode 100644 index 0000000000000000000000000000000000000000..151207592dbaf3c832c7fa43ac15f60db0fbbe18 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-diff.1 @@ -0,0 +1,310 @@ +.TH "NPM-DIFF" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-diff\fR - The registry diff command +.SS "Synopsis" +.P +.RS 2 +.nf +npm diff \[lB]...\[rB] +.fi +.RE +.SS "Description" +.P +Similar to its \fBgit diff\fR counterpart, this command will print diff patches of files for packages published to the npm registry. +.RS 0 +.IP \(bu 4 +\fBnpm diff --diff= --diff=\fR +.P +Compares two package versions using their registry specifiers, e.g: \fBnpm diff --diff=pkg@1.0.0 --diff=pkg@^2.0.0\fR. It's also possible to compare across forks of any package, e.g: \fBnpm diff --diff=pkg@1.0.0 --diff=pkg-fork@1.0.0\fR. +.P +Any valid spec can be used, so that it's also possible to compare directories or git repositories, e.g: \fBnpm diff --diff=pkg@latest --diff=./packages/pkg\fR +.P +Here's an example comparing two different versions of a package named \fBabbrev\fR from the registry: +.P +.RS 2 +.nf +npm diff --diff=abbrev@1.1.0 --diff=abbrev@1.1.1 +.fi +.RE +.P +On success, output looks like: +.P +.RS 2 +.nf +diff --git a/package.json b/package.json +index v1.1.0..v1.1.1 100644 +--- a/package.json ++++ b/package.json +@@ -1,6 +1,6 @@ + { + "name": "abbrev", +- "version": "1.1.0", ++ "version": "1.1.1", + "description": "Like ruby's abbrev module, but in js", + "author": "Isaac Z. Schlueter ", + "main": "abbrev.js", +.fi +.RE +.P +Given the flexible nature of npm specs, you can also target local directories or git repos just like when using \fBnpm install\fR: +.P +.RS 2 +.nf +npm diff --diff=https://github.com/npm/libnpmdiff --diff=./local-path +.fi +.RE +.P +In the example above we can compare the contents from the package installed from the git repo at \fBgithub.com/npm/libnpmdiff\fR with the contents of the \fB./local-path\fR that contains a valid package, such as a modified copy of the original. +.IP \(bu 4 +\fBnpm diff\fR (in a package directory, no arguments): +.P +If the package is published to the registry, \fBnpm diff\fR will fetch the tarball version tagged as \fBlatest\fR (this value can be configured using the \fBtag\fR option) and proceed to compare the contents of files present in that tarball, with the current files in your local file system. +.P +This workflow provides a handy way for package authors to see what package-tracked files have been changed in comparison with the latest published version of that package. +.IP \(bu 4 +\fBnpm diff --diff=\fR (in a package directory): +.P +When using a single package name (with no version or tag specifier) as an argument, \fBnpm diff\fR will work in a similar way to \fB\[rs]fBnpm-outdated\[rs]fR\fR \fI\(lanpm-outdated\(ra\fR and reach for the registry to figure out what current published version of the package named \fB\fR will satisfy its dependent declared semver-range. Once that specific version is known \fBnpm diff\fR will print diff patches comparing the current version of \fB\fR found in the local file system with that specific version returned by the registry. +.P +Given a package named \fBabbrev\fR that is currently installed: +.P +.RS 2 +.nf +npm diff --diff=abbrev +.fi +.RE +.P +That will request from the registry its most up to date version and will print a diff output comparing the currently installed version to this newer one if the version numbers are not the same. +.IP \(bu 4 +\fBnpm diff --diff=\fR (in a package directory): +.P +Similar to using only a single package name, it's also possible to declare a full registry specifier version if you wish to compare the local version of an installed package with the specific version/tag/semver-range provided in \fB\fR. +.P +An example: assuming \fBpkg@1.0.0\fR is installed in the current \fBnode_modules\fR folder, running: +.P +.RS 2 +.nf +npm diff --diff=pkg@2.0.0 +.fi +.RE +.P +It will effectively be an alias to \fBnpm diff --diff=pkg@1.0.0 --diff=pkg@2.0.0\fR. +.IP \(bu 4 +\fBnpm diff --diff= \[lB]--diff=\[rB]\fR (in a package directory): +.P +Using \fBnpm diff\fR along with semver-valid version numbers is a shorthand to compare different versions of the current package. +.P +It needs to be run from a package directory, such that for a package named \fBpkg\fR running \fBnpm diff --diff=1.0.0 --diff=1.0.1\fR is the same as running \fBnpm diff --diff=pkg@1.0.0 --diff=pkg@1.0.1\fR. +.P +If only a single argument \fB\fR is provided, then the current local file system is going to be compared against that version. +.P +Here's an example comparing two specific versions (published to the configured registry) of the current project directory: +.P +.RS 2 +.nf +npm diff --diff=1.0.0 --diff=1.1.0 +.fi +.RE +.RE 0 + +.P +Note that tag names are not valid \fB--diff\fR argument values, if you wish to compare to a published tag, you must use the \fBpkg@tagname\fR syntax. +.SS "Filtering files" +.P +It's possible to also specify positional arguments using file names or globs pattern matching in order to limit the result of diff patches to only a subset of files for a given package, e.g: +.P +.RS 2 +.nf +npm diff --diff=pkg@2 ./lib/ CHANGELOG.md +.fi +.RE +.P +In the example above the diff output is only going to print contents of files located within the folder \fB./lib/\fR and changed lines of code within the \fBCHANGELOG.md\fR file. +.SS "Configuration" +.SS "\fBdiff\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Define arguments to compare in \fBnpm diff\fR. +.SS "\fBdiff-name-only\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Prints only filenames when using \fBnpm diff\fR. +.SS "\fBdiff-unified\fR" +.RS 0 +.IP \(bu 4 +Default: 3 +.IP \(bu 4 +Type: Number +.RE 0 + +.P +The number of lines of context to print in \fBnpm diff\fR. +.SS "\fBdiff-ignore-all-space\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Ignore whitespace when comparing lines in \fBnpm diff\fR. +.SS "\fBdiff-no-prefix\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Do not show any source or destination prefix in \fBnpm diff\fR output. +.P +Note: this causes \fBnpm diff\fR to ignore the \fB--diff-src-prefix\fR and \fB--diff-dst-prefix\fR configs. +.SS "\fBdiff-src-prefix\fR" +.RS 0 +.IP \(bu 4 +Default: "a/" +.IP \(bu 4 +Type: String +.RE 0 + +.P +Source prefix to be used in \fBnpm diff\fR output. +.SS "\fBdiff-dst-prefix\fR" +.RS 0 +.IP \(bu 4 +Default: "b/" +.IP \(bu 4 +Type: String +.RE 0 + +.P +Destination prefix to be used in \fBnpm diff\fR output. +.SS "\fBdiff-text\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Treat all files as text in \fBnpm diff\fR. +.SS "\fBglobal\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "\fBtag\fR" +.RS 0 +.IP \(bu 4 +Default: "latest" +.IP \(bu 4 +Type: String +.RE 0 + +.P +If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag. +.P +It is the tag added to the package@version specified in the \fBnpm dist-tag +add\fR command, if no explicit tag is given. +.P +When used by the \fBnpm diff\fR command, this is the tag used to fetch the tarball that will be compared with the local files by default. +.P +If used in the \fBnpm publish\fR command, this is the tag that will be added to the package submitted to the registry. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SH "SEE ALSO" +.RS 0 +.IP \(bu 4 +npm help outdated +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help registry +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-dist-tag.1 b/node24/node_modules/npm/man/man1/npm-dist-tag.1 new file mode 100644 index 0000000000000000000000000000000000000000..ba1ad4da5a3ac6f6d36c98876e9f8fdcc592f38c --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-dist-tag.1 @@ -0,0 +1,144 @@ +.TH "NPM-DIST-TAG" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-dist-tag\fR - Modify package distribution tags +.SS "Synopsis" +.P +.RS 2 +.nf +npm dist-tag add \[lB]\[rB] +npm dist-tag rm +npm dist-tag ls \[lB]\[rB] + +alias: dist-tags +.fi +.RE +.SS "Description" +.P +Add, remove, and enumerate distribution tags on a package: +.RS 0 +.IP \(bu 4 +add: Tags the specified version of the package with the specified tag, or the \fB\[rs]fB--tag\[rs]fR config\fR \fI\(la/using-npm/config#tag\(ra\fR if not specified. If you have two-factor authentication on auth-and-writes then you\[cq]ll need to include a one-time password on the command line with \fB--otp \fR, or go through a second factor flow based on your \fBauthtype\fR. +.IP \(bu 4 +rm: Clear a tag that is no longer in use from the package. If you have two-factor authentication on auth-and-writes then you\[cq]ll need to include a one-time password on the command line with \fB--otp \fR, or go through a second factor flow based on your \fBauthtype\fR +.IP \(bu 4 +ls: Show all of the dist-tags for a package, defaulting to the package in the current prefix. This is the default action if none is specified. +.RE 0 + +.P +A tag can be used when installing packages as a reference to a version instead of using a specific version number: +.P +.RS 2 +.nf +npm install @ +.fi +.RE +.P +When installing dependencies, a preferred tagged version may be specified: +.P +.RS 2 +.nf +npm install --tag +.fi +.RE +.P +(This also applies to any other commands that resolve and install dependencies, such as \fBnpm dedupe\fR, \fBnpm update\fR, and \fBnpm audit fix\fR.) +.P +Publishing a package sets the \fBlatest\fR tag to the published version unless the \fB--tag\fR option is used. For example, \fBnpm publish --tag=beta\fR. +.P +By default, \fBnpm install \fR (without any \fB@\fR or \fB@\fR specifier) installs the \fBlatest\fR tag. +.SS "Purpose" +.P +Tags can be used to provide an alias instead of version numbers. +.P +For example, a project might choose to have multiple streams of development and use a different tag for each stream, e.g., \fBstable\fR, \fBbeta\fR, \fBdev\fR, \fBcanary\fR. +.P +By default, the \fBlatest\fR tag is used by npm to identify the current version of a package, and \fBnpm install \fR (without any \fB@\fR or \fB@\fR specifier) installs the \fBlatest\fR tag. Typically, projects only use the \fBlatest\fR tag for stable release versions, and use other tags for unstable versions such as prereleases. +.P +The \fBnext\fR tag is used by some projects to identify the upcoming version. +.P +Other than \fBlatest\fR, no tag has any special significance to npm itself. +.SS "Caveats" +.P +This command used to be known as \fBnpm tag\fR, which only created new tags, and so had a different syntax. +.P +Tags must share a namespace with version numbers, because they are specified in the same slot: \fBnpm install @\fR vs \fBnpm install @\fR. +.P +Tags that can be interpreted as valid semver ranges will be rejected. For example, \fBv1.4\fR cannot be used as a tag, because it is interpreted by semver as \fB>=1.4.0 <1.5.0\fR. See \fI\(lahttps://github.com/npm/npm/issues/6082\(ra\fR. +.P +The simplest way to avoid semver problems with tags is to use tags that do not begin with a number or the letter \fBv\fR. +.SS "Configuration" +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "package spec" +.IP \(bu 4 +npm help publish +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help dedupe +.IP \(bu 4 +npm help registry +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-docs.1 b/node24/node_modules/npm/man/man1/npm-docs.1 new file mode 100644 index 0000000000000000000000000000000000000000..11cb8792842fb93d97fc55fb185f2e123969371c --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-docs.1 @@ -0,0 +1,113 @@ +.TH "NPM-DOCS" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-docs\fR - Open documentation for a package in a web browser +.SS "Synopsis" +.P +.RS 2 +.nf +npm docs \[lB] \[lB] ...\[rB]\[rB] + +alias: home +.fi +.RE +.SS "Description" +.P +This command tries to guess at the likely location of a package's documentation URL, and then tries to open it using the \fB\[rs]fB--browser\[rs]fR config\fR \fI\(la/using-npm/config#browser\(ra\fR param. You can pass multiple package names at once. If no package name is provided, it will search for a \fBpackage.json\fR in the current folder and use the \fBname\fR property. +.SS "Configuration" +.SS "\fBbrowser\fR" +.RS 0 +.IP \(bu 4 +Default: macOS: \fB"open"\fR, Windows: \fB"start"\fR, Others: \fB"xdg-open"\fR +.IP \(bu 4 +Type: null, Boolean, or String +.RE 0 + +.P +The browser that is called by npm commands to open websites. +.P +Set to \fBfalse\fR to suppress browser behavior and instead print urls to terminal. +.P +Set to \fBtrue\fR to use default system URL opener. +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help view +.IP \(bu 4 +npm help publish +.IP \(bu 4 +npm help registry +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +\fBpackage.json\fR \fI\(la/configuring-npm/package-json\(ra\fR +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-doctor.1 b/node24/node_modules/npm/man/man1/npm-doctor.1 new file mode 100644 index 0000000000000000000000000000000000000000..af10e5f4e751ecc061e9a54d2e95f8fc6637f6c7 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-doctor.1 @@ -0,0 +1,82 @@ +.TH "NPM-DOCTOR" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-doctor\fR - Check the health of your npm environment +.SS "Synopsis" +.P +.RS 2 +.nf +npm doctor \[lB]connection\[rB] \[lB]registry\[rB] \[lB]versions\[rB] \[lB]environment\[rB] \[lB]permissions\[rB] \[lB]cache\[rB] +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +\fBnpm doctor\fR runs a set of checks to ensure that your npm installation has what it needs to manage your JavaScript packages. npm is mostly a standalone tool, but it does have some basic requirements that must be met: +.RS 0 +.IP \(bu 4 +Node.js and git must be executable by npm. +.IP \(bu 4 +The primary npm registry, \fBregistry.npmjs.com\fR, or another service that uses the registry API, is available. +.IP \(bu 4 +The directories that npm uses, \fBnode_modules\fR (both locally and globally), exist and can be written by the current user. +.IP \(bu 4 +The npm cache exists, and the package tarballs within it aren't corrupt. +.RE 0 + +.P +Without all of these working properly, npm may not work properly. Many issues are often attributable to things that are outside npm's code base, so \fBnpm doctor\fR confirms that the npm installation is in a good state. +.P +Also, in addition to this, there are also very many issue reports due to using old versions of npm. Since npm is constantly improving, running \fBnpm@latest\fR is better than an old version. +.P +\fBnpm doctor\fR verifies the following items in your environment, and if there are any recommended changes, it will display them. By default npm runs all of these checks. You can limit what checks are ran by specifying them as extra arguments. +.SS "\fBConnecting to the registry\fR" +.P +By default, npm installs from the primary npm registry, \fBregistry.npmjs.org\fR. \fBnpm doctor\fR hits a special connection testing endpoint within the registry. This can also be checked with \fBnpm ping\fR. If this check fails, you may be using a proxy that needs to be configured, or may need to talk to your IT staff to get access over HTTPS to \fBregistry.npmjs.org\fR. +.P +This check is done against whichever registry you've configured (you can see what that is by running \fBnpm config get registry\fR), and if you're using a private registry that doesn't support the \fB/whoami\fR endpoint supported by the primary registry, this check may fail. +.SS "\fBChecking npm version\fR" +.P +While Node.js may come bundled with a particular version of npm, it's the policy of the CLI team that we recommend all users run \fBnpm@latest\fR if they can. As the CLI is maintained by a small team of contributors, there are only resources for a single line of development, so npm's own long-term support releases typically only receive critical security and regression fixes. The team believes that the latest tested version of npm is almost always likely to be the most functional and defect-free version of npm. +.SS "\fBChecking node version\fR" +.P +For most users, in most circumstances, the best version of Node will be the latest long-term support (LTS) release. Those of you who want access to new ECMAscript features or bleeding-edge changes to Node's standard library may be running a newer version, and some may be required to run an older version of Node because of enterprise change control policies. That's OK! But in general, the npm team recommends that most users run Node.js LTS. +.SS "\fBChecking configured npm registry\fR" +.P +You may be installing from private package registries for your project or company. That's great! Others may be following tutorials or StackOverflow questions in an effort to troubleshoot problems you may be having. Sometimes, this may entail changing the registry you're pointing at. This part of \fBnpm doctor\fR just lets you, and maybe whoever's helping you with support, know that you're not using the default registry. +.SS "\fBChecking for git executable in PATH\fR" +.P +While it's documented in the README, it may not be obvious that npm needs Git installed to do many of the things that it does. Also, in some cases \[en] especially on Windows \[en] you may have Git set up in such a way that it's not accessible via your \fBPATH\fR so that npm can find it. This check ensures that Git is available. +.SS "Permissions checks" +.RS 0 +.IP \(bu 4 +Your cache must be readable and writable by the user running npm. +.IP \(bu 4 +Global package binaries must be writable by the user running npm. +.IP \(bu 4 +Your local \fBnode_modules\fR path, if you're running \fBnpm doctor\fR with a project directory, must be readable and writable by the user running npm. +.RE 0 + +.SS "Validate the checksums of cached packages" +.P +When an npm package is published, the publishing process generates a checksum that npm uses at install time to verify that the package didn't get corrupted in transit. \fBnpm doctor\fR uses these checksums to validate the package tarballs in your local cache (you can see where that cache is located with \fBnpm config get cache\fR). In the event that there are corrupt packages in your cache, you should probably run \fBnpm cache clean -f\fR and reset the cache. +.SS "Configuration" +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help bugs +.IP \(bu 4 +npm help help +.IP \(bu 4 +npm help ping +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-edit.1 b/node24/node_modules/npm/man/man1/npm-edit.1 new file mode 100644 index 0000000000000000000000000000000000000000..3aa26cb863612041825d639aef5f2f076182055c --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-edit.1 @@ -0,0 +1,43 @@ +.TH "NPM-EDIT" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-edit\fR - Edit an installed package +.SS "Synopsis" +.P +.RS 2 +.nf +npm edit \[lB]/...\[rB] +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +Selects a dependency in the current project and opens the package folder in the default editor (or whatever you've configured as the npm \fBeditor\fR config -- see \fB\[rs]fBnpm-config\[rs]fR\fR \fI\(lanpm-config\(ra\fR.) +.P +After it has been edited, the package is rebuilt so as to pick up any changes in compiled packages. +.P +For instance, you can do \fBnpm install connect\fR to install connect into your package, and then \fBnpm edit connect\fR to make a few changes to your locally installed copy. +.SS "Configuration" +.SS "\fBeditor\fR" +.RS 0 +.IP \(bu 4 +Default: The EDITOR or VISUAL environment variables, or '%SYSTEMROOT%\[rs]notepad.exe' on Windows, or 'vi' on Unix systems +.IP \(bu 4 +Type: String +.RE 0 + +.P +The command to run for \fBnpm edit\fR and \fBnpm config edit\fR. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help folders +.IP \(bu 4 +npm help explore +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-exec.1 b/node24/node_modules/npm/man/man1/npm-exec.1 new file mode 100644 index 0000000000000000000000000000000000000000..a2bd82a48bf660dc51e4ee28e77cff63f43a5663 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-exec.1 @@ -0,0 +1,350 @@ +.TH "NPM-EXEC" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-exec\fR - Run a command from a local or remote npm package +.SS "Synopsis" +.P +.RS 2 +.nf +npm exec -- \[lB]@\[rB] \[lB]args...\[rB] +npm exec --package=\[lB]@\[rB] -- \[lB]args...\[rB] +npm exec -c ' \[lB]args...\[rB]' +npm exec --package=foo -c ' \[lB]args...\[rB]' + +alias: x +.fi +.RE +.SS "Description" +.P +This command allows you to run an arbitrary command from an npm package (either one installed locally, or fetched remotely), in a similar context as running it via \fBnpm run\fR. +.P +Run without positional arguments or \fB--call\fR, this allows you to interactively run commands in the same sort of shell environment that \fBpackage.json\fR scripts are run. Interactive mode is not supported in CI environments when standard input is a TTY, to prevent hangs. +.P +Whatever packages are specified by the \fB--package\fR option will be provided in the \fBPATH\fR of the executed command, along with any locally installed package executables. The \fB--package\fR option may be specified multiple times, to execute the supplied command in an environment where all specified packages are available. +.P +If any requested packages are not present in the local project dependencies, then a prompt is printed, which can be suppressed by providing either \fB--yes\fR or \fB--no\fR. When standard input is not a TTY or a CI environment is detected, \fB--yes\fR is assumed. The requested packages are installed to a folder in the npm cache, which is added to the \fBPATH\fR environment variable in the executed process. +.P +Package names provided without a specifier will be matched with whatever version exists in the local project. Package names with a specifier will only be considered a match if they have the exact same name and version as the local dependency. +.P +If no \fB-c\fR or \fB--call\fR option is provided, then the positional arguments are used to generate the command string. If no \fB--package\fR options are provided, then npm will attempt to determine the executable name from the package specifier provided as the first positional argument according to the following heuristic: +.RS 0 +.IP \(bu 4 +If the package has a single entry in its \fBbin\fR field in \fBpackage.json\fR, or if all entries are aliases of the same command, then that command will be used. +.IP \(bu 4 +If the package has multiple \fBbin\fR entries, and one of them matches the unscoped portion of the \fBname\fR field, then that command will be used. +.IP \(bu 4 +If this does not result in exactly one option (either because there are no bin entries, or none of them match the \fBname\fR of the package), then \fBnpm exec\fR exits with an error. +.RE 0 + +.P +To run a binary \fIother than\fR the named binary, specify one or more \fB--package\fR options, which will prevent npm from inferring the package from the first command argument. +.SS "\fBnpx\fR vs \fBnpm exec\fR" +.P +When run via the \fBnpx\fR binary, all flags and options \fImust\fR be set prior to any positional arguments. When run via \fBnpm exec\fR, a double-hyphen \fB--\fR flag can be used to suppress npm's parsing of switches and options that should be sent to the executed command. +.P +For example: +.P +.RS 2 +.nf +$ npx foo@latest bar --package=@npmcli/foo +.fi +.RE +.P +In this case, npm will resolve the \fBfoo\fR package name, and run the following command: +.P +.RS 2 +.nf +$ foo bar --package=@npmcli/foo +.fi +.RE +.P +Since the \fB--package\fR option comes \fIafter\fR the positional arguments, it is treated as an argument to the executed command. +.P +In contrast, due to npm's argument parsing logic, running this command is different: +.P +.RS 2 +.nf +$ npm exec foo@latest bar --package=@npmcli/foo +.fi +.RE +.P +In this case, npm will parse the \fB--package\fR option first, resolving the \fB@npmcli/foo\fR package. Then, it will execute the following command in that context: +.P +.RS 2 +.nf +$ foo@latest bar +.fi +.RE +.P +The double-hyphen character is recommended to explicitly tell npm to stop parsing command line options and switches. The following command would thus be equivalent to the \fBnpx\fR command above: +.P +.RS 2 +.nf +$ npm exec -- foo@latest bar --package=@npmcli/foo +.fi +.RE +.SS "Configuration" +.SS "\fBpackage\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +The package or packages to install for npm help exec +.SS "\fBcall\fR" +.RS 0 +.IP \(bu 4 +Default: "" +.IP \(bu 4 +Type: String +.RE 0 + +.P +Optional companion option for \fBnpm exec\fR, \fBnpx\fR that allows for specifying a custom command to be run along with the installed packages. +.P +.RS 2 +.nf +npm exec --package yo --package generator-node --call "yo node" +.fi +.RE +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "Examples" +.P +Run the version of \fBtap\fR in the local dependencies, with the provided arguments: +.P +.RS 2 +.nf +$ npm exec -- tap --bail test/foo.js +$ npx tap --bail test/foo.js +.fi +.RE +.P +Run a command \fIother than\fR the command whose name matches the package name by specifying a \fB--package\fR option: +.P +.RS 2 +.nf +$ npm exec --package=foo -- bar --bar-argument +# ~ or ~ +$ npx --package=foo bar --bar-argument +.fi +.RE +.P +Run an arbitrary shell script, in the context of the current project: +.P +.RS 2 +.nf +$ npm x -c 'eslint && say "hooray, lint passed"' +$ npx -c 'eslint && say "hooray, lint passed"' +.fi +.RE +.SS "Workspaces support" +.P +You may use the \fB\[rs]fBworkspace\[rs]fR\fR \fI\(la/using-npm/config#workspace\(ra\fR or \fB\[rs]fBworkspaces\[rs]fR\fR \fI\(la/using-npm/config#workspaces\(ra\fR configs in order to run an arbitrary command from an npm package (either one installed locally, or fetched remotely) in the context of the specified workspaces. If no positional argument or \fB--call\fR option is provided, it will open an interactive subshell in the context of each of these configured workspaces one at a time. +.P +Given a project with configured workspaces, e.g: +.P +.RS 2 +.nf +. ++-- package.json +`-- packages + +-- a + | `-- package.json + +-- b + | `-- package.json + `-- c + `-- package.json +.fi +.RE +.P +Assuming the workspace configuration is properly set up at the root level \fBpackage.json\fR file. e.g: +.P +.RS 2 +.nf +{ + "workspaces": \[lB] "./packages/*" \[rB] +} +.fi +.RE +.P +You can execute an arbitrary command from a package in the context of each of the configured workspaces when using the \fB\[rs]fBworkspaces\[rs]fR config options\fR \fI\(la/using-npm/config#workspace\(ra\fR, in this example we're using \fBeslint\fR to lint any js file found within each workspace folder: +.P +.RS 2 +.nf +npm exec --ws -- eslint ./*.js +.fi +.RE +.SS "Filtering workspaces" +.P +It's also possible to execute a command in a single workspace using the \fBworkspace\fR config along with a name or directory path: +.P +.RS 2 +.nf +npm exec --workspace=a -- eslint ./*.js +.fi +.RE +.P +The \fBworkspace\fR config can also be specified multiple times in order to run a specific script in the context of multiple workspaces. When defining values for the \fBworkspace\fR config in the command line, it also possible to use \fB-w\fR as a shorthand, e.g: +.P +.RS 2 +.nf +npm exec -w a -w b -- eslint ./*.js +.fi +.RE +.P +This last command will run the \fBeslint\fR command in both \fB./packages/a\fR and \fB./packages/b\fR folders. +.SS "Compatibility with Older npx Versions" +.P +The \fBnpx\fR binary was rewritten in npm v7.0.0, and the standalone \fBnpx\fR package deprecated at that time. \fBnpx\fR uses the \fBnpm exec\fR command instead of a separate argument parser and install process, with some affordances to maintain backwards compatibility with the arguments it accepted in previous versions. +.P +This resulted in some shifts in its functionality: +.RS 0 +.IP \(bu 4 +Any \fBnpm\fR config value may be provided. +.IP \(bu 4 +To prevent security and user-experience problems from mistyping package names, \fBnpx\fR prompts before installing anything. Suppress this prompt with the \fB-y\fR or \fB--yes\fR option. +.IP \(bu 4 +The \fB--no-install\fR option is deprecated, and will be converted to \fB--no\fR. +.IP \(bu 4 +Shell fallback functionality is removed, as it is not advisable. +.IP \(bu 4 +The \fB-p\fR argument is a shorthand for \fB--parseable\fR in npm, but shorthand for \fB--package\fR in npx. This is maintained, but only for the \fBnpx\fR executable. +.IP \(bu 4 +The \fB--ignore-existing\fR option is removed. Locally installed bins are always present in the executed process \fBPATH\fR. +.IP \(bu 4 +The \fB--npm\fR option is removed. \fBnpx\fR will always use the \fBnpm\fR it ships with. +.IP \(bu 4 +The \fB--node-arg\fR and \fB-n\fR options are removed. +.IP \(bu 4 +The \fB--always-spawn\fR option is redundant, and thus removed. +.IP \(bu 4 +The \fB--shell\fR option is replaced with \fB--script-shell\fR, but maintained in the \fBnpx\fR executable for backwards compatibility. +.RE 0 + +.SS "A note on caching" +.P +The npm cli utilizes its internal package cache when using the package name specified. You can use the following to change how and when the cli uses this cache. See npm help cache for more on how the cache works. +.SS "prefer-online" +.P +Forces staleness checks for packages, making the cli look for updates immediately even if the package is already in the cache. +.SS "prefer-offline" +.P +Bypasses staleness checks for packages. Missing data will still be requested from the server. To force full offline mode, use \fBoffline\fR. +.SS "offline" +.P +Forces full offline mode. Any packages not locally cached will result in an error. +.SS "workspace" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result to selecting all of the nested workspaces) +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "workspaces" +.RS 0 +.IP \(bu 4 +Alias: \fB--ws\fR +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +Default: \fBfalse\fR +.RE 0 + +.P +Run scripts in the context of all configured workspaces for the current project. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help run +.IP \(bu 4 +npm help scripts +.IP \(bu 4 +npm help test +.IP \(bu 4 +npm help start +.IP \(bu 4 +npm help restart +.IP \(bu 4 +npm help stop +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help workspaces +.IP \(bu 4 +npm help npx +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-explain.1 b/node24/node_modules/npm/man/man1/npm-explain.1 new file mode 100644 index 0000000000000000000000000000000000000000..6bd9c48784ec410108f1bba5845364d5a263affd --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-explain.1 @@ -0,0 +1,118 @@ +.TH "NPM-EXPLAIN" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-explain\fR - Explain installed packages +.SS "Synopsis" +.P +.RS 2 +.nf +npm explain + +alias: why +.fi +.RE +.SS "Description" +.P +This command will print the chain of dependencies causing a given package to be installed in the current project. +.P +If one or more package specs are provided, then only packages matching one of the specifiers will have their relationships explained. +.P +The package spec can also refer to a folder within \fB./node_modules\fR +.P +For example, running \fBnpm explain glob\fR within npm's source tree will show: +.P +.RS 2 +.nf +glob@7.1.6 +node_modules/glob + glob@"^7.1.4" from the root project + +glob@7.1.1 dev +node_modules/tacks/node_modules/glob + glob@"^7.0.5" from rimraf@2.6.2 + node_modules/tacks/node_modules/rimraf + rimraf@"^2.6.2" from tacks@1.3.0 + node_modules/tacks + dev tacks@"^1.3.0" from the root project +.fi +.RE +.P +To explain just the package residing at a specific folder, pass that as the argument to the command. This can be useful when trying to figure out exactly why a given dependency is being duplicated to satisfy conflicting version requirements within the project. +.P +.RS 2 +.nf +$ npm explain node_modules/nyc/node_modules/find-up +find-up@3.0.0 dev +node_modules/nyc/node_modules/find-up + find-up@"^3.0.0" from nyc@14.1.1 + node_modules/nyc + nyc@"^14.1.1" from tap@14.10.8 + node_modules/tap + dev tap@"^14.10.8" from the root project +.fi +.RE +.SS "Configuration" +.SS "\fBjson\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to output JSON data, rather than the normal output. +.RS 0 +.IP \(bu 4 +In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. +.RE 0 + +.P +Not supported by all npm commands. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "package spec" +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +npm help folders +.IP \(bu 4 +npm help ls +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help link +.IP \(bu 4 +npm help prune +.IP \(bu 4 +npm help outdated +.IP \(bu 4 +npm help update +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-explore.1 b/node24/node_modules/npm/man/man1/npm-explore.1 new file mode 100644 index 0000000000000000000000000000000000000000..fb818c7aecefea558f7203940cff9471ff763756 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-explore.1 @@ -0,0 +1,49 @@ +.TH "NPM-EXPLORE" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-explore\fR - Browse an installed package +.SS "Synopsis" +.P +.RS 2 +.nf +npm explore \[lB] -- \[rB] +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +Spawn a subshell in the directory of the installed package specified. +.P +If a command is specified, then it is run in the subshell, which then immediately terminates. +.P +This is particularly handy in the case of git submodules in the \fBnode_modules\fR folder: +.P +.RS 2 +.nf +npm explore some-dependency -- git pull origin master +.fi +.RE +.P +Note that the package is \fInot\fR automatically rebuilt afterwards, so be sure to use \fBnpm rebuild \fR if you make any changes. +.SS "Configuration" +.SS "\fBshell\fR" +.RS 0 +.IP \(bu 4 +Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on Windows +.IP \(bu 4 +Type: String +.RE 0 + +.P +The shell to run for the \fBnpm explore\fR command. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help folders +.IP \(bu 4 +npm help edit +.IP \(bu 4 +npm help rebuild +.IP \(bu 4 +npm help install +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-find-dupes.1 b/node24/node_modules/npm/man/man1/npm-find-dupes.1 new file mode 100644 index 0000000000000000000000000000000000000000..55c00b3a2d299f47541aa3fff47340429577d703 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-find-dupes.1 @@ -0,0 +1,225 @@ +.TH "NPM-FIND-DUPES" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-find-dupes\fR - Find duplication in the package tree +.SS "Synopsis" +.P +.RS 2 +.nf +npm find-dupes +.fi +.RE +.SS "Description" +.P +Runs \fBnpm dedupe\fR in \fB--dry-run\fR mode, making npm only output the duplications, without actually changing the package tree. +.SS "Configuration" +.SS "\fBinstall-strategy\fR" +.RS 0 +.IP \(bu 4 +Default: "hoisted" +.IP \(bu 4 +Type: "hoisted", "nested", "shallow", or "linked" +.RE 0 + +.P +Sets the strategy for installing packages in node_modules. hoisted (default): Install non-duplicated in top-level, and duplicated as necessary within directory structure. nested: (formerly --legacy-bundling) install in place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. +.SS "\fBlegacy-bundling\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=nested\fR +.RE 0 + +.P +Instead of hoisting package installs in \fBnode_modules\fR, install packages in the same manner that they are depended on. This may cause very deep directory structures and duplicate package installs as there is no de-duplicating. Sets \fB--install-strategy=nested\fR. +.SS "\fBglobal-style\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=shallow\fR +.RE 0 + +.P +Only install direct dependencies in the top level \fBnode_modules\fR, but hoist on deeper dependencies. Sets \fB--install-strategy=shallow\fR. +.SS "\fBstrict-peer-deps\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to \fBtrue\fR, and \fB--legacy-peer-deps\fR is not set, then \fIany\fR conflicting \fBpeerDependencies\fR will be treated as an install failure, even if npm could reasonably guess the appropriate resolution based on non-peer dependency relationships. +.P +By default, conflicting \fBpeerDependencies\fR deep in the dependency graph will be resolved using the nearest non-peer dependency specification, even if doing so will result in some packages receiving a peer dependency outside the range set in their package's \fBpeerDependencies\fR object. +.P +When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If \fB--strict-peer-deps\fR is set, then this warning is treated as a failure. +.SS "\fBpackage-lock\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to false, then ignore \fBpackage-lock.json\fR files when installing. This will also prevent \fIwriting\fR \fBpackage-lock.json\fR if \fBsave\fR is true. +.SS "\fBomit\fR" +.RS 0 +.IP \(bu 4 +Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production'; otherwise, empty. +.IP \(bu 4 +Type: "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Dependency types to omit from the installation tree on disk. +.P +Note that these dependencies \fIare\fR still resolved and added to the \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR file. They are just not physically installed on disk. +.P +If a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included. +.P +If the resulting omit list includes \fB'dev'\fR, then the \fBNODE_ENV\fR environment variable will be set to \fB'production'\fR for all lifecycle scripts. +.SS "\fBinclude\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: "prod", "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Option that allows for defining which types of dependencies to install. +.P +This is the inverse of \fB--omit=\fR. +.P +Dependency types specified in \fB--include\fR will not be omitted, regardless of the order in which omit/include are specified on the command-line. +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "\fBaudit\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When "true" submit audit reports alongside the current npm command to the default registry and all registries configured for scopes. See the documentation for npm help audit for details on what is submitted. +.SS "\fBbin-links\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Tells npm to create symlinks (or \fB.cmd\fR shims on Windows) for package executables. +.P +Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems. +.SS "\fBfund\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When "true" displays the message at the end of each \fBnpm install\fR acknowledging the number of dependencies looking for funding. See npm help fund for details. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBinstall-links\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help dedupe +.IP \(bu 4 +npm help ls +.IP \(bu 4 +npm help update +.IP \(bu 4 +npm help install +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-fund.1 b/node24/node_modules/npm/man/man1/npm-fund.1 new file mode 100644 index 0000000000000000000000000000000000000000..3c2b2a149881df04b10e6fd100104046b57e9ad6 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-fund.1 @@ -0,0 +1,142 @@ +.TH "NPM-FUND" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-fund\fR - Retrieve funding information +.SS "Synopsis" +.P +.RS 2 +.nf +npm fund \[lB]\[rB] +.fi +.RE +.SS "Description" +.P +This command retrieves information on how to fund the dependencies of a given project. If no package name is provided, it will list all dependencies that are looking for funding in a tree structure, listing the type of funding and the url to visit. If a package name is provided then it tries to open its funding url using the \fB\[rs]fB--browser\[rs]fR config\fR \fI\(la/using-npm/config#browser\(ra\fR param; if there are multiple funding sources for the package, the user will be instructed to pass the \fB--which\fR option to disambiguate. +.P +The list will avoid duplicated entries and will stack all packages that share the same url as a single entry. Thus, the list does not have the same shape of the output from \fBnpm ls\fR. +.SS "Example" +.SS "Workspaces support" +.P +It's possible to filter the results to only include a single workspace and its dependencies using the \fB\[rs]fBworkspace\[rs]fR config\fR \fI\(la/using-npm/config#workspace\(ra\fR option. +.SS "Example:" +.P +Here's an example running \fBnpm fund\fR in a project with a configured workspace \fBa\fR: +.P +.RS 2 +.nf +$ npm fund +test-workspaces-fund@1.0.0 ++-- https://example.com/a +| | `-- a@1.0.0 +| `-- https://example.com/maintainer +| `-- foo@1.0.0 ++-- https://example.com/npmcli-funding +| `-- @npmcli/test-funding +`-- https://example.com/org + `-- bar@2.0.0 +.fi +.RE +.P +And here is an example of the expected result when filtering only by a specific workspace \fBa\fR in the same project: +.P +.RS 2 +.nf +$ npm fund -w a +test-workspaces-fund@1.0.0 +`-- https://example.com/a + | `-- a@1.0.0 + `-- https://example.com/maintainer + `-- foo@2.0.0 +.fi +.RE +.SS "Configuration" +.SS "\fBjson\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to output JSON data, rather than the normal output. +.RS 0 +.IP \(bu 4 +In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. +.RE 0 + +.P +Not supported by all npm commands. +.SS "\fBbrowser\fR" +.RS 0 +.IP \(bu 4 +Default: macOS: \fB"open"\fR, Windows: \fB"start"\fR, Others: \fB"xdg-open"\fR +.IP \(bu 4 +Type: null, Boolean, or String +.RE 0 + +.P +The browser that is called by npm commands to open websites. +.P +Set to \fBfalse\fR to suppress browser behavior and instead print urls to terminal. +.P +Set to \fBtrue\fR to use default system URL opener. +.SS "\fBunicode\fR" +.RS 0 +.IP \(bu 4 +Default: false on windows, true on mac/unix systems with a unicode locale, as defined by the \fBLC_ALL\fR, \fBLC_CTYPE\fR, or \fBLANG\fR environment variables. +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set to true, npm uses unicode characters in the tree output. When false, it uses ascii characters instead of unicode glyphs. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBwhich\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Number +.RE 0 + +.P +If there are multiple funding sources, which 1-indexed source URL to open. +.SH "SEE ALSO" +.RS 0 +.IP \(bu 4 +npm help "package spec" +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help docs +.IP \(bu 4 +npm help ls +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help workspaces +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-get.1 b/node24/node_modules/npm/man/man1/npm-get.1 new file mode 100644 index 0000000000000000000000000000000000000000..66ce7e547a3ef6b6724e07c9c0712a3072bee3de --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-get.1 @@ -0,0 +1,31 @@ +.TH "NPM-GET" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-get\fR - Get a value from the npm configuration +.SS "Synopsis" +.P +.RS 2 +.nf +npm get \[lB] ...\[rB] (See `npm config`) +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +Get a value from the npm configuration +.SS "Configuration" +.SS "\fBlong\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Show extended information in \fBls\fR, \fBsearch\fR, and \fBhelp-search\fR. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "help config" +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-help-search.1 b/node24/node_modules/npm/man/man1/npm-help-search.1 new file mode 100644 index 0000000000000000000000000000000000000000..72f250274c84cc7b7252c3f3dc9b7e1e53e3d347 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-help-search.1 @@ -0,0 +1,37 @@ +.TH "NPM-HELP-SEARCH" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-help-search\fR - Search npm help documentation +.SS "Synopsis" +.P +.RS 2 +.nf +npm help-search +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +This command will search the npm markdown documentation files for the terms provided, and then list the results, sorted by relevance. +.P +If only one result is found, then it will show that help topic. +.P +If the argument to \fBnpm help\fR is not a known help topic, then it will call \fBhelp-search\fR. It is rarely if ever necessary to call this command directly. +.SS "Configuration" +.SS "\fBlong\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Show extended information in \fBls\fR, \fBsearch\fR, and \fBhelp-search\fR. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help npm +.IP \(bu 4 +npm help help +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-help.1 b/node24/node_modules/npm/man/man1/npm-help.1 new file mode 100644 index 0000000000000000000000000000000000000000..954bc2e4e43228d1762723adae9cbece5b668fa5 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-help.1 @@ -0,0 +1,47 @@ +.TH "NPM-HELP" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-help\fR - Get help on npm +.SS "Synopsis" +.P +.RS 2 +.nf +npm help \[lB]\[rB] + +alias: hlep +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +If supplied a topic, then show the appropriate documentation page. +.P +If the topic does not exist, or if multiple terms are provided, then npm will run the \fBhelp-search\fR command to find a match. Note that, if \fBhelp-search\fR finds a single subject, then it will run \fBhelp\fR on that topic, so unique matches are equivalent to specifying a topic name. +.SS "Configuration" +.SS "\fBviewer\fR" +.RS 0 +.IP \(bu 4 +Default: "man" on Posix, "browser" on Windows +.IP \(bu 4 +Type: String +.RE 0 + +.P +The program to use to view help content. +.P +Set to \fB"browser"\fR to view html help content in the default web browser. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help npm +.IP \(bu 4 +npm help folders +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +\fBpackage.json\fR \fI\(la/configuring-npm/package-json\(ra\fR +.IP \(bu 4 +npm help help-search +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-init.1 b/node24/node_modules/npm/man/man1/npm-init.1 new file mode 100644 index 0000000000000000000000000000000000000000..ff0e5ca82913003359c6aaa17d4a12556d13a3e5 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-init.1 @@ -0,0 +1,393 @@ +.TH "NPM-INIT" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-init\fR - Create a package.json file +.SS "Synopsis" +.P +.RS 2 +.nf +npm init (same as `npx create-`) +npm init <@scope> (same as `npx <@scope>/create`) + +aliases: create, innit +.fi +.RE +.SS "Description" +.P +\fBnpm init \fR can be used to set up a new or existing npm package. +.P +\fBinitializer\fR in this case is an npm package named \fBcreate-\fR, which will be installed by npm help npm-exec, and then have its main bin executed -- presumably creating or updating \fBpackage.json\fR and running any other initialization-related operations. +.P +The init command is transformed to a corresponding \fBnpm exec\fR operation as follows: +.RS 0 +.IP \(bu 4 +\fBnpm init foo\fR -> \fBnpm exec create-foo\fR +.IP \(bu 4 +\fBnpm init @usr/foo\fR -> \fBnpm exec @usr/create-foo\fR +.IP \(bu 4 +\fBnpm init @usr\fR -> \fBnpm exec @usr/create\fR +.IP \(bu 4 +\fBnpm init @usr@2.0.0\fR -> \fBnpm exec @usr/create@2.0.0\fR +.IP \(bu 4 +\fBnpm init @usr/foo@2.0.0\fR -> \fBnpm exec @usr/create-foo@2.0.0\fR +.RE 0 + +.P +If the initializer is omitted (by just calling \fBnpm init\fR), init will fall back to legacy init behavior. It will ask you a bunch of questions, and then write a package.json for you. It will attempt to make reasonable guesses based on existing fields, dependencies, and options selected. It is strictly additive, so it will keep any fields and values that were already set. You can also use \fB-y\fR/\fB--yes\fR to skip the questionnaire altogether. If you pass \fB--scope\fR, it will create a scoped package. +.P +\fINote:\fR if a user already has the \fBcreate-\fR package globally installed, that will be what \fBnpm init\fR uses. If you want npm to use the latest version, or another specific version you must specify it: +.RS 0 +.IP \(bu 4 +\fBnpm init foo@latest\fR # fetches and runs the latest \fBcreate-foo\fR from the registry +.IP \(bu 4 +\fBnpm init foo@1.2.3\fR # runs \fBcreate-foo@1.2.3\fR specifically +.RE 0 + +.SS "Forwarding additional options" +.P +Any additional options will be passed directly to the command, so \fBnpm init foo -- --hello\fR will map to \fBnpm exec -- create-foo --hello\fR. +.P +To better illustrate how options are forwarded, here's a more evolved example showing options passed to both the \fBnpm cli\fR and a create package, both following commands are equivalent: +.RS 0 +.IP \(bu 4 +\fBnpm init foo -y --registry= -- --hello -a\fR +.IP \(bu 4 +\fBnpm exec -y --registry= -- create-foo --hello -a\fR +.RE 0 + +.SS "Examples" +.P +Create a new React-based project using \fB\[rs]fBcreate-react-app\[rs]fR\fR \fI\(lahttps://npm.im/create-react-app\(ra\fR: +.P +.RS 2 +.nf +$ npm init react-app ./my-react-app +.fi +.RE +.P +Create a new \fBesm\fR-compatible package using \fB\[rs]fBcreate-esm\[rs]fR\fR \fI\(lahttps://npm.im/create-esm\(ra\fR: +.P +.RS 2 +.nf +$ mkdir my-esm-lib && cd my-esm-lib +$ npm init esm --yes +.fi +.RE +.P +Generate a plain old package.json using legacy init: +.P +.RS 2 +.nf +$ mkdir my-npm-pkg && cd my-npm-pkg +$ git init +$ npm init +.fi +.RE +.P +Generate it without having it ask any questions: +.P +.RS 2 +.nf +$ npm init -y +.fi +.RE +.P +Set the private flag to \fBtrue\fR in package.json: +.P +.RS 2 +.nf +$ npm init --init-private -y +.fi +.RE +.SS "Workspaces support" +.P +It's possible to create a new workspace within your project by using the \fBworkspace\fR config option. When using \fBnpm init -w \fR the cli will create the folders and boilerplate expected while also adding a reference to your project \fBpackage.json\fR \fB"workspaces": \[lB]\[rB]\fR property in order to make sure that new generated \fBworkspace\fR is properly set up as such. +.P +Given a project with no workspaces, e.g: +.P +.RS 2 +.nf +. ++-- package.json +.fi +.RE +.P +You may generate a new workspace using the legacy init: +.P +.RS 2 +.nf +$ npm init -w packages/a +.fi +.RE +.P +That will generate a new folder and \fBpackage.json\fR file, while also updating your top-level \fBpackage.json\fR to add the reference to this new workspace: +.P +.RS 2 +.nf +. ++-- package.json +`-- packages + `-- a + `-- package.json +.fi +.RE +.P +The workspaces init also supports the \fBnpm init -w \fR syntax, following the same set of rules explained earlier in the initial \fBDescription\fR section of this page. Similar to the previous example of creating a new React-based project using \fB\[rs]fBcreate-react-app\[rs]fR\fR \fI\(lahttps://npm.im/create-react-app\(ra\fR, the following syntax will make sure to create the new react app as a nested \fBworkspace\fR within your project and configure your \fBpackage.json\fR to recognize it as such: +.P +.RS 2 +.nf +npm init -w packages/my-react-app react-app . +.fi +.RE +.P +This will make sure to generate your react app as expected, one important consideration to have in mind is that \fBnpm exec\fR is going to be run in the context of the newly created folder for that workspace, and that's the reason why in this example the initializer uses the initializer name followed with a dot to represent the current directory in that context, e.g: \fBreact-app .\fR: +.P +.RS 2 +.nf +. ++-- package.json +`-- packages + +-- a + | `-- package.json + `-- my-react-app + +-- README + +-- package.json + `-- ... +.fi +.RE +.SS "Configuration" +.SS "\fBinit-author-name\fR" +.RS 0 +.IP \(bu 4 +Default: "" +.IP \(bu 4 +Type: String +.RE 0 + +.P +The value \fBnpm init\fR should use by default for the package author's name. +.SS "\fBinit-author-url\fR" +.RS 0 +.IP \(bu 4 +Default: "" +.IP \(bu 4 +Type: "" or URL +.RE 0 + +.P +The value \fBnpm init\fR should use by default for the package author's homepage. +.SS "\fBinit-license\fR" +.RS 0 +.IP \(bu 4 +Default: "ISC" +.IP \(bu 4 +Type: String +.RE 0 + +.P +The value \fBnpm init\fR should use by default for the package license. +.SS "\fBinit-module\fR" +.RS 0 +.IP \(bu 4 +Default: "~/.npm-init.js" +.IP \(bu 4 +Type: Path +.RE 0 + +.P +A module that will be loaded by the \fBnpm init\fR command. See the documentation for the \fBinit-package-json\fR \fI\(lahttps://github.com/npm/init-package-json\(ra\fR module for more information, or npm help init. +.SS "\fBinit-type\fR" +.RS 0 +.IP \(bu 4 +Default: "commonjs" +.IP \(bu 4 +Type: String +.RE 0 + +.P +The value that \fBnpm init\fR should use by default for the package.json type field. +.SS "\fBinit-version\fR" +.RS 0 +.IP \(bu 4 +Default: "1.0.0" +.IP \(bu 4 +Type: SemVer string +.RE 0 + +.P +The value that \fBnpm init\fR should use by default for the package version number, if not already set in package.json. +.SS "\fBinit-private\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +The value \fBnpm init\fR should use by default for the package's private flag. +.SS "\fByes\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Automatically answer "yes" to any prompts that npm might print on the command line. +.SS "\fBforce\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Removes various protections against unfortunate side effects, common mistakes, unnecessary performance degradation, and malicious input. +.RS 0 +.IP \(bu 4 +Allow clobbering non-npm files in global installs. +.IP \(bu 4 +Allow the \fBnpm version\fR command to work on an unclean git repository. +.IP \(bu 4 +Allow deleting the cache folder with \fBnpm cache clean\fR. +.IP \(bu 4 +Allow installing packages that have an \fBengines\fR declaration requiring a different version of npm. +.IP \(bu 4 +Allow installing packages that have an \fBengines\fR declaration requiring a different version of \fBnode\fR, even if \fB--engine-strict\fR is enabled. +.IP \(bu 4 +Allow \fBnpm audit fix\fR to install modules outside your stated dependency range (including SemVer-major changes). +.IP \(bu 4 +Allow unpublishing all versions of a published package. +.IP \(bu 4 +Allow conflicting peerDependencies to be installed in the root project. +.IP \(bu 4 +Implicitly set \fB--yes\fR during \fBnpm init\fR. +.IP \(bu 4 +Allow clobbering existing values in \fBnpm pkg\fR +.IP \(bu 4 +Allow unpublishing of entire packages (not just a single version). +.RE 0 + +.P +If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! +.SS "\fBscope\fR" +.RS 0 +.IP \(bu 4 +Default: the scope of the current project, if any, or "" +.IP \(bu 4 +Type: String +.RE 0 + +.P +Associate an operation with a scope for a scoped registry. +.P +Useful when logging in to or out of a private registry: +.P +.RS 2 +.nf +# log in, linking the scope to the custom registry +npm login --scope=@mycorp --registry=https://registry.mycorp.com + +# log out, removing the link and the auth token +npm logout --scope=@mycorp +.fi +.RE +.P +This will cause \fB@mycorp\fR to be mapped to the registry for future installation of packages specified according to the pattern \fB@mycorp/package\fR. +.P +This will also cause \fBnpm init\fR to create a scoped package. +.P +.RS 2 +.nf +# accept all defaults, and create a package named "@foo/whatever", +# instead of just named "whatever" +npm init --scope=@foo --yes +.fi +.RE +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces-update\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to true, the npm cli will run an update after operations that may possibly change the workspaces installed to the \fBnode_modules\fR folder. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "package spec" +.IP \(bu 4 +\fBinit-package-json module\fR \fI\(lahttp://npm.im/init-package-json\(ra\fR +.IP \(bu 4 +\fBpackage.json\fR \fI\(la/configuring-npm/package-json\(ra\fR +.IP \(bu 4 +npm help version +.IP \(bu 4 +npm help scope +.IP \(bu 4 +npm help exec +.IP \(bu 4 +npm help workspaces +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-install-ci-test.1 b/node24/node_modules/npm/man/man1/npm-install-ci-test.1 new file mode 100644 index 0000000000000000000000000000000000000000..99c8c4cafcb86c2092056ea30283e70334702b28 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-install-ci-test.1 @@ -0,0 +1,251 @@ +.TH "NPM-INSTALL-CI-TEST" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-install-ci-test\fR - Install a project with a clean slate and run tests +.SS "Synopsis" +.P +.RS 2 +.nf +npm install-ci-test + +aliases: cit, clean-install-test, sit +.fi +.RE +.SS "Description" +.P +This command runs \fBnpm ci\fR followed immediately by \fBnpm test\fR. +.SS "Configuration" +.SS "\fBinstall-strategy\fR" +.RS 0 +.IP \(bu 4 +Default: "hoisted" +.IP \(bu 4 +Type: "hoisted", "nested", "shallow", or "linked" +.RE 0 + +.P +Sets the strategy for installing packages in node_modules. hoisted (default): Install non-duplicated in top-level, and duplicated as necessary within directory structure. nested: (formerly --legacy-bundling) install in place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. +.SS "\fBlegacy-bundling\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=nested\fR +.RE 0 + +.P +Instead of hoisting package installs in \fBnode_modules\fR, install packages in the same manner that they are depended on. This may cause very deep directory structures and duplicate package installs as there is no de-duplicating. Sets \fB--install-strategy=nested\fR. +.SS "\fBglobal-style\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=shallow\fR +.RE 0 + +.P +Only install direct dependencies in the top level \fBnode_modules\fR, but hoist on deeper dependencies. Sets \fB--install-strategy=shallow\fR. +.SS "\fBomit\fR" +.RS 0 +.IP \(bu 4 +Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production'; otherwise, empty. +.IP \(bu 4 +Type: "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Dependency types to omit from the installation tree on disk. +.P +Note that these dependencies \fIare\fR still resolved and added to the \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR file. They are just not physically installed on disk. +.P +If a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included. +.P +If the resulting omit list includes \fB'dev'\fR, then the \fBNODE_ENV\fR environment variable will be set to \fB'production'\fR for all lifecycle scripts. +.SS "\fBinclude\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: "prod", "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Option that allows for defining which types of dependencies to install. +.P +This is the inverse of \fB--omit=\fR. +.P +Dependency types specified in \fB--include\fR will not be omitted, regardless of the order in which omit/include are specified on the command-line. +.SS "\fBstrict-peer-deps\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to \fBtrue\fR, and \fB--legacy-peer-deps\fR is not set, then \fIany\fR conflicting \fBpeerDependencies\fR will be treated as an install failure, even if npm could reasonably guess the appropriate resolution based on non-peer dependency relationships. +.P +By default, conflicting \fBpeerDependencies\fR deep in the dependency graph will be resolved using the nearest non-peer dependency specification, even if doing so will result in some packages receiving a peer dependency outside the range set in their package's \fBpeerDependencies\fR object. +.P +When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If \fB--strict-peer-deps\fR is set, then this warning is treated as a failure. +.SS "\fBforeground-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: \fBfalse\fR unless when using \fBnpm pack\fR or \fBnpm publish\fR where it defaults to \fBtrue\fR +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Run all build scripts (ie, \fBpreinstall\fR, \fBinstall\fR, and \fBpostinstall\fR) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process. +.P +Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "\fBallow-git\fR" +.RS 0 +.IP \(bu 4 +Default: "all" +.IP \(bu 4 +Type: "all", "none", or "root" +.RE 0 + +.P +Limits the ability for npm to fetch dependencies from git references. That is, dependencies that point to a git repo instead of a version or semver range. Please note that this could leave your tree incomplete and some packages may not function as intended or designed. +.P +\fBall\fR allows any git dependencies to be fetched and installed. \fBnone\fR prevents any git dependencies from being fetched and installed. \fBroot\fR only allows git dependencies defined in your project's package.json to be fetched installed. Also allows git dependencies to be fetched for other commands like \fBnpm view\fR +.SS "\fBaudit\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When "true" submit audit reports alongside the current npm command to the default registry and all registries configured for scopes. See the documentation for npm help audit for details on what is submitted. +.SS "\fBbin-links\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Tells npm to create symlinks (or \fB.cmd\fR shims on Windows) for package executables. +.P +Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems. +.SS "\fBfund\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When "true" displays the message at the end of each \fBnpm install\fR acknowledging the number of dependencies looking for funding. See npm help fund for details. +.SS "\fBdry-run\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. +.P +Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBinstall-links\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help install-test +.IP \(bu 4 +npm help ci +.IP \(bu 4 +npm help test +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-install-test.1 b/node24/node_modules/npm/man/man1/npm-install-test.1 new file mode 100644 index 0000000000000000000000000000000000000000..2a3dcd29b4be1065c25f089a02f559f3fea8dfeb --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-install-test.1 @@ -0,0 +1,388 @@ +.TH "NPM-INSTALL-TEST" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-install-test\fR - Install package(s) and run tests +.SS "Synopsis" +.P +.RS 2 +.nf +npm install-test \[lB] ...\[rB] + +alias: it +.fi +.RE +.SS "Description" +.P +This command runs an \fBnpm install\fR followed immediately by an \fBnpm test\fR. It takes exactly the same arguments as \fBnpm install\fR. +.SS "Configuration" +.SS "\fBsave\fR" +.RS 0 +.IP \(bu 4 +Default: \fBtrue\fR unless when using \fBnpm update\fR where it defaults to \fBfalse\fR +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Save installed packages to a \fBpackage.json\fR file as dependencies. +.P +When used with the \fBnpm rm\fR command, removes the dependency from \fBpackage.json\fR. +.P +Will also prevent writing to \fBpackage-lock.json\fR if set to \fBfalse\fR. +.SS "\fBsave-exact\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Dependencies saved to package.json will be configured with an exact version rather than using npm's default semver range operator. +.SS "\fBglobal\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "\fBinstall-strategy\fR" +.RS 0 +.IP \(bu 4 +Default: "hoisted" +.IP \(bu 4 +Type: "hoisted", "nested", "shallow", or "linked" +.RE 0 + +.P +Sets the strategy for installing packages in node_modules. hoisted (default): Install non-duplicated in top-level, and duplicated as necessary within directory structure. nested: (formerly --legacy-bundling) install in place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. +.SS "\fBlegacy-bundling\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=nested\fR +.RE 0 + +.P +Instead of hoisting package installs in \fBnode_modules\fR, install packages in the same manner that they are depended on. This may cause very deep directory structures and duplicate package installs as there is no de-duplicating. Sets \fB--install-strategy=nested\fR. +.SS "\fBglobal-style\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=shallow\fR +.RE 0 + +.P +Only install direct dependencies in the top level \fBnode_modules\fR, but hoist on deeper dependencies. Sets \fB--install-strategy=shallow\fR. +.SS "\fBomit\fR" +.RS 0 +.IP \(bu 4 +Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production'; otherwise, empty. +.IP \(bu 4 +Type: "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Dependency types to omit from the installation tree on disk. +.P +Note that these dependencies \fIare\fR still resolved and added to the \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR file. They are just not physically installed on disk. +.P +If a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included. +.P +If the resulting omit list includes \fB'dev'\fR, then the \fBNODE_ENV\fR environment variable will be set to \fB'production'\fR for all lifecycle scripts. +.SS "\fBinclude\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: "prod", "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Option that allows for defining which types of dependencies to install. +.P +This is the inverse of \fB--omit=\fR. +.P +Dependency types specified in \fB--include\fR will not be omitted, regardless of the order in which omit/include are specified on the command-line. +.SS "\fBstrict-peer-deps\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to \fBtrue\fR, and \fB--legacy-peer-deps\fR is not set, then \fIany\fR conflicting \fBpeerDependencies\fR will be treated as an install failure, even if npm could reasonably guess the appropriate resolution based on non-peer dependency relationships. +.P +By default, conflicting \fBpeerDependencies\fR deep in the dependency graph will be resolved using the nearest non-peer dependency specification, even if doing so will result in some packages receiving a peer dependency outside the range set in their package's \fBpeerDependencies\fR object. +.P +When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If \fB--strict-peer-deps\fR is set, then this warning is treated as a failure. +.SS "\fBprefer-dedupe\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Prefer to deduplicate packages if possible, rather than choosing a newer version of a dependency. +.SS "\fBpackage-lock\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to false, then ignore \fBpackage-lock.json\fR files when installing. This will also prevent \fIwriting\fR \fBpackage-lock.json\fR if \fBsave\fR is true. +.SS "\fBpackage-lock-only\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to true, the current operation will only use the \fBpackage-lock.json\fR, ignoring \fBnode_modules\fR. +.P +For \fBupdate\fR this means only the \fBpackage-lock.json\fR will be updated, instead of checking \fBnode_modules\fR and downloading dependencies. +.P +For \fBlist\fR this means the output will be based on the tree described by the \fBpackage-lock.json\fR, rather than the contents of \fBnode_modules\fR. +.SS "\fBforeground-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: \fBfalse\fR unless when using \fBnpm pack\fR or \fBnpm publish\fR where it defaults to \fBtrue\fR +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Run all build scripts (ie, \fBpreinstall\fR, \fBinstall\fR, and \fBpostinstall\fR) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process. +.P +Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "\fBallow-git\fR" +.RS 0 +.IP \(bu 4 +Default: "all" +.IP \(bu 4 +Type: "all", "none", or "root" +.RE 0 + +.P +Limits the ability for npm to fetch dependencies from git references. That is, dependencies that point to a git repo instead of a version or semver range. Please note that this could leave your tree incomplete and some packages may not function as intended or designed. +.P +\fBall\fR allows any git dependencies to be fetched and installed. \fBnone\fR prevents any git dependencies from being fetched and installed. \fBroot\fR only allows git dependencies defined in your project's package.json to be fetched installed. Also allows git dependencies to be fetched for other commands like \fBnpm view\fR +.SS "\fBaudit\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When "true" submit audit reports alongside the current npm command to the default registry and all registries configured for scopes. See the documentation for npm help audit for details on what is submitted. +.SS "\fBbefore\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Date +.RE 0 + +.P +If passed to \fBnpm install\fR, will rebuild the npm tree such that only versions that were available \fBon or before\fR the given date are installed. If there are no versions available for the current set of dependencies, the command will error. +.P +If the requested version is a \fBdist-tag\fR and the given tag does not pass the \fB--before\fR filter, the most recent version less than or equal to that tag will be used. For example, \fBfoo@latest\fR might install \fBfoo@1.2\fR even though \fBlatest\fR is \fB2.0\fR. +.P +This config cannot be used with: \fBmin-release-age\fR +.SS "\fBmin-release-age\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Number +.RE 0 + +.P +If set, npm will build the npm tree such that only versions that were available more than the given number of days ago will be installed. If there are no versions available for the current set of dependencies, the command will error. +.P +This flag is a complement to \fBbefore\fR, which accepts an exact date instead of a relative number of days. +.P +This config cannot be used with: \fBbefore\fR +.P +This value is not exported to the environment for child processes. +.SS "\fBbin-links\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Tells npm to create symlinks (or \fB.cmd\fR shims on Windows) for package executables. +.P +Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems. +.SS "\fBfund\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When "true" displays the message at the end of each \fBnpm install\fR acknowledging the number of dependencies looking for funding. See npm help fund for details. +.SS "\fBdry-run\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. +.P +Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. +.SS "\fBcpu\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +Override CPU architecture of native modules to install. Acceptable values are same as \fBcpu\fR field of package.json, which comes from \fBprocess.arch\fR. +.SS "\fBos\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +Override OS of native modules to install. Acceptable values are same as \fBos\fR field of package.json, which comes from \fBprocess.platform\fR. +.SS "\fBlibc\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +Override libc of native modules to install. Acceptable values are same as \fBlibc\fR field of package.json +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBinstall-links\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help install-ci-test +.IP \(bu 4 +npm help test +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-install.1 b/node24/node_modules/npm/man/man1/npm-install.1 new file mode 100644 index 0000000000000000000000000000000000000000..6823c7ab422bdec4d5799f682c8e3ec0786dacfe --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-install.1 @@ -0,0 +1,832 @@ +.TH "NPM-INSTALL" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-install\fR - Install a package +.SS "Synopsis" +.P +.RS 2 +.nf +npm install \[lB] ...\[rB] + +aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall +.fi +.RE +.SS "Description" +.P +This command installs a package and any packages that it depends on. If the package has a package-lock, or an npm shrinkwrap file, or a yarn lock file, the installation of dependencies will be driven by that, respecting the following order of precedence: +.RS 0 +.IP \(bu 4 +\fBnpm-shrinkwrap.json\fR +.IP \(bu 4 +\fBpackage-lock.json\fR +.IP \(bu 4 +\fByarn.lock\fR +.RE 0 + +.P +See \fBpackage-lock.json\fR \fI\(la/configuring-npm/package-lock-json\(ra\fR and npm help shrinkwrap. +.SS "How \fBnpm install\fR uses \fBpackage-lock.json\fR" +.P +When you run \fBnpm install\fR without arguments, npm compares \fBpackage.json\fR and \fBpackage-lock.json\fR: +.RS 0 +.IP \(bu 4 +\fBIf the lockfile's resolved versions satisfy the \fBpackage.json\fB ranges:\fR npm uses the exact versions from \fBpackage-lock.json\fR to ensure reproducible builds across environments. +.IP \(bu 4 +\fBIf the ranges don't match:\fR npm resolves new versions that satisfy the \fBpackage.json\fR ranges and updates \fBpackage-lock.json\fR accordingly. This happens when you modify version ranges in \fBpackage.json\fR (e.g., changing \fB^7.0.0\fR to \fB^8.0.0\fR). Note that changing a range within the same major version (e.g., \fB^7.0.0\fR to \fB^7.1.0\fR) will only update the metadata in the lockfile if the currently installed version still satisfies the new range. +.RE 0 + +.P +In essence, \fBpackage-lock.json\fR locks your dependencies to specific versions, but \fBpackage.json\fR is the source of truth for acceptable version ranges. When the lockfile's versions satisfy the \fBpackage.json\fR ranges, the lockfile wins. When they conflict, \fBpackage.json\fR wins and the lockfile is updated. +.P +If you want to install packages while ensuring that \fBpackage.json\fR is not modified and that both files are strictly in sync, use npm help ci instead. +.P +A \fBpackage\fR is: +.RS 0 +.IP \(bu 4 +a) a folder containing a program described by a \fB\[rs]fBpackage.json\[rs]fR\fR \fI\(la/configuring-npm/package-json\(ra\fR file +.IP \(bu 4 +b) a gzipped tarball containing (a) +.IP \(bu 4 +c) a url that resolves to (b) +.IP \(bu 4 +d) a \fB@\fR that is published on the registry (see npm help registry) with (c) +.IP \(bu 4 +e) a \fB@\fR (see npm help dist-tag) that points to (d) +.IP \(bu 4 +f) a \fB\fR that has a "latest" tag satisfying (e) +.IP \(bu 4 +g) a \fB\fR that resolves to (a) +.RE 0 + +.P +Even if you never publish your package, you can still get a lot of benefits of using npm if you just want to write a node program (a), and perhaps if you also want to be able to easily install it elsewhere after packing it up into a tarball (b). +.RS 0 +.IP \(bu 4 +\fBnpm install\fR (in a package directory, no arguments): +.P +Install the dependencies to the local \fBnode_modules\fR folder. +.P +In global mode (ie, with \fB-g\fR or \fB--global\fR appended to the command), it installs the current package context (ie, the current working directory) as a global package. +.P +By default, \fBnpm install\fR will install all modules listed as dependencies in \fB\[rs]fBpackage.json\[rs]fR\fR \fI\(la/configuring-npm/package-json\(ra\fR. +.P +With the \fB--production\fR flag (or when the \fBNODE_ENV\fR environment variable is set to \fBproduction\fR), npm will not install modules listed in \fBdevDependencies\fR. To install all modules listed in both \fBdependencies\fR and \fBdevDependencies\fR when \fBNODE_ENV\fR environment variable is set to \fBproduction\fR, you can use \fB--production=false\fR. +.RS 4 +.P +NOTE: The \fB--production\fR flag has no particular meaning when adding a dependency to a project. +.RE 0 + +.IP \(bu 4 +\fBnpm install \fR: +.P +If \fB\fR sits inside the root of your project, its dependencies will be installed and may be hoisted to the top-level \fBnode_modules\fR as they would for other types of dependencies. If \fB\fR sits outside the root of your project, \fInpm will not install the package dependencies\fR in the directory \fB\fR, but it will create a symlink to \fB\fR. +.RS 4 +.P +NOTE: If you want to install the content of a directory like a package from the registry instead of creating a link, you would need to use the \fB--install-links\fR option. +.RE 0 + +.P +Example: +.P +.RS 2 +.nf +npm install ../../other-package --install-links +npm install ./sub-package +.fi +.RE +.IP \(bu 4 +\fBnpm install \fR: +.P +Install a package that is sitting on the filesystem. Note: if you just want to link a dev directory into your npm root, you can do this more easily by using npm help link. +.P +Tarball requirements: +.RS 4 +.IP \(bu 4 +The filename \fImust\fR use \fB.tar\fR, \fB.tar.gz\fR, or \fB.tgz\fR as the extension. +.IP \(bu 4 +The package contents should reside in a subfolder inside the tarball (usually it is called \fBpackage/\fR). npm strips one directory layer when installing the package (an equivalent of \fBtar x --strip-components=1\fR is run). +.IP \(bu 4 +The package must contain a \fBpackage.json\fR file with \fBname\fR and \fBversion\fR properties. +.RE 0 + +.P +Example: +.P +.RS 2 +.nf +npm install ./package.tgz +.fi +.RE +.IP \(bu 4 +\fBnpm install \fR: +.P +Fetch the tarball url, and then install it. In order to distinguish between this and other options, the argument must start with "http://" or "https://" +.P +Example: +.P +.RS 2 +.nf +npm install https://github.com/indexzero/forever/tarball/v0.5.6 +.fi +.RE +.IP \(bu 4 +\fBnpm install \[lB]<@scope>/\[rB]\fR: +.P +Do a \fB@\fR install, where \fB\fR is the "tag" config. (See \fB\[rs]fBconfig\[rs]fR\fR \fI\(la/using-npm/config#tag\(ra\fR. The config's default value is \fBlatest\fR.) +.P +In most cases, this will install the version of the modules tagged as \fBlatest\fR on the npm registry. +.P +\fBNote:\fR When installing by name without specifying a version or tag, npm prioritizes versions that match the current Node.js version based on the package's \fBengines\fR field. If the \fBlatest\fR tag points to a version incompatible with your current Node.js version, npm will install the newest compatible version instead. To install a specific version regardless of \fBengines\fR compatibility, explicitly specify the version or tag: \fBnpm install @latest\fR. +.P +Example: +.P +.RS 2 +.nf +npm install sax +.fi +.RE +.P +\fBnpm install\fR saves any specified packages into \fBdependencies\fR by default. Additionally, you can control where and how they get saved with some additional flags: +.RS 4 +.IP \(bu 4 +\fB-P, --save-prod\fR: Package will appear in your \fBdependencies\fR. This is the default unless \fB-D\fR or \fB-O\fR are present. +.IP \(bu 4 +\fB-D, --save-dev\fR: Package will appear in your \fBdevDependencies\fR. +.IP \(bu 4 +\fB--save-peer\fR: Package will appear in your \fBpeerDependencies\fR. +.IP \(bu 4 +\fB-O, --save-optional\fR: Package will appear in your \fBoptionalDependencies\fR. +.IP \(bu 4 +\fB--no-save\fR: Prevents saving to \fBdependencies\fR. +.RE 0 + +.P +When using any of the above options to save dependencies to your package.json, there are two additional, optional flags: +.RS 4 +.IP \(bu 4 +\fB-E, --save-exact\fR: Saved dependencies will be configured with an exact version rather than using npm's default semver range operator. +.IP \(bu 4 +\fB-B, --save-bundle\fR: Saved dependencies will also be added to your \fBbundleDependencies\fR list. +.RE 0 + +.P +Further, if you have an \fBnpm-shrinkwrap.json\fR or \fBpackage-lock.json\fR then it will be updated as well. +.P +\fB\fR is optional. The package will be downloaded from the registry associated with the specified scope. If no registry is associated with the given scope the default registry is assumed. See npm help scope. +.P +Note: if you do not include the @-symbol on your scope name, npm will interpret this as a GitHub repository instead, see below. Scopes names must also be followed by a slash. +.P +Examples: +.P +.RS 2 +.nf +npm install sax +npm install githubname/reponame +npm install @myorg/privatepackage +npm install node-tap --save-dev +npm install dtrace-provider --save-optional +npm install readable-stream --save-exact +npm install ansi-regex --save-bundle +.fi +.RE +.IP \(bu 4 +\fBnpm install @npm:\fR: +.P +Install a package under a custom alias. Allows multiple versions of a same-name package side-by-side, more convenient import names for packages with otherwise long ones, and using git forks replacements or forked npm packages as replacements. Aliasing works only on your project and does not rename packages in transitive dependencies. Aliases should follow the naming conventions stated in \fB\[rs]fBvalidate-npm-package-name\[rs]fR\fR \fI\(lahttps://www.npmjs.com/package/validate-npm-package-name#naming-rules\(ra\fR. +.P +Examples: +.P +.RS 2 +.nf +npm install my-react@npm:react +npm install jquery2@npm:jquery@2 +npm install jquery3@npm:jquery@3 +npm install npa@npm:npm-package-arg +.fi +.RE +.IP \(bu 4 +\fBnpm install \[lB]<@scope>/\[rB]@\fR: +.P +Install the version of the package that is referenced by the specified tag. If the tag does not exist in the registry data for that package, then this will fail. +.P +Example: +.P +.RS 2 +.nf +npm install sax@latest +npm install @myorg/mypackage@latest +.fi +.RE +.IP \(bu 4 +\fBnpm install \[lB]<@scope>/\[rB]@\fR: +.P +Install the specified version of the package. This will fail if the version has not been published to the registry. +.P +Example: +.P +.RS 2 +.nf +npm install sax@0.1.1 +npm install @myorg/privatepackage@1.5.0 +.fi +.RE +.IP \(bu 4 +\fBnpm install \[lB]<@scope>/\[rB]@\fR: +.P +Install a version of the package matching the specified version range. This will follow the same rules for resolving dependencies described in \fB\[rs]fBpackage.json\[rs]fR\fR \fI\(la/configuring-npm/package-json\(ra\fR. +.P +Note that most version ranges must be put in quotes so that your shell will treat it as a single argument. +.P +Example: +.P +.RS 2 +.nf +npm install sax@">=0.1.0 <0.2.0" +npm install @myorg/privatepackage@"16 - 17" +.fi +.RE +.P +\fBPrerelease versions:\fR By default, version ranges only match stable versions. To include prerelease versions, they must be explicitly specified in the range. Prerelease versions are tied to a specific version triple (major.minor.patch). For example, \fB^1.2.3-beta.1\fR will only match prereleases for \fB1.2.x\fR, not \fB1.3.x\fR. To match all prereleases for a major version, use a range like \fB^1.0.0-0\fR, which will include all \fB1.x.x\fR prereleases. +.P +Example: +.P +.RS 2 +.nf +npm install package@^1.2.3-beta.1 # Matches 1.2.3-beta.1, 1.2.3-beta.2, 1.2.4-beta.1, etc. +npm install package@^1.0.0-0 # Matches all 1.x.x prereleases and stable versions +.fi +.RE +.IP \(bu 4 +\fBnpm install \fR: +.P +Installs the package from the hosted git provider, cloning it with \fBgit\fR. For a full git remote url, only that URL will be attempted. +.P +.RS 2 +.nf +://\[lB]\[lB]:\[rB]@\[rB]\[lB]:\[rB]\[lB]:\[rB]\[lB]/\[rB]\[lB]# | #semver:\[rB] +.fi +.RE +.P +\fB\fR is one of \fBgit\fR, \fBgit+ssh\fR, \fBgit+http\fR, \fBgit+https\fR, or \fBgit+file\fR. +.P +If \fB#\fR is provided, it will be used to clone exactly that commit. If the commit-ish has the format \fB#semver:\fR, \fB\fR can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. If neither \fB#\fR or \fB#semver:\fR is specified, then the default branch of the repository is used. +.P +If the repository makes use of submodules, those submodules will be cloned as well. +.P +If the package being installed contains a \fBprepare\fR script, its \fBdependencies\fR and \fBdevDependencies\fR will be installed, and the prepare script will be run, before the package is packaged and installed. +.P +The following git environment variables are recognized by npm and will be added to the environment when running git: +.RS 4 +.IP \(bu 4 +\fBGIT_ASKPASS\fR +.IP \(bu 4 +\fBGIT_EXEC_PATH\fR +.IP \(bu 4 +\fBGIT_PROXY_COMMAND\fR +.IP \(bu 4 +\fBGIT_SSH\fR +.IP \(bu 4 +\fBGIT_SSH_COMMAND\fR +.IP \(bu 4 +\fBGIT_SSL_CAINFO\fR +.IP \(bu 4 +\fBGIT_SSL_NO_VERIFY\fR +.RE 0 + +.P +See the git man page for details. +.P +Examples: +.P +.RS 2 +.nf +npm install git+ssh://git@github.com:npm/cli.git#v1.0.27 +npm install git+ssh://git@github.com:npm/cli#pull/273 +npm install git+ssh://git@github.com:npm/cli#semver:^5.0 +npm install git+https://isaacs@github.com/npm/cli.git +npm install git://github.com/npm/cli.git#v1.0.27 +GIT_SSH_COMMAND='ssh -i ~/.ssh/custom_ident' npm install git+ssh://git@github.com:npm/cli.git +.fi +.RE +.IP \(bu 4 +\fBnpm install /\[lB]#\[rB]\fR: +.IP \(bu 4 +\fBnpm install github:/\[lB]#\[rB]\fR: +.P +Install the package at \fBhttps://github.com/githubname/githubrepo\fR by attempting to clone it using \fBgit\fR. +.P +If \fB#\fR is provided, it will be used to clone exactly that commit. If the commit-ish has the format \fB#semver:\fR, \fB\fR can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. If neither \fB#\fR or \fB#semver:\fR is specified, then the default branch is used. +.P +As with regular git dependencies, \fBdependencies\fR and \fBdevDependencies\fR will be installed if the package has a \fBprepare\fR script before the package is done installing. +.P +Examples: +.P +.RS 2 +.nf +npm install mygithubuser/myproject +npm install github:mygithubuser/myproject +.fi +.RE +.IP \(bu 4 +\fBnpm install gist:\[lB]/\[rB]\[lB]#|#semver:\[rB]\fR: +.P +Install the package at \fBhttps://gist.github.com/gistID\fR by attempting to clone it using \fBgit\fR. The GitHub username associated with the gist is optional and will not be saved in \fBpackage.json\fR. +.P +As with regular git dependencies, \fBdependencies\fR and \fBdevDependencies\fR will be installed if the package has a \fBprepare\fR script before the package is done installing. +.P +Example: +.P +.RS 2 +.nf +npm install gist:101a11beef +.fi +.RE +.IP \(bu 4 +\fBnpm install bitbucket:/\[lB]#\[rB]\fR: +.P +Install the package at \fBhttps://bitbucket.org/bitbucketname/bitbucketrepo\fR by attempting to clone it using \fBgit\fR. +.P +If \fB#\fR is provided, it will be used to clone exactly that commit. If the commit-ish has the format \fB#semver:\fR, \fB\fR can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. If neither \fB#\fR or \fB#semver:\fR is specified, then \fBmaster\fR is used. +.P +As with regular git dependencies, \fBdependencies\fR and \fBdevDependencies\fR will be installed if the package has a \fBprepare\fR script before the package is done installing. +.P +Example: +.P +.RS 2 +.nf +npm install bitbucket:mybitbucketuser/myproject +.fi +.RE +.IP \(bu 4 +\fBnpm install gitlab:/\[lB]#\[rB]\fR: +.P +Install the package at \fBhttps://gitlab.com/gitlabname/gitlabrepo\fR by attempting to clone it using \fBgit\fR. +.P +If \fB#\fR is provided, it will be used to clone exactly that commit. If the commit-ish has the format \fB#semver:\fR, \fB\fR can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. If neither \fB#\fR or \fB#semver:\fR is specified, then \fBmaster\fR is used. +.P +As with regular git dependencies, \fBdependencies\fR and \fBdevDependencies\fR will be installed if the package has a \fBprepare\fR script before the package is done installing. +.P +Example: +.P +.RS 2 +.nf +npm install gitlab:mygitlabuser/myproject +npm install gitlab:myusr/myproj#semver:^5.0 +.fi +.RE +.RE 0 + +.P +You may combine multiple arguments and even multiple types of arguments. For example: +.P +.RS 2 +.nf +npm install sax@">=0.1.0 <0.2.0" bench supervisor +.fi +.RE +.P +The \fB--tag\fR argument will apply to all of the specified install targets. If a tag with the given name exists, the tagged version is preferred over newer versions. +.P +\fBNote:\fR The \fB--tag\fR option only affects packages specified on the command line. It does not override version ranges specified in \fBpackage.json\fR. For example, if \fBpackage.json\fR specifies \fB"foo": "^1.0.0"\fR and you run \fBnpm install --tag beta\fR, npm will still install a version matching \fB^1.0.0\fR even if the \fBbeta\fR tag points to a different version. To install a tagged version, specify the package explicitly: \fBnpm install foo@beta\fR. +.P +The \fB--dry-run\fR argument will report in the usual way what the install would have done without actually installing anything. +.P +The \fB--package-lock-only\fR argument will only update the \fBpackage-lock.json\fR, instead of checking \fBnode_modules\fR and downloading dependencies. +.P +The \fB-f\fR or \fB--force\fR argument will force npm to fetch remote resources even if a local copy exists on disk. +.P +.RS 2 +.nf +npm install sax --force +.fi +.RE +.SS "Configuration" +.P +See the npm help config help doc. Many of the configuration params have some effect on installation, since that's most of what npm does. +.P +These are some of the most common options related to installation. +.SS "\fBsave\fR" +.RS 0 +.IP \(bu 4 +Default: \fBtrue\fR unless when using \fBnpm update\fR where it defaults to \fBfalse\fR +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Save installed packages to a \fBpackage.json\fR file as dependencies. +.P +When used with the \fBnpm rm\fR command, removes the dependency from \fBpackage.json\fR. +.P +Will also prevent writing to \fBpackage-lock.json\fR if set to \fBfalse\fR. +.SS "\fBsave-exact\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Dependencies saved to package.json will be configured with an exact version rather than using npm's default semver range operator. +.SS "\fBglobal\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "\fBinstall-strategy\fR" +.RS 0 +.IP \(bu 4 +Default: "hoisted" +.IP \(bu 4 +Type: "hoisted", "nested", "shallow", or "linked" +.RE 0 + +.P +Sets the strategy for installing packages in node_modules. hoisted (default): Install non-duplicated in top-level, and duplicated as necessary within directory structure. nested: (formerly --legacy-bundling) install in place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. +.SS "\fBlegacy-bundling\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=nested\fR +.RE 0 + +.P +Instead of hoisting package installs in \fBnode_modules\fR, install packages in the same manner that they are depended on. This may cause very deep directory structures and duplicate package installs as there is no de-duplicating. Sets \fB--install-strategy=nested\fR. +.SS "\fBglobal-style\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=shallow\fR +.RE 0 + +.P +Only install direct dependencies in the top level \fBnode_modules\fR, but hoist on deeper dependencies. Sets \fB--install-strategy=shallow\fR. +.SS "\fBomit\fR" +.RS 0 +.IP \(bu 4 +Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production'; otherwise, empty. +.IP \(bu 4 +Type: "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Dependency types to omit from the installation tree on disk. +.P +Note that these dependencies \fIare\fR still resolved and added to the \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR file. They are just not physically installed on disk. +.P +If a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included. +.P +If the resulting omit list includes \fB'dev'\fR, then the \fBNODE_ENV\fR environment variable will be set to \fB'production'\fR for all lifecycle scripts. +.SS "\fBinclude\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: "prod", "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Option that allows for defining which types of dependencies to install. +.P +This is the inverse of \fB--omit=\fR. +.P +Dependency types specified in \fB--include\fR will not be omitted, regardless of the order in which omit/include are specified on the command-line. +.SS "\fBstrict-peer-deps\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to \fBtrue\fR, and \fB--legacy-peer-deps\fR is not set, then \fIany\fR conflicting \fBpeerDependencies\fR will be treated as an install failure, even if npm could reasonably guess the appropriate resolution based on non-peer dependency relationships. +.P +By default, conflicting \fBpeerDependencies\fR deep in the dependency graph will be resolved using the nearest non-peer dependency specification, even if doing so will result in some packages receiving a peer dependency outside the range set in their package's \fBpeerDependencies\fR object. +.P +When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If \fB--strict-peer-deps\fR is set, then this warning is treated as a failure. +.SS "\fBprefer-dedupe\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Prefer to deduplicate packages if possible, rather than choosing a newer version of a dependency. +.SS "\fBpackage-lock\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to false, then ignore \fBpackage-lock.json\fR files when installing. This will also prevent \fIwriting\fR \fBpackage-lock.json\fR if \fBsave\fR is true. +.SS "\fBpackage-lock-only\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to true, the current operation will only use the \fBpackage-lock.json\fR, ignoring \fBnode_modules\fR. +.P +For \fBupdate\fR this means only the \fBpackage-lock.json\fR will be updated, instead of checking \fBnode_modules\fR and downloading dependencies. +.P +For \fBlist\fR this means the output will be based on the tree described by the \fBpackage-lock.json\fR, rather than the contents of \fBnode_modules\fR. +.SS "\fBforeground-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: \fBfalse\fR unless when using \fBnpm pack\fR or \fBnpm publish\fR where it defaults to \fBtrue\fR +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Run all build scripts (ie, \fBpreinstall\fR, \fBinstall\fR, and \fBpostinstall\fR) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process. +.P +Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "\fBallow-git\fR" +.RS 0 +.IP \(bu 4 +Default: "all" +.IP \(bu 4 +Type: "all", "none", or "root" +.RE 0 + +.P +Limits the ability for npm to fetch dependencies from git references. That is, dependencies that point to a git repo instead of a version or semver range. Please note that this could leave your tree incomplete and some packages may not function as intended or designed. +.P +\fBall\fR allows any git dependencies to be fetched and installed. \fBnone\fR prevents any git dependencies from being fetched and installed. \fBroot\fR only allows git dependencies defined in your project's package.json to be fetched installed. Also allows git dependencies to be fetched for other commands like \fBnpm view\fR +.SS "\fBaudit\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When "true" submit audit reports alongside the current npm command to the default registry and all registries configured for scopes. See the documentation for npm help audit for details on what is submitted. +.SS "\fBbefore\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Date +.RE 0 + +.P +If passed to \fBnpm install\fR, will rebuild the npm tree such that only versions that were available \fBon or before\fR the given date are installed. If there are no versions available for the current set of dependencies, the command will error. +.P +If the requested version is a \fBdist-tag\fR and the given tag does not pass the \fB--before\fR filter, the most recent version less than or equal to that tag will be used. For example, \fBfoo@latest\fR might install \fBfoo@1.2\fR even though \fBlatest\fR is \fB2.0\fR. +.P +This config cannot be used with: \fBmin-release-age\fR +.SS "\fBmin-release-age\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Number +.RE 0 + +.P +If set, npm will build the npm tree such that only versions that were available more than the given number of days ago will be installed. If there are no versions available for the current set of dependencies, the command will error. +.P +This flag is a complement to \fBbefore\fR, which accepts an exact date instead of a relative number of days. +.P +This config cannot be used with: \fBbefore\fR +.P +This value is not exported to the environment for child processes. +.SS "\fBbin-links\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Tells npm to create symlinks (or \fB.cmd\fR shims on Windows) for package executables. +.P +Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems. +.SS "\fBfund\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When "true" displays the message at the end of each \fBnpm install\fR acknowledging the number of dependencies looking for funding. See npm help fund for details. +.SS "\fBdry-run\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. +.P +Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. +.SS "\fBcpu\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +Override CPU architecture of native modules to install. Acceptable values are same as \fBcpu\fR field of package.json, which comes from \fBprocess.arch\fR. +.SS "\fBos\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +Override OS of native modules to install. Acceptable values are same as \fBos\fR field of package.json, which comes from \fBprocess.platform\fR. +.SS "\fBlibc\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +Override libc of native modules to install. Acceptable values are same as \fBlibc\fR field of package.json +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBinstall-links\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces. +.SS "Algorithm" +.P +Given a \fBpackage{dep}\fR structure: \fBA{B,C}, B{C}, C{D}\fR, the npm install algorithm produces: +.P +.RS 2 +.nf +A ++-- B ++-- C ++-- D +.fi +.RE +.P +That is, the dependency from B to C is satisfied by the fact that A already caused C to be installed at a higher level. D is still installed at the top level because nothing conflicts with it. +.P +For \fBA{B,C}, B{C,D@1}, C{D@2}\fR, this algorithm produces: +.P +.RS 2 +.nf +A ++-- B ++-- C + `-- D@2 ++-- D@1 +.fi +.RE +.P +Because B's D@1 will be installed in the top-level, C now has to install D@2 privately for itself. This algorithm is deterministic, but different trees may be produced if two dependencies are requested for installation in a different order. +.P +See npm help folders for a more detailed description of the specific folder structures that npm creates. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help folders +.IP \(bu 4 +npm help update +.IP \(bu 4 +npm help audit +.IP \(bu 4 +npm help fund +.IP \(bu 4 +npm help link +.IP \(bu 4 +npm help rebuild +.IP \(bu 4 +npm help scripts +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +npm help registry +.IP \(bu 4 +npm help dist-tag +.IP \(bu 4 +npm help uninstall +.IP \(bu 4 +npm help shrinkwrap +.IP \(bu 4 +\fBpackage.json\fR \fI\(la/configuring-npm/package-json\(ra\fR +.IP \(bu 4 +npm help workspaces +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-link.1 b/node24/node_modules/npm/man/man1/npm-link.1 new file mode 100644 index 0000000000000000000000000000000000000000..f1a0f0d69a223b5d8e95cab83f10faa83b4ee652 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-link.1 @@ -0,0 +1,367 @@ +.TH "NPM-LINK" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-link\fR - Symlink a package folder +.SS "Synopsis" +.P +.RS 2 +.nf +npm link \[lB]\[rB] + +alias: ln +.fi +.RE +.SS "Description" +.P +This is handy for installing your own stuff, so that you can work on it and test iteratively without having to continually rebuild. +.P +Package linking is a two-step process. +.P +First, \fBnpm link\fR in a package folder with no arguments will create a symlink in the global folder \fB{prefix}/lib/node_modules/\fR that links to the package where the \fBnpm link\fR command was executed. It will also link any bins in the package to \fB{prefix}/bin/{name}\fR. Note that \fBnpm link\fR uses the global prefix (see \fBnpm prefix -g\fR for its value). +.P +Next, in some other location, \fBnpm link package-name\fR will create a symbolic link from globally-installed \fBpackage-name\fR to \fBnode_modules/\fR of the current folder. +.P +Note that \fBpackage-name\fR is taken from \fBpackage.json\fR, \fInot\fR from the directory name. +.P +The package name can be optionally prefixed with a scope. See npm help scope. The scope must be preceded by an @-symbol and followed by a slash. +.P +When creating tarballs for \fBnpm publish\fR, the linked packages are "snapshotted" to their current state by resolving the symbolic links, if they are included in \fBbundleDependencies\fR. +.P +For example: +.P +.RS 2 +.nf +cd ~/projects/node-redis # go into the package directory +npm link # creates global link +cd ~/projects/node-bloggy # go into some other package directory. +npm link redis # link-install the package +.fi +.RE +.P +Now, any changes to \fB~/projects/node-redis\fR will be reflected in \fB~/projects/node-bloggy/node_modules/node-redis/\fR. Note that the link should be to the package name, not the directory name for that package. +.P +You may also shortcut the two steps in one. For example, to do the above use-case in a shorter way: +.P +.RS 2 +.nf +cd ~/projects/node-bloggy # go into the dir of your main project +npm link ../node-redis # link the dir of your dependency +.fi +.RE +.P +The second line is the equivalent of doing: +.P +.RS 2 +.nf +(cd ../node-redis; npm link) +npm link redis +.fi +.RE +.P +That is, it first creates a global link, and then links the global installation target into your project's \fBnode_modules\fR folder. +.P +Note that in this case, you are referring to the directory name, \fBnode-redis\fR, rather than the package name \fBredis\fR. +.P +If your linked package is scoped (see npm help scope) your link command must include that scope, e.g. +.P +.RS 2 +.nf +npm link @myorg/privatepackage +.fi +.RE +.SS "Caveat" +.P +Note that package dependencies linked in this way are \fInot\fR saved to \fBpackage.json\fR by default, on the assumption that the intention is to have a link stand in for a regular non-link dependency. Otherwise, for example, if you depend on \fBredis@^3.0.1\fR, and ran \fBnpm link redis\fR, it would replace the \fB^3.0.1\fR dependency with \fBfile:../path/to/node-redis\fR, which you probably don't want! Additionally, other users or developers on your project would run into issues if they do not have their folders set up exactly the same as yours. +.P +If you are adding a \fInew\fR dependency as a link, you should add it to the relevant metadata by running \fBnpm install --package-lock-only\fR. +.P +If you \fIwant\fR to save the \fBfile:\fR reference in your \fBpackage.json\fR and \fBpackage-lock.json\fR files, you can use \fBnpm link --save\fR to do so. +.SS "Workspace Usage" +.P +\fBnpm link --workspace \fR will link the relevant package as a dependency of the specified workspace(s). Note that It may actually be linked into the parent project's \fBnode_modules\fR folder, if there are no conflicting dependencies. +.P +\fBnpm link --workspace \fR will create a global link to the specified workspace(s). +.SS "Configuration" +.SS "\fBsave\fR" +.RS 0 +.IP \(bu 4 +Default: \fBtrue\fR unless when using \fBnpm update\fR where it defaults to \fBfalse\fR +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Save installed packages to a \fBpackage.json\fR file as dependencies. +.P +When used with the \fBnpm rm\fR command, removes the dependency from \fBpackage.json\fR. +.P +Will also prevent writing to \fBpackage-lock.json\fR if set to \fBfalse\fR. +.SS "\fBsave-exact\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Dependencies saved to package.json will be configured with an exact version rather than using npm's default semver range operator. +.SS "\fBglobal\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "\fBinstall-strategy\fR" +.RS 0 +.IP \(bu 4 +Default: "hoisted" +.IP \(bu 4 +Type: "hoisted", "nested", "shallow", or "linked" +.RE 0 + +.P +Sets the strategy for installing packages in node_modules. hoisted (default): Install non-duplicated in top-level, and duplicated as necessary within directory structure. nested: (formerly --legacy-bundling) install in place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. +.SS "\fBlegacy-bundling\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=nested\fR +.RE 0 + +.P +Instead of hoisting package installs in \fBnode_modules\fR, install packages in the same manner that they are depended on. This may cause very deep directory structures and duplicate package installs as there is no de-duplicating. Sets \fB--install-strategy=nested\fR. +.SS "\fBglobal-style\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=shallow\fR +.RE 0 + +.P +Only install direct dependencies in the top level \fBnode_modules\fR, but hoist on deeper dependencies. Sets \fB--install-strategy=shallow\fR. +.SS "\fBstrict-peer-deps\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to \fBtrue\fR, and \fB--legacy-peer-deps\fR is not set, then \fIany\fR conflicting \fBpeerDependencies\fR will be treated as an install failure, even if npm could reasonably guess the appropriate resolution based on non-peer dependency relationships. +.P +By default, conflicting \fBpeerDependencies\fR deep in the dependency graph will be resolved using the nearest non-peer dependency specification, even if doing so will result in some packages receiving a peer dependency outside the range set in their package's \fBpeerDependencies\fR object. +.P +When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If \fB--strict-peer-deps\fR is set, then this warning is treated as a failure. +.SS "\fBpackage-lock\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to false, then ignore \fBpackage-lock.json\fR files when installing. This will also prevent \fIwriting\fR \fBpackage-lock.json\fR if \fBsave\fR is true. +.SS "\fBomit\fR" +.RS 0 +.IP \(bu 4 +Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production'; otherwise, empty. +.IP \(bu 4 +Type: "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Dependency types to omit from the installation tree on disk. +.P +Note that these dependencies \fIare\fR still resolved and added to the \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR file. They are just not physically installed on disk. +.P +If a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included. +.P +If the resulting omit list includes \fB'dev'\fR, then the \fBNODE_ENV\fR environment variable will be set to \fB'production'\fR for all lifecycle scripts. +.SS "\fBinclude\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: "prod", "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Option that allows for defining which types of dependencies to install. +.P +This is the inverse of \fB--omit=\fR. +.P +Dependency types specified in \fB--include\fR will not be omitted, regardless of the order in which omit/include are specified on the command-line. +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "\fBallow-git\fR" +.RS 0 +.IP \(bu 4 +Default: "all" +.IP \(bu 4 +Type: "all", "none", or "root" +.RE 0 + +.P +Limits the ability for npm to fetch dependencies from git references. That is, dependencies that point to a git repo instead of a version or semver range. Please note that this could leave your tree incomplete and some packages may not function as intended or designed. +.P +\fBall\fR allows any git dependencies to be fetched and installed. \fBnone\fR prevents any git dependencies from being fetched and installed. \fBroot\fR only allows git dependencies defined in your project's package.json to be fetched installed. Also allows git dependencies to be fetched for other commands like \fBnpm view\fR +.SS "\fBaudit\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When "true" submit audit reports alongside the current npm command to the default registry and all registries configured for scopes. See the documentation for npm help audit for details on what is submitted. +.SS "\fBbin-links\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Tells npm to create symlinks (or \fB.cmd\fR shims on Windows) for package executables. +.P +Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems. +.SS "\fBfund\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When "true" displays the message at the end of each \fBnpm install\fR acknowledging the number of dependencies looking for funding. See npm help fund for details. +.SS "\fBdry-run\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. +.P +Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBinstall-links\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "package spec" +.IP \(bu 4 +npm help developers +.IP \(bu 4 +\fBpackage.json\fR \fI\(la/configuring-npm/package-json\(ra\fR +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help folders +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-ll.1 b/node24/node_modules/npm/man/man1/npm-ll.1 new file mode 100644 index 0000000000000000000000000000000000000000..99e96a192001aac387c383a17f4aa02b450eb454 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-ll.1 @@ -0,0 +1,231 @@ +.TH "NPM-LL" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-ll\fR - List installed packages +.SS "Synopsis" +.P +.RS 2 +.nf +npm ll \[lB]\[lB]<@scope>/\[rB] ...\[rB] + +alias: la +.fi +.RE +.SS "Description" +.P +List installed packages +.SS "Configuration" +.SS "\fBall\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When running \fBnpm outdated\fR and \fBnpm ls\fR, setting \fB--all\fR will show all outdated or installed packages, rather than only those directly depended upon by the current project. +.SS "\fBjson\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to output JSON data, rather than the normal output. +.RS 0 +.IP \(bu 4 +In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. +.RE 0 + +.P +Not supported by all npm commands. +.SS "\fBlong\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Show extended information in \fBls\fR, \fBsearch\fR, and \fBhelp-search\fR. +.SS "\fBparseable\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Output parseable results from commands that write to standard output. For \fBnpm search\fR, this will be tab-separated table format. +.SS "\fBglobal\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "\fBdepth\fR" +.RS 0 +.IP \(bu 4 +Default: \fBInfinity\fR if \fB--all\fR is set; otherwise, \fB0\fR +.IP \(bu 4 +Type: null or Number +.RE 0 + +.P +The depth to go when recursing packages for \fBnpm ls\fR. +.P +If not set, \fBnpm ls\fR will show only the immediate dependencies of the root project. If \fB--all\fR is set, then npm will show all dependencies by default. +.SS "\fBomit\fR" +.RS 0 +.IP \(bu 4 +Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production'; otherwise, empty. +.IP \(bu 4 +Type: "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Dependency types to omit from the installation tree on disk. +.P +Note that these dependencies \fIare\fR still resolved and added to the \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR file. They are just not physically installed on disk. +.P +If a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included. +.P +If the resulting omit list includes \fB'dev'\fR, then the \fBNODE_ENV\fR environment variable will be set to \fB'production'\fR for all lifecycle scripts. +.SS "\fBinclude\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: "prod", "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Option that allows for defining which types of dependencies to install. +.P +This is the inverse of \fB--omit=\fR. +.P +Dependency types specified in \fB--include\fR will not be omitted, regardless of the order in which omit/include are specified on the command-line. +.SS "\fBlink\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Used with \fBnpm ls\fR, limiting output to only those packages that are linked. +.SS "\fBpackage-lock-only\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to true, the current operation will only use the \fBpackage-lock.json\fR, ignoring \fBnode_modules\fR. +.P +For \fBupdate\fR this means only the \fBpackage-lock.json\fR will be updated, instead of checking \fBnode_modules\fR and downloading dependencies. +.P +For \fBlist\fR this means the output will be based on the tree described by the \fBpackage-lock.json\fR, rather than the contents of \fBnode_modules\fR. +.SS "\fBunicode\fR" +.RS 0 +.IP \(bu 4 +Default: false on windows, true on mac/unix systems with a unicode locale, as defined by the \fBLC_ALL\fR, \fBLC_CTYPE\fR, or \fBLANG\fR environment variables. +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set to true, npm uses unicode characters in the tree output. When false, it uses ascii characters instead of unicode glyphs. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBinstall-links\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "help config" +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-login.1 b/node24/node_modules/npm/man/man1/npm-login.1 new file mode 100644 index 0000000000000000000000000000000000000000..48d62a6fff63c5932a4e4eb74fa56724c2995dc5 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-login.1 @@ -0,0 +1,97 @@ +.TH "NPM-LOGIN" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-login\fR - Login to a registry user account +.SS "Synopsis" +.P +.RS 2 +.nf +npm login +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +Verify a user in the specified registry, and save the credentials to the \fB.npmrc\fR file. If no registry is specified, the default registry will be used (see npm help config). +.P +When you run \fBnpm login\fR, the CLI automatically generates a legacy token of \fBpublish\fR type. For more information, see \fBAbout legacy tokens\fR \fI\(la/about-access-tokens#about-legacy-tokens\(ra\fR. +.P +When using \fBlegacy\fR for your \fBauth-type\fR, the username and password, are read in from prompts. +.P +To reset your password, go to \fI\(lahttps://www.npmjs.com/forgot\(ra\fR +.P +To change your email address, go to \fI\(lahttps://www.npmjs.com/email-edit\(ra\fR +.P +You may use this command multiple times with the same user account to authorize on a new machine. When authenticating on a new machine, the username, password and email address must all match with your existing record. +.SS "Configuration" +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "\fBscope\fR" +.RS 0 +.IP \(bu 4 +Default: the scope of the current project, if any, or "" +.IP \(bu 4 +Type: String +.RE 0 + +.P +Associate an operation with a scope for a scoped registry. +.P +Useful when logging in to or out of a private registry: +.P +.RS 2 +.nf +# log in, linking the scope to the custom registry +npm login --scope=@mycorp --registry=https://registry.mycorp.com + +# log out, removing the link and the auth token +npm logout --scope=@mycorp +.fi +.RE +.P +This will cause \fB@mycorp\fR to be mapped to the registry for future installation of packages specified according to the pattern \fB@mycorp/package\fR. +.P +This will also cause \fBnpm init\fR to create a scoped package. +.P +.RS 2 +.nf +# accept all defaults, and create a package named "@foo/whatever", +# instead of just named "whatever" +npm init --scope=@foo --yes +.fi +.RE +.SS "\fBauth-type\fR" +.RS 0 +.IP \(bu 4 +Default: "web" +.IP \(bu 4 +Type: "legacy" or "web" +.RE 0 + +.P +What authentication strategy to use with \fBlogin\fR. Note that if an \fBotp\fR config is given, this value will always be set to \fBlegacy\fR. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help registry +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +npm help owner +.IP \(bu 4 +npm help whoami +.IP \(bu 4 +npm help token +.IP \(bu 4 +npm help profile +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-logout.1 b/node24/node_modules/npm/man/man1/npm-logout.1 new file mode 100644 index 0000000000000000000000000000000000000000..418b922fa6b72689fbe99c8f7df784e3a1869371 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-logout.1 @@ -0,0 +1,75 @@ +.TH "NPM-LOGOUT" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-logout\fR - Log out of the registry +.SS "Synopsis" +.P +.RS 2 +.nf +npm logout +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +When logged into a registry that supports token-based authentication, tell the server to end this token's session. This will invalidate the token everywhere you're using it, not just for the current environment. +.P +When logged into a legacy registry that uses username and password authentication, this will clear the credentials in your user configuration. In this case, it will \fIonly\fR affect the current environment. +.P +If \fB--scope\fR is provided, this will find the credentials for the registry connected to that scope, if set. +.SS "Configuration" +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "\fBscope\fR" +.RS 0 +.IP \(bu 4 +Default: the scope of the current project, if any, or "" +.IP \(bu 4 +Type: String +.RE 0 + +.P +Associate an operation with a scope for a scoped registry. +.P +Useful when logging in to or out of a private registry: +.P +.RS 2 +.nf +# log in, linking the scope to the custom registry +npm login --scope=@mycorp --registry=https://registry.mycorp.com + +# log out, removing the link and the auth token +npm logout --scope=@mycorp +.fi +.RE +.P +This will cause \fB@mycorp\fR to be mapped to the registry for future installation of packages specified according to the pattern \fB@mycorp/package\fR. +.P +This will also cause \fBnpm init\fR to create a scoped package. +.P +.RS 2 +.nf +# accept all defaults, and create a package named "@foo/whatever", +# instead of just named "whatever" +npm init --scope=@foo --yes +.fi +.RE +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help adduser +.IP \(bu 4 +npm help registry +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help whoami +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-ls.1 b/node24/node_modules/npm/man/man1/npm-ls.1 new file mode 100644 index 0000000000000000000000000000000000000000..8e1df26207cce11ac1235cef6b302e948de4da84 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-ls.1 @@ -0,0 +1,271 @@ +.TH "NPM-LS" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-ls\fR - List installed packages +.SS "Synopsis" +.P +.RS 2 +.nf +npm ls + +alias: list +.fi +.RE +.SS "Description" +.P +This command will print to stdout all the versions of packages that are installed, as well as their dependencies when \fB--all\fR is specified, in a tree structure. +.P +Note: to get a "bottoms up" view of why a given package is included in the tree at all, use npm help explain. +.P +Positional arguments are \fBname@version-range\fR identifiers, which will limit the results to only the paths to the packages named. Note that nested packages will \fIalso\fR show the paths to the specified packages. For example, running \fBnpm ls promzard\fR in npm's source tree will show: +.P +.RS 2 +.nf +npm@11.12.1 /path/to/npm +└─┬ init-package-json@0.0.4 + └── promzard@0.1.5 +.fi +.RE +.P +It will print out extraneous, missing, and invalid packages. +.P +If a project specifies git urls for dependencies these are shown in parentheses after the \fBname@version\fR to make it easier for users to recognize potential forks of a project. +.P +The tree shown is the logical dependency tree, based on package dependencies, not the physical layout of your \fBnode_modules\fR folder. +.P +When run as \fBll\fR or \fBla\fR, it shows extended information by default. +.SS "Configuration" +.SS "\fBall\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When running \fBnpm outdated\fR and \fBnpm ls\fR, setting \fB--all\fR will show all outdated or installed packages, rather than only those directly depended upon by the current project. +.SS "\fBjson\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to output JSON data, rather than the normal output. +.RS 0 +.IP \(bu 4 +In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. +.RE 0 + +.P +Not supported by all npm commands. +.SS "\fBlong\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Show extended information in \fBls\fR, \fBsearch\fR, and \fBhelp-search\fR. +.SS "\fBparseable\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Output parseable results from commands that write to standard output. For \fBnpm search\fR, this will be tab-separated table format. +.SS "\fBglobal\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "\fBdepth\fR" +.RS 0 +.IP \(bu 4 +Default: \fBInfinity\fR if \fB--all\fR is set; otherwise, \fB0\fR +.IP \(bu 4 +Type: null or Number +.RE 0 + +.P +The depth to go when recursing packages for \fBnpm ls\fR. +.P +If not set, \fBnpm ls\fR will show only the immediate dependencies of the root project. If \fB--all\fR is set, then npm will show all dependencies by default. +.SS "\fBomit\fR" +.RS 0 +.IP \(bu 4 +Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production'; otherwise, empty. +.IP \(bu 4 +Type: "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Dependency types to omit from the installation tree on disk. +.P +Note that these dependencies \fIare\fR still resolved and added to the \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR file. They are just not physically installed on disk. +.P +If a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included. +.P +If the resulting omit list includes \fB'dev'\fR, then the \fBNODE_ENV\fR environment variable will be set to \fB'production'\fR for all lifecycle scripts. +.SS "\fBinclude\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: "prod", "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Option that allows for defining which types of dependencies to install. +.P +This is the inverse of \fB--omit=\fR. +.P +Dependency types specified in \fB--include\fR will not be omitted, regardless of the order in which omit/include are specified on the command-line. +.SS "\fBlink\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Used with \fBnpm ls\fR, limiting output to only those packages that are linked. +.SS "\fBpackage-lock-only\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to true, the current operation will only use the \fBpackage-lock.json\fR, ignoring \fBnode_modules\fR. +.P +For \fBupdate\fR this means only the \fBpackage-lock.json\fR will be updated, instead of checking \fBnode_modules\fR and downloading dependencies. +.P +For \fBlist\fR this means the output will be based on the tree described by the \fBpackage-lock.json\fR, rather than the contents of \fBnode_modules\fR. +.SS "\fBunicode\fR" +.RS 0 +.IP \(bu 4 +Default: false on windows, true on mac/unix systems with a unicode locale, as defined by the \fBLC_ALL\fR, \fBLC_CTYPE\fR, or \fBLANG\fR environment variables. +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set to true, npm uses unicode characters in the tree output. When false, it uses ascii characters instead of unicode glyphs. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBinstall-links\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "package spec" +.IP \(bu 4 +npm help explain +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +npm help folders +.IP \(bu 4 +npm help explain +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help link +.IP \(bu 4 +npm help prune +.IP \(bu 4 +npm help outdated +.IP \(bu 4 +npm help update +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-org.1 b/node24/node_modules/npm/man/man1/npm-org.1 new file mode 100644 index 0000000000000000000000000000000000000000..eafd9ebe0c027ffbd4efb226401f7fd6d1cd11e9 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-org.1 @@ -0,0 +1,125 @@ +.TH "NPM-ORG" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-org\fR - Manage orgs +.SS "Synopsis" +.P +.RS 2 +.nf +npm org set orgname username \[lB]developer | admin | owner\[rB] +npm org rm orgname username +npm org ls orgname \[lB]\[rB] + +alias: ogr +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Example" +.P +Add a new developer to an org: +.P +.RS 2 +.nf +$ npm org set my-org @mx-smith +.fi +.RE +.P +Add a new admin to an org (or change a developer to an admin): +.P +.RS 2 +.nf +$ npm org set my-org @mx-santos admin +.fi +.RE +.P +Remove a user from an org: +.P +.RS 2 +.nf +$ npm org rm my-org mx-santos +.fi +.RE +.P +List all users in an org: +.P +.RS 2 +.nf +$ npm org ls my-org +.fi +.RE +.P +List all users in JSON format: +.P +.RS 2 +.nf +$ npm org ls my-org --json +.fi +.RE +.P +See what role a user has in an org: +.P +.RS 2 +.nf +$ npm org ls my-org @mx-santos +.fi +.RE +.SS "Description" +.P +You can use the \fBnpm org\fR commands to manage and view users of an organization. It supports adding and removing users, changing their roles, listing them, and finding specific ones and their roles. +.SS "Configuration" +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "\fBotp\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with \fBnpm access\fR. +.P +If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. +.SS "\fBjson\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to output JSON data, rather than the normal output. +.RS 0 +.IP \(bu 4 +In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. +.RE 0 + +.P +Not supported by all npm commands. +.SS "\fBparseable\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Output parseable results from commands that write to standard output. For \fBnpm search\fR, this will be tab-separated table format. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "using orgs" +.IP \(bu 4 +\fBDocumentation on npm Orgs\fR \fI\(lahttps://docs.npmjs.com/orgs/\(ra\fR +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-outdated.1 b/node24/node_modules/npm/man/man1/npm-outdated.1 new file mode 100644 index 0000000000000000000000000000000000000000..509b108e954d9e23d764c0361e83495eabe45d75 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-outdated.1 @@ -0,0 +1,214 @@ +.TH "NPM-OUTDATED" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-outdated\fR - Check for outdated packages +.SS "Synopsis" +.P +.RS 2 +.nf +npm outdated \[lB] ...\[rB] +.fi +.RE +.SS "Description" +.P +This command will check the registry to see if any (or, specific) installed packages are currently outdated. +.P +By default, only the direct dependencies of the root project and direct dependencies of your configured \fIworkspaces\fR are shown. Use \fB--all\fR to find all outdated meta-dependencies as well. +.P +In the output: +.RS 0 +.IP \(bu 4 +\fBwanted\fR is the maximum version of the package that satisfies the semver range specified in \fBpackage.json\fR. If there's no available semver range (i.e. you're running \fBnpm outdated --global\fR, or the package isn't included in \fBpackage.json\fR), then \fBwanted\fR shows the currently-installed version. +.IP \(bu 4 +\fBlatest\fR is the version of the package tagged as latest in the registry. Running \fBnpm publish\fR with no special configuration will publish the package with a dist-tag of \fBlatest\fR. This may or may not be the maximum version of the package, or the most-recently published version of the package, depending on how the package's developer manages the latest npm help dist-tag. +.IP \(bu 4 +\fBlocation\fR is where in the physical tree the package is located. +.IP \(bu 4 +\fBdepended by\fR shows which package depends on the displayed dependency +.IP \(bu 4 +\fBpackage type\fR (when using \fB--long\fR / \fB-l\fR) tells you whether this package is a \fBdependency\fR or a dev/peer/optional dependency. Packages not included in \fBpackage.json\fR are always marked \fBdependencies\fR. +.IP \(bu 4 +\fBhomepage\fR (when using \fB--long\fR / \fB-l\fR) is the \fBhomepage\fR value contained in the package's packument +.IP \(bu 4 +\fBdepended by location\fR (when using \fB--long\fR / \fB-l\fR) shows location of the package that depends on the displayed dependency +.IP \(bu 4 +Red means there's a newer version matching your semver requirements, so you should update now. +.IP \(bu 4 +Yellow indicates that there's a newer version \fIabove\fR your semver requirements (usually new major, or new 0.x minor) so proceed with caution. +.RE 0 + +.SS "An example" +.P +.RS 2 +.nf +$ npm outdated +Package Current Wanted Latest Location Depended by +glob 5.0.15 5.0.15 6.0.1 node_modules/glob dependent-package-name +nothingness 0.0.3 git git node_modules/nothingness dependent-package-name +npm 3.5.1 3.5.2 3.5.1 node_modules/npm dependent-package-name +local-dev 0.0.3 linked linked local-dev dependent-package-name +once 1.3.2 1.3.3 1.3.3 node_modules/once dependent-package-name +.fi +.RE +.P +With these \fBdependencies\fR: +.P +.RS 2 +.nf +{ + "glob": "^5.0.15", + "nothingness": "github:othiym23/nothingness#master", + "npm": "^3.5.1", + "once": "^1.3.1" +} +.fi +.RE +.P +A few things to note: +.RS 0 +.IP \(bu 4 +\fBglob\fR requires \fB^5\fR, which prevents npm from installing \fBglob@6\fR, which is outside the semver range. +.IP \(bu 4 +Git dependencies will always be reinstalled, because of how they're specified. The installed committish might satisfy the dependency specifier (if it's something immutable, like a commit SHA), or it might not, so \fBnpm outdated\fR and \fBnpm update\fR have to fetch Git repos to check. This is why currently doing a reinstall of a Git dependency always forces a new clone and install. +.IP \(bu 4 +\fBnpm@3.5.2\fR is marked as "wanted", but "latest" is \fBnpm@3.5.1\fR because npm uses dist-tags to manage its \fBlatest\fR and \fBnext\fR release channels. \fBnpm update\fR will install the \fInewest\fR version, but \fBnpm install npm\fR (with no semver range) will install whatever's tagged as \fBlatest\fR. +.IP \(bu 4 +\fBonce\fR is just plain out of date. Reinstalling \fBnode_modules\fR from scratch or running \fBnpm update\fR will bring it up to spec. +.RE 0 + +.SS "Configuration" +.SS "\fBall\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When running \fBnpm outdated\fR and \fBnpm ls\fR, setting \fB--all\fR will show all outdated or installed packages, rather than only those directly depended upon by the current project. +.SS "\fBjson\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to output JSON data, rather than the normal output. +.RS 0 +.IP \(bu 4 +In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. +.RE 0 + +.P +Not supported by all npm commands. +.SS "\fBlong\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Show extended information in \fBls\fR, \fBsearch\fR, and \fBhelp-search\fR. +.SS "\fBparseable\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Output parseable results from commands that write to standard output. For \fBnpm search\fR, this will be tab-separated table format. +.SS "\fBglobal\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBbefore\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Date +.RE 0 + +.P +If passed to \fBnpm install\fR, will rebuild the npm tree such that only versions that were available \fBon or before\fR the given date are installed. If there are no versions available for the current set of dependencies, the command will error. +.P +If the requested version is a \fBdist-tag\fR and the given tag does not pass the \fB--before\fR filter, the most recent version less than or equal to that tag will be used. For example, \fBfoo@latest\fR might install \fBfoo@1.2\fR even though \fBlatest\fR is \fB2.0\fR. +.P +This config cannot be used with: \fBmin-release-age\fR +.SS "\fBmin-release-age\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Number +.RE 0 + +.P +If set, npm will build the npm tree such that only versions that were available more than the given number of days ago will be installed. If there are no versions available for the current set of dependencies, the command will error. +.P +This flag is a complement to \fBbefore\fR, which accepts an exact date instead of a relative number of days. +.P +This config cannot be used with: \fBbefore\fR +.P +This value is not exported to the environment for child processes. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "package spec" +.IP \(bu 4 +npm help update +.IP \(bu 4 +npm help dist-tag +.IP \(bu 4 +npm help registry +.IP \(bu 4 +npm help folders +.IP \(bu 4 +npm help workspaces +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-owner.1 b/node24/node_modules/npm/man/man1/npm-owner.1 new file mode 100644 index 0000000000000000000000000000000000000000..8b86d90c7678d135790f6bec963374e0110f79cc --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-owner.1 @@ -0,0 +1,110 @@ +.TH "NPM-OWNER" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-owner\fR - Manage package owners +.SS "Synopsis" +.P +.RS 2 +.nf +npm owner add +npm owner rm +npm owner ls + +alias: author +.fi +.RE +.SS "Description" +.P +Manage ownership of published packages. +.RS 0 +.IP \(bu 4 +ls: List all the users who have access to modify a package and push new versions. Handy when you need to know who to bug for help. +.IP \(bu 4 +add: Add a new user as a maintainer of a package. This user is enabled to modify metadata, publish new versions, and add other owners. +.IP \(bu 4 +rm: Remove a user from the package owner list. This immediately revokes their privileges. +.RE 0 + +.P +Note that there is only one level of access. Either you can modify a package, or you can't. Future versions may contain more fine-grained access levels, but that is not implemented at this time. +.P +If you have two-factor authentication enabled with \fBauth-and-writes\fR (see npm help npm-profile) then you'll need to go through a second factor flow when changing ownership or include an otp on the command line with \fB--otp\fR. +.SS "Configuration" +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "\fBotp\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with \fBnpm access\fR. +.P +If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "package spec" +.IP \(bu 4 +npm help profile +.IP \(bu 4 +npm help publish +.IP \(bu 4 +npm help registry +.IP \(bu 4 +npm help adduser +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-pack.1 b/node24/node_modules/npm/man/man1/npm-pack.1 new file mode 100644 index 0000000000000000000000000000000000000000..c95dcb91972a530a084cb654a5c8ae0d8b79a4ce --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-pack.1 @@ -0,0 +1,142 @@ +.TH "NPM-PACK" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-pack\fR - Create a tarball from a package +.SS "Synopsis" +.P +.RS 2 +.nf +npm pack +.fi +.RE +.SS "Configuration" +.SS "\fBdry-run\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. +.P +Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. +.SS "\fBjson\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to output JSON data, rather than the normal output. +.RS 0 +.IP \(bu 4 +In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. +.RE 0 + +.P +Not supported by all npm commands. +.SS "\fBpack-destination\fR" +.RS 0 +.IP \(bu 4 +Default: "." +.IP \(bu 4 +Type: String +.RE 0 + +.P +Directory in which \fBnpm pack\fR will save tarballs. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "Description" +.P +For anything that's installable (that is, a package folder, tarball, tarball url, git url, name@tag, name@version, name, or scoped name), this command will fetch it to the cache, copy the tarball to the current working directory as \fB-.tgz\fR, and then write the filenames out to stdout. +.P +If the same package is specified multiple times, then the file will be overwritten the second time. +.P +If no arguments are supplied, then npm packs the current package folder. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "package spec" +.IP \(bu 4 +\fBnpm-packlist package\fR \fI\(lahttp://npm.im/npm-packlist\(ra\fR +.IP \(bu 4 +npm help cache +.IP \(bu 4 +npm help publish +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-ping.1 b/node24/node_modules/npm/man/man1/npm-ping.1 new file mode 100644 index 0000000000000000000000000000000000000000..a35fec2af05a1e79dc8a1baa96bb77ab6db5a1f4 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-ping.1 @@ -0,0 +1,52 @@ +.TH "NPM-PING" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-ping\fR - Ping npm registry +.SS "Synopsis" +.P +.RS 2 +.nf +npm ping +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +Ping the configured or given npm registry and verify authentication. If it works it will output something like: +.P +.RS 2 +.nf +npm notice PING https://registry.npmjs.org/ +npm notice PONG 255ms +.fi +.RE +.P +otherwise you will get an error: +.P +.RS 2 +.nf +npm notice PING http://foo.com/ +npm ERR! code E404 +npm ERR! 404 Not Found - GET http://www.foo.com/-/ping?write=true +.fi +.RE +.SS "Configuration" +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help doctor +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-pkg.1 b/node24/node_modules/npm/man/man1/npm-pkg.1 new file mode 100644 index 0000000000000000000000000000000000000000..49dc0aa5530d50fc16042a4d5b82c720dd621266 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-pkg.1 @@ -0,0 +1,286 @@ +.TH "NPM-PKG" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-pkg\fR - Manages your package.json +.SS "Synopsis" +.P +.RS 2 +.nf +npm pkg set = \[lB]= ...\[rB] +npm pkg get \[lB] \[lB] ...\[rB]\[rB] +npm pkg delete \[lB] ...\[rB] +npm pkg set \[lB]\[lB]\[rB].= ...\[rB] +npm pkg set \[lB]\[lB]\[rB].= ...\[rB] +npm pkg fix +.fi +.RE +.SS "Description" +.P +A command that automates the management of \fBpackage.json\fR files. \fBnpm pkg\fR provide 3 different sub commands that allow you to modify or retrieve values for given object keys in your \fBpackage.json\fR. +.P +The syntax to retrieve and set fields is a dot separated representation of the nested object properties to be found within your \fBpackage.json\fR, it's the same notation used in npm help view to retrieve information from the registry manifest, below you can find more examples on how to use it. +.P +Returned values are always in \fBjson\fR format. +.RS 0 +.IP \(bu 4 +\fBnpm pkg get \fR +.P +Retrieves a value \fBkey\fR, defined in your \fBpackage.json\fR file. +.P +For example, in order to retrieve the name of the current package, you can run: +.P +.RS 2 +.nf +npm pkg get name +.fi +.RE +.P +It's also possible to retrieve multiple values at once: +.P +.RS 2 +.nf +npm pkg get name version +.fi +.RE +.P +You can view child fields by separating them with a period. To retrieve the value of a test \fBscript\fR value, you would run the following command: +.P +.RS 2 +.nf +npm pkg get scripts.test +.fi +.RE +.P +For fields that are arrays, requesting a non-numeric field will return all of the values from the objects in the list. For example, to get all the contributor emails for a package, you would run: +.P +.RS 2 +.nf +npm pkg get contributors.email +.fi +.RE +.P +You may also use numeric indices in square braces to specifically select an item in an array field. To just get the email address of the first contributor in the list, you can run: +.P +.RS 2 +.nf +npm pkg get contributors\[lB]0\[rB].email +.fi +.RE +.P +For complex fields you can also name a property in square brackets to specifically select a child field. This is especially helpful with the exports object: +.P +.RS 2 +.nf +npm pkg get "exports\[lB].\[rB].require" +.fi +.RE +.IP \(bu 4 +\fBnpm pkg set =\fR +.P +Sets a \fBvalue\fR in your \fBpackage.json\fR based on the \fBfield\fR value. When saving to your \fBpackage.json\fR file the same set of rules used during \fBnpm install\fR and other cli commands that touches the \fBpackage.json\fR file are used, making sure to respect the existing indentation and possibly applying some validation prior to saving values to the file. +.P +The same syntax used to retrieve values from your package can also be used to define new properties or overriding existing ones, below are some examples of how the dot separated syntax can be used to edit your \fBpackage.json\fR file. +.P +Defining a new bin named \fBmynewcommand\fR in your \fBpackage.json\fR that points to a file \fBcli.js\fR: +.P +.RS 2 +.nf +npm pkg set bin.mynewcommand=cli.js +.fi +.RE +.P +Setting multiple fields at once is also possible: +.P +.RS 2 +.nf +npm pkg set description='Awesome package' engines.node='>=10' +.fi +.RE +.P +It's also possible to add to array values, for example to add a new contributor entry: +.P +.RS 2 +.nf +npm pkg set contributors\[lB]0\[rB].name='Foo' contributors\[lB]0\[rB].email='foo@bar.ca' +.fi +.RE +.P +You may also append items to the end of an array using the special empty bracket notation: +.P +.RS 2 +.nf +npm pkg set contributors\[lB]\[rB].name='Foo' contributors\[lB]\[rB].name='Bar' +.fi +.RE +.P +It's also possible to parse values as json prior to saving them to your \fBpackage.json\fR file, for example in order to set a \fB"private": true\fR property: +.P +.RS 2 +.nf +npm pkg set private=true --json +.fi +.RE +.P +It also enables saving values as numbers: +.P +.RS 2 +.nf +npm pkg set tap.timeout=60 --json +.fi +.RE +.IP \(bu 4 +\fBnpm pkg delete \fR +.P +Deletes a \fBkey\fR from your \fBpackage.json\fR +.P +The same syntax used to set values from your package can also be used to remove existing ones. For example, in order to remove a script named build: +.P +.RS 2 +.nf +npm pkg delete scripts.build +.fi +.RE +.IP \(bu 4 +\fBnpm pkg fix\fR +.P +Auto corrects common errors in your \fBpackage.json\fR. npm already does this during \fBpublish\fR, which leads to subtle (mostly harmless) differences between the contents of your \fBpackage.json\fR file and the manifest that npm uses during installation. +.RE 0 + +.SS "Workspaces support" +.P +You can set/get/delete items across your configured workspaces by using the \fB\[rs]fBworkspace\[rs]fR\fR \fI\(la/using-npm/config#workspace\(ra\fR or \fB\[rs]fBworkspaces\[rs]fR\fR \fI\(la/using-npm/config#workspaces\(ra\fR config options. +.P +For example, setting a \fBfunding\fR value across all configured workspaces of a project: +.P +.RS 2 +.nf +npm pkg set funding=https://example.com --ws +.fi +.RE +.P +When using \fBnpm pkg get\fR to retrieve info from your configured workspaces, the returned result will be in a json format in which top level keys are the names of each workspace, the values of these keys will be the result values returned from each of the configured workspaces, e.g: +.P +.RS 2 +.nf +npm pkg get name version --ws +{ + "a": { + "name": "a", + "version": "1.0.0" + }, + "b": { + "name": "b", + "version": "1.0.0" + } +} +.fi +.RE +.SS "Configuration" +.SS "\fBforce\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Removes various protections against unfortunate side effects, common mistakes, unnecessary performance degradation, and malicious input. +.RS 0 +.IP \(bu 4 +Allow clobbering non-npm files in global installs. +.IP \(bu 4 +Allow the \fBnpm version\fR command to work on an unclean git repository. +.IP \(bu 4 +Allow deleting the cache folder with \fBnpm cache clean\fR. +.IP \(bu 4 +Allow installing packages that have an \fBengines\fR declaration requiring a different version of npm. +.IP \(bu 4 +Allow installing packages that have an \fBengines\fR declaration requiring a different version of \fBnode\fR, even if \fB--engine-strict\fR is enabled. +.IP \(bu 4 +Allow \fBnpm audit fix\fR to install modules outside your stated dependency range (including SemVer-major changes). +.IP \(bu 4 +Allow unpublishing all versions of a published package. +.IP \(bu 4 +Allow conflicting peerDependencies to be installed in the root project. +.IP \(bu 4 +Implicitly set \fB--yes\fR during \fBnpm init\fR. +.IP \(bu 4 +Allow clobbering existing values in \fBnpm pkg\fR +.IP \(bu 4 +Allow unpublishing of entire packages (not just a single version). +.RE 0 + +.P +If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! +.SS "\fBjson\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to output JSON data, rather than the normal output. +.RS 0 +.IP \(bu 4 +In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. +.RE 0 + +.P +Not supported by all npm commands. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SH "SEE ALSO" +.RS 0 +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help init +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help workspaces +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-prefix.1 b/node24/node_modules/npm/man/man1/npm-prefix.1 new file mode 100644 index 0000000000000000000000000000000000000000..9ad56b74e8a4df583fe292aebf7ef69a26a9ce36 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-prefix.1 @@ -0,0 +1,63 @@ +.TH "NPM-PREFIX" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-prefix\fR - Display prefix +.SS "Synopsis" +.P +.RS 2 +.nf +npm prefix +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +Print the local prefix to standard output. This is the closest parent directory to contain a \fBpackage.json\fR file or \fBnode_modules\fR directory, unless \fB-g\fR is also specified. +.P +If \fB-g\fR is specified, this will be the value of the global prefix. See npm help config for more detail. +.SS "Example" +.P +.RS 2 +.nf +npm prefix +/usr/local/projects/foo +.fi +.RE +.P +.RS 2 +.nf +npm prefix -g +/usr/local +.fi +.RE +.SS "Configuration" +.SS "\fBglobal\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help root +.IP \(bu 4 +npm help folders +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-profile.1 b/node24/node_modules/npm/man/man1/npm-profile.1 new file mode 100644 index 0000000000000000000000000000000000000000..83b60632f7668b5a0024d59e462b865e2239da77 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-profile.1 @@ -0,0 +1,126 @@ +.TH "NPM-PROFILE" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-profile\fR - Change settings on your registry profile +.SS "Synopsis" +.P +.RS 2 +.nf +npm profile enable-2fa \[lB]auth-only|auth-and-writes\[rB] +npm profile disable-2fa +npm profile get \[lB]\[rB] +npm profile set +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +Change your profile information on the registry. Note that this command depends on the registry implementation, so third-party registries may not support this interface. +.RS 0 +.IP \(bu 4 +\fBnpm profile get \[lB]\[rB]\fR: Display all of the properties of your profile, or one or more specific properties. It looks like: +.RE 0 + +.P +.RS 2 +.nf +name: example +email: e@example.com (verified) +two-factor auth: auth-and-writes +fullname: Example User +homepage: +freenode: +twitter: +github: +created: 2015-02-26T01:38:35.892Z +updated: 2017-10-02T21:29:45.922Z +.fi +.RE +.RS 0 +.IP \(bu 4 +\fBnpm profile set \fR: Set the value of a profile property. You can set the following properties this way: email, fullname, homepage, freenode, twitter, github +.IP \(bu 4 +\fBnpm profile set password\fR: Change your password. This is interactive, you'll be prompted for your current password and a new password. You'll also be prompted for an OTP if you have two-factor authentication enabled. +.IP \(bu 4 +\fBnpm profile enable-2fa \[lB]auth-and-writes|auth-only\[rB]\fR: Enables two-factor authentication. Defaults to \fBauth-and-writes\fR mode. Modes are: +.RS 4 +.IP \(bu 4 +\fBauth-only\fR: Require an OTP when logging in or making changes to your account's authentication. The OTP will be required on both the website and the command line. +.IP \(bu 4 +\fBauth-and-writes\fR: Requires an OTP at all the times \fBauth-only\fR does, and also requires one when publishing a module, setting the \fBlatest\fR dist-tag, or changing access via \fBnpm access\fR and \fBnpm owner\fR. +.RE 0 + +.IP \(bu 4 +\fBnpm profile disable-2fa\fR: Disables two-factor authentication. +.RE 0 + +.SS "Details" +.P +Some of these commands may not be available on non npmjs.com registries. +.SS "Configuration" +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "\fBjson\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to output JSON data, rather than the normal output. +.RS 0 +.IP \(bu 4 +In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. +.RE 0 + +.P +Not supported by all npm commands. +.SS "\fBparseable\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Output parseable results from commands that write to standard output. For \fBnpm search\fR, this will be tab-separated table format. +.SS "\fBotp\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with \fBnpm access\fR. +.P +If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help adduser +.IP \(bu 4 +npm help registry +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +npm help owner +.IP \(bu 4 +npm help whoami +.IP \(bu 4 +npm help token +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-prune.1 b/node24/node_modules/npm/man/man1/npm-prune.1 new file mode 100644 index 0000000000000000000000000000000000000000..577407d97dfb9287e81e94b8ca5e19968a6e658a --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-prune.1 @@ -0,0 +1,184 @@ +.TH "NPM-PRUNE" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-prune\fR - Remove extraneous packages +.SS "Synopsis" +.P +.RS 2 +.nf +npm prune \[lB]\[lB]<@scope>/\[rB]...\[rB] +.fi +.RE +.SS "Description" +.P +This command removes "extraneous" packages. If a package name is provided, then only packages matching one of the supplied names are removed. +.P +Extraneous packages are those present in the \fBnode_modules\fR folder that are not listed as any package's dependency list. +.P +If the \fB--omit=dev\fR flag is specified or the \fBNODE_ENV\fR environment variable is set to \fBproduction\fR, this command will remove the packages specified in your \fBdevDependencies\fR. +.P +If the \fB--dry-run\fR flag is used then no changes will actually be made. +.P +If the \fB--json\fR flag is used, then the changes \fBnpm prune\fR made (or would have made with \fB--dry-run\fR) are printed as a JSON object. +.P +In normal operation, extraneous modules are pruned automatically, so you'll only need this command with the \fB--production\fR flag. However, in the real world, operation is not always "normal". When crashes or mistakes happen, this command can help clean up any resulting garbage. +.SS "Configuration" +.SS "\fBomit\fR" +.RS 0 +.IP \(bu 4 +Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production'; otherwise, empty. +.IP \(bu 4 +Type: "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Dependency types to omit from the installation tree on disk. +.P +Note that these dependencies \fIare\fR still resolved and added to the \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR file. They are just not physically installed on disk. +.P +If a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included. +.P +If the resulting omit list includes \fB'dev'\fR, then the \fBNODE_ENV\fR environment variable will be set to \fB'production'\fR for all lifecycle scripts. +.SS "\fBinclude\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: "prod", "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Option that allows for defining which types of dependencies to install. +.P +This is the inverse of \fB--omit=\fR. +.P +Dependency types specified in \fB--include\fR will not be omitted, regardless of the order in which omit/include are specified on the command-line. +.SS "\fBdry-run\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. +.P +Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. +.SS "\fBjson\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to output JSON data, rather than the normal output. +.RS 0 +.IP \(bu 4 +In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. +.RE 0 + +.P +Not supported by all npm commands. +.SS "\fBforeground-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: \fBfalse\fR unless when using \fBnpm pack\fR or \fBnpm publish\fR where it defaults to \fBtrue\fR +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Run all build scripts (ie, \fBpreinstall\fR, \fBinstall\fR, and \fBpostinstall\fR) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process. +.P +Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBinstall-links\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help uninstall +.IP \(bu 4 +npm help folders +.IP \(bu 4 +npm help ls +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-publish.1 b/node24/node_modules/npm/man/man1/npm-publish.1 new file mode 100644 index 0000000000000000000000000000000000000000..ee40eb49c39e56bc3e9237970b6b90c3ddfd4298 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-publish.1 @@ -0,0 +1,261 @@ +.TH "NPM-PUBLISH" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-publish\fR - Publish a package +.SS "Synopsis" +.P +.RS 2 +.nf +npm publish +.fi +.RE +.SS "Description" +.P +Publishes a package to the registry so that it can be installed by name. +.SS "Examples" +.P +Publish the package in the current directory: +.P +.RS 2 +.nf +npm publish +.fi +.RE +.P +Publish a specific workspace: +.P +.RS 2 +.nf +npm publish --workspace= +.fi +.RE +.P +Publish multiple workspaces: +.P +.RS 2 +.nf +npm publish --workspace=workspace-a --workspace=workspace-b +.fi +.RE +.P +Publish all workspaces: +.P +.RS 2 +.nf +npm publish --workspaces +.fi +.RE +.P +By default npm will publish to the public registry. This can be overridden by specifying a different default registry or using a npm help scope in the name, combined with a scope-configured registry (see \fB\[rs]fBpackage.json\[rs]fR\fR \fI\(la/configuring-npm/package-json\(ra\fR). +.P +A \fBpackage\fR is interpreted the same way as other commands (like \fBnpm install\fR) and can be: +.RS 0 +.IP \(bu 4 +a) a folder containing a program described by a \fB\[rs]fBpackage.json\[rs]fR\fR \fI\(la/configuring-npm/package-json\(ra\fR file +.IP \(bu 4 +b) a gzipped tarball containing (a) +.IP \(bu 4 +c) a url that resolves to (b) +.IP \(bu 4 +d) a \fB@\fR that is published on the registry (see npm help registry) with (c) +.IP \(bu 4 +e) a \fB@\fR (see npm help dist-tag) that points to (d) +.IP \(bu 4 +f) a \fB\fR that has a "latest" tag satisfying (e) +.IP \(bu 4 +g) a \fB\fR that resolves to (a) +.RE 0 + +.P +If either (a) or (b) is specified as a relative path, it should begin with an explicit \fB./\fR prefix. +.P +The publish will fail if the package name and version combination already exists in the specified registry. +.P +Once a package is published with a given name and version, that specific name and version combination can never be used again, even if it is removed with npm help unpublish. +.P +As of \fBnpm@5\fR, both a sha1sum and an integrity field with a sha512sum of the tarball will be submitted to the registry during publication. Subsequent installs will use the strongest supported algorithm to verify downloads. +.P +Similar to \fB--dry-run\fR see npm help pack, which figures out the files to be included and packs them into a tarball to be uploaded to the registry. +.SS "Files included in package" +.P +To see what will be included in your package, run \fBnpm pack --dry-run\fR. All files are included by default, with the following exceptions: +.RS 0 +.IP \(bu 4 +Certain files that are relevant to package installation and distribution are always included. For example, \fBpackage.json\fR, \fBREADME.md\fR, \fBLICENSE\fR, and so on. +.IP \(bu 4 +If there is a "files" list in \fB\[rs]fBpackage.json\[rs]fR\fR \fI\(la/configuring-npm/package-json\(ra\fR, then only the files specified will be included. (If directories are specified, then they will be walked recursively and their contents included, subject to the same ignore rules.) +.IP \(bu 4 +If there is a \fB.gitignore\fR or \fB.npmignore\fR file, then ignored files in that and all child directories will be excluded from the package. If \fIboth\fR files exist, then the \fB.gitignore\fR is ignored, and only the \fB.npmignore\fR is used. +.P +\fB.npmignore\fR files follow the \fBsame pattern rules\fR \fI\(lahttps://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_ignoring\(ra\fR as \fB.gitignore\fR files +.IP \(bu 4 +If the file matches certain patterns, then it will \fInever\fR be included, unless explicitly added to the \fB"files"\fR list in \fBpackage.json\fR, or un-ignored with a \fB!\fR rule in a \fB.npmignore\fR or \fB.gitignore\fR file. +.IP \(bu 4 +Symbolic links are never included in npm packages. +.RE 0 + +.P +See npm help developers for full details on what's included in the published package, as well as details on how the package is built. +.P +See \fB\[rs]fBpackage.json\[rs]fR\fR \fI\(la/configuring-npm/package-json\(ra\fR for more info on what can and can't be ignored. +.SS "Configuration" +.SS "\fBtag\fR" +.RS 0 +.IP \(bu 4 +Default: "latest" +.IP \(bu 4 +Type: String +.RE 0 + +.P +If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag. +.P +It is the tag added to the package@version specified in the \fBnpm dist-tag +add\fR command, if no explicit tag is given. +.P +When used by the \fBnpm diff\fR command, this is the tag used to fetch the tarball that will be compared with the local files by default. +.P +If used in the \fBnpm publish\fR command, this is the tag that will be added to the package submitted to the registry. +.SS "\fBaccess\fR" +.RS 0 +.IP \(bu 4 +Default: 'public' for new packages, existing packages it will not change the current level +.IP \(bu 4 +Type: null, "restricted", or "public" +.RE 0 + +.P +If you do not want your scoped package to be publicly viewable (and installable) set \fB--access=restricted\fR. +.P +Unscoped packages cannot be set to \fBrestricted\fR. +.P +Note: This defaults to not changing the current access level for existing packages. Specifying a value of \fBrestricted\fR or \fBpublic\fR during publish will change the access for an existing package the same way that \fBnpm access set +status\fR would. +.SS "\fBdry-run\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. +.P +Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. +.SS "\fBotp\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with \fBnpm access\fR. +.P +If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBprovenance\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When publishing from a supported cloud CI/CD system, the package will be publicly linked to where it was built and published from. +.P +This config cannot be used with: \fBprovenance-file\fR +.SS "\fBprovenance-file\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: Path +.RE 0 + +.P +When publishing, the provenance bundle at the given path will be used. +.P +This config cannot be used with: \fBprovenance\fR +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "package spec" +.IP \(bu 4 +\fBnpm-packlist package\fR \fI\(lahttp://npm.im/npm-packlist\(ra\fR +.IP \(bu 4 +npm help registry +.IP \(bu 4 +npm help scope +.IP \(bu 4 +npm help adduser +.IP \(bu 4 +npm help owner +.IP \(bu 4 +npm help deprecate +.IP \(bu 4 +npm help dist-tag +.IP \(bu 4 +npm help pack +.IP \(bu 4 +npm help profile +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-query.1 b/node24/node_modules/npm/man/man1/npm-query.1 new file mode 100644 index 0000000000000000000000000000000000000000..3a9f9fb081d0d3ace2f246ff8d4a07fbc9b6000f --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-query.1 @@ -0,0 +1,281 @@ +.TH "NPM-QUERY" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-query\fR - Dependency selector query +.SS "Synopsis" +.P +.RS 2 +.nf +npm query +.fi +.RE +.SS "Description" +.P +The \fBnpm query\fR command allows for usage of css selectors in order to retrieve an array of dependency objects. +.SS "Piping npm query to other commands" +.P +.RS 2 +.nf +# find all dependencies with postinstall scripts & uninstall them +npm query ":attr(scripts, \[lB]postinstall\[rB])" | jq 'map(.name)|join("\[rs]n")' -r | xargs -I {} npm uninstall {} + +# find all git dependencies & explain who requires them +npm query ":type(git)" | jq 'map(.name)' | xargs -I {} npm why {} +.fi +.RE +.SS "Extended Use Cases & Queries" +.P +.RS 2 +.nf +// all deps +* + +// all direct deps +:root > * + +// direct production deps +:root > .prod + +// direct development deps +:root > .dev + +// any peer dep of a direct deps +:root > * > .peer + +// any workspace dep +.workspace + +// all workspaces that depend on another workspace +.workspace > .workspace + +// all workspaces that have peer deps +.workspace:has(.peer) + +// any dep named "lodash" +// equivalent to \[lB]name="lodash"\[rB] +#lodash + +// any deps named "lodash" & within semver range ^"1.2.3" +#lodash@^1.2.3 +// equivalent to... +\[lB]name="lodash"\[rB]:semver(^1.2.3) + +// get the hoisted node for a given semver range +#lodash@^1.2.3:not(:deduped) + +// querying deps with a specific version +#lodash@2.1.5 +// equivalent to... +\[lB]name="lodash"\[rB]\[lB]version="2.1.5"\[rB] + +// has any deps +:has(*) + +// deps with no other deps (ie. "leaf" nodes) +:empty + +// manually querying git dependencies +\[lB]repository^=github:\[rB], +\[lB]repository^=git:\[rB], +\[lB]repository^=https://github.com\[rB], +\[lB]repository^=http://github.com\[rB], +\[lB]repository^=https://github.com\[rB], +\[lB]repository^=+git:...\[rB] + +// querying for all git dependencies +:type(git) + +// get production dependencies that aren't also dev deps +.prod:not(.dev) + +// get dependencies with specific licenses +\[lB]license=MIT\[rB], \[lB]license=ISC\[rB] + +// find all packages that have @ruyadorno as a contributor +:attr(contributors, \[lB]email=ruyadorno@github.com\[rB]) +.fi +.RE +.SS "Example Response Output" +.RS 0 +.IP \(bu 4 +an array of dependency objects is returned which can contain multiple copies of the same package which may or may not have been linked or deduped +.RE 0 + +.P +.RS 2 +.nf +\[lB] + { + "name": "", + "version": "", + "description": "", + "homepage": "", + "bugs": {}, + "author": {}, + "license": {}, + "funding": {}, + "files": \[lB]\[rB], + "main": "", + "browser": "", + "bin": {}, + "man": \[lB]\[rB], + "directories": {}, + "repository": {}, + "scripts": {}, + "config": {}, + "dependencies": {}, + "devDependencies": {}, + "optionalDependencies": {}, + "bundledDependencies": {}, + "peerDependencies": {}, + "peerDependenciesMeta": {}, + "engines": {}, + "os": \[lB]\[rB], + "cpu": \[lB]\[rB], + "workspaces": {}, + "keywords": \[lB]\[rB], + ... + }, + ... +.fi +.RE +.SS "Expecting a certain number of results" +.P +One common use of \fBnpm query\fR is to make sure there is only one version of a certain dependency in your tree. This is especially common for ecosystems like that rely on \fBtypescript\fR where having state split across two different but identically-named packages causes bugs. You can use the \fB--expect-results\fR or \fB--expect-result-count\fR in your setup to ensure that npm will exit with an exit code if your tree doesn't look like you want it to. +.P +.RS 2 +.nf +$ npm query '#react' --expect-result-count=1 +.fi +.RE +.P +Perhaps you want to quickly check if there are any production dependencies that could be updated: +.P +.RS 2 +.nf +$ npm query ':root>:outdated(in-range).prod' --no-expect-results +.fi +.RE +.SS "Package lock only mode" +.P +If package-lock-only is enabled, only the information in the package lock (or shrinkwrap) is loaded. This means that information from the package.json files of your dependencies will not be included in the result set (e.g. description, homepage, engines). +.SS "Configuration" +.SS "\fBglobal\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBpackage-lock-only\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to true, the current operation will only use the \fBpackage-lock.json\fR, ignoring \fBnode_modules\fR. +.P +For \fBupdate\fR this means only the \fBpackage-lock.json\fR will be updated, instead of checking \fBnode_modules\fR and downloading dependencies. +.P +For \fBlist\fR this means the output will be based on the tree described by the \fBpackage-lock.json\fR, rather than the contents of \fBnode_modules\fR. +.SS "\fBexpect-results\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Tells npm whether or not to expect results from the command. Can be either true (expect some results) or false (expect no results). +.P +This config cannot be used with: \fBexpect-result-count\fR +.SS "\fBexpect-result-count\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Number +.RE 0 + +.P +Tells to expect a specific number of results from the command. +.P +This config cannot be used with: \fBexpect-results\fR +.SH "SEE ALSO" +.RS 0 +.IP \(bu 4 +npm help "dependency selectors" +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-rebuild.1 b/node24/node_modules/npm/man/man1/npm-rebuild.1 new file mode 100644 index 0000000000000000000000000000000000000000..1a305e58b8577986be6cb57930d8da17123eef10 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-rebuild.1 @@ -0,0 +1,178 @@ +.TH "NPM-REBUILD" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-rebuild\fR - Rebuild a package +.SS "Synopsis" +.P +.RS 2 +.nf +npm rebuild \[lB]\[rB] ...\[rB] + +alias: rb +.fi +.RE +.SS "Description" +.P +This command does the following: +.RS 0 +.IP 1. 4 +Execute lifecycle scripts (\fBpreinstall\fR, \fBinstall\fR, \fBpostinstall\fR, \fBprepare\fR) +.IP 2. 4 +Links bins depending on whether bin links are enabled +.RE 0 + +.P +This command is particularly useful in scenarios including but not limited to: +.RS 0 +.IP 1. 4 +Installing a new version of \fBnode.js\fR, where you need to recompile all your C++ add-ons with the updated binary. +.IP 2. 4 +Installing with \fB--ignore-scripts\fR and \fB--no-bin-links\fR, to explicitly choose which packages to build and/or link bins. +.RE 0 + +.P +If one or more package specs are provided, then only packages with a name and version matching one of the specifiers will be rebuilt. +.P +Usually, you should not need to run \fBnpm rebuild\fR as it is already done for you as part of npm install (unless you suppressed these steps with \fB--ignore-scripts\fR or \fB--no-bin-links\fR). +.P +If there is a \fBbinding.gyp\fR file in the root of your package, then npm will use a default install hook: +.P +.RS 2 +.nf +"scripts": { + "install": "node-gyp rebuild" +} +.fi +.RE +.P +This default behavior is suppressed if the \fBpackage.json\fR has its own \fBinstall\fR or \fBpreinstall\fR scripts. It is also suppressed if the package specifies \fB"gypfile": false\fR +.SS "Configuration" +.SS "\fBglobal\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "\fBbin-links\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Tells npm to create symlinks (or \fB.cmd\fR shims on Windows) for package executables. +.P +Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems. +.SS "\fBforeground-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: \fBfalse\fR unless when using \fBnpm pack\fR or \fBnpm publish\fR where it defaults to \fBtrue\fR +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Run all build scripts (ie, \fBpreinstall\fR, \fBinstall\fR, and \fBpostinstall\fR) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process. +.P +Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBinstall-links\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "package spec" +.IP \(bu 4 +npm help install +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-repo.1 b/node24/node_modules/npm/man/man1/npm-repo.1 new file mode 100644 index 0000000000000000000000000000000000000000..6153aa1757dfb8b336d9f832855222eaa6df2c3d --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-repo.1 @@ -0,0 +1,103 @@ +.TH "NPM-REPO" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-repo\fR - Open package repository page in the browser +.SS "Synopsis" +.P +.RS 2 +.nf +npm repo \[lB] \[lB] ...\[rB]\[rB] +.fi +.RE +.SS "Description" +.P +This command tries to guess at the likely location of a package's repository URL, and then tries to open it using the \fB\[rs]fB--browser\[rs]fR config\fR \fI\(la/using-npm/config#browser\(ra\fR param. If no package name is provided, it will search for a \fBpackage.json\fR in the current folder and use the \fBrepository\fR property. +.SS "Configuration" +.SS "\fBbrowser\fR" +.RS 0 +.IP \(bu 4 +Default: macOS: \fB"open"\fR, Windows: \fB"start"\fR, Others: \fB"xdg-open"\fR +.IP \(bu 4 +Type: null, Boolean, or String +.RE 0 + +.P +The browser that is called by npm commands to open websites. +.P +Set to \fBfalse\fR to suppress browser behavior and instead print urls to terminal. +.P +Set to \fBtrue\fR to use default system URL opener. +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help docs +.IP \(bu 4 +npm help config +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-restart.1 b/node24/node_modules/npm/man/man1/npm-restart.1 new file mode 100644 index 0000000000000000000000000000000000000000..51cb81df148451290e37dd6faf100ffb88d11155 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-restart.1 @@ -0,0 +1,84 @@ +.TH "NPM-RESTART" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-restart\fR - Restart a package +.SS "Synopsis" +.P +.RS 2 +.nf +npm restart \[lB]-- \[rB] +.fi +.RE +.SS "Description" +.P +This restarts a project. It is equivalent to running \fBnpm run restart\fR. +.P +If the current project has a \fB"restart"\fR script specified in \fBpackage.json\fR, then the following scripts will be run: +.RS 0 +.IP 1. 4 +prerestart +.IP 2. 4 +restart +.IP 3. 4 +postrestart +.RE 0 + +.P +If it does \fInot\fR have a \fB"restart"\fR script specified, but it does have \fBstop\fR and/or \fBstart\fR scripts, then the following scripts will be run: +.RS 0 +.IP 1. 4 +prerestart +.IP 2. 4 +prestop +.IP 3. 4 +stop +.IP 4. 4 +poststop +.IP 5. 4 +prestart +.IP 6. 4 +start +.IP 7. 4 +poststart +.IP 8. 4 +postrestart +.RE 0 + +.SS "Configuration" +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "\fBscript-shell\fR" +.RS 0 +.IP \(bu 4 +Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +The shell to use for scripts run with the \fBnpm exec\fR, \fBnpm run\fR and \fBnpm +init \fR commands. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help run +.IP \(bu 4 +npm help scripts +.IP \(bu 4 +npm help test +.IP \(bu 4 +npm help start +.IP \(bu 4 +npm help stop +.IP \(bu 4 +npm help restart +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-root.1 b/node24/node_modules/npm/man/man1/npm-root.1 new file mode 100644 index 0000000000000000000000000000000000000000..54e9569b44a7a9b7b5adbedc70de9b5bab7812f4 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-root.1 @@ -0,0 +1,56 @@ +.TH "NPM-ROOT" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-root\fR - Display npm root +.SS "Synopsis" +.P +.RS 2 +.nf +npm root +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +Print the effective \fBnode_modules\fR folder to standard out. +.P +Useful for using npm in shell scripts that do things with the \fBnode_modules\fR folder. For example: +.P +.RS 2 +.nf +#!/bin/bash +global_node_modules="$(npm root --global)" +echo "Global packages installed in: ${global_node_modules}" +.fi +.RE +.SS "Configuration" +.SS "\fBglobal\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help prefix +.IP \(bu 4 +npm help folders +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-run.1 b/node24/node_modules/npm/man/man1/npm-run.1 new file mode 100644 index 0000000000000000000000000000000000000000..7e1735e68d48d8ca515fdc04aebfe0f9f226558c --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-run.1 @@ -0,0 +1,234 @@ +.TH "NPM-RUN" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-run\fR - Run arbitrary package scripts +.SS "Synopsis" +.P +.RS 2 +.nf +npm run \[lB]-- \[rB] + +aliases: run-script, rum, urn +.fi +.RE +.SS "Description" +.P +This runs an arbitrary command from a package's \fB"scripts"\fR object. If no \fB"command"\fR is provided, it will list the available scripts. +.P +\fBrun\[lB]-script\[rB]\fR is used by the test, start, restart, and stop commands, but can be called directly, as well. When the scripts in the package are printed out, they're separated into lifecycle (test, start, restart) and directly-run scripts. +.P +Any positional arguments are passed to the specified script. Use \fB--\fR to pass \fB-\fR-prefixed flags and options which would otherwise be parsed by npm. +.P +For example: +.P +.RS 2 +.nf +npm run test -- --grep="pattern" +.fi +.RE +.P +The arguments will only be passed to the script specified after \fBnpm run\fR and not to any \fBpre\fR or \fBpost\fR script. +.P +The \fBenv\fR script is a special built-in command that can be used to list environment variables that will be available to the script at runtime. If an "env" command is defined in your package, it will take precedence over the built-in. +.P +In addition to the shell's pre-existing \fBPATH\fR, \fBnpm run\fR adds \fBnode_modules/.bin\fR to the \fBPATH\fR provided to scripts. Any binaries provided by locally-installed dependencies can be used without the \fBnode_modules/.bin\fR prefix. For example, if there is a \fBdevDependency\fR on \fBtap\fR in your package, you should write: +.P +.RS 2 +.nf +"scripts": {"test": "tap test/*.js"} +.fi +.RE +.P +instead of +.P +.RS 2 +.nf +"scripts": {"test": "node_modules/.bin/tap test/*.js"} +.fi +.RE +.P +The actual shell your script is run within is platform dependent. By default, on Unix-like systems it is the \fB/bin/sh\fR command, on Windows it is \fBcmd.exe\fR. The actual shell referred to by \fB/bin/sh\fR also depends on the system. You can customize the shell with the \fB\[rs]fBscript-shell\[rs]fR config\fR \fI\(la/using-npm/config#script-shell\(ra\fR. +.P +Scripts are run from the root of the package folder, regardless of what the current working directory is when \fBnpm run\fR is called. If you want your script to use different behavior based on what subdirectory you're in, you can use the \fBINIT_CWD\fR environment variable, which holds the full path you were in when you ran \fBnpm run\fR. +.P +\fBnpm run\fR sets the \fBNODE\fR environment variable to the \fBnode\fR executable with which \fBnpm\fR is executed. +.P +If you try to run a script without having a \fBnode_modules\fR directory and it fails, you will be given a warning to run \fBnpm install\fR, just in case you've forgotten. +.SS "Workspaces support" +.P +You may use the \fB\[rs]fBworkspace\[rs]fR\fR \fI\(la/using-npm/config#workspace\(ra\fR or \fB\[rs]fBworkspaces\[rs]fR\fR \fI\(la/using-npm/config#workspaces\(ra\fR configs in order to run an arbitrary command from a package's \fB"scripts"\fR object in the context of the specified workspaces. If no \fB"command"\fR is provided, it will list the available scripts for each of these configured workspaces. +.P +Given a project with configured workspaces, e.g: +.P +.RS 2 +.nf +. ++-- package.json +`-- packages + +-- a + | `-- package.json + +-- b + | `-- package.json + `-- c + `-- package.json +.fi +.RE +.P +Assuming the workspace configuration is properly set up at the root level \fBpackage.json\fR file. e.g: +.P +.RS 2 +.nf +{ + "workspaces": \[lB] "./packages/*" \[rB] +} +.fi +.RE +.P +And that each of the configured workspaces has a configured \fBtest\fR script, we can run tests in all of them using the \fB\[rs]fBworkspaces\[rs]fR config\fR \fI\(la/using-npm/config#workspaces\(ra\fR: +.P +.RS 2 +.nf +npm test --workspaces +.fi +.RE +.SS "Filtering workspaces" +.P +It's also possible to run a script in a single workspace using the \fBworkspace\fR config along with a name or directory path: +.P +.RS 2 +.nf +npm test --workspace=a +.fi +.RE +.P +The \fBworkspace\fR config can also be specified multiple times in order to run a specific script in the context of multiple workspaces. When defining values for the \fBworkspace\fR config in the command line, it also possible to use \fB-w\fR as a shorthand, e.g: +.P +.RS 2 +.nf +npm test -w a -w b +.fi +.RE +.P +This last command will run \fBtest\fR in both \fB./packages/a\fR and \fB./packages/b\fR packages. +.SS "Configuration" +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBif-present\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm will not exit with an error code when \fBrun\fR is invoked for a script that isn't defined in the \fBscripts\fR section of \fBpackage.json\fR. This option can be used when it's desirable to optionally run a script when it's present and fail if the script fails. This is useful, for example, when running scripts that may only apply for some builds in an otherwise generic CI setup. +.P +This value is not exported to the environment for child processes. +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "\fBforeground-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: \fBfalse\fR unless when using \fBnpm pack\fR or \fBnpm publish\fR where it defaults to \fBtrue\fR +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Run all build scripts (ie, \fBpreinstall\fR, \fBinstall\fR, and \fBpostinstall\fR) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process. +.P +Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. +.SS "\fBscript-shell\fR" +.RS 0 +.IP \(bu 4 +Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +The shell to use for scripts run with the \fBnpm exec\fR, \fBnpm run\fR and \fBnpm +init \fR commands. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help scripts +.IP \(bu 4 +npm help test +.IP \(bu 4 +npm help start +.IP \(bu 4 +npm help restart +.IP \(bu 4 +npm help stop +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help workspaces +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-sbom.1 b/node24/node_modules/npm/man/man1/npm-sbom.1 new file mode 100644 index 0000000000000000000000000000000000000000..222615799216e4e74d97f404abea3be392391270 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-sbom.1 @@ -0,0 +1,314 @@ +.TH "NPM-SBOM" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-sbom\fR - Generate a Software Bill of Materials (SBOM) +.SS "Synopsis" +.P +.RS 2 +.nf +npm sbom +.fi +.RE +.SS "Description" +.P +The \fBnpm sbom\fR command generates a Software Bill of Materials (SBOM) listing the dependencies for the current project. SBOMs can be generated in either \fBSPDX\fR \fI\(lahttps://spdx.dev/\(ra\fR or \fBCycloneDX\fR \fI\(lahttps://cyclonedx.org/\(ra\fR format. +.SS "Example CycloneDX SBOM" +.P +.RS 2 +.nf +{ + "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json", + "bomFormat": "CycloneDX", + "specVersion": "1.5", + "serialNumber": "urn:uuid:09f55116-97e1-49cf-b3b8-44d0207e7730", + "version": 1, + "metadata": { + "timestamp": "2023-09-01T00:00:00.001Z", + "lifecycles": \[lB] + { + "phase": "build" + } + \[rB], + "tools": \[lB] + { + "vendor": "npm", + "name": "cli", + "version": "10.1.0" + } + \[rB], + "component": { + "bom-ref": "simple@1.0.0", + "type": "library", + "name": "simple", + "version": "1.0.0", + "scope": "required", + "author": "John Doe", + "description": "simple react app", + "purl": "pkg:npm/simple@1.0.0", + "properties": \[lB] + { + "name": "cdx:npm:package:path", + "value": "" + } + \[rB], + "externalReferences": \[lB]\[rB], + "licenses": \[lB] + { + "license": { + "id": "MIT" + } + } + \[rB] + } + }, + "components": \[lB] + { + "bom-ref": "lodash@4.17.21", + "type": "library", + "name": "lodash", + "version": "4.17.21", + "scope": "required", + "author": "John-David Dalton", + "description": "Lodash modular utilities.", + "purl": "pkg:npm/lodash@4.17.21", + "properties": \[lB] + { + "name": "cdx:npm:package:path", + "value": "node_modules/lodash" + } + \[rB], + "externalReferences": \[lB] + { + "type": "distribution", + "url": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" + }, + { + "type": "vcs", + "url": "git+https://github.com/lodash/lodash.git" + }, + { + "type": "website", + "url": "https://lodash.com/" + }, + { + "type": "issue-tracker", + "url": "https://github.com/lodash/lodash/issues" + } + \[rB], + "hashes": \[lB] + { + "alg": "SHA-512", + "content": "bf690311ee7b95e713ba568322e3533f2dd1cb880b189e99d4edef13592b81764daec43e2c54c61d5c558dc5cfb35ecb85b65519e74026ff17675b6f8f916f4a" + } + \[rB], + "licenses": \[lB] + { + "license": { + "id": "MIT" + } + } + \[rB] + } + \[rB], + "dependencies": \[lB] + { + "ref": "simple@1.0.0", + "dependsOn": \[lB] + "lodash@4.17.21" + \[rB] + }, + { + "ref": "lodash@4.17.21", + "dependsOn": \[lB]\[rB] + } + \[rB] +} +.fi +.RE +.SS "Example SPDX SBOM" +.P +.RS 2 +.nf +{ + "spdxVersion": "SPDX-2.3", + "dataLicense": "CC0-1.0", + "SPDXID": "SPDXRef-DOCUMENT", + "name": "simple@1.0.0", + "documentNamespace": "http://spdx.org/spdxdocs/simple-1.0.0-bf81090e-8bbc-459d-bec9-abeb794e096a", + "creationInfo": { + "created": "2023-09-01T00:00:00.001Z", + "creators": \[lB] + "Tool: npm/cli-10.1.0" + \[rB] + }, + "documentDescribes": \[lB] + "SPDXRef-Package-simple-1.0.0" + \[rB], + "packages": \[lB] + { + "name": "simple", + "SPDXID": "SPDXRef-Package-simple-1.0.0", + "versionInfo": "1.0.0", + "packageFileName": "", + "description": "simple react app", + "primaryPackagePurpose": "LIBRARY", + "downloadLocation": "NOASSERTION", + "filesAnalyzed": false, + "homepage": "NOASSERTION", + "licenseDeclared": "MIT", + "externalRefs": \[lB] + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceType": "purl", + "referenceLocator": "pkg:npm/simple@1.0.0" + } + \[rB] + }, + { + "name": "lodash", + "SPDXID": "SPDXRef-Package-lodash-4.17.21", + "versionInfo": "4.17.21", + "packageFileName": "node_modules/lodash", + "description": "Lodash modular utilities.", + "downloadLocation": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "filesAnalyzed": false, + "homepage": "https://lodash.com/", + "licenseDeclared": "MIT", + "externalRefs": \[lB] + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceType": "purl", + "referenceLocator": "pkg:npm/lodash@4.17.21" + } + \[rB], + "checksums": \[lB] + { + "algorithm": "SHA512", + "checksumValue": "bf690311ee7b95e713ba568322e3533f2dd1cb880b189e99d4edef13592b81764daec43e2c54c61d5c558dc5cfb35ecb85b65519e74026ff17675b6f8f916f4a" + } + \[rB] + } + \[rB], + "relationships": \[lB] + { + "spdxElementId": "SPDXRef-DOCUMENT", + "relatedSpdxElement": "SPDXRef-Package-simple-1.0.0", + "relationshipType": "DESCRIBES" + }, + { + "spdxElementId": "SPDXRef-Package-simple-1.0.0", + "relatedSpdxElement": "SPDXRef-Package-lodash-4.17.21", + "relationshipType": "DEPENDS_ON" + } + \[rB] +} +.fi +.RE +.SS "Package lock only mode" +.P +If package-lock-only is enabled, only the information in the package lock (or shrinkwrap) is loaded. This means that information from the package.json files of your dependencies will not be included in the result set (e.g. description, homepage, engines). +.SS "Configuration" +.SS "\fBomit\fR" +.RS 0 +.IP \(bu 4 +Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production'; otherwise, empty. +.IP \(bu 4 +Type: "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Dependency types to omit from the installation tree on disk. +.P +Note that these dependencies \fIare\fR still resolved and added to the \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR file. They are just not physically installed on disk. +.P +If a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included. +.P +If the resulting omit list includes \fB'dev'\fR, then the \fBNODE_ENV\fR environment variable will be set to \fB'production'\fR for all lifecycle scripts. +.SS "\fBpackage-lock-only\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to true, the current operation will only use the \fBpackage-lock.json\fR, ignoring \fBnode_modules\fR. +.P +For \fBupdate\fR this means only the \fBpackage-lock.json\fR will be updated, instead of checking \fBnode_modules\fR and downloading dependencies. +.P +For \fBlist\fR this means the output will be based on the tree described by the \fBpackage-lock.json\fR, rather than the contents of \fBnode_modules\fR. +.SS "\fBsbom-format\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: "cyclonedx" or "spdx" +.RE 0 + +.P +SBOM format to use when generating SBOMs. +.SS "\fBsbom-type\fR" +.RS 0 +.IP \(bu 4 +Default: "library" +.IP \(bu 4 +Type: "library", "application", or "framework" +.RE 0 + +.P +The type of package described by the generated SBOM. For SPDX, this is the value for the \fBprimaryPackagePurpose\fR field. For CycloneDX, this is the value for the \fBtype\fR field. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SH "SEE ALSO" +.RS 0 +.IP \(bu 4 +npm help "package spec" +.IP \(bu 4 +npm help "dependency selectors" +.IP \(bu 4 +\fBpackage.json\fR \fI\(la/configuring-npm/package-json\(ra\fR +.IP \(bu 4 +npm help workspaces +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-search.1 b/node24/node_modules/npm/man/man1/npm-search.1 new file mode 100644 index 0000000000000000000000000000000000000000..1839d2ac4ed02d9549f342f85cb5a11003ff2758 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-search.1 @@ -0,0 +1,156 @@ +.TH "NPM-SEARCH" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-search\fR - Search for packages +.SS "Synopsis" +.P +.RS 2 +.nf +npm search \[lB] ...\[rB] + +aliases: find, s, se +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +Search the registry for packages matching the search terms. \fBnpm search\fR performs a linear, incremental, lexically-ordered search through package metadata for all files in the registry. If your terminal has color support, it will further highlight the matches in the results. This can be disabled with the config item \fBcolor\fR +.P +Additionally, using the \fB--searchopts\fR and \fB--searchexclude\fR options paired with more search terms will include and exclude further patterns. The main difference between \fB--searchopts\fR and the standard search terms is that the former does not highlight results in the output and you can use them more fine-grained filtering. Additionally, you can add both of these to your config to change default search filtering behavior. +.P +Search also allows targeting of maintainers in search results, by prefixing their npm username with \fB=\fR. +.P +If a term starts with \fB/\fR, then it's interpreted as a regular expression and supports standard JavaScript RegExp syntax. In this case search will ignore a trailing \fB/\fR . (Note you must escape or quote many regular expression characters in most shells.) +.SS "Configuration" +.SS "\fBjson\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to output JSON data, rather than the normal output. +.RS 0 +.IP \(bu 4 +In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. +.RE 0 + +.P +Not supported by all npm commands. +.SS "\fBcolor\fR" +.RS 0 +.IP \(bu 4 +Default: true unless the NO_COLOR environ is set to something other than '0' +.IP \(bu 4 +Type: "always" or Boolean +.RE 0 + +.P +If false, never shows colors. If \fB"always"\fR then always shows colors. If true, then only prints color codes for tty file descriptors. +.SS "\fBparseable\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Output parseable results from commands that write to standard output. For \fBnpm search\fR, this will be tab-separated table format. +.SS "\fBdescription\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Show the description in \fBnpm search\fR +.SS "\fBsearchlimit\fR" +.RS 0 +.IP \(bu 4 +Default: 20 +.IP \(bu 4 +Type: Number +.RE 0 + +.P +Number of items to limit search results to. Will not apply at all to legacy searches. +.SS "\fBsearchopts\fR" +.RS 0 +.IP \(bu 4 +Default: "" +.IP \(bu 4 +Type: String +.RE 0 + +.P +Space-separated options that are always passed to search. +.SS "\fBsearchexclude\fR" +.RS 0 +.IP \(bu 4 +Default: "" +.IP \(bu 4 +Type: String +.RE 0 + +.P +Space-separated options that limit the results from search. +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "\fBprefer-online\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, staleness checks for cached data will be forced, making the CLI look for updates immediately even for fresh package data. +.SS "\fBprefer-offline\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, staleness checks for cached data will be bypassed, but missing data will be requested from the server. To force full offline mode, use \fB--offline\fR. +.SS "\fBoffline\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Force offline mode: no network requests will be done during install. To allow the CLI to fill in missing cache data, see \fB--prefer-offline\fR. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help registry +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +npm help view +.IP \(bu 4 +npm help cache +.IP \(bu 4 +https://npm.im/npm-registry-fetch +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-set.1 b/node24/node_modules/npm/man/man1/npm-set.1 new file mode 100644 index 0000000000000000000000000000000000000000..832a1687b606a1dd8ba44bde6cca470617f99ba4 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-set.1 @@ -0,0 +1,61 @@ +.TH "NPM-SET" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-set\fR - Set a value in the npm configuration +.SS "Synopsis" +.P +.RS 2 +.nf +npm set = \[lB]= ...\[rB] (See `npm config`) +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +Set a value in the npm configuration +.SS "Configuration" +.SS "\fBglobal\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "\fBlocation\fR" +.RS 0 +.IP \(bu 4 +Default: "user" unless \fB--global\fR is passed, which will also set this value to "global" +.IP \(bu 4 +Type: "global", "user", or "project" +.RE 0 + +.P +When passed to \fBnpm config\fR this refers to which config file to use. +.P +When set to "global" mode, packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "help config" +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-shrinkwrap.1 b/node24/node_modules/npm/man/man1/npm-shrinkwrap.1 new file mode 100644 index 0000000000000000000000000000000000000000..51619129370507fc3a2c3412e0be5e27a3dc0760 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-shrinkwrap.1 @@ -0,0 +1,32 @@ +.TH "NPM-SHRINKWRAP" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-shrinkwrap\fR - Lock down dependency versions for publication +.SS "Synopsis" +.P +.RS 2 +.nf +npm shrinkwrap +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +This command repurposes \fBpackage-lock.json\fR into a publishable \fBnpm-shrinkwrap.json\fR or simply creates a new one. The file created and updated by this command will then take precedence over any other existing or future \fBpackage-lock.json\fR files. For a detailed explanation of the design and purpose of package locks in npm, see npm help package-lock-json. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help run +.IP \(bu 4 +npm help scripts +.IP \(bu 4 +\fBpackage.json\fR \fI\(la/configuring-npm/package-json\(ra\fR +.IP \(bu 4 +\fBpackage-lock.json\fR \fI\(la/configuring-npm/package-lock-json\(ra\fR +.IP \(bu 4 +\fBnpm-shrinkwrap.json\fR \fI\(la/configuring-npm/npm-shrinkwrap-json\(ra\fR +.IP \(bu 4 +npm help ls +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-star.1 b/node24/node_modules/npm/man/man1/npm-star.1 new file mode 100644 index 0000000000000000000000000000000000000000..13f40dbf4aa1230cde286c55e7af2acb71ed625b --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-star.1 @@ -0,0 +1,76 @@ +.TH "NPM-STAR" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-star\fR - Mark your favorite packages +.SS "Synopsis" +.P +.RS 2 +.nf +npm star \[lB]...\[rB] +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +"Starring" a package means that you have some interest in it. It's a vaguely positive way to show that you care. +.P +It's a boolean thing. Starring repeatedly has no additional effect. +.SS "More" +.P +There's also these extra commands to help you manage your favorite packages: +.SS "Unstar" +.P +You can also "unstar" a package using npm help unstar +.P +"Unstarring" is the same thing, but in reverse. +.SS "Listing stars" +.P +You can see all your starred packages using npm help stars +.SS "Configuration" +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "\fBunicode\fR" +.RS 0 +.IP \(bu 4 +Default: false on windows, true on mac/unix systems with a unicode locale, as defined by the \fBLC_ALL\fR, \fBLC_CTYPE\fR, or \fBLANG\fR environment variables. +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set to true, npm uses unicode characters in the tree output. When false, it uses ascii characters instead of unicode glyphs. +.SS "\fBotp\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with \fBnpm access\fR. +.P +If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "package spec" +.IP \(bu 4 +npm help unstar +.IP \(bu 4 +npm help stars +.IP \(bu 4 +npm help view +.IP \(bu 4 +npm help whoami +.IP \(bu 4 +npm help adduser +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-stars.1 b/node24/node_modules/npm/man/man1/npm-stars.1 new file mode 100644 index 0000000000000000000000000000000000000000..212f14a59b8dbc90892f798e9dda18a2a7cb1724 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-stars.1 @@ -0,0 +1,41 @@ +.TH "NPM-STARS" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-stars\fR - View packages marked as favorites +.SS "Synopsis" +.P +.RS 2 +.nf +npm stars \[lB]\[rB] +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +If you have starred a lot of neat things and want to find them again quickly this command lets you do just that. +.P +You may also want to see your friend's favorite packages, in this case you will most certainly enjoy this command. +.SS "Configuration" +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help star +.IP \(bu 4 +npm help unstar +.IP \(bu 4 +npm help view +.IP \(bu 4 +npm help whoami +.IP \(bu 4 +npm help adduser +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-start.1 b/node24/node_modules/npm/man/man1/npm-start.1 new file mode 100644 index 0000000000000000000000000000000000000000..6426a8c8c35d8002b84361f18a796d9f35366325 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-start.1 @@ -0,0 +1,79 @@ +.TH "NPM-START" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-start\fR - Start a package +.SS "Synopsis" +.P +.RS 2 +.nf +npm start \[lB]-- \[rB] +.fi +.RE +.SS "Description" +.P +This runs a predefined command specified in the \fB"start"\fR property of a package's \fB"scripts"\fR object. +.P +If the \fB"scripts"\fR object does not define a \fB"start"\fR property, npm will run \fBnode server.js\fR. +.P +Note that this is different from the default node behavior of running the file specified in a package's \fB"main"\fR attribute when evoking with \fBnode .\fR +.P +As of \fB\[rs]fBnpm@2.0.0\[rs]fR\fR \fI\(lahttps://blog.npmjs.org/post/98131109725/npm-2-0-0\(ra\fR, you can use custom arguments when executing scripts. Refer to npm help run for more details. +.SS "Example" +.P +.RS 2 +.nf +{ + "scripts": { + "start": "node foo.js" + } +} +.fi +.RE +.P +.RS 2 +.nf +npm start + +> npm@x.x.x start +> node foo.js + +(foo.js output would be here) + +.fi +.RE +.SS "Configuration" +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "\fBscript-shell\fR" +.RS 0 +.IP \(bu 4 +Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +The shell to use for scripts run with the \fBnpm exec\fR, \fBnpm run\fR and \fBnpm +init \fR commands. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help run +.IP \(bu 4 +npm help scripts +.IP \(bu 4 +npm help test +.IP \(bu 4 +npm help restart +.IP \(bu 4 +npm help stop +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-stop.1 b/node24/node_modules/npm/man/man1/npm-stop.1 new file mode 100644 index 0000000000000000000000000000000000000000..380935a21ce66c2a9e9a87ebf39ed5b8bcb3900e --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-stop.1 @@ -0,0 +1,75 @@ +.TH "NPM-STOP" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-stop\fR - Stop a package +.SS "Synopsis" +.P +.RS 2 +.nf +npm stop \[lB]-- \[rB] +.fi +.RE +.SS "Description" +.P +This runs a predefined command specified in the "stop" property of a package's "scripts" object. +.P +Unlike with npm help start, there is no default script that will run if the \fB"stop"\fR property is not defined. +.SS "Example" +.P +.RS 2 +.nf +{ + "scripts": { + "stop": "node bar.js" + } +} +.fi +.RE +.P +.RS 2 +.nf +npm stop + +> npm@x.x.x stop +> node bar.js + +(bar.js output would be here) + +.fi +.RE +.SS "Configuration" +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "\fBscript-shell\fR" +.RS 0 +.IP \(bu 4 +Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +The shell to use for scripts run with the \fBnpm exec\fR, \fBnpm run\fR and \fBnpm +init \fR commands. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help run +.IP \(bu 4 +npm help scripts +.IP \(bu 4 +npm help test +.IP \(bu 4 +npm help start +.IP \(bu 4 +npm help restart +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-team.1 b/node24/node_modules/npm/man/man1/npm-team.1 new file mode 100644 index 0000000000000000000000000000000000000000..90232cadb060b3c4ac15cbd6537d24cf7f0ab5c1 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-team.1 @@ -0,0 +1,148 @@ +.TH "NPM-TEAM" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-team\fR - Manage organization teams and team memberships +.SS "Synopsis" +.P +.RS 2 +.nf +npm team create \[lB]--otp \[rB] +npm team destroy \[lB]--otp \[rB] +npm team add \[lB]--otp \[rB] +npm team rm \[lB]--otp \[rB] +npm team ls | +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +Used to manage teams in organizations, and change team memberships. Does not handle permissions for packages. +.P +Teams must always be fully qualified with the organization/scope they belong to when operating on them, separated by a colon (\fB:\fR). That is, if you have a \fBnewteam\fR team in an \fBorg\fR organization, you must always refer to that team as \fB@org:newteam\fR in these commands. +.P +If you have two-factor authentication enabled in \fBauth-and-writes\fR mode, then you can provide a code from your authenticator with \fB\[lB]--otp \[rB]\fR. If you don't include this then you will be taken through a second factor flow based on your \fBauthtype\fR. +.RS 0 +.IP \(bu 4 +create / destroy: Create a new team, or destroy an existing one. Note: You cannot remove the \fBdevelopers\fR team, \fBlearn more.\fR \fI\(lahttps://docs.npmjs.com/about-developers-team\(ra\fR +.P +Here's how to create a new team \fBnewteam\fR under the \fBorg\fR org: +.P +.RS 2 +.nf +npm team create @org:newteam +.fi +.RE +.P +You should see a confirming message such as: \fB+@org:newteam\fR once the new team has been created. +.IP \(bu 4 +add: Add a user to an existing team. +.P +Adding a new user \fBusername\fR to a team named \fBnewteam\fR under the \fBorg\fR org: +.P +.RS 2 +.nf +npm team add @org:newteam username +.fi +.RE +.P +On success, you should see a message: \fBusername added to @org:newteam\fR +.IP \(bu 4 +rm: Using \fBnpm team rm\fR you can also remove users from a team they belong to. +.P +Here's an example removing user \fBusername\fR from \fBnewteam\fR team in \fBorg\fR organization: +.P +.RS 2 +.nf +npm team rm @org:newteam username +.fi +.RE +.P +Once the user is removed a confirmation message is displayed: \fBusername removed from @org:newteam\fR +.IP \(bu 4 +ls: If performed on an organization name, will return a list of existing teams under that organization. If performed on a team, it will instead return a list of all users belonging to that particular team. +.P +Here's an example of how to list all teams from an org named \fBorg\fR: +.P +.RS 2 +.nf +npm team ls @org +.fi +.RE +.P +Example listing all members of a team named \fBnewteam\fR: +.P +.RS 2 +.nf +npm team ls @org:newteam +.fi +.RE +.RE 0 + +.SS "Details" +.P +\fBnpm team\fR always operates directly on the current registry, configurable from the command line using \fB--registry=\fR. +.P +You must be a \fIteam admin\fR to create teams and manage team membership, under the given organization. Listing teams and team memberships may be done by any member of the organization. +.P +Organization creation and management of team admins and \fIorganization\fR members is done through the website, not the npm CLI. +.P +To use teams to manage permissions on packages belonging to your organization, use the \fBnpm access\fR command to grant or revoke the appropriate permissions. +.SS "Configuration" +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "\fBotp\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with \fBnpm access\fR. +.P +If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. +.SS "\fBparseable\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Output parseable results from commands that write to standard output. For \fBnpm search\fR, this will be tab-separated table format. +.SS "\fBjson\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to output JSON data, rather than the normal output. +.RS 0 +.IP \(bu 4 +In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. +.RE 0 + +.P +Not supported by all npm commands. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help access +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help registry +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-test.1 b/node24/node_modules/npm/man/man1/npm-test.1 new file mode 100644 index 0000000000000000000000000000000000000000..19b67307bc2f02fdabf7160da98d040727a8c90d --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-test.1 @@ -0,0 +1,73 @@ +.TH "NPM-TEST" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-test\fR - Test a package +.SS "Synopsis" +.P +.RS 2 +.nf +npm test \[lB]-- \[rB] + +aliases: tst, t +.fi +.RE +.SS "Description" +.P +This runs a predefined command specified in the \fB"test"\fR property of a package's \fB"scripts"\fR object. +.SS "Example" +.P +.RS 2 +.nf +{ + "scripts": { + "test": "node test.js" + } +} +.fi +.RE +.P +.RS 2 +.nf +npm test +> npm@x.x.x test +> node test.js + +(test.js output would be here) +.fi +.RE +.SS "Configuration" +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "\fBscript-shell\fR" +.RS 0 +.IP \(bu 4 +Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +The shell to use for scripts run with the \fBnpm exec\fR, \fBnpm run\fR and \fBnpm +init \fR commands. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help run +.IP \(bu 4 +npm help scripts +.IP \(bu 4 +npm help start +.IP \(bu 4 +npm help restart +.IP \(bu 4 +npm help stop +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-token.1 b/node24/node_modules/npm/man/man1/npm-token.1 new file mode 100644 index 0000000000000000000000000000000000000000..321abb9f11820f191cd93581c864ee92bab3d9e0 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-token.1 @@ -0,0 +1,200 @@ +.TH "NPM-TOKEN" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-token\fR - Manage your authentication tokens +.SS "Synopsis" +.P +.RS 2 +.nf +npm token list +npm token revoke +npm token create +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +This lets you list, create and revoke authentication tokens. +.SS "Listing tokens" +.P +When listing tokens, an abbreviated token will be displayed. For security purposes the full token is not displayed. +.SS "Generating tokens" +.P +When generating tokens, you will be prompted you for your password and, if you have two-factor authentication enabled, an otp. +.P +Please refer to the \fBdocs website\fR \fI\(lahttps://docs.npmjs.com/creating-and-viewing-access-tokens\(ra\fR for more information on generating tokens for CI/CD. +.SS "Revoking tokens" +.P +When revoking a token, you can use the full token (e.g. what you get back from \fBnpm token create\fR, or as can be found in an \fB.npmrc\fR file), or a truncated id. If the given truncated id is not distinct enough to differentiate between multiple existing tokens, you will need to use enough of the id to allow npm to distinguish between them. Full token ids can be found on the \fBnpm website\fR \fI\(lahttps://www.npmjs.com\(ra\fR, or in the \fB--parseable\fR or \fB--json\fR output of \fBnpm token list\fR. This command will NOT accept the truncated token found in the normal \fBnpm token list\fR output. +.P +A revoked token will immediately be removed from the registry and you will no longer be able to use it. +.SS "Configuration" +.SS "\fBname\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +When creating a Granular Access Token with \fBnpm token create\fR, this sets the name/description for the token. +.SS "\fBtoken-description\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +Description text for the token when using \fBnpm token create\fR. +.SS "\fBexpires\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Number +.RE 0 + +.P +When creating a Granular Access Token with \fBnpm token create\fR, this sets the expiration in days. If not specified, the server will determine the default expiration. +.SS "\fBpackages\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: null or String (can be set multiple times) +.RE 0 + +.P +When creating a Granular Access Token with \fBnpm token create\fR, this limits the token access to specific packages. +.SS "\fBpackages-all\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When creating a Granular Access Token with \fBnpm token create\fR, grants the token access to all packages instead of limiting to specific packages. +.SS "\fBscopes\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String (can be set multiple times) +.RE 0 + +.P +When creating a Granular Access Token with \fBnpm token create\fR, this limits the token access to specific scopes. Provide a scope name (with or without @ prefix). +.SS "\fBorgs\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String (can be set multiple times) +.RE 0 + +.P +When creating a Granular Access Token with \fBnpm token create\fR, this limits the token access to specific organizations. +.SS "\fBpackages-and-scopes-permission\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null, "read-only", "read-write", or "no-access" +.RE 0 + +.P +When creating a Granular Access Token with \fBnpm token create\fR, sets the permission level for packages and scopes. Options are "read-only", "read-write", or "no-access". +.SS "\fBorgs-permission\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null, "read-only", "read-write", or "no-access" +.RE 0 + +.P +When creating a Granular Access Token with \fBnpm token create\fR, sets the permission level for organizations. Options are "read-only", "read-write", or "no-access". +.SS "\fBcidr\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String (can be set multiple times) +.RE 0 + +.P +This is a list of CIDR address to be used when configuring limited access tokens with the \fBnpm token create\fR command. +.SS "\fBbypass-2fa\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When creating a Granular Access Token with \fBnpm token create\fR, setting this to true will allow the token to bypass two-factor authentication. This is useful for automation and CI/CD workflows. +.SS "\fBpassword\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +Password for authentication. Can be provided via command line when creating tokens, though it's generally safer to be prompted for it. +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "\fBotp\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with \fBnpm access\fR. +.P +If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. +.SS "\fBread-only\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +This is used to mark a token as unable to publish when configuring limited access tokens with the \fBnpm token create\fR command. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help adduser +.IP \(bu 4 +npm help registry +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +npm help owner +.IP \(bu 4 +npm help whoami +.IP \(bu 4 +npm help profile +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-trust.1 b/node24/node_modules/npm/man/man1/npm-trust.1 new file mode 100644 index 0000000000000000000000000000000000000000..9788fbb339e21f3d51f834a87495de897a8fde15 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-trust.1 @@ -0,0 +1,130 @@ +.TH "NPM-TRUST" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-trust\fR - Manage trusted publishing relationships between packages and CI/CD providers +.SS "Synopsis" +.P +Note: This command is unaware of workspaces. +.SS "Prerequisites" +.P +Before using npm trust commands, ensure the following requirements are met: +.RS 0 +.IP \(bu 4 +\fBnpm version\fR: \fBnpm@11.10.0\fR or above is required. Use \fBnpm install -g npm@^11.10.0\fR to update if needed. +.IP \(bu 4 +\fBWrite permissions on the package\fR: You must have write access to the package you're configuring. +.IP \(bu 4 +\fB2FA enabled on account\fR: Two-factor authentication must be enabled at the account level. Even if it's not currently enabled, you must enable it to use trust commands. +.IP \(bu 4 +\fBSupported authentication methods\fR: Granular Access Tokens (GAT) with the bypass 2FA option are not supported. Legacy basic auth (username and password) credentials will not work for trust commands or endpoints. +.IP \(bu 4 +\fBPackage must exist\fR: The package you're configuring must already exist on the npm registry. +.RE 0 + +.SS "Description" +.P +Configure trust relationships between npm packages and CI/CD providers using OpenID Connect (OIDC). This is the command-line equivalent of managing trusted publisher configurations on the npm website. +.P +For a comprehensive overview of trusted publishing, see the \fBnpm trusted publishers documentation\fR \fI\(lahttps://docs.npmjs.com/trusted-publishers\(ra\fR. +.P +The \fB\[lB]package\[rB]\fR argument specifies the package name. If omitted, npm will use the name from the \fBpackage.json\fR in the current directory. +.P +Each trust relationship has its own set of configuration options and flags based on the OIDC claims provided by that provider. OIDC claims come from the CI/CD provider and include information such as repository name, workflow file, or environment. Since each provider's claims differ, the available flags and configuration keys are not universal\[em]npm matches the claims supported by each provider's OIDC configuration. For specific details on which claims and flags are supported for a given provider, use \fBnpm trust --help\fR. +.P +The required options depend on the CI/CD provider you're configuring. Detailed information about each option is available in the \fBmanaging trusted publisher configurations\fR \fI\(lahttps://docs.npmjs.com/trusted-publishers#managing-trusted-publisher-configurations\(ra\fR section of the npm documentation. If a provider is repository-based and the option is not provided, npm will use the \fBrepository.url\fR field from your \fBpackage.json\fR, if available. +.P +Currently, the registry only supports one configuration per package. If you attempt to create a new trust relationship when one already exists, it will result in an error. To replace an existing configuration: +.RS 0 +.IP 1. 4 +Use \fBnpm trust list \[lB]package\[rB]\fR to view the ID of the existing trusted publisher +.IP 2. 4 +Use \fBnpm trust revoke --id \[lB]package\[rB]\fR to remove the existing configuration +.IP 3. 4 +Then create your new trust relationship +.RE 0 + +.SS "Bulk Usage" +.P +For maintainers managing a large number of packages, you can configure trusted publishing in bulk using bash scripting. Create a loop that iterates through package names and their corresponding configuration details, executing the \fBnpm trust \fR command with the \fB--yes\fR flag for each package. +.P +The first request will require two-factor authentication. During two-factor authentication, you'll see an option on the npm website to skip two-factor authentication for the next 5 minutes. Enabling this option will allow subsequent \fBnpm trust \fR commands to proceed without two-factor authentication, streamlining the bulk configuration process. +.P +We recommend adding a 2-second sleep between each call to avoid rate limiting. With this approach, you can configure approximately 80 packages within the 5-minute two-factor authentication skip window. +.SS "Configuration" +.SS "\fBnpm trust github\fR" +.P +Create a trusted relationship between a package and GitHub Actions +.SS "Synopsis" +.P +.RS 2 +.nf +npm trust github \[lB]package\[rB] --file \[lB]--repo|--repository\[rB] \[lB]--env|--environment\[rB] \[lB]-y|--yes\[rB] +.fi +.RE +.SS "Flags" +.P +| Flag | Default | Type | Description | | --- | --- | --- | --- | | \fB--file\fR | null | String (required) | Name of workflow file within a repositories .GitHub folder (must end in yaml, yml) | | \fB--repository\fR, \fB--repo\fR | null | String | Name of the repository in the format owner/repo | | \fB--environment\fR, \fB--env\fR | null | String | CI environment name | | \fB--dry-run\fR | false | Boolean | Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. | | \fB--json\fR | false | Boolean | Whether or not to output JSON data, rather than the normal output. * In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. Not supported by all npm commands. | | \fB--registry\fR | "https://registry.npmjs.org/" | URL | The base URL of the npm registry. | | \fB--yes\fR, \fB-y\fR | null | null or Boolean | Automatically answer "yes" to any prompts that npm might print on the command line. | +.SS "\fBnpm trust gitlab\fR" +.P +Create a trusted relationship between a package and GitLab CI/CD +.SS "Synopsis" +.P +.RS 2 +.nf +npm trust gitlab \[lB]package\[rB] --file \[lB]--project|--repo|--repository\[rB] \[lB]--env|--environment\[rB] \[lB]-y|--yes\[rB] +.fi +.RE +.SS "Flags" +.P +| Flag | Default | Type | Description | | --- | --- | --- | --- | | \fB--file\fR | null | String (required) | Name of pipeline file (e.g., .gitlab-ci.yml) | | \fB--project\fR | null | String | Name of the project in the format group/project or group/subgroup/project | | \fB--environment\fR, \fB--env\fR | null | String | CI environment name | | \fB--dry-run\fR | false | Boolean | Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. | | \fB--json\fR | false | Boolean | Whether or not to output JSON data, rather than the normal output. * In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. Not supported by all npm commands. | | \fB--registry\fR | "https://registry.npmjs.org/" | URL | The base URL of the npm registry. | | \fB--yes\fR, \fB-y\fR | null | null or Boolean | Automatically answer "yes" to any prompts that npm might print on the command line. | +.SS "\fBnpm trust circleci\fR" +.P +Create a trusted relationship between a package and CircleCI +.SS "Synopsis" +.P +.RS 2 +.nf +npm trust circleci \[lB]package\[rB] --org-id --project-id --pipeline-definition-id --vcs-origin \[lB]--context-id ...\[rB] \[lB]-y|--yes\[rB] +.fi +.RE +.SS "Flags" +.P +| Flag | Default | Type | Description | | --- | --- | --- | --- | | \fB--org-id\fR | null | String (required) | CircleCI organization UUID | | \fB--project-id\fR | null | String (required) | CircleCI project UUID | | \fB--pipeline-definition-id\fR | null | String (required) | CircleCI pipeline definition UUID | | \fB--vcs-origin\fR | null | String (required) | CircleCI repository origin in format 'provider/owner/repo' | | \fB--context-id\fR | null | null or String (can be set multiple times) | CircleCI context UUID to match | | \fB--dry-run\fR | false | Boolean | Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. | | \fB--json\fR | false | Boolean | Whether or not to output JSON data, rather than the normal output. * In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. Not supported by all npm commands. | | \fB--registry\fR | "https://registry.npmjs.org/" | URL | The base URL of the npm registry. | | \fB--yes\fR, \fB-y\fR | null | null or Boolean | Automatically answer "yes" to any prompts that npm might print on the command line. | +.SS "\fBnpm trust list\fR" +.P +List trusted relationships for a package +.SS "Synopsis" +.P +.RS 2 +.nf +npm trust list \[lB]package\[rB] +.fi +.RE +.SS "Flags" +.P +| Flag | Default | Type | Description | | --- | --- | --- | --- | | \fB--json\fR | false | Boolean | Whether or not to output JSON data, rather than the normal output. * In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. Not supported by all npm commands. | | \fB--registry\fR | "https://registry.npmjs.org/" | URL | The base URL of the npm registry. | +.SS "\fBnpm trust revoke\fR" +.P +Revoke a trusted relationship for a package +.SS "Synopsis" +.P +.RS 2 +.nf +npm trust revoke \[lB]package\[rB] --id= +.fi +.RE +.SS "Flags" +.P +| Flag | Default | Type | Description | | --- | --- | --- | --- | | \fB--id\fR | null | String (required) | ID of the trusted relationship to revoke | | \fB--dry-run\fR | false | Boolean | Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. | | \fB--registry\fR | "https://registry.npmjs.org/" | URL | The base URL of the npm registry. | +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help publish +.IP \(bu 4 +npm help token +.IP \(bu 4 +npm help access +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help registry +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-undeprecate.1 b/node24/node_modules/npm/man/man1/npm-undeprecate.1 new file mode 100644 index 0000000000000000000000000000000000000000..e0f40617c2fe7f0a5351b3120a1594ef6c97028b --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-undeprecate.1 @@ -0,0 +1,57 @@ +.TH "NPM-UNDEPRECATE" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-undeprecate\fR - Undeprecate a version of a package +.SS "Synopsis" +.P +.RS 2 +.nf +npm undeprecate +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +This command will update the npm registry entry for a package, removing any deprecation warnings that currently exist. +.P +It works in the same way as npm help deprecate, except that this command removes deprecation warnings instead of adding them. +.SS "Configuration" +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "\fBotp\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with \fBnpm access\fR. +.P +If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. +.SS "\fBdry-run\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. +.P +Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help deprecate +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-uninstall.1 b/node24/node_modules/npm/man/man1/npm-uninstall.1 new file mode 100644 index 0000000000000000000000000000000000000000..cdb0def39224db65ae8e4e8ba371b90e26ec113d --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-uninstall.1 @@ -0,0 +1,159 @@ +.TH "NPM-UNINSTALL" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-uninstall\fR - Remove a package +.SS "Synopsis" +.P +.RS 2 +.nf +npm uninstall \[lB]<@scope>/\[rB]... + +aliases: unlink, remove, rm, r, un +.fi +.RE +.SS "Description" +.P +This uninstalls a package, completely removing everything npm installed on its behalf. +.P +It also removes the package from the \fBdependencies\fR, \fBdevDependencies\fR, \fBoptionalDependencies\fR, and \fBpeerDependencies\fR objects in your \fBpackage.json\fR. +.P +Further, if you have an \fBnpm-shrinkwrap.json\fR or \fBpackage-lock.json\fR, npm will update those files as well. +.P +\fB--no-save\fR will tell npm not to remove the package from your \fBpackage.json\fR, \fBnpm-shrinkwrap.json\fR, or \fBpackage-lock.json\fR files. +.P +\fB--save\fR or \fB-S\fR will tell npm to remove the package from your \fBpackage.json\fR, \fBnpm-shrinkwrap.json\fR, and \fBpackage-lock.json\fR files. This is the default, but you may need to use this if you have for instance \fBsave=false\fR in your \fBnpmrc\fR file +.P +In global mode (ie, with \fB-g\fR or \fB--global\fR appended to the command), it uninstalls the current package context as a global package. \fB--no-save\fR is ignored in this case. +.P +Scope is optional and follows the usual rules for npm help scope. +.SS "Examples" +.P +.RS 2 +.nf +npm uninstall sax +.fi +.RE +.P +\fBsax\fR will no longer be in your \fBpackage.json\fR, \fBnpm-shrinkwrap.json\fR, or \fBpackage-lock.json\fR files. +.P +.RS 2 +.nf +npm uninstall lodash --no-save +.fi +.RE +.P +\fBlodash\fR will not be removed from your \fBpackage.json\fR, \fBnpm-shrinkwrap.json\fR, or \fBpackage-lock.json\fR files. +.SS "Configuration" +.SS "\fBsave\fR" +.RS 0 +.IP \(bu 4 +Default: \fBtrue\fR unless when using \fBnpm update\fR where it defaults to \fBfalse\fR +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Save installed packages to a \fBpackage.json\fR file as dependencies. +.P +When used with the \fBnpm rm\fR command, removes the dependency from \fBpackage.json\fR. +.P +Will also prevent writing to \fBpackage-lock.json\fR if set to \fBfalse\fR. +.SS "\fBglobal\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBinstall-links\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help prune +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help folders +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-unpublish.1 b/node24/node_modules/npm/man/man1/npm-unpublish.1 new file mode 100644 index 0000000000000000000000000000000000000000..019011e4e0e671549278d3032d3618f1a04fe76e --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-unpublish.1 @@ -0,0 +1,137 @@ +.TH "NPM-UNPUBLISH" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-unpublish\fR - Remove a package from the registry +.SS "Synopsis" +.P +.RS 2 +.nf +npm unpublish \[lB]\[rB] +.fi +.RE +.P +To learn more about how the npm registry treats unpublish, see our \fBunpublish policies\fR \fI\(lahttps://docs.npmjs.com/policies/unpublish\(ra\fR. +.SS "Warning" +.P +Consider using the npm help deprecate command instead, if your intent is to encourage users to upgrade, or if you no longer want to maintain a package. +.SS "Description" +.P +This removes a package version from the registry, deleting its entry and removing the tarball. +.P +The npm registry will return an error if you are not npm help "logged in". +.P +If you do not specify a package name at all, the name and version to be unpublished will be pulled from the project in the current directory. +.P +If you specify a package name but do not specify a version or if you remove all of a package's versions then the registry will remove the root package entry entirely. +.P +Even if you unpublish a package version, that specific name and version combination can never be reused. In order to publish the package again, you must use a new version number. If you unpublish the entire package, you may not publish any new versions of that package until 24 hours have passed. +.SS "Configuration" +.SS "\fBdry-run\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. +.P +Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. +.SS "\fBforce\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Removes various protections against unfortunate side effects, common mistakes, unnecessary performance degradation, and malicious input. +.RS 0 +.IP \(bu 4 +Allow clobbering non-npm files in global installs. +.IP \(bu 4 +Allow the \fBnpm version\fR command to work on an unclean git repository. +.IP \(bu 4 +Allow deleting the cache folder with \fBnpm cache clean\fR. +.IP \(bu 4 +Allow installing packages that have an \fBengines\fR declaration requiring a different version of npm. +.IP \(bu 4 +Allow installing packages that have an \fBengines\fR declaration requiring a different version of \fBnode\fR, even if \fB--engine-strict\fR is enabled. +.IP \(bu 4 +Allow \fBnpm audit fix\fR to install modules outside your stated dependency range (including SemVer-major changes). +.IP \(bu 4 +Allow unpublishing all versions of a published package. +.IP \(bu 4 +Allow conflicting peerDependencies to be installed in the root project. +.IP \(bu 4 +Implicitly set \fB--yes\fR during \fBnpm init\fR. +.IP \(bu 4 +Allow clobbering existing values in \fBnpm pkg\fR +.IP \(bu 4 +Allow unpublishing of entire packages (not just a single version). +.RE 0 + +.P +If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "package spec" +.IP \(bu 4 +npm help deprecate +.IP \(bu 4 +npm help publish +.IP \(bu 4 +npm help registry +.IP \(bu 4 +npm help adduser +.IP \(bu 4 +npm help owner +.IP \(bu 4 +npm help login +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-unstar.1 b/node24/node_modules/npm/man/man1/npm-unstar.1 new file mode 100644 index 0000000000000000000000000000000000000000..54ce8a66caf08109c293b36c59b1c9473a735791 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-unstar.1 @@ -0,0 +1,70 @@ +.TH "NPM-UNSTAR" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-unstar\fR - Remove an item from your favorite packages +.SS "Synopsis" +.P +.RS 2 +.nf +npm unstar \[lB]...\[rB] +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +"Unstarring" a package is the opposite of npm help star, it removes an item from your list of favorite packages. +.SS "More" +.P +There's also these extra commands to help you manage your favorite packages: +.SS "Star" +.P +You can "star" a package using npm help star +.SS "Listing stars" +.P +You can see all your starred packages using npm help stars +.SS "Configuration" +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "\fBunicode\fR" +.RS 0 +.IP \(bu 4 +Default: false on windows, true on mac/unix systems with a unicode locale, as defined by the \fBLC_ALL\fR, \fBLC_CTYPE\fR, or \fBLANG\fR environment variables. +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set to true, npm uses unicode characters in the tree output. When false, it uses ascii characters instead of unicode glyphs. +.SS "\fBotp\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with \fBnpm access\fR. +.P +If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help star +.IP \(bu 4 +npm help stars +.IP \(bu 4 +npm help view +.IP \(bu 4 +npm help whoami +.IP \(bu 4 +npm help adduser +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-update.1 b/node24/node_modules/npm/man/man1/npm-update.1 new file mode 100644 index 0000000000000000000000000000000000000000..2a6c0683bb2887eb185aa8e061bc96cd0a191897 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-update.1 @@ -0,0 +1,436 @@ +.TH "NPM-UPDATE" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-update\fR - Update packages +.SS "Synopsis" +.P +.RS 2 +.nf +npm update \[lB]...\[rB] + +aliases: up, upgrade, udpate +.fi +.RE +.SS "Description" +.P +This command will update all the packages listed to the latest version (specified by the \fB\[rs]fBtag\[rs]fR config\fR \fI\(la/using-npm/config#tag\(ra\fR), respecting the semver constraints of both your package and its dependencies (if they also require the same package). +.P +It will also install missing packages. +.P +If the \fB-g\fR flag is specified, this command will update globally installed packages. +.P +If no package name is specified, all packages in the specified location (global or local) will be updated. +.P +Note that by default \fBnpm update\fR will not update the semver values of direct dependencies in your project \fBpackage.json\fR. If you want to also update values in \fBpackage.json\fR you can run: \fBnpm update --save\fR (or add the \fBsave=true\fR option to a npm help "configuration file" to make that the default behavior). +.SS "Example" +.P +For the examples below, assume that the current package is \fBapp\fR and it depends on dependencies, \fBdep1\fR (\fBdep2\fR, .. etc.). The published versions of \fBdep1\fR are: +.P +.RS 2 +.nf +{ + "dist-tags": { "latest": "1.2.2" }, + "versions": \[lB] + "1.2.2", + "1.2.1", + "1.2.0", + "1.1.2", + "1.1.1", + "1.0.0", + "0.4.1", + "0.4.0", + "0.2.0" + \[rB] +} +.fi +.RE +.SS "Caret Dependencies" +.P +If \fBapp\fR's \fBpackage.json\fR contains: +.P +.RS 2 +.nf +"dependencies": { + "dep1": "^1.1.1" +} +.fi +.RE +.P +Then \fBnpm update\fR will install \fBdep1@1.2.2\fR, because \fB1.2.2\fR is \fBlatest\fR and \fB1.2.2\fR satisfies \fB^1.1.1\fR. +.SS "Tilde Dependencies" +.P +However, if \fBapp\fR's \fBpackage.json\fR contains: +.P +.RS 2 +.nf +"dependencies": { + "dep1": "~1.1.1" +} +.fi +.RE +.P +In this case, running \fBnpm update\fR will install \fBdep1@1.1.2\fR. Even though the \fBlatest\fR tag points to \fB1.2.2\fR, this version does not satisfy \fB~1.1.1\fR, which is equivalent to \fB>=1.1.1 <1.2.0\fR. So the highest-sorting version that satisfies \fB~1.1.1\fR is used, which is \fB1.1.2\fR. +.SS "Caret Dependencies below 1.0.0" +.P +Suppose \fBapp\fR has a caret dependency on a version below \fB1.0.0\fR, for example: +.P +.RS 2 +.nf +"dependencies": { + "dep1": "^0.2.0" +} +.fi +.RE +.P +\fBnpm update\fR will install \fBdep1@0.2.0\fR. +.P +If the dependence were on \fB^0.4.0\fR: +.P +.RS 2 +.nf +"dependencies": { + "dep1": "^0.4.0" +} +.fi +.RE +.P +Then \fBnpm update\fR will install \fBdep1@0.4.1\fR, because that is the highest-sorting version that satisfies \fB^0.4.0\fR (\fB>= 0.4.0 <0.5.0\fR) +.SS "Subdependencies" +.P +Suppose your app now also has a dependency on \fBdep2\fR +.P +.RS 2 +.nf +{ + "name": "my-app", + "dependencies": { + "dep1": "^1.0.0", + "dep2": "1.0.0" + } +} +.fi +.RE +.P +and \fBdep2\fR itself depends on this limited range of \fBdep1\fR +.P +.RS 2 +.nf +{ +"name": "dep2", + "dependencies": { + "dep1": "~1.1.1" + } +} +.fi +.RE +.P +Then \fBnpm update\fR will install \fBdep1@1.1.2\fR because that is the highest version that \fBdep2\fR allows. npm will prioritize having a single version of \fBdep1\fR in your tree rather than two when that single version can satisfy the semver requirements of multiple dependencies in your tree. In this case if you really did need your package to use a newer version you would need to use \fBnpm install\fR. +.SS "Updating Globally-Installed Packages" +.P +\fBnpm update -g\fR will apply the \fBupdate\fR action to each globally installed package that is \fBoutdated\fR -- that is, has a version that is different from \fBwanted\fR. +.P +Note: Globally installed packages are treated as if they are installed with a caret semver range specified. So if you require to update to \fBlatest\fR you may need to run \fBnpm install -g \[lB]...\[rB]\fR +.P +NOTE: If a package has been upgraded to a version newer than \fBlatest\fR, it will be \fIdowngraded\fR. +.SS "Configuration" +.SS "\fBsave\fR" +.RS 0 +.IP \(bu 4 +Default: \fBtrue\fR unless when using \fBnpm update\fR where it defaults to \fBfalse\fR +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Save installed packages to a \fBpackage.json\fR file as dependencies. +.P +When used with the \fBnpm rm\fR command, removes the dependency from \fBpackage.json\fR. +.P +Will also prevent writing to \fBpackage-lock.json\fR if set to \fBfalse\fR. +.SS "\fBglobal\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "\fBinstall-strategy\fR" +.RS 0 +.IP \(bu 4 +Default: "hoisted" +.IP \(bu 4 +Type: "hoisted", "nested", "shallow", or "linked" +.RE 0 + +.P +Sets the strategy for installing packages in node_modules. hoisted (default): Install non-duplicated in top-level, and duplicated as necessary within directory structure. nested: (formerly --legacy-bundling) install in place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. +.SS "\fBlegacy-bundling\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=nested\fR +.RE 0 + +.P +Instead of hoisting package installs in \fBnode_modules\fR, install packages in the same manner that they are depended on. This may cause very deep directory structures and duplicate package installs as there is no de-duplicating. Sets \fB--install-strategy=nested\fR. +.SS "\fBglobal-style\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=shallow\fR +.RE 0 + +.P +Only install direct dependencies in the top level \fBnode_modules\fR, but hoist on deeper dependencies. Sets \fB--install-strategy=shallow\fR. +.SS "\fBomit\fR" +.RS 0 +.IP \(bu 4 +Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production'; otherwise, empty. +.IP \(bu 4 +Type: "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Dependency types to omit from the installation tree on disk. +.P +Note that these dependencies \fIare\fR still resolved and added to the \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR file. They are just not physically installed on disk. +.P +If a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included. +.P +If the resulting omit list includes \fB'dev'\fR, then the \fBNODE_ENV\fR environment variable will be set to \fB'production'\fR for all lifecycle scripts. +.SS "\fBinclude\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: "prod", "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Option that allows for defining which types of dependencies to install. +.P +This is the inverse of \fB--omit=\fR. +.P +Dependency types specified in \fB--include\fR will not be omitted, regardless of the order in which omit/include are specified on the command-line. +.SS "\fBstrict-peer-deps\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to \fBtrue\fR, and \fB--legacy-peer-deps\fR is not set, then \fIany\fR conflicting \fBpeerDependencies\fR will be treated as an install failure, even if npm could reasonably guess the appropriate resolution based on non-peer dependency relationships. +.P +By default, conflicting \fBpeerDependencies\fR deep in the dependency graph will be resolved using the nearest non-peer dependency specification, even if doing so will result in some packages receiving a peer dependency outside the range set in their package's \fBpeerDependencies\fR object. +.P +When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If \fB--strict-peer-deps\fR is set, then this warning is treated as a failure. +.SS "\fBpackage-lock\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to false, then ignore \fBpackage-lock.json\fR files when installing. This will also prevent \fIwriting\fR \fBpackage-lock.json\fR if \fBsave\fR is true. +.SS "\fBforeground-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: \fBfalse\fR unless when using \fBnpm pack\fR or \fBnpm publish\fR where it defaults to \fBtrue\fR +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Run all build scripts (ie, \fBpreinstall\fR, \fBinstall\fR, and \fBpostinstall\fR) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process. +.P +Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "\fBaudit\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When "true" submit audit reports alongside the current npm command to the default registry and all registries configured for scopes. See the documentation for npm help audit for details on what is submitted. +.SS "\fBbefore\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Date +.RE 0 + +.P +If passed to \fBnpm install\fR, will rebuild the npm tree such that only versions that were available \fBon or before\fR the given date are installed. If there are no versions available for the current set of dependencies, the command will error. +.P +If the requested version is a \fBdist-tag\fR and the given tag does not pass the \fB--before\fR filter, the most recent version less than or equal to that tag will be used. For example, \fBfoo@latest\fR might install \fBfoo@1.2\fR even though \fBlatest\fR is \fB2.0\fR. +.P +This config cannot be used with: \fBmin-release-age\fR +.SS "\fBmin-release-age\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Number +.RE 0 + +.P +If set, npm will build the npm tree such that only versions that were available more than the given number of days ago will be installed. If there are no versions available for the current set of dependencies, the command will error. +.P +This flag is a complement to \fBbefore\fR, which accepts an exact date instead of a relative number of days. +.P +This config cannot be used with: \fBbefore\fR +.P +This value is not exported to the environment for child processes. +.SS "\fBbin-links\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Tells npm to create symlinks (or \fB.cmd\fR shims on Windows) for package executables. +.P +Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems. +.SS "\fBfund\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When "true" displays the message at the end of each \fBnpm install\fR acknowledging the number of dependencies looking for funding. See npm help fund for details. +.SS "\fBdry-run\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. +.P +Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBinstall-links\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help outdated +.IP \(bu 4 +npm help shrinkwrap +.IP \(bu 4 +npm help registry +.IP \(bu 4 +npm help folders +.IP \(bu 4 +npm help ls +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-version.1 b/node24/node_modules/npm/man/man1/npm-version.1 new file mode 100644 index 0000000000000000000000000000000000000000..b5f9bac26182bc8ed369b83fdc38ec6ce3f354eb --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-version.1 @@ -0,0 +1,257 @@ +.TH "NPM-VERSION" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-version\fR - Bump a package version +.SS "Synopsis" +.P +.RS 2 +.nf +npm version \[lB] | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git\[rB] + +alias: verison +.fi +.RE +.SS "Configuration" +.SS "\fBallow-same-version\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Prevents throwing an error when \fBnpm version\fR is used to set the new version to the same value as the current version. +.SS "\fBcommit-hooks\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Run git commit hooks when using the \fBnpm version\fR command. +.SS "\fBgit-tag-version\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Tag the commit when using the \fBnpm version\fR command. Setting this to false results in no commit being made at all. +.SS "\fBjson\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to output JSON data, rather than the normal output. +.RS 0 +.IP \(bu 4 +In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. +.RE 0 + +.P +Not supported by all npm commands. +.SS "\fBpreid\fR" +.RS 0 +.IP \(bu 4 +Default: "" +.IP \(bu 4 +Type: String +.RE 0 + +.P +The "prerelease identifier" to use as a prefix for the "prerelease" part of a semver. Like the \fBrc\fR in \fB1.2.0-rc.8\fR. +.SS "\fBsign-git-tag\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to true, then the \fBnpm version\fR command will tag the version using \fB-s\fR to add a signature. +.P +Note that git requires you to have set up GPG keys in your git configs for this to work properly. +.SS "\fBsave\fR" +.RS 0 +.IP \(bu 4 +Default: \fBtrue\fR unless when using \fBnpm update\fR where it defaults to \fBfalse\fR +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Save installed packages to a \fBpackage.json\fR file as dependencies. +.P +When used with the \fBnpm rm\fR command, removes the dependency from \fBpackage.json\fR. +.P +Will also prevent writing to \fBpackage-lock.json\fR if set to \fBfalse\fR. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces-update\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to true, the npm cli will run an update after operations that may possibly change the workspaces installed to the \fBnode_modules\fR folder. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "Description" +.P +Run this in a package directory to bump the version and write the new data back to \fBpackage.json\fR, \fBpackage-lock.json\fR, and, if present, \fBnpm-shrinkwrap.json\fR. +.P +The \fBnewversion\fR argument should be a valid semver string, a valid second argument to \fBsemver.inc\fR \fI\(lahttps://github.com/npm/node-semver#functions\(ra\fR (one of \fBpatch\fR, \fBminor\fR, \fBmajor\fR, \fBprepatch\fR, \fBpreminor\fR, \fBpremajor\fR, \fBprerelease\fR), or \fBfrom-git\fR. In the second case, the existing version will be incremented by 1 in the specified field. \fBfrom-git\fR will try to read the latest git tag, and use that as the new npm version. +.P +\fBNote:\fR If the current version is a prerelease version, \fBpatch\fR will simply remove the prerelease suffix without incrementing the patch version number. For example, \fB1.2.0-5\fR becomes \fB1.2.0\fR with \fBnpm version patch\fR, not \fB1.2.1\fR. +.P +If run in a git repo, it will also create a version commit and tag. This behavior is controlled by \fBgit-tag-version\fR (see below), and can be disabled on the command line by running \fBnpm --no-git-tag-version version\fR. It will fail if the working directory is not clean, unless the \fB-f\fR or \fB--force\fR flag is set. +.P +\fBNote:\fR Git integration requires a reasonably recent version of git (2.0.0 or later is recommended). If you encounter issues with git commands, ensure your git installation is up to date. +.P +If supplied with \fB-m\fR or \fB\[rs]fB--message\[rs]fR config\fR \fI\(la/using-npm/config#message\(ra\fR option, npm will use it as a commit message when creating a version commit. If the \fBmessage\fR config contains \fB%s\fR then that will be replaced with the resulting version number. For example: +.P +.RS 2 +.nf +npm version patch -m "Upgrade to %s for reasons" +.fi +.RE +.P +If the \fB\[rs]fBsign-git-tag\[rs]fR config\fR \fI\(la/using-npm/config#sign-git-tag\(ra\fR is set, then the tag will be signed using the \fB-s\fR flag to git. Note that you must have a default GPG key set up in your git config for this to work properly. For example: +.P +.RS 2 +.nf +$ npm config set sign-git-tag true +$ npm version patch + +You need a passphrase to unlock the secret key for user: "isaacs (http://blog.izs.me/) " +2048-bit RSA key, ID 6C481CF6, created 2010-08-31 + +Enter passphrase: +.fi +.RE +.P +If \fBpreversion\fR, \fBversion\fR, or \fBpostversion\fR are in the \fBscripts\fR property of the package.json, they will be executed as part of running \fBnpm version\fR. +.P +The exact order of execution is as follows: +.RS 0 +.IP 1. 4 +Check to make sure the git working directory is clean before we get started. Your scripts may add files to the commit in future steps. This step is skipped if the \fB--force\fR flag is set. +.IP 2. 4 +Run the \fBpreversion\fR script. These scripts have access to the old \fBversion\fR in package.json. A typical use would be running your full test suite before deploying. Any files you want added to the commit should be explicitly added using \fBgit add\fR. +.IP 3. 4 +Bump \fBversion\fR in \fBpackage.json\fR as requested (\fBpatch\fR, \fBminor\fR, \fBmajor\fR, etc). +.IP 4. 4 +Run the \fBversion\fR script. These scripts have access to the new \fBversion\fR in package.json (so they can incorporate it into file headers in generated files for example). Again, scripts should explicitly add generated files to the commit using \fBgit add\fR. +.IP 5. 4 +Commit and tag. +.IP 6. 4 +Run the \fBpostversion\fR script. Use it to clean up the file system or automatically push the commit and/or tag. +.RE 0 + +.P +Take the following example: +.P +.RS 2 +.nf +{ + "scripts": { + "preversion": "npm test", + "version": "npm run build && git add -A dist", + "postversion": "git push && git push --tags && rm -rf build/temp" + } +} +.fi +.RE +.P +This runs all your tests and proceeds only if they pass. Then runs your \fBbuild\fR script, and adds everything in the \fBdist\fR directory to the commit. After the commit, it pushes the new commit and tag up to the server, and deletes the \fBbuild/temp\fR directory. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help init +.IP \(bu 4 +npm help run +.IP \(bu 4 +npm help scripts +.IP \(bu 4 +\fBpackage.json\fR \fI\(la/configuring-npm/package-json\(ra\fR +.IP \(bu 4 +npm help config +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-view.1 b/node24/node_modules/npm/man/man1/npm-view.1 new file mode 100644 index 0000000000000000000000000000000000000000..5991dcdd5007d4d77608255660ff5572e5dd3750 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-view.1 @@ -0,0 +1,284 @@ +.TH "NPM-VIEW" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-view\fR - View registry info +.SS "Synopsis" +.P +.RS 2 +.nf +npm view \[lB]\[rB] \[lB]\[lB].subfield\[rB]...\[rB] + +aliases: info, show, v +.fi +.RE +.SS "Description" +.P +This command shows data about a package and prints it to stdout. +.P +As an example, to view information about the \fBconnect\fR package from the registry, you would run: +.P +.RS 2 +.nf +npm view connect +.fi +.RE +.P +The default version is \fB"latest"\fR if unspecified. +.P +Field names can be specified after the package descriptor. For example, to show the dependencies of the \fBronn\fR package at version \fB0.3.5\fR, you could do the following: +.P +.RS 2 +.nf +npm view ronn@0.3.5 dependencies +.fi +.RE +.P +By default, \fBnpm view\fR shows data about the current project context (by looking for a \fBpackage.json\fR). To show field data for the current project use a file path (i.e. \fB.\fR): +.P +.RS 2 +.nf +npm view . dependencies +.fi +.RE +.P +You can view child fields by separating them with a period. To view the git repository URL for the latest version of \fBnpm\fR, you would run the following command: +.P +.RS 2 +.nf +npm view npm repository.url +.fi +.RE +.P +This makes it easy to view information about a dependency with a bit of shell scripting. For example, to view all the data about the version of \fBopts\fR that \fBronn\fR depends on, you could write the following: +.P +.RS 2 +.nf +npm view opts@$(npm view ronn dependencies.opts) +.fi +.RE +.P +For fields that are arrays, requesting a non-numeric field will return all of the values from the objects in the list. For example, to get all the contributor email addresses for the \fBexpress\fR package, you would run: +.P +.RS 2 +.nf +npm view express contributors.email +.fi +.RE +.P +You may also use numeric indices in square braces to specifically select an item in an array field. To just get the email address of the first contributor in the list, you can run: +.P +.RS 2 +.nf +npm view express contributors\[lB]0\[rB].email +.fi +.RE +.P +If the field value you are querying for is a property of an object, you should run: +.P +.RS 2 +.nf +npm view express time'\[lB]4.8.0\[rB]' +.fi +.RE +.P +Note: When accessing object properties that contain special characters or numeric keys, you need to use quotes around the key name. For example, to get the publish time of a specific version: +.P +.RS 2 +.nf +npm view express "time\[lB]4.17.1\[rB]" +.fi +.RE +.P +Without quotes, the shell may interpret the square brackets as glob patterns, causing the command to fail. You can also access the time field for a specific version by specifying the version in the package descriptor: +.P +.RS 2 +.nf +npm view express@4.17.1 time +.fi +.RE +.P +This will return all version-time pairs, but the context will be for that specific version. +.P +Multiple fields may be specified, and will be printed one after another. For example, to get all the contributor names and email addresses, you can do this: +.P +.RS 2 +.nf +npm view express contributors.name contributors.email +.fi +.RE +.P +"Person" fields are shown as a string if they would be shown as an object. So, for example, this will show the list of \fBnpm\fR contributors in the shortened string format. (See \fB\[rs]fBpackage.json\[rs]fR\fR \fI\(la/configuring-npm/package-json\(ra\fR for more on this.) +.P +.RS 2 +.nf +npm view npm contributors +.fi +.RE +.P +If a version range is provided, then data will be printed for every matching version of the package. This will show which version of \fBjsdom\fR was required by each matching version of \fByui3\fR: +.P +.RS 2 +.nf +npm view yui3@'>0.5.4' dependencies.jsdom +.fi +.RE +.P +To show the \fBconnect\fR package version history, you can do this: +.P +.RS 2 +.nf +npm view connect versions +.fi +.RE +.SS "Field Access Patterns" +.P +The \fBnpm view\fR command supports different ways to access nested fields and array elements in package metadata. Understanding these patterns makes it easier to extract specific information. +.SS "Nested Object Fields" +.P +Use dot notation to access nested object fields: +.P +.RS 2 +.nf +# Access nested properties +npm view npm repository.url +npm view express bugs.url +.fi +.RE +.SS "Array Element Access" +.P +For arrays, use numeric indices in square brackets to access specific elements: +.P +.RS 2 +.nf +# Get the first contributor's email +npm view express contributors\[lB]0\[rB].email + +# Get the second maintainer's name +npm view express maintainers\[lB]1\[rB].name +.fi +.RE +.SS "Object Property Access" +.P +For object properties (like accessing specific versions in the \fBtime\fR field), use bracket notation with the property name in quotes: +.P +.RS 2 +.nf +# Get publish time for a specific version +npm view express "time\[lB]4.17.1\[rB]" + +# Get dist-tags +npm view express "dist-tags.latest" +.fi +.RE +.SS "Extracting Fields from Arrays" +.P +Request a non-numeric field on an array to get all values from objects in the list: +.P +.RS 2 +.nf +# Get all contributor emails +npm view express contributors.email + +# Get all contributor names +npm view express contributors.name +.fi +.RE +.SS "Configuration" +.SS "\fBjson\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to output JSON data, rather than the normal output. +.RS 0 +.IP \(bu 4 +In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. +.RE 0 + +.P +Not supported by all npm commands. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "Output" +.P +If only a single string field for a single version is output, then it will not be colorized or quoted, to enable piping the output to another command. If the field is an object, it will be output as a JavaScript object literal. +.P +If the \fB--json\fR flag is given, the outputted fields will be JSON. +.P +If the version range matches multiple versions then each printed value will be prefixed with the version it applies to. +.P +If multiple fields are requested, then each of them is prefixed with the field name. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help "package spec" +.IP \(bu 4 +npm help search +.IP \(bu 4 +npm help registry +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +npm help docs +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm-whoami.1 b/node24/node_modules/npm/man/man1/npm-whoami.1 new file mode 100644 index 0000000000000000000000000000000000000000..af14f5ac61700c5029cbd170987d69d1a4fc6fe7 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm-whoami.1 @@ -0,0 +1,39 @@ +.TH "NPM-WHOAMI" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-whoami\fR - Display npm username +.SS "Synopsis" +.P +.RS 2 +.nf +npm whoami +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Description" +.P +Display the npm username of the currently logged-in user. +.P +If logged into a registry that provides token-based authentication, then connect to the \fB/-/whoami\fR registry endpoint to find the username associated with the token, and print to standard output. +.P +If logged into a registry that uses Basic Auth, then simply print the \fBusername\fR portion of the authentication string. +.SS "Configuration" +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +npm help adduser +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npm.1 b/node24/node_modules/npm/man/man1/npm.1 new file mode 100644 index 0000000000000000000000000000000000000000..dd74cb527c5e6637b4bd14d10ee39fcd7c178009 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npm.1 @@ -0,0 +1,131 @@ +.TH "NPM" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm\fR - javascript package manager +.SS "Synopsis" +.P +.RS 2 +.nf +npm +.fi +.RE +.P +Note: This command is unaware of workspaces. +.SS "Version" +.P +11.12.1 +.SS "Description" +.P +npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency conflicts intelligently. +.P +It is extremely configurable to support a variety of use cases. Most commonly, you use it to publish, discover, install, and develop node programs. +.P +Run \fBnpm help\fR to get a list of available commands. +.SS "Important" +.P +npm comes preconfigured to use npm's public registry at https://registry.npmjs.org by default. Use of the npm public registry is subject to terms of use available at https://docs.npmjs.com/policies/terms. +.P +You can configure npm to use any compatible registry you like, and even run your own registry. Use of someone else's registry is governed by their terms of use. +.SS "Introduction" +.P +You probably got npm because you want to install stuff. +.P +The very first thing you will most likely want to run in any node program is \fBnpm install\fR to install its dependencies. +.P +You can also run \fBnpm install blerg\fR to install the latest version of "blerg". Check out npm help install for more info. It can do a lot of stuff. +.P +Use the \fBnpm search\fR command to show everything that's available in the public registry. Use \fBnpm ls\fR to show everything you've installed. +.SS "Dependencies" +.P +If a package lists a dependency using a git URL, npm will install that dependency using the \fB\[rs]fBgit\[rs]fR\fR \fI\(lahttps://github.com/git-guides/install-git\(ra\fR command and will generate an error if it is not installed. +.P +If one of the packages npm tries to install is a native node module and requires compiling of C++ Code, npm will use \fBnode-gyp\fR \fI\(lahttps://github.com/nodejs/node-gyp\(ra\fR for that task. For a Unix system, \fBnode-gyp\fR \fI\(lahttps://github.com/nodejs/node-gyp\(ra\fR needs Python, make and a buildchain like GCC. On Windows, Python and Microsoft Visual Studio C++ are needed. For more information visit \fBthe node-gyp repository\fR \fI\(lahttps://github.com/nodejs/node-gyp\(ra\fR and the \fBnode-gyp Wiki\fR \fI\(lahttps://github.com/nodejs/node-gyp/wiki\(ra\fR. +.SS "Directories" +.P +See npm help folders to learn about where npm puts stuff. +.P +In particular, npm has two modes of operation: +.RS 0 +.IP \(bu 4 +local mode: npm installs packages into the current project directory, which defaults to the current working directory. Packages install to \fB./node_modules\fR, and bins to \fB./node_modules/.bin\fR. +.IP \(bu 4 +global mode: npm installs packages into the install prefix at \fB$NPM_CONFIG_PREFIX/lib/node_modules\fR and bins to \fB$NPM_CONFIG_PREFIX/bin\fR. +.RE 0 + +.P +Local mode is the default. Use \fB-g\fR or \fB--global\fR on any command to run in global mode instead. +.SS "Developer Usage" +.P +If you're using npm to develop and publish your code, check out the following help topics: +.RS 0 +.IP \(bu 4 +json: Make a package.json file. See \fB\[rs]fBpackage.json\[rs]fR\fR \fI\(la/configuring-npm/package-json\(ra\fR. +.IP \(bu 4 +link: Links your current working code into Node's path, so that you don't have to reinstall every time you make a change. Use npm help link to do this. +.IP \(bu 4 +install: It's a good idea to install things if you don't need the symbolic link. Especially, installing other peoples code from the registry is done via npm help install +.IP \(bu 4 +adduser: Create an account or log in. When you do this, npm will store credentials in the user config file. +.IP \(bu 4 +publish: Use the npm help publish command to upload your code to the registry. +.RE 0 + +.SS "Configuration" +.P +npm is extremely configurable. It reads its configuration options from 5 places. +.RS 0 +.IP \(bu 4 +Command line switches: Set a config with \fB--key val\fR. All keys take a value, even if they are booleans (the config parser doesn't know what the options are at the time of parsing). If you do not provide a value (\fB--key\fR) then the option is set to boolean \fBtrue\fR. +.IP \(bu 4 +Environment Variables: Set any config by prefixing the name in an environment variable with \fBNPM_CONFIG_\fR. For example, \fBexport NPM_CONFIG_KEY=val\fR. +.IP \(bu 4 +User Configs: The file at \fB$HOME/.npmrc\fR is an ini-formatted list of configs. If present, it is parsed. If the \fBuserconfig\fR option is set in the cli or env, that file will be used instead. +.IP \(bu 4 +Global Configs: The file found at \fB./etc/npmrc\fR (relative to the global prefix will be parsed if it is found. See npm help prefix for more info on the global prefix. If the \fBglobalconfig\fR option is set in the cli, env, or user config, then that file is parsed instead. +.IP \(bu 4 +Defaults: npm's default configuration options are defined in \fBlib/utils/config/definitions.js\fR. These must not be changed. +.RE 0 + +.P +See npm help config for much, much, more information. +.SS "Contributions" +.P +Patches welcome! +.P +If you would like to help, but don't know what to work on, read the \fBcontributing guidelines\fR \fI\(lahttps://github.com/npm/cli/blob/latest/CONTRIBUTING.md\(ra\fR and check the issues list. +.SS "Bugs" +.P +When you find issues, please report them: \fI\(lahttps://github.com/npm/cli/issues\(ra\fR +.P +Please be sure to follow the template and bug reporting guidelines. +.SS "Feature Requests" +.P +Discuss new feature ideas on our discussion forum: +.RS 0 +.IP \(bu 4 +\fI\(lahttps://github.com/orgs/community/discussions/categories/npm\(ra\fR +.RE 0 + +.P +Or suggest formal RFC proposals: +.RS 0 +.IP \(bu 4 +\fI\(lahttps://github.com/npm/rfcs\(ra\fR +.RE 0 + +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help help +.IP \(bu 4 +\fBpackage.json\fR \fI\(la/configuring-npm/package-json\(ra\fR +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help prefix +.IP \(bu 4 +npm help publish +.RE 0 diff --git a/node24/node_modules/npm/man/man1/npx.1 b/node24/node_modules/npm/man/man1/npx.1 new file mode 100644 index 0000000000000000000000000000000000000000..53cd485b0aff965c5b4e031b33e9391a01e25358 --- /dev/null +++ b/node24/node_modules/npm/man/man1/npx.1 @@ -0,0 +1,158 @@ +.TH "NPX" "1" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpx\fR - Run a command from a local or remote npm package +.SS "Synopsis" +.P +.RS 2 +.nf +npx -- \[lB]@\[rB] \[lB]args...\[rB] +npx --package=\[lB]@\[rB] -- \[lB]args...\[rB] +npx -c ' \[lB]args...\[rB]' +npx --package=foo -c ' \[lB]args...\[rB]' +.fi +.RE +.SS "Description" +.P +This command allows you to run an arbitrary command from an npm package (either one installed locally, or fetched remotely), in a similar context as running it via \fBnpm run\fR. +.P +Run this command to execute a package's binary. Any options and arguments after the package name are passed directly to the executed command, not to npx itself. For example, \fBnpx create-react-app my-app --template typescript\fR will pass \fBmy-app\fR and \fB--template typescript\fR to the \fBcreate-react-app\fR command. To see what options a specific package accepts, consult that package's documentation (e.g., at npmjs.com or in its repository). +.P +Whatever packages are specified by the \fB--package\fR option will be provided in the \fBPATH\fR of the executed command, along with any locally installed package executables. The \fB--package\fR option may be specified multiple times, to execute the supplied command in an environment where all specified packages are available. +.P +If any requested packages are not present in the local project dependencies, then they are installed to a folder in the npm cache, which is added to the \fBPATH\fR environment variable in the executed process. A prompt is printed (which can be suppressed by providing either \fB--yes\fR or \fB--no\fR). +.P +Package names provided without a specifier will be matched with whatever version exists in the local project. Package names with a specifier will only be considered a match if they have the exact same name and version as the local dependency. +.P +If no \fB-c\fR or \fB--call\fR option is provided, then the positional arguments are used to generate the command string. If no \fB--package\fR options are provided, then npm will attempt to determine the executable name from the package specifier provided as the first positional argument according to the following heuristic: +.RS 0 +.IP \(bu 4 +If the package has a single entry in its \fBbin\fR field in \fBpackage.json\fR, or if all entries are aliases of the same command, then that command will be used. +.IP \(bu 4 +If the package has multiple \fBbin\fR entries, and one of them matches the unscoped portion of the \fBname\fR field, then that command will be used. +.IP \(bu 4 +If this does not result in exactly one option (either because there are no bin entries, or none of them match the \fBname\fR of the package), then \fBnpm exec\fR exits with an error. +.RE 0 + +.P +To run a binary \fIother than\fR the named binary, specify one or more \fB--package\fR options, which will prevent npm from inferring the package from the first command argument. +.SS "\fBnpx\fR vs \fBnpm exec\fR" +.P +When run via the \fBnpx\fR binary, all flags and options \fImust\fR be set prior to any positional arguments. When run via \fBnpm exec\fR, a double-hyphen \fB--\fR flag can be used to suppress npm's parsing of switches and options that should be sent to the executed command. +.P +For example: +.P +.RS 2 +.nf +$ npx foo@latest bar --package=@npmcli/foo +.fi +.RE +.P +In this case, npm will resolve the \fBfoo\fR package name, and run the following command: +.P +.RS 2 +.nf +$ foo bar --package=@npmcli/foo +.fi +.RE +.P +Since the \fB--package\fR option comes \fIafter\fR the positional arguments, it is treated as an argument to the executed command. +.P +In contrast, due to npm's argument parsing logic, running this command is different: +.P +.RS 2 +.nf +$ npm exec foo@latest bar --package=@npmcli/foo +.fi +.RE +.P +In this case, npm will parse the \fB--package\fR option first, resolving the \fB@npmcli/foo\fR package. Then, it will execute the following command in that context: +.P +.RS 2 +.nf +$ foo@latest bar +.fi +.RE +.P +The double-hyphen character is recommended to explicitly tell npm to stop parsing command line options and switches. The following command would thus be equivalent to the \fBnpx\fR command above: +.P +.RS 2 +.nf +$ npm exec -- foo@latest bar --package=@npmcli/foo +.fi +.RE +.SS "Examples" +.P +Run the version of \fBtap\fR in the local dependencies, with the provided arguments: +.P +.RS 2 +.nf +$ npm exec -- tap --bail test/foo.js +$ npx tap --bail test/foo.js +.fi +.RE +.P +Run a command \fIother than\fR the command whose name matches the package name by specifying a \fB--package\fR option: +.P +.RS 2 +.nf +$ npm exec --package=foo -- bar --bar-argument +# ~ or ~ +$ npx --package=foo bar --bar-argument +.fi +.RE +.P +Run an arbitrary shell script, in the context of the current project: +.P +.RS 2 +.nf +$ npm x -c 'eslint && say "hooray, lint passed"' +$ npx -c 'eslint && say "hooray, lint passed"' +.fi +.RE +.SS "Compatibility with Older npx Versions" +.P +The \fBnpx\fR binary was rewritten in npm v7.0.0, and the standalone \fBnpx\fR package deprecated at that time. \fBnpx\fR uses the \fBnpm exec\fR command instead of a separate argument parser and install process, with some affordances to maintain backwards compatibility with the arguments it accepted in previous versions. +.P +This resulted in some shifts in its functionality: +.RS 0 +.IP \(bu 4 +Any \fBnpm\fR config value may be provided. +.IP \(bu 4 +To prevent security and user-experience problems from mistyping package names, \fBnpx\fR prompts before installing anything. Suppress this prompt with the \fB-y\fR or \fB--yes\fR option. +.IP \(bu 4 +The \fB--no-install\fR option is deprecated, and will be converted to \fB--no\fR. +.IP \(bu 4 +Shell fallback functionality is removed, as it is not advisable. +.IP \(bu 4 +The \fB-p\fR argument is a shorthand for \fB--parseable\fR in npm, but shorthand for \fB--package\fR in npx. This is maintained, but only for the \fBnpx\fR executable. +.IP \(bu 4 +The \fB--ignore-existing\fR option is removed. Locally installed bins are always present in the executed process \fBPATH\fR. +.IP \(bu 4 +The \fB--npm\fR option is removed. \fBnpx\fR will always use the \fBnpm\fR it ships with. +.IP \(bu 4 +The \fB--node-arg\fR and \fB-n\fR options have been removed. Use \fB\[rs]fBNODE_OPTIONS\[rs]fR\fR \fI\(lahttps://nodejs.org/api/cli.html#node_optionsoptions\(ra\fR instead: e.g., \fBNODE_OPTIONS="--trace-warnings --trace-exit" npx foo --random=true\fR +.IP \(bu 4 +The \fB--always-spawn\fR option is redundant, and thus removed. +.IP \(bu 4 +The \fB--shell\fR option is replaced with \fB--script-shell\fR, but maintained in the \fBnpx\fR executable for backwards compatibility. +.RE 0 + +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help run +.IP \(bu 4 +npm help scripts +.IP \(bu 4 +npm help test +.IP \(bu 4 +npm help start +.IP \(bu 4 +npm help restart +.IP \(bu 4 +npm help stop +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help exec +.RE 0 diff --git a/node24/node_modules/npm/man/man5/folders.5 b/node24/node_modules/npm/man/man5/folders.5 new file mode 100644 index 0000000000000000000000000000000000000000..7d6c2b906b6e189b5c1e6f4fa5d7c36986bf14f2 --- /dev/null +++ b/node24/node_modules/npm/man/man5/folders.5 @@ -0,0 +1,147 @@ +.TH "FOLDERS" "5" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBFolders\fR - Folder structures used by npm +.SS "Description" +.P +npm puts various things on your computer. That's its job. +.P +This document will tell you what it puts where. +.SS "tl;dr" +.RS 0 +.IP \(bu 4 +Local install (default): puts stuff in \fB./node_modules\fR of the current package root. +.IP \(bu 4 +Global install (with \fB-g\fR): puts stuff in /usr/local or wherever node is installed. +.IP \(bu 4 +Install it \fBlocally\fR if you're going to \fBrequire()\fR it. +.IP \(bu 4 +Install it \fBglobally\fR if you're going to run it on the command line. +.IP \(bu 4 +If you need both, then install it in both places, or use \fBnpm link\fR. +.RE 0 + +.SS "prefix Configuration" +.P +The \fB\[rs]fBprefix\[rs]fR config\fR \fI\(la/using-npm/config#prefix\(ra\fR defaults to the location where node is installed. On most systems, this is \fB/usr/local\fR. On Windows, it's \fB%AppData%\[rs]npm\fR. On Unix systems, it's one level up, since node is typically installed at \fB{prefix}/bin/node\fR rather than \fB{prefix}/node.exe\fR. +.P +When the \fBglobal\fR flag is set, npm installs things into this prefix. When it is not set, it uses the root of the current package, or the current working directory if not in a package already. +.SS "Node Modules" +.P +Packages are dropped into the \fBnode_modules\fR folder under the \fBprefix\fR. When installing locally, this means that you can \fBrequire("packagename")\fR to load its main module, or \fBrequire("packagename/lib/path/to/sub/module")\fR to load other modules. +.P +Global installs on Unix systems go to \fB{prefix}/lib/node_modules\fR. Global installs on Windows go to \fB{prefix}/node_modules\fR (that is, no \fBlib\fR folder.) +.P +Scoped packages are installed the same way, except they are grouped together in a sub-folder of the relevant \fBnode_modules\fR folder with the name of that scope prefix by the @ symbol, e.g. \fBnpm install @myorg/package\fR would place the package in \fB{prefix}/node_modules/@myorg/package\fR. See npm help scope for more details. +.P +If you wish to \fBrequire()\fR a package, then install it locally. +.SS "Executables" +.P +When in global mode, executables are linked into \fB{prefix}/bin\fR on Unix, or directly into \fB{prefix}\fR on Windows. Ensure that path is in your terminal's \fBPATH\fR environment to run them. +.P +When in local mode, executables are linked into \fB./node_modules/.bin\fR so that they can be made available to scripts run through npm. (For example, so that a test runner will be in the path when you run \fBnpm test\fR.) +.SS "Man Pages" +.P +When in global mode, man pages are linked into \fB{prefix}/share/man\fR. +.P +When in local mode, man pages are not installed. +.P +Man pages are not installed on Windows systems. +.SS "Cache" +.P +See npm help cache. Cache files are stored in \fB~/.npm\fR on Posix, or \fB%LocalAppData%/npm-cache\fR on Windows. +.P +This is controlled by the \fB\[rs]fBcache\[rs]fR config\fR \fI\(la/using-npm/config#cache\(ra\fR param. +.SS "More Information" +.P +When installing locally, npm first tries to find an appropriate \fBprefix\fR folder. This is so that \fBnpm install foo@1.2.3\fR will install to the sensible root of your package, even if you happen to have \fBcd\fRed into some other folder. +.P +Starting at the $PWD, npm will walk up the folder tree checking for a folder that contains either a \fBpackage.json\fR file, or a \fBnode_modules\fR folder. If such a thing is found, then that is treated as the effective "current directory" for the purpose of running npm commands. (This behavior is inspired by and similar to git's .git-folder seeking logic when running git commands in a working dir.) +.P +If no package root is found, then the current folder is used. +.P +When you run \fBnpm install foo@1.2.3\fR, then the package is loaded into the cache, and then unpacked into \fB./node_modules/foo\fR. Then, any of foo's dependencies are similarly unpacked into \fB./node_modules/foo/node_modules/...\fR. +.P +Any bin files are symlinked to \fB./node_modules/.bin/\fR, so that they may be found by npm scripts when necessary. +.SS "Global Installation" +.P +If the \fB\[rs]fBglobal\[rs]fR config\fR \fI\(la/using-npm/config#global\(ra\fR is set to true, then npm will install packages "globally". +.P +For global installation, packages are installed roughly the same way, but using the folders described above. +.SS "Cycles, Conflicts, and Folder Parsimony" +.P +Cycles are handled using the property of node's module system that it walks up the directories looking for \fBnode_modules\fR folders. So, at every stage, if a package is already installed in an ancestor \fBnode_modules\fR folder, then it is not installed at the current location. +.P +Consider the case above, where \fBfoo -> bar -> baz\fR. Imagine if, in addition to that, baz depended on bar, so you'd have: \fBfoo -> bar -> baz -> bar -> baz ...\fR. However, since the folder structure is: \fBfoo/node_modules/bar/node_modules/baz\fR, there's no need to put another copy of bar into \fB.../baz/node_modules\fR, since when baz calls \fBrequire("bar")\fR, it will get the copy that is installed in \fBfoo/node_modules/bar\fR. +.P +This shortcut is only used if the exact same version would be installed in multiple nested \fBnode_modules\fR folders. It is still possible to have \fBa/node_modules/b/node_modules/a\fR if the two "a" packages are different versions. However, without repeating the exact same package multiple times, an infinite regress will always be prevented. +.P +Another optimization can be made by installing dependencies at the highest level possible, below the localized "target" folder (hoisting). Since version 3, npm hoists dependencies by default. +.SS "Example" +.P +Consider this dependency graph: +.P +.RS 2 +.nf +foo ++-- blerg@1.2.5 ++-- bar@1.2.3 +| +-- blerg@1.x (latest=1.3.7) +| +-- baz@2.x +| | `-- quux@3.x +| | `-- bar@1.2.3 (cycle) +| `-- asdf@* +`-- baz@1.2.3 + `-- quux@3.x + `-- bar +.fi +.RE +.P +In this case, we might expect a folder structure like this (with all dependencies hoisted to the highest level possible): +.P +.RS 2 +.nf +foo ++-- node_modules + +-- blerg (1.2.5) <---\[lB]A\[rB] + +-- bar (1.2.3) <---\[lB]B\[rB] + | +-- node_modules + | +-- baz (2.0.2) <---\[lB]C\[rB] + +-- asdf (2.3.4) + +-- baz (1.2.3) <---\[lB]D\[rB] + +-- quux (3.2.0) <---\[lB]E\[rB] +.fi +.RE +.P +Since foo depends directly on \fBbar@1.2.3\fR and \fBbaz@1.2.3\fR, those are installed in foo's \fBnode_modules\fR folder. +.P +Even though the latest copy of blerg is 1.3.7, foo has a specific dependency on version 1.2.5. So, that gets installed at \[lB]A\[rB]. Since the parent installation of blerg satisfies bar's dependency on \fBblerg@1.x\fR, it does not install another copy under \[lB]B\[rB]. +.P +Bar \[lB]B\[rB] also has dependencies on baz and asdf. Because it depends on \fBbaz@2.x\fR, it cannot re-use the \fBbaz@1.2.3\fR installed in the parent \fBnode_modules\fR folder \[lB]D\[rB], and must install its own copy \[lB]C\[rB]. In order to minimize duplication, npm hoists dependencies to the top level by default, so asdf is installed under \[lB]A\[rB]. +.P +Underneath bar, the \fBbaz -> quux -> bar\fR dependency creates a cycle. However, because bar is already in quux's ancestry \[lB]B\[rB], it does not unpack another copy of bar into that folder. Likewise, quux's \[lB]E\[rB] folder tree is empty, because its dependency on bar is satisfied by the parent folder copy installed at \[lB]B\[rB]. +.P +For a graphical breakdown of what is installed where, use \fBnpm ls\fR. +.SS "Publishing" +.P +Upon publishing, npm will look in the \fBnode_modules\fR folder. If any of the items there are not in the \fBbundleDependencies\fR array, then they will not be included in the package tarball. +.P +This allows a package maintainer to install all of their dependencies (and dev dependencies) locally, but only re-publish those items that cannot be found elsewhere. See \fB\[rs]fBpackage.json\[rs]fR\fR \fI\(la/configuring-npm/package-json\(ra\fR for more information. +.SS "See also" +.RS 0 +.IP \(bu 4 +\fBpackage.json\fR \fI\(la/configuring-npm/package-json\(ra\fR +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help pack +.IP \(bu 4 +npm help cache +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help publish +.RE 0 diff --git a/node24/node_modules/npm/man/man5/install.5 b/node24/node_modules/npm/man/man5/install.5 new file mode 100644 index 0000000000000000000000000000000000000000..816b924cd4ea39b6cb487a1c4fdb8a8467d412fb --- /dev/null +++ b/node24/node_modules/npm/man/man5/install.5 @@ -0,0 +1,54 @@ +.TH "INSTALL" "5" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBInstall\fR - Download and install node and npm +.SS "Description" +.P +To publish and install packages to and from the public npm registry, you must install Node.js and the npm command line interface using either a Node version manager or a Node installer. \fBWe strongly recommend using a Node version manager to install Node.js and npm.\fR We do not recommend using a Node installer, since the Node installation process installs npm in a directory with local permissions and can cause permissions errors when you run npm packages globally. +.SS "Overview" +.RS 0 +.IP \(bu 4 +\fI(Checking your version of npm and Node.js)\fR +.IP \(bu 4 +\fI(Using a Node version manager to install Node.js and npm)\fR +.IP \(bu 4 +\fI(Using a Node installer to install Node.js and npm)\fR +.RE 0 + +.SS "Checking your version of npm and Node.js" +.P +To see if you already have Node.js and npm installed and check the installed version, run the following commands: +.P +.RS 2 +.nf +node -v +npm -v +.fi +.RE +.SS "Using a Node version manager to install Node.js and npm" +.P +Node version managers allow you to install and switch between multiple versions of Node.js and npm on your system so you can test your applications on multiple versions of npm to ensure they work for users on different versions. You can \fBsearch for them on GitHub\fR \fI\(lahttps://github.com/search?q=node+version+manager+archived%3Afalse&type=repositories&ref=advsearch\(ra\fR. +.SS "Using a Node installer to install Node.js and npm" +.P +If you are unable to use a Node version manager, you can use a Node installer to install both Node.js and npm on your system. +.RS 0 +.IP \(bu 4 +\fBNode.js installer\fR \fI\(lahttps://nodejs.org/en/download/\(ra\fR +.IP \(bu 4 +\fBNodeSource installer\fR \fI\(lahttps://github.com/nodesource/distributions\(ra\fR. If you use Linux, we recommend that you use a NodeSource installer. +.RE 0 + +.SS "macOS or Windows Node installers" +.P +If you're using macOS or Windows, use one of the installers from the \fBNode.js download page\fR \fI\(lahttps://nodejs.org/en/download/\(ra\fR. Be sure to install the version labeled \fBLTS\fR. Other versions have not yet been tested with npm. +.SS "Linux or other operating systems Node installers" +.P +If you're using Linux or another operating system, use one of the following installers: +.RS 0 +.IP \(bu 4 +\fBNodeSource installer\fR \fI\(lahttps://github.com/nodesource/distributions\(ra\fR (recommended) +.IP \(bu 4 +One of the installers on the \fBNode.js download page\fR \fI\(lahttps://nodejs.org/en/download/\(ra\fR +.RE 0 + +.P +Or see \fBthis page\fR \fI\(lahttps://nodejs.org/en/download/package-manager/\(ra\fR to install npm for Linux in the way many Linux developers prefer. diff --git a/node24/node_modules/npm/man/man5/npm-global.5 b/node24/node_modules/npm/man/man5/npm-global.5 new file mode 100644 index 0000000000000000000000000000000000000000..7d6c2b906b6e189b5c1e6f4fa5d7c36986bf14f2 --- /dev/null +++ b/node24/node_modules/npm/man/man5/npm-global.5 @@ -0,0 +1,147 @@ +.TH "FOLDERS" "5" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBFolders\fR - Folder structures used by npm +.SS "Description" +.P +npm puts various things on your computer. That's its job. +.P +This document will tell you what it puts where. +.SS "tl;dr" +.RS 0 +.IP \(bu 4 +Local install (default): puts stuff in \fB./node_modules\fR of the current package root. +.IP \(bu 4 +Global install (with \fB-g\fR): puts stuff in /usr/local or wherever node is installed. +.IP \(bu 4 +Install it \fBlocally\fR if you're going to \fBrequire()\fR it. +.IP \(bu 4 +Install it \fBglobally\fR if you're going to run it on the command line. +.IP \(bu 4 +If you need both, then install it in both places, or use \fBnpm link\fR. +.RE 0 + +.SS "prefix Configuration" +.P +The \fB\[rs]fBprefix\[rs]fR config\fR \fI\(la/using-npm/config#prefix\(ra\fR defaults to the location where node is installed. On most systems, this is \fB/usr/local\fR. On Windows, it's \fB%AppData%\[rs]npm\fR. On Unix systems, it's one level up, since node is typically installed at \fB{prefix}/bin/node\fR rather than \fB{prefix}/node.exe\fR. +.P +When the \fBglobal\fR flag is set, npm installs things into this prefix. When it is not set, it uses the root of the current package, or the current working directory if not in a package already. +.SS "Node Modules" +.P +Packages are dropped into the \fBnode_modules\fR folder under the \fBprefix\fR. When installing locally, this means that you can \fBrequire("packagename")\fR to load its main module, or \fBrequire("packagename/lib/path/to/sub/module")\fR to load other modules. +.P +Global installs on Unix systems go to \fB{prefix}/lib/node_modules\fR. Global installs on Windows go to \fB{prefix}/node_modules\fR (that is, no \fBlib\fR folder.) +.P +Scoped packages are installed the same way, except they are grouped together in a sub-folder of the relevant \fBnode_modules\fR folder with the name of that scope prefix by the @ symbol, e.g. \fBnpm install @myorg/package\fR would place the package in \fB{prefix}/node_modules/@myorg/package\fR. See npm help scope for more details. +.P +If you wish to \fBrequire()\fR a package, then install it locally. +.SS "Executables" +.P +When in global mode, executables are linked into \fB{prefix}/bin\fR on Unix, or directly into \fB{prefix}\fR on Windows. Ensure that path is in your terminal's \fBPATH\fR environment to run them. +.P +When in local mode, executables are linked into \fB./node_modules/.bin\fR so that they can be made available to scripts run through npm. (For example, so that a test runner will be in the path when you run \fBnpm test\fR.) +.SS "Man Pages" +.P +When in global mode, man pages are linked into \fB{prefix}/share/man\fR. +.P +When in local mode, man pages are not installed. +.P +Man pages are not installed on Windows systems. +.SS "Cache" +.P +See npm help cache. Cache files are stored in \fB~/.npm\fR on Posix, or \fB%LocalAppData%/npm-cache\fR on Windows. +.P +This is controlled by the \fB\[rs]fBcache\[rs]fR config\fR \fI\(la/using-npm/config#cache\(ra\fR param. +.SS "More Information" +.P +When installing locally, npm first tries to find an appropriate \fBprefix\fR folder. This is so that \fBnpm install foo@1.2.3\fR will install to the sensible root of your package, even if you happen to have \fBcd\fRed into some other folder. +.P +Starting at the $PWD, npm will walk up the folder tree checking for a folder that contains either a \fBpackage.json\fR file, or a \fBnode_modules\fR folder. If such a thing is found, then that is treated as the effective "current directory" for the purpose of running npm commands. (This behavior is inspired by and similar to git's .git-folder seeking logic when running git commands in a working dir.) +.P +If no package root is found, then the current folder is used. +.P +When you run \fBnpm install foo@1.2.3\fR, then the package is loaded into the cache, and then unpacked into \fB./node_modules/foo\fR. Then, any of foo's dependencies are similarly unpacked into \fB./node_modules/foo/node_modules/...\fR. +.P +Any bin files are symlinked to \fB./node_modules/.bin/\fR, so that they may be found by npm scripts when necessary. +.SS "Global Installation" +.P +If the \fB\[rs]fBglobal\[rs]fR config\fR \fI\(la/using-npm/config#global\(ra\fR is set to true, then npm will install packages "globally". +.P +For global installation, packages are installed roughly the same way, but using the folders described above. +.SS "Cycles, Conflicts, and Folder Parsimony" +.P +Cycles are handled using the property of node's module system that it walks up the directories looking for \fBnode_modules\fR folders. So, at every stage, if a package is already installed in an ancestor \fBnode_modules\fR folder, then it is not installed at the current location. +.P +Consider the case above, where \fBfoo -> bar -> baz\fR. Imagine if, in addition to that, baz depended on bar, so you'd have: \fBfoo -> bar -> baz -> bar -> baz ...\fR. However, since the folder structure is: \fBfoo/node_modules/bar/node_modules/baz\fR, there's no need to put another copy of bar into \fB.../baz/node_modules\fR, since when baz calls \fBrequire("bar")\fR, it will get the copy that is installed in \fBfoo/node_modules/bar\fR. +.P +This shortcut is only used if the exact same version would be installed in multiple nested \fBnode_modules\fR folders. It is still possible to have \fBa/node_modules/b/node_modules/a\fR if the two "a" packages are different versions. However, without repeating the exact same package multiple times, an infinite regress will always be prevented. +.P +Another optimization can be made by installing dependencies at the highest level possible, below the localized "target" folder (hoisting). Since version 3, npm hoists dependencies by default. +.SS "Example" +.P +Consider this dependency graph: +.P +.RS 2 +.nf +foo ++-- blerg@1.2.5 ++-- bar@1.2.3 +| +-- blerg@1.x (latest=1.3.7) +| +-- baz@2.x +| | `-- quux@3.x +| | `-- bar@1.2.3 (cycle) +| `-- asdf@* +`-- baz@1.2.3 + `-- quux@3.x + `-- bar +.fi +.RE +.P +In this case, we might expect a folder structure like this (with all dependencies hoisted to the highest level possible): +.P +.RS 2 +.nf +foo ++-- node_modules + +-- blerg (1.2.5) <---\[lB]A\[rB] + +-- bar (1.2.3) <---\[lB]B\[rB] + | +-- node_modules + | +-- baz (2.0.2) <---\[lB]C\[rB] + +-- asdf (2.3.4) + +-- baz (1.2.3) <---\[lB]D\[rB] + +-- quux (3.2.0) <---\[lB]E\[rB] +.fi +.RE +.P +Since foo depends directly on \fBbar@1.2.3\fR and \fBbaz@1.2.3\fR, those are installed in foo's \fBnode_modules\fR folder. +.P +Even though the latest copy of blerg is 1.3.7, foo has a specific dependency on version 1.2.5. So, that gets installed at \[lB]A\[rB]. Since the parent installation of blerg satisfies bar's dependency on \fBblerg@1.x\fR, it does not install another copy under \[lB]B\[rB]. +.P +Bar \[lB]B\[rB] also has dependencies on baz and asdf. Because it depends on \fBbaz@2.x\fR, it cannot re-use the \fBbaz@1.2.3\fR installed in the parent \fBnode_modules\fR folder \[lB]D\[rB], and must install its own copy \[lB]C\[rB]. In order to minimize duplication, npm hoists dependencies to the top level by default, so asdf is installed under \[lB]A\[rB]. +.P +Underneath bar, the \fBbaz -> quux -> bar\fR dependency creates a cycle. However, because bar is already in quux's ancestry \[lB]B\[rB], it does not unpack another copy of bar into that folder. Likewise, quux's \[lB]E\[rB] folder tree is empty, because its dependency on bar is satisfied by the parent folder copy installed at \[lB]B\[rB]. +.P +For a graphical breakdown of what is installed where, use \fBnpm ls\fR. +.SS "Publishing" +.P +Upon publishing, npm will look in the \fBnode_modules\fR folder. If any of the items there are not in the \fBbundleDependencies\fR array, then they will not be included in the package tarball. +.P +This allows a package maintainer to install all of their dependencies (and dev dependencies) locally, but only re-publish those items that cannot be found elsewhere. See \fB\[rs]fBpackage.json\[rs]fR\fR \fI\(la/configuring-npm/package-json\(ra\fR for more information. +.SS "See also" +.RS 0 +.IP \(bu 4 +\fBpackage.json\fR \fI\(la/configuring-npm/package-json\(ra\fR +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help pack +.IP \(bu 4 +npm help cache +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help publish +.RE 0 diff --git a/node24/node_modules/npm/man/man5/npm-json.5 b/node24/node_modules/npm/man/man5/npm-json.5 new file mode 100644 index 0000000000000000000000000000000000000000..7b8970bf714c4907a92be93037b88274ad01c31f --- /dev/null +++ b/node24/node_modules/npm/man/man5/npm-json.5 @@ -0,0 +1,1255 @@ +.TH "PACKAGE.JSON" "5" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBpackage.json\fR - Specifics of npm's package.json handling +.SS "Description" +.P +This document is all you need to know about what's required in your package.json file. It must be actual JSON, not just a JavaScript object literal. +.P +A lot of the behavior described in this document is affected by the config settings described in npm help config. +.SS "name" +.P +If you plan to publish your package, the \fImost\fR important things in your package.json are the name and version fields as they will be required. The name and version together form an identifier that is assumed to be completely unique. Changes to the package should come along with changes to the version. If you don't plan to publish your package, the name and version fields are optional. +.P +The name is what your thing is called. +.P +Some rules: +.RS 0 +.IP \(bu 4 +The name must be less than or equal to 214 characters. This includes the scope for scoped packages. +.IP \(bu 4 +The names of scoped packages can begin with a dot or an underscore. This is not permitted without a scope. +.IP \(bu 4 +New packages must not have uppercase letters in the name. +.IP \(bu 4 +The name ends up being part of a URL, an argument on the command line, and a folder name. Therefore, the name can't contain any non-URL-safe characters. +.RE 0 + +.P +Some tips: +.RS 0 +.IP \(bu 4 +Don't use the same name as a core Node module. +.IP \(bu 4 +Don't put "js" or "node" in the name. It's assumed that it's js, since you're writing a package.json file, and you can specify the engine using the "\fI(engines)\fR" field. (See below.) +.IP \(bu 4 +The name will probably be passed as an argument to require(), so it should be something short, but also reasonably descriptive. +.IP \(bu 4 +You may want to check the npm registry to see if there's something by that name already, before you get too attached to it. \fI\(lahttps://www.npmjs.com/\(ra\fR +.RE 0 + +.P +A name can be optionally prefixed by a scope, e.g. \fB@npm/example\fR. See npm help scope for more detail. +.SS "version" +.P +If you plan to publish your package, the \fImost\fR important things in your package.json are the name and version fields as they will be required. The name and version together form an identifier that is assumed to be completely unique. Changes to the package should come along with changes to the version. If you don't plan to publish your package, the name and version fields are optional. +.P +Version must be parseable by \fBnode-semver\fR \fI\(lahttps://github.com/npm/node-semver\(ra\fR, which is bundled with npm as a dependency. (\fBnpm install semver\fR to use it yourself.) +.SS "description" +.P +Put a description in it. It's a string. This helps people discover your package, as it's listed in \fBnpm search\fR. +.SS "keywords" +.P +Put keywords in it. It's an array of strings. This helps people discover your package as it's listed in \fBnpm search\fR. +.P +Example: +.P +.RS 2 +.nf +"keywords": \[lB] + "node", + "javascript", + "npm" +\[rB] +.fi +.RE +.SS "homepage" +.P +The URL to the project homepage. +.P +Example: +.P +.RS 2 +.nf +"homepage": "https://github.com/npm/example#readme" +.fi +.RE +.SS "bugs" +.P +The URL to your project's issue tracker and / or the email address to which issues should be reported. These are helpful for people who encounter issues with your package. +.P +It should look like this: +.P +.RS 2 +.nf +{ + "bugs": { + "url": "https://github.com/npm/example/issues", + "email": "example@npmjs.com" + } +} +.fi +.RE +.P +You can specify either one or both values. If you want to provide only a URL, you can specify the value for "bugs" as a simple string instead of an object. +.P +If a URL is provided, it will be used by the \fBnpm bugs\fR command. +.SS "license" +.P +You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you're placing on it. +.P +If you're using a common license such as BSD-2-Clause or MIT, add a current SPDX license identifier for the license you're using, like this: +.P +.RS 2 +.nf +{ + "license" : "BSD-3-Clause" +} +.fi +.RE +.P +You can check \fBthe full list of SPDX license IDs\fR \fI\(lahttps://spdx.org/licenses/\(ra\fR. Ideally, you should pick one that is \fBOSI\fR \fI\(lahttps://opensource.org/licenses/\(ra\fR approved. +.P +If your package is licensed under multiple common licenses, use an \fBSPDX license expression syntax version 2.0 string\fR \fI\(lahttps://spdx.dev/specifications/\(ra\fR, like this: +.P +.RS 2 +.nf +{ + "license" : "(ISC OR GPL-3.0)" +} +.fi +.RE +.P +If you are using a license that hasn't been assigned an SPDX identifier, or if you are using a custom license, use a string value like this one: +.P +.RS 2 +.nf +{ + "license" : "SEE LICENSE IN " +} +.fi +.RE +.P +Then include a file named \fB\fR at the top level of the package. +.P +Some old packages used license objects or a "licenses" property containing an array of license objects: +.P +.RS 2 +.nf +// Not valid metadata +{ + "license" : { + "type" : "ISC", + "url" : "https://opensource.org/licenses/ISC" + } +} + +// Not valid metadata +{ + "licenses" : \[lB] + { + "type": "MIT", + "url": "https://www.opensource.org/licenses/mit-license.php" + }, + { + "type": "Apache-2.0", + "url": "https://opensource.org/licenses/apache2.0.php" + } + \[rB] +} +.fi +.RE +.P +Those styles are now deprecated. Instead, use SPDX expressions, like this: +.P +.RS 2 +.nf +{ + "license": "ISC" +} +.fi +.RE +.P +.RS 2 +.nf +{ + "license": "(MIT OR Apache-2.0)" +} +.fi +.RE +.P +Finally, if you do not wish to grant others the right to use a private or unpublished package under any terms: +.P +.RS 2 +.nf +{ + "license": "UNLICENSED" +} +.fi +.RE +.P +Consider also setting \fB"private": true\fR to prevent accidental publication. +.SS "people fields: author, contributors" +.P +The "author" is one person. "contributors" is an array of people. A "person" is an object with a "name" field and optionally "url" and "email", like this: +.P +.RS 2 +.nf +{ + "name" : "Barney Rubble", + "email" : "barney@npmjs.com", + "url" : "http://barnyrubble.npmjs.com/" +} +.fi +.RE +.P +Or you can shorten that all into a single string, and npm will parse it for you: +.P +.RS 2 +.nf +{ + "author": "Barney Rubble (http://barnyrubble.npmjs.com/)" +} +.fi +.RE +.P +Both email and url are optional either way. +.P +npm also sets a top-level "maintainers" field with your npm user info. +.SS "funding" +.P +You can specify an object containing a URL that provides up-to-date information about ways to help fund development of your package, a string URL, or an array of objects and string URLs: +.P +.RS 2 +.nf +{ + "funding": { + "type" : "individual", + "url" : "http://npmjs.com/donate" + } +} +.fi +.RE +.P +.RS 2 +.nf +{ + "funding": { + "type" : "patreon", + "url" : "https://www.patreon.com/user" + } +} +.fi +.RE +.P +.RS 2 +.nf +{ + "funding": "http://npmjs.com/donate" +} +.fi +.RE +.P +.RS 2 +.nf +{ + "funding": \[lB] + { + "type" : "individual", + "url" : "http://npmjs.com/donate" + }, + "http://npmjs.com/donate-also", + { + "type" : "patreon", + "url" : "https://www.patreon.com/user" + } + \[rB] +} +.fi +.RE +.P +Users can use the \fBnpm fund\fR subcommand to list the \fBfunding\fR URLs of all dependencies of their project, direct and indirect. A shortcut to visit each funding URL is also available when providing the project name such as: \fBnpm fund \fR (when there are multiple URLs, the first one will be visited) +.SS "files" +.P +The optional \fBfiles\fR field is an array of file patterns that describes the entries to be included when your package is installed as a dependency. File patterns follow a similar syntax to \fB.gitignore\fR, but reversed: including a file, directory, or glob pattern (\fB*\fR, \fB**/*\fR, and such) will make it so that file is included in the tarball when it's packed. Omitting the field will make it default to \fB\[lB]"*"\[rB]\fR, which means it will include all files. +.P +Some special files and directories are also included or excluded regardless of whether they exist in the \fBfiles\fR array (see below). +.P +You can also provide a \fB.npmignore\fR file in the root of your package or in subdirectories, which will keep files from being included. At the root of your package it will not override the "files" field, but in subdirectories it will. The \fB.npmignore\fR file works just like a \fB.gitignore\fR. If there is a \fB.gitignore\fR file, and \fB.npmignore\fR is missing, \fB.gitignore\fR's contents will be used instead. +.P +Certain files are always included, regardless of settings: +.RS 0 +.IP \(bu 4 +\fBpackage.json\fR +.IP \(bu 4 +\fBREADME\fR +.IP \(bu 4 +\fBLICENSE\fR / \fBLICENCE\fR +.IP \(bu 4 +The file in the "main" field +.IP \(bu 4 +The file(s) in the "bin" field +.RE 0 + +.P +\fBREADME\fR & \fBLICENSE\fR can have any case and extension. +.P +Some files are always ignored by default: +.RS 0 +.IP \(bu 4 +\fB*.orig\fR +.IP \(bu 4 +\fB.*.swp\fR +.IP \(bu 4 +\fB.DS_Store\fR +.IP \(bu 4 +\fB._*\fR +.IP \(bu 4 +\fB.git\fR +.IP \(bu 4 +\fB.hg\fR +.IP \(bu 4 +\fB.lock-wscript\fR +.IP \(bu 4 +\fB.npmrc\fR +.IP \(bu 4 +\fB.svn\fR +.IP \(bu 4 +\fB.wafpickle-N\fR +.IP \(bu 4 +\fBCVS\fR +.IP \(bu 4 +\fBconfig.gypi\fR +.IP \(bu 4 +\fBnode_modules\fR +.IP \(bu 4 +\fBnpm-debug.log\fR +.IP \(bu 4 +\fBpackage-lock.json\fR (use \fB\[rs]fBnpm-shrinkwrap.json\[rs]fR\fR \fI\(la/configuring-npm/npm-shrinkwrap-json\(ra\fR if you wish it to be published) +.IP \(bu 4 +\fBpnpm-lock.yaml\fR +.IP \(bu 4 +\fByarn.lock\fR +.IP \(bu 4 +\fBbun.lockb\fR +.RE 0 + +.P +Most of these ignored files can be included specifically if included in the \fBfiles\fR globs. Exceptions to this are: +.RS 0 +.IP \(bu 4 +\fB.git\fR +.IP \(bu 4 +\fB.npmrc\fR +.IP \(bu 4 +\fBnode_modules\fR +.IP \(bu 4 +\fBpackage-lock.json\fR +.IP \(bu 4 +\fBpnpm-lock.yaml\fR +.IP \(bu 4 +\fByarn.lock\fR +.IP \(bu 4 +\fBbun.lockb\fR +.RE 0 + +.P +These cannot be included. +.SS "exports" +.P +The "exports" provides a modern alternative to "main" allowing multiple entry points to be defined, conditional entry resolution support between environments, and preventing any other entry points besides those defined in "exports". This encapsulation allows module authors to clearly define the public interface for their package. For more details see the \fBnode.js documentation on package entry points\fR \fI\(lahttps://nodejs.org/api/packages.html#package-entry-points\(ra\fR +.SS "main" +.P +The main field is a module ID that is the primary entry point to your program. That is, if your package is named \fBfoo\fR, and a user installs it, and then does \fBrequire("foo")\fR, then your main module's exports object will be returned. +.P +This should be a module relative to the root of your package folder. +.P +For most modules, it makes the most sense to have a main script and often not much else. +.P +If \fBmain\fR is not set, it defaults to \fBindex.js\fR in the package's root folder. +.SS "type" +.P +The \fBtype\fR field defines how Node.js should interpret \fB.js\fR files in your package. This field is not used by npm. +.P +See the \fBNode.js documentation on the type field\fR \fI\(lahttps://nodejs.org/api/packages.html#type\(ra\fR for more information. +.SS "browser" +.P +If your module is meant to be used client-side the browser field should be used instead of the main field. This is helpful to hint users that it might rely on primitives that aren't available in Node.js modules. (e.g. \fBwindow\fR) +.SS "bin" +.P +A lot of packages have one or more executable files that they'd like to install into the PATH. npm makes this pretty easy (in fact, it uses this feature to install the "npm" executable.) +.P +To use this, supply a \fBbin\fR field in your package.json which is a map of command name to local file name. When this package is installed globally, that file will be either linked inside the global bins directory or a cmd (Windows Command File) will be created which executes the specified file in the \fBbin\fR field, so it is available to run by \fBname\fR or \fBname.cmd\fR (on Windows PowerShell). When this package is installed as a dependency in another package, the file will be linked where it will be available to that package either directly by \fBnpm exec\fR or by name in other scripts when invoking them via \fBnpm run\fR. +.P +For example, myapp could have this: +.P +.RS 2 +.nf +{ + "bin": { + "myapp": "bin/cli.js" + } +} +.fi +.RE +.P +So, when you install myapp, in case of unix-like OS it'll create a symlink from the \fBcli.js\fR script to \fB/usr/local/bin/myapp\fR and in case of windows it will create a cmd file usually at \fBC:\[rs]Users\[rs]{Username}\[rs]AppData\[rs]Roaming\[rs]npm\[rs]myapp.cmd\fR which runs the \fBcli.js\fR script. +.P +If you have a single executable, and its name should be the name of the package, then you can just supply it as a string. For example: +.P +.RS 2 +.nf +{ + "name": "my-program", + "version": "1.2.5", + "bin": "path/to/program" +} +.fi +.RE +.P +would be the same as this: +.P +.RS 2 +.nf +{ + "name": "my-program", + "version": "1.2.5", + "bin": { + "my-program": "path/to/program" + } +} +.fi +.RE +.P +Please make sure that your file(s) referenced in \fBbin\fR starts with \fB#!/usr/bin/env node\fR; otherwise, the scripts are started without the node executable! +.P +Note that you can also set the executable files using \fI(directories.bin)\fR. +.P +See \fBfolders\fR \fI\(la/configuring-npm/folders#executables\(ra\fR for more info on executables. +.SS "man" +.P +Specify either a single file or an array of filenames to put in place for the \fBman\fR program to find. +.P +If only a single file is provided, then it's installed such that it is the result from \fBman \fR, regardless of its actual filename. For example: +.P +.RS 2 +.nf +{ + "name": "foo", + "version": "1.2.3", + "description": "A packaged foo fooer for fooing foos", + "main": "foo.js", + "man": "./man/doc.1" +} +.fi +.RE +.P +would link the \fB./man/doc.1\fR file in such that it is the target for \fBman foo\fR +.P +If the filename doesn't start with the package name, then it's prefixed. So, this: +.P +.RS 2 +.nf +{ + "name": "foo", + "version": "1.2.3", + "description": "A packaged foo fooer for fooing foos", + "main": "foo.js", + "man": \[lB] + "./man/foo.1", + "./man/bar.1" + \[rB] +} +.fi +.RE +.P +will create files to do \fBman foo\fR and \fBman foo-bar\fR. +.P +Man files must end with a number, and optionally a \fB.gz\fR suffix if they are compressed. The number dictates which man section the file is installed into. +.P +.RS 2 +.nf +{ + "name": "foo", + "version": "1.2.3", + "description": "A packaged foo fooer for fooing foos", + "main": "foo.js", + "man": \[lB] + "./man/foo.1", + "./man/foo.2" + \[rB] +} +.fi +.RE +.P +will create entries for \fBman foo\fR and \fBman 2 foo\fR +.SS "directories" +.P +The CommonJS \fBPackages\fR \fI\(lahttp://wiki.commonjs.org/wiki/Packages/1.0\(ra\fR spec details a few ways that you can indicate the structure of your package using a \fBdirectories\fR object. If you look at \fBnpm's package.json\fR \fI\(lahttps://registry.npmjs.org/npm/latest\(ra\fR, you'll see that it has directories for doc, lib, and man. +.P +In the future, this information may be used in other creative ways. +.SS "directories.bin" +.P +If you specify a \fBbin\fR directory in \fBdirectories.bin\fR, all the files in that folder will be added. +.P +Because of the way the \fBbin\fR directive works, specifying both a \fBbin\fR path and setting \fBdirectories.bin\fR is an error. If you want to specify individual files, use \fBbin\fR, and for all the files in an existing \fBbin\fR directory, use \fBdirectories.bin\fR. +.SS "directories.man" +.P +A folder that is full of man pages. Sugar to generate a "man" array by walking the folder. +.SS "repository" +.P +Specify the place where your code lives. This is helpful for people who want to contribute. If the git repo is on GitHub, then the \fBnpm repo\fR command will be able to find you. +.P +Do it like this: +.P +.RS 2 +.nf +{ + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cli.git" + } +} +.fi +.RE +.P +The URL should be a publicly available (perhaps read-only) URL that can be handed directly to a VCS program without any modification. It should not be a URL to an html project page that you put in your browser. It's for computers. +.P +For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same shortcut syntax you use for \fBnpm install\fR: +.P +.RS 2 +.nf +{ + "repository": "npm/example", + + "repository": "github:npm/example", + + "repository": "gist:11081aaa281", + + "repository": "bitbucket:user/repo", + + "repository": "gitlab:user/repo" +} +.fi +.RE +.P +\fBNote on normalization:\fR When you publish a package, npm normalizes the \fBrepository\fR field to the full object format with a \fBurl\fR property. If you use a shorthand format (like \fB"npm/example"\fR), you'll see a warning during \fBnpm publish\fR indicating that the field was auto-corrected. While the shorthand format currently works, it's recommended to use the full object format in your \fBpackage.json\fR to avoid warnings and ensure future compatibility: +.P +.RS 2 +.nf +{ + "repository": { + "type": "git", + "url": "git+https://github.com/npm/example.git" + } +} +.fi +.RE +.P +You can run \fBnpm pkg fix\fR to automatically convert shorthand formats to the normalized object format. +.P +If the \fBpackage.json\fR for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives: +.P +.RS 2 +.nf +{ + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cli.git", + "directory": "workspaces/libnpmpublish" + } +} +.fi +.RE +.SS "scripts" +.P +The "scripts" property is a dictionary containing script commands that are run at various times in the lifecycle of your package. The key is the lifecycle event, and the value is the command to run at that point. +.P +See npm help scripts to find out more about writing package scripts. +.SS "gypfile" +.P +If you have a binding.gyp file in the root of your package and you have not defined your own \fBinstall\fR or \fBpreinstall\fR scripts, npm will default to building your module using node-gyp. +.P +To prevent npm from automatically building your module with node-gyp, set \fBgypfile\fR to \fBfalse\fR: +.P +.RS 2 +.nf +{ + "gypfile": false +} +.fi +.RE +.P +This is useful for packages that include native addons but want to handle the build process differently, or packages that have a binding.gyp file but should not be built as a native addon. +.SS "config" +.P +A "config" object can be used to set configuration parameters used in package scripts that persist across upgrades. For instance, if a package had the following: +.P +.RS 2 +.nf +{ + "name": "foo", + "config": { + "port": "8080" + } +} +.fi +.RE +.P +It could also have a "start" script that referenced the \fBnpm_package_config_port\fR environment variable. +.SS "dependencies" +.P +Dependencies are specified in a simple object that maps a package name to a version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL. +.P +\fBPlease do not put test harnesses or transpilers or other "development" time tools in your \fBdependencies\fB object.\fR See \fBdevDependencies\fR, below. +.P +See \fBsemver\fR \fI\(lahttps://github.com/npm/node-semver#versions\(ra\fR for more details about specifying version ranges. +.RS 0 +.IP \(bu 4 +\fBversion\fR Must match \fBversion\fR exactly +.IP \(bu 4 +\fB>version\fR Must be greater than \fBversion\fR +.IP \(bu 4 +\fB>=version\fR etc +.IP \(bu 4 +\fB=version1 <=version2\fR. +.IP \(bu 4 +\fBrange1 || range2\fR Passes if either range1 or range2 are satisfied. +.IP \(bu 4 +\fBgit...\fR See 'Git URLs as Dependencies' below +.IP \(bu 4 +\fBuser/repo\fR See 'GitHub URLs' below +.IP \(bu 4 +\fBtag\fR A specific version tagged and published as \fBtag\fR See npm help dist-tag +.IP \(bu 4 +\fBpath/path/path\fR See \fI(Local Paths)\fR below +.IP \(bu 4 +\fBnpm:@scope/pkg@version\fR Custom alias for a package See \fB\[rs]fBpackage-spec\[rs]fR\fR \fI\(la/using-npm/package-spec#aliases\(ra\fR +.RE 0 + +.P +For example, these are all valid: +.P +.RS 2 +.nf +{ + "dependencies": { + "foo": "1.0.0 - 2.9999.9999", + "bar": ">=1.0.2 <2.1.2", + "baz": ">1.0.2 <=2.3.4", + "boo": "2.0.1", + "qux": "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0", + "asd": "http://npmjs.com/example.tar.gz", + "til": "~1.2", + "elf": "~1.2.3", + "two": "2.x", + "thr": "3.3.x", + "lat": "latest", + "dyl": "file:../dyl", + "kpg": "npm:pkg@1.0.0" + } +} +.fi +.RE +.SS "URLs as Dependencies" +.P +You may specify a tarball URL in place of a version range. +.P +This tarball will be downloaded and installed locally to your package at install time. +.SS "Git URLs as Dependencies" +.P +Git URLs are of the form: +.P +.RS 2 +.nf +://\[lB]\[lB]:\[rB]@\[rB]\[lB]:\[rB]\[lB]:\[rB]\[lB]/\[rB]\[lB]# | #semver:\[rB] +.fi +.RE +.P +\fB\fR is one of \fBgit\fR, \fBgit+ssh\fR, \fBgit+http\fR, \fBgit+https\fR, or \fBgit+file\fR. +.P +If \fB#\fR is provided, it will be used to clone exactly that commit. If the commit-ish has the format \fB#semver:\fR, \fB\fR can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. If neither \fB#\fR or \fB#semver:\fR is specified, then the default branch is used. +.P +Examples: +.P +.RS 2 +.nf +git+ssh://git@github.com:npm/cli.git#v1.0.27 +git+ssh://git@github.com:npm/cli#semver:^5.0 +git+https://isaacs@github.com/npm/cli.git +git://github.com/npm/cli.git#v1.0.27 +.fi +.RE +.P +When installing from a \fBgit\fR repository, the presence of certain fields in the \fBpackage.json\fR will cause npm to believe it needs to perform a build. To do so your repository will be cloned into a temporary directory, all of its deps installed, relevant scripts run, and the resulting directory packed and installed. +.P +This flow will occur if your git dependency uses \fBworkspaces\fR, or if any of the following scripts are present: +.RS 0 +.IP \(bu 4 +\fBbuild\fR +.IP \(bu 4 +\fBprepare\fR +.IP \(bu 4 +\fBprepack\fR +.IP \(bu 4 +\fBpreinstall\fR +.IP \(bu 4 +\fBinstall\fR +.IP \(bu 4 +\fBpostinstall\fR +.RE 0 + +.P +If your git repository includes pre-built artifacts, you will likely want to make sure that none of the above scripts are defined, or your dependency will be rebuilt for every installation. +.SS "GitHub URLs" +.P +As of version 1.1.65, you can refer to GitHub URLs as just "foo": "user/foo-project". Just as with git URLs, a \fBcommit-ish\fR suffix can be included. For example: +.P +.RS 2 +.nf +{ + "name": "foo", + "version": "0.0.0", + "dependencies": { + "express": "expressjs/express", + "mocha": "mochajs/mocha#4727d357ea", + "module": "npm/example-github-repo#feature\[rs]/branch" + } +} +.fi +.RE +.SS "Local Paths" +.P +As of version 2.0.0 you can provide a path to a local directory that contains a package. Local paths can be saved using \fBnpm install -S\fR or \fBnpm install --save\fR, using any of these forms: +.P +.RS 2 +.nf +../foo/bar +~/foo/bar +./foo/bar +/foo/bar +.fi +.RE +.P +in which case they will be normalized to a relative path and added to your \fBpackage.json\fR. For example: +.P +.RS 2 +.nf +{ + "name": "baz", + "dependencies": { + "bar": "file:../foo/bar" + } +} +.fi +.RE +.P +This feature is helpful for local offline development and creating tests that require npm installing where you don't want to hit an external server, but should not be used when publishing your package to the public registry. +.P +\fInote\fR: Packages linked by local path will not have their own dependencies installed when \fBnpm install\fR is run. You must run \fBnpm install\fR from inside the local path itself. +.SS "devDependencies" +.P +If someone is planning on downloading and using your module in their program, then they probably don't want or need to download and build the external test or documentation framework that you use. +.P +In this case, it's best to map these additional items in a \fBdevDependencies\fR object. +.P +These things will be installed when doing \fBnpm link\fR or \fBnpm install\fR from the root of a package, and can be managed like any other npm configuration param. See npm help config for more on the topic. +.P +For build steps that are not platform-specific, such as compiling CoffeeScript or other languages to JavaScript, use the \fBprepare\fR script to do this, and make the required package a devDependency. +.P +For example: +.P +.RS 2 +.nf +{ + "name": "@npm/ethopia-waza", + "description": "a delightfully fruity coffee varietal", + "version": "1.2.3", + "devDependencies": { + "coffee-script": "~1.6.3" + }, + "scripts": { + "prepare": "coffee -o lib/ -c src/waza.coffee" + }, + "main": "lib/waza.js" +} +.fi +.RE +.P +The \fBprepare\fR script will be run before publishing, so that users can consume the functionality without requiring them to compile it themselves. In dev mode (ie, locally running \fBnpm install\fR), it'll run this script as well, so that you can test it easily. +.SS "peerDependencies" +.P +In some cases, you want to express the compatibility of your package with a host tool or library, while not necessarily doing a \fBrequire\fR of this host. This is usually referred to as a \fIplugin\fR. Notably, your module may be exposing a specific interface, expected and specified by the host documentation. +.P +For example: +.P +.RS 2 +.nf +{ + "name": "@npm/tea-latte", + "version": "1.3.5", + "peerDependencies": { + "@npm/tea": "2.x" + } +} +.fi +.RE +.P +This ensures your package \fB@npm/tea-latte\fR can be installed \fIalong\fR with the second major version of the host package \fB@npm/tea\fR only. \fBnpm install tea-latte\fR could possibly yield the following dependency graph: +.P +.RS 2 +.nf +├── @npm/tea-latte@1.3.5 +└── @npm/tea@2.2.0 +.fi +.RE +.P +In npm versions 3 through 6, \fBpeerDependencies\fR were not automatically installed, and would raise a warning if an invalid version of the peer dependency was found in the tree. As of npm v7, peerDependencies \fIare\fR installed by default. +.P +Trying to install another plugin with a conflicting requirement may cause an error if the tree cannot be resolved correctly. For this reason, make sure your plugin requirement is as broad as possible, and not to lock it down to specific patch versions. +.P +Assuming the host complies with \fBsemver\fR \fI\(lahttps://semver.org/\(ra\fR, only changes in the host package's major version will break your plugin. Thus, if you've worked with every 1.x version of the host package, use \fB"^1.0"\fR or \fB"1.x"\fR to express this. If you depend on features introduced in 1.5.2, use \fB"^1.5.2"\fR. +.SS "peerDependenciesMeta" +.P +The \fBpeerDependenciesMeta\fR field serves to provide npm more information on how your peer dependencies are to be used. Specifically, it allows peer dependencies to be marked as optional. Npm will not automatically install optional peer dependencies. This allows you to integrate and interact with a variety of host packages without requiring all of them to be installed. +.P +For example: +.P +.RS 2 +.nf +{ + "name": "@npm/tea-latte", + "version": "1.3.5", + "peerDependencies": { + "@npm/tea": "2.x", + "@npm/soy-milk": "1.2" + }, + "peerDependenciesMeta": { + "@npm/soy-milk": { + "optional": true + } + } +} +.fi +.RE +.SS "bundleDependencies" +.P +This defines an array of package names that will be bundled when publishing the package. +.P +In cases where you need to preserve npm packages locally or have them available through a single file download, you can bundle the packages in a tarball file by specifying the package names in the \fBbundleDependencies\fR array and executing \fBnpm pack\fR. +.P +For example: +.P +If we define a package.json like this: +.P +.RS 2 +.nf +{ + "name": "@npm/awesome-web-framework", + "version": "1.0.0", + "bundleDependencies": \[lB] + "@npm/renderized", + "@npm/super-streams" + \[rB] +} +.fi +.RE +.P +we can obtain \fB@npm/awesome-web-framework-1.0.0.tgz\fR file by running \fBnpm pack\fR. This file contains the dependencies \fB@npm/renderized\fR and \fB@npm/super-streams\fR which can be installed in a new project by executing \fBnpm install awesome-web-framework-1.0.0.tgz\fR. Note that the package names do not include any versions, as that information is specified in \fBdependencies\fR. +.P +If this is spelled \fB"bundledDependencies"\fR, then that is also honored. +.P +Alternatively, \fB"bundleDependencies"\fR can be defined as a boolean value. A value of \fBtrue\fR will bundle all dependencies, a value of \fBfalse\fR will bundle none. +.SS "optionalDependencies" +.P +If a dependency can be used, but you would like npm to proceed if it cannot be found or fails to install, then you may put it in the \fBoptionalDependencies\fR object. This is a map of package name to version or URL, just like the \fBdependencies\fR object. The difference is that build failures do not cause installation to fail. Running \fBnpm install --omit=optional\fR will prevent these dependencies from being installed. +.P +It is still your program's responsibility to handle the lack of the dependency. For example, something like this: +.P +.RS 2 +.nf +try { + var foo = require('@npm/foo') + var fooVersion = require('@npm/foo/package.json').version +} catch (er) { + foo = null +} +if ( notGoodFooVersion(fooVersion) ) { + foo = null +} + +// .. then later in your program .. + +if (foo) { + foo.doFooThings() +} +.fi +.RE +.P +Entries in \fBoptionalDependencies\fR will override entries of the same name in \fBdependencies\fR, so it's usually best to only put in one place. +.SS "overrides" +.P +If you need to make specific changes to dependencies of your dependencies, for example replacing the version of a dependency with a known security issue, replacing an existing dependency with a fork, or making sure that the same version of a package is used everywhere, then you may add an override. +.P +Overrides provide a way to replace a package in your dependency tree with another version, or another package entirely. These changes can be scoped as specific or as vague as desired. +.P +Overrides are only considered in the root \fBpackage.json\fR file for a project. Overrides in installed dependencies (including npm help workspaces) are not considered in dependency tree resolution. Published packages may dictate their resolutions by pinning dependencies or using an \fB\[rs]fBnpm-shrinkwrap.json\[rs]fR\fR \fI\(la/configuring-npm/npm-shrinkwrap-json\(ra\fR file. +.P +To make sure the package \fB@npm/foo\fR is always installed as version \fB1.0.0\fR no matter what version your dependencies rely on: +.P +.RS 2 +.nf +{ + "overrides": { + "@npm/foo": "1.0.0" + } +} +.fi +.RE +.P +The above is a short hand notation, the full object form can be used to allow overriding a package itself as well as a child of the package. This will cause \fB@npm/foo\fR to always be \fB1.0.0\fR while also making \fB@npm/bar\fR at any depth beyond \fB@npm/foo\fR also \fB1.0.0\fR: +.P +.RS 2 +.nf +{ + "overrides": { + "@npm/foo": { + ".": "1.0.0", + "@npm/bar": "1.0.0" + } + } +} +.fi +.RE +.P +To only override \fB@npm/foo\fR to be \fB1.0.0\fR when it's a child (or grandchild, or great grandchild, etc) of the package \fB@npm/bar\fR: +.P +.RS 2 +.nf +{ + "overrides": { + "@npm/bar": { + "@npm/foo": "1.0.0" + } + } +} +.fi +.RE +.P +Keys can be nested to any arbitrary length. To override \fB@npm/foo\fR only when it's a child of \fB@npm/bar\fR and only when \fB@npm/bar\fR is a child of \fB@npm/baz\fR: +.P +.RS 2 +.nf +{ + "overrides": { + "@npm/baz": { + "@npm/bar": { + "@npm/foo": "1.0.0" + } + } + } +} +.fi +.RE +.P +The key of an override can also include a version, or range of versions. To override \fB@npm/foo\fR to \fB1.0.0\fR, but only when it's a child of \fB@npm/bar@2.0.0\fR: +.P +.RS 2 +.nf +{ + "overrides": { + "@npm/bar@2.0.0": { + "@npm/foo": "1.0.0" + } + } +} +.fi +.RE +.P +You may not set an override for a package that you directly depend on unless both the dependency and the override itself share the exact same spec. To make this limitation easier to deal with, overrides may also be defined as a reference to a spec for a direct dependency by prefixing the name of the package you wish the version to match with a \fB$\fR. +.P +.RS 2 +.nf +{ + "dependencies": { + "@npm/foo": "^1.0.0" + }, + "overrides": { + // BAD, will throw an EOVERRIDE error + // "foo": "^2.0.0" + // GOOD, specs match so override is allowed + // "foo": "^1.0.0" + // BEST, the override is defined as a reference to the dependency + "@npm/foo": "$foo", + // the referenced package does not need to match the overridden one + "@npm/bar": "$foo" + } +} +.fi +.RE +.SS "Replacing a dependency with a fork" +.P +You can replace a package with a different package or fork using several methods: +.P +\fBUsing the \fBnpm:\fB prefix to replace with a different package name:\fR +.P +.RS 2 +.nf +{ + "overrides": { + "package-name": "npm:@scope/forked-package@1.0.0" + } +} +.fi +.RE +.P +\fBUsing a GitHub repository (supports branches, tags, or commit hashes):\fR +.P +.RS 2 +.nf +{ + "overrides": { + "package-name": "github:username/repo#branch-name" + } +} +.fi +.RE +.P +\fBUsing a local file path:\fR +.P +.RS 2 +.nf +{ + "overrides": { + "package-name": "file:../local-fork" + } +} +.fi +.RE +.P +These replacement methods work for both top-level overrides and nested overrides. For example, to replace a transitive dependency with a fork: +.P +.RS 2 +.nf +{ + "overrides": { + "parent-package": { + "vulnerable-dep": "github:username/patched-fork#v2.0.1" + } + } +} +.fi +.RE +.SS "engines" +.P +You can specify the version of node that your stuff works on: +.P +.RS 2 +.nf +{ + "engines": { + "node": ">=0.10.3 <15" + } +} +.fi +.RE +.P +And, like with dependencies, if you don't specify the version (or if you specify "*" as the version), then any version of node will do. +.P +You can also use the "engines" field to specify which versions of npm are capable of properly installing your program. For example: +.P +.RS 2 +.nf +{ + "engines": { + "npm": "~1.0.20" + } +} +.fi +.RE +.P +Unless the user has set the \fB\[rs]fBengine-strict\[rs]fR config\fR \fI\(la/using-npm/config#engine-strict\(ra\fR flag, this field is advisory only and will only produce warnings when your package is installed as a dependency. +.SS "os" +.P +You can specify which operating systems your module will run on: +.P +.RS 2 +.nf +{ + "os": \[lB] + "darwin", + "linux" + \[rB] +} +.fi +.RE +.P +You can also block instead of allowing operating systems, just prepend the blocked os with a '!': +.P +.RS 2 +.nf +{ + "os": \[lB] + "!win32" + \[rB] +} +.fi +.RE +.P +The host operating system is determined by \fBprocess.platform\fR +.P +It is allowed to both block and allow an item, although there isn't any good reason to do this. +.SS "cpu" +.P +If your code only runs on certain cpu architectures, you can specify which ones. +.P +.RS 2 +.nf +{ + "cpu": \[lB] + "x64", + "ia32" + \[rB] +} +.fi +.RE +.P +Like the \fBos\fR option, you can also block architectures: +.P +.RS 2 +.nf +{ + "cpu": \[lB] + "!arm", + "!mips" + \[rB] +} +.fi +.RE +.P +The host architecture is determined by \fBprocess.arch\fR +.SS "libc" +.P +If your code only runs or builds in certain versions of libc, you can specify which ones. This field only applies if \fBos\fR is \fBlinux\fR. +.P +.RS 2 +.nf +{ + "os": "linux", + "libc": "glibc" +} +.fi +.RE +.SS "devEngines" +.P +The \fBdevEngines\fR field aids engineers working on a codebase to all be using the same tooling. +.P +You can specify a \fBdevEngines\fR property in your \fBpackage.json\fR which will run before \fBinstall\fR, \fBci\fR, and \fBrun\fR commands. +.RS 0 +.P +Note: \fBengines\fR and \fBdevEngines\fR differ in object shape. They also function very differently. \fBengines\fR is designed to alert the user when a dependency uses a different npm or node version than the project it's being used in, whereas \fBdevEngines\fR is used to alert people interacting with the source code of a project. +.RE 0 + +.P +The supported keys under the \fBdevEngines\fR property are \fBcpu\fR, \fBos\fR, \fBlibc\fR, \fBruntime\fR, and \fBpackageManager\fR. Each property can be an object or an array of objects. Objects must contain \fBname\fR, and optionally can specify \fBversion\fR, and \fBonFail\fR. \fBonFail\fR can be \fBwarn\fR, \fBerror\fR, or \fBignore\fR, and if left undefined is of the same value as \fBerror\fR. \fBnpm\fR will assume that you're running with \fBnode\fR. Here's an example of a project that will fail if the environment is not \fBnode\fR and \fBnpm\fR. If you set \fBruntime.name\fR or \fBpackageManager.name\fR to any other string, it will fail within the npm CLI. +.P +.RS 2 +.nf +{ + "devEngines": { + "runtime": { + "name": "node", + "onFail": "error" + }, + "packageManager": { + "name": "npm", + "onFail": "error" + } + } +} +.fi +.RE +.SS "private" +.P +If you set \fB"private": true\fR in your package.json, then npm will refuse to publish it. +.P +This is a way to prevent accidental publication of private repositories. If you would like to ensure that a given package is only ever published to a specific registry (for example, an internal registry), then use the \fBpublishConfig\fR dictionary described below to override the \fBregistry\fR config param at publish-time. +.SS "publishConfig" +.P +This is a set of config values that will be used at publish-time. It's especially handy if you want to set the tag, registry or access, so that you can ensure that a given package is not tagged with "latest", published to the global public registry or that a scoped module is private by default. +.P +See npm help config to see the list of config options that can be overridden. +.SS "workspaces" +.P +The optional \fBworkspaces\fR field is an array of file patterns that describes locations within the local file system that the install client should look up to find each npm help workspace that needs to be symlinked to the top level \fBnode_modules\fR folder. +.P +It can describe either the direct paths of the folders to be used as workspaces or it can define globs that will resolve to these same folders. +.P +In the following example, all folders located inside the folder \fB./packages\fR will be treated as workspaces as long as they have valid \fBpackage.json\fR files inside them: +.P +.RS 2 +.nf +{ + "name": "workspace-example", + "workspaces": \[lB] + "./packages/*" + \[rB] +} +.fi +.RE +.P +See npm help workspaces for more examples. +.SS "DEFAULT VALUES" +.P +npm will default some values based on package contents. +.RS 0 +.IP \(bu 4 +\fB"scripts": {"start": "node server.js"}\fR +.P +If there is a \fBserver.js\fR file in the root of your package, then npm will default the \fBstart\fR command to \fBnode server.js\fR. +.IP \(bu 4 +\fB"scripts":{"install": "node-gyp rebuild"}\fR +.P +If there is a \fBbinding.gyp\fR file in the root of your package and you have not defined an \fBinstall\fR or \fBpreinstall\fR script, npm will default the \fBinstall\fR command to compile using node-gyp. +.IP \(bu 4 +\fB"contributors": \[lB]...\[rB]\fR +.P +If there is an \fBAUTHORS\fR file in the root of your package, npm will treat each line as a \fBName (url)\fR format, where email and url are optional. Lines which start with a \fB#\fR or are blank, will be ignored. +.RE 0 + +.SS "SEE ALSO" +.RS 0 +.IP \(bu 4 +\fBsemver\fR \fI\(lahttps://github.com/npm/node-semver#versions\(ra\fR +.IP \(bu 4 +npm help workspaces +.IP \(bu 4 +npm help init +.IP \(bu 4 +npm help version +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help help +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help publish +.IP \(bu 4 +npm help uninstall +.RE 0 diff --git a/node24/node_modules/npm/man/man5/npm-shrinkwrap-json.5 b/node24/node_modules/npm/man/man5/npm-shrinkwrap-json.5 new file mode 100644 index 0000000000000000000000000000000000000000..daf76df9ee23baba33b5f40caeaab504fef6b5c4 --- /dev/null +++ b/node24/node_modules/npm/man/man5/npm-shrinkwrap-json.5 @@ -0,0 +1,23 @@ +.TH "NPM-SHRINKWRAP.JSON" "5" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBnpm-shrinkwrap.json\fR - A publishable lockfile +.SS "Description" +.P +\fBnpm-shrinkwrap.json\fR is a file created by npm help shrinkwrap. It is identical to \fBpackage-lock.json\fR, with one major caveat: Unlike \fBpackage-lock.json\fR, \fBnpm-shrinkwrap.json\fR may be included when publishing a package. +.P +The recommended use-case for \fBnpm-shrinkwrap.json\fR is applications deployed through the publishing process on the registry: for example, daemons and command-line tools intended as global installs or \fBdevDependencies\fR. It's strongly discouraged for library authors to publish this file, since that would prevent end users from having control over transitive dependency updates. +.P +If both \fBpackage-lock.json\fR and \fBnpm-shrinkwrap.json\fR are present in a package root, \fBnpm-shrinkwrap.json\fR will be preferred over the \fBpackage-lock.json\fR file. +.P +For full details and description of the \fBnpm-shrinkwrap.json\fR file format, refer to the manual page for \fBpackage-lock.json\fR \fI\(la/configuring-npm/package-lock-json\(ra\fR. +.SS "See also" +.RS 0 +.IP \(bu 4 +npm help shrinkwrap +.IP \(bu 4 +\fBpackage-lock.json\fR \fI\(la/configuring-npm/package-lock-json\(ra\fR +.IP \(bu 4 +\fBpackage.json\fR \fI\(la/configuring-npm/package-json\(ra\fR +.IP \(bu 4 +npm help install +.RE 0 diff --git a/node24/node_modules/npm/man/man5/npmrc.5 b/node24/node_modules/npm/man/man5/npmrc.5 new file mode 100644 index 0000000000000000000000000000000000000000..cfff76caf799540f46d87bd5d854fe4873c6e0c4 --- /dev/null +++ b/node24/node_modules/npm/man/man5/npmrc.5 @@ -0,0 +1,195 @@ +.TH ".NPMRC" "5" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fB.npmrc\fR - The npm config files +.SS "Description" +.P +npm gets its config settings from the command line, environment variables, and \fBnpmrc\fR files. +.P +The \fBnpm config\fR command can be used to update and edit the contents of the user and global npmrc files. +.P +For a list of available configuration options, see npm help config. +.SS "Files" +.P +The four relevant files are: +.RS 0 +.IP \(bu 4 +per-project config file (\fB/path/to/my/project/.npmrc\fR) +.IP \(bu 4 +per-user config file (\fB~/.npmrc\fR) +.IP \(bu 4 +global config file (\fB$PREFIX/etc/npmrc\fR) +.IP \(bu 4 +npm builtin config file (\fB/path/to/npm/npmrc\fR) +.RE 0 + +.P +All npm config files are an ini-formatted list of \fBkey = value\fR parameters. Environment variables can be replaced using \fB${VARIABLE_NAME}\fR. By default if the variable is not defined, it is left unreplaced. By adding \fB?\fR after variable name they can be forced to evaluate to an empty string instead. For example: +.P +.RS 2 +.nf +cache = ${HOME}/.npm-packages +node-options = "${NODE_OPTIONS?} --use-system-ca" +.fi +.RE +.P +Each of these files is loaded, and config options are resolved in priority order. For example, a setting in the userconfig file would override the setting in the globalconfig file. +.P +Array values are specified by adding "\[lB]\[rB]" after the key name. For example: +.P +.RS 2 +.nf +key\[lB]\[rB] = "first value" +key\[lB]\[rB] = "second value" +.fi +.RE +.SS "Comments" +.P +Lines in \fB.npmrc\fR files are interpreted as comments when they begin with a \fB;\fR or \fB#\fR character. \fB.npmrc\fR files are parsed by \fBnpm/ini\fR \fI\(lahttps://github.com/npm/ini\(ra\fR, which specifies this comment syntax. +.P +For example: +.P +.RS 2 +.nf +# last modified: 01 Jan 2016 +; Set a new registry for a scoped package +@myscope:registry=https://mycustomregistry.example.org +.fi +.RE +.SS "Per-project config file" +.P +When working locally in a project, a \fB.npmrc\fR file in the root of the project (ie, a sibling of \fBnode_modules\fR and \fBpackage.json\fR) will set config values specific to this project. +.P +Note that this only applies to the root of the project that you're running npm in. It has no effect when your module is published. For example, you can't publish a module that forces itself to install globally, or in a different location. +.P +Additionally, this file is not read in global mode, such as when running \fBnpm install -g\fR. +.SS "Per-user config file" +.P +\fB$HOME/.npmrc\fR (or the \fBuserconfig\fR param, if set in the environment or on the command line) +.SS "Global config file" +.P +\fB$PREFIX/etc/npmrc\fR (or the \fBglobalconfig\fR param, if set above): This file is an ini-file formatted list of \fBkey = value\fR parameters. Environment variables can be replaced as above. +.SS "Built-in config file" +.P +\fBpath/to/npm/itself/npmrc\fR +.P +This is an unchangeable "builtin" configuration file that npm keeps consistent across updates. Set fields in here using the \fB./configure\fR script that comes with npm. This is primarily for distribution maintainers to override default configs in a standard and consistent manner. +.SS "Auth related configuration" +.P +The settings \fB_auth\fR, \fB_authToken\fR, \fBusername\fR, \fB_password\fR, \fBcertfile\fR, and \fBkeyfile\fR must all be scoped to a specific registry. This ensures that \fBnpm\fR will never send credentials to the wrong host. +.P +The full list is: +.RS 0 +.IP \(bu 4 +\fB_auth\fR (base64 authentication string) +.IP \(bu 4 +\fB_authToken\fR (authentication token) +.IP \(bu 4 +\fBusername\fR +.IP \(bu 4 +\fB_password\fR +.IP \(bu 4 +\fBemail\fR +.IP \(bu 4 +\fBcafile\fR (path to certificate authority file) +.IP \(bu 4 +\fBcertfile\fR (path to certificate file) +.IP \(bu 4 +\fBkeyfile\fR (path to key file) +.RE 0 + +.P +In order to scope these values, they must be prefixed by a URI fragment. If the credential is meant for any request to a registry on a single host, the scope may look like \fB//registry.npmjs.org/:\fR. If it must be scoped to a specific path on the host that path may also be provided, such as \fB//my-custom-registry.org/unique/path:\fR. +.SS "Unsupported Custom Configuration Keys" +.P +Starting in npm v11.2.0, npm warns when unknown configuration keys are defined in \fB.npmrc\fR. In a future major version of npm, these unknown keys may no longer be accepted. +.P +Only configuration keys that npm officially supports are recognized. Custom keys intended for third-party tools (for example, \fBelectron-builder\fR) should not be placed in \fB.npmrc\fR. +.P +If you need package-level configuration for use in scripts, use the \fBconfig\fR field in your \fBpackage.json\fR instead: +.P +.RS 2 +.nf +{ + "name": "my-package", + "config": { + "mirror": "https://example.com/" + } +} + +.fi +.RE +.P +Values defined in \fBpackage.json#config\fR are exposed to scripts as environment variables prefixed with \fBnpm_package_config_\fR. For example: +.P +.RS 2 +.nf +npm_package_config_mirror +.fi +.RE +.P +If you need to pass arguments to a script command, use \fB--\fR to separate npm arguments from script arguments: +.P +.RS 2 +.nf +npm run build -- --customFlag +.fi +.RE +.P +Using environment variables is also recommended for cross-platform configuration instead of defining unsupported keys in \fB.npmrc\fR. +.P +.RS 2 +.nf +; bad config +_authToken=MYTOKEN + +; good config +@myorg:registry=https://somewhere-else.com/myorg +@another:registry=https://somewhere-else.com/another +//registry.npmjs.org/:_authToken=MYTOKEN + +; would apply to both @myorg and @another +//somewhere-else.com/:_authToken=MYTOKEN + +; would apply only to @myorg +//somewhere-else.com/myorg/:_authToken=MYTOKEN1 + +; would apply only to @another +//somewhere-else.com/another/:_authToken=MYTOKEN2 +.fi +.RE +.SS "Custom / third-party config keys" +.P +npm only recognizes its own npm help "configuration options". If your \fB.npmrc\fR contains keys that are not part of npm's config definitions (for example, \fBelectron_mirror\fR or \fBsass_binary_site\fR), npm will emit a warning: +.P +.RS 2 +.nf +warn Unknown user config "electron_mirror". +This will stop working in the next major version of npm. +.fi +.RE +.P +These keys were historically tolerated but are not officially supported. A future major version of npm will treat unknown top-level keys as errors. +.P +Some tools (such as \fB@electron/get\fR or \fBnode-sass\fR) read their own configuration from environment variables or from \fB.npmrc\fR by convention. You can set these values as environment variables instead: +.P +.RS 2 +.nf +export ELECTRON_MIRROR="https://mirrorexample.npmjs.org/mirrors/electron/" +export ELECTRON_CUSTOM_DIR="{{ version }}" +.fi +.RE +.P +Environment variables are the most portable approach and work regardless of \fB.npmrc\fR format. +.SS "See also" +.RS 0 +.IP \(bu 4 +npm help folders +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help config +.IP \(bu 4 +\fBpackage.json\fR \fI\(la/configuring-npm/package-json\(ra\fR +.IP \(bu 4 +npm help npm +.RE 0 diff --git a/node24/node_modules/npm/man/man5/package-json.5 b/node24/node_modules/npm/man/man5/package-json.5 new file mode 100644 index 0000000000000000000000000000000000000000..7b8970bf714c4907a92be93037b88274ad01c31f --- /dev/null +++ b/node24/node_modules/npm/man/man5/package-json.5 @@ -0,0 +1,1255 @@ +.TH "PACKAGE.JSON" "5" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBpackage.json\fR - Specifics of npm's package.json handling +.SS "Description" +.P +This document is all you need to know about what's required in your package.json file. It must be actual JSON, not just a JavaScript object literal. +.P +A lot of the behavior described in this document is affected by the config settings described in npm help config. +.SS "name" +.P +If you plan to publish your package, the \fImost\fR important things in your package.json are the name and version fields as they will be required. The name and version together form an identifier that is assumed to be completely unique. Changes to the package should come along with changes to the version. If you don't plan to publish your package, the name and version fields are optional. +.P +The name is what your thing is called. +.P +Some rules: +.RS 0 +.IP \(bu 4 +The name must be less than or equal to 214 characters. This includes the scope for scoped packages. +.IP \(bu 4 +The names of scoped packages can begin with a dot or an underscore. This is not permitted without a scope. +.IP \(bu 4 +New packages must not have uppercase letters in the name. +.IP \(bu 4 +The name ends up being part of a URL, an argument on the command line, and a folder name. Therefore, the name can't contain any non-URL-safe characters. +.RE 0 + +.P +Some tips: +.RS 0 +.IP \(bu 4 +Don't use the same name as a core Node module. +.IP \(bu 4 +Don't put "js" or "node" in the name. It's assumed that it's js, since you're writing a package.json file, and you can specify the engine using the "\fI(engines)\fR" field. (See below.) +.IP \(bu 4 +The name will probably be passed as an argument to require(), so it should be something short, but also reasonably descriptive. +.IP \(bu 4 +You may want to check the npm registry to see if there's something by that name already, before you get too attached to it. \fI\(lahttps://www.npmjs.com/\(ra\fR +.RE 0 + +.P +A name can be optionally prefixed by a scope, e.g. \fB@npm/example\fR. See npm help scope for more detail. +.SS "version" +.P +If you plan to publish your package, the \fImost\fR important things in your package.json are the name and version fields as they will be required. The name and version together form an identifier that is assumed to be completely unique. Changes to the package should come along with changes to the version. If you don't plan to publish your package, the name and version fields are optional. +.P +Version must be parseable by \fBnode-semver\fR \fI\(lahttps://github.com/npm/node-semver\(ra\fR, which is bundled with npm as a dependency. (\fBnpm install semver\fR to use it yourself.) +.SS "description" +.P +Put a description in it. It's a string. This helps people discover your package, as it's listed in \fBnpm search\fR. +.SS "keywords" +.P +Put keywords in it. It's an array of strings. This helps people discover your package as it's listed in \fBnpm search\fR. +.P +Example: +.P +.RS 2 +.nf +"keywords": \[lB] + "node", + "javascript", + "npm" +\[rB] +.fi +.RE +.SS "homepage" +.P +The URL to the project homepage. +.P +Example: +.P +.RS 2 +.nf +"homepage": "https://github.com/npm/example#readme" +.fi +.RE +.SS "bugs" +.P +The URL to your project's issue tracker and / or the email address to which issues should be reported. These are helpful for people who encounter issues with your package. +.P +It should look like this: +.P +.RS 2 +.nf +{ + "bugs": { + "url": "https://github.com/npm/example/issues", + "email": "example@npmjs.com" + } +} +.fi +.RE +.P +You can specify either one or both values. If you want to provide only a URL, you can specify the value for "bugs" as a simple string instead of an object. +.P +If a URL is provided, it will be used by the \fBnpm bugs\fR command. +.SS "license" +.P +You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you're placing on it. +.P +If you're using a common license such as BSD-2-Clause or MIT, add a current SPDX license identifier for the license you're using, like this: +.P +.RS 2 +.nf +{ + "license" : "BSD-3-Clause" +} +.fi +.RE +.P +You can check \fBthe full list of SPDX license IDs\fR \fI\(lahttps://spdx.org/licenses/\(ra\fR. Ideally, you should pick one that is \fBOSI\fR \fI\(lahttps://opensource.org/licenses/\(ra\fR approved. +.P +If your package is licensed under multiple common licenses, use an \fBSPDX license expression syntax version 2.0 string\fR \fI\(lahttps://spdx.dev/specifications/\(ra\fR, like this: +.P +.RS 2 +.nf +{ + "license" : "(ISC OR GPL-3.0)" +} +.fi +.RE +.P +If you are using a license that hasn't been assigned an SPDX identifier, or if you are using a custom license, use a string value like this one: +.P +.RS 2 +.nf +{ + "license" : "SEE LICENSE IN " +} +.fi +.RE +.P +Then include a file named \fB\fR at the top level of the package. +.P +Some old packages used license objects or a "licenses" property containing an array of license objects: +.P +.RS 2 +.nf +// Not valid metadata +{ + "license" : { + "type" : "ISC", + "url" : "https://opensource.org/licenses/ISC" + } +} + +// Not valid metadata +{ + "licenses" : \[lB] + { + "type": "MIT", + "url": "https://www.opensource.org/licenses/mit-license.php" + }, + { + "type": "Apache-2.0", + "url": "https://opensource.org/licenses/apache2.0.php" + } + \[rB] +} +.fi +.RE +.P +Those styles are now deprecated. Instead, use SPDX expressions, like this: +.P +.RS 2 +.nf +{ + "license": "ISC" +} +.fi +.RE +.P +.RS 2 +.nf +{ + "license": "(MIT OR Apache-2.0)" +} +.fi +.RE +.P +Finally, if you do not wish to grant others the right to use a private or unpublished package under any terms: +.P +.RS 2 +.nf +{ + "license": "UNLICENSED" +} +.fi +.RE +.P +Consider also setting \fB"private": true\fR to prevent accidental publication. +.SS "people fields: author, contributors" +.P +The "author" is one person. "contributors" is an array of people. A "person" is an object with a "name" field and optionally "url" and "email", like this: +.P +.RS 2 +.nf +{ + "name" : "Barney Rubble", + "email" : "barney@npmjs.com", + "url" : "http://barnyrubble.npmjs.com/" +} +.fi +.RE +.P +Or you can shorten that all into a single string, and npm will parse it for you: +.P +.RS 2 +.nf +{ + "author": "Barney Rubble (http://barnyrubble.npmjs.com/)" +} +.fi +.RE +.P +Both email and url are optional either way. +.P +npm also sets a top-level "maintainers" field with your npm user info. +.SS "funding" +.P +You can specify an object containing a URL that provides up-to-date information about ways to help fund development of your package, a string URL, or an array of objects and string URLs: +.P +.RS 2 +.nf +{ + "funding": { + "type" : "individual", + "url" : "http://npmjs.com/donate" + } +} +.fi +.RE +.P +.RS 2 +.nf +{ + "funding": { + "type" : "patreon", + "url" : "https://www.patreon.com/user" + } +} +.fi +.RE +.P +.RS 2 +.nf +{ + "funding": "http://npmjs.com/donate" +} +.fi +.RE +.P +.RS 2 +.nf +{ + "funding": \[lB] + { + "type" : "individual", + "url" : "http://npmjs.com/donate" + }, + "http://npmjs.com/donate-also", + { + "type" : "patreon", + "url" : "https://www.patreon.com/user" + } + \[rB] +} +.fi +.RE +.P +Users can use the \fBnpm fund\fR subcommand to list the \fBfunding\fR URLs of all dependencies of their project, direct and indirect. A shortcut to visit each funding URL is also available when providing the project name such as: \fBnpm fund \fR (when there are multiple URLs, the first one will be visited) +.SS "files" +.P +The optional \fBfiles\fR field is an array of file patterns that describes the entries to be included when your package is installed as a dependency. File patterns follow a similar syntax to \fB.gitignore\fR, but reversed: including a file, directory, or glob pattern (\fB*\fR, \fB**/*\fR, and such) will make it so that file is included in the tarball when it's packed. Omitting the field will make it default to \fB\[lB]"*"\[rB]\fR, which means it will include all files. +.P +Some special files and directories are also included or excluded regardless of whether they exist in the \fBfiles\fR array (see below). +.P +You can also provide a \fB.npmignore\fR file in the root of your package or in subdirectories, which will keep files from being included. At the root of your package it will not override the "files" field, but in subdirectories it will. The \fB.npmignore\fR file works just like a \fB.gitignore\fR. If there is a \fB.gitignore\fR file, and \fB.npmignore\fR is missing, \fB.gitignore\fR's contents will be used instead. +.P +Certain files are always included, regardless of settings: +.RS 0 +.IP \(bu 4 +\fBpackage.json\fR +.IP \(bu 4 +\fBREADME\fR +.IP \(bu 4 +\fBLICENSE\fR / \fBLICENCE\fR +.IP \(bu 4 +The file in the "main" field +.IP \(bu 4 +The file(s) in the "bin" field +.RE 0 + +.P +\fBREADME\fR & \fBLICENSE\fR can have any case and extension. +.P +Some files are always ignored by default: +.RS 0 +.IP \(bu 4 +\fB*.orig\fR +.IP \(bu 4 +\fB.*.swp\fR +.IP \(bu 4 +\fB.DS_Store\fR +.IP \(bu 4 +\fB._*\fR +.IP \(bu 4 +\fB.git\fR +.IP \(bu 4 +\fB.hg\fR +.IP \(bu 4 +\fB.lock-wscript\fR +.IP \(bu 4 +\fB.npmrc\fR +.IP \(bu 4 +\fB.svn\fR +.IP \(bu 4 +\fB.wafpickle-N\fR +.IP \(bu 4 +\fBCVS\fR +.IP \(bu 4 +\fBconfig.gypi\fR +.IP \(bu 4 +\fBnode_modules\fR +.IP \(bu 4 +\fBnpm-debug.log\fR +.IP \(bu 4 +\fBpackage-lock.json\fR (use \fB\[rs]fBnpm-shrinkwrap.json\[rs]fR\fR \fI\(la/configuring-npm/npm-shrinkwrap-json\(ra\fR if you wish it to be published) +.IP \(bu 4 +\fBpnpm-lock.yaml\fR +.IP \(bu 4 +\fByarn.lock\fR +.IP \(bu 4 +\fBbun.lockb\fR +.RE 0 + +.P +Most of these ignored files can be included specifically if included in the \fBfiles\fR globs. Exceptions to this are: +.RS 0 +.IP \(bu 4 +\fB.git\fR +.IP \(bu 4 +\fB.npmrc\fR +.IP \(bu 4 +\fBnode_modules\fR +.IP \(bu 4 +\fBpackage-lock.json\fR +.IP \(bu 4 +\fBpnpm-lock.yaml\fR +.IP \(bu 4 +\fByarn.lock\fR +.IP \(bu 4 +\fBbun.lockb\fR +.RE 0 + +.P +These cannot be included. +.SS "exports" +.P +The "exports" provides a modern alternative to "main" allowing multiple entry points to be defined, conditional entry resolution support between environments, and preventing any other entry points besides those defined in "exports". This encapsulation allows module authors to clearly define the public interface for their package. For more details see the \fBnode.js documentation on package entry points\fR \fI\(lahttps://nodejs.org/api/packages.html#package-entry-points\(ra\fR +.SS "main" +.P +The main field is a module ID that is the primary entry point to your program. That is, if your package is named \fBfoo\fR, and a user installs it, and then does \fBrequire("foo")\fR, then your main module's exports object will be returned. +.P +This should be a module relative to the root of your package folder. +.P +For most modules, it makes the most sense to have a main script and often not much else. +.P +If \fBmain\fR is not set, it defaults to \fBindex.js\fR in the package's root folder. +.SS "type" +.P +The \fBtype\fR field defines how Node.js should interpret \fB.js\fR files in your package. This field is not used by npm. +.P +See the \fBNode.js documentation on the type field\fR \fI\(lahttps://nodejs.org/api/packages.html#type\(ra\fR for more information. +.SS "browser" +.P +If your module is meant to be used client-side the browser field should be used instead of the main field. This is helpful to hint users that it might rely on primitives that aren't available in Node.js modules. (e.g. \fBwindow\fR) +.SS "bin" +.P +A lot of packages have one or more executable files that they'd like to install into the PATH. npm makes this pretty easy (in fact, it uses this feature to install the "npm" executable.) +.P +To use this, supply a \fBbin\fR field in your package.json which is a map of command name to local file name. When this package is installed globally, that file will be either linked inside the global bins directory or a cmd (Windows Command File) will be created which executes the specified file in the \fBbin\fR field, so it is available to run by \fBname\fR or \fBname.cmd\fR (on Windows PowerShell). When this package is installed as a dependency in another package, the file will be linked where it will be available to that package either directly by \fBnpm exec\fR or by name in other scripts when invoking them via \fBnpm run\fR. +.P +For example, myapp could have this: +.P +.RS 2 +.nf +{ + "bin": { + "myapp": "bin/cli.js" + } +} +.fi +.RE +.P +So, when you install myapp, in case of unix-like OS it'll create a symlink from the \fBcli.js\fR script to \fB/usr/local/bin/myapp\fR and in case of windows it will create a cmd file usually at \fBC:\[rs]Users\[rs]{Username}\[rs]AppData\[rs]Roaming\[rs]npm\[rs]myapp.cmd\fR which runs the \fBcli.js\fR script. +.P +If you have a single executable, and its name should be the name of the package, then you can just supply it as a string. For example: +.P +.RS 2 +.nf +{ + "name": "my-program", + "version": "1.2.5", + "bin": "path/to/program" +} +.fi +.RE +.P +would be the same as this: +.P +.RS 2 +.nf +{ + "name": "my-program", + "version": "1.2.5", + "bin": { + "my-program": "path/to/program" + } +} +.fi +.RE +.P +Please make sure that your file(s) referenced in \fBbin\fR starts with \fB#!/usr/bin/env node\fR; otherwise, the scripts are started without the node executable! +.P +Note that you can also set the executable files using \fI(directories.bin)\fR. +.P +See \fBfolders\fR \fI\(la/configuring-npm/folders#executables\(ra\fR for more info on executables. +.SS "man" +.P +Specify either a single file or an array of filenames to put in place for the \fBman\fR program to find. +.P +If only a single file is provided, then it's installed such that it is the result from \fBman \fR, regardless of its actual filename. For example: +.P +.RS 2 +.nf +{ + "name": "foo", + "version": "1.2.3", + "description": "A packaged foo fooer for fooing foos", + "main": "foo.js", + "man": "./man/doc.1" +} +.fi +.RE +.P +would link the \fB./man/doc.1\fR file in such that it is the target for \fBman foo\fR +.P +If the filename doesn't start with the package name, then it's prefixed. So, this: +.P +.RS 2 +.nf +{ + "name": "foo", + "version": "1.2.3", + "description": "A packaged foo fooer for fooing foos", + "main": "foo.js", + "man": \[lB] + "./man/foo.1", + "./man/bar.1" + \[rB] +} +.fi +.RE +.P +will create files to do \fBman foo\fR and \fBman foo-bar\fR. +.P +Man files must end with a number, and optionally a \fB.gz\fR suffix if they are compressed. The number dictates which man section the file is installed into. +.P +.RS 2 +.nf +{ + "name": "foo", + "version": "1.2.3", + "description": "A packaged foo fooer for fooing foos", + "main": "foo.js", + "man": \[lB] + "./man/foo.1", + "./man/foo.2" + \[rB] +} +.fi +.RE +.P +will create entries for \fBman foo\fR and \fBman 2 foo\fR +.SS "directories" +.P +The CommonJS \fBPackages\fR \fI\(lahttp://wiki.commonjs.org/wiki/Packages/1.0\(ra\fR spec details a few ways that you can indicate the structure of your package using a \fBdirectories\fR object. If you look at \fBnpm's package.json\fR \fI\(lahttps://registry.npmjs.org/npm/latest\(ra\fR, you'll see that it has directories for doc, lib, and man. +.P +In the future, this information may be used in other creative ways. +.SS "directories.bin" +.P +If you specify a \fBbin\fR directory in \fBdirectories.bin\fR, all the files in that folder will be added. +.P +Because of the way the \fBbin\fR directive works, specifying both a \fBbin\fR path and setting \fBdirectories.bin\fR is an error. If you want to specify individual files, use \fBbin\fR, and for all the files in an existing \fBbin\fR directory, use \fBdirectories.bin\fR. +.SS "directories.man" +.P +A folder that is full of man pages. Sugar to generate a "man" array by walking the folder. +.SS "repository" +.P +Specify the place where your code lives. This is helpful for people who want to contribute. If the git repo is on GitHub, then the \fBnpm repo\fR command will be able to find you. +.P +Do it like this: +.P +.RS 2 +.nf +{ + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cli.git" + } +} +.fi +.RE +.P +The URL should be a publicly available (perhaps read-only) URL that can be handed directly to a VCS program without any modification. It should not be a URL to an html project page that you put in your browser. It's for computers. +.P +For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same shortcut syntax you use for \fBnpm install\fR: +.P +.RS 2 +.nf +{ + "repository": "npm/example", + + "repository": "github:npm/example", + + "repository": "gist:11081aaa281", + + "repository": "bitbucket:user/repo", + + "repository": "gitlab:user/repo" +} +.fi +.RE +.P +\fBNote on normalization:\fR When you publish a package, npm normalizes the \fBrepository\fR field to the full object format with a \fBurl\fR property. If you use a shorthand format (like \fB"npm/example"\fR), you'll see a warning during \fBnpm publish\fR indicating that the field was auto-corrected. While the shorthand format currently works, it's recommended to use the full object format in your \fBpackage.json\fR to avoid warnings and ensure future compatibility: +.P +.RS 2 +.nf +{ + "repository": { + "type": "git", + "url": "git+https://github.com/npm/example.git" + } +} +.fi +.RE +.P +You can run \fBnpm pkg fix\fR to automatically convert shorthand formats to the normalized object format. +.P +If the \fBpackage.json\fR for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives: +.P +.RS 2 +.nf +{ + "repository": { + "type": "git", + "url": "git+https://github.com/npm/cli.git", + "directory": "workspaces/libnpmpublish" + } +} +.fi +.RE +.SS "scripts" +.P +The "scripts" property is a dictionary containing script commands that are run at various times in the lifecycle of your package. The key is the lifecycle event, and the value is the command to run at that point. +.P +See npm help scripts to find out more about writing package scripts. +.SS "gypfile" +.P +If you have a binding.gyp file in the root of your package and you have not defined your own \fBinstall\fR or \fBpreinstall\fR scripts, npm will default to building your module using node-gyp. +.P +To prevent npm from automatically building your module with node-gyp, set \fBgypfile\fR to \fBfalse\fR: +.P +.RS 2 +.nf +{ + "gypfile": false +} +.fi +.RE +.P +This is useful for packages that include native addons but want to handle the build process differently, or packages that have a binding.gyp file but should not be built as a native addon. +.SS "config" +.P +A "config" object can be used to set configuration parameters used in package scripts that persist across upgrades. For instance, if a package had the following: +.P +.RS 2 +.nf +{ + "name": "foo", + "config": { + "port": "8080" + } +} +.fi +.RE +.P +It could also have a "start" script that referenced the \fBnpm_package_config_port\fR environment variable. +.SS "dependencies" +.P +Dependencies are specified in a simple object that maps a package name to a version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL. +.P +\fBPlease do not put test harnesses or transpilers or other "development" time tools in your \fBdependencies\fB object.\fR See \fBdevDependencies\fR, below. +.P +See \fBsemver\fR \fI\(lahttps://github.com/npm/node-semver#versions\(ra\fR for more details about specifying version ranges. +.RS 0 +.IP \(bu 4 +\fBversion\fR Must match \fBversion\fR exactly +.IP \(bu 4 +\fB>version\fR Must be greater than \fBversion\fR +.IP \(bu 4 +\fB>=version\fR etc +.IP \(bu 4 +\fB=version1 <=version2\fR. +.IP \(bu 4 +\fBrange1 || range2\fR Passes if either range1 or range2 are satisfied. +.IP \(bu 4 +\fBgit...\fR See 'Git URLs as Dependencies' below +.IP \(bu 4 +\fBuser/repo\fR See 'GitHub URLs' below +.IP \(bu 4 +\fBtag\fR A specific version tagged and published as \fBtag\fR See npm help dist-tag +.IP \(bu 4 +\fBpath/path/path\fR See \fI(Local Paths)\fR below +.IP \(bu 4 +\fBnpm:@scope/pkg@version\fR Custom alias for a package See \fB\[rs]fBpackage-spec\[rs]fR\fR \fI\(la/using-npm/package-spec#aliases\(ra\fR +.RE 0 + +.P +For example, these are all valid: +.P +.RS 2 +.nf +{ + "dependencies": { + "foo": "1.0.0 - 2.9999.9999", + "bar": ">=1.0.2 <2.1.2", + "baz": ">1.0.2 <=2.3.4", + "boo": "2.0.1", + "qux": "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0", + "asd": "http://npmjs.com/example.tar.gz", + "til": "~1.2", + "elf": "~1.2.3", + "two": "2.x", + "thr": "3.3.x", + "lat": "latest", + "dyl": "file:../dyl", + "kpg": "npm:pkg@1.0.0" + } +} +.fi +.RE +.SS "URLs as Dependencies" +.P +You may specify a tarball URL in place of a version range. +.P +This tarball will be downloaded and installed locally to your package at install time. +.SS "Git URLs as Dependencies" +.P +Git URLs are of the form: +.P +.RS 2 +.nf +://\[lB]\[lB]:\[rB]@\[rB]\[lB]:\[rB]\[lB]:\[rB]\[lB]/\[rB]\[lB]# | #semver:\[rB] +.fi +.RE +.P +\fB\fR is one of \fBgit\fR, \fBgit+ssh\fR, \fBgit+http\fR, \fBgit+https\fR, or \fBgit+file\fR. +.P +If \fB#\fR is provided, it will be used to clone exactly that commit. If the commit-ish has the format \fB#semver:\fR, \fB\fR can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. If neither \fB#\fR or \fB#semver:\fR is specified, then the default branch is used. +.P +Examples: +.P +.RS 2 +.nf +git+ssh://git@github.com:npm/cli.git#v1.0.27 +git+ssh://git@github.com:npm/cli#semver:^5.0 +git+https://isaacs@github.com/npm/cli.git +git://github.com/npm/cli.git#v1.0.27 +.fi +.RE +.P +When installing from a \fBgit\fR repository, the presence of certain fields in the \fBpackage.json\fR will cause npm to believe it needs to perform a build. To do so your repository will be cloned into a temporary directory, all of its deps installed, relevant scripts run, and the resulting directory packed and installed. +.P +This flow will occur if your git dependency uses \fBworkspaces\fR, or if any of the following scripts are present: +.RS 0 +.IP \(bu 4 +\fBbuild\fR +.IP \(bu 4 +\fBprepare\fR +.IP \(bu 4 +\fBprepack\fR +.IP \(bu 4 +\fBpreinstall\fR +.IP \(bu 4 +\fBinstall\fR +.IP \(bu 4 +\fBpostinstall\fR +.RE 0 + +.P +If your git repository includes pre-built artifacts, you will likely want to make sure that none of the above scripts are defined, or your dependency will be rebuilt for every installation. +.SS "GitHub URLs" +.P +As of version 1.1.65, you can refer to GitHub URLs as just "foo": "user/foo-project". Just as with git URLs, a \fBcommit-ish\fR suffix can be included. For example: +.P +.RS 2 +.nf +{ + "name": "foo", + "version": "0.0.0", + "dependencies": { + "express": "expressjs/express", + "mocha": "mochajs/mocha#4727d357ea", + "module": "npm/example-github-repo#feature\[rs]/branch" + } +} +.fi +.RE +.SS "Local Paths" +.P +As of version 2.0.0 you can provide a path to a local directory that contains a package. Local paths can be saved using \fBnpm install -S\fR or \fBnpm install --save\fR, using any of these forms: +.P +.RS 2 +.nf +../foo/bar +~/foo/bar +./foo/bar +/foo/bar +.fi +.RE +.P +in which case they will be normalized to a relative path and added to your \fBpackage.json\fR. For example: +.P +.RS 2 +.nf +{ + "name": "baz", + "dependencies": { + "bar": "file:../foo/bar" + } +} +.fi +.RE +.P +This feature is helpful for local offline development and creating tests that require npm installing where you don't want to hit an external server, but should not be used when publishing your package to the public registry. +.P +\fInote\fR: Packages linked by local path will not have their own dependencies installed when \fBnpm install\fR is run. You must run \fBnpm install\fR from inside the local path itself. +.SS "devDependencies" +.P +If someone is planning on downloading and using your module in their program, then they probably don't want or need to download and build the external test or documentation framework that you use. +.P +In this case, it's best to map these additional items in a \fBdevDependencies\fR object. +.P +These things will be installed when doing \fBnpm link\fR or \fBnpm install\fR from the root of a package, and can be managed like any other npm configuration param. See npm help config for more on the topic. +.P +For build steps that are not platform-specific, such as compiling CoffeeScript or other languages to JavaScript, use the \fBprepare\fR script to do this, and make the required package a devDependency. +.P +For example: +.P +.RS 2 +.nf +{ + "name": "@npm/ethopia-waza", + "description": "a delightfully fruity coffee varietal", + "version": "1.2.3", + "devDependencies": { + "coffee-script": "~1.6.3" + }, + "scripts": { + "prepare": "coffee -o lib/ -c src/waza.coffee" + }, + "main": "lib/waza.js" +} +.fi +.RE +.P +The \fBprepare\fR script will be run before publishing, so that users can consume the functionality without requiring them to compile it themselves. In dev mode (ie, locally running \fBnpm install\fR), it'll run this script as well, so that you can test it easily. +.SS "peerDependencies" +.P +In some cases, you want to express the compatibility of your package with a host tool or library, while not necessarily doing a \fBrequire\fR of this host. This is usually referred to as a \fIplugin\fR. Notably, your module may be exposing a specific interface, expected and specified by the host documentation. +.P +For example: +.P +.RS 2 +.nf +{ + "name": "@npm/tea-latte", + "version": "1.3.5", + "peerDependencies": { + "@npm/tea": "2.x" + } +} +.fi +.RE +.P +This ensures your package \fB@npm/tea-latte\fR can be installed \fIalong\fR with the second major version of the host package \fB@npm/tea\fR only. \fBnpm install tea-latte\fR could possibly yield the following dependency graph: +.P +.RS 2 +.nf +├── @npm/tea-latte@1.3.5 +└── @npm/tea@2.2.0 +.fi +.RE +.P +In npm versions 3 through 6, \fBpeerDependencies\fR were not automatically installed, and would raise a warning if an invalid version of the peer dependency was found in the tree. As of npm v7, peerDependencies \fIare\fR installed by default. +.P +Trying to install another plugin with a conflicting requirement may cause an error if the tree cannot be resolved correctly. For this reason, make sure your plugin requirement is as broad as possible, and not to lock it down to specific patch versions. +.P +Assuming the host complies with \fBsemver\fR \fI\(lahttps://semver.org/\(ra\fR, only changes in the host package's major version will break your plugin. Thus, if you've worked with every 1.x version of the host package, use \fB"^1.0"\fR or \fB"1.x"\fR to express this. If you depend on features introduced in 1.5.2, use \fB"^1.5.2"\fR. +.SS "peerDependenciesMeta" +.P +The \fBpeerDependenciesMeta\fR field serves to provide npm more information on how your peer dependencies are to be used. Specifically, it allows peer dependencies to be marked as optional. Npm will not automatically install optional peer dependencies. This allows you to integrate and interact with a variety of host packages without requiring all of them to be installed. +.P +For example: +.P +.RS 2 +.nf +{ + "name": "@npm/tea-latte", + "version": "1.3.5", + "peerDependencies": { + "@npm/tea": "2.x", + "@npm/soy-milk": "1.2" + }, + "peerDependenciesMeta": { + "@npm/soy-milk": { + "optional": true + } + } +} +.fi +.RE +.SS "bundleDependencies" +.P +This defines an array of package names that will be bundled when publishing the package. +.P +In cases where you need to preserve npm packages locally or have them available through a single file download, you can bundle the packages in a tarball file by specifying the package names in the \fBbundleDependencies\fR array and executing \fBnpm pack\fR. +.P +For example: +.P +If we define a package.json like this: +.P +.RS 2 +.nf +{ + "name": "@npm/awesome-web-framework", + "version": "1.0.0", + "bundleDependencies": \[lB] + "@npm/renderized", + "@npm/super-streams" + \[rB] +} +.fi +.RE +.P +we can obtain \fB@npm/awesome-web-framework-1.0.0.tgz\fR file by running \fBnpm pack\fR. This file contains the dependencies \fB@npm/renderized\fR and \fB@npm/super-streams\fR which can be installed in a new project by executing \fBnpm install awesome-web-framework-1.0.0.tgz\fR. Note that the package names do not include any versions, as that information is specified in \fBdependencies\fR. +.P +If this is spelled \fB"bundledDependencies"\fR, then that is also honored. +.P +Alternatively, \fB"bundleDependencies"\fR can be defined as a boolean value. A value of \fBtrue\fR will bundle all dependencies, a value of \fBfalse\fR will bundle none. +.SS "optionalDependencies" +.P +If a dependency can be used, but you would like npm to proceed if it cannot be found or fails to install, then you may put it in the \fBoptionalDependencies\fR object. This is a map of package name to version or URL, just like the \fBdependencies\fR object. The difference is that build failures do not cause installation to fail. Running \fBnpm install --omit=optional\fR will prevent these dependencies from being installed. +.P +It is still your program's responsibility to handle the lack of the dependency. For example, something like this: +.P +.RS 2 +.nf +try { + var foo = require('@npm/foo') + var fooVersion = require('@npm/foo/package.json').version +} catch (er) { + foo = null +} +if ( notGoodFooVersion(fooVersion) ) { + foo = null +} + +// .. then later in your program .. + +if (foo) { + foo.doFooThings() +} +.fi +.RE +.P +Entries in \fBoptionalDependencies\fR will override entries of the same name in \fBdependencies\fR, so it's usually best to only put in one place. +.SS "overrides" +.P +If you need to make specific changes to dependencies of your dependencies, for example replacing the version of a dependency with a known security issue, replacing an existing dependency with a fork, or making sure that the same version of a package is used everywhere, then you may add an override. +.P +Overrides provide a way to replace a package in your dependency tree with another version, or another package entirely. These changes can be scoped as specific or as vague as desired. +.P +Overrides are only considered in the root \fBpackage.json\fR file for a project. Overrides in installed dependencies (including npm help workspaces) are not considered in dependency tree resolution. Published packages may dictate their resolutions by pinning dependencies or using an \fB\[rs]fBnpm-shrinkwrap.json\[rs]fR\fR \fI\(la/configuring-npm/npm-shrinkwrap-json\(ra\fR file. +.P +To make sure the package \fB@npm/foo\fR is always installed as version \fB1.0.0\fR no matter what version your dependencies rely on: +.P +.RS 2 +.nf +{ + "overrides": { + "@npm/foo": "1.0.0" + } +} +.fi +.RE +.P +The above is a short hand notation, the full object form can be used to allow overriding a package itself as well as a child of the package. This will cause \fB@npm/foo\fR to always be \fB1.0.0\fR while also making \fB@npm/bar\fR at any depth beyond \fB@npm/foo\fR also \fB1.0.0\fR: +.P +.RS 2 +.nf +{ + "overrides": { + "@npm/foo": { + ".": "1.0.0", + "@npm/bar": "1.0.0" + } + } +} +.fi +.RE +.P +To only override \fB@npm/foo\fR to be \fB1.0.0\fR when it's a child (or grandchild, or great grandchild, etc) of the package \fB@npm/bar\fR: +.P +.RS 2 +.nf +{ + "overrides": { + "@npm/bar": { + "@npm/foo": "1.0.0" + } + } +} +.fi +.RE +.P +Keys can be nested to any arbitrary length. To override \fB@npm/foo\fR only when it's a child of \fB@npm/bar\fR and only when \fB@npm/bar\fR is a child of \fB@npm/baz\fR: +.P +.RS 2 +.nf +{ + "overrides": { + "@npm/baz": { + "@npm/bar": { + "@npm/foo": "1.0.0" + } + } + } +} +.fi +.RE +.P +The key of an override can also include a version, or range of versions. To override \fB@npm/foo\fR to \fB1.0.0\fR, but only when it's a child of \fB@npm/bar@2.0.0\fR: +.P +.RS 2 +.nf +{ + "overrides": { + "@npm/bar@2.0.0": { + "@npm/foo": "1.0.0" + } + } +} +.fi +.RE +.P +You may not set an override for a package that you directly depend on unless both the dependency and the override itself share the exact same spec. To make this limitation easier to deal with, overrides may also be defined as a reference to a spec for a direct dependency by prefixing the name of the package you wish the version to match with a \fB$\fR. +.P +.RS 2 +.nf +{ + "dependencies": { + "@npm/foo": "^1.0.0" + }, + "overrides": { + // BAD, will throw an EOVERRIDE error + // "foo": "^2.0.0" + // GOOD, specs match so override is allowed + // "foo": "^1.0.0" + // BEST, the override is defined as a reference to the dependency + "@npm/foo": "$foo", + // the referenced package does not need to match the overridden one + "@npm/bar": "$foo" + } +} +.fi +.RE +.SS "Replacing a dependency with a fork" +.P +You can replace a package with a different package or fork using several methods: +.P +\fBUsing the \fBnpm:\fB prefix to replace with a different package name:\fR +.P +.RS 2 +.nf +{ + "overrides": { + "package-name": "npm:@scope/forked-package@1.0.0" + } +} +.fi +.RE +.P +\fBUsing a GitHub repository (supports branches, tags, or commit hashes):\fR +.P +.RS 2 +.nf +{ + "overrides": { + "package-name": "github:username/repo#branch-name" + } +} +.fi +.RE +.P +\fBUsing a local file path:\fR +.P +.RS 2 +.nf +{ + "overrides": { + "package-name": "file:../local-fork" + } +} +.fi +.RE +.P +These replacement methods work for both top-level overrides and nested overrides. For example, to replace a transitive dependency with a fork: +.P +.RS 2 +.nf +{ + "overrides": { + "parent-package": { + "vulnerable-dep": "github:username/patched-fork#v2.0.1" + } + } +} +.fi +.RE +.SS "engines" +.P +You can specify the version of node that your stuff works on: +.P +.RS 2 +.nf +{ + "engines": { + "node": ">=0.10.3 <15" + } +} +.fi +.RE +.P +And, like with dependencies, if you don't specify the version (or if you specify "*" as the version), then any version of node will do. +.P +You can also use the "engines" field to specify which versions of npm are capable of properly installing your program. For example: +.P +.RS 2 +.nf +{ + "engines": { + "npm": "~1.0.20" + } +} +.fi +.RE +.P +Unless the user has set the \fB\[rs]fBengine-strict\[rs]fR config\fR \fI\(la/using-npm/config#engine-strict\(ra\fR flag, this field is advisory only and will only produce warnings when your package is installed as a dependency. +.SS "os" +.P +You can specify which operating systems your module will run on: +.P +.RS 2 +.nf +{ + "os": \[lB] + "darwin", + "linux" + \[rB] +} +.fi +.RE +.P +You can also block instead of allowing operating systems, just prepend the blocked os with a '!': +.P +.RS 2 +.nf +{ + "os": \[lB] + "!win32" + \[rB] +} +.fi +.RE +.P +The host operating system is determined by \fBprocess.platform\fR +.P +It is allowed to both block and allow an item, although there isn't any good reason to do this. +.SS "cpu" +.P +If your code only runs on certain cpu architectures, you can specify which ones. +.P +.RS 2 +.nf +{ + "cpu": \[lB] + "x64", + "ia32" + \[rB] +} +.fi +.RE +.P +Like the \fBos\fR option, you can also block architectures: +.P +.RS 2 +.nf +{ + "cpu": \[lB] + "!arm", + "!mips" + \[rB] +} +.fi +.RE +.P +The host architecture is determined by \fBprocess.arch\fR +.SS "libc" +.P +If your code only runs or builds in certain versions of libc, you can specify which ones. This field only applies if \fBos\fR is \fBlinux\fR. +.P +.RS 2 +.nf +{ + "os": "linux", + "libc": "glibc" +} +.fi +.RE +.SS "devEngines" +.P +The \fBdevEngines\fR field aids engineers working on a codebase to all be using the same tooling. +.P +You can specify a \fBdevEngines\fR property in your \fBpackage.json\fR which will run before \fBinstall\fR, \fBci\fR, and \fBrun\fR commands. +.RS 0 +.P +Note: \fBengines\fR and \fBdevEngines\fR differ in object shape. They also function very differently. \fBengines\fR is designed to alert the user when a dependency uses a different npm or node version than the project it's being used in, whereas \fBdevEngines\fR is used to alert people interacting with the source code of a project. +.RE 0 + +.P +The supported keys under the \fBdevEngines\fR property are \fBcpu\fR, \fBos\fR, \fBlibc\fR, \fBruntime\fR, and \fBpackageManager\fR. Each property can be an object or an array of objects. Objects must contain \fBname\fR, and optionally can specify \fBversion\fR, and \fBonFail\fR. \fBonFail\fR can be \fBwarn\fR, \fBerror\fR, or \fBignore\fR, and if left undefined is of the same value as \fBerror\fR. \fBnpm\fR will assume that you're running with \fBnode\fR. Here's an example of a project that will fail if the environment is not \fBnode\fR and \fBnpm\fR. If you set \fBruntime.name\fR or \fBpackageManager.name\fR to any other string, it will fail within the npm CLI. +.P +.RS 2 +.nf +{ + "devEngines": { + "runtime": { + "name": "node", + "onFail": "error" + }, + "packageManager": { + "name": "npm", + "onFail": "error" + } + } +} +.fi +.RE +.SS "private" +.P +If you set \fB"private": true\fR in your package.json, then npm will refuse to publish it. +.P +This is a way to prevent accidental publication of private repositories. If you would like to ensure that a given package is only ever published to a specific registry (for example, an internal registry), then use the \fBpublishConfig\fR dictionary described below to override the \fBregistry\fR config param at publish-time. +.SS "publishConfig" +.P +This is a set of config values that will be used at publish-time. It's especially handy if you want to set the tag, registry or access, so that you can ensure that a given package is not tagged with "latest", published to the global public registry or that a scoped module is private by default. +.P +See npm help config to see the list of config options that can be overridden. +.SS "workspaces" +.P +The optional \fBworkspaces\fR field is an array of file patterns that describes locations within the local file system that the install client should look up to find each npm help workspace that needs to be symlinked to the top level \fBnode_modules\fR folder. +.P +It can describe either the direct paths of the folders to be used as workspaces or it can define globs that will resolve to these same folders. +.P +In the following example, all folders located inside the folder \fB./packages\fR will be treated as workspaces as long as they have valid \fBpackage.json\fR files inside them: +.P +.RS 2 +.nf +{ + "name": "workspace-example", + "workspaces": \[lB] + "./packages/*" + \[rB] +} +.fi +.RE +.P +See npm help workspaces for more examples. +.SS "DEFAULT VALUES" +.P +npm will default some values based on package contents. +.RS 0 +.IP \(bu 4 +\fB"scripts": {"start": "node server.js"}\fR +.P +If there is a \fBserver.js\fR file in the root of your package, then npm will default the \fBstart\fR command to \fBnode server.js\fR. +.IP \(bu 4 +\fB"scripts":{"install": "node-gyp rebuild"}\fR +.P +If there is a \fBbinding.gyp\fR file in the root of your package and you have not defined an \fBinstall\fR or \fBpreinstall\fR script, npm will default the \fBinstall\fR command to compile using node-gyp. +.IP \(bu 4 +\fB"contributors": \[lB]...\[rB]\fR +.P +If there is an \fBAUTHORS\fR file in the root of your package, npm will treat each line as a \fBName (url)\fR format, where email and url are optional. Lines which start with a \fB#\fR or are blank, will be ignored. +.RE 0 + +.SS "SEE ALSO" +.RS 0 +.IP \(bu 4 +\fBsemver\fR \fI\(lahttps://github.com/npm/node-semver#versions\(ra\fR +.IP \(bu 4 +npm help workspaces +.IP \(bu 4 +npm help init +.IP \(bu 4 +npm help version +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help help +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help publish +.IP \(bu 4 +npm help uninstall +.RE 0 diff --git a/node24/node_modules/npm/man/man5/package-lock-json.5 b/node24/node_modules/npm/man/man5/package-lock-json.5 new file mode 100644 index 0000000000000000000000000000000000000000..10501b459f18c4fbe6a9615ebc044e42698af350 --- /dev/null +++ b/node24/node_modules/npm/man/man5/package-lock-json.5 @@ -0,0 +1,166 @@ +.TH "PACKAGE-LOCK.JSON" "5" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBpackage-lock.json\fR - A manifestation of the manifest +.SS "Description" +.P +\fBpackage-lock.json\fR is automatically generated for any operations where npm modifies either the \fBnode_modules\fR tree, or \fBpackage.json\fR. It describes the exact tree that was generated, such that subsequent installs are able to generate identical trees, regardless of intermediate dependency updates. +.P +This file is intended to be committed into source repositories, and serves various purposes: +.RS 0 +.IP \(bu 4 +Describe a single representation of a dependency tree such that teammates, deployments, and continuous integration are guaranteed to install exactly the same dependencies. +.IP \(bu 4 +Provide a facility for users to "time-travel" to previous states of \fBnode_modules\fR without having to commit the directory itself. +.IP \(bu 4 +Facilitate greater visibility of tree changes through readable source control diffs. +.IP \(bu 4 +Optimize the installation process by allowing npm to skip repeated metadata resolutions for previously-installed packages. +.IP \(bu 4 +As of npm v7, lockfiles include enough information to gain a complete picture of the package tree, reducing the need to read \fBpackage.json\fR files, and allowing for significant performance improvements. +.RE 0 + +.P +When \fBnpm\fR creates or updates \fBpackage-lock.json\fR, it will infer line endings and indentation from \fBpackage.json\fR so that the formatting of both files matches. +.SS "\fBpackage-lock.json\fR vs \fBnpm-shrinkwrap.json\fR" +.P +Both of these files have the same format, and perform similar functions in the root of a project. +.P +The difference is that \fBpackage-lock.json\fR cannot be published, and it will be ignored if found in any place other than the root project. +.P +In contrast, \fBnpm-shrinkwrap.json\fR \fI\(la/configuring-npm/npm-shrinkwrap-json\(ra\fR allows publication, and defines the dependency tree from the point encountered. This is not recommended unless deploying a CLI tool or otherwise using the publication process for producing production packages. +.P +If both \fBpackage-lock.json\fR and \fBnpm-shrinkwrap.json\fR are present in the root of a project, \fBnpm-shrinkwrap.json\fR will take precedence and \fBpackage-lock.json\fR will be ignored. +.SS "Hidden Lockfiles" +.P +In order to avoid processing the \fBnode_modules\fR folder repeatedly, npm as of v7 uses a "hidden" lockfile present in \fBnode_modules/.package-lock.json\fR. This contains information about the tree, and is used in lieu of reading the entire \fBnode_modules\fR hierarchy provided that the following conditions are met: +.RS 0 +.IP \(bu 4 +All package folders it references exist in the \fBnode_modules\fR hierarchy. +.IP \(bu 4 +No package folders exist in the \fBnode_modules\fR hierarchy that are not listed in the lockfile. +.IP \(bu 4 +The modified time of the file is at least as recent as all of the package folders it references. +.RE 0 + +.P +That is, the hidden lockfile will only be relevant if it was created as part of the most recent update to the package tree. If another CLI mutates the tree in any way, this will be detected, and the hidden lockfile will be ignored. +.P +Note that it \fIis\fR possible to manually change the \fIcontents\fR of a package in such a way that the modified time of the package folder is unaffected. For example, if you add a file to \fBnode_modules/foo/lib/bar.js\fR, then the modified time on \fBnode_modules/foo\fR will not reflect this change. If you are manually editing files in \fBnode_modules\fR, it is generally best to delete the file at \fBnode_modules/.package-lock.json\fR. +.P +As the hidden lockfile is ignored by older npm versions, it does not contain the backwards compatibility affordances present in "normal" lockfiles. That is, it is \fBlockfileVersion: 3\fR, rather than \fBlockfileVersion: 2\fR. +.SS "Handling Old Lockfiles" +.P +When npm detects a lockfile from npm v6 or before during the package installation process, it is automatically updated to fetch missing information from either the \fBnode_modules\fR tree or (in the case of empty \fBnode_modules\fR trees or very old lockfile formats) the npm registry. +.SS "File Format" +.SS "\fBname\fR" +.P +The name of the package this is a package-lock for. This will match what's in \fBpackage.json\fR. +.SS "\fBversion\fR" +.P +The version of the package this is a package-lock for. This will match what's in \fBpackage.json\fR. +.SS "\fBlockfileVersion\fR" +.P +An integer version, starting at \fB1\fR with the version number of this document whose semantics were used when generating this \fBpackage-lock.json\fR. +.P +Note that the file format changed significantly in npm v7 to track information that would have otherwise required looking in \fBnode_modules\fR or the npm registry. Lockfiles generated by npm v7 will contain \fBlockfileVersion: 2\fR. +.RS 0 +.IP \(bu 4 +No version provided: an "ancient" shrinkwrap file from a version of npm prior to npm v5. +.IP \(bu 4 +\fB1\fR: The lockfile version used by npm v5 and v6. +.IP \(bu 4 +\fB2\fR: The lockfile version used by npm v7 and v8. Backwards compatible to v1 lockfiles. +.IP \(bu 4 +\fB3\fR: The lockfile version used by npm v9 and above. Backwards compatible to npm v7. +.RE 0 + +.P +npm will always attempt to get whatever data it can out of a lockfile, even if it is not a version that it was designed to support. +.SS "\fBpackages\fR" +.P +This is an object that maps package locations to an object containing the information about that package. +.P +The root project is typically listed with a key of \fB""\fR, and all other packages are listed with their relative paths from the root project folder. +.P +Package descriptors have the following fields: +.RS 0 +.IP \(bu 4 +version: The version found in \fBpackage.json\fR +.IP \(bu 4 +resolved: The place where the package was actually resolved from. In the case of packages fetched from the registry, this will be a url to a tarball. In the case of git dependencies, this will be the full git url with commit sha. In the case of link dependencies, this will be the location of the link target. \fBregistry.npmjs.org\fR is a magic value meaning "the currently configured registry". +.IP \(bu 4 +integrity: A \fBsha512\fR or \fBsha1\fR \fBStandard Subresource Integrity\fR \fI\(lahttps://w3c.github.io/webappsec/specs/subresourceintegrity/\(ra\fR string for the artifact that was unpacked in this location. +.IP \(bu 4 +link: A flag to indicate that this is a symbolic link. If this is present, no other fields are specified, since the link target will also be included in the lockfile. +.IP \(bu 4 +dev, optional, devOptional: If the package is strictly part of the \fBdevDependencies\fR tree, then \fBdev\fR will be true. If it is strictly part of the \fBoptionalDependencies\fR tree, then \fBoptional\fR will be set. If it is both a \fBdev\fR dependency \fIand\fR an \fBoptional\fR dependency of a non-dev dependency, then \fBdevOptional\fR will be set. (An \fBoptional\fR dependency of a \fBdev\fR dependency will have both \fBdev\fR and \fBoptional\fR set.) +.IP \(bu 4 +inBundle: A flag to indicate that the package is a bundled dependency. +.IP \(bu 4 +hasInstallScript: A flag to indicate that the package has a \fBpreinstall\fR, \fBinstall\fR, or \fBpostinstall\fR script. +.IP \(bu 4 +hasShrinkwrap: A flag to indicate that the package has an \fBnpm-shrinkwrap.json\fR file. +.IP \(bu 4 +bin, license, engines, dependencies, optionalDependencies: fields from \fBpackage.json\fR +.IP \(bu 4 +os: An array of operating systems this package is compatible with, as specified in \fBpackage.json\fR. This field is included when the package specifies OS restrictions. +.IP \(bu 4 +cpu: An array of CPU architectures this package is compatible with, as specified in \fBpackage.json\fR. This field is included when the package specifies CPU restrictions. +.IP \(bu 4 +funding: Funding information for the package, as specified in \fBpackage.json\fR. This field contains details about how to support the package maintainers. +.RE 0 + +.SS "dependencies" +.P +Legacy data for supporting versions of npm that use \fBlockfileVersion: 1\fR. This is a mapping of package names to dependency objects. Because the object structure is strictly hierarchical, symbolic link dependencies are somewhat challenging to represent in some cases. +.P +npm v7 ignores this section entirely if a \fBpackages\fR section is present, but does keep it up to date in order to support switching between npm v6 and npm v7. +.P +Dependency objects have the following fields: +.RS 0 +.IP \(bu 4 +version: a specifier that varies depending on the nature of the package, and is usable in fetching a new copy of it. Note that for peer dependencies that are not installed, or optional dependencies that are not installed, this field may be omitted. +.RS 4 +.IP \(bu 4 +bundled dependencies: Regardless of source, this is a version number that is purely for informational purposes. +.IP \(bu 4 +registry sources: This is a version number. (eg, \fB1.2.3\fR) +.IP \(bu 4 +git sources: This is a git specifier with resolved committish. (eg, \fBgit+https://example.com/foo/bar#115311855adb0789a0466714ed48a1499ffea97e\fR) +.IP \(bu 4 +http tarball sources: This is the URL of the tarball. (eg, \fBhttps://example.com/example-1.3.0.tgz\fR) +.IP \(bu 4 +local tarball sources: This is the file URL of the tarball. (eg \fBfile:///opt/storage/example-1.3.0.tgz\fR) +.IP \(bu 4 +local link sources: This is the file URL of the link. (eg \fBfile:libs/our-module\fR) +.RE 0 + +.P +\fBNote:\fR The \fBversion\fR field may be omitted for certain types of dependencies, such as optional peer dependencies that are not installed. In these cases, only metadata fields like \fBdev\fR, \fBoptional\fR, and \fBpeer\fR will be present. +.IP \(bu 4 +integrity: A \fBsha512\fR or \fBsha1\fR \fBStandard Subresource Integrity\fR \fI\(lahttps://w3c.github.io/webappsec/specs/subresourceintegrity/\(ra\fR string for the artifact that was unpacked in this location. For git dependencies, this is the commit sha. +.IP \(bu 4 +resolved: For registry sources this is path of the tarball relative to the registry URL. If the tarball URL isn't on the same server as the registry URL then this is a complete URL. \fBregistry.npmjs.org\fR is a magic value meaning "the currently configured registry". +.IP \(bu 4 +bundled: If true, this is the bundled dependency and will be installed by the parent module. When installing, this module will be extracted from the parent module during the extract phase, not installed as a separate dependency. +.IP \(bu 4 +dev: If true then this dependency is either a development dependency ONLY of the top level module or a transitive dependency of one. This is false for dependencies that are both a development dependency of the top level and a transitive dependency of a non-development dependency of the top level. +.IP \(bu 4 +optional: If true then this dependency is either an optional dependency ONLY of the top level module or a transitive dependency of one. This is false for dependencies that are both an optional dependency of the top level and a transitive dependency of a non-optional dependency of the top level. +.IP \(bu 4 +requires: This is a mapping of module name to version. This is a list of everything this module requires, regardless of where it will be installed. The version should match via normal matching rules a dependency either in our \fBdependencies\fR or in a level higher than us. +.IP \(bu 4 +dependencies: The dependencies of this dependency, exactly as at the top level. +.RE 0 + +.SS "See also" +.RS 0 +.IP \(bu 4 +npm help shrinkwrap +.IP \(bu 4 +\fBnpm-shrinkwrap.json\fR \fI\(la/configuring-npm/npm-shrinkwrap-json\(ra\fR +.IP \(bu 4 +\fBpackage.json\fR \fI\(la/configuring-npm/package-json\(ra\fR +.IP \(bu 4 +npm help install +.RE 0 diff --git a/node24/node_modules/npm/man/man7/config.7 b/node24/node_modules/npm/man/man7/config.7 new file mode 100644 index 0000000000000000000000000000000000000000..7905220d432d595344688da17b0b13208cf1311c --- /dev/null +++ b/node24/node_modules/npm/man/man7/config.7 @@ -0,0 +1,2246 @@ +.TH "CONFIG" "7" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBConfig\fR - About npm configuration +.SS "Description" +.P +This article details npm configuration in general. To learn about the \fBconfig\fR command, see npm help config. +.P +npm gets its configuration values from the following sources, sorted by priority: +.SS "Command Line Flags" +.P +Putting \fB--foo bar\fR on the command line sets the \fBfoo\fR configuration parameter to \fB"bar"\fR. A \fB--\fR argument tells the cli parser to stop reading flags. Using \fB--flag\fR without specifying any value will set the value to \fBtrue\fR. +.P +Example: \fB--flag1 --flag2\fR will set both configuration parameters to \fBtrue\fR, while \fB--flag1 --flag2 bar\fR will set \fBflag1\fR to \fBtrue\fR, and \fBflag2\fR to \fBbar\fR. Finally, \fB--flag1 --flag2 -- bar\fR will set both configuration parameters to \fBtrue\fR, and the \fBbar\fR is taken as a command argument. +.P +\fBCommon examples:\fR +.RS 0 +.IP \(bu 4 +\fBnpm install --prefix /path/to/dir\fR - Runs npm commands in a different directory without changing the current working directory +.IP \(bu 4 +\fBnpm install --global\fR - Installs packages globally (shorthand: \fB-g\fR) +.IP \(bu 4 +\fBnpm install --save-dev\fR - Saves to devDependencies (shorthand: \fB-D\fR) +.RE 0 + +.P +Any configuration option documented in the \fI(Config Settings)\fR section below can be set via command line flags using \fB--option-name value\fR syntax. +.SS "Environment Variables" +.P +Any environment variables that start with \fBnpm_config_\fR will be interpreted as a configuration parameter. For example, putting \fBnpm_config_foo=bar\fR in your environment will set the \fBfoo\fR configuration parameter to \fBbar\fR. Any environment configurations that are not given a value will be given the value of \fBtrue\fR. Config values are case-insensitive, so \fBNPM_CONFIG_FOO=bar\fR will work the same. However, please note that inside npm help scripts npm will set its own environment variables and Node will prefer those lowercase versions over any uppercase ones that you might set. For details see \fBthis issue\fR \fI\(lahttps://github.com/npm/npm/issues/14528\(ra\fR. +.P +Notice that you need to use underscores instead of dashes, so \fB--allow-same-version\fR would become \fBnpm_config_allow_same_version=true\fR. +.P +\fBImportant:\fR When defining custom configuration keys in \fB.npmrc\fR files, use hyphens instead of underscores (e.g., \fBcustom-key=value\fR). This ensures they can be overridden by environment variables, since npm automatically converts underscores to hyphens when reading environment variables. Keys with underscores in \fB.npmrc\fR files cannot be overridden via environment variables. +.SS "npmrc Files" +.P +The four relevant files are: +.RS 0 +.IP \(bu 4 +per-project configuration file (\fB/path/to/my/project/.npmrc\fR) +.IP \(bu 4 +per-user configuration file (defaults to \fB$HOME/.npmrc\fR; configurable via CLI option \fB--userconfig\fR or environment variable \fB$NPM_CONFIG_USERCONFIG\fR) +.IP \(bu 4 +global configuration file (defaults to \fB$PREFIX/etc/npmrc\fR; configurable via CLI option \fB--globalconfig\fR or environment variable \fB$NPM_CONFIG_GLOBALCONFIG\fR) +.IP \(bu 4 +npm's built-in configuration file (\fB/path/to/npm/npmrc\fR) +.RE 0 + +.P +See npm help npmrc for more details. +.SS "Default Configs" +.P +Run \fBnpm config ls -l\fR to see a set of configuration parameters that are internal to npm, and are defaults if nothing else is specified. +.SS "Shorthands and Other CLI Niceties" +.P +The following shorthands are parsed on the command-line: +.RS 0 +.IP \(bu 4 +\fB-a\fR: \fB--all\fR +.IP \(bu 4 +\fB--enjoy-by\fR: \fB--before\fR +.IP \(bu 4 +\fB-c\fR: \fB--call\fR +.IP \(bu 4 +\fB--desc\fR: \fB--description\fR +.IP \(bu 4 +\fB-f\fR: \fB--force\fR +.IP \(bu 4 +\fB-g\fR: \fB--global\fR +.IP \(bu 4 +\fB--iwr\fR: \fB--include-workspace-root\fR +.IP \(bu 4 +\fB-L\fR: \fB--location\fR +.IP \(bu 4 +\fB-d\fR: \fB--loglevel info\fR +.IP \(bu 4 +\fB-s\fR: \fB--loglevel silent\fR +.IP \(bu 4 +\fB--silent\fR: \fB--loglevel silent\fR +.IP \(bu 4 +\fB--ddd\fR: \fB--loglevel silly\fR +.IP \(bu 4 +\fB--dd\fR: \fB--loglevel verbose\fR +.IP \(bu 4 +\fB--verbose\fR: \fB--loglevel verbose\fR +.IP \(bu 4 +\fB-q\fR: \fB--loglevel warn\fR +.IP \(bu 4 +\fB--quiet\fR: \fB--loglevel warn\fR +.IP \(bu 4 +\fB-l\fR: \fB--long\fR +.IP \(bu 4 +\fB-m\fR: \fB--message\fR +.IP \(bu 4 +\fB--local\fR: \fB--no-global\fR +.IP \(bu 4 +\fB-n\fR: \fB--no-yes\fR +.IP \(bu 4 +\fB--no\fR: \fB--no-yes\fR +.IP \(bu 4 +\fB-p\fR: \fB--parseable\fR +.IP \(bu 4 +\fB--porcelain\fR: \fB--parseable\fR +.IP \(bu 4 +\fB-C\fR: \fB--prefix\fR +.IP \(bu 4 +\fB--readonly\fR: \fB--read-only\fR +.IP \(bu 4 +\fB--reg\fR: \fB--registry\fR +.IP \(bu 4 +\fB-S\fR: \fB--save\fR +.IP \(bu 4 +\fB-B\fR: \fB--save-bundle\fR +.IP \(bu 4 +\fB-D\fR: \fB--save-dev\fR +.IP \(bu 4 +\fB-E\fR: \fB--save-exact\fR +.IP \(bu 4 +\fB-O\fR: \fB--save-optional\fR +.IP \(bu 4 +\fB-P\fR: \fB--save-prod\fR +.IP \(bu 4 +\fB-?\fR: \fB--usage\fR +.IP \(bu 4 +\fB-h\fR: \fB--usage\fR +.IP \(bu 4 +\fB-H\fR: \fB--usage\fR +.IP \(bu 4 +\fB--help\fR: \fB--usage\fR +.IP \(bu 4 +\fB-v\fR: \fB--version\fR +.IP \(bu 4 +\fB-w\fR: \fB--workspace\fR +.IP \(bu 4 +\fB--ws\fR: \fB--workspaces\fR +.IP \(bu 4 +\fB-y\fR: \fB--yes\fR +.RE 0 + +.P +If the specified configuration param resolves unambiguously to a known configuration parameter, then it is expanded to that configuration parameter. For example: +.P +.RS 2 +.nf +npm ls --par +# same as: +npm ls --parseable +.fi +.RE +.P +If multiple single-character shorthands are strung together, and the resulting combination is unambiguously not some other configuration param, then it is expanded to its various component pieces. For example: +.P +.RS 2 +.nf +npm ls -gpld +# same as: +npm ls --global --parseable --long --loglevel info +.fi +.RE +.SS "Config Settings" +.SS "\fB_auth\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +A basic-auth string to use when authenticating against the npm registry. This will ONLY be used to authenticate against the npm registry. For other registries you will need to scope it like "//other-registry.tld/:_auth" +.P +Warning: This should generally not be set via a command-line option. It is safer to use a registry-provided authentication bearer token stored in the ~/.npmrc file by running \fBnpm login\fR. +.SS "\fBaccess\fR" +.RS 0 +.IP \(bu 4 +Default: 'public' for new packages, existing packages it will not change the current level +.IP \(bu 4 +Type: null, "restricted", or "public" +.RE 0 + +.P +If you do not want your scoped package to be publicly viewable (and installable) set \fB--access=restricted\fR. +.P +Unscoped packages cannot be set to \fBrestricted\fR. +.P +Note: This defaults to not changing the current access level for existing packages. Specifying a value of \fBrestricted\fR or \fBpublic\fR during publish will change the access for an existing package the same way that \fBnpm access set +status\fR would. +.SS "\fBall\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When running \fBnpm outdated\fR and \fBnpm ls\fR, setting \fB--all\fR will show all outdated or installed packages, rather than only those directly depended upon by the current project. +.SS "\fBallow-git\fR" +.RS 0 +.IP \(bu 4 +Default: "all" +.IP \(bu 4 +Type: "all", "none", or "root" +.RE 0 + +.P +Limits the ability for npm to fetch dependencies from git references. That is, dependencies that point to a git repo instead of a version or semver range. Please note that this could leave your tree incomplete and some packages may not function as intended or designed. +.P +\fBall\fR allows any git dependencies to be fetched and installed. \fBnone\fR prevents any git dependencies from being fetched and installed. \fBroot\fR only allows git dependencies defined in your project's package.json to be fetched installed. Also allows git dependencies to be fetched for other commands like \fBnpm view\fR +.SS "\fBallow-same-version\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Prevents throwing an error when \fBnpm version\fR is used to set the new version to the same value as the current version. +.SS "\fBaudit\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When "true" submit audit reports alongside the current npm command to the default registry and all registries configured for scopes. See the documentation for npm help audit for details on what is submitted. +.SS "\fBaudit-level\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null, "info", "low", "moderate", "high", "critical", or "none" +.RE 0 + +.P +The minimum level of vulnerability for \fBnpm audit\fR to exit with a non-zero exit code. +.SS "\fBauth-type\fR" +.RS 0 +.IP \(bu 4 +Default: "web" +.IP \(bu 4 +Type: "legacy" or "web" +.RE 0 + +.P +What authentication strategy to use with \fBlogin\fR. Note that if an \fBotp\fR config is given, this value will always be set to \fBlegacy\fR. +.SS "\fBbefore\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Date +.RE 0 + +.P +If passed to \fBnpm install\fR, will rebuild the npm tree such that only versions that were available \fBon or before\fR the given date are installed. If there are no versions available for the current set of dependencies, the command will error. +.P +If the requested version is a \fBdist-tag\fR and the given tag does not pass the \fB--before\fR filter, the most recent version less than or equal to that tag will be used. For example, \fBfoo@latest\fR might install \fBfoo@1.2\fR even though \fBlatest\fR is \fB2.0\fR. +.P +This config cannot be used with: \fBmin-release-age\fR +.SS "\fBbin-links\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Tells npm to create symlinks (or \fB.cmd\fR shims on Windows) for package executables. +.P +Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems. +.SS "\fBbrowser\fR" +.RS 0 +.IP \(bu 4 +Default: macOS: \fB"open"\fR, Windows: \fB"start"\fR, Others: \fB"xdg-open"\fR +.IP \(bu 4 +Type: null, Boolean, or String +.RE 0 + +.P +The browser that is called by npm commands to open websites. +.P +Set to \fBfalse\fR to suppress browser behavior and instead print urls to terminal. +.P +Set to \fBtrue\fR to use default system URL opener. +.SS "\fBbypass-2fa\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When creating a Granular Access Token with \fBnpm token create\fR, setting this to true will allow the token to bypass two-factor authentication. This is useful for automation and CI/CD workflows. +.SS "\fBca\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String (can be set multiple times) +.RE 0 + +.P +The Certificate Authority signing certificate that is trusted for SSL connections to the registry. Values should be in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string "\[rs]n". For example: +.P +.RS 2 +.nf +ca="-----BEGIN CERTIFICATE-----\[rs]nXXXX\[rs]nXXXX\[rs]n-----END CERTIFICATE-----" +.fi +.RE +.P +Set to \fBnull\fR to only allow "known" registrars, or to a specific CA cert to trust only that specific signing authority. +.P +Multiple CAs can be trusted by specifying an array of certificates: +.P +.RS 2 +.nf +ca\[lB]\[rB]="..." +ca\[lB]\[rB]="..." +.fi +.RE +.P +See also the \fBstrict-ssl\fR config. +.SS "\fBcache\fR" +.RS 0 +.IP \(bu 4 +Default: Windows: \fB%LocalAppData%\[rs]npm-cache\fR, Posix: \fB~/.npm\fR +.IP \(bu 4 +Type: Path +.RE 0 + +.P +The location of npm's cache directory. +.SS "\fBcafile\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: Path +.RE 0 + +.P +A path to a file containing one or multiple Certificate Authority signing certificates. Similar to the \fBca\fR setting, but allows for multiple CA's, as well as for the CA information to be stored in a file on disk. +.SS "\fBcall\fR" +.RS 0 +.IP \(bu 4 +Default: "" +.IP \(bu 4 +Type: String +.RE 0 + +.P +Optional companion option for \fBnpm exec\fR, \fBnpx\fR that allows for specifying a custom command to be run along with the installed packages. +.P +.RS 2 +.nf +npm exec --package yo --package generator-node --call "yo node" +.fi +.RE +.SS "\fBcidr\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String (can be set multiple times) +.RE 0 + +.P +This is a list of CIDR address to be used when configuring limited access tokens with the \fBnpm token create\fR command. +.SS "\fBcolor\fR" +.RS 0 +.IP \(bu 4 +Default: true unless the NO_COLOR environ is set to something other than '0' +.IP \(bu 4 +Type: "always" or Boolean +.RE 0 + +.P +If false, never shows colors. If \fB"always"\fR then always shows colors. If true, then only prints color codes for tty file descriptors. +.SS "\fBcommit-hooks\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Run git commit hooks when using the \fBnpm version\fR command. +.SS "\fBcpu\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +Override CPU architecture of native modules to install. Acceptable values are same as \fBcpu\fR field of package.json, which comes from \fBprocess.arch\fR. +.SS "\fBdepth\fR" +.RS 0 +.IP \(bu 4 +Default: \fBInfinity\fR if \fB--all\fR is set; otherwise, \fB0\fR +.IP \(bu 4 +Type: null or Number +.RE 0 + +.P +The depth to go when recursing packages for \fBnpm ls\fR. +.P +If not set, \fBnpm ls\fR will show only the immediate dependencies of the root project. If \fB--all\fR is set, then npm will show all dependencies by default. +.SS "\fBdescription\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Show the description in \fBnpm search\fR +.SS "\fBdiff\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Define arguments to compare in \fBnpm diff\fR. +.SS "\fBdiff-dst-prefix\fR" +.RS 0 +.IP \(bu 4 +Default: "b/" +.IP \(bu 4 +Type: String +.RE 0 + +.P +Destination prefix to be used in \fBnpm diff\fR output. +.SS "\fBdiff-ignore-all-space\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Ignore whitespace when comparing lines in \fBnpm diff\fR. +.SS "\fBdiff-name-only\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Prints only filenames when using \fBnpm diff\fR. +.SS "\fBdiff-no-prefix\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Do not show any source or destination prefix in \fBnpm diff\fR output. +.P +Note: this causes \fBnpm diff\fR to ignore the \fB--diff-src-prefix\fR and \fB--diff-dst-prefix\fR configs. +.SS "\fBdiff-src-prefix\fR" +.RS 0 +.IP \(bu 4 +Default: "a/" +.IP \(bu 4 +Type: String +.RE 0 + +.P +Source prefix to be used in \fBnpm diff\fR output. +.SS "\fBdiff-text\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Treat all files as text in \fBnpm diff\fR. +.SS "\fBdiff-unified\fR" +.RS 0 +.IP \(bu 4 +Default: 3 +.IP \(bu 4 +Type: Number +.RE 0 + +.P +The number of lines of context to print in \fBnpm diff\fR. +.SS "\fBdry-run\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR. +.P +Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc. +.SS "\fBeditor\fR" +.RS 0 +.IP \(bu 4 +Default: The EDITOR or VISUAL environment variables, or '%SYSTEMROOT%\[rs]notepad.exe' on Windows, or 'vi' on Unix systems +.IP \(bu 4 +Type: String +.RE 0 + +.P +The command to run for \fBnpm edit\fR and \fBnpm config edit\fR. +.SS "\fBengine-strict\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to true, then npm will stubbornly refuse to install (or even consider installing) any package that claims to not be compatible with the current Node.js version. +.P +This can be overridden by setting the \fB--force\fR flag. +.SS "\fBexpect-result-count\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Number +.RE 0 + +.P +Tells to expect a specific number of results from the command. +.P +This config cannot be used with: \fBexpect-results\fR +.SS "\fBexpect-results\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Tells npm whether or not to expect results from the command. Can be either true (expect some results) or false (expect no results). +.P +This config cannot be used with: \fBexpect-result-count\fR +.SS "\fBexpires\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Number +.RE 0 + +.P +When creating a Granular Access Token with \fBnpm token create\fR, this sets the expiration in days. If not specified, the server will determine the default expiration. +.SS "\fBfetch-retries\fR" +.RS 0 +.IP \(bu 4 +Default: 2 +.IP \(bu 4 +Type: Number +.RE 0 + +.P +The "retries" config for the \fBretry\fR module to use when fetching packages from the registry. +.P +npm will retry idempotent read requests to the registry in the case of network failures or 5xx HTTP errors. +.SS "\fBfetch-retry-factor\fR" +.RS 0 +.IP \(bu 4 +Default: 10 +.IP \(bu 4 +Type: Number +.RE 0 + +.P +The "factor" config for the \fBretry\fR module to use when fetching packages. +.SS "\fBfetch-retry-maxtimeout\fR" +.RS 0 +.IP \(bu 4 +Default: 60000 (1 minute) +.IP \(bu 4 +Type: Number +.RE 0 + +.P +The "maxTimeout" config for the \fBretry\fR module to use when fetching packages. +.SS "\fBfetch-retry-mintimeout\fR" +.RS 0 +.IP \(bu 4 +Default: 10000 (10 seconds) +.IP \(bu 4 +Type: Number +.RE 0 + +.P +The "minTimeout" config for the \fBretry\fR module to use when fetching packages. +.SS "\fBfetch-timeout\fR" +.RS 0 +.IP \(bu 4 +Default: 300000 (5 minutes) +.IP \(bu 4 +Type: Number +.RE 0 + +.P +The maximum amount of time to wait for HTTP requests to complete. +.SS "\fBforce\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Removes various protections against unfortunate side effects, common mistakes, unnecessary performance degradation, and malicious input. +.RS 0 +.IP \(bu 4 +Allow clobbering non-npm files in global installs. +.IP \(bu 4 +Allow the \fBnpm version\fR command to work on an unclean git repository. +.IP \(bu 4 +Allow deleting the cache folder with \fBnpm cache clean\fR. +.IP \(bu 4 +Allow installing packages that have an \fBengines\fR declaration requiring a different version of npm. +.IP \(bu 4 +Allow installing packages that have an \fBengines\fR declaration requiring a different version of \fBnode\fR, even if \fB--engine-strict\fR is enabled. +.IP \(bu 4 +Allow \fBnpm audit fix\fR to install modules outside your stated dependency range (including SemVer-major changes). +.IP \(bu 4 +Allow unpublishing all versions of a published package. +.IP \(bu 4 +Allow conflicting peerDependencies to be installed in the root project. +.IP \(bu 4 +Implicitly set \fB--yes\fR during \fBnpm init\fR. +.IP \(bu 4 +Allow clobbering existing values in \fBnpm pkg\fR +.IP \(bu 4 +Allow unpublishing of entire packages (not just a single version). +.RE 0 + +.P +If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! +.SS "\fBforeground-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: \fBfalse\fR unless when using \fBnpm pack\fR or \fBnpm publish\fR where it defaults to \fBtrue\fR +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Run all build scripts (ie, \fBpreinstall\fR, \fBinstall\fR, and \fBpostinstall\fR) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process. +.P +Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. +.SS "\fBformat-package-lock\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Format \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR as a human readable file. +.SS "\fBfund\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When "true" displays the message at the end of each \fBnpm install\fR acknowledging the number of dependencies looking for funding. See npm help fund for details. +.SS "\fBgit\fR" +.RS 0 +.IP \(bu 4 +Default: "git" +.IP \(bu 4 +Type: String +.RE 0 + +.P +The command to use for git commands. If git is installed on the computer, but is not in the \fBPATH\fR, then set this to the full path to the git binary. +.SS "\fBgit-tag-version\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Tag the commit when using the \fBnpm version\fR command. Setting this to false results in no commit being made at all. +.SS "\fBglobal\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "\fBglobalconfig\fR" +.RS 0 +.IP \(bu 4 +Default: The global --prefix setting plus 'etc/npmrc'. For example, '/usr/local/etc/npmrc' +.IP \(bu 4 +Type: Path +.RE 0 + +.P +The config file to read for global config options. +.SS "\fBheading\fR" +.RS 0 +.IP \(bu 4 +Default: "npm" +.IP \(bu 4 +Type: String +.RE 0 + +.P +The string that starts all the debugging log output. +.SS "\fBhttps-proxy\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or URL +.RE 0 + +.P +A proxy to use for outgoing https requests. If the \fBHTTPS_PROXY\fR or \fBhttps_proxy\fR or \fBHTTP_PROXY\fR or \fBhttp_proxy\fR environment variables are set, proxy settings will be honored by the underlying \fBmake-fetch-happen\fR library. +.SS "\fBif-present\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm will not exit with an error code when \fBrun\fR is invoked for a script that isn't defined in the \fBscripts\fR section of \fBpackage.json\fR. This option can be used when it's desirable to optionally run a script when it's present and fail if the script fails. This is useful, for example, when running scripts that may only apply for some builds in an otherwise generic CI setup. +.P +This value is not exported to the environment for child processes. +.SS "\fBignore-scripts\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, npm does not run scripts specified in package.json files. +.P +Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts. +.SS "\fBinclude\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: "prod", "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Option that allows for defining which types of dependencies to install. +.P +This is the inverse of \fB--omit=\fR. +.P +Dependency types specified in \fB--include\fR will not be omitted, regardless of the order in which omit/include are specified on the command-line. +.SS "\fBinclude-attestations\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When used with \fBnpm audit signatures --json\fR, includes the full sigstore attestation bundles in the JSON output for each verified package. The bundles contain DSSE envelopes, verification material, and transparency log entries. +.SS "\fBinclude-staged\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Allow installing "staged" published packages, as defined by \fBnpm RFC PR #92\fR \fI\(lahttps://github.com/npm/rfcs/pull/92\(ra\fR. +.P +This is experimental, and not implemented by the npm public registry. +.SS "\fBinclude-workspace-root\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Include the workspace root when workspaces are enabled for a command. +.P +When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project. +.P +This value is not exported to the environment for child processes. +.SS "\fBinit-author-email\fR" +.RS 0 +.IP \(bu 4 +Default: "" +.IP \(bu 4 +Type: String +.RE 0 + +.P +The value \fBnpm init\fR should use by default for the package author's email. +.SS "\fBinit-author-name\fR" +.RS 0 +.IP \(bu 4 +Default: "" +.IP \(bu 4 +Type: String +.RE 0 + +.P +The value \fBnpm init\fR should use by default for the package author's name. +.SS "\fBinit-author-url\fR" +.RS 0 +.IP \(bu 4 +Default: "" +.IP \(bu 4 +Type: "" or URL +.RE 0 + +.P +The value \fBnpm init\fR should use by default for the package author's homepage. +.SS "\fBinit-license\fR" +.RS 0 +.IP \(bu 4 +Default: "ISC" +.IP \(bu 4 +Type: String +.RE 0 + +.P +The value \fBnpm init\fR should use by default for the package license. +.SS "\fBinit-module\fR" +.RS 0 +.IP \(bu 4 +Default: "~/.npm-init.js" +.IP \(bu 4 +Type: Path +.RE 0 + +.P +A module that will be loaded by the \fBnpm init\fR command. See the documentation for the \fBinit-package-json\fR \fI\(lahttps://github.com/npm/init-package-json\(ra\fR module for more information, or npm help init. +.SS "\fBinit-private\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +The value \fBnpm init\fR should use by default for the package's private flag. +.SS "\fBinit-type\fR" +.RS 0 +.IP \(bu 4 +Default: "commonjs" +.IP \(bu 4 +Type: String +.RE 0 + +.P +The value that \fBnpm init\fR should use by default for the package.json type field. +.SS "\fBinit-version\fR" +.RS 0 +.IP \(bu 4 +Default: "1.0.0" +.IP \(bu 4 +Type: SemVer string +.RE 0 + +.P +The value that \fBnpm init\fR should use by default for the package version number, if not already set in package.json. +.SS "\fBinstall-links\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces. +.SS "\fBinstall-strategy\fR" +.RS 0 +.IP \(bu 4 +Default: "hoisted" +.IP \(bu 4 +Type: "hoisted", "nested", "shallow", or "linked" +.RE 0 + +.P +Sets the strategy for installing packages in node_modules. hoisted (default): Install non-duplicated in top-level, and duplicated as necessary within directory structure. nested: (formerly --legacy-bundling) install in place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. +.SS "\fBjson\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to output JSON data, rather than the normal output. +.RS 0 +.IP \(bu 4 +In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR. +.RE 0 + +.P +Not supported by all npm commands. +.SS "\fBlegacy-peer-deps\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Causes npm to completely ignore \fBpeerDependencies\fR when building a package tree, as in npm versions 3 through 6. +.P +If a package cannot be installed because of overly strict \fBpeerDependencies\fR that collide, it provides a way to move forward resolving the situation. +.P +This differs from \fB--omit=peer\fR, in that \fB--omit=peer\fR will avoid unpacking \fBpeerDependencies\fR on disk, but will still design a tree such that \fBpeerDependencies\fR \fIcould\fR be unpacked in a correct place. +.P +Use of \fBlegacy-peer-deps\fR is not recommended, as it will not enforce the \fBpeerDependencies\fR contract that meta-dependencies may rely on. +.SS "\fBlibc\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +Override libc of native modules to install. Acceptable values are same as \fBlibc\fR field of package.json +.SS "\fBlink\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Used with \fBnpm ls\fR, limiting output to only those packages that are linked. +.SS "\fBlocal-address\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: IP Address +.RE 0 + +.P +The IP address of the local interface to use when making connections to the npm registry. Must be IPv4 in versions of Node prior to 0.12. +.SS "\fBlocation\fR" +.RS 0 +.IP \(bu 4 +Default: "user" unless \fB--global\fR is passed, which will also set this value to "global" +.IP \(bu 4 +Type: "global", "user", or "project" +.RE 0 + +.P +When passed to \fBnpm config\fR this refers to which config file to use. +.P +When set to "global" mode, packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior. +.RS 0 +.IP \(bu 4 +packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory. +.IP \(bu 4 +bin files are linked to \fB{prefix}/bin\fR +.IP \(bu 4 +man pages are linked to \fB{prefix}/share/man\fR +.RE 0 + +.SS "\fBlockfile-version\fR" +.RS 0 +.IP \(bu 4 +Default: Version 3 if no lockfile, auto-converting v1 lockfiles to v3; otherwise, maintain current lockfile version. +.IP \(bu 4 +Type: null, 1, 2, 3, "1", "2", or "3" +.RE 0 + +.P +Set the lockfile format version to be used in package-lock.json and npm-shrinkwrap-json files. Possible options are: +.P +1: The lockfile version used by npm versions 5 and 6. Lacks some data that is used during the install, resulting in slower and possibly less deterministic installs. Prevents lockfile churn when interoperating with older npm versions. +.P +2: The default lockfile version used by npm version 7 and 8. Includes both the version 1 lockfile data and version 3 lockfile data, for maximum determinism and interoperability, at the expense of more bytes on disk. +.P +3: Only the new lockfile information introduced in npm version 7. Smaller on disk than lockfile version 2, but not interoperable with older npm versions. Ideal if all users are on npm version 7 and higher. +.SS "\fBloglevel\fR" +.RS 0 +.IP \(bu 4 +Default: "notice" +.IP \(bu 4 +Type: "silent", "error", "warn", "notice", "http", "info", "verbose", or "silly" +.RE 0 + +.P +What level of logs to report. All logs are written to a debug log, with the path to that file printed if the execution of a command fails. +.P +Any logs of a higher level than the setting are shown. The default is "notice". +.P +See also the \fBforeground-scripts\fR config. +.SS "\fBlogs-dir\fR" +.RS 0 +.IP \(bu 4 +Default: A directory named \fB_logs\fR inside the cache +.IP \(bu 4 +Type: null or Path +.RE 0 + +.P +The location of npm's log directory. See npm help logging for more information. +.SS "\fBlogs-max\fR" +.RS 0 +.IP \(bu 4 +Default: 10 +.IP \(bu 4 +Type: Number +.RE 0 + +.P +The maximum number of log files to store. +.P +If set to 0, no log files will be written for the current run. +.SS "\fBlong\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Show extended information in \fBls\fR, \fBsearch\fR, and \fBhelp-search\fR. +.SS "\fBmaxsockets\fR" +.RS 0 +.IP \(bu 4 +Default: 15 +.IP \(bu 4 +Type: Number +.RE 0 + +.P +The maximum number of connections to use per origin (protocol/host/port combination). +.SS "\fBmessage\fR" +.RS 0 +.IP \(bu 4 +Default: "%s" +.IP \(bu 4 +Type: String +.RE 0 + +.P +Commit message which is used by \fBnpm version\fR when creating version commit. +.P +Any "%s" in the message will be replaced with the version number. +.SS "\fBmin-release-age\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Number +.RE 0 + +.P +If set, npm will build the npm tree such that only versions that were available more than the given number of days ago will be installed. If there are no versions available for the current set of dependencies, the command will error. +.P +This flag is a complement to \fBbefore\fR, which accepts an exact date instead of a relative number of days. +.P +This config cannot be used with: \fBbefore\fR +.P +This value is not exported to the environment for child processes. +.SS "\fBname\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +When creating a Granular Access Token with \fBnpm token create\fR, this sets the name/description for the token. +.SS "\fBnode-gyp\fR" +.RS 0 +.IP \(bu 4 +Default: The path to the node-gyp bin that ships with npm +.IP \(bu 4 +Type: Path +.RE 0 + +.P +This is the location of the "node-gyp" bin. By default it uses one that ships with npm itself. +.P +You can use this config to specify your own "node-gyp" to run when it is required to build a package. +.SS "\fBnode-options\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +Options to pass through to Node.js via the \fBNODE_OPTIONS\fR environment variable. This does not impact how npm itself is executed but it does impact how lifecycle scripts are called. +.SS "\fBnoproxy\fR" +.RS 0 +.IP \(bu 4 +Default: The value of the NO_PROXY environment variable +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Domain extensions that should bypass any proxies. +.P +Also accepts a comma-delimited string. +.SS "\fBoffline\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Force offline mode: no network requests will be done during install. To allow the CLI to fill in missing cache data, see \fB--prefer-offline\fR. +.SS "\fBomit\fR" +.RS 0 +.IP \(bu 4 +Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production'; otherwise, empty. +.IP \(bu 4 +Type: "dev", "optional", or "peer" (can be set multiple times) +.RE 0 + +.P +Dependency types to omit from the installation tree on disk. +.P +Note that these dependencies \fIare\fR still resolved and added to the \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR file. They are just not physically installed on disk. +.P +If a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included. +.P +If the resulting omit list includes \fB'dev'\fR, then the \fBNODE_ENV\fR environment variable will be set to \fB'production'\fR for all lifecycle scripts. +.SS "\fBomit-lockfile-registry-resolved\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +This option causes npm to create lock files without a \fBresolved\fR key for registry dependencies. Subsequent installs will need to resolve tarball endpoints with the configured registry, likely resulting in a longer install time. +.SS "\fBorgs\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String (can be set multiple times) +.RE 0 + +.P +When creating a Granular Access Token with \fBnpm token create\fR, this limits the token access to specific organizations. +.SS "\fBorgs-permission\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null, "read-only", "read-write", or "no-access" +.RE 0 + +.P +When creating a Granular Access Token with \fBnpm token create\fR, sets the permission level for organizations. Options are "read-only", "read-write", or "no-access". +.SS "\fBos\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +Override OS of native modules to install. Acceptable values are same as \fBos\fR field of package.json, which comes from \fBprocess.platform\fR. +.SS "\fBotp\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with \fBnpm access\fR. +.P +If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. +.SS "\fBpack-destination\fR" +.RS 0 +.IP \(bu 4 +Default: "." +.IP \(bu 4 +Type: String +.RE 0 + +.P +Directory in which \fBnpm pack\fR will save tarballs. +.SS "\fBpackage\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +The package or packages to install for npm help exec +.SS "\fBpackage-lock\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to false, then ignore \fBpackage-lock.json\fR files when installing. This will also prevent \fIwriting\fR \fBpackage-lock.json\fR if \fBsave\fR is true. +.SS "\fBpackage-lock-only\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to true, the current operation will only use the \fBpackage-lock.json\fR, ignoring \fBnode_modules\fR. +.P +For \fBupdate\fR this means only the \fBpackage-lock.json\fR will be updated, instead of checking \fBnode_modules\fR and downloading dependencies. +.P +For \fBlist\fR this means the output will be based on the tree described by the \fBpackage-lock.json\fR, rather than the contents of \fBnode_modules\fR. +.SS "\fBpackages\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: null or String (can be set multiple times) +.RE 0 + +.P +When creating a Granular Access Token with \fBnpm token create\fR, this limits the token access to specific packages. +.SS "\fBpackages-all\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When creating a Granular Access Token with \fBnpm token create\fR, grants the token access to all packages instead of limiting to specific packages. +.SS "\fBpackages-and-scopes-permission\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null, "read-only", "read-write", or "no-access" +.RE 0 + +.P +When creating a Granular Access Token with \fBnpm token create\fR, sets the permission level for packages and scopes. Options are "read-only", "read-write", or "no-access". +.SS "\fBparseable\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Output parseable results from commands that write to standard output. For \fBnpm search\fR, this will be tab-separated table format. +.SS "\fBpassword\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +Password for authentication. Can be provided via command line when creating tokens, though it's generally safer to be prompted for it. +.SS "\fBprefer-dedupe\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Prefer to deduplicate packages if possible, rather than choosing a newer version of a dependency. +.SS "\fBprefer-offline\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, staleness checks for cached data will be bypassed, but missing data will be requested from the server. To force full offline mode, use \fB--offline\fR. +.SS "\fBprefer-online\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, staleness checks for cached data will be forced, making the CLI look for updates immediately even for fresh package data. +.SS "\fBprefix\fR" +.RS 0 +.IP \(bu 4 +Default: In global mode, the folder where the node executable is installed. Otherwise, the nearest parent folder containing either a package.json file or a node_modules folder. +.IP \(bu 4 +Type: Path +.RE 0 + +.P +The location to install global items. If set on the command line, then it forces non-global commands to run in the specified folder. +.SS "\fBpreid\fR" +.RS 0 +.IP \(bu 4 +Default: "" +.IP \(bu 4 +Type: String +.RE 0 + +.P +The "prerelease identifier" to use as a prefix for the "prerelease" part of a semver. Like the \fBrc\fR in \fB1.2.0-rc.8\fR. +.SS "\fBprogress\fR" +.RS 0 +.IP \(bu 4 +Default: \fBtrue\fR when not in CI and both stderr and stdout are TTYs and not in a dumb terminal +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set to \fBtrue\fR, npm will display a progress bar during time intensive operations, if \fBprocess.stderr\fR and \fBprocess.stdout\fR are a TTY. +.P +Set to \fBfalse\fR to suppress the progress bar. +.SS "\fBprovenance\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When publishing from a supported cloud CI/CD system, the package will be publicly linked to where it was built and published from. +.P +This config cannot be used with: \fBprovenance-file\fR +.SS "\fBprovenance-file\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: Path +.RE 0 + +.P +When publishing, the provenance bundle at the given path will be used. +.P +This config cannot be used with: \fBprovenance\fR +.SS "\fBproxy\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null, false, or URL +.RE 0 + +.P +A proxy to use for outgoing http requests. If the \fBHTTP_PROXY\fR or \fBhttp_proxy\fR environment variables are set, proxy settings will be honored by the underlying \fBrequest\fR library. +.SS "\fBread-only\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +This is used to mark a token as unable to publish when configuring limited access tokens with the \fBnpm token create\fR command. +.SS "\fBrebuild-bundle\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Rebuild bundled dependencies after installation. +.SS "\fBregistry\fR" +.RS 0 +.IP \(bu 4 +Default: "https://registry.npmjs.org/" +.IP \(bu 4 +Type: URL +.RE 0 + +.P +The base URL of the npm registry. +.SS "\fBreplace-registry-host\fR" +.RS 0 +.IP \(bu 4 +Default: "npmjs" +.IP \(bu 4 +Type: "npmjs", "never", "always", or String +.RE 0 + +.P +Defines behavior for replacing the registry host in a lockfile with the configured registry. +.P +The default behavior is to replace package dist URLs from the default registry (https://registry.npmjs.org) to the configured registry. If set to "never", then use the registry value. If set to "always", then replace the registry host with the configured host every time. +.P +You may also specify a bare hostname (e.g., "registry.npmjs.org"). +.SS "\fBsave\fR" +.RS 0 +.IP \(bu 4 +Default: \fBtrue\fR unless when using \fBnpm update\fR where it defaults to \fBfalse\fR +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Save installed packages to a \fBpackage.json\fR file as dependencies. +.P +When used with the \fBnpm rm\fR command, removes the dependency from \fBpackage.json\fR. +.P +Will also prevent writing to \fBpackage-lock.json\fR if set to \fBfalse\fR. +.SS "\fBsave-bundle\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If a package would be saved at install time by the use of \fB--save\fR, \fB--save-dev\fR, or \fB--save-optional\fR, then also put it in the \fBbundleDependencies\fR list. +.P +Ignored if \fB--save-peer\fR is set, since peerDependencies cannot be bundled. +.SS "\fBsave-dev\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Save installed packages to a package.json file as \fBdevDependencies\fR. +.P +This config cannot be used with: \fBsave-optional\fR, \fBsave-peer\fR, \fBsave-prod\fR +.SS "\fBsave-exact\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Dependencies saved to package.json will be configured with an exact version rather than using npm's default semver range operator. +.SS "\fBsave-optional\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Save installed packages to a package.json file as \fBoptionalDependencies\fR. +.P +This config cannot be used with: \fBsave-dev\fR, \fBsave-peer\fR, \fBsave-prod\fR +.SS "\fBsave-peer\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Save installed packages to a package.json file as \fBpeerDependencies\fR +.P +This config cannot be used with: \fBsave-dev\fR, \fBsave-optional\fR, \fBsave-prod\fR +.SS "\fBsave-prefix\fR" +.RS 0 +.IP \(bu 4 +Default: "^" +.IP \(bu 4 +Type: String +.RE 0 + +.P +Configure how versions of packages installed to a package.json file via \fB--save\fR or \fB--save-dev\fR get prefixed. +.P +For example if a package has version \fB1.2.3\fR, by default its version is set to \fB^1.2.3\fR which allows minor upgrades for that package, but after \fBnpm +config set save-prefix='~'\fR it would be set to \fB~1.2.3\fR which only allows patch upgrades. +.SS "\fBsave-prod\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Save installed packages into \fBdependencies\fR specifically. This is useful if a package already exists in \fBdevDependencies\fR or \fBoptionalDependencies\fR, but you want to move it to be a non-optional production dependency. +.P +This is the default behavior if \fB--save\fR is true, and neither \fB--save-dev\fR or \fB--save-optional\fR are true. +.P +This config cannot be used with: \fBsave-dev\fR, \fBsave-optional\fR, \fBsave-peer\fR +.SS "\fBsbom-format\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: "cyclonedx" or "spdx" +.RE 0 + +.P +SBOM format to use when generating SBOMs. +.SS "\fBsbom-type\fR" +.RS 0 +.IP \(bu 4 +Default: "library" +.IP \(bu 4 +Type: "library", "application", or "framework" +.RE 0 + +.P +The type of package described by the generated SBOM. For SPDX, this is the value for the \fBprimaryPackagePurpose\fR field. For CycloneDX, this is the value for the \fBtype\fR field. +.SS "\fBscope\fR" +.RS 0 +.IP \(bu 4 +Default: the scope of the current project, if any, or "" +.IP \(bu 4 +Type: String +.RE 0 + +.P +Associate an operation with a scope for a scoped registry. +.P +Useful when logging in to or out of a private registry: +.P +.RS 2 +.nf +# log in, linking the scope to the custom registry +npm login --scope=@mycorp --registry=https://registry.mycorp.com + +# log out, removing the link and the auth token +npm logout --scope=@mycorp +.fi +.RE +.P +This will cause \fB@mycorp\fR to be mapped to the registry for future installation of packages specified according to the pattern \fB@mycorp/package\fR. +.P +This will also cause \fBnpm init\fR to create a scoped package. +.P +.RS 2 +.nf +# accept all defaults, and create a package named "@foo/whatever", +# instead of just named "whatever" +npm init --scope=@foo --yes +.fi +.RE +.SS "\fBscopes\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String (can be set multiple times) +.RE 0 + +.P +When creating a Granular Access Token with \fBnpm token create\fR, this limits the token access to specific scopes. Provide a scope name (with or without @ prefix). +.SS "\fBscript-shell\fR" +.RS 0 +.IP \(bu 4 +Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +The shell to use for scripts run with the \fBnpm exec\fR, \fBnpm run\fR and \fBnpm +init \fR commands. +.SS "\fBsearchexclude\fR" +.RS 0 +.IP \(bu 4 +Default: "" +.IP \(bu 4 +Type: String +.RE 0 + +.P +Space-separated options that limit the results from search. +.SS "\fBsearchlimit\fR" +.RS 0 +.IP \(bu 4 +Default: 20 +.IP \(bu 4 +Type: Number +.RE 0 + +.P +Number of items to limit search results to. Will not apply at all to legacy searches. +.SS "\fBsearchopts\fR" +.RS 0 +.IP \(bu 4 +Default: "" +.IP \(bu 4 +Type: String +.RE 0 + +.P +Space-separated options that are always passed to search. +.SS "\fBsearchstaleness\fR" +.RS 0 +.IP \(bu 4 +Default: 900 +.IP \(bu 4 +Type: Number +.RE 0 + +.P +The age of the cache, in seconds, before another registry request is made if using legacy search endpoint. +.SS "\fBshell\fR" +.RS 0 +.IP \(bu 4 +Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on Windows +.IP \(bu 4 +Type: String +.RE 0 + +.P +The shell to run for the \fBnpm explore\fR command. +.SS "\fBsign-git-commit\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to true, then the \fBnpm version\fR command will commit the new package version using \fB-S\fR to add a signature. +.P +Note that git requires you to have set up GPG keys in your git configs for this to work properly. +.SS "\fBsign-git-tag\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to true, then the \fBnpm version\fR command will tag the version using \fB-s\fR to add a signature. +.P +Note that git requires you to have set up GPG keys in your git configs for this to work properly. +.SS "\fBstrict-peer-deps\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to \fBtrue\fR, and \fB--legacy-peer-deps\fR is not set, then \fIany\fR conflicting \fBpeerDependencies\fR will be treated as an install failure, even if npm could reasonably guess the appropriate resolution based on non-peer dependency relationships. +.P +By default, conflicting \fBpeerDependencies\fR deep in the dependency graph will be resolved using the nearest non-peer dependency specification, even if doing so will result in some packages receiving a peer dependency outside the range set in their package's \fBpeerDependencies\fR object. +.P +When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If \fB--strict-peer-deps\fR is set, then this warning is treated as a failure. +.SS "\fBstrict-ssl\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Whether or not to do SSL key validation when making requests to the registry via https. +.P +See also the \fBca\fR config. +.SS "\fBtag\fR" +.RS 0 +.IP \(bu 4 +Default: "latest" +.IP \(bu 4 +Type: String +.RE 0 + +.P +If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag. +.P +It is the tag added to the package@version specified in the \fBnpm dist-tag +add\fR command, if no explicit tag is given. +.P +When used by the \fBnpm diff\fR command, this is the tag used to fetch the tarball that will be compared with the local files by default. +.P +If used in the \fBnpm publish\fR command, this is the tag that will be added to the package submitted to the registry. +.SS "\fBtag-version-prefix\fR" +.RS 0 +.IP \(bu 4 +Default: "v" +.IP \(bu 4 +Type: String +.RE 0 + +.P +If set, alters the prefix used when tagging a new version when performing a version increment using \fBnpm version\fR. To remove the prefix altogether, set it to the empty string: \fB""\fR. +.P +Because other tools may rely on the convention that npm version tags look like \fBv1.0.0\fR, \fIonly use this property if it is absolutely necessary\fR. In particular, use care when overriding this setting for public packages. +.SS "\fBtiming\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, writes timing information to a process specific json file in the cache or \fBlogs-dir\fR. The file name ends with \fB-timing.json\fR. +.P +You can quickly view it with this \fBjson\fR \fI\(lahttps://npm.im/json\(ra\fR command line: \fBcat ~/.npm/_logs/*-timing.json | npm exec -- json -g\fR. +.P +Timing information will also be reported in the terminal. To suppress this while still writing the timing file, use \fB--silent\fR. +.SS "\fBtoken-description\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.RE 0 + +.P +Description text for the token when using \fBnpm token create\fR. +.SS "\fBumask\fR" +.RS 0 +.IP \(bu 4 +Default: 0 +.IP \(bu 4 +Type: Octal numeric string in range 0000..0777 (0..511) +.RE 0 + +.P +The "umask" value to use when setting the file creation mode on files and folders. +.P +Folders and executables are given a mode which is \fB0o777\fR masked against this value. Other files are given a mode which is \fB0o666\fR masked against this value. +.P +Note that the underlying system will \fIalso\fR apply its own umask value to files and folders that are created, and npm does not circumvent this, but rather adds the \fB--umask\fR config to it. +.P +Thus, the effective default umask value on most POSIX systems is 0o22, meaning that folders and executables are created with a mode of 0o755 and other files are created with a mode of 0o644. +.SS "\fBunicode\fR" +.RS 0 +.IP \(bu 4 +Default: false on windows, true on mac/unix systems with a unicode locale, as defined by the \fBLC_ALL\fR, \fBLC_CTYPE\fR, or \fBLANG\fR environment variables. +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +When set to true, npm uses unicode characters in the tree output. When false, it uses ascii characters instead of unicode glyphs. +.SS "\fBupdate-notifier\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Set to false to suppress the update notification when using an older version of npm than the latest. +.SS "\fBusage\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +Show short usage output about the command specified. +.SS "\fBuser-agent\fR" +.RS 0 +.IP \(bu 4 +Default: "npm/{npm-version} node/{node-version} {platform} {arch} workspaces/{workspaces} {ci}" +.IP \(bu 4 +Type: String +.RE 0 + +.P +Sets the User-Agent request header. The following fields are replaced with their actual counterparts: +.RS 0 +.IP \(bu 4 +\fB{npm-version}\fR - The npm version in use +.IP \(bu 4 +\fB{node-version}\fR - The Node.js version in use +.IP \(bu 4 +\fB{platform}\fR - The value of \fBprocess.platform\fR +.IP \(bu 4 +\fB{arch}\fR - The value of \fBprocess.arch\fR +.IP \(bu 4 +\fB{workspaces}\fR - Set to \fBtrue\fR if the \fBworkspaces\fR or \fBworkspace\fR options are set. +.IP \(bu 4 +\fB{ci}\fR - The value of the \fBci-name\fR config, if set, prefixed with \fBci/\fR, or an empty string if \fBci-name\fR is empty. +.RE 0 + +.SS "\fBuserconfig\fR" +.RS 0 +.IP \(bu 4 +Default: "~/.npmrc" +.IP \(bu 4 +Type: Path +.RE 0 + +.P +The location of user-level configuration settings. +.P +This may be overridden by the \fBnpm_config_userconfig\fR environment variable or the \fB--userconfig\fR command line option, but may \fInot\fR be overridden by settings in the \fBglobalconfig\fR file. +.SS "\fBversion\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, output the npm version and exit successfully. +.P +Only relevant when specified explicitly on the command line. +.SS "\fBversions\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If true, output the npm version as well as node's \fBprocess.versions\fR map and the version in the current working directory's \fBpackage.json\fR file if one exists, and exit successfully. +.P +Only relevant when specified explicitly on the command line. +.SS "\fBviewer\fR" +.RS 0 +.IP \(bu 4 +Default: "man" on Posix, "browser" on Windows +.IP \(bu 4 +Type: String +.RE 0 + +.P +The program to use to view help content. +.P +Set to \fB"browser"\fR to view html help content in the default web browser. +.SS "\fBwhich\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Number +.RE 0 + +.P +If there are multiple funding sources, which 1-indexed source URL to open. +.SS "\fBworkspace\fR" +.RS 0 +.IP \(bu 4 +Default: +.IP \(bu 4 +Type: String (can be set multiple times) +.RE 0 + +.P +Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option. +.P +Valid values for the \fBworkspace\fR config are either: +.RS 0 +.IP \(bu 4 +Workspace names +.IP \(bu 4 +Path to a workspace directory +.IP \(bu 4 +Path to a parent workspace directory (will result in selecting all workspaces within that folder) +.RE 0 + +.P +When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Set to true to run the command in the context of \fBall\fR configured workspaces. +.P +Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly: +.RS 0 +.IP \(bu 4 +Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config. +.RE 0 + +.P +This value is not exported to the environment for child processes. +.SS "\fBworkspaces-update\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.RE 0 + +.P +If set to true, the npm cli will run an update after operations that may possibly change the workspaces installed to the \fBnode_modules\fR folder. +.SS "\fByes\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.RE 0 + +.P +Automatically answer "yes" to any prompts that npm might print on the command line. +.SS "\fBalso\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null, "dev", or "development" +.IP \(bu 4 +DEPRECATED: Please use --include=dev instead. +.RE 0 + +.P +When set to \fBdev\fR or \fBdevelopment\fR, this is an alias for \fB--include=dev\fR. +.SS "\fBcache-max\fR" +.RS 0 +.IP \(bu 4 +Default: Infinity +.IP \(bu 4 +Type: Number +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--prefer-online\fR +.RE 0 + +.P +\fB--cache-max=0\fR is an alias for \fB--prefer-online\fR +.SS "\fBcache-min\fR" +.RS 0 +.IP \(bu 4 +Default: 0 +.IP \(bu 4 +Type: Number +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--prefer-offline\fR. +.RE 0 + +.P +\fB--cache-min=9999 (or bigger)\fR is an alias for \fB--prefer-offline\fR. +.SS "\fBcert\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.IP \(bu 4 +DEPRECATED: \fBkey\fR and \fBcert\fR are no longer used for most registry operations. Use registry scoped \fBkeyfile\fR and \fBcertfile\fR instead. Example: //other-registry.tld/:keyfile=/path/to/key.pem //other-registry.tld/:certfile=/path/to/cert.crt +.RE 0 + +.P +A client certificate to pass when accessing the registry. Values should be in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string "\[rs]n". For example: +.P +.RS 2 +.nf +cert="-----BEGIN CERTIFICATE-----\[rs]nXXXX\[rs]nXXXX\[rs]n-----END CERTIFICATE-----" +.fi +.RE +.P +It is \fInot\fR the path to a certificate file, though you can set a registry-scoped "certfile" path like "//other-registry.tld/:certfile=/path/to/cert.pem". +.SS "\fBdev\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: Please use --include=dev instead. +.RE 0 + +.P +Alias for \fB--include=dev\fR. +.SS "\fBglobal-style\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=shallow\fR +.RE 0 + +.P +Only install direct dependencies in the top level \fBnode_modules\fR, but hoist on deeper dependencies. Sets \fB--install-strategy=shallow\fR. +.SS "\fBinit.author.email\fR" +.RS 0 +.IP \(bu 4 +Default: "" +.IP \(bu 4 +Type: String +.IP \(bu 4 +DEPRECATED: Use \fB--init-author-email\fR instead. +.RE 0 + +.P +Alias for \fB--init-author-email\fR +.SS "\fBinit.author.name\fR" +.RS 0 +.IP \(bu 4 +Default: "" +.IP \(bu 4 +Type: String +.IP \(bu 4 +DEPRECATED: Use \fB--init-author-name\fR instead. +.RE 0 + +.P +Alias for \fB--init-author-name\fR +.SS "\fBinit.author.url\fR" +.RS 0 +.IP \(bu 4 +Default: "" +.IP \(bu 4 +Type: "" or URL +.IP \(bu 4 +DEPRECATED: Use \fB--init-author-url\fR instead. +.RE 0 + +.P +Alias for \fB--init-author-url\fR +.SS "\fBinit.license\fR" +.RS 0 +.IP \(bu 4 +Default: "ISC" +.IP \(bu 4 +Type: String +.IP \(bu 4 +DEPRECATED: Use \fB--init-license\fR instead. +.RE 0 + +.P +Alias for \fB--init-license\fR +.SS "\fBinit.module\fR" +.RS 0 +.IP \(bu 4 +Default: "~/.npm-init.js" +.IP \(bu 4 +Type: Path +.IP \(bu 4 +DEPRECATED: Use \fB--init-module\fR instead. +.RE 0 + +.P +Alias for \fB--init-module\fR +.SS "\fBinit.version\fR" +.RS 0 +.IP \(bu 4 +Default: "1.0.0" +.IP \(bu 4 +Type: SemVer string +.IP \(bu 4 +DEPRECATED: Use \fB--init-version\fR instead. +.RE 0 + +.P +Alias for \fB--init-version\fR +.SS "\fBkey\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or String +.IP \(bu 4 +DEPRECATED: \fBkey\fR and \fBcert\fR are no longer used for most registry operations. Use registry scoped \fBkeyfile\fR and \fBcertfile\fR instead. Example: //other-registry.tld/:keyfile=/path/to/key.pem //other-registry.tld/:certfile=/path/to/cert.crt +.RE 0 + +.P +A client key to pass when accessing the registry. Values should be in PEM format with newlines replaced by the string "\[rs]n". For example: +.P +.RS 2 +.nf +key="-----BEGIN PRIVATE KEY-----\[rs]nXXXX\[rs]nXXXX\[rs]n-----END PRIVATE KEY-----" +.fi +.RE +.P +It is \fInot\fR the path to a key file, though you can set a registry-scoped "keyfile" path like "//other-registry.tld/:keyfile=/path/to/key.pem". +.SS "\fBlegacy-bundling\fR" +.RS 0 +.IP \(bu 4 +Default: false +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=nested\fR +.RE 0 + +.P +Instead of hoisting package installs in \fBnode_modules\fR, install packages in the same manner that they are depended on. This may cause very deep directory structures and duplicate package installs as there is no de-duplicating. Sets \fB--install-strategy=nested\fR. +.SS "\fBonly\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null, "prod", or "production" +.IP \(bu 4 +DEPRECATED: Use \fB--omit=dev\fR to omit dev dependencies from the install. +.RE 0 + +.P +When set to \fBprod\fR or \fBproduction\fR, this is an alias for \fB--omit=dev\fR. +.SS "\fBoptional\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.IP \(bu 4 +DEPRECATED: Use \fB--omit=optional\fR to exclude optional dependencies, or \fB--include=optional\fR to include them. +.RE 0 + +.P +Default value does install optional deps unless otherwise omitted. +.P +Alias for --include=optional or --omit=optional +.SS "\fBproduction\fR" +.RS 0 +.IP \(bu 4 +Default: null +.IP \(bu 4 +Type: null or Boolean +.IP \(bu 4 +DEPRECATED: Use \fB--omit=dev\fR instead. +.RE 0 + +.P +Alias for \fB--omit=dev\fR +.SS "\fBshrinkwrap\fR" +.RS 0 +.IP \(bu 4 +Default: true +.IP \(bu 4 +Type: Boolean +.IP \(bu 4 +DEPRECATED: Use the --package-lock setting instead. +.RE 0 + +.P +Alias for --package-lock +.SS "See also" +.RS 0 +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +npm help scripts +.IP \(bu 4 +npm help folders +.IP \(bu 4 +npm help npm +.RE 0 diff --git a/node24/node_modules/npm/man/man7/dependency-selectors.7 b/node24/node_modules/npm/man/man7/dependency-selectors.7 new file mode 100644 index 0000000000000000000000000000000000000000..0f34d1eb25ca7b26641be57d83254b936c5df9da --- /dev/null +++ b/node24/node_modules/npm/man/man7/dependency-selectors.7 @@ -0,0 +1,331 @@ +.TH "SELECTORS" "7" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBSelectors\fR - Dependency Selector Syntax & Querying +.SS "Description" +.P +The npm help query command exposes a new dependency selector syntax (informed by & respecting many aspects of the \fBCSS Selectors 4 Spec\fR \fI\(lahttps://dev.w3.org/csswg/selectors4/#relational\(ra\fR) which: +.RS 0 +.IP \(bu 4 +Standardizes the shape of, & querying of, dependency graphs with a robust object model, metadata & selector syntax +.IP \(bu 4 +Leverages existing, known language syntax & operators from CSS to make disparate package information broadly accessible +.IP \(bu 4 +Unlocks the ability to answer complex, multi-faceted questions about dependencies, their relationships & associative metadata +.IP \(bu 4 +Consolidates redundant logic of similar query commands in \fBnpm\fR (ex. \fBnpm fund\fR, \fBnpm ls\fR, \fBnpm outdated\fR, \fBnpm audit\fR ...) +.RE 0 + +.SS "Dependency Selector Syntax" +.SS "Overview:" +.RS 0 +.IP \(bu 4 +there is no "type" or "tag" selectors (ex. \fBdiv, h1, a\fR) as a dependency/target is the only type of \fBNode\fR that can be queried +.IP \(bu 4 +the term "dependencies" is in reference to any \fBNode\fR found in a \fBtree\fR returned by \fBArborist\fR +.RE 0 + +.SS "Combinators" +.RS 0 +.IP \(bu 4 +\fB>\fR direct descendant/child +.IP \(bu 4 +\fB \fR any descendant/child +.IP \(bu 4 +\fB~\fR sibling +.RE 0 + +.SS "Selectors" +.RS 0 +.IP \(bu 4 +\fB*\fR universal selector +.IP \(bu 4 +\fB#\fR dependency selector (equivalent to \fB\[lB]name="..."\[rB]\fR) +.IP \(bu 4 +\fB#@\fR (equivalent to \fB\[lB]name=\[rB]:semver()\fR) +.IP \(bu 4 +\fB,\fR selector list delimiter +.IP \(bu 4 +\fB.\fR dependency type selector +.IP \(bu 4 +\fB:\fR pseudo selector +.RE 0 + +.SS "Dependency Type Selectors" +.RS 0 +.IP \(bu 4 +\fB.prod\fR dependency found in the \fBdependencies\fR section of \fBpackage.json\fR, or is a child of said dependency +.IP \(bu 4 +\fB.dev\fR dependency found in the \fBdevDependencies\fR section of \fBpackage.json\fR, or is a child of said dependency +.IP \(bu 4 +\fB.optional\fR dependency found in the \fBoptionalDependencies\fR section of \fBpackage.json\fR, or has \fB"optional": true\fR set in its entry in the \fBpeerDependenciesMeta\fR section of \fBpackage.json\fR, or a child of said dependency +.IP \(bu 4 +\fB.peer\fR dependency found in the \fBpeerDependencies\fR section of \fBpackage.json\fR +.IP \(bu 4 +\fB.workspace\fR dependency found in the \fB\[rs]fBworkspaces\[rs]fR\fR \fI\(lahttps://docs.npmjs.com/cli/v8/using-npm/workspaces\(ra\fR section of \fBpackage.json\fR +.IP \(bu 4 +\fB.bundled\fR dependency found in the \fBbundleDependencies\fR section of \fBpackage.json\fR, or is a child of said dependency +.RE 0 + +.SS "Pseudo Selectors" +.RS 0 +.IP \(bu 4 +\fB\[rs]fB:not()\[rs]fR\fR \fI\(lahttps://developer.mozilla.org/en-US/docs/Web/CSS/:not\(ra\fR +.IP \(bu 4 +\fB\[rs]fB:has()\[rs]fR\fR \fI\(lahttps://developer.mozilla.org/en-US/docs/Web/CSS/:has\(ra\fR +.IP \(bu 4 +\fB\[rs]fB:is()\[rs]fR\fR \fI\(lahttps://developer.mozilla.org/en-US/docs/Web/CSS/:is\(ra\fR +.IP \(bu 4 +\fB\[rs]fB:root\[rs]fR\fR \fI\(lahttps://developer.mozilla.org/en-US/docs/Web/CSS/:root\(ra\fR matches the root node/dependency +.IP \(bu 4 +\fB\[rs]fB:scope\[rs]fR\fR \fI\(lahttps://developer.mozilla.org/en-US/docs/Web/CSS/:scope\(ra\fR matches node/dependency it was queried against +.IP \(bu 4 +\fB\[rs]fB:empty\[rs]fR\fR \fI\(lahttps://developer.mozilla.org/en-US/docs/Web/CSS/:empty\(ra\fR when a dependency has no dependencies +.IP \(bu 4 +\fB\[rs]fB:private\[rs]fR\fR \fI\(lahttps://docs.npmjs.com/cli/v8/configuring-npm/package-json#private\(ra\fR when a dependency is private +.IP \(bu 4 +\fB:link\fR when a dependency is linked (for instance, workspaces or packages manually \fB\[rs]fBlinked\[rs]fR\fR \fI\(lahttps://docs.npmjs.com/cli/v8/commands/npm-link\(ra\fR +.IP \(bu 4 +\fB:deduped\fR when a dependency has been deduped (note that this does \fInot\fR always mean the dependency has been hoisted to the root of node_modules) +.IP \(bu 4 +\fB:overridden\fR when a dependency has been overridden +.IP \(bu 4 +\fB:extraneous\fR when a dependency exists but is not defined as a dependency of any node +.IP \(bu 4 +\fB:invalid\fR when a dependency version is out of its ancestors specified range +.IP \(bu 4 +\fB:missing\fR when a dependency is not found on disk +.IP \(bu 4 +\fB:semver(, \[lB]selector\[rB], \[lB]function\[rB])\fR match a valid \fB\[rs]fBnode-semver\[rs]fR\fR \fI\(lahttps://github.com/npm/node-semver\(ra\fR version or range to a selector +.IP \(bu 4 +\fB:path()\fR \fBglob\fR \fI\(lahttps://www.npmjs.com/package/glob\(ra\fR matching based on dependencies path relative to the project +.IP \(bu 4 +\fB:type()\fR \fBbased on currently recognized types\fR \fI\(lahttps://github.com/npm/npm-package-arg#result-object\(ra\fR. You can also use the aggregate type of \fBregistry\fR for any registry dependency (e.g. tag, version, range, alias) +.IP \(bu 4 +\fB:outdated()\fR when a dependency is outdated +.IP \(bu 4 +\fB:vuln()\fR when a dependency has a known vulnerability +.RE 0 + +.SS "\fB:semver(, \[lB]selector\[rB], \[lB]function\[rB])\fR" +.P +The \fB:semver()\fR pseudo selector allows comparing fields from each node's \fBpackage.json\fR using \fBsemver\fR \fI\(lahttps://github.com/npm/node-semver#readme\(ra\fR methods. It accepts up to 3 parameters, all but the first of which are optional. +.RS 0 +.IP \(bu 4 +\fBspec\fR a semver version or range +.IP \(bu 4 +\fBselector\fR an attribute selector for each node (default \fB\[lB]version\[rB]\fR) +.IP \(bu 4 +\fBfunction\fR a semver method to apply, one of: \fBsatisfies\fR, \fBintersects\fR, \fBsubset\fR, \fBgt\fR, \fBgte\fR, \fBgtr\fR, \fBlt\fR, \fBlte\fR, \fBltr\fR, \fBeq\fR, \fBneq\fR or the special function \fBinfer\fR (default \fBinfer\fR) +.RE 0 + +.P +When the special \fBinfer\fR function is used the \fBspec\fR and the actual value from the node are compared. If both are versions, according to \fBsemver.valid()\fR, \fBeq\fR is used. If both values are ranges, according to \fB!semver.valid()\fR, \fBintersects\fR is used. If the values are mixed types \fBsatisfies\fR is used. +.P +Some examples: +.RS 0 +.IP \(bu 4 +\fB:semver(^1.0.0)\fR returns every node that has a \fBversion\fR satisfied by the provided range \fB^1.0.0\fR +.IP \(bu 4 +\fB:semver(16.0.0, :attr(engines, \[lB]node\[rB]))\fR returns every node which has an \fBengines.node\fR property satisfying the version \fB16.0.0\fR +.IP \(bu 4 +\fB:semver(1.0.0, \[lB]version\[rB], lt)\fR every node with a \fBversion\fR less than \fB1.0.0\fR +.RE 0 + +.SS "\fB:outdated()\fR" +.P +The \fB:outdated\fR pseudo selector retrieves data from the registry and returns information about which of your dependencies are outdated. The type parameter may be one of the following: +.RS 0 +.IP \(bu 4 +\fBany\fR (default) a version exists that is greater than the current one +.IP \(bu 4 +\fBin-range\fR a version exists that is greater than the current one, and satisfies at least one if its parent's dependencies +.IP \(bu 4 +\fBout-of-range\fR a version exists that is greater than the current one, does not satisfy at least one of its parent's dependencies +.IP \(bu 4 +\fBmajor\fR a version exists that is a semver major greater than the current one +.IP \(bu 4 +\fBminor\fR a version exists that is a semver minor greater than the current one +.IP \(bu 4 +\fBpatch\fR a version exists that is a semver patch greater than the current one +.RE 0 + +.P +In addition to the filtering performed by the pseudo selector, some extra data is added to the resulting objects. The following data can be found under the \fBqueryContext\fR property of each node. +.RS 0 +.IP \(bu 4 +\fBversions\fR an array of every available version of the given node +.IP \(bu 4 +\fBoutdated.inRange\fR an array of objects, each with a \fBfrom\fR and \fBversions\fR, where \fBfrom\fR is the on-disk location of the node that depends on the current node and \fBversions\fR is an array of all available versions that satisfies that dependency. This is only populated if \fB:outdated(in-range)\fR is used. +.IP \(bu 4 +\fBoutdated.outOfRange\fR an array of objects, identical in shape to \fBinRange\fR, but where the \fBversions\fR array is every available version that does not satisfy the dependency. This is only populated if \fB:outdated(out-of-range)\fR is used. +.RE 0 + +.P +Some examples: +.RS 0 +.IP \(bu 4 +\fB:root > :outdated(major)\fR returns every direct dependency that has a new semver major release +.IP \(bu 4 +\fB.prod:outdated(in-range)\fR returns production dependencies that have a new release that satisfies at least one of its parent's dependencies +.RE 0 + +.SS "\fB:vuln\fR" +.P +The \fB:vuln\fR pseudo selector retrieves data from the registry and returns information about which if your dependencies has a known vulnerability. Only dependencies whose current version matches a vulnerability will be returned. For example if you have \fBsemver@7.6.0\fR in your tree, a vulnerability for \fBsemver\fR which affects versions \fB<=6.3.1\fR will not match. +.P +You can also filter results by certain attributes in advisories. Currently that includes \fBseverity\fR and \fBcwe\fR. Note that severity filtering is done per severity, it does not include severities "higher" or "lower" than the one specified. +.P +In addition to the filtering performed by the pseudo selector, info about each relevant advisory will be added to the \fBqueryContext\fR attribute of each node under the \fBadvisories\fR attribute. +.P +Some examples: +.RS 0 +.IP \(bu 4 +\fB:root > .prod:vuln\fR returns direct production dependencies with any known vulnerability +.IP \(bu 4 +\fB:vuln(\[lB]severity=high\[rB])\fR returns only dependencies with a vulnerability with a \fBhigh\fR severity. +.IP \(bu 4 +\fB:vuln(\[lB]severity=high\[rB],\[lB]severity=moderate\[rB])\fR returns only dependencies with a vulnerability with a \fBhigh\fR or \fBmoderate\fR severity. +.IP \(bu 4 +\fB:vuln(\[lB]cwe=1333\[rB])\fR returns only dependencies with a vulnerability that includes CWE-1333 (ReDoS) +.RE 0 + +.SS "\fBAttribute Selectors\fR \fI\(lahttps://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors\(ra\fR" +.P +The attribute selector evaluates the key/value pairs in \fBpackage.json\fR if they are \fBString\fRs. +.RS 0 +.IP \(bu 4 +\fB\[lB]\[rB]\fR attribute selector (ie. existence of attribute) +.IP \(bu 4 +\fB\[lB]attribute=value\[rB]\fR attribute value is equivalent... +.IP \(bu 4 +\fB\[lB]attribute~=value\[rB]\fR attribute value contains word... +.IP \(bu 4 +\fB\[lB]attribute*=value\[rB]\fR attribute value contains string... +.IP \(bu 4 +\fB\[lB]attribute|=value\[rB]\fR attribute value is equal to or starts with... +.IP \(bu 4 +\fB\[lB]attribute^=value\[rB]\fR attribute value starts with... +.IP \(bu 4 +\fB\[lB]attribute$=value\[rB]\fR attribute value ends with... +.RE 0 + +.SS "\fBArray\fR & \fBObject\fR Attribute Selectors" +.P +The generic \fB:attr()\fR pseudo selector standardizes a pattern which can be used for attribute selection of \fBObject\fRs, \fBArray\fRs or \fBArrays\fR of \fBObject\fRs accessible via \fBArborist\fR's \fBNode.package\fR metadata. This allows for iterative attribute selection beyond top-level \fBString\fR evaluation. The last argument passed to \fB:attr()\fR must be an \fBattribute\fR selector or a nested \fB:attr()\fR. See examples below: +.SS "\fBObjects\fR" +.P +.RS 2 +.nf +/* return dependencies that have a `scripts.test` containing `"tap"` */ +*:attr(scripts, \[lB]test~=tap\[rB]) +.fi +.RE +.SS "Nested \fBObjects\fR" +.P +Nested objects are expressed as sequential arguments to \fB:attr()\fR. +.P +.RS 2 +.nf +/* return dependencies that have a \[lB]testling config\[rB](https://ci.testling.com/guide/advanced_configuration) for opera browsers */ +*:attr(testling, browsers, \[lB]~=opera\[rB]) +.fi +.RE +.SS "\fBArrays\fR" +.P +\fBArray\fRs specifically uses a special/reserved \fB.\fR character in place of a typical attribute name. \fBArrays\fR also support exact \fBvalue\fR matching when a \fBString\fR is passed to the selector. +.SS "Example of an \fBArray\fR Attribute Selection:" +.P +.RS 2 +.nf +/* removes the distinction between properties & arrays */ +/* ie. we'd have to check the property & iterate to match selection */ +*:attr(\[lB]keywords^=react\[rB]) +*:attr(contributors, :attr(\[lB]name~=Jordan\[rB])) +.fi +.RE +.SS "Example of an \fBArray\fR matching directly to a value:" +.P +.RS 2 +.nf +/* return dependencies that have the exact keyword "react" */ +/* this is equivalent to `*:keywords(\[lB]value="react"\[rB])` */ +*:attr(\[lB]keywords=react\[rB]) +.fi +.RE +.SS "Example of an \fBArray\fR of \fBObject\fRs:" +.P +.RS 2 +.nf +/* returns */ +*:attr(contributors, \[lB]email=ruyadorno@github.com\[rB]) +.fi +.RE +.SS "Groups" +.P +Dependency groups are defined by the package relationships to their ancestors (ie. the dependency types that are defined in \fBpackage.json\fR). This approach is user-centric as the ecosystem has been taught to think about dependencies in these groups first-and-foremost. Dependencies are allowed to be included in multiple groups (ex. a \fBprod\fR dependency may also be a \fBdev\fR dependency (in that it's also required by another \fBdev\fR dependency) & may also be \fBbundled\fR - a selector for that type of dependency would look like: \fB*.prod.dev.bundled\fR). +.RS 0 +.IP \(bu 4 +\fB.prod\fR +.IP \(bu 4 +\fB.dev\fR +.IP \(bu 4 +\fB.optional\fR +.IP \(bu 4 +\fB.peer\fR +.IP \(bu 4 +\fB.bundled\fR +.IP \(bu 4 +\fB.workspace\fR +.RE 0 + +.P +Please note that currently \fBworkspace\fR deps are always \fBprod\fR dependencies. Additionally the \fB.root\fR dependency is also considered a \fBprod\fR dependency. +.SS "Programmatic Usage" +.RS 0 +.IP \(bu 4 +\fBArborist\fR's \fBNode\fR Class has a \fB.querySelectorAll()\fR method +.RS 4 +.IP \(bu 4 +this method will return a filtered, flattened dependency Arborist \fBNode\fR list based on a valid query selector +.RE 0 + +.RE 0 + +.P +.RS 2 +.nf +const Arborist = require('@npmcli/arborist') +const arb = new Arborist({}) +.fi +.RE +.P +.RS 2 +.nf +// root-level +arb.loadActual().then(async (tree) => { + // query all production dependencies + const results = await tree.querySelectorAll('.prod') + console.log(results) +}) +.fi +.RE +.P +.RS 2 +.nf +// iterative +arb.loadActual().then(async (tree) => { + // query for the deduped version of react + const results = await tree.querySelectorAll('#react:not(:deduped)') + // query the deduped react for git deps + const deps = await results\[lB]0\[rB].querySelectorAll(':type(git)') + console.log(deps) +}) +.fi +.RE +.SH "SEE ALSO" +.RS 0 +.IP \(bu 4 +npm help query +.IP \(bu 4 +\fB@npmcli/arborist\fR \fI\(lahttps://npm.im/@npmcli/arborist\(ra\fR +.RE 0 diff --git a/node24/node_modules/npm/man/man7/developers.7 b/node24/node_modules/npm/man/man7/developers.7 new file mode 100644 index 0000000000000000000000000000000000000000..6ab21af51b0a08b52be76ee98146e5b73155587e --- /dev/null +++ b/node24/node_modules/npm/man/man7/developers.7 @@ -0,0 +1,234 @@ +.TH "DEVELOPERS" "7" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBDevelopers\fR - Developer guide +.SS "Description" +.P +So, you've decided to use npm to develop (and maybe publish/deploy) your project. +.P +Fantastic! +.P +There are a few things that you need to do above the simple steps that your users will do to install your program. +.SS "About These Documents" +.P +These are man pages. If you install npm, you should be able to then do \fBman npm-thing\fR to get the documentation on a particular topic, or \fBnpm help thing\fR to see the same information. +.SS "What is a Package" +.P +A package is: +.RS 0 +.IP \(bu 4 +a) a folder containing a program described by a package.json file +.IP \(bu 4 +b) a gzipped tarball containing (a) +.IP \(bu 4 +c) a url that resolves to (b) +.IP \(bu 4 +d) a \fB@\fR that is published on the registry with (c) +.IP \(bu 4 +e) a \fB@\fR that points to (d) +.IP \(bu 4 +f) a \fB\fR that has a "latest" tag satisfying (e) +.IP \(bu 4 +g) a \fBgit\fR url that, when cloned, results in (a). +.RE 0 + +.P +Even if you never publish your package, you can still get a lot of benefits of using npm if you just want to write a node program (a), and perhaps if you also want to be able to easily install it elsewhere after packing it up into a tarball (b). +.P +Git urls can be of the form: +.P +.RS 2 +.nf +git://github.com/user/project.git#commit-ish +git+ssh://user@hostname:project.git#commit-ish +git+http://user@hostname/project/blah.git#commit-ish +git+https://user@hostname/project/blah.git#commit-ish +.fi +.RE +.P +The \fBcommit-ish\fR can be any tag, sha, or branch which can be supplied as an argument to \fBgit checkout\fR. The default is whatever the repository uses as its default branch. +.SS "The package.json File" +.P +You need to have a \fBpackage.json\fR file in the root of your project to do much of anything with npm. That is basically the whole interface. +.P +See \fB\[rs]fBpackage.json\[rs]fR\fR \fI\(la/configuring-npm/package-json\(ra\fR for details about what goes in that file. At the very least, you need: +.RS 0 +.IP \(bu 4 +name: This should be a string that identifies your project. Please do not use the name to specify that it runs on node, or is in JavaScript. You can use the "engines" field to explicitly state the versions of node (or whatever else) that your program requires, and it's pretty well assumed that it's JavaScript. +.P +It does not necessarily need to match your github repository name. +.P +So, \fBnode-foo\fR and \fBbar-js\fR are bad names. \fBfoo\fR or \fBbar\fR are better. +.IP \(bu 4 +version: A semver-compatible version. +.IP \(bu 4 +engines: Specify the versions of node (or whatever else) that your program runs on. The node API changes a lot, and there may be bugs or new functionality that you depend on. Be explicit. +.IP \(bu 4 +author: Take some credit. +.IP \(bu 4 +scripts: If you have a special compilation or installation script, then you should put it in the \fBscripts\fR object. You should definitely have at least a basic smoke-test command as the "scripts.test" field. See npm help scripts. +.IP \(bu 4 +main: If you have a single module that serves as the entry point to your program (like what the "foo" package gives you at require("foo")), then you need to specify that in the "main" field. +.IP \(bu 4 +directories: This is an object mapping names to folders. The best ones to include are "lib" and "doc", but if you use "man" to specify a folder full of man pages, they'll get installed just like these ones. +.RE 0 + +.P +You can use \fBnpm init\fR in the root of your package in order to get you started with a pretty basic package.json file. See npm help init for more info. +.SS "Keeping files \fIout\fR of your Package" +.P +Use a \fB.npmignore\fR file to keep stuff out of your package. If there's no \fB.npmignore\fR file, but there \fIis\fR a \fB.gitignore\fR file, then npm will ignore the stuff matched by the \fB.gitignore\fR file. If you \fIwant\fR to include something that is excluded by your \fB.gitignore\fR file, you can create an empty \fB.npmignore\fR file to override it. Like \fBgit\fR, \fBnpm\fR looks for \fB.npmignore\fR and \fB.gitignore\fR files in all subdirectories of your package, not only the root directory. +.P +\fB.npmignore\fR files follow the \fBsame pattern rules\fR \fI\(lahttps://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_ignoring\(ra\fR as \fB.gitignore\fR files: +.RS 0 +.IP \(bu 4 +Blank lines or lines starting with \fB#\fR are ignored. +.IP \(bu 4 +Standard glob patterns work. +.IP \(bu 4 +You can end patterns with a forward slash \fB/\fR to specify a directory. +.IP \(bu 4 +You can negate a pattern by starting it with an exclamation point \fB!\fR. +.RE 0 + +.P +By default, some paths and files are ignored, so there's no need to add them to \fB.npmignore\fR explicitly. Some examples are: +.RS 0 +.IP \(bu 4 +\fB.*.swp\fR +.IP \(bu 4 +\fB._*\fR +.IP \(bu 4 +\fB.DS_Store\fR +.IP \(bu 4 +\fB.git\fR +.IP \(bu 4 +\fB.gitignore\fR +.IP \(bu 4 +\fB.hg\fR +.IP \(bu 4 +\fB.npmignore\fR +.IP \(bu 4 +\fB.npmrc\fR +.IP \(bu 4 +\fB.lock-wscript\fR +.IP \(bu 4 +\fB.svn\fR +.IP \(bu 4 +\fB.wafpickle-*\fR +.IP \(bu 4 +\fBconfig.gypi\fR +.IP \(bu 4 +\fBCVS\fR +.IP \(bu 4 +\fBnpm-debug.log\fR +.RE 0 + +.P +Additionally, everything in \fBnode_modules\fR is ignored, except for bundled dependencies. npm automatically handles this for you, so don't bother adding \fBnode_modules\fR to \fB.npmignore\fR. +.P +The following paths and files are never ignored, so adding them to \fB.npmignore\fR is pointless: +.RS 0 +.IP \(bu 4 +\fBpackage.json\fR +.IP \(bu 4 +\fBREADME\fR (and its variants) +.IP \(bu 4 +\fBLICENSE\fR / \fBLICENCE\fR +.RE 0 + +.P +If, given the structure of your project, you find \fB.npmignore\fR to be a maintenance headache, you might instead try populating the \fBfiles\fR property of \fBpackage.json\fR, which is an array of file or directory names that should be included in your package. Sometimes manually picking which items to allow is easier to manage than building a block list. +.P +See \fB\[rs]fBpackage.json\[rs]fR\fR \fI\(la/configuring-npm/package-json\(ra\fR for more info on what can and can't be ignored. +.SS "Testing whether your \fB.npmignore\fR or \fBfiles\fR config works" +.P +If you want to double check that your package will include only the files you intend it to when published, you can run the \fBnpm pack\fR command locally which will generate a tarball in the working directory, the same way it does for publishing. +.SS "Link Packages" +.P +\fBnpm link\fR is designed to install a development package and see the changes in real time without having to keep re-installing it. (You do need to either re-link or \fBnpm rebuild -g\fR to update compiled packages, of course.) +.P +More info at npm help link. +.SS "Before Publishing: Make Sure Your Package Installs and Works" +.P +\fBThis is important.\fR +.P +If you cannot install it locally, you'll have problems trying to publish it. Or, worse yet, you'll be able to publish it, but you'll be publishing a broken or pointless package. So don't do that. +.P +In the root of your package, do this: +.P +.RS 2 +.nf +npm install . -g +.fi +.RE +.P +That'll show you that it's working. If you'd rather just create a symlink package that points to your working directory, then do this: +.P +.RS 2 +.nf +npm link +.fi +.RE +.P +Use \fBnpm ls -g\fR to see if it's there. +.P +To test a local install, go into some other folder, and then do: +.P +.RS 2 +.nf +cd ../some-other-folder +npm install ../my-package +.fi +.RE +.P +to install it locally into the node_modules folder in that other place. +.P +Then go into the node-repl, and try using require("my-thing") to bring in your module's main module. +.SS "Create a User Account" +.P +Create a user with the adduser command. It works like this: +.P +.RS 2 +.nf +npm adduser +.fi +.RE +.P +and then follow the prompts. +.P +This is documented better in npm help adduser. +.SS "Publish your Package" +.P +This part's easy. In the root of your folder, do this: +.P +.RS 2 +.nf +npm publish +.fi +.RE +.P +You can give publish a url to a tarball, or a filename of a tarball, or a path to a folder. +.P +Note that pretty much \fBeverything in that folder will be exposed\fR by default. So, if you have secret stuff in there, use a \fB.npmignore\fR file to list out the globs to ignore, or publish from a fresh checkout. +.SS "Brag about it" +.P +Send emails, write blogs, blab in IRC. +.P +Tell the world how easy it is to install your program! +.SS "See also" +.RS 0 +.IP \(bu 4 +npm help npm +.IP \(bu 4 +npm help init +.IP \(bu 4 +\fBpackage.json\fR \fI\(la/configuring-npm/package-json\(ra\fR +.IP \(bu 4 +npm help scripts +.IP \(bu 4 +npm help publish +.IP \(bu 4 +npm help adduser +.IP \(bu 4 +npm help registry +.RE 0 diff --git a/node24/node_modules/npm/man/man7/logging.7 b/node24/node_modules/npm/man/man7/logging.7 new file mode 100644 index 0000000000000000000000000000000000000000..7abd08b80da081df2eaea410214693cfeaf03c84 --- /dev/null +++ b/node24/node_modules/npm/man/man7/logging.7 @@ -0,0 +1,108 @@ +.TH "LOGGING" "7" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBLogging\fR - Why, What & How we Log +.SS "Description" +.P +The \fBnpm\fR CLI has various mechanisms for showing different levels of information back to end-users for certain commands, configurations & environments. +.SS "Setting Log File Location" +.P +All logs are written to a debug log, with the path to that file printed if the execution of a command fails. +.P +The default location of the logs directory is a directory named \fB_logs\fR inside the npm cache. This can be changed with the \fBlogs-dir\fR config option. +.P +For example, if you wanted to write all your logs to the current working directory, you could run: \fBnpm install --logs-dir=.\fR. This is especially helpful in debugging a specific \fBnpm\fR issue as you can run a command multiple times with different config values and then diff all the log files. +.P +Log files will be removed from the \fBlogs-dir\fR when the number of log files exceeds \fBlogs-max\fR, with the oldest logs being deleted first. +.P +To turn off logs completely set \fB--logs-max=0\fR. +.SS "Setting Log Levels" +.SS "\fBloglevel\fR" +.P +\fBloglevel\fR is a global argument/config that can be set to determine the type of information to be displayed. +.P +The default value of \fBloglevel\fR is \fB"notice"\fR but there are several levels/types of logs available, including: +.RS 0 +.IP \(bu 4 +\fB"silent"\fR +.IP \(bu 4 +\fB"error"\fR +.IP \(bu 4 +\fB"warn"\fR +.IP \(bu 4 +\fB"notice"\fR +.IP \(bu 4 +\fB"http"\fR +.IP \(bu 4 +\fB"info"\fR +.IP \(bu 4 +\fB"verbose"\fR +.IP \(bu 4 +\fB"silly"\fR +.RE 0 + +.P +All logs pertaining to a level preceding the current setting will be shown. +.SS "Aliases" +.P +The log levels listed above have various corresponding aliases, including: +.RS 0 +.IP \(bu 4 +\fB-d\fR: \fB--loglevel info\fR +.IP \(bu 4 +\fB--dd\fR: \fB--loglevel verbose\fR +.IP \(bu 4 +\fB--verbose\fR: \fB--loglevel verbose\fR +.IP \(bu 4 +\fB--ddd\fR: \fB--loglevel silly\fR +.IP \(bu 4 +\fB-q\fR: \fB--loglevel warn\fR +.IP \(bu 4 +\fB--quiet\fR: \fB--loglevel warn\fR +.IP \(bu 4 +\fB-s\fR: \fB--loglevel silent\fR +.IP \(bu 4 +\fB--silent\fR: \fB--loglevel silent\fR +.RE 0 + +.SS "\fBforeground-scripts\fR" +.P +The \fBnpm\fR CLI began hiding the output of lifecycle scripts for \fBnpm install\fR as of \fBv7\fR. Notably, this means you will not see logs/output from packages that may be using "install scripts" to display information back to you or from your own project's scripts defined in \fBpackage.json\fR. If you'd like to change this behavior & log this output you can set \fBforeground-scripts\fR to \fBtrue\fR. +.SS "Timing Information" +.P +The \fB\[rs]fB--timing\[rs]fR config\fR \fI\(la/using-npm/config#timing\(ra\fR can be set which does a few things: +.RS 0 +.IP 1. 4 +Always shows the full path to the debug log regardless of command exit status +.IP 2. 4 +Write timing information to a process specific timing file in the cache or \fBlogs-dir\fR +.IP 3. 4 +Output timing information to the terminal +.RE 0 + +.P +This file contains a \fBtimers\fR object where the keys are an identifier for the portion of the process being timed and the value is the number of milliseconds it took to complete. +.P +Sometimes it is helpful to get timing information without outputting anything to the terminal. For example, the performance might be affected by writing to the terminal. In this case you can use \fB--timing --silent\fR which will still write the timing file, but not output anything to the terminal while running. +.SS "Registry Response Headers" +.SS "\fBnpm-notice\fR" +.P +The \fBnpm\fR CLI reads from & logs any \fBnpm-notice\fR headers that are returned from the configured registry. This mechanism can be used by third-party registries to provide useful information when network-dependent requests occur. +.P +This header is not cached, and will not be logged if the request is served from the cache. +.SS "Logs and Sensitive Information" +.P +The \fBnpm\fR CLI makes a best effort to redact the following from terminal output and log files: +.RS 0 +.IP \(bu 4 +Passwords inside basic auth URLs +.IP \(bu 4 +npm tokens +.RE 0 + +.P +However, this behavior should not be relied on to keep all possible sensitive information redacted. If you are concerned about secrets in your log file or terminal output, you can use \fB--loglevel=silent\fR and \fB--logs-max=0\fR to ensure no logs are written to your terminal or filesystem. +.SS "See also" +.RS 0 +.IP \(bu 4 +npm help config +.RE 0 diff --git a/node24/node_modules/npm/man/man7/orgs.7 b/node24/node_modules/npm/man/man7/orgs.7 new file mode 100644 index 0000000000000000000000000000000000000000..b85c26a19e499a189314ca42a0d895735352ae78 --- /dev/null +++ b/node24/node_modules/npm/man/man7/orgs.7 @@ -0,0 +1,145 @@ +.TH "ORGANIZATIONS" "7" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBOrganizations\fR - Working with teams & organizations +.SS "Description" +.P +There are three levels of org users: +.RS 0 +.IP 1. 4 +Super admin, controls billing & adding people to the org. +.IP 2. 4 +Team admin, manages team membership & package access. +.IP 3. 4 +Developer, works on packages they are given access to. +.RE 0 + +.P +The super admin is the only person who can add users to the org because it impacts the monthly bill. The super admin will use the website to manage membership. Every org has a \fBdevelopers\fR team that all users are automatically added to. +.P +The team admin is the person who manages team creation, team membership, and package access for teams. The team admin grants package access to teams, not individuals. +.P +The developer will be able to access packages based on the teams they are on. Access is either read-write or read-only. +.P +There are two main commands: +.RS 0 +.IP 1. 4 +\fBnpm team\fR see npm help team for more details +.IP 2. 4 +\fBnpm access\fR see npm help access for more details +.RE 0 + +.SS "Team Admins create teams" +.RS 0 +.IP \(bu 4 +Check who you\[cq]ve added to your org: +.RE 0 + +.P +.RS 2 +.nf +npm team ls :developers +.fi +.RE +.RS 0 +.IP \(bu 4 +Each org is automatically given a \fBdevelopers\fR team, so you can see the whole list of team members in your org. This team automatically gets read-write access to all packages, but you can change that with the \fBaccess\fR command. +.IP \(bu 4 +Create a new team: +.RE 0 + +.P +.RS 2 +.nf +npm team create +.fi +.RE +.RS 0 +.IP \(bu 4 +Add members to that team: +.RE 0 + +.P +.RS 2 +.nf +npm team add +.fi +.RE +.SS "Publish a package and adjust package access" +.RS 0 +.IP \(bu 4 +In package directory, run +.RE 0 + +.P +.RS 2 +.nf +npm init --scope= +.fi +.RE +.P +to scope it for your org & publish as usual +.RS 0 +.IP \(bu 4 +Grant access: +.RE 0 + +.P +.RS 2 +.nf +npm access grant \[lB]\[rB] +.fi +.RE +.RS 0 +.IP \(bu 4 +Revoke access: +.RE 0 + +.P +.RS 2 +.nf +npm access revoke \[lB]\[rB] +.fi +.RE +.SS "Monitor your package access" +.RS 0 +.IP \(bu 4 +See what org packages a team member can access: +.RE 0 + +.P +.RS 2 +.nf +npm access list packages +.fi +.RE +.RS 0 +.IP \(bu 4 +See packages available to a specific team: +.RE 0 + +.P +.RS 2 +.nf +npm access list packages +.fi +.RE +.RS 0 +.IP \(bu 4 +Check which teams are collaborating on a package: +.RE 0 + +.P +.RS 2 +.nf +npm access list collaborators +.fi +.RE +.SS "See also" +.RS 0 +.IP \(bu 4 +npm help team +.IP \(bu 4 +npm help access +.IP \(bu 4 +npm help scope +.RE 0 diff --git a/node24/node_modules/npm/man/man7/package-spec.7 b/node24/node_modules/npm/man/man7/package-spec.7 new file mode 100644 index 0000000000000000000000000000000000000000..67a78056747a88dd229e259ac5fe2783c9bbaac4 --- /dev/null +++ b/node24/node_modules/npm/man/man7/package-spec.7 @@ -0,0 +1,126 @@ +.TH "SPEC" "7" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBspec\fR - Package name specifier +.SS "Description" +.P +Commands like \fBnpm install\fR and the dependency sections in the \fBpackage.json\fR use a package name specifier. This can be many different things that all refer to a "package". Examples include a package name, git url, tarball, or local directory. These will generally be referred to as \fB\fR in the help output for the npm commands that use this package name specifier. +.SS "Package name" +.RS 0 +.IP \(bu 4 +\fB\[lB]<@scope>/\[rB]\fR +.IP \(bu 4 +\fB\[lB]<@scope>/\[rB]@\fR +.IP \(bu 4 +\fB\[lB]<@scope>/\[rB]@\fR +.IP \(bu 4 +\fB\[lB]<@scope>/\[rB]@\fR +.RE 0 + +.P +Refers to a package by name, with or without a scope, and optionally tag, version, or version range. This is typically used in combination with the \fBregistry\fR \fI\(la/using-npm/config#registry\(ra\fR config to refer to a package in a registry. +.P +Examples: +.RS 0 +.IP \(bu 4 +\fBnpm\fR +.IP \(bu 4 +\fB@npmcli/arborist\fR +.IP \(bu 4 +\fB@npmcli/arborist@latest\fR +.IP \(bu 4 +\fBnpm@6.13.1\fR +.IP \(bu 4 +\fBnpm@^4.0.0\fR +.RE 0 + +.SS "Aliases" +.RS 0 +.IP \(bu 4 +\fB@npm:\fR +.RE 0 + +.P +Primarily used by commands like \fBnpm install\fR and in the dependency sections in the \fBpackage.json\fR, this refers to a package by an alias. The \fB\fR is the name of the package as it is reified in the \fBnode_modules\fR folder, and the \fB\fR refers to a package name as found in the configured registry. +.P +See \fBPackage name\fR above for more info on referring to a package by name, and \fBregistry\fR \fI\(la/using-npm/config#registry\(ra\fR for configuring which registry is used when referring to a package by name. +.P +Examples: +.RS 0 +.IP \(bu 4 +\fBsemver@npm:@npmcli/semver-with-patch\fR +.IP \(bu 4 +\fBsemver@npm:semver@7.2.2\fR +.IP \(bu 4 +\fBsemver@npm:semver@legacy\fR +.RE 0 + +.SS "Folders" +.RS 0 +.IP \(bu 4 +\fB\fR +.RE 0 + +.P +This refers to a package on the local filesystem. Specifically this is a folder with a \fBpackage.json\fR file in it. This \fIshould\fR always be prefixed with a \fB/\fR or \fB./\fR (or your OS equivalent) to reduce confusion. npm currently will parse a string with more than one \fB/\fR in it as a folder, but this is legacy behavior that may be removed in a future version. +.P +Examples: +.RS 0 +.IP \(bu 4 +\fB./my-package\fR +.IP \(bu 4 +\fB/opt/npm/my-package\fR +.RE 0 + +.SS "Tarballs" +.RS 0 +.IP \(bu 4 +\fB\fR +.IP \(bu 4 +\fB\fR +.RE 0 + +.P +Examples: +.RS 0 +.IP \(bu 4 +\fB./my-package.tgz\fR +.IP \(bu 4 +\fBhttps://registry.npmjs.org/semver/-/semver-1.0.0.tgz\fR +.RE 0 + +.P +Refers to a package in a tarball format, either on the local filesystem or remotely via url. This is the format that packages exist in when uploaded to a registry. +.SS "git urls" +.RS 0 +.IP \(bu 4 +\fB\fR +.IP \(bu 4 +\fB/\fR +.RE 0 + +.P +Refers to a package in a git repo. This can be a full git url, git shorthand, or a username/package on GitHub. You can specify a git tag, branch, or other git ref by appending \fB#ref\fR. +.P +Examples: +.RS 0 +.IP \(bu 4 +\fBhttps://github.com/npm/cli.git\fR +.IP \(bu 4 +\fBgit@github.com:npm/cli.git\fR +.IP \(bu 4 +\fBgit+ssh://git@github.com/npm/cli#v6.0.0\fR +.IP \(bu 4 +\fBgithub:npm/cli#HEAD\fR +.IP \(bu 4 +\fBnpm/cli#c12ea07\fR +.RE 0 + +.SS "See also" +.RS 0 +.IP \(bu 4 +\fBnpm-package-arg\fR \fI\(lahttps://npm.im/npm-package-arg\(ra\fR +.IP \(bu 4 +npm help scope +.IP \(bu 4 +npm help config +.RE 0 diff --git a/node24/node_modules/npm/man/man7/registry.7 b/node24/node_modules/npm/man/man7/registry.7 new file mode 100644 index 0000000000000000000000000000000000000000..0ce5a361a7980950b8a68949548f46d2a56d75cd --- /dev/null +++ b/node24/node_modules/npm/man/man7/registry.7 @@ -0,0 +1,49 @@ +.TH "REGISTRY" "7" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBRegistry\fR - The JavaScript Package Registry +.SS "Description" +.P +To resolve packages by name and version, npm talks to a registry website that implements the CommonJS Package Registry specification for reading package info. +.P +npm is configured to use the \fBnpm public registry\fR at \fI\(lahttps://registry.npmjs.org\(ra\fR by default. Use of the npm public registry is subject to terms of use available at \fI\(lahttps://docs.npmjs.com/policies/terms\(ra\fR. +.P +You can configure npm to use any compatible registry you like, and even run your own registry. Use of someone else's registry may be governed by their terms of use. +.P +npm's package registry implementation supports several write APIs as well, to allow for publishing packages and managing user account information. +.P +The registry URL used is determined by the scope of the package (see npm help scope. If no scope is specified, the default registry is used, which is supplied by the \fB\[rs]fBregistry\[rs]fR config\fR \fI\(la/using-npm/config#registry\(ra\fR parameter. See npm help config, npm help npmrc, and npm help config for more on managing npm's configuration. Authentication configuration such as auth tokens and certificates are configured specifically scoped to an individual registry. See \fBAuth Related Configuration\fR \fI\(la/configuring-npm/npmrc#auth-related-configuration\(ra\fR +.P +When the default registry is used in a package-lock or shrinkwrap it has the special meaning of "the currently configured registry". If you create a lock file while using the default registry you can switch to another registry and npm will install packages from the new registry, but if you create a lock file while using a custom registry packages will be installed from that registry even after you change to another registry. +.SS "Does npm send any information about me back to the registry?" +.P +Yes. +.P +When making requests of the registry npm adds two headers with information about your environment: +.RS 0 +.IP \(bu 4 +\fBNpm-Scope\fR \[en] If your project is scoped, this header will contain its scope. In the future npm hopes to build registry features that use this information to allow you to customize your experience for your organization. +.IP \(bu 4 +\fBNpm-In-CI\fR \[en] Set to "true" if npm believes this install is running in a continuous integration environment, "false" otherwise. This is detected by looking for the following environment variables: \fBCI\fR, \fBTDDIUM\fR, \fBJENKINS_URL\fR, \fBbamboo.buildKey\fR. If you'd like to learn more you may find the \fBoriginal PR\fR \fI\(lahttps://github.com/npm/npm-registry-client/pull/129\(ra\fR interesting. This is used to gather better metrics on how npm is used by humans, versus build farms. +.RE 0 + +.P +The npm registry does not try to correlate the information in these headers with any authenticated accounts that may be used in the same requests. +.SS "How can I prevent my package from being published in the official registry?" +.P +Set \fB"private": true\fR in your \fBpackage.json\fR to prevent it from being published at all, or \fB"publishConfig":{"registry":"http://my-internal-registry.local"}\fR to force it to be published only to your internal/private registry. +.P +See \fB\[rs]fBpackage.json\[rs]fR\fR \fI\(la/configuring-npm/package-json\(ra\fR for more info on what goes in the package.json file. +.SS "Where can I find my (and others') published packages?" +.P +\fI\(lahttps://www.npmjs.com/\(ra\fR +.SS "See also" +.RS 0 +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help config +.IP \(bu 4 +npm help npmrc +.IP \(bu 4 +npm help developers +.RE 0 diff --git a/node24/node_modules/npm/man/man7/removal.7 b/node24/node_modules/npm/man/man7/removal.7 new file mode 100644 index 0000000000000000000000000000000000000000..8b866dd861488bbf14ab3b0ca9c4ab3348c8a4fc --- /dev/null +++ b/node24/node_modules/npm/man/man7/removal.7 @@ -0,0 +1,54 @@ +.TH "REMOVAL" "7" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBRemoval\fR - Cleaning the slate +.SS "Synopsis" +.P +So sad to see you go. +.P +.RS 2 +.nf +sudo npm uninstall npm -g +.fi +.RE +.P +Or, if that fails, please proceed to more severe uninstalling methods. +.SS "More Severe Uninstalling" +.P +Usually, the above instructions are sufficient. That will remove npm, but leave behind anything you've installed. +.P +If that doesn't work, or if you require more drastic measures, continue reading. +.P +Note that this is only necessary for globally-installed packages. Local installs are completely contained within a project's \fBnode_modules\fR folder. Delete that folder, and everything is gone unless a package's install script is particularly ill-behaved. +.P +This assumes that you installed node and npm in the default place. If you configured node with a different \fB--prefix\fR, or installed npm with a different prefix setting, then adjust the paths accordingly, replacing \fB/usr/local\fR with your install prefix. +.P +To remove everything npm-related manually: +.P +.RS 2 +.nf +rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm* +.fi +.RE +.P +If you installed things \fIwith\fR npm, then your best bet is to uninstall them with npm first, and then install them again once you have a proper install. This can help find any symlinks that are lying around: +.P +.RS 2 +.nf +ls -laF /usr/local/{lib/node{,/.npm},bin,share/man} | grep npm +.fi +.RE +.P +Prior to version 0.3, npm used shim files for executables and node modules. To track those down, you can do the following: +.P +.RS 2 +.nf +find /usr/local/{lib/node,bin} -exec grep -l npm \[rs]{\[rs]} \[rs]; ; +.fi +.RE +.SS "See also" +.RS 0 +.IP \(bu 4 +npm help uninstall +.IP \(bu 4 +npm help prune +.RE 0 diff --git a/node24/node_modules/npm/man/man7/scope.7 b/node24/node_modules/npm/man/man7/scope.7 new file mode 100644 index 0000000000000000000000000000000000000000..3fea2731123c386c288aa5283fe719608cb1c7c8 --- /dev/null +++ b/node24/node_modules/npm/man/man7/scope.7 @@ -0,0 +1,113 @@ +.TH "SCOPE" "7" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBScope\fR - Scoped packages +.SS "Description" +.P +All npm packages have a name. Some package names also have a scope. A scope follows the usual rules for package names (URL-safe characters, no leading dots or underscores). When used in package names, scopes are preceded by an \fB@\fR symbol and followed by a slash, e.g. +.P +.RS 2 +.nf +@somescope/somepackagename +.fi +.RE +.P +Scopes are a way of grouping related packages together, and also affect a few things about the way npm treats the package. +.P +Each npm user/organization has their own scope, and only you can add packages in your scope. This means you don't have to worry about someone taking your package name ahead of you. Thus it is also a good way to signal official packages for organizations. +.P +Scoped packages can be published and installed as of \fBnpm@2\fR and are supported by the primary npm registry. Unscoped packages can depend on scoped packages and vice versa. The npm client is backwards-compatible with unscoped registries, so it can be used to work with scoped and unscoped registries at the same time. +.SS "Installing scoped packages" +.P +Scoped packages are installed to a sub-folder of the regular installation folder, e.g. if your other packages are installed in \fBnode_modules/packagename\fR, scoped modules will be installed in \fBnode_modules/@myorg/packagename\fR. The scope folder (\fB@myorg\fR) is simply the name of the scope preceded by an \fB@\fR symbol, and can contain any number of scoped packages. +.P +A scoped package is installed by referencing it by name, preceded by an \fB@\fR symbol, in \fBnpm install\fR: +.P +.RS 2 +.nf +npm install @myorg/mypackage +.fi +.RE +.P +Or in \fBpackage.json\fR: +.P +.RS 2 +.nf +"dependencies": { + "@myorg/mypackage": "^1.3.0" +} +.fi +.RE +.P +Note that if the \fB@\fR symbol is omitted, in either case, npm will instead attempt to install from GitHub; see npm help install. +.SS "Requiring scoped packages" +.P +Because scoped packages are installed into a scope folder, you have to include the name of the scope when requiring them in your code, e.g. +.P +.RS 2 +.nf +require('@myorg/mypackage') +.fi +.RE +.P +There is nothing special about the way Node treats scope folders. This simply requires the \fBmypackage\fR module in the folder named \fB@myorg\fR. +.SS "Publishing scoped packages" +.P +Scoped packages can be published from the CLI as of \fBnpm@2\fR and can be published to any registry that supports them, including the primary npm registry. +.P +(As of 2015-04-19, and with npm 2.0 or better, the primary npm registry \fBdoes\fR support scoped packages.) +.P +If you wish, you may associate a scope with a registry; see below. +.SS "Publishing public scoped packages to the primary npm registry" +.P +Publishing to a scope, you have two options: +.RS 0 +.IP \(bu 4 +Publishing to your user scope (example: \fB@username/module\fR) +.IP \(bu 4 +Publishing to an organization scope (example: \fB@org/module\fR) +.RE 0 + +.P +If publishing a public module to an organization scope, you must first either create an organization with the name of the scope that you'd like to publish to or be added to an existing organization with the appropriate permissions. For example, if you'd like to publish to \fB@org\fR, you would need to create the \fBorg\fR organization on npmjs.com prior to trying to publish. +.P +Scoped packages are not public by default. You will need to specify \fB--access public\fR with the initial \fBnpm publish\fR command. This will publish the package and set access to \fBpublic\fR as if you had run \fBnpm access public\fR after publishing. You do not need to do this when publishing new versions of an existing scoped package. +.SS "Publishing private scoped packages to the npm registry" +.P +To publish a private scoped package to the npm registry, you must have an \fBnpm Private Modules\fR \fI\(lahttps://docs.npmjs.com/private-modules/intro\(ra\fR account. +.P +You can then publish the module with \fBnpm publish\fR or \fBnpm publish +--access restricted\fR, and it will be present in the npm registry, with restricted access. You can then change the access permissions, if desired, with \fBnpm access\fR or on the npmjs.com website. +.SS "Associating a scope with a registry" +.P +Scopes can be associated with a separate registry. This allows you to seamlessly use a mix of packages from the primary npm registry and one or more private registries, such as \fBGitHub Packages\fR \fI\(lahttps://github.com/features/packages\(ra\fR or the open source \fBVerdaccio\fR \fI\(lahttps://verdaccio.org\(ra\fR project. +.P +You can associate a scope with a registry at login, e.g. +.P +.RS 2 +.nf +npm login --registry=http://reg.example.com --scope=@myco +.fi +.RE +.P +Scopes have a many-to-one relationship with registries: one registry can host multiple scopes, but a scope only ever points to one registry. +.P +You can also associate a scope with a registry using \fBnpm config\fR: +.P +.RS 2 +.nf +npm config set @myco:registry=http://reg.example.com +.fi +.RE +.P +Once a scope is associated with a registry, any \fBnpm install\fR for a package with that scope will request packages from that registry instead. Any \fBnpm publish\fR for a package name that contains the scope will be published to that registry instead. +.SS "See also" +.RS 0 +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help publish +.IP \(bu 4 +npm help access +.IP \(bu 4 +npm help registry +.RE 0 diff --git a/node24/node_modules/npm/man/man7/scripts.7 b/node24/node_modules/npm/man/man7/scripts.7 new file mode 100644 index 0000000000000000000000000000000000000000..e30b9cc44ac754df528d84e5d40af4dff16af3f8 --- /dev/null +++ b/node24/node_modules/npm/man/man7/scripts.7 @@ -0,0 +1,457 @@ +.TH "SCRIPTS" "7" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBScripts\fR - How npm handles the "scripts" field +.SS "Description" +.P +The \fB"scripts"\fR property of your \fBpackage.json\fR file supports a number of built-in scripts and their preset life cycle events as well as arbitrary scripts. These all can be executed by running \fBnpm run \fR. \fIPre\fR and \fIpost\fR commands with matching names will be run for those as well (e.g. \fBpremyscript\fR, \fBmyscript\fR, \fBpostmyscript\fR). Scripts from dependencies can be run with \fBnpm explore -- npm run \fR. +.SS "Pre & Post Scripts" +.P +To create "pre" or "post" scripts for any scripts defined in the \fB"scripts"\fR section of the \fBpackage.json\fR, simply create another script \fIwith a matching name\fR and add "pre" or "post" to the beginning of them. +.P +.RS 2 +.nf +{ + "scripts": { + "precompress": "{{ executes BEFORE the `compress` script }}", + "compress": "{{ run command to compress files }}", + "postcompress": "{{ executes AFTER `compress` script }}" + } +} +.fi +.RE +.P +In this example \fBnpm run compress\fR would execute these scripts as described. +.SS "Life Cycle Scripts" +.P +There are some special life cycle scripts that happen only in certain situations. These scripts happen in addition to the \fBpre\fR, \fBpost\fR, and \fB\fR scripts. +.RS 0 +.IP \(bu 4 +\fBprepare\fR, \fBprepublish\fR, \fBprepublishOnly\fR, \fBprepack\fR, \fBpostpack\fR, \fBdependencies\fR +.RE 0 + +.P +\fBprepare\fR (since \fBnpm@4.0.0\fR) +.RS 0 +.IP \(bu 4 +Runs BEFORE the package is packed, i.e. during \fBnpm publish\fR and \fBnpm pack\fR +.IP \(bu 4 +Runs on local \fBnpm install\fR without package arguments (runs with flags like \fB--production\fR or \fB--omit=dev\fR, but does not run when installing specific packages like \fBnpm install express\fR) +.IP \(bu 4 +Runs AFTER \fBprepublishOnly\fR and \fBprepack\fR, but BEFORE \fBpostpack\fR +.IP \(bu 4 +Runs for a package if it's being installed as a link through \fBnpm install \fR +.IP \(bu 4 +NOTE: If a package being installed through git contains a \fBprepare\fR script, its \fBdependencies\fR and \fBdevDependencies\fR will be installed, and the prepare script will be run, before the package is packaged and installed. +.IP \(bu 4 +As of \fBnpm@7\fR these scripts run in the background. To see the output, run with: \fB--foreground-scripts\fR. +.IP \(bu 4 +\fBIn workspaces, prepare scripts run concurrently\fR across all packages. If you have interdependent packages where one must build before another, consider using \fB--foreground-scripts\fR (which can be set in \fB.npmrc\fR with \fBforeground-scripts=true\fR) to run scripts sequentially, or structure your build differently. +.RE 0 + +.P +\fBprepublish\fR (DEPRECATED) +.RS 0 +.IP \(bu 4 +Does not run during \fBnpm publish\fR, but does run during \fBnpm ci\fR and \fBnpm install\fR. See below for more info. +.RE 0 + +.P +\fBprepublishOnly\fR +.RS 0 +.IP \(bu 4 +Runs BEFORE the package is prepared and packed, ONLY on \fBnpm publish\fR. +.RE 0 + +.P +\fBprepack\fR +.RS 0 +.IP \(bu 4 +Runs BEFORE a tarball is packed (on "\fBnpm pack\fR", "\fBnpm publish\fR", and when installing a git dependency). +.IP \(bu 4 +NOTE: "\fBnpm run pack\fR" is NOT the same as "\fBnpm pack\fR". "\fBnpm run pack\fR" is an arbitrary user defined script name, whereas, "\fBnpm pack\fR" is a CLI defined command. +.RE 0 + +.P +\fBpostpack\fR +.RS 0 +.IP \(bu 4 +Runs AFTER the tarball has been generated but before it is moved to its final destination (if at all, publish does not save the tarball locally) +.RE 0 + +.P +\fBdependencies\fR +.RS 0 +.IP \(bu 4 +Runs AFTER any operations that modify the \fBnode_modules\fR directory IF changes occurred. +.IP \(bu 4 +Does NOT run in global mode +.RE 0 + +.SS "Prepare and Prepublish" +.P +\fBDeprecation Note: prepublish\fR +.P +Since \fBnpm@1.1.71\fR, the npm CLI has run the \fBprepublish\fR script for both \fBnpm publish\fR and \fBnpm install\fR, because it's a convenient way to prepare a package for use (some common use cases are described in the section below). It has also turned out to be, in practice, \fBvery confusing\fR \fI\(lahttps://github.com/npm/npm/issues/10074\(ra\fR. As of \fBnpm@4.0.0\fR, a new event has been introduced, \fBprepare\fR, that preserves this existing behavior. A \fInew\fR event, \fBprepublishOnly\fR has been added as a transitional strategy to allow users to avoid the confusing behavior of existing npm versions and only run on \fBnpm publish\fR (for instance, running the tests one last time to ensure they're in good shape). +.P +See \fI\(lahttps://github.com/npm/npm/issues/10074\(ra\fR for a much lengthier justification, with further reading, for this change. +.P +\fBUse Cases\fR +.P +Use a \fBprepare\fR script to perform build tasks that are platform-independent and need to run before your package is used. This includes tasks such as: +.RS 0 +.IP \(bu 4 +Compiling TypeScript or other source code into JavaScript. +.IP \(bu 4 +Creating minified versions of JavaScript source code. +.IP \(bu 4 +Fetching remote resources that your package will use. +.RE 0 + +.P +Running these build tasks in the \fBprepare\fR script ensures they happen once, in a single place, reducing complexity and variability. Additionally, this means that: +.RS 0 +.IP \(bu 4 +You can depend on build tools as \fBdevDependencies\fR, and thus your users don't need to have them installed. +.IP \(bu 4 +You don't need to include minifiers in your package, reducing the size for your users. +.IP \(bu 4 +You don't need to rely on your users having \fBcurl\fR or \fBwget\fR or other system tools on the target machines. +.RE 0 + +.SS "Dependencies" +.P +The \fBdependencies\fR script is run any time an \fBnpm\fR command causes changes to the \fBnode_modules\fR directory. It is run AFTER the changes have been applied and the \fBpackage.json\fR and \fBpackage-lock.json\fR files have been updated. +.SS "Life Cycle Operation Order" +.SS "npm help \"cache add\"" +.RS 0 +.IP \(bu 4 +\fBprepare\fR +.RE 0 + +.SS "npm help ci" +.RS 0 +.IP \(bu 4 +\fBpreinstall\fR +.IP \(bu 4 +\fBinstall\fR +.IP \(bu 4 +\fBpostinstall\fR +.IP \(bu 4 +\fBprepublish\fR +.IP \(bu 4 +\fBpreprepare\fR +.IP \(bu 4 +\fBprepare\fR +.IP \(bu 4 +\fBpostprepare\fR +.RE 0 + +.P +These all run after the actual installation of modules into \fBnode_modules\fR, in order, with no internal actions happening in between +.SS "npm help diff" +.RS 0 +.IP \(bu 4 +\fBprepare\fR +.RE 0 + +.SS "npm help install" +.P +These also run when you run \fBnpm install -g \fR +.RS 0 +.IP \(bu 4 +\fBpreinstall\fR +.IP \(bu 4 +\fBinstall\fR +.IP \(bu 4 +\fBpostinstall\fR +.IP \(bu 4 +\fBprepublish\fR +.IP \(bu 4 +\fBpreprepare\fR +.IP \(bu 4 +\fBprepare\fR +.IP \(bu 4 +\fBpostprepare\fR +.RE 0 + +.P +If there is a \fBbinding.gyp\fR file in the root of your package and you haven't defined your own \fBinstall\fR or \fBpreinstall\fR scripts, npm will default the \fBinstall\fR command to compile using node-gyp via \fBnode-gyp rebuild\fR +.P +These are run from the scripts of \fB\fR +.SS "npm help pack" +.RS 0 +.IP \(bu 4 +\fBprepack\fR +.IP \(bu 4 +\fBprepare\fR +.IP \(bu 4 +\fBpostpack\fR +.RE 0 + +.SS "npm help publish" +.RS 0 +.IP \(bu 4 +\fBprepublishOnly\fR +.IP \(bu 4 +\fBprepack\fR +.IP \(bu 4 +\fBprepare\fR +.IP \(bu 4 +\fBpostpack\fR +.IP \(bu 4 +\fBpublish\fR +.IP \(bu 4 +\fBpostpublish\fR +.RE 0 + +.SS "npm help rebuild" +.RS 0 +.IP \(bu 4 +\fBpreinstall\fR +.IP \(bu 4 +\fBinstall\fR +.IP \(bu 4 +\fBpostinstall\fR +.IP \(bu 4 +\fBprepare\fR +.RE 0 + +.P +\fBprepare\fR is only run if the current directory is a symlink (e.g. with linked packages) +.SS "npm help restart" +.P +If there is a \fBrestart\fR script defined, these events are run; otherwise, \fBstop\fR and \fBstart\fR are both run if present, including their \fBpre\fR and \fBpost\fR iterations) +.RS 0 +.IP \(bu 4 +\fBprerestart\fR +.IP \(bu 4 +\fBrestart\fR +.IP \(bu 4 +\fBpostrestart\fR +.RE 0 + +.SS "\fB\[rs]fBnpm run \[rs]fR\fR \fI\(la/commands/npm-run\(ra\fR" +.RS 0 +.IP \(bu 4 +\fBpre\fR +.IP \(bu 4 +\fB\fR +.IP \(bu 4 +\fBpost\fR +.RE 0 + +.SS "npm help start" +.RS 0 +.IP \(bu 4 +\fBprestart\fR +.IP \(bu 4 +\fBstart\fR +.IP \(bu 4 +\fBpoststart\fR +.RE 0 + +.P +If there is a \fBserver.js\fR file in the root of your package, then npm will default the \fBstart\fR command to \fBnode server.js\fR. \fBprestart\fR and \fBpoststart\fR will still run in this case. +.SS "npm help stop" +.RS 0 +.IP \(bu 4 +\fBprestop\fR +.IP \(bu 4 +\fBstop\fR +.IP \(bu 4 +\fBpoststop\fR +.RE 0 + +.SS "npm help test" +.RS 0 +.IP \(bu 4 +\fBpretest\fR +.IP \(bu 4 +\fBtest\fR +.IP \(bu 4 +\fBposttest\fR +.RE 0 + +.SS "npm help version" +.RS 0 +.IP \(bu 4 +\fBpreversion\fR +.IP \(bu 4 +\fBversion\fR +.IP \(bu 4 +\fBpostversion\fR +.RE 0 + +.SS "A Note on a lack of npm help uninstall scripts" +.P +While npm v6 had \fBuninstall\fR lifecycle scripts, npm v7 does not. Removal of a package can happen for a wide variety of reasons, and there's no clear way to currently give the script enough context to be useful. +.P +Reasons for a package removal include: +.RS 0 +.IP \(bu 4 +a user directly uninstalled this package +.IP \(bu 4 +a user uninstalled a dependent package and so this dependency is being uninstalled +.IP \(bu 4 +a user uninstalled a dependent package but another package also depends on this version +.IP \(bu 4 +this version has been merged as a duplicate with another version +.IP \(bu 4 +etc. +.RE 0 + +.P +Due to the lack of necessary context, \fBuninstall\fR lifecycle scripts are not implemented and will not function. +.SS "Working Directory for Scripts" +.P +Scripts are always run from the root of the package folder, regardless of what the current working directory is when \fBnpm\fR is invoked. This means your scripts can reliably assume they are running in the package root. +.P +If you want your script to behave differently based on the directory you were in when you ran \fBnpm\fR, you can use the \fBINIT_CWD\fR environment variable, which holds the full path you were in when you ran \fBnpm run\fR. +.SS "Historical Behavior in Older npm Versions" +.P +For npm v6 and earlier, scripts were generally run from the root of the package, but there were rare cases and bugs in older versions where this was not guaranteed. If your package must support very old npm versions, you may wish to add a safeguard in your scripts (for example, by checking process.cwd()). +.P +For more details, see: +.RS 0 +.IP \(bu 4 +\fBnpm v7 release notes\fR \fI\(lahttps://github.com/npm/cli/releases/tag/v7.0.0\(ra\fR +.IP \(bu 4 +\fBDiscussion about script working directory reliability in npm v6 and earlier\fR \fI\(lahttps://github.com/npm/npm/issues/12356\(ra\fR +.RE 0 + +.SS "Environment" +.P +Package scripts run in an environment where many pieces of information are made available regarding the setup of npm and the current state of the process. +.SS "path" +.P +If you depend on modules that define executable scripts, like test suites, then those executables will be added to the \fBPATH\fR for executing the scripts. So, if your package.json has this: +.P +.RS 2 +.nf +{ + "name" : "foo", + "dependencies" : { + "bar" : "0.1.x" + }, + "scripts": { + "start" : "bar ./test" + } +} +.fi +.RE +.P +then you could run \fBnpm start\fR to execute the \fBbar\fR script, which is exported into the \fBnode_modules/.bin\fR directory on \fBnpm install\fR. +.SS "package.json vars" +.P +npm sets the following environment variables from the package.json: +.RS 0 +.IP \(bu 4 +\fBnpm_package_name\fR - The package name +.IP \(bu 4 +\fBnpm_package_version\fR - The package version +.IP \(bu 4 +\fBnpm_package_bin_*\fR - Each executable defined in the bin field +.IP \(bu 4 +\fBnpm_package_engines_*\fR - Each engine defined in the engines field +.IP \(bu 4 +\fBnpm_package_config_*\fR - Each config value defined in the config field +.IP \(bu 4 +\fBnpm_package_json\fR - The full path to the package.json file +.RE 0 + +.P +Additionally, for install scripts (\fBpreinstall\fR, \fBinstall\fR, \fBpostinstall\fR), npm sets these environment variables: +.RS 0 +.IP \(bu 4 +\fBnpm_package_resolved\fR - The resolved URL for the package +.IP \(bu 4 +\fBnpm_package_integrity\fR - The integrity hash for the package +.IP \(bu 4 +\fBnpm_package_optional\fR - Set to \fB"true"\fR if the package is optional +.IP \(bu 4 +\fBnpm_package_dev\fR - Set to \fB"true"\fR if the package is a dev dependency +.IP \(bu 4 +\fBnpm_package_peer\fR - Set to \fB"true"\fR if the package is a peer dependency +.IP \(bu 4 +\fBnpm_package_dev_optional\fR - Set to \fB"true"\fR if the package is both dev and optional +.RE 0 + +.P +For example, if you had \fB{"name":"foo", "version":"1.2.5"}\fR in your package.json file, then your package scripts would have the \fBnpm_package_name\fR environment variable set to "foo", and the \fBnpm_package_version\fR set to "1.2.5". You can access these variables in your code with \fBprocess.env.npm_package_name\fR and \fBprocess.env.npm_package_version\fR. +.P +\fBNote:\fR In npm 7 and later, most package.json fields are no longer provided as environment variables. Scripts that need access to other package.json fields should read the package.json file directly. The \fBnpm_package_json\fR environment variable provides the path to the file for this purpose. +.P +See \fB\[rs]fBpackage.json\[rs]fR\fR \fI\(la/configuring-npm/package-json\(ra\fR for more on package configs. +.SS "current lifecycle event" +.P +Lastly, the \fBnpm_lifecycle_event\fR environment variable is set to whichever stage of the cycle is being executed. So, you could have a single script used for different parts of the process which switches based on what's currently happening. +.P +Objects are flattened following this format, so if you had \fB{"scripts":{"install":"foo.js"}}\fR in your package.json, then you'd see this in the script: +.P +.RS 2 +.nf +process.env.npm_package_scripts_install === "foo.js" +.fi +.RE +.SS "Examples" +.P +For example, if your package.json contains this: +.P +.RS 2 +.nf +{ + "scripts" : { + "prepare" : "scripts/build.js", + "test" : "scripts/test.js" + } +} +.fi +.RE +.P +then \fBscripts/build.js\fR will be called for the prepare stage of the lifecycle, and you can check the \fBnpm_lifecycle_event\fR environment variable if your script needs to behave differently in different contexts. +.P +If you want to run build commands, you can do so. This works just fine: +.P +.RS 2 +.nf +{ + "scripts" : { + "prepare" : "npm run build", + "build" : "tsc", + "test" : "jest" + } +} +.fi +.RE +.SS "Exiting" +.P +Scripts are run by passing the line as a script argument to \fB/bin/sh\fR on POSIX systems or \fBcmd.exe\fR on Windows. You can control which shell is used by setting the \fB\[rs]fBscript-shell\[rs]fR\fR \fI\(la/using-npm/config#script-shell\(ra\fR configuration option. +.P +If the script exits with a code other than 0, then this will abort the process. +.P +Note that these script files don't have to be Node.js or even JavaScript programs. They just have to be some kind of executable file. +.SS "Best Practices" +.RS 0 +.IP \(bu 4 +Don't exit with a non-zero error code unless you \fIreally\fR mean it. If the failure is minor or only will prevent some optional features, then it's better to just print a warning and exit successfully. +.IP \(bu 4 +Try not to use scripts to do what npm can do for you. Read through \fB\[rs]fBpackage.json\[rs]fR\fR \fI\(la/configuring-npm/package-json\(ra\fR to see all the things that you can specify and enable by simply describing your package appropriately. In general, this will lead to a more robust and consistent state. +.IP \(bu 4 +Inspect the env to determine where to put things. For instance, if the \fBNPM_CONFIG_BINROOT\fR environment variable is set to \fB/home/user/bin\fR, then don't try to install executables into \fB/usr/local/bin\fR. The user probably set it up that way for a reason. +.IP \(bu 4 +Don't prefix your script commands with "sudo". If root permissions are required for some reason, then it'll fail with that error, and the user will sudo the npm command in question. +.IP \(bu 4 +Don't use \fBinstall\fR. Use a \fB.gyp\fR file for compilation, and \fBprepare\fR for anything else. You should almost never have to explicitly set a preinstall or install script. If you are doing this, please consider if there is another option. The only valid use of \fBinstall\fR or \fBpreinstall\fR scripts is for compilation which must be done on the target architecture. +.RE 0 + +.SS "See Also" +.RS 0 +.IP \(bu 4 +npm help run +.IP \(bu 4 +\fBpackage.json\fR \fI\(la/configuring-npm/package-json\(ra\fR +.IP \(bu 4 +npm help developers +.IP \(bu 4 +npm help install +.RE 0 diff --git a/node24/node_modules/npm/man/man7/workspaces.7 b/node24/node_modules/npm/man/man7/workspaces.7 new file mode 100644 index 0000000000000000000000000000000000000000..aee4de3efed4ac8e28cdada7a411f5e816d68ea3 --- /dev/null +++ b/node24/node_modules/npm/man/man7/workspaces.7 @@ -0,0 +1,236 @@ +.TH "WORKSPACES" "7" "March 2026" "NPM@11.12.1" "" +.SH "NAME" +\fBWorkspaces\fR - Working with workspaces +.SS "Description" +.P +\fBWorkspaces\fR is a generic term that refers to the set of features in the npm cli that provides support for managing multiple packages from your local file system from within a singular top-level, root package. +.P +This set of features makes up for a much more streamlined workflow handling linked packages from the local file system. It automates the linking process as part of \fBnpm install\fR and removes the need to manually use \fBnpm link\fR in order to add references to packages that should be symlinked into the current \fBnode_modules\fR folder. +.P +We also refer to these packages being auto-symlinked during \fBnpm install\fR as a single \fBworkspace\fR, meaning it's a nested package within the current local file system that is explicitly defined in the \fB\[rs]fBpackage.json\[rs]fR\fR \fI\(la/configuring-npm/package-json#workspaces\(ra\fR \fBworkspaces\fR configuration. +.SS "Defining workspaces" +.P +Workspaces are usually defined via the \fBworkspaces\fR property of the \fB\[rs]fBpackage.json\[rs]fR\fR \fI\(la/configuring-npm/package-json#workspaces\(ra\fR file, e.g: +.P +.RS 2 +.nf +{ + "name": "my-workspaces-powered-project", + "workspaces": \[lB] + "packages/a" + \[rB] +} +.fi +.RE +.P +Given the above \fBpackage.json\fR example living at a current working directory \fB.\fR that contains a folder named \fBpackages/a\fR that itself contains a \fBpackage.json\fR inside it, defining a Node.js package, e.g: +.P +.RS 2 +.nf +. ++-- package.json +`-- packages + +-- a + | `-- package.json +.fi +.RE +.P +The expected result once running \fBnpm install\fR in this current working directory \fB.\fR is that the folder \fBpackages/a\fR will get symlinked to the \fBnode_modules\fR folder of the current working dir. +.P +Below is a post \fBnpm install\fR example, given that same previous example structure of files and folders: +.P +.RS 2 +.nf +. ++-- node_modules +| `-- a -> ../packages/a ++-- package-lock.json ++-- package.json +`-- packages + +-- a + | `-- package.json +.fi +.RE +.SS "Getting started with workspaces" +.P +You may automate the required steps to define a new workspace using npm help init. For example in a project that already has a \fBpackage.json\fR defined you can run: +.P +.RS 2 +.nf +npm init -w ./packages/a +.fi +.RE +.P +This command will create the missing folders and a new \fBpackage.json\fR file (if needed) while also making sure to properly configure the \fB"workspaces"\fR property of your root project \fBpackage.json\fR. +.SS "Adding dependencies to a workspace" +.P +It's possible to directly add/remove/update dependencies of your workspaces using the \fB\[rs]fBworkspace\[rs]fR config\fR \fI\(la/using-npm/config#workspace\(ra\fR. +.P +For example, assuming the following structure: +.P +.RS 2 +.nf +. ++-- package.json +`-- packages + +-- a + | `-- package.json + `-- b + `-- package.json +.fi +.RE +.P +If you want to add a dependency named \fBabbrev\fR from the registry as a dependency of your workspace \fBa\fR, you may use the workspace config to tell the npm installer that package should be added as a dependency of the provided workspace: +.P +.RS 2 +.nf +npm install abbrev -w a +.fi +.RE +.P +\fBAdding a workspace as a dependency of another workspace:\fR +.P +The same approach works when adding one workspace as a dependency of another. If you want to add workspace \fBb\fR as a dependency of workspace \fBa\fR, run: +.P +.RS 2 +.nf +npm install b -w a +.fi +.RE +.P +npm will detect that \fBb\fR is a workspace and automatically symlink it rather than fetching it from the registry. The resulting entry in workspace \fBa\fR's \fBpackage.json\fR will use a standard version range: +.P +.RS 2 +.nf +{ + "dependencies": { + "b": "^1.0.0" + } +} +.fi +.RE +.P +Note: other installing commands such as \fBuninstall\fR, \fBci\fR, etc will also respect the provided \fBworkspace\fR configuration. +.SS "Using workspaces" +.P +Given the \fBspecifics of how Node.js handles module resolution\fR \fI\(lahttps://nodejs.org/dist/latest-v14.x/docs/api/modules.html#modules_all_together\(ra\fR it's possible to consume any defined workspace by its declared \fBpackage.json\fR \fBname\fR. Continuing from the example defined above, let's also create a Node.js script that will require the workspace \fBa\fR example module, e.g: +.P +.RS 2 +.nf +// ./packages/a/index.js +module.exports = 'a' + +// ./lib/index.js +const moduleA = require('a') +console.log(moduleA) // -> a +.fi +.RE +.P +When running it with: +.P +\fBnode lib/index.js\fR +.P +This demonstrates how the nature of \fBnode_modules\fR resolution allows for \fBworkspaces\fR to enable a portable workflow for requiring each \fBworkspace\fR in such a way that is also easy to npm help publish these nested workspaces to be consumed elsewhere. +.SS "Running commands in the context of workspaces" +.P +You can use the \fBworkspace\fR configuration option to run commands in the context of a configured workspace. Additionally, if your current directory is in a workspace, the \fBworkspace\fR configuration is implicitly set, and \fBprefix\fR is set to the root workspace. +.P +Following is a quick example on how to use the \fBnpm run\fR command in the context of nested workspaces. For a project containing multiple workspaces, e.g: +.P +.RS 2 +.nf +. ++-- package.json +`-- packages + +-- a + | `-- package.json + `-- b + `-- package.json +.fi +.RE +.P +By running a command using the \fBworkspace\fR option, it's possible to run the given command in the context of that specific workspace. e.g: +.P +.RS 2 +.nf +npm run test --workspace=a +.fi +.RE +.P +You could also run the command within the workspace. +.P +.RS 2 +.nf +cd packages/a && npm run test +.fi +.RE +.P +Either will run the \fBtest\fR script defined within the \fB./packages/a/package.json\fR file. +.P +Please note that you can also specify this argument multiple times in the command-line in order to target multiple workspaces, e.g: +.P +.RS 2 +.nf +npm run test --workspace=a --workspace=b +.fi +.RE +.P +Or run the command for each workspace within the 'packages' folder: +.P +.RS 2 +.nf +npm run test --workspace=packages +.fi +.RE +.P +It's also possible to use the \fBworkspaces\fR (plural) configuration option to enable the same behavior but running that command in the context of \fBall\fR configured workspaces. e.g: +.P +.RS 2 +.nf +npm run test --workspaces +.fi +.RE +.P +Will run the \fBtest\fR script in both \fB./packages/a\fR and \fB./packages/b\fR. +.P +Commands will be run in each workspace in the order they appear in your \fBpackage.json\fR +.P +.RS 2 +.nf +{ + "workspaces": \[lB] "packages/a", "packages/b" \[rB] +} +.fi +.RE +.P +Order of run is different with: +.P +.RS 2 +.nf +{ + "workspaces": \[lB] "packages/b", "packages/a" \[rB] +} +.fi +.RE +.SS "Ignoring missing scripts" +.P +It is not required for all of the workspaces to implement scripts run with the \fBnpm run\fR command. +.P +By running the command with the \fB--if-present\fR flag, npm will ignore workspaces missing target script. +.P +.RS 2 +.nf +npm run test --workspaces --if-present +.fi +.RE +.SS "See also" +.RS 0 +.IP \(bu 4 +npm help install +.IP \(bu 4 +npm help publish +.IP \(bu 4 +npm help run +.IP \(bu 4 +npm help config +.RE 0 diff --git a/node24/node_modules/npm/node_modules/@gar/promise-retry/LICENSE b/node24/node_modules/npm/node_modules/@gar/promise-retry/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..b9e98d82a1cd8a300d43caf9ff4303db16226348 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@gar/promise-retry/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2011 Tim Koschützki (tim@debuggable.com), Felix Geisendörfer (felix@debuggable.com) +Copyright (c) 2014 IndigoUnited + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node24/node_modules/npm/node_modules/@gar/promise-retry/lib/index.js b/node24/node_modules/npm/node_modules/@gar/promise-retry/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2de4ff81ce2f2c70181fc7d4da28e946ffb3f3e6 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@gar/promise-retry/lib/index.js @@ -0,0 +1,62 @@ +const { RetryOperation } = require('./retry') + +const createTimeout = (attempt, opts) => Math.min(Math.round((1 + (opts.randomize ? Math.random() : 0)) * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt)), opts.maxTimeout) +const isRetryError = err => err?.code === 'EPROMISERETRY' && Object.hasOwn(err, 'retried') + +const promiseRetry = async (fn, options = {}) => { + let timeouts = [] + if (options instanceof Array) { + timeouts = [...options] + } else { + if (options.retries === Infinity) { + options.forever = true + delete options.retries + } + const opts = { + retries: 10, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: Infinity, + randomize: false, + ...options + } + if (opts.minTimeout > opts.maxTimeout) { + throw new Error('minTimeout is greater than maxTimeout') + } + if (opts.retries) { + for (let i = 0; i < opts.retries; i++) { + timeouts.push(createTimeout(i, opts)) + } + // sort the array numerically ascending (since the timeouts may be out of order at factor < 1) + timeouts.sort((a, b) => a - b) + } else if (options.forever) { + timeouts.push(createTimeout(0, opts)) + } + } + + const operation = new RetryOperation(timeouts, { + forever: options.forever, + unref: options.unref, + maxRetryTime: options.maxRetryTime + }) + + return new Promise(function (resolve, reject) { + operation.attempt(async number => { + try { + const result = await fn(err => { + throw Object.assign(new Error('Retrying'), { code: 'EPROMISERETRY', retried: err }) + }, number, operation) + return resolve(result) + } catch (err) { + if (!isRetryError(err)) { + return reject(err) + } + if (!operation.retry(err.retried || new Error())) { + return reject(err.retried) + } + } + }) + }) +} + +module.exports = { promiseRetry } diff --git a/node24/node_modules/npm/node_modules/@gar/promise-retry/lib/retry.js b/node24/node_modules/npm/node_modules/@gar/promise-retry/lib/retry.js new file mode 100644 index 0000000000000000000000000000000000000000..646b4fc805691bb3bb5c75145582420e55ea5e5e --- /dev/null +++ b/node24/node_modules/npm/node_modules/@gar/promise-retry/lib/retry.js @@ -0,0 +1,109 @@ +class RetryOperation { + #attempts = 1 + #cachedTimeouts = null + #errors = [] + #fn = null + #maxRetryTime + #operationStart = null + #originalTimeouts + #timeouts + #timer = null + #unref + + constructor (timeouts, options = {}) { + this.#originalTimeouts = [...timeouts] + this.#timeouts = [...timeouts] + this.#unref = options.unref + this.#maxRetryTime = options.maxRetryTime || Infinity + if (options.forever) { + this.#cachedTimeouts = [...this.#timeouts] + } + } + + get timeouts () { + return [...this.#timeouts] + } + + get errors () { + return [...this.#errors] + } + + get attempts () { + return this.#attempts + } + + get mainError () { + let mainError = null + if (this.#errors.length) { + let mainErrorCount = 0 + const counts = {} + for (let i = 0; i < this.#errors.length; i++) { + const error = this.#errors[i] + const { message } = error + if (!counts[message]) { + counts[message] = 0 + } + counts[message]++ + + if (counts[message] >= mainErrorCount) { + mainError = error + mainErrorCount = counts[message] + } + } + } + return mainError + } + + reset () { + this.#attempts = 1 + this.#timeouts = [...this.#originalTimeouts] + } + + stop () { + if (this.#timer) { + clearTimeout(this.#timer) + } + + this.#timeouts = [] + this.#cachedTimeouts = null + } + + retry (err) { + this.#errors.push(err) + if (new Date().getTime() - this.#operationStart >= this.#maxRetryTime) { + // XXX This puts the timeout error first, meaning it will never show as mainError, there may be no way to ever see this + this.#errors.unshift(new Error('RetryOperation timeout occurred')) + return false + } + + let timeout = this.#timeouts.shift() + if (timeout === undefined) { + // We're out of timeouts, clear the last error and repeat the final timeout + if (this.#cachedTimeouts) { + this.#errors.pop() + timeout = this.#cachedTimeouts.at(-1) + } else { + return false + } + } + + // TODO what if there already is a timer? + this.#timer = setTimeout(() => { + this.#attempts++ + this.#fn(this.#attempts) + }, timeout) + + if (this.#unref) { + this.#timer.unref() + } + + return true + } + + attempt (fn) { + this.#fn = fn + this.#operationStart = new Date().getTime() + this.#fn(this.#attempts) + } +} +module.exports = { RetryOperation } diff --git a/node24/node_modules/npm/node_modules/@gar/promise-retry/package.json b/node24/node_modules/npm/node_modules/@gar/promise-retry/package.json new file mode 100644 index 0000000000000000000000000000000000000000..362908c5305f5bacf907773b064c2e8192f464a2 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@gar/promise-retry/package.json @@ -0,0 +1,45 @@ +{ + "name": "@gar/promise-retry", + "version": "1.0.3", + "description": "Retries a function that returns a promise, leveraging the power of the retry module.", + "main": "./lib/index.js", + "files": [ + "lib" + ], + "type": "commonjs", + "exports": { + ".": [ + { + "default": "./lib/index.js", + "types": "./lib/index.d.ts" + }, + "./lib/index.js" + ] + }, + "scripts": { + "lint": "npx standard", + "lint:fix": "npx standard --fix", + "test": "node --test --experimental-test-coverage --test-coverage-lines=100 --test-coverage-functions=100 --test-coverage-branches=100", + "typelint": "npx -p typescript tsc ./lib/index.d.ts", + "posttest": "npm run lint", + "postlint": "npm run typelint" + }, + "bugs": { + "url": "https://github.com/wraithgar/node-promise-retry/issues/" + }, + "repository": { + "type": "git", + "url": "git://github.com/wraithgar/node-promise-retry.git" + }, + "keywords": [ + "retry", + "promise", + "backoff", + "repeat", + "replay" + ], + "license": "MIT", + "engines": { + "node": "^20.17.0 || >=22.9.0" + } +} diff --git a/node24/node_modules/npm/node_modules/@isaacs/fs-minipass/LICENSE b/node24/node_modules/npm/node_modules/@isaacs/fs-minipass/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..32eb517086ebb24cfe3dd076033211d444186dc9 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@isaacs/fs-minipass/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node24/node_modules/npm/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js b/node24/node_modules/npm/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ef71e40140c578ce2628d0318bcdaf292cfcbb14 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js @@ -0,0 +1,430 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WriteStreamSync = exports.WriteStream = exports.ReadStreamSync = exports.ReadStream = void 0; +const events_1 = __importDefault(require("events")); +const fs_1 = __importDefault(require("fs")); +const minipass_1 = require("minipass"); +const writev = fs_1.default.writev; +const _autoClose = Symbol('_autoClose'); +const _close = Symbol('_close'); +const _ended = Symbol('_ended'); +const _fd = Symbol('_fd'); +const _finished = Symbol('_finished'); +const _flags = Symbol('_flags'); +const _flush = Symbol('_flush'); +const _handleChunk = Symbol('_handleChunk'); +const _makeBuf = Symbol('_makeBuf'); +const _mode = Symbol('_mode'); +const _needDrain = Symbol('_needDrain'); +const _onerror = Symbol('_onerror'); +const _onopen = Symbol('_onopen'); +const _onread = Symbol('_onread'); +const _onwrite = Symbol('_onwrite'); +const _open = Symbol('_open'); +const _path = Symbol('_path'); +const _pos = Symbol('_pos'); +const _queue = Symbol('_queue'); +const _read = Symbol('_read'); +const _readSize = Symbol('_readSize'); +const _reading = Symbol('_reading'); +const _remain = Symbol('_remain'); +const _size = Symbol('_size'); +const _write = Symbol('_write'); +const _writing = Symbol('_writing'); +const _defaultFlag = Symbol('_defaultFlag'); +const _errored = Symbol('_errored'); +class ReadStream extends minipass_1.Minipass { + [_errored] = false; + [_fd]; + [_path]; + [_readSize]; + [_reading] = false; + [_size]; + [_remain]; + [_autoClose]; + constructor(path, opt) { + opt = opt || {}; + super(opt); + this.readable = true; + this.writable = false; + if (typeof path !== 'string') { + throw new TypeError('path must be a string'); + } + this[_errored] = false; + this[_fd] = typeof opt.fd === 'number' ? opt.fd : undefined; + this[_path] = path; + this[_readSize] = opt.readSize || 16 * 1024 * 1024; + this[_reading] = false; + this[_size] = typeof opt.size === 'number' ? opt.size : Infinity; + this[_remain] = this[_size]; + this[_autoClose] = + typeof opt.autoClose === 'boolean' ? opt.autoClose : true; + if (typeof this[_fd] === 'number') { + this[_read](); + } + else { + this[_open](); + } + } + get fd() { + return this[_fd]; + } + get path() { + return this[_path]; + } + //@ts-ignore + write() { + throw new TypeError('this is a readable stream'); + } + //@ts-ignore + end() { + throw new TypeError('this is a readable stream'); + } + [_open]() { + fs_1.default.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd)); + } + [_onopen](er, fd) { + if (er) { + this[_onerror](er); + } + else { + this[_fd] = fd; + this.emit('open', fd); + this[_read](); + } + } + [_makeBuf]() { + return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain])); + } + [_read]() { + if (!this[_reading]) { + this[_reading] = true; + const buf = this[_makeBuf](); + /* c8 ignore start */ + if (buf.length === 0) { + return process.nextTick(() => this[_onread](null, 0, buf)); + } + /* c8 ignore stop */ + fs_1.default.read(this[_fd], buf, 0, buf.length, null, (er, br, b) => this[_onread](er, br, b)); + } + } + [_onread](er, br, buf) { + this[_reading] = false; + if (er) { + this[_onerror](er); + } + else if (this[_handleChunk](br, buf)) { + this[_read](); + } + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd]; + this[_fd] = undefined; + fs_1.default.close(fd, er => er ? this.emit('error', er) : this.emit('close')); + } + } + [_onerror](er) { + this[_reading] = true; + this[_close](); + this.emit('error', er); + } + [_handleChunk](br, buf) { + let ret = false; + // no effect if infinite + this[_remain] -= br; + if (br > 0) { + ret = super.write(br < buf.length ? buf.subarray(0, br) : buf); + } + if (br === 0 || this[_remain] <= 0) { + ret = false; + this[_close](); + super.end(); + } + return ret; + } + emit(ev, ...args) { + switch (ev) { + case 'prefinish': + case 'finish': + return false; + case 'drain': + if (typeof this[_fd] === 'number') { + this[_read](); + } + return false; + case 'error': + if (this[_errored]) { + return false; + } + this[_errored] = true; + return super.emit(ev, ...args); + default: + return super.emit(ev, ...args); + } + } +} +exports.ReadStream = ReadStream; +class ReadStreamSync extends ReadStream { + [_open]() { + let threw = true; + try { + this[_onopen](null, fs_1.default.openSync(this[_path], 'r')); + threw = false; + } + finally { + if (threw) { + this[_close](); + } + } + } + [_read]() { + let threw = true; + try { + if (!this[_reading]) { + this[_reading] = true; + do { + const buf = this[_makeBuf](); + /* c8 ignore start */ + const br = buf.length === 0 + ? 0 + : fs_1.default.readSync(this[_fd], buf, 0, buf.length, null); + /* c8 ignore stop */ + if (!this[_handleChunk](br, buf)) { + break; + } + } while (true); + this[_reading] = false; + } + threw = false; + } + finally { + if (threw) { + this[_close](); + } + } + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd]; + this[_fd] = undefined; + fs_1.default.closeSync(fd); + this.emit('close'); + } + } +} +exports.ReadStreamSync = ReadStreamSync; +class WriteStream extends events_1.default { + readable = false; + writable = true; + [_errored] = false; + [_writing] = false; + [_ended] = false; + [_queue] = []; + [_needDrain] = false; + [_path]; + [_mode]; + [_autoClose]; + [_fd]; + [_defaultFlag]; + [_flags]; + [_finished] = false; + [_pos]; + constructor(path, opt) { + opt = opt || {}; + super(opt); + this[_path] = path; + this[_fd] = typeof opt.fd === 'number' ? opt.fd : undefined; + this[_mode] = opt.mode === undefined ? 0o666 : opt.mode; + this[_pos] = typeof opt.start === 'number' ? opt.start : undefined; + this[_autoClose] = + typeof opt.autoClose === 'boolean' ? opt.autoClose : true; + // truncating makes no sense when writing into the middle + const defaultFlag = this[_pos] !== undefined ? 'r+' : 'w'; + this[_defaultFlag] = opt.flags === undefined; + this[_flags] = opt.flags === undefined ? defaultFlag : opt.flags; + if (this[_fd] === undefined) { + this[_open](); + } + } + emit(ev, ...args) { + if (ev === 'error') { + if (this[_errored]) { + return false; + } + this[_errored] = true; + } + return super.emit(ev, ...args); + } + get fd() { + return this[_fd]; + } + get path() { + return this[_path]; + } + [_onerror](er) { + this[_close](); + this[_writing] = true; + this.emit('error', er); + } + [_open]() { + fs_1.default.open(this[_path], this[_flags], this[_mode], (er, fd) => this[_onopen](er, fd)); + } + [_onopen](er, fd) { + if (this[_defaultFlag] && + this[_flags] === 'r+' && + er && + er.code === 'ENOENT') { + this[_flags] = 'w'; + this[_open](); + } + else if (er) { + this[_onerror](er); + } + else { + this[_fd] = fd; + this.emit('open', fd); + if (!this[_writing]) { + this[_flush](); + } + } + } + end(buf, enc) { + if (buf) { + //@ts-ignore + this.write(buf, enc); + } + this[_ended] = true; + // synthetic after-write logic, where drain/finish live + if (!this[_writing] && + !this[_queue].length && + typeof this[_fd] === 'number') { + this[_onwrite](null, 0); + } + return this; + } + write(buf, enc) { + if (typeof buf === 'string') { + buf = Buffer.from(buf, enc); + } + if (this[_ended]) { + this.emit('error', new Error('write() after end()')); + return false; + } + if (this[_fd] === undefined || this[_writing] || this[_queue].length) { + this[_queue].push(buf); + this[_needDrain] = true; + return false; + } + this[_writing] = true; + this[_write](buf); + return true; + } + [_write](buf) { + fs_1.default.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) => this[_onwrite](er, bw)); + } + [_onwrite](er, bw) { + if (er) { + this[_onerror](er); + } + else { + if (this[_pos] !== undefined && typeof bw === 'number') { + this[_pos] += bw; + } + if (this[_queue].length) { + this[_flush](); + } + else { + this[_writing] = false; + if (this[_ended] && !this[_finished]) { + this[_finished] = true; + this[_close](); + this.emit('finish'); + } + else if (this[_needDrain]) { + this[_needDrain] = false; + this.emit('drain'); + } + } + } + } + [_flush]() { + if (this[_queue].length === 0) { + if (this[_ended]) { + this[_onwrite](null, 0); + } + } + else if (this[_queue].length === 1) { + this[_write](this[_queue].pop()); + } + else { + const iovec = this[_queue]; + this[_queue] = []; + writev(this[_fd], iovec, this[_pos], (er, bw) => this[_onwrite](er, bw)); + } + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd]; + this[_fd] = undefined; + fs_1.default.close(fd, er => er ? this.emit('error', er) : this.emit('close')); + } + } +} +exports.WriteStream = WriteStream; +class WriteStreamSync extends WriteStream { + [_open]() { + let fd; + // only wrap in a try{} block if we know we'll retry, to avoid + // the rethrow obscuring the error's source frame in most cases. + if (this[_defaultFlag] && this[_flags] === 'r+') { + try { + fd = fs_1.default.openSync(this[_path], this[_flags], this[_mode]); + } + catch (er) { + if (er?.code === 'ENOENT') { + this[_flags] = 'w'; + return this[_open](); + } + else { + throw er; + } + } + } + else { + fd = fs_1.default.openSync(this[_path], this[_flags], this[_mode]); + } + this[_onopen](null, fd); + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd]; + this[_fd] = undefined; + fs_1.default.closeSync(fd); + this.emit('close'); + } + } + [_write](buf) { + // throw the original, but try to close if it fails + let threw = true; + try { + this[_onwrite](null, fs_1.default.writeSync(this[_fd], buf, 0, buf.length, this[_pos])); + threw = false; + } + finally { + if (threw) { + try { + this[_close](); + } + catch { + // ok error + } + } + } + } +} +exports.WriteStreamSync = WriteStreamSync; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node24/node_modules/npm/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json b/node24/node_modules/npm/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json new file mode 100644 index 0000000000000000000000000000000000000000..140154e8de6e45b8f73020ef9c28c8ce2321bda2 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node24/node_modules/npm/node_modules/@isaacs/fs-minipass/dist/esm/index.js b/node24/node_modules/npm/node_modules/@isaacs/fs-minipass/dist/esm/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e147224443dc0259ba1e21bd3c066ab1809c7122 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@isaacs/fs-minipass/dist/esm/index.js @@ -0,0 +1,420 @@ +import EE from 'events'; +import fs from 'fs'; +import { Minipass } from 'minipass'; +const writev = fs.writev; +const _autoClose = Symbol('_autoClose'); +const _close = Symbol('_close'); +const _ended = Symbol('_ended'); +const _fd = Symbol('_fd'); +const _finished = Symbol('_finished'); +const _flags = Symbol('_flags'); +const _flush = Symbol('_flush'); +const _handleChunk = Symbol('_handleChunk'); +const _makeBuf = Symbol('_makeBuf'); +const _mode = Symbol('_mode'); +const _needDrain = Symbol('_needDrain'); +const _onerror = Symbol('_onerror'); +const _onopen = Symbol('_onopen'); +const _onread = Symbol('_onread'); +const _onwrite = Symbol('_onwrite'); +const _open = Symbol('_open'); +const _path = Symbol('_path'); +const _pos = Symbol('_pos'); +const _queue = Symbol('_queue'); +const _read = Symbol('_read'); +const _readSize = Symbol('_readSize'); +const _reading = Symbol('_reading'); +const _remain = Symbol('_remain'); +const _size = Symbol('_size'); +const _write = Symbol('_write'); +const _writing = Symbol('_writing'); +const _defaultFlag = Symbol('_defaultFlag'); +const _errored = Symbol('_errored'); +export class ReadStream extends Minipass { + [_errored] = false; + [_fd]; + [_path]; + [_readSize]; + [_reading] = false; + [_size]; + [_remain]; + [_autoClose]; + constructor(path, opt) { + opt = opt || {}; + super(opt); + this.readable = true; + this.writable = false; + if (typeof path !== 'string') { + throw new TypeError('path must be a string'); + } + this[_errored] = false; + this[_fd] = typeof opt.fd === 'number' ? opt.fd : undefined; + this[_path] = path; + this[_readSize] = opt.readSize || 16 * 1024 * 1024; + this[_reading] = false; + this[_size] = typeof opt.size === 'number' ? opt.size : Infinity; + this[_remain] = this[_size]; + this[_autoClose] = + typeof opt.autoClose === 'boolean' ? opt.autoClose : true; + if (typeof this[_fd] === 'number') { + this[_read](); + } + else { + this[_open](); + } + } + get fd() { + return this[_fd]; + } + get path() { + return this[_path]; + } + //@ts-ignore + write() { + throw new TypeError('this is a readable stream'); + } + //@ts-ignore + end() { + throw new TypeError('this is a readable stream'); + } + [_open]() { + fs.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd)); + } + [_onopen](er, fd) { + if (er) { + this[_onerror](er); + } + else { + this[_fd] = fd; + this.emit('open', fd); + this[_read](); + } + } + [_makeBuf]() { + return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain])); + } + [_read]() { + if (!this[_reading]) { + this[_reading] = true; + const buf = this[_makeBuf](); + /* c8 ignore start */ + if (buf.length === 0) { + return process.nextTick(() => this[_onread](null, 0, buf)); + } + /* c8 ignore stop */ + fs.read(this[_fd], buf, 0, buf.length, null, (er, br, b) => this[_onread](er, br, b)); + } + } + [_onread](er, br, buf) { + this[_reading] = false; + if (er) { + this[_onerror](er); + } + else if (this[_handleChunk](br, buf)) { + this[_read](); + } + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd]; + this[_fd] = undefined; + fs.close(fd, er => er ? this.emit('error', er) : this.emit('close')); + } + } + [_onerror](er) { + this[_reading] = true; + this[_close](); + this.emit('error', er); + } + [_handleChunk](br, buf) { + let ret = false; + // no effect if infinite + this[_remain] -= br; + if (br > 0) { + ret = super.write(br < buf.length ? buf.subarray(0, br) : buf); + } + if (br === 0 || this[_remain] <= 0) { + ret = false; + this[_close](); + super.end(); + } + return ret; + } + emit(ev, ...args) { + switch (ev) { + case 'prefinish': + case 'finish': + return false; + case 'drain': + if (typeof this[_fd] === 'number') { + this[_read](); + } + return false; + case 'error': + if (this[_errored]) { + return false; + } + this[_errored] = true; + return super.emit(ev, ...args); + default: + return super.emit(ev, ...args); + } + } +} +export class ReadStreamSync extends ReadStream { + [_open]() { + let threw = true; + try { + this[_onopen](null, fs.openSync(this[_path], 'r')); + threw = false; + } + finally { + if (threw) { + this[_close](); + } + } + } + [_read]() { + let threw = true; + try { + if (!this[_reading]) { + this[_reading] = true; + do { + const buf = this[_makeBuf](); + /* c8 ignore start */ + const br = buf.length === 0 + ? 0 + : fs.readSync(this[_fd], buf, 0, buf.length, null); + /* c8 ignore stop */ + if (!this[_handleChunk](br, buf)) { + break; + } + } while (true); + this[_reading] = false; + } + threw = false; + } + finally { + if (threw) { + this[_close](); + } + } + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd]; + this[_fd] = undefined; + fs.closeSync(fd); + this.emit('close'); + } + } +} +export class WriteStream extends EE { + readable = false; + writable = true; + [_errored] = false; + [_writing] = false; + [_ended] = false; + [_queue] = []; + [_needDrain] = false; + [_path]; + [_mode]; + [_autoClose]; + [_fd]; + [_defaultFlag]; + [_flags]; + [_finished] = false; + [_pos]; + constructor(path, opt) { + opt = opt || {}; + super(opt); + this[_path] = path; + this[_fd] = typeof opt.fd === 'number' ? opt.fd : undefined; + this[_mode] = opt.mode === undefined ? 0o666 : opt.mode; + this[_pos] = typeof opt.start === 'number' ? opt.start : undefined; + this[_autoClose] = + typeof opt.autoClose === 'boolean' ? opt.autoClose : true; + // truncating makes no sense when writing into the middle + const defaultFlag = this[_pos] !== undefined ? 'r+' : 'w'; + this[_defaultFlag] = opt.flags === undefined; + this[_flags] = opt.flags === undefined ? defaultFlag : opt.flags; + if (this[_fd] === undefined) { + this[_open](); + } + } + emit(ev, ...args) { + if (ev === 'error') { + if (this[_errored]) { + return false; + } + this[_errored] = true; + } + return super.emit(ev, ...args); + } + get fd() { + return this[_fd]; + } + get path() { + return this[_path]; + } + [_onerror](er) { + this[_close](); + this[_writing] = true; + this.emit('error', er); + } + [_open]() { + fs.open(this[_path], this[_flags], this[_mode], (er, fd) => this[_onopen](er, fd)); + } + [_onopen](er, fd) { + if (this[_defaultFlag] && + this[_flags] === 'r+' && + er && + er.code === 'ENOENT') { + this[_flags] = 'w'; + this[_open](); + } + else if (er) { + this[_onerror](er); + } + else { + this[_fd] = fd; + this.emit('open', fd); + if (!this[_writing]) { + this[_flush](); + } + } + } + end(buf, enc) { + if (buf) { + //@ts-ignore + this.write(buf, enc); + } + this[_ended] = true; + // synthetic after-write logic, where drain/finish live + if (!this[_writing] && + !this[_queue].length && + typeof this[_fd] === 'number') { + this[_onwrite](null, 0); + } + return this; + } + write(buf, enc) { + if (typeof buf === 'string') { + buf = Buffer.from(buf, enc); + } + if (this[_ended]) { + this.emit('error', new Error('write() after end()')); + return false; + } + if (this[_fd] === undefined || this[_writing] || this[_queue].length) { + this[_queue].push(buf); + this[_needDrain] = true; + return false; + } + this[_writing] = true; + this[_write](buf); + return true; + } + [_write](buf) { + fs.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) => this[_onwrite](er, bw)); + } + [_onwrite](er, bw) { + if (er) { + this[_onerror](er); + } + else { + if (this[_pos] !== undefined && typeof bw === 'number') { + this[_pos] += bw; + } + if (this[_queue].length) { + this[_flush](); + } + else { + this[_writing] = false; + if (this[_ended] && !this[_finished]) { + this[_finished] = true; + this[_close](); + this.emit('finish'); + } + else if (this[_needDrain]) { + this[_needDrain] = false; + this.emit('drain'); + } + } + } + } + [_flush]() { + if (this[_queue].length === 0) { + if (this[_ended]) { + this[_onwrite](null, 0); + } + } + else if (this[_queue].length === 1) { + this[_write](this[_queue].pop()); + } + else { + const iovec = this[_queue]; + this[_queue] = []; + writev(this[_fd], iovec, this[_pos], (er, bw) => this[_onwrite](er, bw)); + } + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd]; + this[_fd] = undefined; + fs.close(fd, er => er ? this.emit('error', er) : this.emit('close')); + } + } +} +export class WriteStreamSync extends WriteStream { + [_open]() { + let fd; + // only wrap in a try{} block if we know we'll retry, to avoid + // the rethrow obscuring the error's source frame in most cases. + if (this[_defaultFlag] && this[_flags] === 'r+') { + try { + fd = fs.openSync(this[_path], this[_flags], this[_mode]); + } + catch (er) { + if (er?.code === 'ENOENT') { + this[_flags] = 'w'; + return this[_open](); + } + else { + throw er; + } + } + } + else { + fd = fs.openSync(this[_path], this[_flags], this[_mode]); + } + this[_onopen](null, fd); + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd]; + this[_fd] = undefined; + fs.closeSync(fd); + this.emit('close'); + } + } + [_write](buf) { + // throw the original, but try to close if it fails + let threw = true; + try { + this[_onwrite](null, fs.writeSync(this[_fd], buf, 0, buf.length, this[_pos])); + threw = false; + } + finally { + if (threw) { + try { + this[_close](); + } + catch { + // ok error + } + } + } + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node24/node_modules/npm/node_modules/@isaacs/fs-minipass/dist/esm/package.json b/node24/node_modules/npm/node_modules/@isaacs/fs-minipass/dist/esm/package.json new file mode 100644 index 0000000000000000000000000000000000000000..916833506f3f5b4f805b8ff70692019bf0910884 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@isaacs/fs-minipass/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node24/node_modules/npm/node_modules/@isaacs/fs-minipass/package.json b/node24/node_modules/npm/node_modules/@isaacs/fs-minipass/package.json new file mode 100644 index 0000000000000000000000000000000000000000..21f281d630ab2e7d1f231cca2fe9e57a574ccf6e --- /dev/null +++ b/node24/node_modules/npm/node_modules/@isaacs/fs-minipass/package.json @@ -0,0 +1,72 @@ +{ + "name": "@isaacs/fs-minipass", + "version": "4.0.1", + "main": "./dist/commonjs/index.js", + "scripts": { + "prepare": "tshy", + "pretest": "npm run prepare", + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "format": "prettier --write . --loglevel warn", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "keywords": [], + "author": "Isaac Z. Schlueter", + "license": "ISC", + "repository": { + "type": "git", + "url": "https://github.com/npm/fs-minipass.git" + }, + "description": "fs read and write streams based on minipass", + "dependencies": { + "minipass": "^7.0.4" + }, + "devDependencies": { + "@types/node": "^20.11.30", + "mutate-fs": "^2.1.1", + "prettier": "^3.2.5", + "tap": "^18.7.1", + "tshy": "^1.12.0", + "typedoc": "^0.25.12" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=18.0.0" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "types": "./dist/commonjs/index.d.ts", + "type": "module", + "prettier": { + "semi": false, + "printWidth": 75, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + } +} diff --git a/node24/node_modules/npm/node_modules/@isaacs/string-locale-compare/LICENSE b/node24/node_modules/npm/node_modules/@isaacs/string-locale-compare/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..235bdd54ec77f257af3e9f5bfece770fa2d6d6a8 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@isaacs/string-locale-compare/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node24/node_modules/npm/node_modules/@isaacs/string-locale-compare/index.js b/node24/node_modules/npm/node_modules/@isaacs/string-locale-compare/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1d44cf285c282b12c35baa6f79df73f342430d6d --- /dev/null +++ b/node24/node_modules/npm/node_modules/@isaacs/string-locale-compare/index.js @@ -0,0 +1,42 @@ +const hasIntl = typeof Intl === 'object' && !!Intl +const Collator = hasIntl && Intl.Collator +const cache = new Map() + +const collatorCompare = (locale, opts) => { + const collator = new Collator(locale, opts) + return (a, b) => collator.compare(a, b) +} + +const localeCompare = (locale, opts) => (a, b) => a.localeCompare(b, locale, opts) + +const knownOptions = [ + 'sensitivity', + 'numeric', + 'ignorePunctuation', + 'caseFirst', +] + +const { hasOwnProperty } = Object.prototype + +module.exports = (locale, options = {}) => { + if (!locale || typeof locale !== 'string') + throw new TypeError('locale required') + + const opts = knownOptions.reduce((opts, k) => { + if (hasOwnProperty.call(options, k)) { + opts[k] = options[k] + } + return opts + }, {}) + const key = `${locale}\n${JSON.stringify(opts)}` + + if (cache.has(key)) + return cache.get(key) + + const compare = hasIntl + ? collatorCompare(locale, opts) + : localeCompare(locale, opts) + cache.set(key, compare) + + return compare +} diff --git a/node24/node_modules/npm/node_modules/@isaacs/string-locale-compare/package.json b/node24/node_modules/npm/node_modules/@isaacs/string-locale-compare/package.json new file mode 100644 index 0000000000000000000000000000000000000000..6cb43b092e29eb6e951da74eeafdeb9a010a76c8 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@isaacs/string-locale-compare/package.json @@ -0,0 +1,28 @@ +{ + "name": "@isaacs/string-locale-compare", + "version": "1.1.0", + "files": [ + "index.js" + ], + "main": "index.js", + "description": "Compare strings with Intl.Collator if available, falling back to String.localeCompare otherwise", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/string-locale-compare" + }, + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^15.0.9" + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/agent/lib/agents.js b/node24/node_modules/npm/node_modules/@npmcli/agent/lib/agents.js new file mode 100644 index 0000000000000000000000000000000000000000..a0e8b9f5b80de6e10bd852c306839176304b4aa4 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/agent/lib/agents.js @@ -0,0 +1,206 @@ +'use strict' + +const net = require('net') +const tls = require('tls') +const { once } = require('events') +const timers = require('timers/promises') +const { normalizeOptions, cacheOptions } = require('./options') +const { getProxy, getProxyAgent, proxyCache } = require('./proxy.js') +const Errors = require('./errors.js') +const { Agent: AgentBase } = require('agent-base') + +module.exports = class Agent extends AgentBase { + #options + #timeouts + #proxy + #noProxy + #ProxyAgent + + constructor (options = {}) { + const { timeouts, proxy, noProxy, ...normalizedOptions } = normalizeOptions(options) + + super(normalizedOptions) + + this.#options = normalizedOptions + this.#timeouts = timeouts + + if (proxy) { + this.#proxy = new URL(proxy) + this.#noProxy = noProxy + this.#ProxyAgent = getProxyAgent(proxy) + } + } + + get proxy () { + return this.#proxy ? { url: this.#proxy } : {} + } + + #getProxy (options) { + if (!this.#proxy) { + return + } + + const proxy = getProxy(`${options.protocol}//${options.host}:${options.port}`, { + proxy: this.#proxy, + noProxy: this.#noProxy, + }) + + if (!proxy) { + return + } + + const cacheKey = cacheOptions({ + ...options, + ...this.#options, + timeouts: this.#timeouts, + proxy, + }) + + if (proxyCache.has(cacheKey)) { + return proxyCache.get(cacheKey) + } + + let ProxyAgent = this.#ProxyAgent + if (Array.isArray(ProxyAgent)) { + ProxyAgent = this.isSecureEndpoint(options) ? ProxyAgent[1] : ProxyAgent[0] + } + + const proxyAgent = new ProxyAgent(proxy, { + ...this.#options, + socketOptions: { family: this.#options.family }, + }) + proxyCache.set(cacheKey, proxyAgent) + + return proxyAgent + } + + // takes an array of promises and races them against the connection timeout + // which will throw the necessary error if it is hit. This will return the + // result of the promise race. + async #timeoutConnection ({ promises, options, timeout }, ac = new AbortController()) { + if (timeout) { + const connectionTimeout = timers.setTimeout(timeout, null, { signal: ac.signal }) + .then(() => { + throw new Errors.ConnectionTimeoutError(`${options.host}:${options.port}`) + }).catch((err) => { + if (err.name === 'AbortError') { + return + } + throw err + }) + promises.push(connectionTimeout) + } + + let result + try { + result = await Promise.race(promises) + ac.abort() + } catch (err) { + ac.abort() + throw err + } + return result + } + + async connect (request, options) { + // if the connection does not have its own lookup function + // set, then use the one from our options + options.lookup ??= this.#options.lookup + + let socket + let timeout = this.#timeouts.connection + const isSecureEndpoint = this.isSecureEndpoint(options) + + const proxy = this.#getProxy(options) + if (proxy) { + // some of the proxies will wait for the socket to fully connect before + // returning so we have to await this while also racing it against the + // connection timeout. + const start = Date.now() + socket = await this.#timeoutConnection({ + options, + timeout, + promises: [proxy.connect(request, options)], + }) + // see how much time proxy.connect took and subtract it from + // the timeout + if (timeout) { + timeout = timeout - (Date.now() - start) + } + } else { + socket = (isSecureEndpoint ? tls : net).connect(options) + } + + socket.setKeepAlive(this.keepAlive, this.keepAliveMsecs) + socket.setNoDelay(this.keepAlive) + + const abortController = new AbortController() + const { signal } = abortController + + const connectPromise = socket[isSecureEndpoint ? 'secureConnecting' : 'connecting'] + ? once(socket, isSecureEndpoint ? 'secureConnect' : 'connect', { signal }) + : Promise.resolve() + + await this.#timeoutConnection({ + options, + timeout, + promises: [ + connectPromise, + once(socket, 'error', { signal }).then((err) => { + throw err[0] + }), + ], + }, abortController) + + if (this.#timeouts.idle) { + socket.setTimeout(this.#timeouts.idle, () => { + socket.destroy(new Errors.IdleTimeoutError(`${options.host}:${options.port}`)) + }) + } + + return socket + } + + addRequest (request, options) { + const proxy = this.#getProxy(options) + // it would be better to call proxy.addRequest here but this causes the + // http-proxy-agent to call its super.addRequest which causes the request + // to be added to the agent twice. since we only support 3 agents + // currently (see the required agents in proxy.js) we have manually + // checked that the only public methods we need to call are called in the + // next block. this could change in the future and presumably we would get + // failing tests until we have properly called the necessary methods on + // each of our proxy agents + if (proxy?.setRequestProps) { + proxy.setRequestProps(request, options) + } + + request.setHeader('connection', this.keepAlive ? 'keep-alive' : 'close') + + if (this.#timeouts.response) { + let responseTimeout + request.once('finish', () => { + setTimeout(() => { + request.destroy(new Errors.ResponseTimeoutError(request, this.#proxy)) + }, this.#timeouts.response) + }) + request.once('response', () => { + clearTimeout(responseTimeout) + }) + } + + if (this.#timeouts.transfer) { + let transferTimeout + request.once('response', (res) => { + setTimeout(() => { + res.destroy(new Errors.TransferTimeoutError(request, this.#proxy)) + }, this.#timeouts.transfer) + res.once('close', () => { + clearTimeout(transferTimeout) + }) + }) + } + + return super.addRequest(request, options) + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/agent/lib/dns.js b/node24/node_modules/npm/node_modules/@npmcli/agent/lib/dns.js new file mode 100644 index 0000000000000000000000000000000000000000..d9ce25afd8125500815d954e2d14cb829d10452e --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/agent/lib/dns.js @@ -0,0 +1,53 @@ +'use strict' + +const { LRUCache } = require('lru-cache') +const dns = require('dns') + +// this is a factory so that each request can have its own opts (i.e. ttl) +// while still sharing the cache across all requests +const cache = new LRUCache({ max: 50 }) + +const getOptions = ({ + family = 0, + hints = dns.ADDRCONFIG, + all = false, + verbatim = undefined, + ttl = 5 * 60 * 1000, + lookup = dns.lookup, +}) => ({ + // hints and lookup are returned since both are top level properties to (net|tls).connect + hints, + lookup: (hostname, ...args) => { + const callback = args.pop() // callback is always last arg + const lookupOptions = args[0] ?? {} + + const options = { + family, + hints, + all, + verbatim, + ...(typeof lookupOptions === 'number' ? { family: lookupOptions } : lookupOptions), + } + + const key = JSON.stringify({ hostname, ...options }) + + if (cache.has(key)) { + const cached = cache.get(key) + return process.nextTick(callback, null, ...cached) + } + + lookup(hostname, options, (err, ...result) => { + if (err) { + return callback(err) + } + + cache.set(key, result, { ttl }) + return callback(null, ...result) + }) + }, +}) + +module.exports = { + cache, + getOptions, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/agent/lib/errors.js b/node24/node_modules/npm/node_modules/@npmcli/agent/lib/errors.js new file mode 100644 index 0000000000000000000000000000000000000000..060a20665aca72479e5b7bd80c35552787288020 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/agent/lib/errors.js @@ -0,0 +1,61 @@ +'use strict' + +class InvalidProxyProtocolError extends Error { + constructor (url) { + super(`Invalid protocol \`${url.protocol}\` connecting to proxy \`${url.host}\``) + this.code = 'EINVALIDPROXY' + this.proxy = url + } +} + +class ConnectionTimeoutError extends Error { + constructor (host) { + super(`Timeout connecting to host \`${host}\``) + this.code = 'ECONNECTIONTIMEOUT' + this.host = host + } +} + +class IdleTimeoutError extends Error { + constructor (host) { + super(`Idle timeout reached for host \`${host}\``) + this.code = 'EIDLETIMEOUT' + this.host = host + } +} + +class ResponseTimeoutError extends Error { + constructor (request, proxy) { + let msg = 'Response timeout ' + if (proxy) { + msg += `from proxy \`${proxy.host}\` ` + } + msg += `connecting to host \`${request.host}\`` + super(msg) + this.code = 'ERESPONSETIMEOUT' + this.proxy = proxy + this.request = request + } +} + +class TransferTimeoutError extends Error { + constructor (request, proxy) { + let msg = 'Transfer timeout ' + if (proxy) { + msg += `from proxy \`${proxy.host}\` ` + } + msg += `for \`${request.host}\`` + super(msg) + this.code = 'ETRANSFERTIMEOUT' + this.proxy = proxy + this.request = request + } +} + +module.exports = { + InvalidProxyProtocolError, + ConnectionTimeoutError, + IdleTimeoutError, + ResponseTimeoutError, + TransferTimeoutError, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/agent/lib/index.js b/node24/node_modules/npm/node_modules/@npmcli/agent/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..64cbbb1efbb5bac751ac8acca26897cea2844913 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/agent/lib/index.js @@ -0,0 +1,56 @@ +'use strict' + +const { LRUCache } = require('lru-cache') +const { normalizeOptions, cacheOptions } = require('./options') +const { getProxy, proxyCache } = require('./proxy.js') +const dns = require('./dns.js') +const Agent = require('./agents.js') + +const agentCache = new LRUCache({ max: 20 }) + +const getAgent = (url, { agent, proxy, noProxy, ...options } = {}) => { + // false has meaning so this can't be a simple truthiness check + if (agent != null) { + return agent + } + + url = new URL(url) + + const proxyForUrl = getProxy(url, { proxy, noProxy }) + const normalizedOptions = { + ...normalizeOptions(options), + proxy: proxyForUrl, + } + + const cacheKey = cacheOptions({ + ...normalizedOptions, + secureEndpoint: url.protocol === 'https:', + }) + + if (agentCache.has(cacheKey)) { + return agentCache.get(cacheKey) + } + + const newAgent = new Agent(normalizedOptions) + agentCache.set(cacheKey, newAgent) + + return newAgent +} + +module.exports = { + getAgent, + Agent, + // these are exported for backwards compatability + HttpAgent: Agent, + HttpsAgent: Agent, + cache: { + proxy: proxyCache, + agent: agentCache, + dns: dns.cache, + clear: () => { + proxyCache.clear() + agentCache.clear() + dns.cache.clear() + }, + }, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/agent/lib/options.js b/node24/node_modules/npm/node_modules/@npmcli/agent/lib/options.js new file mode 100644 index 0000000000000000000000000000000000000000..a4f09638180883185d5ade990dca85600ff161b1 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/agent/lib/options.js @@ -0,0 +1,86 @@ +'use strict' + +const dns = require('./dns') + +const normalizeOptions = (opts) => { + const family = parseInt(opts.family ?? '0', 10) + const keepAlive = opts.keepAlive ?? true + + const normalized = { + // nodejs http agent options. these are all the defaults + // but kept here to increase the likelihood of cache hits + // https://nodejs.org/api/http.html#new-agentoptions + keepAliveMsecs: keepAlive ? 1000 : undefined, + maxSockets: opts.maxSockets ?? 15, + maxTotalSockets: Infinity, + maxFreeSockets: keepAlive ? 256 : undefined, + scheduling: 'fifo', + // then spread the rest of the options + ...opts, + // we already set these to their defaults that we want + family, + keepAlive, + // our custom timeout options + timeouts: { + // the standard timeout option is mapped to our idle timeout + // and then deleted below + idle: opts.timeout ?? 0, + connection: 0, + response: 0, + transfer: 0, + ...opts.timeouts, + }, + // get the dns options that go at the top level of socket connection + ...dns.getOptions({ family, ...opts.dns }), + } + + // remove timeout since we already used it to set our own idle timeout + delete normalized.timeout + + return normalized +} + +const createKey = (obj) => { + let key = '' + const sorted = Object.entries(obj).sort((a, b) => a[0] - b[0]) + for (let [k, v] of sorted) { + if (v == null) { + v = 'null' + } else if (v instanceof URL) { + v = v.toString() + } else if (typeof v === 'object') { + v = createKey(v) + } + key += `${k}:${v}:` + } + return key +} + +const cacheOptions = ({ secureEndpoint, ...options }) => createKey({ + secureEndpoint: !!secureEndpoint, + // socket connect options + family: options.family, + hints: options.hints, + localAddress: options.localAddress, + // tls specific connect options + strictSsl: secureEndpoint ? !!options.rejectUnauthorized : false, + ca: secureEndpoint ? options.ca : null, + cert: secureEndpoint ? options.cert : null, + key: secureEndpoint ? options.key : null, + // http agent options + keepAlive: options.keepAlive, + keepAliveMsecs: options.keepAliveMsecs, + maxSockets: options.maxSockets, + maxTotalSockets: options.maxTotalSockets, + maxFreeSockets: options.maxFreeSockets, + scheduling: options.scheduling, + // timeout options + timeouts: options.timeouts, + // proxy + proxy: options.proxy, +}) + +module.exports = { + normalizeOptions, + cacheOptions, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/agent/lib/proxy.js b/node24/node_modules/npm/node_modules/@npmcli/agent/lib/proxy.js new file mode 100644 index 0000000000000000000000000000000000000000..7505e6547a3e2e06a9a7f925bc4fceda932e3829 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/agent/lib/proxy.js @@ -0,0 +1,88 @@ +'use strict' + +const { HttpProxyAgent } = require('http-proxy-agent') +const { HttpsProxyAgent } = require('https-proxy-agent') +const { SocksProxyAgent } = require('socks-proxy-agent') +const { LRUCache } = require('lru-cache') +const { InvalidProxyProtocolError } = require('./errors.js') + +const PROXY_CACHE = new LRUCache({ max: 20 }) + +const SOCKS_PROTOCOLS = new Set(SocksProxyAgent.protocols) + +const PROXY_ENV_KEYS = new Set(['https_proxy', 'http_proxy', 'proxy', 'no_proxy']) + +const PROXY_ENV = Object.entries(process.env).reduce((acc, [key, value]) => { + key = key.toLowerCase() + if (PROXY_ENV_KEYS.has(key)) { + acc[key] = value + } + return acc +}, {}) + +const getProxyAgent = (url) => { + url = new URL(url) + + const protocol = url.protocol.slice(0, -1) + if (SOCKS_PROTOCOLS.has(protocol)) { + return SocksProxyAgent + } + if (protocol === 'https' || protocol === 'http') { + return [HttpProxyAgent, HttpsProxyAgent] + } + + throw new InvalidProxyProtocolError(url) +} + +const isNoProxy = (url, noProxy) => { + if (typeof noProxy === 'string') { + noProxy = noProxy.split(',').map((p) => p.trim()).filter(Boolean) + } + + if (!noProxy || !noProxy.length) { + return false + } + + const hostSegments = url.hostname.split('.').reverse() + + return noProxy.some((no) => { + const noSegments = no.split('.').filter(Boolean).reverse() + if (!noSegments.length) { + return false + } + + for (let i = 0; i < noSegments.length; i++) { + if (hostSegments[i] !== noSegments[i]) { + return false + } + } + + return true + }) +} + +const getProxy = (url, { proxy, noProxy }) => { + url = new URL(url) + + if (!proxy) { + proxy = url.protocol === 'https:' + ? PROXY_ENV.https_proxy + : PROXY_ENV.https_proxy || PROXY_ENV.http_proxy || PROXY_ENV.proxy + } + + if (!noProxy) { + noProxy = PROXY_ENV.no_proxy + } + + if (!proxy || isNoProxy(url, noProxy)) { + return null + } + + return new URL(proxy) +} + +module.exports = { + getProxyAgent, + getProxy, + proxyCache: PROXY_CACHE, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/actual.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/actual.js new file mode 100644 index 0000000000000000000000000000000000000000..56b70f1117d7fcec64995ade12188a75e0d0fc78 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/actual.js @@ -0,0 +1,19 @@ +const Arborist = require('../') + +const printTree = require('./lib/print-tree.js') + +module.exports = (options, time) => new Arborist(options) + .loadActual(options) + .then(time) + .then(async ({ timing, result: tree }) => { + printTree(tree) + if (options.save) { + await tree.meta.save() + } + if (options.saveHidden) { + tree.meta.hiddenLockfile = true + tree.meta.filename = options.path + '/node_modules/.package-lock.json' + await tree.meta.save() + } + return `read ${tree.inventory.size} deps in ${timing.ms}` + }) diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/audit.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/audit.js new file mode 100644 index 0000000000000000000000000000000000000000..8a039ce6fd0044f9205043026861123f60995200 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/audit.js @@ -0,0 +1,51 @@ +const Arborist = require('../') + +const printTree = require('./lib/print-tree.js') +const log = require('./lib/logging.js') + +const Vuln = require('../lib/vuln.js') +const printReport = report => { + for (const vuln of report.values()) { + log.info(printVuln(vuln)) + } + if (report.topVulns.size) { + log.info('\n# top-level vulnerabilities') + for (const vuln of report.topVulns.values()) { + log.info(printVuln(vuln)) + } + } +} + +const printVuln = vuln => { + return { + __proto__: { constructor: Vuln }, + name: vuln.name, + issues: [...vuln.advisories].map(a => printAdvisory(a)), + range: vuln.simpleRange, + nodes: [...vuln.nodes].map(node => `${node.name} ${node.location || '#ROOT'}`), + ...(vuln.topNodes.size === 0 ? {} : { + topNodes: [...vuln.topNodes].map(node => `${node.location || '#ROOT'}`), + }), + } +} + +const printAdvisory = a => `${a.title}${a.url ? ' ' + a.url : ''}` + +module.exports = (options, time) => { + const arb = new Arborist(options) + return arb + .audit(options) + .then(time) + .then(async ({ timing, result: tree }) => { + if (options.fix) { + printTree(tree) + } + printReport(arb.auditReport) + if (tree.meta && options.save) { + await tree.meta.save() + } + return options.fix + ? `resolved ${tree.inventory.size} deps in ${timing.seconds}` + : `done in ${timing.seconds}` + }) +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/funding.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/funding.js new file mode 100644 index 0000000000000000000000000000000000000000..0a7b4ac06ace953734b53d55bfb9fa57f86a698b --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/funding.js @@ -0,0 +1,38 @@ +const Arborist = require('../') + +const log = require('./lib/logging.js') + +module.exports = (options, time) => { + const query = options._.shift() + const a = new Arborist(options) + return a + .loadVirtual() + .then(tree => { + // only load the actual tree if the virtual one doesn't have modern metadata + if (!tree.meta || !(tree.meta.originalLockfileVersion >= 2)) { + log.error('old metadata, load actual') + throw 'load actual' + } else { + log.error('meta ok, return virtual tree') + return tree + } + }) + .catch(() => a.loadActual()) + .then(time) + .then(({ timing, result: tree }) => { + if (!query) { + for (const node of tree.inventory.values()) { + if (node.package.funding) { + log.info(node.name, node.location, node.package.funding) + } + } + } else { + for (const node of tree.inventory.query('name', query)) { + if (node.package.funding) { + log.info(node.name, node.location, node.package.funding) + } + } + } + return `read ${tree.inventory.size} deps in ${timing.ms}` + }) +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/ideal.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/ideal.js new file mode 100644 index 0000000000000000000000000000000000000000..011327c8272a26796318523b9bd0da1cbaf7e43a --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/ideal.js @@ -0,0 +1,14 @@ +const Arborist = require('../') + +const printTree = require('./lib/print-tree.js') + +module.exports = (options, time) => new Arborist(options) + .buildIdealTree(options) + .then(time) + .then(async ({ timing, result: tree }) => { + printTree(tree) + if (tree.meta && options.save) { + await tree.meta.save() + } + return `resolved ${tree.inventory.size} deps in ${timing.seconds}` + }) diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/index.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0854996f9863b9d5f7b48e15e9ddc82286b7a3c0 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/index.js @@ -0,0 +1,112 @@ +#!/usr/bin/env node + +const fs = require('node:fs') +const path = require('node:path') +const { time } = require('proc-log') + +const { bin, arb: options } = require('./lib/options') +const version = require('../package.json').version + +const usage = (message = '') => `Arborist - the npm tree doctor + +Version: ${version} +${message && '\n' + message + '\n'} +# USAGE + arborist [path] [options...] + +# COMMANDS + + * reify: reify ideal tree to node_modules (install, update, rm, ...) + * prune: prune the ideal tree and reify (like npm prune) + * ideal: generate and print the ideal tree + * actual: read and print the actual tree in node_modules + * virtual: read and print the virtual tree in the local shrinkwrap file + * shrinkwrap: load a local shrinkwrap and print its data + * audit: perform a security audit on project dependencies + * funding: query funding information in the local package tree. A second + positional argument after the path name can limit to a package name. + * license: query license information in the local package tree. A second + positional argument after the path name can limit to a license type. + * help: print this text + * version: print the version + +# OPTIONS + + Most npm options are supported, but in camelCase rather than css-case. For + example, instead of '--dry-run', use '--dryRun'. + + Additionally: + + * --loglevel=warn|--quiet will suppress the printing of package trees + * --logfile will output logs to a file + * --timing will show timing information + * Instead of 'npm install ', use 'arborist reify --add='. + The '--add=' option can be specified multiple times. + * Instead of 'npm rm ', use 'arborist reify --rm='. + The '--rm=' option can be specified multiple times. + * Instead of 'npm update', use 'arborist reify --update-all'. + * 'npm audit fix' is 'arborist audit --fix' +` + +const commands = { + version: () => console.log(version), + help: () => console.log(usage()), + exit: () => { + process.exitCode = 1 + console.error( + usage(`Error: command '${bin.command}' does not exist.`) + ) + }, +} + +const commandFiles = fs.readdirSync(__dirname).filter((f) => path.extname(f) === '.js' && f !== __filename) + +for (const file of commandFiles) { + const command = require(`./${file}`) + const name = path.basename(file, '.js') + const totalTime = `bin:${name}:init` + const scriptTime = `bin:${name}:script` + + commands[name] = () => { + const timers = require('./lib/timers') + const log = require('./lib/logging') + + log.info(name, options) + + const timeEnd = time.start(totalTime) + const scriptEnd = time.start(scriptTime) + + return command(options, (result) => { + scriptEnd() + return { + result, + timing: { + seconds: `${timers.get(scriptTime) / 1e9}s`, + ms: `${timers.get(scriptTime) / 1e6}ms`, + }, + } + }) + .then((result) => { + log.info(result) + return result + }) + .catch((err) => { + process.exitCode = 1 + log.error(err) + return err + }) + .then((r) => { + timeEnd() + if (bin.loglevel !== 'silent') { + console[process.exitCode ? 'error' : 'log'](r) + } + return r + }) + } +} + +if (commands[bin.command]) { + commands[bin.command]() +} else { + commands.exit() +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/lib/logging.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/lib/logging.js new file mode 100644 index 0000000000000000000000000000000000000000..e437f29425789a68151afa8ddb7ec8b8b646d659 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/lib/logging.js @@ -0,0 +1,77 @@ +const { log } = require('proc-log') +const fs = require('node:fs') +const { dirname } = require('node:path') +const os = require('node:os') +const { inspect, format } = require('node:util') + +const { bin: options } = require('./options.js') + +// add a meta method to proc-log for passing optional +// metadata through to log handlers +const META = Symbol('meta') +const parseArgs = (...args) => { + const { [META]: isMeta } = args[args.length - 1] || {} + return isMeta + ? [args[args.length - 1], ...args.slice(0, args.length - 1)] + : [{}, ...args] +} +log.meta = (meta = {}) => ({ [META]: true, ...meta }) + +const levels = new Map([ + 'silly', + 'verbose', + 'info', + 'http', + 'notice', + 'warn', + 'error', + 'silent', +].map((level, index) => [level, index])) + +const addLogListener = (write, { eol = os.EOL, loglevel = 'silly', colors = false } = {}) => { + const levelIndex = levels.get(loglevel) + + const magenta = m => colors ? `\x1B[35m${m}\x1B[39m` : m + const dim = m => colors ? `\x1B[2m${m}\x1B[22m` : m + const red = m => colors ? `\x1B[31m${m}\x1B[39m` : m + + const formatter = (level, ...args) => { + const depth = level === 'error' && args[0] && args[0].code === 'ERESOLVE' ? Infinity : 10 + + if (level === 'info' && args[0] === 'timeEnd') { + args[1] = dim(args[1]) + } else if (level === 'error' && args[0] === 'timeError') { + args[1] = red(args[1]) + } + + const messages = args.map(a => typeof a === 'string' ? a : inspect(a, { depth, colors })) + const pref = `${process.pid} ${magenta(level)} ` + + return pref + format(...messages).trim().split('\n').join(`${eol}${pref}`) + eol + } + + process.on('log', (...args) => { + const [meta, level, ...logArgs] = parseArgs(...args) + + if (levelIndex <= levels.get(level) || meta.force) { + write(formatter(level, ...logArgs)) + } + }) +} + +if (options.loglevel !== 'silent') { + addLogListener((v) => process.stderr.write(v), { + eol: '\n', + colors: options.colors, + loglevel: options.loglevel, + }) +} + +if (options.logfile) { + log.silly('logfile', options.logfile) + fs.mkdirSync(dirname(options.logfile), { recursive: true }) + const fd = fs.openSync(options.logfile, 'a') + addLogListener((str) => fs.writeSync(fd, str)) +} + +module.exports = log diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/lib/options.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/lib/options.js new file mode 100644 index 0000000000000000000000000000000000000000..23ce7fd3c54c4779e848c1a7cfcb759ea54a65be --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/lib/options.js @@ -0,0 +1,123 @@ +const nopt = require('nopt') +const path = require('node:path') + +const has = (o, k) => Object.prototype.hasOwnProperty.call(o, k) + +const cleanPath = (val) => { + const k = Symbol('key') + const data = {} + nopt.typeDefs.path.validate(data, k, val) + return data[k] +} + +const parse = (...noptArgs) => { + const binOnlyOpts = { + command: String, + loglevel: String, + colors: Boolean, + timing: ['always', Boolean], + logfile: String, + } + + const arbOpts = { + add: Array, + rm: Array, + omit: Array, + update: Array, + workspaces: Array, + global: Boolean, + force: Boolean, + 'global-style': Boolean, + 'prefer-dedupe': Boolean, + 'legacy-peer-deps': Boolean, + 'update-all': Boolean, + before: Date, + path: path, + cache: path, + ...binOnlyOpts, + } + + const short = { + quiet: ['--loglevel', 'warn'], + logs: ['--logfile', 'true'], + w: '--workspaces', + g: '--global', + f: '--force', + } + + const defaults = { + // key order is important for command and path + // since they shift positional args + // command is 1st, path is 2nd + command: (o) => o.argv.remain.shift(), + path: (o) => cleanPath(o.argv.remain.shift() || '.'), + colors: has(process.env, 'NO_COLOR') ? false : !!process.stderr.isTTY, + loglevel: 'silly', + timing: (o) => o.loglevel === 'silly', + cache: `${process.env.HOME}/.npm/_cacache`, + } + + const derived = [ + // making update either `all` or an array of names but not both + ({ updateAll: all, update: names, ...o }) => { + if (all || names) { + o.update = all != null ? { all } : { names } + } + return o + }, + ({ logfile, ...o }) => { + // logfile is parsed as a string so if its true or set but empty + // then set the default logfile + if (logfile === 'true' || logfile === '') { + logfile = `arb-log-${new Date().toISOString().replace(/[.:]/g, '_')}.log` + } + // then parse it the same as nopt parses other paths + if (logfile) { + o.logfile = cleanPath(logfile) + } + return o + }, + ] + + const transforms = [ + // Camelcase all top level keys + (o) => { + const entries = Object.entries(o).map(([k, v]) => [ + k.replace(/-./g, s => s[1].toUpperCase()), + v, + ]) + return Object.fromEntries(entries) + }, + // Set defaults on unset keys + (o) => { + for (const [k, v] of Object.entries(defaults)) { + if (!has(o, k)) { + o[k] = typeof v === 'function' ? v(o) : v + } + } + return o + }, + // Set/unset derived values + ...derived.map((derive) => (o) => derive(o) || o), + // Separate bin and arborist options + ({ argv: { remain: _ }, ...o }) => { + const bin = { _ } + for (const k of Object.keys(binOnlyOpts)) { + if (has(o, k)) { + bin[k] = o[k] + delete o[k] + } + } + return { bin, arb: o } + }, + ] + + let options = nopt(arbOpts, short, ...noptArgs) + for (const t of transforms) { + options = t(options) + } + + return options +} + +module.exports = parse() diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/lib/print-tree.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/lib/print-tree.js new file mode 100644 index 0000000000000000000000000000000000000000..dc2e66f36d053a9e49fa0befa3ba538fe79b075c --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/lib/print-tree.js @@ -0,0 +1,4 @@ +const { inspect } = require('node:util') +const log = require('./logging.js') + +module.exports = tree => log.info(inspect(tree.toJSON(), { depth: Infinity })) diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/lib/timers.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/lib/timers.js new file mode 100644 index 0000000000000000000000000000000000000000..39838e235950bb06fc03741014909cf3639ede1f --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/lib/timers.js @@ -0,0 +1,33 @@ +const { bin: options } = require('./options.js') +const log = require('./logging.js') + +const timers = new Map() +const finished = new Map() + +process.on('time', (level, name) => { + if (level === 'start') { + if (timers.has(name)) { + throw new Error('conflicting timer! ' + name) + } + timers.set(name, process.hrtime.bigint()) + } else if (level === 'end') { + if (!timers.has(name)) { + throw new Error('timer not started! ' + name) + } + const elapsed = Number(process.hrtime.bigint() - timers.get(name)) + timers.delete(name) + finished.set(name, elapsed) + if (options.timing) { + log.info('timeEnd', `${name} ${elapsed / 1e9}s`, log.meta({ force: options.timing === 'always' })) + } + } +}) + +process.on('exit', () => { + for (const name of timers.keys()) { + log.error('timeError', 'Dangling timer:', name) + process.exitCode = 1 + } +}) + +module.exports = finished diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/license.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/license.js new file mode 100644 index 0000000000000000000000000000000000000000..e03ffc8398db63dd3ee80f64e4471d60f24b6097 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/license.js @@ -0,0 +1,48 @@ +const localeCompare = require('@isaacs/string-locale-compare')('en') +const Arborist = require('../') +const log = require('./lib/logging.js') + +module.exports = (options, time) => { + const query = options._.shift() + const a = new Arborist(options) + return a + .loadVirtual() + .then(tree => { + // only load the actual tree if the virtual one doesn't have modern metadata + if (!tree.meta || !(tree.meta.originalLockfileVersion >= 2)) { + throw 'load actual' + } else { + return tree + } + }).catch((er) => { + log.error('loading actual tree', er) + return a.loadActual() + }) + .then(time) + .then(({ result: tree }) => { + const output = [] + if (!query) { + const set = [] + for (const license of tree.inventory.query('license')) { + set.push([tree.inventory.query('license', license).size, license]) + } + + for (const [count, license] of set.sort((a, b) => + a[1] && b[1] ? b[0] - a[0] || localeCompare(a[1], b[1]) + : a[1] ? -1 + : b[1] ? 1 + : 0)) { + output.push(`${count} ${license}`) + log.info(count, license) + } + } else { + for (const node of tree.inventory.query('license', query === 'undefined' ? undefined : query)) { + const msg = `${node.name} ${node.location} ${node.package.description || ''}` + output.push(msg) + log.info(msg) + } + } + + return output.join('\n') + }) +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/prune.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/prune.js new file mode 100644 index 0000000000000000000000000000000000000000..2bc007c29c600d47b1a8697751d720e6ef57a17f --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/prune.js @@ -0,0 +1,48 @@ +const Arborist = require('../') + +const printTree = require('./lib/print-tree.js') +const log = require('./lib/logging.js') + +const printDiff = diff => { + const { depth } = require('treeverse') + depth({ + tree: diff, + visit: d => { + if (d.location === '') { + return + } + switch (d.action) { + case 'REMOVE': + log.info('REMOVE', d.actual.location) + break + case 'ADD': + log.info('ADD', d.ideal.location, d.ideal.resolved) + break + case 'CHANGE': + log.info('CHANGE', d.actual.location, { + from: d.actual.resolved, + to: d.ideal.resolved, + }) + break + } + }, + getChildren: d => d.children, + }) +} + +module.exports = (options, time) => { + const arb = new Arborist(options) + return arb + .prune(options) + .then(time) + .then(async ({ timing, result: tree }) => { + printTree(tree) + if (options.dryRun) { + printDiff(arb.diff) + } + if (tree.meta && options.save) { + await tree.meta.save() + } + return `resolved ${tree.inventory.size} deps in ${timing.seconds}` + }) +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/reify.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/reify.js new file mode 100644 index 0000000000000000000000000000000000000000..eac986d06885e95b67aa4394e526b1522679e6dc --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/reify.js @@ -0,0 +1,48 @@ +const Arborist = require('../') + +const printTree = require('./lib/print-tree.js') +const log = require('./lib/logging.js') + +const printDiff = diff => { + const { depth } = require('treeverse') + depth({ + tree: diff, + visit: d => { + if (d.location === '') { + return + } + switch (d.action) { + case 'REMOVE': + log.info('REMOVE', d.actual.location) + break + case 'ADD': + log.info('ADD', d.ideal.location, d.ideal.resolved) + break + case 'CHANGE': + log.info('CHANGE', d.actual.location, { + from: d.actual.resolved, + to: d.ideal.resolved, + }) + break + } + }, + getChildren: d => d.children, + }) +} + +module.exports = (options, time) => { + const arb = new Arborist(options) + return arb + .reify(options) + .then(time) + .then(async ({ timing, result: tree }) => { + printTree(tree) + if (options.dryRun) { + printDiff(arb.diff) + } + if (tree.meta && options.save) { + await tree.meta.save() + } + return `resolved ${tree.inventory.size} deps in ${timing.seconds}` + }) +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/shrinkwrap.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/shrinkwrap.js new file mode 100644 index 0000000000000000000000000000000000000000..023fca47a3c89136ef403ecaa312405b8ebfa918 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/shrinkwrap.js @@ -0,0 +1,7 @@ +const Shrinkwrap = require('../lib/shrinkwrap.js') + +module.exports = (options, time) => Shrinkwrap + .load(options) + .then((s) => s.commit()) + .then(time) + .then(({ result: s }) => JSON.stringify(s, 0, 2)) diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/virtual.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/virtual.js new file mode 100644 index 0000000000000000000000000000000000000000..72116960c717fd936681ff1e19426be1de84cb24 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/bin/virtual.js @@ -0,0 +1,14 @@ +const Arborist = require('../') + +const printTree = require('./lib/print-tree.js') + +module.exports = (options, time) => new Arborist(options) + .loadVirtual() + .then(time) + .then(async ({ timing, result: tree }) => { + printTree(tree) + if (options.save) { + await tree.meta.save() + } + return `read ${tree.inventory.size} deps in ${timing.ms}` + }) diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js new file mode 100644 index 0000000000000000000000000000000000000000..58094d3285dcfe77958e3220af2fe4a64e89aa2e --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js @@ -0,0 +1,143 @@ +// add and remove dependency specs to/from pkg manifest + +const { log } = require('proc-log') +const localeCompare = require('@isaacs/string-locale-compare')('en') + +const add = ({ pkg, add, saveBundle, saveType }) => { + for (const { name, rawSpec } of add) { + let addSaveType = saveType + // if the user does not give us a type, we infer which type(s) + // to keep based on the same order of priority we do when + // building the tree as defined in the _loadDeps method of + // the node class. + if (!addSaveType) { + addSaveType = inferSaveType(pkg, name) + } + + if (addSaveType === 'prod') { + // a production dependency can only exist as production (rpj ensures it + // doesn't coexist w/ optional) + deleteSubKey(pkg, 'devDependencies', name, 'dependencies') + deleteSubKey(pkg, 'peerDependencies', name, 'dependencies') + } else if (addSaveType === 'dev') { + // a dev dependency may co-exist as peer, or optional, but not production + deleteSubKey(pkg, 'dependencies', name, 'devDependencies') + } else if (addSaveType === 'optional') { + // an optional dependency may co-exist as dev (rpj ensures it doesn't + // coexist w/ prod) + deleteSubKey(pkg, 'peerDependencies', name, 'optionalDependencies') + } else { // peer or peerOptional is all that's left + // a peer dependency may coexist as dev + deleteSubKey(pkg, 'dependencies', name, 'peerDependencies') + deleteSubKey(pkg, 'optionalDependencies', name, 'peerDependencies') + } + + const depType = saveTypeMap.get(addSaveType) + + pkg[depType] = pkg[depType] || {} + if (rawSpec !== '*' || pkg[depType][name] === undefined) { + pkg[depType][name] = rawSpec + } + if (addSaveType === 'optional') { + // Affordance for previous npm versions that require this behaviour + pkg.dependencies = pkg.dependencies || {} + pkg.dependencies[name] = pkg.optionalDependencies[name] + } + + if (addSaveType === 'peer' || addSaveType === 'peerOptional') { + const pdm = pkg.peerDependenciesMeta || {} + if (addSaveType === 'peer' && pdm[name] && pdm[name].optional) { + pdm[name].optional = false + } else if (addSaveType === 'peerOptional') { + pdm[name] = pdm[name] || {} + pdm[name].optional = true + pkg.peerDependenciesMeta = pdm + } + // peerDeps are often also a devDep, so that they can be tested when + // using package managers that don't auto-install peer deps + if (pkg.devDependencies && pkg.devDependencies[name] !== undefined) { + pkg.devDependencies[name] = pkg.peerDependencies[name] + } + } + + if (saveBundle && addSaveType !== 'peer' && addSaveType !== 'peerOptional') { + // keep it sorted, keep it unique + const bd = new Set(pkg.bundleDependencies || []) + bd.add(name) + pkg.bundleDependencies = [...bd].sort(localeCompare) + } + } + + return pkg +} + +// Canonical source of both the map between saveType and where it correlates to +// in the package, and the names of all our dependencies attributes +const saveTypeMap = new Map([ + ['dev', 'devDependencies'], + ['optional', 'optionalDependencies'], + ['prod', 'dependencies'], + ['peerOptional', 'peerDependencies'], + ['peer', 'peerDependencies'], +]) + +// Finds where the package is already in the spec and infers saveType from that +const inferSaveType = (pkg, name) => { + for (const saveType of saveTypeMap.keys()) { + if (hasSubKey(pkg, saveTypeMap.get(saveType), name)) { + if ( + saveType === 'peerOptional' && + (!hasSubKey(pkg, 'peerDependenciesMeta', name) || + !pkg.peerDependenciesMeta[name].optional) + ) { + return 'peer' + } + return saveType + } + } + return 'prod' +} + +const hasSubKey = (pkg, depType, name) => { + return pkg[depType] && Object.prototype.hasOwnProperty.call(pkg[depType], name) +} + +// Removes a subkey and warns about it if it's being replaced +const deleteSubKey = (pkg, depType, name, replacedBy) => { + if (hasSubKey(pkg, depType, name)) { + if (replacedBy) { + log.warn('idealTree', `Removing ${depType}.${name} in favor of ${replacedBy}.${name}`) + } + delete pkg[depType][name] + + // clean up peerDepsMeta if we are removing something from peerDependencies + if (depType === 'peerDependencies' && pkg.peerDependenciesMeta) { + delete pkg.peerDependenciesMeta[name] + if (!Object.keys(pkg.peerDependenciesMeta).length) { + delete pkg.peerDependenciesMeta + } + } + + if (!Object.keys(pkg[depType]).length) { + delete pkg[depType] + } + } +} + +const rm = (pkg, rm) => { + for (const depType of new Set(saveTypeMap.values())) { + for (const name of rm) { + deleteSubKey(pkg, depType, name) + } + } + if (pkg.bundleDependencies) { + pkg.bundleDependencies = pkg.bundleDependencies + .filter(name => !rm.includes(name)) + if (!pkg.bundleDependencies.length) { + delete pkg.bundleDependencies + } + } + return pkg +} + +module.exports = { add, rm, saveTypeMap, hasSubKey } diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js new file mode 100644 index 0000000000000000000000000000000000000000..823f940e9841c0c9282c563b3a472d82eca386f4 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js @@ -0,0 +1,1594 @@ +// mixin implementing the buildIdealTree method +const localeCompare = require('@isaacs/string-locale-compare')('en') +const PackageJson = require('@npmcli/package-json') +const npa = require('npm-package-arg') +const pacote = require('pacote') +const cacache = require('cacache') +const { callLimit: promiseCallLimit } = require('promise-call-limit') +const realpath = require('../../lib/realpath.js') +const { resolve, dirname, sep } = require('node:path') +const treeCheck = require('../tree-check.js') +const { readdirScoped } = require('@npmcli/fs') +const { lstat, readlink } = require('node:fs/promises') +const { depth } = require('treeverse') +const { log, time } = require('proc-log') +const { redact } = require('@npmcli/redact') +const semver = require('semver') + +const { + OK, + REPLACE, + CONFLICT, +} = require('../can-place-dep.js') +const PlaceDep = require('../place-dep.js') + +const debug = require('../debug.js') +const fromPath = require('../from-path.js') +const calcDepFlags = require('../calc-dep-flags.js') +const Shrinkwrap = require('../shrinkwrap.js') +const { defaultLockfileVersion } = Shrinkwrap +const Node = require('../node.js') +const Link = require('../link.js') +const addRmPkgDeps = require('../add-rm-pkg-deps.js') +const optionalSet = require('../optional-set.js') +const { checkEngine, checkPlatform } = require('npm-install-checks') +const relpath = require('../relpath.js') +const resetDepFlags = require('../reset-dep-flags.js') + +// note: some of these symbols are shared so we can hit +// them with unit tests and reuse them across mixins +const _updateAll = Symbol.for('updateAll') +const _flagsSuspect = Symbol.for('flagsSuspect') +const _setWorkspaces = Symbol.for('setWorkspaces') +const _updateNames = Symbol.for('updateNames') +const _resolvedAdd = Symbol.for('resolvedAdd') +const _rpcache = Symbol.for('realpathCache') +const _stcache = Symbol.for('statCache') + +// used by Reify mixin +const _addNodeToTrashList = Symbol.for('addNodeToTrashList') + +// Push items in, pop them sorted by depth and then path +// Sorts physically shallower deps up to the front of the queue, because +// they'll affect things deeper in, then alphabetical for consistency between +// installs +class DepsQueue { + #deps = [] + #sorted = true + + get length () { + return this.#deps.length + } + + push (item) { + if (!this.#deps.includes(item)) { + this.#sorted = false + this.#deps.push(item) + } + } + + pop () { + if (!this.#sorted) { + this.#deps.sort((a, b) => (a.depth - b.depth) || localeCompare(a.path, b.path)) + this.#sorted = true + } + return this.#deps.shift() + } +} + +module.exports = cls => class IdealTreeBuilder extends cls { + #complete + #currentDep = null + #depsQueue = new DepsQueue() + #depsSeen = new Set() + #explicitRequests = new Set() + #follow + #installStrategy + #linkNodes = new Set() + #loadFailures = new Set() + #manifests = new Map() + #mutateTree = false + // a map of each module in a peer set to the thing that depended on + // that set of peers in the first place. Use a WeakMap so that we + // don't hold onto references for nodes that are garbage collected. + #peerSetSource = new WeakMap() + #preferDedupe = false + #prune + #strictPeerDeps + #virtualRoots = new Map() + + constructor (options) { + super(options) + + const { + follow = false, + installStrategy = 'hoisted', + strictPeerDeps = false, + global, + } = options + + this.#strictPeerDeps = !!strictPeerDeps + + this.#installStrategy = global ? 'shallow' : installStrategy + this.#follow = !!follow + + this[_updateAll] = false + this[_updateNames] = [] + this[_resolvedAdd] = [] + + // caches for cached realpath calls + const cwd = process.cwd() + // assume that the cwd is real enough for our purposes + this[_rpcache] = new Map([[cwd, cwd]]) + this[_stcache] = new Map() + this[_flagsSuspect] = false + } + + get explicitRequests () { + return new Set(this.#explicitRequests) + } + + // public method + async buildIdealTree (options = {}) { + if (this.idealTree) { + return this.idealTree + } + + // allow the user to set reify options on the ctor as well. + // XXX: deprecate separate reify() options object. + options = { ...this.options, ...options } + + // an empty array or any falsey value is the same as null + if (!options.add || options.add.length === 0) { + options.add = null + } + if (!options.rm || options.rm.length === 0) { + options.rm = null + } + + const timeEnd = time.start('idealTree') + + if (!options.add && !options.rm && !options.update && this.options.global) { + throw new Error('global requires add, rm, or update option') + } + + // first get the virtual tree, if possible. If there's a lockfile, then + // that defines the ideal tree, unless the root package.json is not + // satisfied by what the ideal tree provides. + // from there, we start adding nodes to it to satisfy the deps requested + // by the package.json in the root. + + this.#parseSettings(options) + + // start tracker block + this.addTracker('idealTree') + + try { + await this.#initTree() + await this.#inflateAncientLockfile() + await this.#applyUserRequests(options) + await this.#buildDeps() + await this.#fixDepFlags() + await this.#pruneFailedOptional() + await this.#checkEngineAndPlatform() + } finally { + timeEnd() + this.finishTracker('idealTree') + } + + return treeCheck(this.idealTree) + } + + async #checkEngineAndPlatform () { + const { engineStrict, npmVersion, nodeVersion, omit = [], cpu, os, libc } = this.options + const omitSet = new Set(omit) + + for (const node of this.idealTree.inventory.values()) { + if (!node.optional && !node.shouldOmit(omitSet)) { + try { + // if devEngines is present in the root node we ignore the engines check + if (!(node.isRoot && node.package.devEngines)) { + checkEngine(node.package, npmVersion, nodeVersion, this.options.force) + } + } catch (err) { + if (engineStrict) { + throw err + } + log.warn(err.code, err.message, { + package: err.pkgid, + required: err.required, + current: err.current, + }) + } + checkPlatform(node.package, this.options.force) + } + if (node.optional && !node.inert) { + // Mark any optional packages we can't install as inert. + // We ignore the --force and --engine-strict flags. + try { + checkEngine(node.package, npmVersion, nodeVersion, false) + checkPlatform(node.package, false, { cpu, os, libc }) + } catch (error) { + const set = optionalSet(node) + for (const node of set) { + node.inert = true + } + } + } + } + } + + #parseSettings (options) { + const update = options.update === true ? { all: true } + : Array.isArray(options.update) ? { names: options.update } + : options.update || {} + + if (update.all || !Array.isArray(update.names)) { + update.names = [] + } + + this.#complete = !!options.complete + this.#preferDedupe = !!options.preferDedupe + + // validates list of update names, they must + // be dep names only, no semver ranges are supported + for (const name of update.names) { + const spec = npa(name) + const validationError = + new TypeError(`Update arguments must only contain package names, eg: + npm update ${spec.name}`) + validationError.code = 'EUPDATEARGS' + + // If they gave us anything other than a bare package name + if (spec.raw !== spec.name) { + throw validationError + } + } + this[_updateNames] = update.names + + this[_updateAll] = update.all + // we prune by default unless explicitly set to boolean false + this.#prune = options.prune !== false + + // set if we add anything, but also set here if we know we'll make + // changes and thus have to maybe prune later. + this.#mutateTree = !!( + options.add || + options.rm || + update.all || + update.names.length + ) + } + + // load the initial tree, either the virtualTree from a shrinkwrap, + // or just the root node from a package.json + async #initTree () { + const timeEnd = time.start('idealTree:init') + let root + if (this.options.global) { + root = await this.#globalRootNode() + } else { + try { + const { content: pkg } = await PackageJson.normalize(this.path) + root = await this.#rootNodeFromPackage(pkg) + } catch (err) { + if (err.code === 'EJSONPARSE') { + throw err + } + root = await this.#rootNodeFromPackage({}) + } + } + return this[_setWorkspaces](root) + // ok to not have a virtual tree. probably initial install. + // When updating all, we load the shrinkwrap, but don't bother + // to build out the full virtual tree from it, since we'll be + // reconstructing it anyway. + .then(root => { + if (this.options.global) { + return root + } else if (!this.options.usePackageLock || this[_updateAll]) { + return Shrinkwrap.reset({ + path: this.path, + lockfileVersion: this.options.lockfileVersion, + resolveOptions: this.options, + }).then(meta => Object.assign(root, { meta })) + } else { + return this.loadVirtual({ root }) + .then(tree => { + this.#applyRootOverridesToWorkspaces(tree) + return tree + }) + } + }) + + // if we don't have a lockfile to go from, then start with the + // actual tree, so we only make the minimum required changes. + // don't do this for global installs or updates, because in those + // cases we don't use a lockfile anyway. + // Load on a new Arborist object, so the Nodes aren't the same, + // or else it'll get super confusing when we change them! + .then(async root => { + if ((!this[_updateAll] && !this.options.global && !root.meta.loadedFromDisk) || (this.options.global && this[_updateNames].length)) { + await new this.constructor(this.options).loadActual({ root }) + const tree = root.target + // even though we didn't load it from a package-lock.json FILE, + // we still loaded it "from disk", meaning we have to reset + // dep flags before assuming that any mutations were reflected. + if (tree.children.size) { + root.meta.loadedFromDisk = true + // set these so that we don't try to ancient lockfile reload it + root.meta.originalLockfileVersion = root.meta.lockfileVersion = this.options.lockfileVersion || defaultLockfileVersion + } + } + root.meta.inferFormattingOptions(root.package) + return root + }) + + .then(tree => { + // search the virtual tree for missing/invalid edges, if any are found add their source to + // the depsQueue so that we'll fix it later + depth({ + tree, + getChildren: (node) => { + const children = [] + for (const edge of node.edgesOut.values()) { + children.push(edge.to) + } + return children + }, + filter: node => node, + visit: node => { + for (const edge of node.edgesOut.values()) { + const skipPeerOptional = edge.type === 'peerOptional' && this.options.save === false + if (!skipPeerOptional && (!edge.to || !edge.valid)) { + this.#depsQueue.push(node) + break // no need to continue the loop after the first hit + } + } + }, + }) + // null the virtual tree, because we're about to hack away at it + // if you want another one, load another copy. + this.idealTree = tree + this.virtualTree = null + timeEnd() + return tree + }) + } + + async #globalRootNode () { + const root = await this.#rootNodeFromPackage({ dependencies: {} }) + // this is a gross kludge to handle the fact that we don't save + // metadata on the root node in global installs, because the "root" + // node is something like /usr/local/lib. + const meta = new Shrinkwrap({ + path: this.path, + lockfileVersion: this.options.lockfileVersion, + resolveOptions: this.options, + }) + meta.reset() + root.meta = meta + return root + } + + async #rootNodeFromPackage (pkg) { + // if the path doesn't exist, then we explode at this point. Note that + // this is not a problem for reify(), since it creates the root path + // before ever loading trees. + // TODO: make buildIdealTree() and loadActual handle a missing root path, + // or a symlink to a missing target, and let reify() create it as needed. + const real = await realpath(this.path, this[_rpcache], this[_stcache]) + const Cls = real === this.path ? Node : Link + const root = new Cls({ + path: this.path, + realpath: real, + pkg, + extraneous: false, + dev: false, + devOptional: false, + peer: false, + optional: false, + global: this.options.global, + installLinks: this.installLinks, + legacyPeerDeps: this.legacyPeerDeps, + loadOverrides: true, + }) + if (root.isLink) { + root.target = new Node({ + path: real, + realpath: real, + pkg, + extraneous: false, + dev: false, + devOptional: false, + peer: false, + optional: false, + global: this.options.global, + installLinks: this.installLinks, + legacyPeerDeps: this.legacyPeerDeps, + root, + }) + } + return root + } + + // process the add/rm requests by modifying the root node, and the + // update.names request by queueing nodes dependent on those named. + async #applyUserRequests (options) { + const timeEnd = time.start('idealTree:userRequests') + const tree = this.idealTree.target + + if (!this.options.workspaces.length) { + await this.#applyUserRequestsToNode(tree, options) + } else { + const nodes = this.workspaceNodes(tree, this.options.workspaces) + if (this.options.includeWorkspaceRoot) { + nodes.push(tree) + } + const appliedRequests = nodes.map( + node => this.#applyUserRequestsToNode(node, options) + ) + await Promise.all(appliedRequests) + } + + timeEnd() + } + + async #applyUserRequestsToNode (tree, options) { + // If we have a list of package names to update, and we know it's + // going to update them wherever they are, add any paths into those + // named nodes to the buildIdealTree queue. + if (!this.options.global && this[_updateNames].length) { + this.#queueNamedUpdates() + } + + // global updates only update the globalTop nodes, but we need to know + // that they're there, and not reinstall the world unnecessarily. + const globalExplicitUpdateNames = [] + if (this.options.global && (this[_updateAll] || this[_updateNames].length)) { + const nm = resolve(this.path, 'node_modules') + const paths = await readdirScoped(nm).catch(() => []) + for (const p of paths) { + const name = p.replace(/\\/g, '/') + const updateName = this[_updateNames].includes(name) + if (this[_updateAll] || updateName) { + if (updateName) { + globalExplicitUpdateNames.push(name) + } + const dir = resolve(nm, name) + const st = await lstat(dir) + .catch(/* istanbul ignore next */ () => null) + if (st && st.isSymbolicLink()) { + const target = await readlink(dir) + const real = resolve(dirname(dir), target) + tree.package.dependencies[name] = `file:${real}` + } else { + tree.package.dependencies[name] = '*' + } + } + } + } + + if (this.auditReport && this.auditReport.size > 0) { + await this.#queueVulnDependents(options) + } + + const { add, rm } = options + + if (rm && rm.length) { + addRmPkgDeps.rm(tree.package, rm) + for (const name of rm) { + this.#explicitRequests.add({ from: tree, name, action: 'DELETE' }) + } + } + + if (add && add.length) { + await this.#add(tree, options) + } + + // triggers a refresh of all edgesOut. this has to be done BEFORE + // adding the edges to explicitRequests, because the package setter + // resets all edgesOut. + if (add && add.length || rm && rm.length || this.options.global) { + tree.package = tree.package + } + + for (const spec of this[_resolvedAdd]) { + if (spec.tree === tree) { + this.#explicitRequests.add(tree.edgesOut.get(spec.name)) + } + } + for (const name of globalExplicitUpdateNames) { + this.#explicitRequests.add(tree.edgesOut.get(name)) + } + + this.#depsQueue.push(tree) + } + + // This returns a promise because we might not have the name yet, and need to call pacote.manifest to find the name. + async #add (tree, { add, saveType = null, saveBundle = false }) { + // If we have a link it will need to be added relative to the target's path + const path = tree.target.path + + // Get the name for each of the specs in the list. + // e.g. doing `foo@bar` we just return foo but if it's a url or git, we don't know the name until we fetch it and look in its manifest. + await Promise.all(add.map(async rawSpec => { + // We do NOT provide the path to npa here, because user-additions need to be resolved relative to the tree being added to. + let spec = npa(rawSpec) + + // if it's just @'' then we reload whatever's there, or get latest. + // if it's an explicit tag, we need to install that specific tag version. + const isTag = spec.rawSpec && spec.type === 'tag' + + // look up the names of file/directory/git specs + if (!spec.name || isTag) { + const _isRoot = tree.isProjectRoot || tree.isWorkspace + const mani = await pacote.manifest(spec, { ...this.options, _isRoot }) + if (isTag) { + // translate tag to a version + spec = npa(`${mani.name}@${mani.version}`) + } + spec.name = mani.name + } + + const { name } = spec + if (spec.type === 'file') { + spec = npa(`file:${relpath(path, spec.fetchSpec)}`, path) + spec.name = name + } else if (spec.type === 'directory') { + try { + const real = await realpath(spec.fetchSpec, this[_rpcache], this[_stcache]) + spec = npa(`file:${relpath(path, real)}`, path) + spec.name = name + } catch { + // TODO: create synthetic test case to simulate realpath failure + } + } + spec.tree = tree + this[_resolvedAdd].push(spec) + })) + + // now this._resolvedAdd is a list of spec objects with names. + // find a home for each of them! + addRmPkgDeps.add({ + pkg: tree.package, + add: this[_resolvedAdd], + saveBundle, + saveType, + }) + } + + // TODO: provide a way to fix bundled deps by exposing metadata about + // what's in the bundle at each published manifest. Without that, we + // can't possibly fix bundled deps without breaking a ton of other stuff, + // and leaving the user subject to getting it overwritten later anyway. + async #queueVulnDependents (options) { + for (const vuln of this.auditReport.values()) { + for (const node of vuln.nodes) { + const bundler = node.getBundler() + + // XXX this belongs in the audit report itself, not here. + // We shouldn't even get these things here, and they shouldn't + // be printed by npm-audit-report as if they can be fixed, because + // they can't. + if (bundler) { + log.warn(`audit fix ${node.name}@${node.version}`, + `${node.location}\nis a bundled dependency of\n${ + bundler.name}@${bundler.version} at ${bundler.location}\n` + + 'It cannot be fixed automatically.\n' + + `Check for updates to the ${bundler.name} package.`) + continue + } + + for (const edge of node.edgesIn) { + this.addTracker('idealTree', edge.from.name, edge.from.location) + this.#depsQueue.push(edge.from) + } + } + } + + // note any that can't be fixed at the root level without --force + // if there's a fix, we use that. otherwise, the user has to remove it, + // find a different thing, fix the upstream, etc. + // + // XXX: how to handle top nodes that aren't the root? Maybe the report + // just tells the user to cd into that directory and fix it? + if (this.options.force && this.auditReport && this.auditReport.topVulns.size) { + options.add = options.add || [] + options.rm = options.rm || [] + const nodesTouched = new Set() + for (const [name, topVuln] of this.auditReport.topVulns.entries()) { + const { + simpleRange, + topNodes, + fixAvailable, + } = topVuln + for (const node of topNodes) { + if (!node.isProjectRoot && !node.isWorkspace) { + // not something we're going to fix, sorry. have to cd into + // that directory and fix it yourself. + log.warn('audit', 'Manual fix required in linked project ' + + `at ./${node.location} for ${name}@${simpleRange}.\n` + + `'cd ./${node.location}' and run 'npm audit' for details.`) + continue + } + + if (!fixAvailable) { + log.warn('audit', `No fix available for ${name}@${simpleRange}`) + continue + } + + // name may be different if parent fixes the dep + // see Vuln fixAvailable setter + const { isSemVerMajor, version, name: fixName } = fixAvailable + const breakingMessage = isSemVerMajor + ? 'a SemVer major change' + : 'outside your stated dependency range' + log.warn('audit', `Updating ${fixName} to ${version}, ` + + `which is ${breakingMessage}.`) + + await this.#add(node, { add: [`${fixName}@${version}`] }) + nodesTouched.add(node) + } + } + for (const node of nodesTouched) { + node.package = node.package + } + } + } + + #avoidRange (name) { + if (!this.auditReport) { + return null + } + const vuln = this.auditReport.get(name) + if (!vuln) { + return null + } + return vuln.range + } + + #queueNamedUpdates () { + // ignore top nodes, since they are not loaded the same way, and + // probably have their own project associated with them. + + // for every node with one of the names on the list, we add its + // dependents to the queue to be evaluated. in buildDepStep, + // anything on the update names list will get refreshed, even if + // it isn't a problem. + + // XXX this could be faster by doing a series of inventory.query('name') + // calls rather than walking over everything in the tree. + for (const node of this.idealTree.inventory.values()) { + // XXX add any invalid edgesOut to the queue + if (this[_updateNames].includes(node.name) && + !node.isTop && !node.inDepBundle && !node.inShrinkwrap) { + for (const edge of node.edgesIn) { + this.addTracker('idealTree', edge.from.name, edge.from.location) + this.#depsQueue.push(edge.from) + } + } + } + } + + async #inflateAncientLockfile () { + const { meta, inventory } = this.idealTree + const ancient = meta.ancientLockfile + const old = meta.loadedFromDisk && !(meta.originalLockfileVersion >= 2) + + if (inventory.size === 0 || !ancient && !old) { + return + } + + // if the lockfile is from node v5 or earlier, then we'll have to reload + // all the manifests of everything we encounter. this is costly, but at + // least it's just a one-time hit. + const timeEnd = time.start('idealTree:inflate') + + // don't warn if we're not gonna actually write it back anyway. + const heading = ancient ? 'ancient lockfile' : 'old lockfile' + if (ancient || !this.options.lockfileVersion || + this.options.lockfileVersion >= defaultLockfileVersion) { + log.warn(heading, + ` +The ${meta.type} file was created with an old version of npm, +so supplemental metadata must be fetched from the registry. + +This is a one-time fix-up, please be patient... +`) + } + + this.addTracker('idealTree:inflate') + const queue = [] + for (const node of inventory.values()) { + if (node.isProjectRoot) { + continue + } + + // if the node's location isn't within node_modules then this is actually + // a link target, so skip it. the link node itself will be queued later. + if (!node.location.startsWith('node_modules')) { + continue + } + + queue.push(async () => { + log.silly('inflate', node.location) + const { resolved, version, path, name, location, integrity } = node + // don't try to hit the registry for linked deps + const useResolved = resolved && ( + !version || resolved.startsWith('file:') + ) + const id = useResolved ? resolved : version + const spec = npa.resolve(name, id, dirname(path)) + const t = `idealTree:inflate:${location}` + this.addTracker(t) + try { + const mani = await pacote.manifest(spec, { + ...this.options, + resolved: resolved, + integrity: integrity, + fullMetadata: false, + }) + node.package = { ...mani, _id: `${mani.name}@${mani.version}` } + } catch (er) { + const warning = `Could not fetch metadata for ${name}@${id}` + log.warn(heading, warning, er) + } + this.finishTracker(t) + }) + } + await promiseCallLimit(queue) + + // have to re-calc dep flags, because the nodes don't have edges + // until their packages get assigned, so everything looks extraneous + resetDepFlags(this.idealTree) + calcDepFlags(this.idealTree) + + // yes, yes, this isn't the "original" version, but now that it's been + // upgraded, we need to make sure we don't do the work to upgrade it + // again, since it's now as new as can be. + if (!this.options.lockfileVersion && !meta.hiddenLockfile) { + meta.originalLockfileVersion = defaultLockfileVersion + } + this.finishTracker('idealTree:inflate') + timeEnd() + } + + // at this point we have a virtual tree with the actual root node's + // package deps, which may be partly or entirely incomplete, invalid + // or extraneous. + #buildDeps () { + const timeEnd = time.start('idealTree:buildDeps') + const tree = this.idealTree.target + tree.assertRootOverrides() + this.#depsQueue.push(tree) + // XXX also push anything that depends on a node with a name + // in the override list + log.silly('idealTree', 'buildDeps') + this.addTracker('idealTree', tree.name, '') + return this.#buildDepStep().then(timeEnd) + } + + async #buildDepStep () { + // removes tracker of previous dependency in the queue + if (this.#currentDep) { + const { location, name } = this.#currentDep + time.end(`idealTree:${location || '#root'}`) + this.finishTracker('idealTree', name, location) + this.#currentDep = null + } + + if (!this.#depsQueue.length) { + return this.#resolveLinks() + } + + const node = this.#depsQueue.pop() + const bd = node.package.bundleDependencies + const hasBundle = bd && Array.isArray(bd) && bd.length + const { hasShrinkwrap } = node + + // if the node was already visited, or has since been removed from the + // tree, skip over it and process the rest of the queue. If a node has + // a shrinkwrap, also skip it, because it's going to get its deps + // satisfied by whatever's in that file anyway. + if (this.#depsSeen.has(node) || + node.root !== this.idealTree || + hasShrinkwrap && !this.#complete) { + return this.#buildDepStep() + } + + this.#depsSeen.add(node) + this.#currentDep = node + time.start(`idealTree:${node.location || '#root'}`) + + // if we're loading a _complete_ ideal tree, for a --package-lock-only + // installation for example, we have to crack open the tarball and + // look inside if it has bundle deps or shrinkwraps. note that this is + // not necessary during a reification, because we just update the + // ideal tree by reading bundles/shrinkwraps in place. + // Don't bother if the node is from the actual tree and hasn't + // been resolved, because we can't fetch it anyway, could be anything! + const crackOpen = this.#complete && + node !== this.idealTree && + node.resolved && + (hasBundle || hasShrinkwrap) && + !node.inert + if (crackOpen) { + const Arborist = this.constructor + const opt = { ...this.options } + await cacache.tmp.withTmp(this.cache, opt, async path => { + await pacote.extract(node.resolved, path, { + ...opt, + Arborist, + resolved: node.resolved, + integrity: node.integrity, + }) + + if (hasShrinkwrap) { + await new Arborist({ ...this.options, path }) + .loadVirtual({ root: node }) + } + + if (hasBundle) { + await new Arborist({ ...this.options, path }) + .loadActual({ root: node, ignoreMissing: true }) + } + }) + } + + // if any deps are missing or invalid, then we fetch the manifest for + // the thing we want, and build a new dep node from that. + // Then, find the ideal placement for that node. The ideal placement + // searches from the node's deps (or parent deps in the case of non-root + // peer deps), and walks up the tree until it finds the highest spot + // where it doesn't cause any conflicts. + // + // A conflict can be: + // - A node by that name already exists at that location. + // - The parent has a peer dep on that name + // - One of the node's peer deps conflicts at that location, unless the + // peer dep is met by a node at that location, which is fine. + // + // If we create a new node, then build its ideal deps as well. + // + // Note: this is the same "maximally naive" deduping tree-building + // algorithm that npm has used since v3. In a case like this: + // + // root -> (a@1, b@1||2) + // a -> (b@1) + // + // You'll end up with a tree like this: + // + // root + // +-- a@1 + // | +-- b@1 + // +-- b@2 + // + // rather than this, more deduped, but just as correct tree: + // + // root + // +-- a@1 + // +-- b@1 + // + // Another way to look at it is that this algorithm favors getting higher + // version deps at higher levels in the tree, even if that reduces + // potential deduplication. + // + // Set `preferDedupe: true` in the options to replace the shallower + // dep if allowed. + + const tasks = [] + const peerSource = this.#peerSetSource.get(node) || node + for (const edge of this.#problemEdges(node)) { + if (edge.peerConflicted) { + continue + } + + // peerSetSource is only relevant when we have a peerEntryEdge + // otherwise we're setting regular non-peer deps as if they have + // a virtual root of whatever brought in THIS node. + // so we VR the node itself if the edge is not a peer + const source = edge.peer ? peerSource : node + + const virtualRoot = this.#virtualRoot(source, true) + // reuse virtual root if we already have one, but don't + // try to do the override ahead of time, since we MAY be able + // to create a more correct tree than the virtual root could. + const vrEdge = virtualRoot && virtualRoot.edgesOut.get(edge.name) + const vrDep = vrEdge && vrEdge.valid && vrEdge.to + // only re-use the virtualRoot if it's a peer edge we're placing. + // otherwise, we end up in situations where we override peer deps that + // we could have otherwise found homes for. Eg: + // xy -> (x, y) + // x -> PEER(z@1) + // y -> PEER(z@2) + // If xy is a dependency, we can resolve this like: + // project + // +-- xy + // | +-- y + // | +-- z@2 + // +-- x + // +-- z@1 + // But if x and y are loaded in the same virtual root, then they will + // be forced to agree on a version of z. + const required = new Set([edge.from]) + const parent = edge.peer ? virtualRoot : null + const dep = vrDep && vrDep.satisfies(edge) ? vrDep + : await this.#nodeFromEdge(edge, parent, null, required) + + /* istanbul ignore next */ + debug(() => { + if (!dep) { + throw new Error('no dep??') + } + }) + + tasks.push({ edge, dep }) + } + + const placeDeps = tasks.sort((a, b) => localeCompare(a.edge.name, b.edge.name)) + + const promises = [] + for (const { edge, dep } of placeDeps) { + const pd = new PlaceDep({ + edge, + dep, + + auditReport: this.auditReport, + explicitRequest: this.#explicitRequests.has(edge), + force: this.options.force, + installLinks: this.installLinks, + installStrategy: this.#installStrategy, + legacyPeerDeps: this.legacyPeerDeps, + preferDedupe: this.#preferDedupe, + strictPeerDeps: this.#strictPeerDeps, + updateNames: this[_updateNames], + }) + // placing a dep is actually a tree of placing the dep itself + // and all of its peer group that aren't already met by the tree + depth({ + tree: pd, + getChildren: pd => pd.children, + visit: pd => { + const { placed, edge, canPlace: cpd } = pd + // if we didn't place anything, nothing to do here + if (!placed) { + return + } + + // we placed something, that means we changed the tree + if (placed.errors.length) { + this.#loadFailures.add(placed) + } + this.#mutateTree = true + if (cpd.canPlaceSelf === OK) { + for (const edgeIn of placed.edgesIn) { + if (edgeIn === edge) { + continue + } + const { from, valid, peerConflicted } = edgeIn + if (!peerConflicted && !valid) { + if (this.#depsSeen.has(from) && this.options.save) { + // Re-queue already-processed nodes when a newly placed dep creates an invalid edge during npm install (save=true). + // This handles the case where a peerOptional dep was valid (missing) when the node was first processed, but becomes invalid when the dep is later placed by another path with a version that doesn't satisfy the peer spec. + // See npm/cli#8726. + this.#depsSeen.delete(from) + this.#depsQueue.push(from) + } else if (!this.#depsSeen.has(from)) { + this.addTracker('idealTree', from.name, from.location) + this.#depsQueue.push(from) + } + } + } + } else { + /* istanbul ignore else - should be only OK or REPLACE here */ + if (cpd.canPlaceSelf === REPLACE) { + // this may also create some invalid edges, for example if we're + // intentionally causing something to get nested which was + // previously placed in this location. + for (const edgeIn of placed.edgesIn) { + if (edgeIn === edge) { + continue + } + + const { valid, peerConflicted } = edgeIn + if (!valid && !peerConflicted) { + // if it's already been visited, we have to re-visit + // otherwise, just enqueue normally. + this.#depsSeen.delete(edgeIn.from) + this.#depsQueue.push(edgeIn.from) + } + } + } + } + + /* istanbul ignore if - should be impossible */ + if (cpd.canPlaceSelf === CONFLICT) { + debug(() => { + const er = new Error('placed with canPlaceSelf=CONFLICT') + throw Object.assign(er, { placeDep: pd }) + }) + return + } + + // lastly, also check for the missing deps of the node we placed, + // and any holes created by pruning out conflicted peer sets. + this.#depsQueue.push(placed) + for (const dep of pd.needEvaluation) { + this.#depsSeen.delete(dep) + this.#depsQueue.push(dep) + } + + // pre-fetch any problem edges, since we'll need these soon + // if it fails at this point, though, don't worry because it + // may well be an optional dep that has gone missing. it'll + // fail later anyway. + for (const e of this.#problemEdges(placed)) { + // XXX This is somehow load bearing. This makes tests that print + // the ideal tree of a tree with tarball dependencies fail. This + // can't be changed or removed till we figure out why + // The test is named "tarball deps with transitive tarball deps" + promises.push(() => + this.#fetchManifest(npa.resolve(e.name, e.spec, fromPath(placed, e))) + .catch(() => null) + ) + } + }, + }) + } + + for (const { to } of node.edgesOut.values()) { + if (to && to.isLink && to.target) { + this.#linkNodes.add(to) + } + } + + await promiseCallLimit(promises) + return this.#buildDepStep() + } + + // loads a node from an edge, and then loads its peer deps (and their + // peer deps, on down the line) into a virtual root parent. + async #nodeFromEdge (edge, parent_, secondEdge, required) { + // create a virtual root node with the same deps as the node that + // is requesting this one, so that we can get all the peer deps in + // a context where they're likely to be resolvable. + // Note that the virtual root will also have virtual copies of the + // targets of any child Links, so that they resolve appropriately. + const parent = parent_ || this.#virtualRoot(edge.from) + + const spec = npa.resolve(edge.name, edge.spec, edge.from.path) + const first = await this.#nodeFromSpec(edge.name, spec, parent, edge) + + // we might have a case where the parent has a peer dependency on + // `foo@*` which resolves to v2, but another dep in the set has a + // peerDependency on `foo@1`. In that case, if we force it to be v2, + // we're unnecessarily triggering an ERESOLVE. + // If we have a second edge to worry about, and it's not satisfied + // by the first node, try a second and see if that satisfies the + // original edge here. + const spec2 = secondEdge && npa.resolve( + edge.name, + secondEdge.spec, + secondEdge.from.path + ) + const second = secondEdge && !secondEdge.valid + ? await this.#nodeFromSpec(edge.name, spec2, parent, secondEdge) + : null + + // pick the second one if they're both happy with that; otherwise, first + const node = second && edge.valid ? second : first + // ensure the one we want is the one that's placed + node.parent = parent + + if (required.has(edge.from) && edge.type !== 'peerOptional' || + secondEdge && ( + required.has(secondEdge.from) && secondEdge.type !== 'peerOptional')) { + required.add(node) + } + + // keep track of the thing that caused this node to be included. + const src = parent.sourceReference + this.#peerSetSource.set(node, src) + + // do not load the peers along with the set if this is a global top pkg + // otherwise we'll be tempted to put peers as other top-level installed + // things, potentially clobbering what's there already, which is not + // what we want. the missing edges will be picked up on the next pass. + if (this.options.global && edge.from.isProjectRoot) { + return node + } + + // otherwise, we have to make sure that our peers can go along with us. + return this.#loadPeerSet(node, required) + } + + #virtualRoot (node, reuse = false) { + if (reuse && this.#virtualRoots.has(node)) { + return this.#virtualRoots.get(node) + } + + const vr = new Node({ + path: node.realpath, + sourceReference: node, + installLinks: this.installLinks, + legacyPeerDeps: this.legacyPeerDeps, + overrides: node.overrides, + }) + + // also need to set up any targets from any link deps, so that + // they are properly reflected in the virtual environment + for (const child of node.children.values()) { + if (child.isLink) { + new Node({ + path: child.realpath, + sourceReference: child.target, + root: vr, + }) + } + } + + this.#virtualRoots.set(node, vr) + return vr + } + + #problemEdges (node) { + // skip over any bundled deps, they're not our problem. + // Note that this WILL fetch bundled meta-deps which are also dependencies + // but not listed as bundled deps. When reifying, we first unpack any + // nodes that have bundleDependencies, then do a loadActual on them, move + // the nodes into the ideal tree, and then prune. So, fetching those + // possibly-bundled meta-deps at this point doesn't cause any worse + // problems than a few unnecessary packument fetches. + + // also skip over any nodes in the tree that failed to load, since those + // will crash the install later on anyway. + const bd = node.isProjectRoot || node.isWorkspace ? null + : node.package.bundleDependencies + const bundled = new Set(bd || []) + + const problems = [] + for (const edge of node.edgesOut.values()) { + // If it's included in a bundle, we take whatever is specified. + if (bundled.has(edge.name)) { + continue + } + + // If it's already been logged as a load failure, skip it. + if (edge.to && this.#loadFailures.has(edge.to)) { + continue + } + + // If it's shrinkwrapped, we use what the shrinkwap wants. + if (edge.to && edge.to.inShrinkwrap) { + continue + } + + // If the edge has no destination, that's a problem, unless + // if it's peerOptional and not explicitly requested. + if (!edge.to) { + if (edge.type !== 'peerOptional' || + this.#explicitRequests.has(edge)) { + problems.push(edge) + } + continue + } + + // If the edge has an error, there's a problem, unless it's peerOptional and we're not saving (e.g. npm ci), in which case we trust the lockfile and skip re-resolution. + // When saving (npm install), peerOptional invalid edges ARE treated as problems so the lockfile gets fixed. + // See npm/cli#8726. + if (!edge.valid) { + if (edge.type !== 'peerOptional' || this.options.save !== false) { + problems.push(edge) + } + continue + } + + // If the edge is a workspace, and it's valid, leave it alone + if (edge.to.isWorkspace) { + continue + } + + // user explicitly asked to update this package by name, problem + if (this[_updateNames].includes(edge.name)) { + problems.push(edge) + continue + } + + // fixing a security vulnerability with this package, problem + if (this.auditReport && this.auditReport.isVulnerable(edge.to)) { + problems.push(edge) + continue + } + + // user has explicitly asked to install this package, problem + if (this.#explicitRequests.has(edge)) { + problems.push(edge) + continue + } + } + return problems + } + + async #fetchManifest (spec) { + const options = { + ...this.options, + avoid: this.#avoidRange(spec.name), + fullMetadata: true, + } + // get the intended spec and stored metadata from yarn.lock file, + // if available and valid. + spec = this.idealTree.meta.checkYarnLock(spec, options) + + if (this.#manifests.has(spec.raw)) { + return this.#manifests.get(spec.raw) + } else { + log.silly('fetch manifest', spec.raw.replace(spec.rawSpec, redact(spec.rawSpec))) + const mani = await pacote.manifest(spec, options) + this.#manifests.set(spec.raw, mani) + return mani + } + } + + async #nodeFromSpec (name, spec, parent, edge) { + // pacote will slap integrity on its options, so we have to clone + // the object so it doesn't get mutated. + // Don't bother to load the manifest for link deps, because the target + // might be within another package that doesn't exist yet. + const { installLinks, legacyPeerDeps } = this + const isWorkspace = this.idealTree.workspaces && this.idealTree.workspaces.has(spec.name) + + // spec is a directory, link it if: + // - it's a workspace, OR + // - it's a project-internal file: dependency (always linked), OR + // - it's external and installLinks is false + // TODO post arborist refactor, will need to check for installStrategy=linked + let isProjectInternalFileSpec = false + if (edge?.rawSpec.startsWith('file:../') || edge?.rawSpec.startsWith('file:./')) { + const targetPath = resolve(parent.realpath, edge.rawSpec.slice(5)) + const resolvedProjectRoot = resolve(this.idealTree.realpath) + // Check if the target is within the project root + isProjectInternalFileSpec = targetPath.startsWith(resolvedProjectRoot + sep) || targetPath === resolvedProjectRoot + } + + // When using --install-links, we need to handle transitive file dependencies specially + // If the parent was installed (not linked) due to --install-links, and this is a file: dep, we should also install it rather than link it + const parentWasInstalled = parent && !parent.isLink && parent.resolved?.startsWith('file:') + const isTransitiveFileDep = spec.type === 'directory' && parentWasInstalled && installLinks + + // Decide whether to link or copy the dependency + const shouldLink = (isWorkspace || isProjectInternalFileSpec || !installLinks) && !isTransitiveFileDep + if (spec.type === 'directory' && shouldLink) { + const realpath = spec.fetchSpec + const { content: pkg } = await PackageJson.normalize(realpath).catch(() => { + return { content: {} } + }) + const link = new Link({ name, parent, realpath, pkg, installLinks, legacyPeerDeps }) + this.#linkNodes.add(link) + return link + } + + // if the spec matches a workspace name, then see if the workspace node will satisfy the edge. if it does, we return the workspace node to make sure it takes priority. + if (isWorkspace) { + const existingNode = this.idealTree.edgesOut.get(spec.name).to + if (existingNode && existingNode.isWorkspace && existingNode.satisfies(edge)) { + return existingNode + } + } + + // For file: dependencies that we're installing (not linking), ensure proper resolution + if (isTransitiveFileDep && edge) { + // For transitive file deps, resolve relative to the parent's original source location + const parentOriginalPath = parent.resolved.slice(5) // Remove 'file:' prefix + const relativePath = edge.rawSpec.slice(5) // Remove 'file:' prefix + const absolutePath = resolve(parentOriginalPath, relativePath) + spec = npa.resolve(name, `file:${absolutePath}`) + } + + // spec isn't a directory, and either isn't a workspace or the workspace we have + // doesn't satisfy the edge. try to fetch a manifest and build a node from that. + return this.#fetchManifest(spec) + .then(pkg => new Node({ name, pkg, parent, installLinks, legacyPeerDeps }), error => { + error.requiredBy = edge.from.location || '.' + + // failed to load the spec, either because of enotarget or + // fetch failure of some other sort. save it so we can verify + // later that it's optional; otherwise, the error is fatal. + const n = new Node({ + name, + parent, + error, + installLinks, + legacyPeerDeps, + }) + this.#loadFailures.add(n) + return n + }) + } + + // load all peer deps and meta-peer deps into the node's parent + // At the end of this, the node's peer-type outward edges are all + // resolved, and so are all of theirs, but other dep types are not. + // We prefer to get peer deps that meet the requiring node's dependency, + // if possible, since that almost certainly works (since that package was + // developed with this set of deps) and will typically be more restrictive. + // Note that the peers in the set can conflict either with each other, + // or with a direct dependency from the virtual root parent! In strict + // mode, this is always an error. In force mode, it never is, and we + // prefer the parent's non-peer dep over a peer dep, or the version that + // gets placed first. In non-strict mode, we behave strictly if the + // virtual root is based on the root project, and allow non-peer parent + // deps to override, but throw if no preference can be determined. + async #loadPeerSet (node, required) { + const peerEdges = [...node.edgesOut.values()] + // we typically only install non-optional peers, but we have to + // factor them into the peerSet so that we can avoid conflicts + .filter(e => e.peer && !(e.valid && e.to)) + .sort(({ name: a }, { name: b }) => localeCompare(a, b)) + + for (const edge of peerEdges) { + // node.parent gets mutated during loop execution due to recursive #nodeFromEdge calls. + // When a compatible peer is found (e.g. a@1.1.0 replaces a@1.2.0), the original node loses its parent. + // if node is detached/removed from the tree, or has no parent, so no need to check remaining edgesOut for that node. + if (!node.parent) { + break + } + // already placed this one, and we're happy with it. + if (edge.valid && edge.to) { + continue + } + + const parentEdge = node.parent.edgesOut.get(edge.name) + const { isProjectRoot, isWorkspace } = node.parent.sourceReference + const isMine = isProjectRoot || isWorkspace + const conflictOK = this.options.force || !isMine && !this.#strictPeerDeps + + if (!edge.to) { + if (!parentEdge) { + // easy, just put the thing there + await this.#nodeFromEdge(edge, node.parent, null, required) + continue + } else { + // if the parent's edge is very broad like >=1, and the edge in + // question is something like 1.x, then we want to get a 1.x, not + // a 2.x. pass along the child edge as an advisory guideline. + // if the parent edge doesn't satisfy the child edge, and the + // child edge doesn't satisfy the parent edge, then we have + // a conflict. this is always a problem in strict mode, never + // in force mode, and a problem in non-strict mode if this isn't + // on behalf of our project. in all such cases, we warn at least. + const dep = await this.#nodeFromEdge( + parentEdge, + node.parent, + edge, + required + ) + + // hooray! that worked! + if (edge.valid) { + continue + } + + // allow it. either we're overriding, or it's not something + // that will be installed by default anyway, and we'll fail when + // we get to the point where we need to, if we need to. + if (conflictOK || !required.has(dep)) { + edge.peerConflicted = true + continue + } + + // problem + this.#failPeerConflict(edge, parentEdge) + } + } + + // There is something present already, and we're not happy about it + // See if the thing we WOULD be happy with is also going to satisfy + // the other dependents on the current node. + const current = edge.to + const dep = await this.#nodeFromEdge(edge, null, null, required) + if (dep.canReplace(current)) { + await this.#nodeFromEdge(edge, node.parent, null, required) + continue + } + + // at this point we know that there is a dep there, and + // we don't like it. always fail strictly, always allow forcibly or + // in non-strict mode if it's not our fault. don't warn here, because + // we are going to warn again when we place the deps, if we end up + // overriding for something else. If the thing that has this dep + // isn't also required, then there's a good chance we won't need it, + // so allow it for now and let it conflict if it turns out to actually + // be necessary for the installation. + if (conflictOK || !required.has(edge.from)) { + continue + } + + // ok, it's the root, or we're in unforced strict mode, so this is bad + this.#failPeerConflict(edge, parentEdge) + } + return node + } + + #failPeerConflict (edge, currentEdge) { + const expl = this.#explainPeerConflict(edge, currentEdge) + throw Object.assign(new Error('unable to resolve dependency tree'), expl) + } + + #explainPeerConflict (edge, currentEdge) { + const node = edge.from + const curNode = node.resolve(edge.name) + const current = curNode.explain() + return { + code: 'ERESOLVE', + current, + // it SHOULD be impossible to get here without a current node in place, + // but this at least gives us something report on when bugs creep into + // the tree handling logic. + currentEdge: currentEdge ? currentEdge.explain() : null, + edge: edge.explain(), + strictPeerDeps: this.#strictPeerDeps, + force: this.options.force, + } + } + + // go through all the links in the this.#linkNodes set + // for each one: + // - if outside the root, ignore it, assume it's fine, it's not our problem + // - if a node in the tree already, assign the target to that node. + // - if a path under an existing node, then assign that as the fsParent, + // and add it to the _depsQueue + // + // call buildDepStep if anything was added to the queue; otherwise, we're done + // XXX load-virtual also has a #resolveLinks, is there overlap? + #resolveLinks () { + for (const link of this.#linkNodes) { + this.#linkNodes.delete(link) + + // link we never ended up placing, skip it + if (link.root !== this.idealTree) { + continue + } + + const tree = this.idealTree.target + const external = !link.target.isDescendantOf(tree) + + // outside the root, somebody else's problem, ignore it + if (external && !this.#follow) { + continue + } + + // didn't find a parent for it or it has not been seen yet + // so go ahead and process it. + const unseenLink = (link.target.parent || link.target.fsParent) && + !this.#depsSeen.has(link.target) + + if (this.#follow && + !link.target.parent && + !link.target.fsParent || + unseenLink) { + this.addTracker('idealTree', link.target.name, link.target.location) + this.#depsQueue.push(link.target) + } + } + + if (this.#depsQueue.length) { + return this.#buildDepStep() + } + } + + #fixDepFlags () { + const timeEnd = time.start('idealTree:fixDepFlags') + const metaFromDisk = this.idealTree.meta.loadedFromDisk + const flagsSuspect = this[_flagsSuspect] + const mutateTree = this.#mutateTree + // if the options set prune:false, then we don't prune, but we still + // mark the extraneous items in the tree if we modified it at all. + // If we did no modifications, we just iterate over the extraneous nodes. + // if we started with an empty tree, then the dep flags are already + // all set to true, and there can be nothing extraneous, so there's + // nothing to prune, because we built it from scratch. if we didn't + // add or remove anything, then also nothing to do. + if (metaFromDisk && mutateTree) { + resetDepFlags(this.idealTree) + } + + // update all the dev/optional/etc flags in the tree + // either we started with a fresh tree, or we + // reset all the flags to find the extraneous nodes. + // + // if we started from a blank slate, or changed something, then + // the dep flags will be all set to true. + if (!metaFromDisk || mutateTree) { + calcDepFlags(this.idealTree) + } else { + // otherwise just unset all the flags on the root node + // since they will sometimes have the default value + this.idealTree.unsetDepFlags() + } + + // at this point, any node marked as extraneous should be pruned. + // if we started from a shrinkwrap, and then added/removed something, + // then the tree is suspect. Prune what is marked as extraneous. + // otherwise, don't bother. + const needPrune = metaFromDisk && (mutateTree || flagsSuspect) + if (this.#prune && needPrune) { + this.#idealTreePrune() + } + + timeEnd() + } + + #applyRootOverridesToWorkspaces (tree) { + const rootOverrides = tree.root.package.overrides || {} + + for (const node of tree.root.inventory.values()) { + if (!node.isWorkspace) { + continue + } + + for (const depName of Object.keys(rootOverrides)) { + const edge = node.edgesOut.get(depName) + const rootNode = tree.root.children.get(depName) + + // safely skip if either edge or rootNode doesn't exist yet + if (!edge || !rootNode) { + continue + } + + const resolvedRootVersion = rootNode.package.version + if (!semver.satisfies(resolvedRootVersion, edge.spec)) { + edge.detach() + node.children.delete(depName) + } + } + } + } + + #idealTreePrune () { + for (const node of this.idealTree.inventory.values()) { + if (node.extraneous) { + node.parent = null + } + } + } + + #pruneFailedOptional () { + for (const node of this.#loadFailures) { + if (!node.optional) { + throw node.errors[0] + } + + const set = optionalSet(node) + for (const node of set) { + node.inert = true + } + } + } + + async prune (options = {}) { + // allow the user to set options on the ctor as well. + // XXX: deprecate separate method options objects. + options = { ...this.options, ...options } + + await this.buildIdealTree(options) + + this.#idealTreePrune() + + if (!this.options.workspacesEnabled) { + const excludeNodes = this.excludeWorkspacesDependencySet(this.idealTree) + for (const node of this.idealTree.inventory.values()) { + if ( + node.parent !== null + && !node.isProjectRoot + && !excludeNodes.has(node) + && !node.inert + ) { + this[_addNodeToTrashList](node) + } + } + } + + return this.reify(options) + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/index.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..582cad68dab44fda888d06682ae5376473c4bfef --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/index.js @@ -0,0 +1,310 @@ +// The arborist manages three trees: +// - actual +// - virtual +// - ideal +// +// The actual tree is what's present on disk in the node_modules tree +// and elsewhere that links may extend. +// +// The virtual tree is loaded from metadata (package.json and lock files). +// +// The ideal tree is what we WANT that actual tree to become. This starts +// with the virtual tree, and then applies the options requesting +// add/remove/update actions. +// +// To reify a tree, we calculate a diff between the ideal and actual trees, +// and then turn the actual tree into the ideal tree by taking the actions +// required. At the end of the reification process, the actualTree is +// updated to reflect the changes. +// +// Each tree has an Inventory at the root. Shrinkwrap is tracked by Arborist +// instance. It always refers to the actual tree, but is updated (and written +// to disk) on reification. + +// Each of the mixin "classes" adds functionality, but are not dependent on +// constructor call order. So, we just load them in an array, and build up +// the base class, so that the overall voltron class is easier to test and +// cover, and separation of concerns can be maintained. + +const { resolve } = require('node:path') +const { homedir } = require('node:os') +const { depth } = require('treeverse') +const mapWorkspaces = require('@npmcli/map-workspaces') +const { log, time } = require('proc-log') +const { saveTypeMap } = require('../add-rm-pkg-deps.js') +const AuditReport = require('../audit-report.js') +const relpath = require('../relpath.js') +const PackumentCache = require('../packument-cache.js') + +const mixins = [ + require('../tracker.js'), + require('./build-ideal-tree.js'), + require('./load-actual.js'), + require('./load-virtual.js'), + require('./rebuild.js'), + require('./reify.js'), + require('./isolated-reifier.js'), +] + +const _setWorkspaces = Symbol.for('setWorkspaces') +const Base = mixins.reduce((a, b) => b(a), require('node:events')) + +// if it's 1, 2, or 3, set it explicitly that. +// if undefined or null, set it null +// otherwise, throw. +const lockfileVersion = lfv => { + if (lfv === 1 || lfv === 2 || lfv === 3) { + return lfv + } + + if (lfv === undefined || lfv === null) { + return null + } + + throw new TypeError('Invalid lockfileVersion config: ' + lfv) +} + +class Arborist extends Base { + constructor (options = {}) { + const timeEnd = time.start('arborist:ctor') + super(options) + + // normalize trailing slash + const registry = options.registry || 'https://registry.npmjs.org' + options.registry = this.registry = registry.replace(/(? { + for (const { to } of node.edgesOut.values()) { + if (!to || to.isWorkspace) { + continue + } + for (const edgeIn of to.edgesIn.values()) { + if (edgeIn.from.isRoot || rootDepSet.has(edgeIn.from)) { + rootDepSet.add(to) + } + } + } + return node + }, + filter: node => node, + getChildren: (node, tree) => + [...tree.edgesOut.values()].map(edge => edge.to), + }) + return rootDepSet + } + + async [_setWorkspaces] (node) { + const workspaces = await mapWorkspaces({ + cwd: node.path, + pkg: node.package, + }) + + if (node && workspaces.size) { + node.workspaces = workspaces + } + + return node + } + + async audit (options = {}) { + this.addTracker('audit') + if (this.options.global) { + throw Object.assign( + new Error('`npm audit` does not support testing globals'), + { code: 'EAUDITGLOBAL' } + ) + } + + // allow the user to set options on the ctor as well. + // XXX: deprecate separate method options objects. + options = { ...this.options, ...options } + + const timeEnd = time.start('audit') + let tree + if (options.packageLock === false) { + // build ideal tree + await this.loadActual(options) + await this.buildIdealTree() + tree = this.idealTree + } else { + tree = await this.loadVirtual() + } + if (this.options.workspaces.length) { + options.filterSet = this.workspaceDependencySet( + tree, + this.options.workspaces, + this.options.includeWorkspaceRoot + ) + } + if (!options.workspacesEnabled) { + options.filterSet = + this.excludeWorkspacesDependencySet(tree) + } + this.auditReport = await AuditReport.load(tree, options) + const ret = options.fix ? this.reify(options) : this.auditReport + timeEnd() + this.finishTracker('audit') + return ret + } + + async dedupe (options = {}) { + // allow the user to set options on the ctor as well. + // XXX: deprecate separate method options objects. + options = { ...this.options, ...options } + const tree = await this.loadVirtual().catch(() => this.loadActual()) + const names = [] + for (const name of tree.inventory.query('name')) { + if (tree.inventory.query('name', name).size > 1) { + names.push(name) + } + } + return this.reify({ + ...options, + preferDedupe: true, + update: { names }, + }) + } +} + +module.exports = Arborist diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/isolated-reifier.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/isolated-reifier.js new file mode 100644 index 0000000000000000000000000000000000000000..ab66fefc65b6042a822e559cfbdc0122c0f2d8f0 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/isolated-reifier.js @@ -0,0 +1,472 @@ +const { mkdirSync } = require('node:fs') +const pacote = require('pacote') +const { join } = require('node:path') +const { depth } = require('treeverse') +const crypto = require('node:crypto') +const { IsolatedNode, IsolatedLink } = require('../isolated-classes.js') + +// generate short hash key based on the dependency tree starting at this node +const getKey = (startNode) => { + const deps = [] + const branch = [] + depth({ + tree: startNode, + getChildren: node => node.dependencies, + visit: node => { + branch.push(`${node.packageName}@${node.version}`) + deps.push(`${branch.join('->')}::${node.resolved}`) + }, + leave: () => { + branch.pop() + }, + }) + deps.sort() + // TODO these replaces were originally to deal with node 14 not supporting base64url and likely don't need to happen anymore + // Changing this is a pretty significant breaking change, but removing parts of the hash increases collision possibilities (even if slight). + const hash = crypto.createHash('shake256', { outputLength: 16 }) + .update(deps.join(',')) + .digest('base64') + .replace(/\+/g, '-') + .replace(/\//g, '_') + .replace(/=+$/m, '') + return `${startNode.packageName}@${startNode.version}-${hash}` +} + +module.exports = cls => class IsolatedReifier extends cls { + #externalProxies = new Map() + #omit = new Set() + #rootDeclaredDeps = new Set() + #processedEdges = new Set() + #workspaceProxies = new Map() + + #generateChild (node, location, pkg, isInStore, root) { + const newChild = new IsolatedNode({ + isInStore, + location, + name: node.packageName || node.name, + optional: node.optional, + package: pkg, + parent: root, + path: join(this.idealGraph.localPath, location), + resolved: node.resolved, + root, + }) + // XXX top is from place-dep not lib/node.js + newChild.top = { path: this.idealGraph.localPath } + root.children.set(newChild.location, newChild) + root.inventory.set(newChild.location, newChild) + } + + /** + * Create an ideal graph. + * + * An implementation of npm RFC-0042 + * https://github.com/npm/rfcs/blob/main/accepted/0042-isolated-mode.md + * + * This entire file should be considered technical debt that will be resolved with an Arborist refactor or rewrite. + * Embedded logic in Nodes and Links, and the incremental state of building trees and reifying contains too many assumptions to do a linked mode properly. + * + * Instead, this approach takes a tree built from build-ideal-tree, and returns a new tree-like structure without the embedded logic of Node and Link classes. + * + * Since the RFC requires leaving the package-lock in place, this approach temporarily replaces the tree state for a couple of steps of reifying. + * + **/ + async makeIdealGraph () { + const idealTree = this.idealTree + this.#omit = new Set(this.options.omit) + const omit = this.#omit + + // npm auto-creates 'workspace' edges from root to all workspaces. + // For isolated/linked mode, only include workspaces that root explicitly declares as dependencies. + // When omitting dep types, exclude those from the declared set so their workspaces aren't hoisted. + const rootPkg = idealTree.package + this.#rootDeclaredDeps = new Set(Object.keys(Object.assign({}, + rootPkg.dependencies, + (!omit.has('dev') && rootPkg.devDependencies), + (!omit.has('optional') && rootPkg.optionalDependencies), + (!omit.has('peer') && rootPkg.peerDependencies) + ))) + + // XXX this sometimes acts like a node too + this.idealGraph = { + external: [], + isProjectRoot: true, + localLocation: idealTree.location, + localPath: idealTree.path, + path: idealTree.path, + } + this.counter = 0 + + this.idealGraph.workspaces = await Promise.all(Array.from(idealTree.fsChildren.values(), w => this.#workspaceProxy(w))) + const processed = new Set() + const queue = [idealTree, ...idealTree.fsChildren] + while (queue.length !== 0) { + const next = queue.pop() + if (processed.has(next.location)) { + continue + } + processed.add(next.location) + next.edgesOut.forEach(edge => { + if (edge.to && !(next.package.bundleDependencies || next.package.bundledDependencies || []).includes(edge.to.name) && !edge.to.shouldOmit?.(omit)) { + queue.push(edge.to) + } + }) + // local `file:` deps are in fsChildren but are not workspaces. + // they are already handled as workspace-like proxies above and should not go through the external/store extraction path. + if (!next.isProjectRoot && !next.isWorkspace && !next.inert && !idealTree.fsChildren.has(next) && !idealTree.fsChildren.has(next.target)) { + this.idealGraph.external.push(await this.#externalProxy(next)) + } + } + + await this.#assignCommonProperties(idealTree, this.idealGraph) + } + + async #workspaceProxy (node) { + if (this.#workspaceProxies.has(node)) { + return this.#workspaceProxies.get(node) + } + const result = {} + // XXX this goes recursive if we don't set here because assignCommonProperties also calls this.#workspaceProxy + this.#workspaceProxies.set(node, result) + result.localLocation = node.location + result.localPath = node.path + result.isWorkspace = true + result.resolved = node.resolved + await this.#assignCommonProperties(node, result) + return result + } + + async #externalProxy (node) { + if (this.#externalProxies.has(node)) { + return this.#externalProxies.get(node) + } + const result = {} + // XXX this goes recursive if we don't set here because assignCommonProperties also calls this.#externalProxy + this.#externalProxies.set(node, result) + await this.#assignCommonProperties(node, result, !node.hasShrinkwrap) + if (node.hasShrinkwrap) { + const dir = join( + node.root.path, + 'node_modules', + '.store', + `${node.packageName}@${node.version}` + ) + mkdirSync(dir, { recursive: true }) + // TODO this approach feels wrong and shouldn't be necessary for shrinkwraps + await pacote.extract(node.resolved, dir, { + ...this.options, + resolved: node.resolved, + integrity: node.integrity, + }) + const Arborist = this.constructor + const arb = new Arborist({ ...this.options, path: dir }) + // Make sure that the ideal tree is build as the rest of the algorithm depends on it. + await arb.buildIdealTree({ + complete: false, + dev: false, + }) + await arb.makeIdealGraph() + this.idealGraph.external.push(...arb.idealGraph.external) + for (const edge of arb.idealGraph.external) { + edge.root = this.idealGraph + edge.id = `${node.id}=>${edge.id}` + } + result.localDependencies = [] + result.externalDependencies = arb.idealGraph.externalDependencies + result.externalOptionalDependencies = arb.idealGraph.externalOptionalDependencies + result.dependencies = [ + ...result.externalDependencies, + ...result.externalOptionalDependencies, + ] + } + result.optional = node.optional + result.resolved = node.resolved + result.version = node.version + return result + } + + async #assignCommonProperties (node, result, populateDeps = true) { + result.root = this.idealGraph + // XXX does anything need this? + result.id = this.counter++ + /* istanbul ignore next - packageName is always set for real packages */ + result.name = result.isWorkspace ? (node.packageName || node.name) : node.name + result.packageName = node.packageName || node.name + result.package = { ...node.package } + result.package.bundleDependencies = undefined + + if (!populateDeps) { + return + } + + let edges = [...node.edgesOut.values()].filter(edge => + edge.to?.target && + !(node.package.bundledDependencies || node.package.bundleDependencies)?.includes(edge.to.name) + ) + + // Only omit edge types for root and workspace nodes (matching shouldOmit scope) + if ((node.isProjectRoot || node.isWorkspace) && this.#omit.size) { + edges = edges.filter(edge => { + if (edge.dev && this.#omit.has('dev')) { + return false + } + if (edge.optional && this.#omit.has('optional')) { + return false + } + if (edge.peer && this.#omit.has('peer')) { + return false + } + return true + }) + } + + let nonOptionalDeps = edges.filter(edge => !edge.optional).map(edge => edge.to.target) + + // npm auto-creates 'workspace' edges from root to all workspaces. + // For isolated/linked mode, only include workspaces that root explicitly declares as dependencies. + if (node.isProjectRoot) { + nonOptionalDeps = nonOptionalDeps.filter(n => !n.isWorkspace || this.#rootDeclaredDeps.has(n.packageName)) + } + + // When legacyPeerDeps is enabled, peer dep edges are not created on the node. + // Resolve them from the tree so they get symlinked in the store. + const peerDeps = node.package.peerDependencies + if (peerDeps && node.legacyPeerDeps) { + const edgeNames = new Set(edges.map(edge => edge.name)) + for (const peerName in peerDeps) { + if (!edgeNames.has(peerName)) { + const resolved = node.resolve(peerName) + if (resolved && resolved !== node && !resolved.inert) { + nonOptionalDeps.push(resolved.target) + } + } + } + } + + // local `file:` deps (non-workspace fsChildren) should be treated as local dependencies, not external, so they get symlinked directly instead of being extracted into the store. + const isLocal = (n) => n.isWorkspace || node.fsChildren?.has(n) + const optionalDeps = edges.filter(edge => edge.optional).map(edge => edge.to.target) + result.localDependencies = await Promise.all(nonOptionalDeps.filter(isLocal).map(n => this.#workspaceProxy(n))) + result.externalDependencies = await Promise.all(nonOptionalDeps.filter(n => !isLocal(n) && !n.inert).map(n => this.#externalProxy(n))) + result.externalOptionalDependencies = await Promise.all(optionalDeps.filter(n => !n.inert).map(n => this.#externalProxy(n))) + result.dependencies = [ + ...result.externalDependencies, + ...result.localDependencies, + ...result.externalOptionalDependencies, + ] + } + + async #createBundledTree () { + // TODO: make sure that idealTree object exists + const idealTree = this.idealTree + // TODO: test workspaces having bundled deps + const queue = [] + + for (const [, edge] of idealTree.edgesOut) { + if (edge.to && (idealTree.package.bundleDependencies || idealTree.package.bundledDependencies || []).includes(edge.to.name)) { + queue.push({ from: idealTree, to: edge.to }) + } + } + for (const child of idealTree.fsChildren) { + for (const [, edge] of child.edgesOut) { + if (edge.to && (child.package.bundleDependencies || child.package.bundledDependencies || []).includes(edge.to.name)) { + queue.push({ from: child, to: edge.to }) + } + } + } + + const processed = new Set() + const nodes = new Map() + const edges = [] + while (queue.length !== 0) { + const nextEdge = queue.pop() + const key = `${nextEdge.from.location}=>${nextEdge.to.location}` + // should be impossible, unless bundled is duped + /* istanbul ignore next */ + if (processed.has(key)) { + continue + } + processed.add(key) + const from = nextEdge.from + if (!from.isRoot && !from.isWorkspace) { + nodes.set(from.location, { location: from.location, resolved: from.resolved, name: from.name, optional: from.optional, pkg: { ...from.package, bundleDependencies: undefined } }) + } + const to = nextEdge.to + nodes.set(to.location, { location: to.location, resolved: to.resolved, name: to.name, optional: to.optional, pkg: { ...to.package, bundleDependencies: undefined } }) + edges.push({ from: from.isRoot ? 'root' : from.location, to: to.location }) + + to.edgesOut.forEach(edge => { + // an edge out should always have a to + /* istanbul ignore else */ + if (edge.to) { + queue.push({ from: edge.from, to: edge.to }) + } + }) + } + return { edges, nodes } + } + + async createIsolatedTree () { + await this.makeIdealGraph() + const bundledTree = await this.#createBundledTree() + + const root = new IsolatedNode(this.idealGraph) + root.root = root + root.inventory.set('', root) + const processed = new Set() + for (const c of this.idealGraph.workspaces) { + const wsName = c.packageName + // XXX parent? root? + const workspace = new IsolatedNode({ + location: c.localLocation, + name: wsName, + package: c.package, + path: c.localPath, + resolved: c.resolved, + }) + root.fsChildren.add(workspace) + root.inventory.set(workspace.location, workspace) + root.workspaces.set(wsName, workspace.path) + + // Create workspace Link. For root declared deps, link at root node_modules/. For undeclared deps, link at the workspace's own node_modules/ (self-link). + const isDeclared = this.#rootDeclaredDeps.has(wsName) + const wsLink = new IsolatedLink({ + location: isDeclared ? join('node_modules', wsName) : join(c.localLocation, 'node_modules', wsName), + name: wsName, + package: workspace.package, + parent: root, + path: isDeclared ? join(root.path, 'node_modules', wsName) : join(root.path, c.localLocation, 'node_modules', wsName), + realpath: workspace.path, + root, + target: workspace, + }) + if (!isDeclared) { + workspace.children.set(wsName, wsLink) + } + root.children.set(wsName, wsLink) + root.inventory.set(wsLink.location, wsLink) + workspace.linksIn.add(wsLink) + } + + this.idealGraph.external.forEach(c => { + const key = getKey(c) + if (processed.has(key)) { + return + } + processed.add(key) + const location = join('node_modules', '.store', key, 'node_modules', c.packageName) + this.#generateChild(c, location, c.package, true, root) + }) + + bundledTree.nodes.forEach(node => { + this.#generateChild(node, node.location, node.pkg, false, root) + }) + + bundledTree.edges.forEach(edge => { + const from = edge.from === 'root' ? root : root.inventory.get(edge.from) + const to = root.inventory.get(edge.to) + // Maybe optional should be propagated from the original edge + const newEdge = { optional: false, from, to } + from.edgesOut.set(to.name, newEdge) + to.edgesIn.add(newEdge) + }) + + this.#processEdges(this.idealGraph, false, root) + for (const node of this.idealGraph.workspaces) { + this.#processEdges(node, false, root) + } + return root + } + + #processEdges (node, externalEdge, root) { + const key = getKey(node) + if (this.#processedEdges.has(key)) { + return + } + this.#processedEdges.add(key) + + let from, nmFolder + if (externalEdge) { + const fromLocation = join('node_modules', '.store', key, 'node_modules', node.packageName) + from = root.children.get(fromLocation) + nmFolder = join('node_modules', '.store', key, 'node_modules') + } else { + from = node.isProjectRoot ? root : root.inventory.get(node.localLocation) + nmFolder = join(node.localLocation, 'node_modules') + } + /* istanbul ignore next - strict-peer-deps can exclude nodes from the tree */ + if (!from) { + return + } + + for (const dep of node.localDependencies) { + this.#processEdges(dep, false, root) + // nonOptional, local + this.#processDeps(dep, false, false, root, from, nmFolder) + } + for (const dep of node.externalDependencies) { + this.#processEdges(dep, true, root) + // nonOptional, external + this.#processDeps(dep, false, true, root, from, nmFolder) + } + for (const dep of node.externalOptionalDependencies) { + this.#processEdges(dep, true, root) + // optional, external + this.#processDeps(dep, true, true, root, from, nmFolder) + } + } + + #processDeps (dep, optional, external, root, from, nmFolder) { + const toKey = getKey(dep) + + let target + if (external) { + const toLocation = join('node_modules', '.store', toKey, 'node_modules', dep.packageName) + target = root.children.get(toLocation) + } else { + target = root.inventory.get(dep.localLocation) + } + // TODO: we should no-op is an edge has already been created with the same fromKey and toKey + /* istanbul ignore next - strict-peer-deps can exclude nodes from the tree */ + if (!target) { + return + } + + if (dep.package.bin) { + for (const bn in dep.package.bin) { + target.binPaths.push(join(dep.root.localPath, nmFolder, '.bin', bn)) + } + } + + const pkg = { + _id: dep.package._id, + bin: target.package.bin, + bundleDependencies: undefined, + deprecated: undefined, + scripts: dep.package.scripts, + version: dep.package.version, + } + const link = new IsolatedLink({ + isStoreLink: true, + location: join(nmFolder, dep.name), + name: toKey, + optional, + parent: root, + package: pkg, + path: join(dep.root.localPath, nmFolder, dep.name), + realpath: target.path, + resolved: external ? `file:.store/${toKey}/node_modules/${dep.packageName}` : dep.resolved, + root, + target, + }) + // XXX top is from place-dep not lib/link.js + link.top = { path: dep.root.localPath } + const newEdge1 = { optional, from, to: link } + from.edgesOut.set(dep.name, newEdge1) + link.edgesIn.add(newEdge1) + const newEdge2 = { optional: false, from: link, to: target } + link.edgesOut.set(dep.name, newEdge2) + target.edgesIn.add(newEdge2) + root.children.set(link.location, link) + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js new file mode 100644 index 0000000000000000000000000000000000000000..86a85cac682cc0e8e04ec54c70bdb51ef4d7b6d3 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js @@ -0,0 +1,429 @@ +// mix-in implementing the loadActual method + +const { dirname, join, normalize, relative, resolve } = require('node:path') + +const PackageJson = require('@npmcli/package-json') +const { readdirScoped } = require('@npmcli/fs') +const { walkUp } = require('walk-up-path') +const { commonAncestorPath } = require('common-ancestor-path') +const treeCheck = require('../tree-check.js') + +const Shrinkwrap = require('../shrinkwrap.js') +const calcDepFlags = require('../calc-dep-flags.js') +const Node = require('../node.js') +const Link = require('../link.js') +const realpath = require('../realpath.js') + +// public symbols +const _changePath = Symbol.for('_changePath') +const _setWorkspaces = Symbol.for('setWorkspaces') +const _rpcache = Symbol.for('realpathCache') +const _stcache = Symbol.for('statCache') + +module.exports = cls => class ActualLoader extends cls { + #actualTree + // ensure when walking the tree that we don't call loadTree on the same + // actual node more than one time. + #actualTreeLoaded = new Set() + #actualTreePromise + + // cache of nodes when loading the actualTree, so that we avoid loaded the + // same node multiple times when symlinks attack. + #cache = new Map() + #filter + + // cache of link targets for setting fsParent links + // We don't do fsParent as a magic getter/setter, because it'd be too costly + // to keep up to date along the walk. + // And, we know that it can ONLY be relevant when the node is a target of a + // link; otherwise, it'd be in a node_modules folder, so take advantage of + // that to limit the scans later. + #topNodes = new Set() + #transplantFilter + + // public method + // TODO remove options param in next semver major + async loadActual (options = {}) { + // In the past this.actualTree was set as a promise that eventually + // resolved, and overwrite this.actualTree with the resolved value. This + // was a problem because virtually no other code expects this.actualTree to + // be a promise. Instead we only set it once resolved, and also return it + // from the promise so that it is what's returned from this function when + // awaited. + if (this.actualTree) { + return this.actualTree + } + if (!this.#actualTreePromise) { + // allow the user to set options on the ctor as well. + // XXX: deprecate separate method options objects. + options = { ...this.options, ...options } + + this.#actualTreePromise = this.#loadActual(options) + .then(tree => { + // reset all deps to extraneous prior to recalc + if (!options.root) { + for (const node of tree.inventory.values()) { + node.extraneous = true + } + } + + // only reset root flags if we're not re-rooting, + // otherwise leave as-is + calcDepFlags(tree, !options.root) + this.actualTree = treeCheck(tree) + return this.actualTree + }) + } + return this.#actualTreePromise + } + + // return the promise so that we don't ever have more than one going at the + // same time. This is so that buildIdealTree can default to the actualTree + // if no shrinkwrap present, but reify() can still call buildIdealTree and + // loadActual in parallel safely. + + async #loadActual (options) { + // mostly realpath to throw if the root doesn't exist + const { + global, + filter = () => true, + root = null, + transplantFilter = () => true, + ignoreMissing = false, + forceActual = false, + } = options + this.#filter = filter + this.#transplantFilter = transplantFilter + + if (global) { + const real = await realpath(this.path, this[_rpcache], this[_stcache]) + const params = { + path: this.path, + realpath: real, + pkg: {}, + global, + loadOverrides: true, + } + if (this.path === real) { + this.#actualTree = this.#newNode(params) + } else { + this.#actualTree = await this.#newLink(params) + } + } else { + // not in global mode, hidden lockfile is allowed, load root pkg too + this.#actualTree = await this.#loadFSNode({ + path: this.path, + real: await realpath(this.path, this[_rpcache], this[_stcache]), + loadOverrides: true, + }) + + this.#actualTree.assertRootOverrides() + + // if forceActual is set, don't even try the hidden lockfile + if (!forceActual) { + // Note: hidden lockfile will be rejected if it's not the latest thing + // in the folder, or if any of the entries in the hidden lockfile are + // missing. + const meta = await Shrinkwrap.load({ + path: this.#actualTree.path, + hiddenLockfile: true, + resolveOptions: this.options, + }) + + if (meta.loadedFromDisk) { + this.#actualTree.meta = meta + // have to load on a new Arborist object, so we don't assign + // the virtualTree on this one! Also, the weird reference is because + // we can't easily get a ref to Arborist in this module, without + // creating a circular reference, since this class is a mixin used + // to build up the Arborist class itself. + await new this.constructor({ ...this.options }).loadVirtual({ + root: this.#actualTree, + }) + await this[_setWorkspaces](this.#actualTree) + + this.#transplant(root) + return this.#actualTree + } + } + + const meta = await Shrinkwrap.load({ + path: this.#actualTree.path, + lockfileVersion: this.options.lockfileVersion, + resolveOptions: this.options, + }) + this.#actualTree.meta = meta + } + + await this.#loadFSTree(this.#actualTree) + await this[_setWorkspaces](this.#actualTree) + + // if there are workspace targets without Link nodes created, load + // the targets, so that we know what they are. + if (this.#actualTree.workspaces && this.#actualTree.workspaces.size) { + const promises = [] + for (const path of this.#actualTree.workspaces.values()) { + if (!this.#cache.has(path)) { + // workspace overrides use the root overrides + const p = this.#loadFSNode({ path, root: this.#actualTree, useRootOverrides: true }) + .then(node => this.#loadFSTree(node)) + promises.push(p) + } + } + await Promise.all(promises) + } + + if (!ignoreMissing) { + await this.#findMissingEdges() + } + + // try to find a node that is the parent in a fs tree sense, but not a + // node_modules tree sense, of any link targets. this allows us to + // resolve deps that node will find, but a legacy npm view of the + // world would not have noticed. + for (const path of this.#topNodes) { + const node = this.#cache.get(path) + if (node && !node.parent && !node.fsParent) { + for (const p of walkUp(dirname(path))) { + if (this.#cache.has(p)) { + node.fsParent = this.#cache.get(p) + break + } + } + } + } + + this.#transplant(root) + + if (global) { + // need to depend on the children, or else all of them + // will end up being flagged as extraneous, since the + // global root isn't a "real" project + const tree = this.#actualTree + const actualRoot = tree.isLink ? tree.target : tree + const { dependencies = {} } = actualRoot.package + for (const [name, kid] of actualRoot.children.entries()) { + const def = kid.isLink ? `file:${kid.realpath}` : '*' + dependencies[name] = dependencies[name] || def + } + actualRoot.package = { ...actualRoot.package, dependencies } + } + return this.#actualTree + } + + #transplant (root) { + if (!root || root === this.#actualTree) { + return + } + + this.#actualTree[_changePath](root.path) + for (const node of this.#actualTree.children.values()) { + if (!this.#transplantFilter(node)) { + node.root = null + } + } + + root.replace(this.#actualTree) + for (const node of this.#actualTree.fsChildren) { + node.root = this.#transplantFilter(node) ? root : null + } + + this.#actualTree = root + } + + async #loadFSNode ({ path, parent, real, root, loadOverrides, useRootOverrides }) { + if (!real) { + try { + real = await realpath(path, this[_rpcache], this[_stcache]) + } catch (error) { + // if realpath fails, just provide a dummy error node + return new Node({ + error, + path, + realpath: path, + parent, + root, + loadOverrides, + }) + } + } + + const cached = this.#cache.get(path) + let node + // missing edges get a dummy node, assign the parent and return it + if (cached && !cached.dummy) { + cached.parent = parent + return cached + } else { + const params = { + installLinks: this.installLinks, + legacyPeerDeps: this.legacyPeerDeps, + path, + realpath: real, + parent, + root, + loadOverrides, + } + + try { + const { content: pkg } = await PackageJson.normalize(real) + params.pkg = pkg + if (useRootOverrides && root.overrides) { + params.overrides = root.overrides.getNodeRule({ name: pkg.name, version: pkg.version }) + } + } catch (err) { + if (err.code === 'EJSONPARSE') { + // TODO @npmcli/package-json should be doing this + err.path = join(real, 'package.json') + } + params.error = err + } + + // soldier on if read-package-json raises an error, passing it to the + // Node which will attach it to its errors array (Link passes it along to + // its target node) + if (normalize(path) === real) { + node = this.#newNode(params) + } else { + node = await this.#newLink(params) + } + } + this.#cache.set(path, node) + return node + } + + #newNode (options) { + // check it for an fsParent if it's a tree top. there's a decent chance + // it'll get parented later, making the fsParent scan a no-op, but better + // safe than sorry, since it's cheap. + const { parent, realpath } = options + if (!parent) { + this.#topNodes.add(realpath) + } + return new Node(options) + } + + async #newLink (options) { + const { realpath } = options + this.#topNodes.add(realpath) + const target = this.#cache.get(realpath) + const link = new Link({ ...options, target }) + + if (!target) { + // Link set its target itself in this case + this.#cache.set(realpath, link.target) + // if a link target points at a node outside of the root tree's + // node_modules hierarchy, then load that node as well. + await this.#loadFSTree(link.target) + } + + return link + } + + async #loadFSTree (node) { + const did = this.#actualTreeLoaded + if (!node.isLink && !did.has(node.target.realpath)) { + did.add(node.target.realpath) + await this.#loadFSChildren(node.target) + return Promise.all( + [...node.target.children.entries()] + .filter(([, kid]) => !did.has(kid.realpath)) + .map(([, kid]) => this.#loadFSTree(kid)) + ) + } + } + + // create child nodes for all the entries in node_modules + // and attach them to the node as a parent + async #loadFSChildren (node) { + const nm = resolve(node.realpath, 'node_modules') + try { + const kids = await readdirScoped(nm).then(paths => paths.map(p => p.replace(/\\/g, '/'))) + return Promise.all( + // ignore . dirs and retired scoped package folders + kids.filter(kid => !/^(@[^/]+\/)?\./.test(kid)) + .filter(kid => this.#filter(node, kid)) + .map(kid => this.#loadFSNode({ + parent: node, + path: resolve(nm, kid), + }))) + } catch { + // error in the readdir is not fatal, just means no kids + } + } + + async #findMissingEdges () { + // try to resolve any missing edges by walking up the directory tree, + // checking for the package in each node_modules folder. stop at the + // root directory. + // The tricky move here is that we load a "dummy" node for the folder + // containing the node_modules folder, so that it can be assigned as + // the fsParent. It's a bad idea to *actually* load that full node, + // because people sometimes develop in ~/projects/node_modules/... + // so we'd end up loading a massive tree with lots of unrelated junk. + const nmContents = new Map() + const tree = this.#actualTree + for (const node of tree.inventory.values()) { + const ancestor = commonAncestorPath(node.realpath, this.path) + + const depPromises = [] + for (const [name, edge] of node.edgesOut.entries()) { + const notMissing = !edge.missing && + !(edge.to && (edge.to.dummy || edge.to.parent !== node)) + if (notMissing) { + continue + } + + // start the walk from the dirname, because we would have found + // the dep in the loadFSTree step already if it was local. + for (const p of walkUp(dirname(node.realpath))) { + // only walk as far as the nearest ancestor + // this keeps us from going into completely unrelated + // places when a project is just missing something, but + // allows for finding the transitive deps of link targets. + // ie, if it has to go up and back out to get to the path + // from the nearest common ancestor, we've gone too far. + if (ancestor && /^\.\.(?:[\\/]|$)/.test(relative(ancestor, p))) { + break + } + + let entries + if (!nmContents.has(p)) { + entries = await readdirScoped(p + '/node_modules') + .catch(() => []).then(paths => paths.map(p => p.replace(/\\/g, '/'))) + nmContents.set(p, entries) + } else { + entries = nmContents.get(p) + } + + if (!entries.includes(name)) { + continue + } + + let d + if (!this.#cache.has(p)) { + d = new Node({ path: p, root: node.root, dummy: true }) + this.#cache.set(p, d) + } else { + d = this.#cache.get(p) + } + if (d.dummy) { + // it's a placeholder, so likely would not have loaded this dep, + // unless another dep in the tree also needs it. + const depPath = normalize(`${p}/node_modules/${name}`) + const cached = this.#cache.get(depPath) + if (!cached || cached.dummy) { + depPromises.push(this.#loadFSNode({ + path: depPath, + root: node.root, + parent: d, + }).then(node => this.#loadFSTree(node))) + } + } + break + } + } + await Promise.all(depPromises) + } + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/load-virtual.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/load-virtual.js new file mode 100644 index 0000000000000000000000000000000000000000..54eb2679ed957687a5e41123cbc3a25ecdbe2141 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/load-virtual.js @@ -0,0 +1,277 @@ +const { resolve } = require('node:path') +// mixin providing the loadVirtual method +const mapWorkspaces = require('@npmcli/map-workspaces') +const PackageJson = require('@npmcli/package-json') +const nameFromFolder = require('@npmcli/name-from-folder') + +const consistentResolve = require('../consistent-resolve.js') +const Shrinkwrap = require('../shrinkwrap.js') +const Node = require('../node.js') +const Link = require('../link.js') +const relpath = require('../relpath.js') +const calcDepFlags = require('../calc-dep-flags.js') +const treeCheck = require('../tree-check.js') + +const flagsSuspect = Symbol.for('flagsSuspect') +const setWorkspaces = Symbol.for('setWorkspaces') + +module.exports = cls => class VirtualLoader extends cls { + #rootOptionProvided + + // public method + async loadVirtual (options = {}) { + if (this.virtualTree) { + return this.virtualTree + } + + // allow the user to set reify options on the ctor as well. + // XXX: deprecate separate reify() options object. + options = { ...this.options, ...options } + + if (options.root && options.root.meta) { + await this.#loadFromShrinkwrap(options.root.meta, options.root) + return treeCheck(this.virtualTree) + } + + const s = await Shrinkwrap.load({ + path: this.path, + lockfileVersion: this.options.lockfileVersion, + resolveOptions: this.options, + }) + if (!s.loadedFromDisk && !options.root) { + const er = new Error('loadVirtual requires existing shrinkwrap file') + throw Object.assign(er, { code: 'ENOLOCK' }) + } + + // when building the ideal tree, we pass in a root node to this function + // otherwise, load it from the root package json or the lockfile + const pkg = await PackageJson.normalize(this.path).then(p => p.content).catch(() => s.data.packages[''] || {}) + // TODO clean this up + const { + root = await this[setWorkspaces](this.#loadNode('', pkg, true)), + } = options + this.#rootOptionProvided = options.root + + await this.#loadFromShrinkwrap(s, root) + root.assertRootOverrides() + return treeCheck(this.virtualTree) + } + + async #loadFromShrinkwrap (s, root) { + if (!this.#rootOptionProvided) { + // root is never any of these things, but might be a brand new + // baby Node object that never had its dep flags calculated. + root.unsetDepFlags() + } else { + this[flagsSuspect] = true + } + + this.#checkRootEdges(s, root) + root.meta = s + this.virtualTree = root + // separate out link metadata, and create Node objects for nodes + const links = new Map() + const nodes = new Map([['', root]]) + for (const [location, meta] of Object.entries(s.data.packages)) { + // skip the root because we already got it + if (!location) { + continue + } + + if (meta.link) { + links.set(location, meta) + } else { + nodes.set(location, this.#loadNode(location, meta)) + } + } + await this.#resolveLinks(links, nodes) + if (!(s.originalLockfileVersion >= 2)) { + this.#assignBundles(nodes) + } + if (this[flagsSuspect]) { + // reset all dep flags + // can't use inventory here, because virtualTree might not be root + for (const node of nodes.values()) { + if (node.isRoot || node === this.#rootOptionProvided) { + continue + } + node.resetDepFlags() + } + calcDepFlags(this.virtualTree, !this.#rootOptionProvided) + } + return root + } + + // check the lockfile deps, and see if they match. if they do not + // then we have to reset dep flags at the end. for example, if the + // user manually edits their package.json file, then we need to know + // that the idealTree is no longer entirely trustworthy. + #checkRootEdges (s, root) { + // loaded virtually from tree, no chance of being out of sync + // ancient lockfiles are critically damaged by this process, + // so we need to just hope for the best in those cases. + if (!s.loadedFromDisk || s.ancientLockfile) { + return + } + + const lock = s.get('') + const prod = lock.dependencies || {} + const dev = lock.devDependencies || {} + const optional = lock.optionalDependencies || {} + const peer = lock.peerDependencies || {} + const peerOptional = {} + + if (lock.peerDependenciesMeta) { + for (const [name, meta] of Object.entries(lock.peerDependenciesMeta)) { + if (meta.optional && peer[name] !== undefined) { + peerOptional[name] = peer[name] + delete peer[name] + } + } + } + + for (const name of Object.keys(optional)) { + delete prod[name] + } + + const lockWS = {} + const workspaces = mapWorkspaces.virtual({ + cwd: this.path, + lockfile: s.data, + }) + + for (const [name, path] of workspaces.entries()) { + lockWS[name] = `file:${path}` + } + + // Should rootNames exclude optional? + const rootNames = new Set(root.edgesOut.keys()) + + const lockByType = ({ dev, optional, peer, peerOptional, prod, workspace: lockWS }) + + // Find anything in shrinkwrap deps that doesn't match root's type or spec + for (const type in lockByType) { + const deps = lockByType[type] + for (const name in deps) { + const edge = root.edgesOut.get(name) + if (!edge || edge.type !== type || edge.spec !== deps[name]) { + return this[flagsSuspect] = true + } + rootNames.delete(name) + } + } + // Something was in root that's not accounted for in shrinkwrap + if (rootNames.size) { + return this[flagsSuspect] = true + } + } + + // links is the set of metadata, and nodes is the map of non-Link nodes + // Set the targets to nodes in the set, if we have them (we might not) + // XXX build-ideal-tree also has a #resolveLinks, is there overlap? + async #resolveLinks (links, nodes) { + for (const [location, meta] of links.entries()) { + const targetPath = resolve(this.path, meta.resolved) + const targetLoc = relpath(this.path, targetPath) + const target = nodes.get(targetLoc) + + if (!target) { + const err = new Error( +`Missing target in lock file: "${targetLoc}" is referenced by "${location}" but does not exist. +To fix: +1. rm package-lock.json +2. npm install` + ) + err.code = 'EMISSINGTARGET' + throw err + } + + const link = this.#loadLink(location, targetLoc, target, meta) + nodes.set(location, link) + nodes.set(targetLoc, link.target) + + // we always need to read the package.json for link targets + // outside node_modules because they can be changed by the local user + if (!link.target.parent) { + await PackageJson.normalize(link.realpath).then(p => link.target.package = p.content).catch(() => null) + } + } + } + + #assignBundles (nodes) { + for (const [location, node] of nodes) { + // Skip assignment of parentage for the root package + if (!location || node.isLink && !node.target.location) { + continue + } + const { name, parent, package: { inBundle } } = node + + if (!parent) { + continue + } + + // read inBundle from package because 'package' here is + // actually a v2 lockfile metadata entry. + // If the *parent* is also bundled, though, or if the parent has + // no dependency on it, then we assume that it's being pulled in + // just by virtue of its parent or a transitive dep being bundled. + const { package: ppkg } = parent + const { inBundle: parentBundled } = ppkg + if (inBundle && !parentBundled && parent.edgesOut.has(node.name)) { + if (!ppkg.bundleDependencies) { + ppkg.bundleDependencies = [name] + } else { + ppkg.bundleDependencies.push(name) + } + } + } + } + + #loadNode (location, sw, loadOverrides) { + const p = this.virtualTree ? this.virtualTree.realpath : this.path + const path = resolve(p, location) + // shrinkwrap doesn't include package name unless necessary + if (!sw.name) { + sw.name = nameFromFolder(path) + } + + const node = new Node({ + installLinks: this.installLinks, + legacyPeerDeps: this.legacyPeerDeps, + root: this.virtualTree, + path, + realpath: path, + integrity: sw.integrity, + resolved: consistentResolve(sw.resolved, this.path, path), + pkg: sw, + hasShrinkwrap: sw.hasShrinkwrap, + loadOverrides, + // cast to boolean because they're undefined in the lock file when false + extraneous: !!sw.extraneous, + devOptional: !!(sw.devOptional || sw.dev || sw.optional), + peer: !!sw.peer, + optional: !!sw.optional, + dev: !!sw.dev, + }) + + return node + } + + #loadLink (location, targetLoc, target) { + const path = resolve(this.path, location) + const link = new Link({ + installLinks: this.installLinks, + legacyPeerDeps: this.legacyPeerDeps, + path, + realpath: resolve(this.path, targetLoc), + target, + pkg: target && target.package, + }) + link.extraneous = target.extraneous + link.devOptional = target.devOptional + link.peer = target.peer + link.optional = target.optional + link.dev = target.dev + return link + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js new file mode 100644 index 0000000000000000000000000000000000000000..23d57bf3161bcb21bcf64eb0a3dfbe6098edd028 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js @@ -0,0 +1,406 @@ +// Arborist.rebuild({path = this.path}) will do all the binlinks and +// bundle building needed. Called by reify, and by `npm rebuild`. + +const PackageJson = require('@npmcli/package-json') +const binLinks = require('bin-links') +const localeCompare = require('@isaacs/string-locale-compare')('en') +const promiseAllRejectLate = require('promise-all-reject-late') +const runScript = require('@npmcli/run-script') +const { callLimit: promiseCallLimit } = require('promise-call-limit') +const { depth: dfwalk } = require('treeverse') +const { isNodeGypPackage, defaultGypInstallScript } = require('@npmcli/node-gyp') +const { promiseRetry } = require('@gar/promise-retry') +const { log, time } = require('proc-log') +const { resolve } = require('node:path') + +const boolEnv = b => b ? '1' : '' +const sortNodes = (a, b) => (a.depth - b.depth) || localeCompare(a.path, b.path) + +const _checkBins = Symbol.for('checkBins') + +// defined by reify mixin +const _handleOptionalFailure = Symbol.for('handleOptionalFailure') +const _trashList = Symbol.for('trashList') + +module.exports = cls => class Builder extends cls { + #doHandleOptionalFailure + #oldMeta = null + #queues = { + preinstall: [], + install: [], + postinstall: [], + prepare: [], + bin: [], + } + + async rebuild ({ nodes, handleOptionalFailure = false } = {}) { + // nothing to do if we're not building anything! + if (this.options.ignoreScripts && !this.options.binLinks) { + return + } + + // when building for the first time, as part of reify, we ignore + // failures in optional nodes, and just delete them. however, when + // running JUST a rebuild, we treat optional failures as real fails + this.#doHandleOptionalFailure = handleOptionalFailure + + if (!nodes) { + nodes = await this.#loadDefaultNodes() + } + + // separates links nodes so that it can run + // prepare scripts and link bins in the expected order + const timeEnd = time.start('build') + + const { + depNodes, + linkNodes, + } = this.#retrieveNodesByType(nodes) + + // build regular deps + await this.#build(depNodes, {}) + + // build link deps + if (linkNodes.size) { + this.#queues = { + preinstall: [], + install: [], + postinstall: [], + prepare: [], + bin: [], + } + await this.#build(linkNodes, { type: 'links' }) + } + + timeEnd() + } + + // if we don't have a set of nodes, then just rebuild + // the actual tree on disk. + async #loadDefaultNodes () { + let nodes + const tree = await this.loadActual() + let filterSet + if (!this.options.workspacesEnabled) { + filterSet = this.excludeWorkspacesDependencySet(tree) + nodes = tree.inventory.filter(node => + filterSet.has(node) || node.isProjectRoot + ) + } else if (this.options.workspaces.length) { + filterSet = this.workspaceDependencySet( + tree, + this.options.workspaces, + this.options.includeWorkspaceRoot + ) + nodes = tree.inventory.filter(node => filterSet.has(node)) + } else { + nodes = tree.inventory.values() + } + return nodes + } + + #retrieveNodesByType (nodes) { + const depNodes = new Set() + const linkNodes = new Set() + const storeNodes = new Set() + + for (const node of nodes) { + if (node.isStoreLink) { + storeNodes.add(node) + } else if (node.isLink) { + linkNodes.add(node) + } else { + depNodes.add(node) + } + } + // Make sure that store linked nodes are processed last. + // We can't process store links separately or else lifecycle scripts on + // standard nodes might not have bin links yet. + for (const node of storeNodes) { + depNodes.add(node) + } + + // deduplicates link nodes and their targets, avoids + // calling lifecycle scripts twice when running `npm rebuild` + // ref: https://github.com/npm/cli/issues/2905 + // + // we avoid doing so if global=true since `bin-links` relies + // on having the target nodes available in global mode. + if (!this.options.global) { + for (const node of linkNodes) { + depNodes.delete(node.target) + } + } + + return { + depNodes, + linkNodes, + } + } + + async #build (nodes, { type = 'deps' }) { + const timeEnd = time.start(`build:${type}`) + + await this.#buildQueues(nodes) + + if (!this.options.ignoreScripts) { + await this.#runScripts('preinstall') + } + + // links should run prepare scripts and only link bins after that + if (type === 'links') { + if (!this.options.ignoreScripts) { + await this.#runScripts('prepare') + } + } + if (this.options.binLinks) { + await this.#linkAllBins() + } + + if (!this.options.ignoreScripts) { + await this.#runScripts('install') + await this.#runScripts('postinstall') + } + + timeEnd() + } + + async #buildQueues (nodes) { + const timeEnd = time.start('build:queue') + const set = new Set() + + const promises = [] + for (const node of nodes) { + promises.push(this.#addToBuildSet(node, set)) + + // if it has bundle deps, add those too, if rebuildBundle + if (this.options.rebuildBundle !== false) { + const bd = node.package.bundleDependencies + if (bd && bd.length) { + dfwalk({ + tree: node, + leave: node => promises.push(this.#addToBuildSet(node, set)), + getChildren: node => [...node.children.values()], + filter: node => node.inBundle, + }) + } + } + } + await promiseAllRejectLate(promises) + + // now sort into the queues for the 4 things we have to do + // run in the same predictable order that buildIdealTree uses + // there's no particular reason for doing it in this order rather + // than another, but sorting *somehow* makes it consistent. + const queue = [...set].sort(sortNodes) + + for (const node of queue) { + const { package: { bin, scripts = {} } } = node.target + const { preinstall, install, postinstall, prepare } = scripts + const tests = { bin, preinstall, install, postinstall, prepare } + for (const [key, has] of Object.entries(tests)) { + if (has) { + this.#queues[key].push(node) + } + } + } + timeEnd() + } + + async [_checkBins] (node) { + // if the node is a global top, and we're not in force mode, then + // any existing bins need to either be missing, or a symlink into + // the node path. Otherwise a package can have a preinstall script + // that unlinks something, to allow them to silently overwrite system + // binaries, which is unsafe and insecure. + if (!node.globalTop || this.options.force) { + return + } + const { path, package: pkg } = node + await binLinks.checkBins({ pkg, path, top: true, global: true }) + } + + async #addToBuildSet (node, set, refreshed = false) { + if (set.has(node)) { + return + } + + if (this.#oldMeta === null) { + const { root: { meta } } = node + this.#oldMeta = meta && meta.loadedFromDisk && + !(meta.originalLockfileVersion >= 2) + } + + const { package: pkg, hasInstallScript } = node.target + const { gypfile, bin, scripts = {} } = pkg + + const { preinstall, install, postinstall, prepare } = scripts + const anyScript = preinstall || install || postinstall || prepare + if (!refreshed && !anyScript && (hasInstallScript || this.#oldMeta)) { + // we either have an old metadata (and thus might have scripts) + // or we have an indication that there's install scripts (but + // don't yet know what they are) so we have to load the package.json + // from disk to see what the deal is. Failure here just means + // no scripts to add, probably borked package.json. + // add to the set then remove while we're reading the pj, so we + // don't accidentally hit it multiple times. + set.add(node) + const { content: pkg } = await PackageJson.normalize(node.path).catch(() => { + return { content: {} } + }) + set.delete(node) + + const { scripts = {} } = pkg + node.package.scripts = scripts + return this.#addToBuildSet(node, set, true) + } + + // Rebuild node-gyp dependencies lacking an install or preinstall script + // note that 'scripts' might be missing entirely, and the package may + // set gypfile:false to avoid this automatic detection. + const isGyp = gypfile !== false && + !install && + !preinstall && + await isNodeGypPackage(node.path) + + if (bin || preinstall || install || postinstall || prepare || isGyp) { + if (bin) { + await this[_checkBins](node) + } + if (isGyp) { + scripts.install = defaultGypInstallScript + node.package.scripts = scripts + } + set.add(node) + } + } + + async #runScripts (event) { + const queue = this.#queues[event] + + if (!queue.length) { + return + } + + const timeEnd = time.start(`build:run:${event}`) + const stdio = this.options.foregroundScripts ? 'inherit' : 'pipe' + const limit = this.options.foregroundScripts ? 1 : undefined + await promiseCallLimit(queue.map(node => async () => { + const { + path, + integrity, + resolved, + optional, + peer, + dev, + devOptional, + package: pkg, + location, + } = node.target + + // skip any that we know we'll be deleting + // or links to store entries (their scripts run on the store + // entry itself, not through the link) + if (this[_trashList].has(path) || (node.isLink && node.target?.isInStore)) { + return + } + + const timeEndLocation = time.start(`build:run:${event}:${location}`) + log.info('run', pkg._id, event, location, pkg.scripts[event]) + const env = { + npm_package_resolved: resolved, + npm_package_integrity: integrity, + npm_package_json: resolve(path, 'package.json'), + npm_package_optional: boolEnv(optional), + npm_package_dev: boolEnv(dev), + npm_package_peer: boolEnv(peer), + npm_package_dev_optional: + boolEnv(devOptional && !dev && !optional), + } + const runOpts = { + event, + path, + pkg, + stdio, + env, + scriptShell: this.options.scriptShell, + } + const p = runScript(runOpts).catch(er => { + const { code, signal } = er + log.info('run', pkg._id, event, { code, signal }) + throw er + }).then(({ args, code, signal, stdout, stderr }) => { + this.scriptsRun.add({ + pkg, + path, + event, + // I do not know why this needs to be on THIS line but refactoring + // this function would be quite a process + // eslint-disable-next-line promise/always-return + cmd: args && args[args.length - 1], + env, + code, + signal, + stdout, + stderr, + }) + log.info('run', pkg._id, event, { code, signal }) + }) + + await (this.#doHandleOptionalFailure + ? this[_handleOptionalFailure](node, p) + : p) + + timeEndLocation() + }), { limit }) + timeEnd() + } + + async #linkAllBins () { + const queue = this.#queues.bin + if (!queue.length) { + return + } + + const timeEnd = time.start('build:link') + const promises = [] + // sort the queue by node path, so that the module-local collision + // detector in bin-links will always resolve the same way. + for (const node of queue.sort(sortNodes)) { + // TODO these run before they're awaited + promises.push(this.#createBinLinks(node)) + } + + await promiseAllRejectLate(promises) + timeEnd() + } + + async #createBinLinks (node) { + if (this[_trashList].has(node.path)) { + return + } + + const timeEnd = time.start(`build:link:${node.location}`) + + // On Windows, antivirus/indexer can transiently lock files, causing EPERM/EACCES/EBUSY on the rename inside write-file-atomic (used by bin-links/fix-bin.js), so, retry with backoff. + const p = promiseRetry((retry) => binLinks({ + pkg: node.package, + path: node.path, + top: !!(node.isTop || node.globalTop), + force: this.options.force, + global: !!node.globalTop, + }).catch(/* istanbul ignore next - Windows-only transient antivirus locks */ err => { + if (process.platform === 'win32' && + (err.code === 'EPERM' || err.code === 'EACCES' || err.code === 'EBUSY')) { + return retry(err) + } + throw err + }), { retries: 5, minTimeout: 500 }) + + await (this.#doHandleOptionalFailure + ? this[_handleOptionalFailure](node, p) + : p) + + timeEnd() + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js new file mode 100644 index 0000000000000000000000000000000000000000..1384727c3bb0d5c53c810b933e2234f678477a8e --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js @@ -0,0 +1,1626 @@ +// mixin implementing the reify method +const PackageJson = require('@npmcli/package-json') +const hgi = require('hosted-git-info') +const npa = require('npm-package-arg') +const packageContents = require('@npmcli/installed-package-contents') +const pacote = require('pacote') +const promiseAllRejectLate = require('promise-all-reject-late') +const runScript = require('@npmcli/run-script') +const { callLimit: promiseCallLimit } = require('promise-call-limit') +const { depth: dfwalk } = require('treeverse') +const { dirname, resolve, relative, join, sep } = require('node:path') +const { log, time } = require('proc-log') +const { existsSync } = require('node:fs') +const { lstat, mkdir, readdir, rm, symlink } = require('node:fs/promises') +const { moveFile } = require('@npmcli/fs') +const { subset, intersects } = require('semver') +const { walkUp } = require('walk-up-path') + +const AuditReport = require('../audit-report.js') +const Diff = require('../diff.js') +const calcDepFlags = require('../calc-dep-flags.js') +const debug = require('../debug.js') +const onExit = require('../signal-handling.js') +const optionalSet = require('../optional-set.js') +const relpath = require('../relpath.js') +const retirePath = require('../retire-path.js') +const treeCheck = require('../tree-check.js') +const { defaultLockfileVersion } = require('../shrinkwrap.js') +const { saveTypeMap, hasSubKey } = require('../add-rm-pkg-deps.js') +const { IsolatedNode, IsolatedLink } = require('../isolated-classes.js') + +// Part of steps (steps need refactoring before we can do anything about these) +const _retireShallowNodes = Symbol.for('retireShallowNodes') +const _loadBundlesAndUpdateTrees = Symbol.for('loadBundlesAndUpdateTrees') +const _submitQuickAudit = Symbol('submitQuickAudit') +const _unpackNewModules = Symbol.for('unpackNewModules') +const _build = Symbol.for('build') + +// shared by rebuild mixin +const _trashList = Symbol.for('trashList') +const _handleOptionalFailure = Symbol.for('handleOptionalFailure') +const _loadTrees = Symbol.for('loadTrees') +// defined by rebuild mixin +const _checkBins = Symbol.for('checkBins') + +// shared symbols for swapping out when testing +// TODO tests should not be this deep into internals +const _diffTrees = Symbol.for('diffTrees') +const _createSparseTree = Symbol.for('createSparseTree') +const _loadShrinkwrapsAndUpdateTrees = Symbol.for('loadShrinkwrapsAndUpdateTrees') +const _reifyNode = Symbol.for('reifyNode') +const _updateAll = Symbol.for('updateAll') +const _updateNames = Symbol.for('updateNames') +const _moveContents = Symbol.for('moveContents') +const _moveBackRetiredUnchanged = Symbol.for('moveBackRetiredUnchanged') +const _removeTrash = Symbol.for('removeTrash') +const _renamePath = Symbol.for('renamePath') +const _rollbackRetireShallowNodes = Symbol.for('rollbackRetireShallowNodes') +const _rollbackCreateSparseTree = Symbol.for('rollbackCreateSparseTree') +const _rollbackMoveBackRetiredUnchanged = Symbol.for('rollbackMoveBackRetiredUnchanged') +const _saveIdealTree = Symbol.for('saveIdealTree') + +// defined by build-ideal-tree mixin +const _resolvedAdd = Symbol.for('resolvedAdd') +// used by build-ideal-tree mixin +const _addNodeToTrashList = Symbol.for('addNodeToTrashList') + +module.exports = cls => class Reifier extends cls { + #bundleMissing = new Set() // child nodes we'd EXPECT to be included in a bundle, but aren't + #bundleUnpacked = new Set() // the nodes we unpack to read their bundles + #nmValidated = new Set() + #omit + #retiredPaths = {} + #retiredUnchanged = {} + #shrinkwrapInflated = new Set() + #sparseTreeDirs = new Set() + #sparseTreeRoots = new Set() + #linkedActualForDiff = null + + constructor (options) { + super(options) + + this[_trashList] = new Set() + } + + // public method + async reify (options = {}) { + const linked = (options.installStrategy || this.options.installStrategy) === 'linked' + + if (this.options.packageLockOnly && this.options.global) { + const er = new Error('cannot generate lockfile for global packages') + er.code = 'ESHRINKWRAPGLOBAL' + throw er + } + + this.#omit = new Set(options.omit) + + // start tracker block + this.addTracker('reify') + const timeEnd = time.start('reify') + // don't create missing dirs on dry runs + if (!this.options.packageLockOnly && !this.options.dryRun) { + // we do NOT want to set ownership on this folder, especially + // recursively, because it can have other side effects to do that + // in a project directory. We just want to make it if it's missing. + await mkdir(resolve(this.path), { recursive: true }) + + // do not allow the top-level node_modules to be a symlink + await this.#validateNodeModules(resolve(this.path, 'node_modules')) + } + await this[_loadTrees](options) + + const oldTree = this.idealTree + if (linked) { + // swap out the tree with the isolated tree + // this is currently technical debt which will be resolved in a refactor + // of Node/Link trees + log.warn('reify', 'The "linked" install strategy is EXPERIMENTAL and may contain bugs.') + this.idealTree = await this.createIsolatedTree() + if (this.actualTree) { + this.#linkedActualForDiff = this.#buildLinkedActualForDiff( + this.idealTree, this.actualTree + ) + } + } + await this[_diffTrees]() + await this.#reifyPackages() + if (linked) { + await this.#cleanOrphanedStoreEntries() + // swap back in the idealTree + // so that the lockfile is preserved + this.idealTree = oldTree + } + await this[_saveIdealTree](options) + this.#linkedActualForDiff = null + // clean inert + for (const node of this.idealTree.inventory.values()) { + if (node.inert) { + node.parent = null + } + } + // clean up any trash that is still in the tree + for (const path of this[_trashList]) { + const loc = relpath(this.idealTree.realpath, path) + const node = this.idealTree.inventory.get(loc) + if (node && node.root === this.idealTree) { + node.parent = null + } + } + + // if we filtered to only certain nodes, then anything ELSE needs + // to be untouched in the resulting actual tree, even if it differs + // in the idealTree. Copy over anything that was in the actual and + // was not changed, delete anything in the ideal and not actual. + // Then we move the entire idealTree over to this.actualTree, and + // save the hidden lockfile. + if (this.diff && this.diff.filterSet.size && !linked) { + const reroot = new Set() + + const { filterSet } = this.diff + const seen = new Set() + for (const [loc, ideal] of this.idealTree.inventory.entries()) { + seen.add(loc) + + // if it's an ideal node from the filter set, then skip it + // because we already made whatever changes were necessary + if (filterSet.has(ideal)) { + continue + } + + // otherwise, if it's not in the actualTree, then it's not a thing + // that we actually added. And if it IS in the actualTree, then + // it's something that we left untouched, so we need to record + // that. + const actual = this.actualTree.inventory.get(loc) + if (!actual) { + ideal.root = null + } else { + if ([...actual.linksIn].some(link => filterSet.has(link))) { + seen.add(actual.location) + continue + } + const { realpath, isLink } = actual + if (isLink && ideal.isLink && ideal.realpath === realpath) { + continue + } else { + reroot.add(actual) + } + } + } + + // now find any actual nodes that may not be present in the ideal + // tree, but were left behind by virtue of not being in the filter + for (const [loc, actual] of this.actualTree.inventory.entries()) { + if (seen.has(loc)) { + continue + } + seen.add(loc) + + // we know that this is something that ISN'T in the idealTree, + // or else we will have addressed it in the previous loop. + // If it's in the filterSet, that means we intentionally removed + // it, so nothing to do here. + if (filterSet.has(actual)) { + continue + } + + reroot.add(actual) + } + + // go through the rerooted actual nodes, and move them over. + for (const actual of reroot) { + actual.root = this.idealTree + } + + // prune out any tops that lack a linkIn, they are no longer relevant. + for (const top of this.idealTree.tops) { + if (top.linksIn.size === 0) { + top.root = null + } + } + + // need to calculate dep flags, since nodes may have been marked + // as extraneous or otherwise incorrect during transit. + calcDepFlags(this.idealTree) + } + + // save the ideal's meta as a hidden lockfile after we actualize it + this.idealTree.meta.filename = + this.idealTree.realpath + '/node_modules/.package-lock.json' + this.idealTree.meta.hiddenLockfile = true + this.idealTree.meta.lockfileVersion = defaultLockfileVersion + + this.actualTree = this.idealTree + this.idealTree = null + + if (!this.options.global) { + await this.actualTree.meta.save() + const ignoreScripts = !!this.options.ignoreScripts + // if we aren't doing a dry run or ignoring scripts and we actually made changes to the dep + // tree, then run the dependencies scripts + if (!this.options.dryRun && !ignoreScripts && this.diff && this.diff.children.length) { + const { path, package: pkg } = this.actualTree.target + const stdio = this.options.foregroundScripts ? 'inherit' : 'pipe' + const { scripts = {} } = pkg + for (const event of ['predependencies', 'dependencies', 'postdependencies']) { + if (Object.prototype.hasOwnProperty.call(scripts, event)) { + log.info('run', pkg._id, event, scripts[event]) + await time.start(`reify:run:${event}`, () => runScript({ + event, + path, + pkg, + stdio, + scriptShell: this.options.scriptShell, + })) + } + } + } + } + // This is a very bad pattern and I can't wait to stop doing it + this.auditReport = await this.auditReport + + this.finishTracker('reify') + timeEnd() + return treeCheck(this.actualTree) + } + + async #reifyPackages () { + // we don't submit the audit report or write to disk on dry runs + if (this.options.dryRun) { + return + } + + if (this.options.packageLockOnly) { + // we already have the complete tree, so just audit it now, + // and that's all we have to do here. + return this[_submitQuickAudit]() + } + + // ok, we're about to start touching the fs. need to roll back + // if we get an early termination. + let reifyTerminated = null + const removeHandler = onExit(({ signal }) => { + // only call once. if signal hits twice, we just terminate + removeHandler() + reifyTerminated = Object.assign(new Error('process terminated'), { + signal, + }) + return false + }) + + // [rollbackfn, [...actions]] + // after each step, if the process was terminated, execute the rollback + // note that each rollback *also* calls the previous one when it's + // finished, and then the first one throws the error, so we only need + // a new rollback step when we have a new thing that must be done to + // revert the install. + const steps = [ + [_rollbackRetireShallowNodes, [ + _retireShallowNodes, + ]], + [_rollbackCreateSparseTree, [ + _createSparseTree, + _loadShrinkwrapsAndUpdateTrees, + _loadBundlesAndUpdateTrees, + _submitQuickAudit, + _unpackNewModules, + ]], + [_rollbackMoveBackRetiredUnchanged, [ + _moveBackRetiredUnchanged, + _build, + ]], + ] + for (const [rollback, actions] of steps) { + for (const action of actions) { + try { + await this[action]() + if (reifyTerminated) { + throw reifyTerminated + } + } catch (er) { + // TODO rollbacks shouldn't be relied on to throw err + await this[rollback](er) + /* istanbul ignore next - rollback throws, should never hit this */ + throw er + } + } + } + + // no rollback for this one, just exit with the error, since the + // install completed and can't be safely recovered at this point. + await this[_removeTrash]() + if (reifyTerminated) { + throw reifyTerminated + } + + // done modifying the file system, no need to keep listening for sigs + removeHandler() + } + + // when doing a local install, we load everything and figure it all out. + // when doing a global install, we *only* care about the explicit requests. + [_loadTrees] (options) { + const timeEnd = time.start('reify:loadTrees') + const bitOpt = { + ...options, + complete: this.options.packageLockOnly || this.options.dryRun, + } + + // if we're only writing a package lock, then it doesn't matter what's here + if (this.options.packageLockOnly) { + return this.buildIdealTree(bitOpt).then(timeEnd) + } + + const actualOpt = this.options.global ? { + ignoreMissing: true, + global: true, + filter: (node, kid) => { + // if it's not the project root, and we have no explicit requests, + // then we're already into a nested dep, so we keep it + if (this.explicitRequests.size === 0 || !node.isProjectRoot) { + return true + } + + // if we added it as an edgeOut, then we want it + if (this.idealTree.edgesOut.has(kid)) { + return true + } + + // if it's an explicit request, then we want it + const hasExplicit = [...this.explicitRequests] + .some(edge => edge.name === kid) + if (hasExplicit) { + return true + } + + // ignore the rest of the global install folder + return false + }, + } : { ignoreMissing: true } + + if (!this.options.global) { + return Promise.all([ + this.loadActual(actualOpt), + this.buildIdealTree(bitOpt), + ]).then(timeEnd) + } + + // the global install space tends to have a lot of stuff in it. don't + // load all of it, just what we care about. we won't be saving a + // hidden lockfile in there anyway. Note that we have to load ideal + // BEFORE loading actual, so that the actualOpt can use the + // explicitRequests which is set during buildIdealTree + return this.buildIdealTree(bitOpt) + .then(() => this.loadActual(actualOpt)) + .then(timeEnd) + } + + [_diffTrees] () { + if (this.options.packageLockOnly) { + return + } + + const timeEnd = time.start('reify:diffTrees') + // XXX if we have an existing diff already, there should be a way + // to just invalidate the parts that changed, but avoid walking the + // whole tree again. + + const includeWorkspaces = this.options.workspacesEnabled + const includeRootDeps = !includeWorkspaces + || this.options.includeWorkspaceRoot && this.options.workspaces.length > 0 + + const filterNodes = [] + if (this.options.global && this.explicitRequests.size) { + const idealTree = this.idealTree.target + const actualTree = this.actualTree.target + // we ONLY are allowed to make changes in the global top-level + // children where there's an explicit request. + for (const { name } of this.explicitRequests) { + const ideal = idealTree.children.get(name) + if (ideal) { + filterNodes.push(ideal) + } + const actual = actualTree.children.get(name) + if (actual) { + filterNodes.push(actual) + } + } + } else { + if (includeWorkspaces) { + // add all ws nodes to filterNodes + for (const ws of this.options.workspaces) { + const ideal = this.idealTree.children.get(ws) + if (ideal) { + filterNodes.push(ideal) + } + // Skip actual-side filterNodes when using the linked diff wrapper. + // Those nodes have root===actualTree, not root===linkedActualForDiff, and Diff.calculate requires filterNode.root to match actual. + // The ideal filterNode alone is sufficient to scope the workspace diff. + if (!this.#linkedActualForDiff) { + const actual = this.actualTree.children.get(ws) + if (actual) { + filterNodes.push(actual) + } + } + } + } + if (includeRootDeps) { + // add all non-workspace nodes to filterNodes + for (const tree of [this.idealTree, this.actualTree]) { + for (const { type, to } of tree.edgesOut.values()) { + if (type !== 'workspace' && to) { + filterNodes.push(to) + } + } + } + } + } + + // find all the nodes that need to change between the actual + // and ideal trees. + this.diff = Diff.calculate({ + omit: this.#omit, + shrinkwrapInflated: this.#shrinkwrapInflated, + filterNodes, + actual: this.#linkedActualForDiff || this.actualTree, + ideal: this.idealTree, + }) + + // we don't have to add 'removed' folders to the trashlist, because + // they'll be moved aside to a retirement folder, and then the retired + // folder will be deleted at the end. This is important when we have + // a folder like FOO being "removed" in favor of a folder like "foo", + // because if we remove node_modules/FOO on case-insensitive systems, + // it will remove the dep that we *want* at node_modules/foo. + + timeEnd() + } + + // add the node and all its bins to the list of things to be + // removed later on in the process. optionally, also mark them + // as a retired paths, so that we move them out of the way and + // replace them when rolling back on failure. + [_addNodeToTrashList] (node, retire = false) { + const paths = [node.path, ...node.binPaths] + const moves = this.#retiredPaths + log.silly('reify', 'mark', retire ? 'retired' : 'deleted', paths) + for (const path of paths) { + if (retire) { + const retired = retirePath(path) + moves[path] = retired + this[_trashList].add(retired) + } else { + this[_trashList].add(path) + } + } + } + + // move aside the shallowest nodes in the tree that have to be + // changed or removed, so that we can rollback if necessary. + [_retireShallowNodes] () { + const timeEnd = time.start('reify:retireShallow') + const moves = this.#retiredPaths = {} + for (const diff of this.diff.children) { + if (diff.action === 'CHANGE' || diff.action === 'REMOVE') { + // we'll have to clean these up at the end, so add them to the list + this[_addNodeToTrashList](diff.actual, true) + } + } + log.silly('reify', 'moves', moves) + const movePromises = Object.entries(moves) + .map(([from, to]) => this[_renamePath](from, to)) + return promiseAllRejectLate(movePromises).then(timeEnd) + } + + [_renamePath] (from, to, didMkdirp = false) { + return moveFile(from, to) + .catch(er => { + // Occasionally an expected bin file might not exist in the package, + // or a shim/symlink might have been moved aside. If we've already + // handled the most common cause of ENOENT (dir doesn't exist yet), + // then just ignore any ENOENT. + if (er.code === 'ENOENT') { + return didMkdirp ? null : mkdir(dirname(to), { recursive: true }).then(() => + this[_renamePath](from, to, true)) + } else if (er.code === 'EEXIST' || er.code === 'ENOTEMPTY') { + return rm(to, { recursive: true, force: true }).then(() => moveFile(from, to)) + } else { + throw er + } + }) + } + + [_rollbackRetireShallowNodes] (er) { + const timeEnd = time.start('reify:rollback:retireShallow') + const moves = this.#retiredPaths + const movePromises = Object.entries(moves) + .map(([from, to]) => this[_renamePath](to, from)) + return promiseAllRejectLate(movePromises) + // ignore subsequent rollback errors + .catch(() => {}) + .then(timeEnd) + .then(() => { + throw er + }) + } + + [_createSparseTree] () { + const timeEnd = time.start('reify:createSparse') + // if we call this fn again, we look for the previous list + // so that we can avoid making the same directory multiple times + const leaves = this.diff.leaves + .filter(diff => { + return (diff.action === 'ADD' || diff.action === 'CHANGE') && + !this.#sparseTreeDirs.has(diff.ideal.path) && + !diff.ideal.isLink + }) + .map(diff => diff.ideal) + + // we check this in parallel, so guard against multiple attempts to + // retire the same path at the same time. + const dirsChecked = new Set() + return promiseAllRejectLate(leaves.map(async node => { + for (const d of walkUp(node.path)) { + if (d === node.top.path) { + break + } + if (dirsChecked.has(d)) { + continue + } + dirsChecked.add(d) + const st = await lstat(d).catch(() => null) + // this can happen if we have a link to a package with a name + // that the filesystem treats as if it is the same thing. + // would be nice to have conditional istanbul ignores here... + /* istanbul ignore next - defense in depth */ + if (st && !st.isDirectory()) { + const retired = retirePath(d) + this.#retiredPaths[d] = retired + this[_trashList].add(retired) + await this[_renamePath](d, retired) + } + } + this.#sparseTreeDirs.add(node.path) + const made = await mkdir(node.path, { recursive: true }) + // if the directory already exists, made will be undefined. if that's the case + // we don't want to remove it because we aren't the ones who created it so we + // omit it from the #sparseTreeRoots + /* istanbul ignore next -- pre-existing: mkdir returns undefined when dir exists, covered in reify tests but lost in aggregate coverage merge */ + if (made) { + this.#sparseTreeRoots.add(made) + } + })).then(timeEnd) + } + + [_rollbackCreateSparseTree] (er) { + const timeEnd = time.start('reify:rollback:createSparse') + // cut the roots of the sparse tree that were created, not the leaves + const roots = this.#sparseTreeRoots + // also delete the moves that we retired, so that we can move them back + const failures = [] + const targets = [...roots, ...Object.keys(this.#retiredPaths)] + const unlinks = targets + .map(path => rm(path, { recursive: true, force: true }).catch(er => failures.push([path, er]))) + return promiseAllRejectLate(unlinks).then(() => { + // eslint-disable-next-line promise/always-return + if (failures.length) { + log.warn('cleanup', 'Failed to remove some directories', failures) + } + }) + .then(timeEnd) + .then(() => this[_rollbackRetireShallowNodes](er)) + } + + // shrinkwrap nodes define their dependency branches with a file, so + // we need to unpack them, read that shrinkwrap file, and then update + // the tree by calling loadVirtual with the node as the root. + [_loadShrinkwrapsAndUpdateTrees] () { + const seen = this.#shrinkwrapInflated + const shrinkwraps = this.diff.leaves + .filter(d => (d.action === 'CHANGE' || d.action === 'ADD' || !d.action) && + d.ideal.hasShrinkwrap && !seen.has(d.ideal) && + !this[_trashList].has(d.ideal.path)) + + if (!shrinkwraps.length) { + return + } + + const timeEnd = time.start('reify:loadShrinkwraps') + + const Arborist = this.constructor + return promiseAllRejectLate(shrinkwraps.map(diff => { + const node = diff.ideal + seen.add(node) + return diff.action ? this[_reifyNode](node) : node + })) + .then(nodes => promiseAllRejectLate(nodes.map(node => new Arborist({ + ...this.options, + path: node.path, + }).loadVirtual({ root: node })))) + // reload the diff and sparse tree because the ideal tree changed + .then(() => this[_diffTrees]()) + .then(() => this[_createSparseTree]()) + .then(() => this[_loadShrinkwrapsAndUpdateTrees]()) + .then(timeEnd) + } + + // create a symlink for Links, extract for Nodes + // return the node object, since we usually want that + // handle optional dep failures here + // If reifying fails, and the node is optional, add it and its optionalSet + // to the trash list + // Always return the node. + [_reifyNode] (node) { + const timeEnd = time.start(`reifyNode:${node.location}`) + this.addTracker('reify', node.name, node.location) + + const p = Promise.resolve().then(async () => { + await this[_checkBins](node) + await this.#extractOrLink(node) + const { _id, deprecated } = node.package + // The .catch is in _handleOptionalFailure. Not ideal, this should be cleaned up. + // eslint-disable-next-line promise/always-return + if (deprecated) { + log.warn('deprecated', `${_id}: ${deprecated}`) + } + }) + + return this[_handleOptionalFailure](node, p) + .then(() => { + this.finishTracker('reify', node.name, node.location) + timeEnd() + return node + }) + } + + // do not allow node_modules to be a symlink + async #validateNodeModules (nm) { + if (this.options.force || this.#nmValidated.has(nm)) { + return + } + const st = await lstat(nm).catch(() => null) + if (!st || st.isDirectory()) { + this.#nmValidated.add(nm) + return + } + log.warn('reify', 'Removing non-directory', nm) + await rm(nm, { recursive: true, force: true }) + } + + async #extractOrLink (node) { + const nm = resolve(node.parent.path, 'node_modules') + await this.#validateNodeModules(nm) + + if (!node.isLink) { + // in normal cases, node.resolved should *always* be set by now. + // however, it is possible when a lockfile is damaged, or very old, + // or in some other race condition bugs in npm v6, that a previously + // bundled dependency will have just a version, but no resolved value, + // and no 'bundled: true' setting. + // Do the best with what we have, or else remove it from the tree + // entirely, since we can't possibly reify it. + let res = null + if (node.resolved) { + const registryResolved = this.#registryResolved(node.resolved) + if (registryResolved) { + res = `${node.name}@${registryResolved}` + } + } else if (node.package.name && node.version) { + res = `${node.package.name}@${node.version}` + } + + // no idea what this thing is. remove it from the tree. + if (!res) { + const warning = 'invalid or damaged lockfile detected\n' + + 'please re-try this operation once it completes\n' + + 'so that the damage can be corrected, or perform\n' + + 'a fresh install with no lockfile if the problem persists.' + log.warn('reify', warning) + log.verbose('reify', 'unrecognized node in tree', node.path) + node.parent = null + node.fsParent = null + this[_addNodeToTrashList](node) + return + } + await debug(async () => { + const st = await lstat(node.path).catch(() => null) + if (st && !st.isDirectory()) { + debug.log('unpacking into a non-directory', node) + throw Object.assign(new Error('ENOTDIR: not a directory'), { + code: 'ENOTDIR', + path: node.path, + }) + } + }) + await pacote.extract(res, node.path, { + ...this.options, + resolved: node.resolved, + integrity: node.integrity, + }) + // store nodes don't use Node class so node.package doesn't get updated + if (node.isInStore) { + const { content: pkg } = await PackageJson.normalize(node.path) + node.package.scripts = pkg.scripts + } + return + } + + // node.isLink + await rm(node.path, { recursive: true, force: true }) + + // symlink + const dir = dirname(node.path) + const target = node.realpath + + let rel + if (node.resolved?.startsWith('file:')) { + rel = this.#calculateRelativePath(node, dir, target, nm) + } else { + rel = relative(dir, target) + } + + await mkdir(dir, { recursive: true }) + return symlink(rel, node.path, 'junction') + } + + // if the node is optional, then the failure of the promise is nonfatal + // just add it and its optional set to the trash list. + [_handleOptionalFailure] (node, p) { + return (node.optional ? p.catch(() => { + const set = optionalSet(node) + for (const node of set) { + log.verbose('reify', 'failed optional dependency', node.path) + node.inert = true + this[_addNodeToTrashList](node) + } + }) : p).then(() => node) + } + + #calculateRelativePath (node, dir, target) { + // Check if the node is affected by a root override + let hasRootOverride = [...node.edgesIn].some(edge => edge.from.isRoot && edge.overrides) + // If not set via edges, see if the root package.json explicitly lists an override + if (!hasRootOverride && node.root) { + const rootPackage = node.root.target + hasRootOverride = !!(rootPackage && + rootPackage.package.overrides && + rootPackage.package.overrides[node.name]) + } + if (!hasRootOverride) { + return relative(dir, target) + } + // If an override is detected, attempt to retrieve the override spec from the root package.json + const overrideSpec = node.root?.target?.package?.overrides?.[node.name] + if (typeof overrideSpec === 'string' && overrideSpec.startsWith('file:')) { + const overridePath = overrideSpec.replace(/^file:/, '') + const rootDir = node.root.target.path + return relative(dir, resolve(rootDir, overridePath)) + } + + // Fallback: derive the file path from node.resolved in a platform-agnostic way + const filePath = node.resolved.replace(/^file:/, '') + return join(filePath) + } + + // Build a flat actual tree wrapper for linked installs so the diff can correctly match store entries that already exist on disk. + // The proxy tree from createIsolatedTree() is flat (all children on root), but loadActual() produces a nested tree where store entries are deep link targets. + // This wrapper surfaces them at the root level for comparison. + #buildLinkedActualForDiff (idealTree, actualTree) { + // Combined Map keyed by path (how allChildren() in diff.js keys) + const combined = new Map() + + // Create synthetic actual entries for ALL ideal children that exist on disk. + // The isolated ideal tree is flat (all entries as root children), but loadActual() produces a nested tree where workspace deps are under fsChildren and store entries are deep link targets. + // Synthetic entries ensure the diff compares matching resolved/integrity values (e.g. workspace links have resolved=undefined in the ideal tree but resolved="file:../packages/..." in the actual tree). + for (const child of idealTree.children.values()) { + if (combined.has(child.path) || !existsSync(child.path)) { + continue + } + // Skip store links whose ideal realpath doesn't exist on disk yet — the store hash changed and the symlink needs recreating via ADD. + if (child.isLink && child.resolved?.startsWith('file:.store/') && !existsSync(child.realpath)) { + continue + } + let entry + if (child.isLink) { + entry = new IsolatedLink(child) + } else { + entry = new IsolatedNode(child) + } + if (child.isLink && combined.has(child.realpath)) { + entry.target = combined.get(child.realpath) + } + combined.set(child.path, entry) + } + + // Proxy .get(name) to original actual tree for filterNodes compatibility + // (scoped workspace installs use .get(name), allChildren uses .values()) + const origGet = actualTree.children.get.bind(actualTree.children) + const combinedGet = combined.get.bind(combined) + /* istanbul ignore next -- only reached during scoped workspace installs */ + combined.get = (key) => combinedGet(key) || origGet(key) + + let wrapper + /* istanbul ignore next - untested! */ + if (actualTree.isLink) { + wrapper = new IsolatedLink(actualTree) + } else { + wrapper = new IsolatedNode(actualTree) + } + wrapper.root = wrapper + wrapper.binPaths = actualTree.binPaths + wrapper.children = combined + wrapper.edgesOut = actualTree.edgesOut + // Use empty fsChildren so that allChildren() only picks up entries from the combined map. + // The actual fsChildren have real children with different resolved values (e.g. file:../../../node_modules/.store/... vs file:.store/...) that would overwrite our synthetic entries in allChildren(). + wrapper.fsChildren = new Set() + wrapper.integrity = actualTree.integrity + wrapper.inventory = actualTree.inventory + + return wrapper + } + + #registryResolved (resolved) { + // the default registry url is a magic value meaning "the currently + // configured registry". + // `resolved` must never be falsey. + // + // XXX: use a magic string that isn't also a valid value, like + // ${REGISTRY} or something. This has to be threaded through the + // Shrinkwrap and Node classes carefully, so for now, just treat + // the default reg as the magical animal that it has been. + try { + const resolvedURL = hgi.parseUrl(resolved) + + if ((this.options.replaceRegistryHost === resolvedURL.hostname) || + this.options.replaceRegistryHost === 'always') { + const registryURL = new URL(this.registry) + + // Replace the host with the registry host while keeping the path intact + resolvedURL.hostname = registryURL.hostname + resolvedURL.port = registryURL.port + resolvedURL.protocol = registryURL.protocol + + // Make sure we don't double-include the path if it's already there + const registryPath = registryURL.pathname.replace(/\/$/, '') + + if (registryPath && registryPath !== '/') { + // Check if the resolved pathname already starts with the registry path + // We need to ensure it's a proper path prefix, not just a string prefix + // e.g., registry path '/npm' should not match '/npm-run-path' + const hasRegistryPath = resolvedURL.pathname === registryPath || + resolvedURL.pathname.startsWith(registryPath + '/') + + if (!hasRegistryPath) { + // Since hostname is changed, we need to ensure the registry path is included + resolvedURL.pathname = registryPath + resolvedURL.pathname + } + } + + return resolvedURL.toString() + } + return resolved + } catch (e) { + // if we could not parse the url at all then returning nothing + // here means it will get removed from the tree in the next step + return undefined + } + } + + // bundles are *sort of* like shrinkwraps, in that the branch is defined + // by the contents of the package. however, in their case, rather than + // shipping a virtual tree that must be reified, they ship an entire + // reified actual tree that must be unpacked and not modified. + [_loadBundlesAndUpdateTrees] (depth = 0, bundlesByDepth) { + let maxBundleDepth + if (!bundlesByDepth) { + bundlesByDepth = new Map() + maxBundleDepth = -1 + dfwalk({ + tree: this.diff, + visit: diff => { + const node = diff.ideal + if (!node) { + return + } + if (node.isProjectRoot) { + return + } + + const { bundleDependencies } = node.package + if (bundleDependencies && bundleDependencies.length) { + maxBundleDepth = Math.max(maxBundleDepth, node.depth) + if (!bundlesByDepth.has(node.depth)) { + bundlesByDepth.set(node.depth, [node]) + } else { + bundlesByDepth.get(node.depth).push(node) + } + } + }, + getChildren: diff => diff.children, + }) + + bundlesByDepth.set('maxBundleDepth', maxBundleDepth) + } else { + maxBundleDepth = bundlesByDepth.get('maxBundleDepth') + } + + if (depth === 0) { + time.start('reify:loadBundles') + } + + if (depth > maxBundleDepth) { + // if we did something, then prune the tree and update the diffs + if (maxBundleDepth !== -1) { + this.#pruneBundledMetadeps(bundlesByDepth) + this[_diffTrees]() + } + time.end('reify:loadBundles') + return + } + + // skip any that have since been removed from the tree, eg by a + // shallower bundle overwriting them with a bundled meta-dep. + const set = (bundlesByDepth.get(depth) || []) + .filter(node => node.root === this.idealTree && + node.target !== node.root && + !this[_trashList].has(node.path)) + + if (!set.length) { + return this[_loadBundlesAndUpdateTrees](depth + 1, bundlesByDepth) + } + + // extract all the nodes with bundles + return promiseCallLimit(set.map(node => { + return () => { + this.#bundleUnpacked.add(node) + return this[_reifyNode](node) + } + }), { rejectLate: true }) + // then load their unpacked children and move into the ideal tree + .then(nodes => + promiseAllRejectLate(nodes.map(async node => { + const arb = new this.constructor({ + ...this.options, + path: node.path, + }) + const notTransplanted = new Set(node.children.keys()) + await arb.loadActual({ + root: node, + // don't transplant any sparse folders we created + // loadActual will set node.package to {} for empty directories + // if by chance there are some empty folders in the node_modules + // tree for some other reason, then ok, ignore those too. + transplantFilter: node => { + if (node.package._id) { + // it's actually in the bundle if it gets transplanted + notTransplanted.delete(node.name) + return true + } else { + return false + } + }, + }) + for (const name of notTransplanted) { + this.#bundleMissing.add(node.children.get(name)) + } + }))) + // move onto the next level of bundled items + .then(() => this[_loadBundlesAndUpdateTrees](depth + 1, bundlesByDepth)) + } + + // https://github.com/npm/cli/issues/1597#issuecomment-667639545 + #pruneBundledMetadeps (bundlesByDepth) { + const bundleShadowed = new Set() + + // Example dep graph: + // root -> (a, c) + // a -> BUNDLE(b) + // b -> c + // c -> b + // + // package tree: + // root + // +-- a + // | +-- b(1) + // | +-- c(1) + // +-- b(2) + // +-- c(2) + // 1. mark everything that's shadowed by anything in the bundle. This + // marks b(2) and c(2). + // 2. anything with edgesIn from outside the set, mark not-extraneous, + // remove from set. This unmarks c(2). + // 3. continue until no change + // 4. remove everything in the set from the tree. b(2) is pruned + + // create the list of nodes shadowed by children of bundlers + for (const bundles of bundlesByDepth.values()) { + // skip the 'maxBundleDepth' item + if (!Array.isArray(bundles)) { + continue + } + for (const node of bundles) { + for (const name of node.children.keys()) { + const shadow = node.parent.resolve(name) + if (!shadow) { + continue + } + bundleShadowed.add(shadow) + shadow.extraneous = true + } + } + } + + // lib -> (a@1.x) BUNDLE(a@1.2.3 (b@1.2.3)) + // a@1.2.3 -> (b@1.2.3) + // a@1.3.0 -> (b@2) + // b@1.2.3 -> () + // b@2 -> (c@2) + // + // root + // +-- lib + // | +-- a@1.2.3 + // | +-- b@1.2.3 + // +-- b@2 <-- shadowed, now extraneous + // +-- c@2 <-- also shadowed, because only dependent is shadowed + for (const shadow of bundleShadowed) { + for (const shadDep of shadow.edgesOut.values()) { + /* istanbul ignore else - pretty unusual situation, just being + * defensive here. Would mean that a bundled dep has a dependency + * that is unmet. which, weird, but if you bundle it, we take + * whatever you put there and assume the publisher knows best. */ + if (shadDep.to) { + bundleShadowed.add(shadDep.to) + shadDep.to.extraneous = true + } + } + } + + let changed + do { + changed = false + for (const shadow of bundleShadowed) { + for (const edge of shadow.edgesIn) { + if (!bundleShadowed.has(edge.from)) { + shadow.extraneous = false + bundleShadowed.delete(shadow) + changed = true + break + } + } + } + } while (changed) + + for (const shadow of bundleShadowed) { + this[_addNodeToTrashList](shadow) + shadow.root = null + } + } + + async [_submitQuickAudit] () { + if (this.options.audit === false) { + this.auditReport = null + return + } + + // we submit the quick audit at this point in the process, as soon as + // we have all the deps resolved, so that it can overlap with the other + // actions as much as possible. Stash the promise, which we resolve + // before finishing the reify() and returning the tree. Thus, we do + // NOT return the promise, as the intent is for this to run in parallel + // with the reification, and be resolved at a later time. + const timeEnd = time.start('reify:audit') + const options = { ...this.options } + const tree = this.idealTree + + // if we're operating on a workspace, only audit the workspace deps + if (this.options.workspaces.length) { + options.filterSet = this.workspaceDependencySet( + tree, + this.options.workspaces, + this.options.includeWorkspaceRoot + ) + } + + this.auditReport = AuditReport.load(tree, options).then(res => { + timeEnd() + return res + }) + } + + // ok! actually unpack stuff into their target locations! + // The sparse tree has already been created, so we walk the diff + // kicking off each unpack job. If any fail, we rm the sparse + // tree entirely and try to put everything back where it was. + [_unpackNewModules] () { + const timeEnd = time.start('reify:unpack') + const unpacks = [] + dfwalk({ + tree: this.diff, + visit: diff => { + // no unpacking if we don't want to change this thing + if (diff.action !== 'CHANGE' && diff.action !== 'ADD') { + return + } + + const node = diff.ideal + const bd = this.#bundleUnpacked.has(node) + const sw = this.#shrinkwrapInflated.has(node) + const bundleMissing = this.#bundleMissing.has(node) + + // check whether we still need to unpack this one. + // test the inDepBundle last, since that's potentially a tree walk. + const doUnpack = node && // can't unpack if removed! + // root node already exists + !node.isRoot && + // already unpacked to read bundle + !bd && + // already unpacked to read sw + !sw && + // already unpacked by another dep's bundle + (bundleMissing || !node.inDepBundle) + + if (doUnpack) { + unpacks.push(this[_reifyNode](node)) + } + }, + getChildren: diff => diff.children, + }) + return promiseAllRejectLate(unpacks).then(timeEnd) + } + + // This is the part where we move back the unchanging nodes that were + // the children of a node that did change. If this fails, the rollback + // is a three-step process. First, we try to move the retired unchanged + // nodes BACK to their retirement folders, then delete the sparse tree, + // then move everything out of retirement. + [_moveBackRetiredUnchanged] () { + // get a list of all unchanging children of any shallow retired nodes + // if they are not the ancestor of any node in the diff set, then the + // directory won't already exist, so just rename it over. + // This is sort of an inverse diff tree, of all the nodes where + // the actualTree and idealTree _don't_ differ, starting from the + // shallowest nodes that we moved aside in the first place. + const timeEnd = time.start('reify:unretire') + const moves = this.#retiredPaths + this.#retiredUnchanged = {} + return promiseAllRejectLate(this.diff.children.map(diff => { + // skip if nothing was retired + if (diff.action !== 'CHANGE' && diff.action !== 'REMOVE') { + return + } + + const { path: realFolder } = diff.actual + const retireFolder = moves[realFolder] + /* istanbul ignore next - should be impossible */ + debug(() => { + if (!retireFolder) { + const er = new Error('trying to un-retire but not retired') + throw Object.assign(er, { + realFolder, + retireFolder, + actual: diff.actual, + ideal: diff.ideal, + action: diff.action, + }) + } + }) + + this.#retiredUnchanged[retireFolder] = [] + return promiseAllRejectLate(diff.unchanged.map(node => { + // no need to roll back links, since we'll just delete them anyway + if (node.isLink) { + return mkdir(dirname(node.path), { recursive: true, force: true }) + .then(() => this[_reifyNode](node)) + } + + // will have been moved/unpacked along with bundler + if (node.inDepBundle && !this.#bundleMissing.has(node)) { + return + } + + this.#retiredUnchanged[retireFolder].push(node) + + const rel = relative(realFolder, node.path) + const fromPath = resolve(retireFolder, rel) + // if it has bundleDependencies, then make node_modules. otherwise + // skip it. + const bd = node.package.bundleDependencies + const dir = bd && bd.length ? node.path + '/node_modules' : node.path + return mkdir(dir, { recursive: true }).then(() => this[_moveContents](node, fromPath)) + })) + })).then(timeEnd) + } + + // move the contents from the fromPath to the node.path + [_moveContents] (node, fromPath) { + return packageContents({ + path: fromPath, + depth: 1, + packageJsonCache: new Map([[fromPath + '/package.json', node.package]]), + }).then(res => promiseAllRejectLate(res.map(path => { + const rel = relative(fromPath, path) + const to = resolve(node.path, rel) + return this[_renamePath](path, to) + }))) + } + + [_rollbackMoveBackRetiredUnchanged] (er) { + const moves = this.#retiredPaths + // flip the mapping around to go back + const realFolders = new Map(Object.entries(moves).map(([k, v]) => [v, k])) + const promises = Object.entries(this.#retiredUnchanged) + .map(([retireFolder, nodes]) => promiseAllRejectLate(nodes.map(node => { + const realFolder = realFolders.get(retireFolder) + const rel = relative(realFolder, node.path) + const fromPath = resolve(retireFolder, rel) + return this[_moveContents]({ ...node, path: fromPath }, node.path) + }))) + return promiseAllRejectLate(promises) + .then(() => this[_rollbackCreateSparseTree](er)) + } + + [_build] () { + const timeEnd = time.start('reify:build') + + // for all the things being installed, run their appropriate scripts + // run in tip->root order, so as to be more likely to build a node's + // deps before attempting to build it itself + const nodes = [] + dfwalk({ + tree: this.diff, + leave: diff => { + if (!diff.ideal.isProjectRoot) { + nodes.push(diff.ideal) + } + }, + // process adds before changes, ignore removals + getChildren: diff => diff && diff.children, + filter: diff => diff.action === 'ADD' || diff.action === 'CHANGE', + }) + + // pick up link nodes from the unchanged list as we want to run their + // scripts in every install despite of having a diff status change + for (const node of this.diff.unchanged) { + const tree = node.root.target + + // skip links that only live within node_modules as they are most + // likely managed by packages we installed, we only want to rebuild + // unchanged links we directly manage + const linkedFromRoot = (node.parent === tree && !node.inert) || node.target.fsTop === tree + if (node.isLink && linkedFromRoot) { + nodes.push(node) + } + } + + return this.rebuild({ nodes, handleOptionalFailure: true }).then(timeEnd) + } + + // the tree is pretty much built now, so it's cleanup time. + // remove the retired folders, and any deleted nodes + // If this fails, there isn't much we can do but tell the user about it. + // Thankfully, it's pretty unlikely that it'll fail, since rm is a node builtin. + async [_removeTrash] () { + const timeEnd = time.start('reify:trash') + const promises = [] + const failures = [] + const _rm = path => rm(path, { recursive: true, force: true }).catch(er => failures.push([path, er])) + + for (const path of this[_trashList]) { + promises.push(_rm(path)) + } + + await promiseAllRejectLate(promises) + if (failures.length) { + log.warn('cleanup', 'Failed to remove some directories', failures) + } + + timeEnd() + } + + // After a linked install, scan node_modules/.store/ and remove any directories that are not referenced by the current ideal tree. + // Store entries become orphaned when dependencies are updated or removed, because the diff never sees the old store keys. + async #cleanOrphanedStoreEntries () { + const storeDir = resolve(this.path, 'node_modules', '.store') + let entries + try { + entries = await readdir(storeDir) + } catch { + return + } + + // Collect valid store keys from the isolated ideal tree (location: node_modules/.store/{key}/node_modules/{pkg}) + const validKeys = new Set() + for (const child of this.idealTree.children.values()) { + if (child.isInStore) { + const key = child.location.split(sep)[2] + validKeys.add(key) + } + } + + const orphaned = entries.filter(e => !validKeys.has(e)) + if (!orphaned.length) { + return + } + + log.silly('reify', 'cleaning orphaned store entries', orphaned) + await promiseAllRejectLate( + orphaned.map(e => + rm(resolve(storeDir, e), { recursive: true, force: true }) + .catch(/* istanbul ignore next -- rm with force rarely fails */ + er => log.warn('cleanup', `Failed to remove orphaned store entry ${e}`, er)) + ) + ) + } + + // last but not least, we save the ideal tree metadata to the package-lock + // or shrinkwrap file, and any additions or removals to package.json + async [_saveIdealTree] (options) { + // the ideal tree is actualized now, hooray! + // it still contains all the references to optional nodes that were removed + // for install failures. Those still end up in the shrinkwrap, so we + // save it first, then prune out the optional trash, and then return it. + + const save = !(options.save === false) + + // we check for updates in order to make sure we run save ideal tree + // even though save=false since we want `npm update` to be able to + // write to package-lock files by default + const hasUpdates = this[_updateAll] || this[_updateNames].length + + // we're going to completely skip save ideal tree in case of a global or + // dry-run install and also if the save option is set to false, EXCEPT for + // update since the expected behavior for npm7+ is for update to + // NOT save to package.json, we make that exception since we still want + // saveIdealTree to be able to write the lockfile by default. + const saveIdealTree = !( + (!save && !hasUpdates) + || this.options.global + || this.options.dryRun + ) + + if (!saveIdealTree) { + return false + } + + const timeEnd = time.start('reify:save') + + const updatedTrees = new Set() + const updateNodes = nodes => { + for (const { name, tree: addTree } of nodes) { + // addTree either the root, or a workspace + const edge = addTree.edgesOut.get(name) + const pkg = addTree.package + const req = npa.resolve(name, edge.spec, addTree.realpath) + const { rawSpec, subSpec } = req + + const spec = subSpec ? subSpec.rawSpec : rawSpec + const child = edge.to + + // if we tried to install an optional dep, but it was a version + // that we couldn't resolve, this MAY be missing. if we haven't + // blown up by now, it's because it was not a problem, though, so + // just move on. + if (!child || !addTree.isTop) { + continue + } + + let newSpec + // True if the dependency is getting installed from a local file path + // In this case it is not possible to do the normal version comparisons + // as the new version will be a file path + const isLocalDep = req.type === 'directory' || req.type === 'file' + if (req.registry) { + const version = child.version + const prefixRange = version ? this.options.savePrefix + version : '*' + // if we installed a range, then we save the range specified + // if it is not a subset of the ^x.y.z. eg, installing a range + // of `1.x <1.2.3` will not be saved as `^1.2.0`, because that + // would allow versions outside the requested range. Tags and + // specific versions save with the save-prefix. + const isRange = (subSpec || req).type === 'range' + + let range = spec + if ( + !isRange || + spec === '*' || + subset(prefixRange, spec, { loose: true }) + ) { + range = prefixRange + } + + const pname = child.packageName + const alias = name !== pname + newSpec = alias ? `npm:${pname}@${range}` : range + } else if (req.hosted) { + // save the git+https url if it has auth; otherwise, shortcut + const h = req.hosted + const opt = { noCommittish: false } + if (h.https && h.auth) { + newSpec = `git+${h.https(opt)}` + } else { + newSpec = h.shortcut(opt) + } + } else if (isLocalDep) { + // when finding workspace nodes, make sure that + // we save them using their version instead of + // using their relative path + if (edge.type === 'workspace') { + const { version } = edge.to.target + const prefixRange = version ? this.options.savePrefix + version : '*' + newSpec = prefixRange + } else { + // save the relative path in package.json + // Normally saveSpec is updated with the proper relative + // path already, but it's possible to specify a full absolute + // path initially, in which case we can end up with the wrong + // thing, so just get the ultimate fetchSpec and relativize it. + const p = req.fetchSpec.replace(/^file:/, '') + const rel = relpath(addTree.realpath, p) + newSpec = `file:${rel}` + } + } else { + newSpec = req.saveSpec + } + + if (options.saveType) { + const depType = saveTypeMap.get(options.saveType) + pkg[depType][name] = newSpec + // PackageJson.normalize will have moved it here if it was in both, if it is empty it will be deleted later + if (options.saveType === 'prod' && pkg.optionalDependencies) { + delete pkg.optionalDependencies[name] + } + } else { + if (hasSubKey(pkg, 'dependencies', name)) { + pkg.dependencies[name] = newSpec + } + + if (hasSubKey(pkg, 'devDependencies', name)) { + pkg.devDependencies[name] = newSpec + // don't update peer or optional if we don't have to + if (hasSubKey(pkg, 'peerDependencies', name) && (isLocalDep || !intersects(newSpec, pkg.peerDependencies[name]))) { + pkg.peerDependencies[name] = newSpec + } + + if (hasSubKey(pkg, 'optionalDependencies', name) && (isLocalDep || !intersects(newSpec, pkg.optionalDependencies[name]))) { + pkg.optionalDependencies[name] = newSpec + } + } else { + if (hasSubKey(pkg, 'peerDependencies', name)) { + pkg.peerDependencies[name] = newSpec + } + + if (hasSubKey(pkg, 'optionalDependencies', name)) { + pkg.optionalDependencies[name] = newSpec + } + } + } + + updatedTrees.add(addTree) + } + } + + // Returns true if any of the edges from this node has a semver + // range definition that is an exact match to the version installed + // e.g: should return true if for a given and installed version 1.0.0, + // range is either =1.0.0 or 1.0.0 + const exactVersion = node => { + for (const edge of node.edgesIn) { + try { + if (subset(edge.spec, node.version)) { + return false + } + } catch { + // ignore errors + } + } + return true + } + + // helper that retrieves an array of nodes that were + // potentially updated during the reify process, in order + // to limit the number of nodes to check and update, only + // select nodes from the inventory that are direct deps + // of a given package.json (project root or a workspace) + // and in ase of using a list of `names`, restrict nodes + // to only names that are found in this list + const retrieveUpdatedNodes = names => { + const filterDirectDependencies = node => + !node.isRoot && node.resolveParent && node.resolveParent.isRoot + && (!names || names.includes(node.name)) + && exactVersion(node) // skip update for exact ranges + + const directDeps = this.idealTree.inventory + .filter(filterDirectDependencies) + + // traverses the list of direct dependencies and collect all nodes + // to be updated, since any of them might have changed during reify + const nodes = [] + for (const node of directDeps) { + for (const edgeIn of node.edgesIn) { + nodes.push({ + name: node.name, + tree: edgeIn.from.target, + }) + } + } + return nodes + } + + if (save) { + // when using update all alongside with save, we'll make + // sure to refresh every dependency of the root idealTree + if (this[_updateAll]) { + const nodes = retrieveUpdatedNodes() + updateNodes(nodes) + } else { + // resolvedAdd is the list of user add requests, but with names added + // to things like git repos and tarball file/urls. However, if the + // user requested 'foo@', and we have a foo@file:../foo, then we should + // end up saving the spec we actually used, not whatever they gave us. + if (this[_resolvedAdd].length) { + updateNodes(this[_resolvedAdd]) + } + + // if updating given dependencies by name, restrict the list of + // nodes to check to only those currently in _updateNames + if (this[_updateNames].length) { + const nodes = retrieveUpdatedNodes(this[_updateNames]) + updateNodes(nodes) + } + + // grab any from explicitRequests that had deps removed + for (const { from: tree } of this.explicitRequests) { + updatedTrees.add(tree) + } + } + } + + if (save) { + for (const tree of updatedTrees) { + // refresh the edges so they have the correct specs + tree.package = tree.package + const pkgJson = await PackageJson.load(tree.path, { create: true }) + const { + dependencies = {}, + devDependencies = {}, + optionalDependencies = {}, + peerDependencies = {}, + // bundleDependencies is not required by PackageJson like the other + // fields here PackageJson also doesn't omit an empty array for this + // field so defaulting this to an empty array would add that field to + // every package.json file. + bundleDependencies, + } = tree.package + + pkgJson.update({ + dependencies, + devDependencies, + optionalDependencies, + peerDependencies, + bundleDependencies, + }) + await pkgJson.save() + } + } + + // before now edge specs could be changing, affecting the `requires` field + // in the package lock, so we hold off saving to the very last action + if (this.options.usePackageLock) { + // preserve indentation, if possible + let format = this.idealTree.package[Symbol.for('indent')] + if (format === undefined) { + format = ' ' + } + + // TODO this ignores options.save + await this.idealTree.meta.save({ + format: (this.options.formatPackageLock && format) ? format + : this.options.formatPackageLock, + }) + } + + timeEnd() + return true + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/audit-report.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/audit-report.js new file mode 100644 index 0000000000000000000000000000000000000000..397629178dd9cedacfd1824dfaed92d296cd06ed --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/audit-report.js @@ -0,0 +1,330 @@ +// an object representing the set of vulnerabilities in a tree + +const localeCompare = require('@isaacs/string-locale-compare')('en') +const npa = require('npm-package-arg') +const pickManifest = require('npm-pick-manifest') + +const Vuln = require('./vuln.js') +const Calculator = require('@npmcli/metavuln-calculator') + +const { log, time } = require('proc-log') + +const npmFetch = require('npm-registry-fetch') + +class AuditReport extends Map { + #omit + error = null + topVulns = new Map() + + static load (tree, opts) { + return new AuditReport(tree, opts).run() + } + + get auditReportVersion () { + return 2 + } + + toJSON () { + const obj = { + auditReportVersion: this.auditReportVersion, + vulnerabilities: {}, + metadata: { + vulnerabilities: { + info: 0, + low: 0, + moderate: 0, + high: 0, + critical: 0, + total: this.size, + }, + dependencies: { + prod: 0, + dev: 0, + optional: 0, + peer: 0, + peerOptional: 0, + total: this.tree.inventory.size - 1, + }, + }, + } + + for (const node of this.tree.inventory.values()) { + const { dependencies } = obj.metadata + let prod = true + for (const type of [ + 'dev', + 'optional', + 'peer', + 'peerOptional', + ]) { + if (node[type]) { + dependencies[type]++ + prod = false + } + } + if (prod) { + dependencies.prod++ + } + } + + // if it doesn't have any topVulns, then it's fixable with audit fix + // for each topVuln, figure out if it's fixable with audit fix --force, + // or if we have to just delete the thing, and if the fix --force will + // require a semver major update. + const vulnerabilities = [] + for (const [name, vuln] of this.entries()) { + vulnerabilities.push([name, vuln.toJSON()]) + obj.metadata.vulnerabilities[vuln.severity]++ + } + + obj.vulnerabilities = vulnerabilities + .sort(([a], [b]) => localeCompare(a, b)) + .reduce((set, [name, vuln]) => { + set[name] = vuln + return set + }, {}) + + return obj + } + + constructor (tree, opts = {}) { + super() + this.#omit = new Set(opts.omit || []) + this.calculator = new Calculator(opts) + this.options = opts + this.tree = tree + this.filterSet = opts.filterSet + } + + async run () { + this.report = await this.#getReport() + log.silly('audit report', this.report) + if (this.report) { + await this.#init() + } + return this + } + + isVulnerable (node) { + const vuln = this.get(node.packageName) + return !!(vuln && vuln.isVulnerable(node)) + } + + async #init () { + const timeEnd = time.start('auditReport:init') + + const promises = [] + for (const [name, advisories] of Object.entries(this.report)) { + for (const advisory of advisories) { + promises.push(this.calculator.calculate(name, advisory)) + } + } + + // now the advisories are calculated with a set of versions + // and the packument. turn them into our style of vuln objects + // which also have the affected nodes, and also create entries + // for all the metavulns that we find from dependents. + const advisories = new Set(await Promise.all(promises)) + const seen = new Set() + for (const advisory of advisories) { + const { name, range } = advisory + const k = `${name}@${range}` + + const vuln = this.get(name) || new Vuln({ name, advisory }) + if (this.has(name)) { + vuln.addAdvisory(advisory) + } + super.set(name, vuln) + + // don't flag the exact same name/range more than once + // adding multiple advisories with the same range is fine, but no + // need to search for nodes we already would have added. + if (!seen.has(k)) { + const p = [] + for (const node of this.tree.inventory.query('packageName', name)) { + if (!this.shouldAudit(node)) { + continue + } + + // if not vulnerable by this advisory, keep searching + if (!advisory.testVersion(node.version)) { + continue + } + + // we will have loaded the source already if this is a metavuln + if (advisory.type === 'metavuln') { + vuln.addVia(this.get(advisory.dependency)) + } + + // already marked this one, no need to do it again + if (vuln.nodes.has(node)) { + continue + } + + // haven't marked this one yet. get its dependents. + vuln.nodes.add(node) + for (const { from: dep, spec } of node.edgesIn) { + if (dep.isTop && !vuln.topNodes.has(dep)) { + vuln.fixAvailable = this.#fixAvailable(vuln, spec) + if (vuln.fixAvailable !== true) { + // now we know the top node is vulnerable, and cannot be + // upgraded out of the bad place without --force. But, there's + // no need to add it to the actual vulns list, because nothing + // depends on root. + this.topVulns.set(vuln.name, vuln) + vuln.topNodes.add(dep) + } + } else { + // calculate a metavuln, if necessary + const calc = this.calculator.calculate(dep.packageName, advisory) + // eslint-disable-next-line promise/always-return + p.push(calc.then(meta => { + // eslint-disable-next-line promise/always-return + if (meta.testVersion(dep.version, spec)) { + advisories.add(meta) + } + })) + } + } + } + await Promise.all(p) + seen.add(k) + } + + // make sure we actually got something. if not, remove it + // this can happen if you are loading from a lockfile created by + // npm v5, since it lists the current version of all deps, + // rather than the range that is actually depended upon, + // or if using --omit with the older audit endpoint. + if (this.get(name).nodes.size === 0) { + this.delete(name) + continue + } + + // if the vuln is valid, but THIS advisory doesn't apply to any of + // the nodes it references, then remove it from the advisory list. + // happens when using omit with old audit endpoint. + for (const advisory of vuln.advisories) { + const relevant = [...vuln.nodes] + .some(n => advisory.testVersion(n.version)) + if (!relevant) { + vuln.deleteAdvisory(advisory) + } + } + } + + timeEnd() + } + + // given the spec, see if there is a fix available at all, and note whether or not it's a semver major fix or not (i.e. will need --force) + #fixAvailable (vuln, spec) { + // TODO we return true, false, OR an object here. this is probably a bad pattern. + if (!vuln.testSpec(spec)) { + return true + } + + // even if we HAVE a packument, if we're looking for it somewhere other than the registry and we have something vulnerable then we're stuck with it. + const specObj = npa(spec) + if (!specObj.registry) { + return false + } + + if (specObj.subSpec) { + spec = specObj.subSpec.rawSpec + } + + // we don't provide fixes for top nodes other than root, but we still check to see if the node is fixable with a different version, and note if that is a semver major bump. + try { + const { + _isSemVerMajor: isSemVerMajor, + version, + name, + } = pickManifest(vuln.packument, spec, { + ...this.options, + before: null, + avoid: vuln.range, + avoidStrict: true, + }) + return { name, version, isSemVerMajor } + } catch (er) { + return false + } + } + + set () { + throw new Error('do not call AuditReport.set() directly') + } + + async #getReport () { + // if we're not auditing, just return false + if (this.options.audit === false || this.options.offline === true || this.tree.inventory.size === 1) { + return null + } + + const timeEnd = time.start('auditReport:getReport') + try { + const body = this.prepareBulkData() + log.silly('audit', 'bulk request', body) + + // no sense asking if we don't have anything to audit, + // we know it'll be empty + if (!Object.keys(body).length) { + return null + } + + const res = await npmFetch('/-/npm/v1/security/advisories/bulk', { + ...this.options, + registry: this.options.auditRegistry || this.options.registry, + method: 'POST', + gzip: true, + body, + }) + + return await res.json() + } catch (er) { + log.verbose('audit error', er) + log.silly('audit error', String(er.body)) + this.error = er + return null + } finally { + timeEnd() + } + } + + // return true if we should audit this one + shouldAudit (node) { + if ( + !node.version || + node.isRoot || + node.isLink || + node.linksIn?.size > 0 || + (this.filterSet && this.filterSet?.size !== 0 && !this.filterSet?.has(node)) + ) { + return false + } + if (this.#omit.size === 0) { + return true + } + return !node.shouldOmit(this.#omit) + } + + prepareBulkData () { + const payload = {} + for (const name of this.tree.inventory.query('packageName')) { + const set = new Set() + for (const node of this.tree.inventory.query('packageName', name)) { + if (!this.shouldAudit(node)) { + continue + } + + set.add(node.version) + } + if (set.size) { + payload[name] = [...set] + } + } + return payload + } +} + +module.exports = AuditReport diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/calc-dep-flags.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/calc-dep-flags.js new file mode 100644 index 0000000000000000000000000000000000000000..37b5d3c6f5decae976794a8fd6b32255482d25ea --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/calc-dep-flags.js @@ -0,0 +1,103 @@ +// Dep flag (dev, peer, etc.) calculation requires default or reset flags. +// Flags are true by default and are unset to false as we walk deps. +// We iterate outward edges looking for dep flags that can +// be unset based on the current nodes flags and edge type. +// Examples: +// - a non-optional node with a non-optional edge out, the edge node should not be optional +// - a non-peer node with a non-peer edge out, the edge node should not be peer +// If a node is changed, we add to the queue and continue until no more changes. +// Flags that remain after all this unsetting should be valid. +// Examples: +// - a node still flagged optional must only be reachable via optional edges +// - a node still flagged peer must only be reachable via peer edges +const calcDepFlags = (tree, resetRoot = true) => { + if (resetRoot) { + tree.unsetDepFlags() + } + + const seen = new Set() + const queue = [tree] + + let node + while (node = queue.pop()) { + seen.add(node) + + // Unset extraneous from all parents to avoid removal of children. + if (!node.extraneous) { + for (let n = node.resolveParent; n?.extraneous; n = n.resolveParent) { + n.extraneous = false + } + } + + // for links, map their hierarchy appropriately + if (node.isLink) { + // node.target can be null, we check to ensure it's not null before proceeding + if (node.target == null) { + continue + } + node.target.dev = node.dev + node.target.optional = node.optional + node.target.devOptional = node.devOptional + node.target.peer = node.peer + node.target.extraneous = node.extraneous + queue.push(node.target) + continue + } + + for (const { peer, optional, dev, to } of node.edgesOut.values()) { + // if the dep is missing, then its flags are already maximally unset + if (!to) { + continue + } + + let changed = false + + // only optional peer dependencies should stay extraneous + if (to.extraneous && !node.extraneous && !(peer && optional)) { + to.extraneous = false + changed = true + } + + if (to.dev && !node.dev && !dev) { + to.dev = false + changed = true + } + + if (to.optional && !node.optional && !optional) { + to.optional = false + changed = true + } + + // devOptional is the *overlap* of the dev and optional tree. + // A node may be depended on by separate dev and optional nodes. + // It SHOULD NOT be removed when pruning dev OR optional. + // It SHOULD be removed when pruning dev AND optional. + // We only unset here if a node is not dev AND not optional because + // if we did unset, it would prevent any overlap deeper in the tree. + // We correct this later by removing if dev OR optional is set. + if (to.devOptional && !node.devOptional && !node.dev && !node.optional && !dev && !optional) { + to.devOptional = false + changed = true + } + + if (to.peer && !node.peer && !peer) { + to.peer = false + changed = true + } + + if (changed) { + queue.push(to) + } + } + } + + // Remove incorrect devOptional flags now that we have walked all deps. + seen.delete(tree) + for (const node of seen.values()) { + if (node.devOptional && (node.dev || node.optional)) { + node.devOptional = false + } + } +} + +module.exports = calcDepFlags diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/can-place-dep.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/can-place-dep.js new file mode 100644 index 0000000000000000000000000000000000000000..aac98642406b1a0bd3761fe030d2e7ff0d4b1e60 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/can-place-dep.js @@ -0,0 +1,436 @@ +// Internal methods used by buildIdealTree. +// Answer the question: "can I put this dep here?" +// +// IMPORTANT: *nothing* in this class should *ever* modify or mutate the tree +// at all. The contract here is strictly limited to read operations. We call +// this in the process of walking through the ideal tree checking many +// different potential placement targets for a given node. If a change is made +// to the tree along the way, that can cause serious problems! +// +// In order to enforce this restriction, in debug mode, canPlaceDep() will +// snapshot the tree at the start of the process, and then at the end, will +// verify that it still matches the snapshot, and throw an error if any changes +// occurred. +// +// The algorithm is roughly like this: +// - check the node itself: +// - if there is no version present, and no conflicting edges from target, +// OK, provided all peers can be placed at or above the target. +// - if the current version matches, KEEP +// - if there is an older version present, which can be replaced, then +// - if satisfying and preferDedupe? KEEP +// - else: REPLACE +// - if there is a newer version present, and preferDedupe, REPLACE +// - if the version present satisfies the edge, KEEP +// - else: CONFLICT +// - if the node is not in conflict, check each of its peers: +// - if the peer can be placed in the target, continue +// - else if the peer can be placed in a parent, and there is no other +// conflicting version shadowing it, continue +// - else CONFLICT +// - If the peers are not in conflict, return the original node's value +// +// An exception to this logic is that if the target is the deepest location +// that a node can be placed, and the conflicting node can be placed deeper, +// then we will return REPLACE rather than CONFLICT, and Arborist will queue +// the replaced node for resolution elsewhere. + +const localeCompare = require('@isaacs/string-locale-compare')('en') +const semver = require('semver') +const debug = require('./debug.js') +const peerEntrySets = require('./peer-entry-sets.js') +const deepestNestingTarget = require('./deepest-nesting-target.js') + +const CONFLICT = Symbol('CONFLICT') +const OK = Symbol('OK') +const REPLACE = Symbol('REPLACE') +const KEEP = Symbol('KEEP') + +class CanPlaceDep { + // dep is a dep that we're trying to place. it should already live in + // a virtual tree where its peer set is loaded as children of the root. + // target is the actual place where we're trying to place this dep + // in a node_modules folder. + // edge is the edge that we're trying to satisfy with this placement. + // parent is the CanPlaceDep object of the entry node when placing a peer. + constructor (options) { + const { + dep, + target, + edge, + preferDedupe, + parent = null, + peerPath = [], + explicitRequest = false, + } = options + + debug(() => { + if (!dep) { + throw new Error('no dep provided to CanPlaceDep') + } + + if (!target) { + throw new Error('no target provided to CanPlaceDep') + } + + if (!edge) { + throw new Error('no edge provided to CanPlaceDep') + } + + this._treeSnapshot = JSON.stringify([...target.root.inventory.entries()] + .map(([loc, { packageName, version, resolved }]) => { + return [loc, packageName, version, resolved] + }).sort(([a], [b]) => localeCompare(a, b))) + }) + + // the result of whether we can place it or not + this.canPlace = null + // if peers conflict, but this one doesn't, then that is useful info + this.canPlaceSelf = null + + this.dep = dep + this.target = target + this.edge = edge + this.explicitRequest = explicitRequest + + // preventing cycles when we check peer sets + this.peerPath = peerPath + // we always prefer to dedupe peers, because they are trying + // a bit harder to be singletons. + this.preferDedupe = !!preferDedupe || edge.peer + this.parent = parent + this.children = [] + + this.isSource = target === this.peerSetSource + this.name = edge.name + this.current = target.children.get(this.name) + this.targetEdge = target.edgesOut.get(this.name) + this.conflicts = new Map() + + // check if this dep was already subject to a peerDep override while + // building the peerSet. + this.edgeOverride = !dep.satisfies(edge) + + this.canPlace = this.checkCanPlace() + if (!this.canPlaceSelf) { + this.canPlaceSelf = this.canPlace + } + + debug(() => { + const treeSnapshot = JSON.stringify([...target.root.inventory.entries()] + .map(([loc, { packageName, version, resolved }]) => { + return [loc, packageName, version, resolved] + }).sort(([a], [b]) => localeCompare(a, b))) + /* istanbul ignore if */ + if (this._treeSnapshot !== treeSnapshot) { + throw Object.assign(new Error('tree changed in CanPlaceDep'), { + expect: this._treeSnapshot, + actual: treeSnapshot, + }) + } + }) + } + + checkCanPlace () { + const { target, targetEdge, current, dep } = this + + // if the dep failed to load, we're going to fail the build or + // prune it out anyway, so just move forward placing/replacing it. + if (dep.errors.length) { + return current ? REPLACE : OK + } + + // cannot place peers inside their dependents, except for tops + if (targetEdge && targetEdge.peer && !target.isTop) { + return CONFLICT + } + + // skip this test if there's a current node, because we might be able + // to dedupe against it anyway + if (!current && + targetEdge && + !dep.satisfies(targetEdge) && + targetEdge !== this.edge) { + return CONFLICT + } + + return current ? this.checkCanPlaceCurrent() : this.checkCanPlaceNoCurrent() + } + + // we know that the target has a dep by this name in its node_modules + // already. Can return KEEP, REPLACE, or CONFLICT. + checkCanPlaceCurrent () { + const { preferDedupe, explicitRequest, current, target, edge, dep } = this + + if (dep.matches(current)) { + if (current.satisfies(edge) || this.edgeOverride) { + return explicitRequest ? REPLACE : KEEP + } + } + + const { version: curVer } = current + const { version: newVer } = dep + const tryReplace = curVer && newVer && semver.gte(newVer, curVer) + if (tryReplace && dep.canReplace(current)) { + // It's extremely rare that a replaceable node would be a conflict, if + // the current one wasn't a conflict, but it is theoretically possible + // if peer deps are pinned. In that case we treat it like any other + // conflict, and keep trying. + const cpp = this.canPlacePeers(REPLACE) + if (cpp !== CONFLICT) { + return cpp + } + } + + // ok, can't replace the current with new one, but maybe current is ok? + if (current.satisfies(edge) && (!explicitRequest || preferDedupe)) { + return KEEP + } + + // if we prefer deduping, then try replacing newer with older + if (preferDedupe && !tryReplace && dep.canReplace(current)) { + const cpp = this.canPlacePeers(REPLACE) + if (cpp !== CONFLICT) { + return cpp + } + } + + // Check for interesting cases! + // First, is this the deepest place that this thing can go, and NOT the + // deepest place where the conflicting dep can go? If so, replace it, + // and let it re-resolve deeper in the tree. + const myDeepest = this.deepestNestingTarget + + // ok, i COULD be placed deeper, so leave the current one alone. + if (target !== myDeepest) { + return CONFLICT + } + + // if we are not checking a peerDep, then we MUST place it here, in the + // target that has a non-peer dep on it. + if (!edge.peer && target === edge.from) { + return this.canPlacePeers(REPLACE) + } + + // if we aren't placing a peer in a set, then we're done here. + // This is ignored because it SHOULD be redundant, as far as I can tell, + // with the deepest target and target===edge.from tests. But until we + // can prove that isn't possible, this condition is here for safety. + /* istanbul ignore if - allegedly impossible */ + if (!this.parent && !edge.peer) { + return CONFLICT + } + + // check the deps in the peer group for each edge into that peer group + // if ALL of them can be pushed deeper, or if it's ok to replace its + // members with the contents of the new peer group, then we're good. + let canReplace = true + for (const [entryEdge, currentPeers] of peerEntrySets(current)) { + if (entryEdge === this.edge || entryEdge === this.peerEntryEdge) { + continue + } + + // First, see if it's ok to just replace the peerSet entirely. + // we do this by walking out from the entryEdge, because in a case like + // this: + // + // v -> PEER(a@1||2) + // a@1 -> PEER(b@1) + // a@2 -> PEER(b@2) + // b@1 -> PEER(a@1) + // b@2 -> PEER(a@2) + // + // root + // +-- v + // +-- a@2 + // +-- b@2 + // + // Trying to place a peer group of (a@1, b@1) would fail to note that + // they can be replaced, if we did it by looping 1 by 1. If we are + // replacing something, we don't have to check its peer deps, because + // the peerDeps in the placed peerSet will presumably satisfy. + const entryNode = entryEdge.to + const entryRep = dep.parent.children.get(entryNode.name) + if (entryRep) { + if (entryRep.canReplace(entryNode, dep.parent.children.keys())) { + continue + } + } + + let canClobber = !entryRep + if (!entryRep) { + const peerReplacementWalk = new Set([entryNode]) + OUTER: for (const currentPeer of peerReplacementWalk) { + for (const edge of currentPeer.edgesOut.values()) { + if (!edge.peer || !edge.valid) { + continue + } + const rep = dep.parent.children.get(edge.name) + if (!rep) { + if (edge.to) { + peerReplacementWalk.add(edge.to) + } + continue + } + if (!rep.satisfies(edge)) { + canClobber = false + break OUTER + } + } + } + } + if (canClobber) { + continue + } + + // ok, we can't replace, but maybe we can nest the current set deeper? + let canNestCurrent = true + for (const currentPeer of currentPeers) { + if (!canNestCurrent) { + break + } + + // still possible to nest this peerSet + const curDeep = deepestNestingTarget(entryEdge.from, currentPeer.name) + if (curDeep === target || target.isDescendantOf(curDeep)) { + canNestCurrent = false + canReplace = false + } + if (canNestCurrent) { + continue + } + } + } + + // if we can nest or replace all the current peer groups, we can replace. + if (canReplace) { + return this.canPlacePeers(REPLACE) + } + + return CONFLICT + } + + checkCanPlaceNoCurrent () { + const { target, peerEntryEdge, dep, name } = this + + // check to see what that name resolves to here, and who may depend on + // being able to reach it by crawling up past the parent. we know + // that it's not the target's direct child node, and if it was a direct + // dep of the target, we would have conflicted earlier. + const current = target !== peerEntryEdge.from && target.resolve(name) + if (current) { + for (const edge of current.edgesIn.values()) { + if (edge.from.isDescendantOf(target) && edge.valid) { + if (!dep.satisfies(edge)) { + return CONFLICT + } + } + } + } + + // no objections, so this is fine as long as peers are ok here. + return this.canPlacePeers(OK) + } + + get deepestNestingTarget () { + const start = this.parent ? this.parent.deepestNestingTarget + : this.edge.from + return deepestNestingTarget(start, this.name) + } + + get conflictChildren () { + return this.allChildren.filter(c => c.canPlace === CONFLICT) + } + + get allChildren () { + const set = new Set(this.children) + for (const child of set) { + for (const grandchild of child.children) { + set.add(grandchild) + } + } + return [...set] + } + + get top () { + return this.parent ? this.parent.top : this + } + + // check if peers can go here. returns state or CONFLICT + canPlacePeers (state) { + this.canPlaceSelf = state + if (this._canPlacePeers) { + return this._canPlacePeers + } + + // TODO: represent peerPath in ERESOLVE error somehow? + const peerPath = [...this.peerPath, this.dep] + let sawConflict = false + for (const peerEdge of this.dep.edgesOut.values()) { + if (!peerEdge.peer || !peerEdge.to || peerPath.includes(peerEdge.to)) { + continue + } + const peer = peerEdge.to + // it may be the case that the *initial* dep can be nested, but a peer + // of that dep needs to be placed shallower, because the target has + // a peer dep on the peer as well. + const target = deepestNestingTarget(this.target, peer.name) + const cpp = new CanPlaceDep({ + dep: peer, + target, + parent: this, + edge: peerEdge, + peerPath, + // always place peers in preferDedupe mode + preferDedupe: true, + }) + /* istanbul ignore next */ + debug(() => { + if (this.children.some(c => c.dep === cpp.dep)) { + throw new Error('checking same dep repeatedly') + } + }) + this.children.push(cpp) + + if (cpp.canPlace === CONFLICT) { + sawConflict = true + } + } + + this._canPlacePeers = sawConflict ? CONFLICT : state + return this._canPlacePeers + } + + // what is the node that is causing this peerSet to be placed? + get peerSetSource () { + return this.parent ? this.parent.peerSetSource : this.edge.from + } + + get peerEntryEdge () { + return this.top.edge + } + + static get CONFLICT () { + return CONFLICT + } + + static get OK () { + return OK + } + + static get REPLACE () { + return REPLACE + } + + static get KEEP () { + return KEEP + } + + get description () { + const { canPlace } = this + return canPlace && canPlace.description || + /* istanbul ignore next - old node affordance */ canPlace + } +} + +module.exports = CanPlaceDep diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/case-insensitive-map.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/case-insensitive-map.js new file mode 100644 index 0000000000000000000000000000000000000000..ca235857f746d7fbea8562ba299d134718fe0ded --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/case-insensitive-map.js @@ -0,0 +1,50 @@ +// package children are represented with a Map object, but many file systems +// are case-insensitive and unicode-normalizing, so we need to treat +// node.children.get('FOO') and node.children.get('foo') as the same thing. + +module.exports = class CIMap extends Map { + #keys = new Map() + + constructor (items = []) { + super() + for (const [key, val] of items) { + this.set(key, val) + } + } + + #normKey (key) { + if (typeof key !== 'string') { + return key + } + return key.normalize('NFKD').toLowerCase() + } + + get (key) { + const normKey = this.#normKey(key) + return this.#keys.has(normKey) ? super.get(this.#keys.get(normKey)) + : undefined + } + + set (key, val) { + const normKey = this.#normKey(key) + if (this.#keys.has(normKey)) { + super.delete(this.#keys.get(normKey)) + } + this.#keys.set(normKey, key) + return super.set(key, val) + } + + delete (key) { + const normKey = this.#normKey(key) + if (this.#keys.has(normKey)) { + const prevKey = this.#keys.get(normKey) + this.#keys.delete(normKey) + return super.delete(prevKey) + } + } + + has (key) { + const normKey = this.#normKey(key) + return this.#keys.has(normKey) && super.has(this.#keys.get(normKey)) + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/consistent-resolve.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/consistent-resolve.js new file mode 100644 index 0000000000000000000000000000000000000000..7b73a42bb71a7fd932f4deae8a7dd18674f0c892 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/consistent-resolve.js @@ -0,0 +1,44 @@ +// take a path and a resolved value, and turn it into a resolution from +// the given new path. This is used with converting a package.json's +// relative file: path into one suitable for a lockfile, or between +// lockfiles, and for converting hosted git repos to a consistent url type. +const npa = require('npm-package-arg') +const relpath = require('./relpath.js') +const consistentResolve = (resolved, fromPath, toPath, relPaths = false) => { + if (!resolved) { + return null + } + + try { + const hostedOpt = { noCommittish: false } + const { + fetchSpec, + saveSpec, + type, + hosted, + rawSpec, + raw, + } = npa(resolved, fromPath) + if (type === 'file' || type === 'directory') { + if (relPaths && toPath) { + return `file:${relpath(toPath, fetchSpec)}` + } + return `file:${fetchSpec}` + } + if (hosted) { + return `git+${hosted.auth ? hosted.https(hostedOpt) : hosted.sshurl(hostedOpt)}` + } + if (type === 'git') { + return saveSpec + } + if (rawSpec === '*') { + return raw + } + return rawSpec + } catch (_) { + // whatever we passed in was not acceptable to npa. + // leave it 100% untouched. + return resolved + } +} +module.exports = consistentResolve diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/debug.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/debug.js new file mode 100644 index 0000000000000000000000000000000000000000..7283076f7c3ccaf147617394461d5b6638ba4ea9 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/debug.js @@ -0,0 +1,32 @@ +// certain assertions we should do only when testing arborist itself, because +// they are too expensive or aggressive and would break user programs if we +// miss a situation where they are actually valid. +// +// call like this: +// +// /* istanbul ignore next - debug check */ +// debug(() => { +// if (someExpensiveCheck) +// throw new Error('expensive check should have returned false') +// }) + +// run in debug mode if explicitly requested, running arborist tests, +// or working in the arborist project directory. + +const debug = process.env.ARBORIST_DEBUG !== '0' && ( + process.env.ARBORIST_DEBUG === '1' || + /\barborist\b/.test(process.env.NODE_DEBUG || '') || + process.env.npm_package_name === '@npmcli/arborist' && + ['test', 'snap'].includes(process.env.npm_lifecycle_event) || + process.cwd() === require('node:path').resolve(__dirname, '..') +) + +module.exports = debug ? fn => fn() : () => {} +const red = process.stderr.isTTY ? msg => `\x1B[31m${msg}\x1B[39m` : m => m +module.exports.log = (...msg) => module.exports(() => { + const { format } = require('node:util') + const prefix = `\n${process.pid} ${red(format(msg.shift()))} ` + msg = (prefix + format(...msg).trim().split('\n').join(prefix)).trim() + /* eslint-disable-next-line no-console */ + console.error(msg) +}) diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/deepest-nesting-target.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/deepest-nesting-target.js new file mode 100644 index 0000000000000000000000000000000000000000..fb5f6b9497ee29671a30cb73a051e899439aa027 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/deepest-nesting-target.js @@ -0,0 +1,18 @@ +// given a starting node, what is the *deepest* target where name could go? +// This is not on the Node class for the simple reason that we sometimes +// need to check the deepest *potential* target for a Node that is not yet +// added to the tree where we are checking. +const deepestNestingTarget = (start, name) => { + for (const target of start.ancestry()) { + // note: this will skip past the first target if edge is peer + if (target.isProjectRoot || !target.resolveParent || target.globalTop) { + return target + } + const targetEdge = target.edgesOut.get(name) + if (!targetEdge || !targetEdge.peer) { + return target + } + } +} + +module.exports = deepestNestingTarget diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/dep-valid.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/dep-valid.js new file mode 100644 index 0000000000000000000000000000000000000000..dd903c679c2c61b33912a31d0ef642e2c5a27f87 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/dep-valid.js @@ -0,0 +1,150 @@ +// Do not rely on package._fields, so that we don't throw +// false failures if a tree is generated by other clients. +// Only relies on child.resolved, which MAY come from +// client-specific package.json meta _fields, but most of +// the time will be pulled out of a lockfile + +const semver = require('semver') +const npa = require('npm-package-arg') +const { relative } = require('node:path') +const fromPath = require('./from-path.js') + +const depValid = (child, requested, requestor) => { + // NB: we don't do much to verify 'tag' type requests. + // Just verify that we got a remote resolution. Presumably, it + // came from a registry and was tagged at some point. + + if (typeof requested === 'string') { + try { + // tarball/dir must have resolved to the same tgz on disk, but for + // file: deps that depend on other files/dirs, we must resolve the + // location based on the *requestor* file/dir, not where it ends up. + // '' is equivalent to '*' + requested = npa.resolve(child.name, requested || '*', fromPath(requestor, requestor.edgesOut.get(child.name))) + } catch (er) { + // Not invalid because the child doesn't match, but because + // the spec itself is not supported. Nothing would match, + // so the edge is definitely not valid and never can be. + er.dependency = child.name + er.requested = requested + requestor.errors.push(er) + return false + } + } + + // if the lockfile is super old, or hand-modified, + // then it's possible to hit this state. + if (!requested) { + const er = new Error('Invalid dependency specifier') + er.dependency = child.name + er.requested = requested + requestor.errors.push(er) + return false + } + + switch (requested.type) { + case 'range': + if (requested.fetchSpec === '*') { + return true + } + // fallthrough + case 'version': + // if it's a version or a range other than '*', semver it + return semver.satisfies(child.version, requested.fetchSpec, true) + + case 'directory': + return linkValid(child, requested, requestor) + + case 'file': + return tarballValid(child, requested, requestor) + + case 'alias': + // check that the alias target is valid + return depValid(child, requested.subSpec, requestor) + + case 'tag': + // if it's a tag, we just verify that it has a tarball resolution + // presumably, it came from the registry and was tagged at some point + return child.resolved && npa(child.resolved).type === 'remote' + + case 'remote': + // verify that we got it from the desired location + return child.resolved === requested.fetchSpec + + case 'git': { + // if it's a git type, verify that they're the same repo + // + // if it specifies a definite commit, then it must have the + // same commit to be considered the same repo + // + // if it has a #semver: specifier, verify that the + // version in the package is in the semver range + const resRepo = npa(child.resolved || '') + const resHost = resRepo.hosted + const reqHost = requested.hosted + const reqCommit = /^[a-fA-F0-9]{40,64}$/.test(requested.gitCommittish || '') + const nc = { noCommittish: !reqCommit } + if (!resHost) { + if (resRepo.fetchSpec !== requested.fetchSpec) { + return false + } + } else { + if (reqHost?.ssh(nc) !== resHost.ssh(nc)) { + return false + } + } + if (!requested.gitRange) { + return true + } + return semver.satisfies(child.package.version, requested.gitRange, { + loose: true, + }) + } + + default: // impossible, just being cautious + break + } + + const er = new Error('Unsupported dependency type') + er.dependency = child.name + er.requested = requested + requestor.errors.push(er) + return false +} + +const linkValid = (child, requested, requestor) => { + const isLink = !!child.isLink + // if we're installing links and the node is a link, then it's invalid because we want + // a real node to be there. Except for workspaces. They are always links. + if (requestor.installLinks && !child.isWorkspace) { + return !isLink + } + + // directory must be a link to the specified folder + return isLink && relative(child.realpath, requested.fetchSpec) === '' +} + +const tarballValid = (child, requested) => { + if (child.isLink) { + return false + } + + if (child.resolved) { + return child.resolved.replace(/\\/g, '/') === `file:${requested.fetchSpec.replace(/\\/g, '/')}` + } + + // if we have a legacy mutated package.json file. we can't be 100% + // sure that it resolved to the same file, but if it was the same + // request, that's a pretty good indicator of sameness. + if (child.package._requested) { + return child.package._requested.saveSpec === requested.saveSpec + } + + // ok, we're probably dealing with some legacy cruft here, not much + // we can do at this point unfortunately. + return false +} + +module.exports = (child, requested, accept, requestor) => + depValid(child, requested, requestor) || + (typeof accept === 'string' ? depValid(child, accept, requestor) : false) diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/diff.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/diff.js new file mode 100644 index 0000000000000000000000000000000000000000..5f705d18eaab80898f75a1bea22959ced7b52be1 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/diff.js @@ -0,0 +1,330 @@ +// a tree representing the difference between two trees +// A Diff node's parent is not necessarily the parent of +// the node location it refers to, but rather the highest level +// node that needs to be either changed or removed. +// Thus, the root Diff node is the shallowest change required +// for a given branch of the tree being mutated. + +const { depth } = require('treeverse') +const { existsSync } = require('node:fs') + +const ssri = require('ssri') + +class Diff { + constructor ({ actual, ideal, filterSet, shrinkwrapInflated, omit }) { + this.omit = omit + this.filterSet = filterSet + this.shrinkwrapInflated = shrinkwrapInflated + this.children = [] + this.actual = actual + this.ideal = ideal + if (this.ideal) { + this.resolved = this.ideal.resolved + this.integrity = this.ideal.integrity + } + this.action = getAction(this) + this.parent = null + // the set of leaf nodes that we rake up to the top level + this.leaves = [] + // the set of nodes that don't change in this branch of the tree + this.unchanged = [] + // the set of nodes that will be removed in this branch of the tree + this.removed = [] + } + + static calculate ({ + actual, + ideal, + filterNodes = [], + shrinkwrapInflated = new Set(), + omit = new Set(), + }) { + // if there's a filterNode, then: + // - get the path from the root to the filterNode. The root or + // root.target should have an edge either to the filterNode or + // a link to the filterNode. If not, abort. Add the path to the + // filterSet. + // - Add set of Nodes depended on by the filterNode to filterSet. + // - Anything outside of that set should be ignored by getChildren + const filterSet = new Set() + const extraneous = new Set() + for (const filterNode of filterNodes) { + const { root } = filterNode + if (root !== ideal && root !== actual) { + throw new Error('invalid filterNode: outside idealTree/actualTree') + } + const rootTarget = root.target + const edge = [...rootTarget.edgesOut.values()].filter(e => { + return e.to && (e.to === filterNode || e.to.target === filterNode) + })[0] + filterSet.add(root) + filterSet.add(rootTarget) + filterSet.add(ideal) + filterSet.add(actual) + if (edge && edge.to) { + filterSet.add(edge.to) + filterSet.add(edge.to.target) + } + filterSet.add(filterNode) + + depth({ + tree: filterNode, + visit: node => filterSet.add(node), + getChildren: node => { + const orig = node + node = node.target + const loc = node.location + const idealNode = ideal.inventory.get(loc) + const ideals = !idealNode ? [] + : [...idealNode.edgesOut.values()].filter(e => e.to).map(e => e.to) + const actualNode = actual.inventory.get(loc) + const actuals = !actualNode ? [] + : [...actualNode.edgesOut.values()].filter(e => e.to).map(e => e.to) + if (actualNode) { + for (const child of actualNode.children.values()) { + if (child.extraneous) { + extraneous.add(child) + } + } + } + + const result = ideals.concat(actuals) + // Include link targets so store entries end up in filterSet + if (orig.isLink) { + result.push(node) + } + return result + }, + }) + } + for (const extra of extraneous) { + filterSet.add(extra) + } + + return depth({ + tree: new Diff({ actual, ideal, filterSet, shrinkwrapInflated, omit }), + getChildren, + leave, + }) + } +} + +const getAction = ({ actual, ideal }) => { + if (!ideal) { + return 'REMOVE' + } + + // bundled meta-deps are copied over to the ideal tree when we visit it, + // so they'll appear to be missing here. There's no need to handle them + // in the diff, though, because they'll be replaced at reify time anyway + // Otherwise, add the missing node. + if (!actual) { + return ideal.inDepBundle ? null : 'ADD' + } + + // always ignore the root node + if (ideal.isRoot && actual.isRoot) { + return null + } + + // if the versions don't match, it's a change no matter what + if (ideal.version !== actual.version) { + return 'CHANGE' + } + + const binsExist = ideal.binPaths.every((path) => existsSync(path)) + + // top nodes, links, and git deps won't have integrity, but do have resolved + // if neither node has integrity, the bins exist, and either (a) neither + // node has a resolved value or (b) they both do and match, then we can + // leave this one alone since we already know the versions match due to + // the condition above. The "neither has resolved" case (a) cannot be + // treated as a 'mark CHANGE and refetch', because shrinkwraps, bundles, + // and link deps may lack this information, and we don't want to try to + // go to the registry for something that isn't there. + const noIntegrity = !ideal.integrity && !actual.integrity + const noResolved = !ideal.resolved && !actual.resolved + const resolvedMatch = ideal.resolved && ideal.resolved === actual.resolved + if (noIntegrity && binsExist && (resolvedMatch || noResolved)) { + return null + } + + // otherwise, verify that it's the same bits + // note that if ideal has integrity, and resolved doesn't, we treat + // that as a 'change', so that it gets re-fetched and locked down. + const integrityMismatch = !ideal.integrity || !actual.integrity || + !ssri.parse(ideal.integrity).match(actual.integrity) + if (integrityMismatch || !binsExist) { + return 'CHANGE' + } + + return null +} + +const allChildren = node => { + if (!node) { + return new Map() + } + + // if the node is root, and also a link, then what we really + // want is to traverse the target's children + if (node.isRoot && node.isLink) { + return allChildren(node.target) + } + + const kids = new Map() + for (const n of [node, ...node.fsChildren]) { + for (const kid of n.children.values()) { + kids.set(kid.path, kid) + } + } + return kids +} + +// functions for the walk options when we traverse the trees +// to create the diff tree +const getChildren = diff => { + const children = [] + const { + actual, + ideal, + unchanged, + removed, + filterSet, + shrinkwrapInflated, + omit, + } = diff + + // Note: we DON'T diff fsChildren themselves, because they are either + // included in the package contents, or part of some other project, and + // will never appear in legacy shrinkwraps anyway. but we _do_ include the + // child nodes of fsChildren, because those are nodes that we are typically + // responsible for installing. + const actualKids = allChildren(actual) + const idealKids = allChildren(ideal) + + if (ideal && ideal.hasShrinkwrap && !shrinkwrapInflated.has(ideal)) { + // Guaranteed to get a diff.leaves here, because we always + // be called with a proper Diff object when ideal has a shrinkwrap + // that has not been inflated. + diff.leaves.push(diff) + return children + } + + const paths = new Set([...actualKids.keys(), ...idealKids.keys()]) + for (const path of paths) { + const actual = actualKids.get(path) + const ideal = idealKids.get(path) + diffNode({ + actual, + ideal, + children, + unchanged, + removed, + filterSet, + shrinkwrapInflated, + omit, + }) + } + + if (diff.leaves && !children.length) { + diff.leaves.push(diff) + } + + return children +} + +const diffNode = ({ + actual, + ideal, + children, + unchanged, + removed, + filterSet, + shrinkwrapInflated, + omit, +}) => { + if (filterSet.size && !(filterSet.has(ideal) || filterSet.has(actual))) { + return + } + + if (ideal?.shouldOmit?.(omit)) { + ideal.inert = true + } + + // Treat inert nodes as undefined for the purposes of diffing. + if (ideal?.inert) { + ideal = undefined + } + if (!actual && !ideal) { + return + } + + const action = getAction({ actual, ideal }) + + // if it's a match, then get its children + // otherwise, this is the child diff node + if (action || (!shrinkwrapInflated.has(ideal) && ideal.hasShrinkwrap)) { + if (action === 'REMOVE') { + removed.push(actual) + } + children.push(new Diff({ actual, ideal, filterSet, shrinkwrapInflated, omit })) + } else { + unchanged.push(ideal) + // !*! Weird dirty hack warning !*! + // + // Bundled deps aren't loaded in the ideal tree, because we don't know + // what they are going to be without unpacking. Swap them over now if + // the bundling node isn't changing, so we don't prune them later. + // + // It's a little bit dirty to be doing this here, since it means that + // diffing trees can mutate them, but otherwise we have to walk over + // all unchanging bundlers and correct the diff later, so it's more + // efficient to just fix it while we're passing through already. + // + // Note that moving over a bundled dep will break the links to other + // deps under this parent, which may have been transitively bundled. + // Breaking those links means that we'll no longer see the transitive + // dependency, meaning that it won't appear as bundled any longer! + // In order to not end up dropping transitively bundled deps, we have + // to get the list of nodes to move, then move them all at once, rather + // than moving them one at a time in the first loop. + const bd = ideal.package.bundleDependencies + if (actual && bd && bd.length) { + const bundledChildren = [] + for (const node of actual.children.values()) { + if (node.inBundle) { + bundledChildren.push(node) + } + } + for (const node of bundledChildren) { + node.parent = ideal + } + } + children.push(...getChildren({ + actual, + ideal, + unchanged, + removed, + filterSet, + shrinkwrapInflated, + omit, + })) + } +} + +// set the parentage in the leave step so that we aren't attaching +// child nodes only to remove them later. also bubble up the unchanged +// nodes so that we can move them out of staging in the reification step. +const leave = (diff, children) => { + children.forEach(kid => { + kid.parent = diff + diff.leaves.push(...kid.leaves) + diff.unchanged.push(...kid.unchanged) + diff.removed.push(...kid.removed) + }) + diff.children = children + return diff +} + +module.exports = Diff diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/edge.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/edge.js new file mode 100644 index 0000000000000000000000000000000000000000..374fcee4143d09a358624726c4083789a220b5d7 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/edge.js @@ -0,0 +1,364 @@ +// An edge in the dependency graph +// Represents a dependency relationship of some kind + +const util = require('node:util') +const npa = require('npm-package-arg') +const depValid = require('./dep-valid.js') +const OverrideSet = require('./override-set.js') + +class ArboristEdge { + constructor (edge) { + this.name = edge.name + this.spec = edge.spec + this.type = edge.type + + const edgeFrom = edge.from?.location + const edgeTo = edge.to?.location + const override = edge.overrides?.value + + if (edgeFrom != null) { + this.from = edgeFrom + } + if (edgeTo) { + this.to = edgeTo + } + if (edge.error) { + this.error = edge.error + } + if (edge.peerConflicted) { + this.peerConflicted = true + } + if (override) { + this.overridden = override + } + } +} + +class Edge { + #accept + #error + #explanation + #from + #name + #spec + #to + #type + + static types = Object.freeze([ + 'prod', + 'dev', + 'optional', + 'peer', + 'peerOptional', + 'workspace', + ]) + + // XXX where is this used? + static errors = Object.freeze([ + 'DETACHED', + 'MISSING', + 'PEER LOCAL', + 'INVALID', + ]) + + constructor (options) { + const { type, name, spec, accept, from, overrides } = options + + // XXX are all of these error states even possible? + if (typeof spec !== 'string') { + throw new TypeError('must provide string spec') + } + if (!Edge.types.includes(type)) { + throw new TypeError(`invalid type: ${type}\n(valid types are: ${Edge.types.join(', ')})`) + } + if (type === 'workspace' && npa(spec).type !== 'directory') { + throw new TypeError('workspace edges must be a symlink') + } + if (typeof name !== 'string') { + throw new TypeError('must provide dependency name') + } + if (!from) { + throw new TypeError('must provide "from" node') + } + if (accept !== undefined) { + if (typeof accept !== 'string') { + throw new TypeError('accept field must be a string if provided') + } + this.#accept = accept || '*' + } + if (overrides !== undefined) { + this.overrides = overrides + } + + this.#name = name + this.#type = type + this.#spec = spec + this.#explanation = null + this.#from = from + + from.edgesOut.get(this.#name)?.detach() + from.addEdgeOut(this) + + this.reload(true) + this.peerConflicted = false + } + + satisfiedBy (node) { + if (node.name !== this.#name || !this.#from) { + return false + } + + // NOTE: this condition means we explicitly do not support overriding + // bundled or shrinkwrapped dependencies + if (node.hasShrinkwrap || node.inShrinkwrap || node.inBundle) { + return depValid(node, this.rawSpec, this.#accept, this.#from) + } + + // If there's no override we just use the spec. + if (!this.overrides?.keySpec) { + return depValid(node, this.spec, this.#accept, this.#from) + } + // There's some override. If the target node satisfies the overriding spec + // then it's okay. + if (depValid(node, this.spec, this.#accept, this.#from)) { + return true + } + // If it doesn't, then it should at least satisfy the original spec. + if (!depValid(node, this.rawSpec, this.#accept, this.#from)) { + return false + } + // It satisfies the original spec, not the overriding spec. We need to make + // sure it doesn't use the overridden spec. + // For example: + // we might have an ^8.0.0 rawSpec, and an override that makes + // keySpec=8.23.0 and the override value spec=9.0.0. + // If the node is 9.0.0, then it's okay because it's consistent with spec. + // If the node is 8.24.0, then it's okay because it's consistent with the rawSpec. + // If the node is 8.23.0, then it's not okay because even though it's consistent + // with the rawSpec, it's also consistent with the keySpec. + // So we're looking for ^8.0.0 or 9.0.0 and not 8.23.0. + return !depValid(node, this.overrides.keySpec, this.#accept, this.#from) + } + + // return the edge data, and an explanation of how that edge came to be here + explain (seen = []) { + if (!this.#explanation) { + const explanation = { + type: this.#type, + name: this.#name, + spec: this.spec, + } + if (this.rawSpec !== this.spec) { + explanation.rawSpec = this.rawSpec + explanation.overridden = true + } + if (this.bundled) { + explanation.bundled = this.bundled + } + if (this.error) { + explanation.error = this.error + } + if (this.#from) { + explanation.from = this.#from.explain(null, seen) + } + this.#explanation = explanation + } + return this.#explanation + } + + get bundled () { + return !!this.#from?.package?.bundleDependencies?.includes(this.#name) + } + + get workspace () { + return this.#type === 'workspace' + } + + get prod () { + return this.#type === 'prod' + } + + get dev () { + return this.#type === 'dev' + } + + get optional () { + return this.#type === 'optional' || this.#type === 'peerOptional' + } + + get peer () { + return this.#type === 'peer' || this.#type === 'peerOptional' + } + + get type () { + return this.#type + } + + get name () { + return this.#name + } + + get rawSpec () { + return this.#spec + } + + get spec () { + if (this.overrides?.value && this.overrides.value !== '*' && this.overrides.name === this.#name) { + if (this.overrides.value.startsWith('$')) { + const ref = this.overrides.value.slice(1) + let pkg = this.#from?.sourceReference + ? this.#from?.sourceReference.root.package + : this.#from?.root?.package + + let specValue = this.#calculateReferentialOverrideSpec(ref, pkg) + + // If the package isn't found in the root package, fall back to the local package. + if (!specValue) { + pkg = this.#from?.package + specValue = this.#calculateReferentialOverrideSpec(ref, pkg) + } + + if (specValue) { + return specValue + } + throw new Error(`Unable to resolve reference ${this.overrides.value}`) + } + return this.overrides.value + } + return this.#spec + } + + #calculateReferentialOverrideSpec (ref, pkg) { + if (pkg.devDependencies?.[ref]) { + return pkg.devDependencies[ref] + } + if (pkg.optionalDependencies?.[ref]) { + return pkg.optionalDependencies[ref] + } + if (pkg.dependencies?.[ref]) { + return pkg.dependencies[ref] + } + if (pkg.peerDependencies?.[ref]) { + return pkg.peerDependencies[ref] + } + } + + get accept () { + return this.#accept + } + + get valid () { + return !this.error + } + + get missing () { + return this.error === 'MISSING' + } + + get invalid () { + return this.error === 'INVALID' + } + + get peerLocal () { + return this.error === 'PEER LOCAL' + } + + get error () { + if (!this.#error) { + if (!this.#to) { + if (this.optional) { + this.#error = null + } else { + this.#error = 'MISSING' + } + } else if (this.peer && this.#from === this.#to.parent && !this.#from?.isTop) { + this.#error = 'PEER LOCAL' + } else if (!this.satisfiedBy(this.#to)) { + this.#error = 'INVALID' + } else if (this.overrides && this.#to.overrides && this.#to.edgesOut.size && OverrideSet.doOverrideSetsConflict(this.overrides, this.#to.overrides)) { + // Check for conflicts between the edge's override set and the target node's override set. + // This catches cases where different parts of the tree have genuinely incompatible + // version requirements for the same package. + // The improved conflict detection uses semantic comparison (checking for incompatible + // version ranges) rather than pure structural equality, avoiding false positives from: + // - Reference overrides ($syntax) that resolve to compatible versions + // - Peer dependencies with different but compatible override contexts + // Note: We only check if the target has dependencies (edgesOut.size > 0), since + // override conflicts are only relevant if the target has its own dependencies. + this.#error = 'INVALID' + } else { + this.#error = 'OK' + } + } + if (this.#error === 'OK') { + return null + } + return this.#error + } + + reload (hard = false) { + this.#explanation = null + + let needToUpdateOverrideSet = false + let newOverrideSet + let oldOverrideSet + if (this.#from?.overrides) { + newOverrideSet = this.#from.overrides.getEdgeRule(this) + if (newOverrideSet && !newOverrideSet.isEqual(this.overrides)) { + // If there's a new different override set we need to propagate it to the nodes. + // If we're deleting the override set then there's no point propagating it right now since it will be filled with another value later. + needToUpdateOverrideSet = true + oldOverrideSet = this.overrides + this.overrides = newOverrideSet + } + } else { + delete this.overrides + } + const newTo = this.#from?.resolve(this.#name) + if (newTo !== this.#to) { + if (this.#to) { + this.#to.deleteEdgeIn(this) + } + this.#to = newTo + this.#error = null + if (this.#to) { + this.#to.addEdgeIn(this) + } + } else if (hard) { + this.#error = null + } else if (needToUpdateOverrideSet && this.#to) { + // Propagate the new override set to the target node. + this.#to.updateOverridesEdgeInRemoved(oldOverrideSet) + this.#to.updateOverridesEdgeInAdded(newOverrideSet) + } + } + + detach () { + this.#explanation = null + if (this.#to) { + this.#to.deleteEdgeIn(this) + } + this.#from?.edgesOut.delete(this.#name) + this.#to = null + this.#error = 'DETACHED' + this.#from = null + } + + get from () { + return this.#from + } + + get to () { + return this.#to + } + + toJSON () { + return new ArboristEdge(this) + } + + [util.inspect.custom] () { + return this.toJSON() + } +} + +module.exports = Edge diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/from-path.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/from-path.js new file mode 100644 index 0000000000000000000000000000000000000000..012fd17aa881574a342411f6d0efb03619887e12 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/from-path.js @@ -0,0 +1,30 @@ +// file dependencies need their dependencies resolved based on the location +// where the tarball was found, not the location where they end up getting +// installed. directory (ie, symlink) deps also need to be resolved based on +// their targets, but that's what realpath is + +const { dirname } = require('node:path') +const npa = require('npm-package-arg') + +const fromPath = (node, edge) => { + if (edge && edge.overrides && edge.overrides.name === edge.name && edge.overrides.value) { + // fromPath could be called with a node that has a virtual root, if that + // happens we want to make sure we get the real root node when overrides + // are in use. this is to allow things like overriding a dependency with a + // tarball file that's a relative path from the project root + if (node.sourceReference) { + return node.sourceReference.root.realpath + } + return node.root.realpath + } + + if (node.resolved) { + const spec = npa(node.resolved) + if (spec?.type === 'file') { + return dirname(spec.fetchSpec) + } + } + return node.realpath +} + +module.exports = fromPath diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/gather-dep-set.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/gather-dep-set.js new file mode 100644 index 0000000000000000000000000000000000000000..e8cb60263b458b93cb99829b6bd93594da684e09 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/gather-dep-set.js @@ -0,0 +1,43 @@ +// Given a set of nodes in a tree, and a filter function to test +// incoming edges to the dep set that should be ignored otherwise. +// +// find the set of deps that are only depended upon by nodes in the set, or +// their dependencies, or edges that are ignored. +// +// Used when figuring out what to prune when replacing a node with a newer +// version, or when an optional dep fails to install. + +const gatherDepSet = (set, edgeFilter) => { + const deps = new Set(set) + + // add the full set of dependencies. note that this loop will continue + // as the deps set increases in size. + for (const node of deps) { + for (const edge of node.edgesOut.values()) { + if (edge.to && edgeFilter(edge)) { + deps.add(edge.to) + } + } + } + + // now remove all nodes in the set that have a dependent outside the set + // if any change is made, then re-check + // continue until no changes made, or deps set evaporates fully. + let changed = true + while (changed === true && deps.size > 0) { + changed = false + for (const dep of deps) { + for (const edge of dep.edgesIn) { + if (!deps.has(edge.from) && edgeFilter(edge)) { + changed = true + deps.delete(dep) + break + } + } + } + } + + return deps +} + +module.exports = gatherDepSet diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/index.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..085b4bebf41463e52ac93920609f7f06d78c1453 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/index.js @@ -0,0 +1,6 @@ +module.exports = require('./arborist/index.js') +module.exports.Arborist = module.exports +module.exports.Node = require('./node.js') +module.exports.Link = require('./link.js') +module.exports.Edge = require('./edge.js') +module.exports.Shrinkwrap = require('./shrinkwrap.js') diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/inventory.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/inventory.js new file mode 100644 index 0000000000000000000000000000000000000000..bb4cfa0ebcda1ed0a7f333bc513bd4ae1becad18 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/inventory.js @@ -0,0 +1,137 @@ +// a class to manage an inventory and set of indexes of a set of objects based on specific fields. +const { hasOwnProperty } = Object.prototype +const debug = require('./debug.js') + +const keys = ['name', 'license', 'funding', 'realpath', 'packageName'] +class Inventory extends Map { + #index + + constructor () { + super() + this.#index = new Map() + for (const key of keys) { + this.#index.set(key, new Map()) + } + } + + // XXX where is this used? + get primaryKey () { + return 'location' + } + + // XXX where is this used? + get indexes () { + return [...keys] + } + + * filter (fn) { + for (const node of this.values()) { + if (fn(node)) { + yield node + } + } + } + + add (node) { + const root = super.get('') + if (root && node.root !== root && node.root !== root.root) { + debug(() => { + throw Object.assign(new Error('adding external node to inventory'), { + root: root.path, + node: node.path, + nodeRoot: node.root.path, + }) + }) + return + } + + const current = super.get(node.location) + if (current) { + if (current === node) { + return + } + this.delete(current) + } + super.set(node.location, node) + for (const [key, map] of this.#index.entries()) { + let val + if (hasOwnProperty.call(node, key)) { + // if the node has the value, use it even if it's false + val = node[key] + } else if (key === 'license' && node.package) { + // handling for the outdated "licenses" array, just pick the first one + // also support the alternative spelling "licence" + if (node.package.license) { + val = node.package.license + } else if (node.package.licence) { + val = node.package.licence + } else if (Array.isArray(node.package.licenses)) { + val = node.package.licenses[0] + } else if (Array.isArray(node.package.licences)) { + val = node.package.licences[0] + } + } else if (node[key]) { + val = node[key] + } else { + val = node.package?.[key] + } + if (val && typeof val === 'object') { + // We currently only use license and funding + /* istanbul ignore next - not used */ + if (key === 'license') { + val = val.type + } else if (key === 'funding') { + val = val.url + } + } + if (!map.has(val)) { + map.set(val, new Set()) + } + map.get(val).add(node) + } + } + + delete (node) { + if (!this.has(node)) { + return + } + + super.delete(node.location) + for (const [key, map] of this.#index.entries()) { + let val + if (node[key] !== undefined) { + val = node[key] + } else { + val = node.package?.[key] + } + const set = map.get(val) + if (set) { + set.delete(node) + if (set.size === 0) { + map.delete(node[key]) + } + } + } + } + + query (key, val) { + const map = this.#index.get(key) + if (arguments.length === 2) { + if (map.has(val)) { + return map.get(val) + } + return new Set() + } + return map.keys() + } + + has (node) { + return super.get(node.location) === node + } + + set () { + throw new Error('direct set() not supported, use inventory.add(node)') + } +} + +module.exports = Inventory diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/isolated-classes.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/isolated-classes.js new file mode 100644 index 0000000000000000000000000000000000000000..0738d75d8de17efd2dc933b5f124a919b3fada2d --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/isolated-classes.js @@ -0,0 +1,138 @@ +// Alternate versions of different classes that we use for isolated mode +const CaseInsensitiveMap = require('./case-insensitive-map.js') +const { resolve } = require('node:path') + +// fake lib/inventory.js +class IsolatedInventory extends Map { + query () { + return [] + } +} + +// fake lib/node.js +class IsolatedNode { + binPaths = [] + children = new CaseInsensitiveMap() + edgesIn = new Set() + edgesOut = new CaseInsensitiveMap() + fsChildren = new Set() + hasShrinkwrap = false + integrity = null + inventory = new IsolatedInventory() + isInStore = false + linksIn = new Set() + meta = { loadedFromDisk: false } + optional = false + parent = null + root = null + tops = new Set() + workspaces = new Map() + + constructor (options) { + this.location = options.location + this.name = options.name + this.package = options.package + this.path = options.path + this.realpath = !this.isLink ? this.path : resolve(options.realpath) + + if (options.parent) { + this.parent = options.parent + } + if (options.resolved) { + this.resolved = options.resolved + } + if (options.root) { + this.root = options.root + } + if (options.isInStore) { + this.isInStore = true + } + if (options.optional) { + this.optional = true + } + } + + get isRoot () { + return this === this.root + } + + // The idealGraph is where this is set to true + get isProjectRoot () { + return false + } + + get inDepBundle () { + return false + } + + get isLink () { + return false + } + + get isTop () { + return !this.parent + } + + /* istanbul ignore next -- emulate lib/node.js */ + get global () { + return false + } + + get globalTop () { + return false + } + + /* istanbul ignore next -- emulate lib/node.js */ + set target (t) { + // nop + // In the real lib/node.js this throws in debug mode + } + + get target () { + return this + } + + /* istanbul ignore next -- emulate lib/node.js */ + getBundler () { + return null + } + + /* istanbul ignore next -- emulate lib/node.js */ + get hasInstallScript () { + const { hasInstallScript, scripts } = this.package + const { install, preinstall, postinstall } = scripts || {} + return !!(hasInstallScript || install || preinstall || postinstall) + } + + get version () { + return this.package.version + } +} + +// fake lib/link.js +class IsolatedLink extends IsolatedNode { + #target + isStoreLink = false + + constructor (options) { + super(options) + this.#target = options.target + if (options.isStoreLink) { + this.isStoreLink = true + } + } + + get isLink () { + return true + } + + set target (t) { + this.#target = t + } + + get target () { + return this.#target + } +} + +module.exports = { IsolatedNode, IsolatedLink } diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/link.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/link.js new file mode 100644 index 0000000000000000000000000000000000000000..ac1278524dfdcdec7fcf660ab32fceda0a273463 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/link.js @@ -0,0 +1,126 @@ +const relpath = require('./relpath.js') +const Node = require('./node.js') +const _loadDeps = Symbol.for('Arborist.Node._loadDeps') +const _target = Symbol.for('_target') +const { dirname } = require('node:path') +// defined by Node class +const _delistFromMeta = Symbol.for('_delistFromMeta') +const _refreshLocation = Symbol.for('_refreshLocation') +class Link extends Node { + constructor (options) { + const { root, realpath, target, parent, fsParent, isStoreLink } = options + + if (!realpath && !(target && target.path)) { + throw new TypeError('must provide realpath for Link node') + } + + super({ + ...options, + realpath: realpath || target.path, + root: root || (parent ? parent.root + : fsParent ? fsParent.root + : target ? target.root + : null), + }) + + this.isStoreLink = isStoreLink || false + + if (target) { + this.target = target + } else if (this.realpath === this.root.path) { + this.target = this.root + } else { + this.target = new Node({ + ...options, + path: realpath, + parent: null, + fsParent: null, + root: this.root, + }) + } + } + + get version () { + return this.target ? this.target.version : this.package.version || '' + } + + get target () { + return this[_target] + } + + set target (target) { + const current = this[_target] + if (target === current) { + return + } + + if (!target) { + if (current && current.linksIn) { + current.linksIn.delete(this) + } + if (this.path) { + this[_delistFromMeta]() + this[_target] = null + this.package = {} + this[_refreshLocation]() + } else { + this[_target] = null + } + return + } + + if (!this.path) { + // temp node pending assignment to a tree + // we know it's not in the inventory yet, because no path. + if (target.path) { + this.realpath = target.path + } else { + target.path = target.realpath = this.realpath + } + target.root = this.root + this[_target] = target + target.linksIn.add(this) + this.package = target.package + return + } + + // have to refresh metadata, because either realpath or package + // is very likely changing. + this[_delistFromMeta]() + this.package = target.package + this.realpath = target.path + this[_refreshLocation]() + + target.root = this.root + } + + // a link always resolves to the relative path to its target + get resolved () { + // the path/realpath guard is there for the benefit of setting + // these things in the "wrong" order + return this.path && this.realpath + ? `file:${relpath(dirname(this.path), this.realpath)}` + : null + } + + set resolved (r) {} + + // deps are resolved on the target, not the Link + // so this is a no-op + [_loadDeps] () {} + + // links can't have children, only their targets can + // fix it to an empty list so that we can still call + // things that iterate over them, just as a no-op + get children () { + return new Map() + } + + set children (c) {} + + get isLink () { + return true + } +} + +module.exports = Link diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js new file mode 100644 index 0000000000000000000000000000000000000000..47d5002bd82f2d9113708da661ba253cb64f0a8c --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js @@ -0,0 +1,1631 @@ +// inventory, path, realpath, root, and parent +// +// node.root is a reference to the root module in the tree (ie, typically the +// cwd project folder) +// +// node.location is the /-delimited path from the root module to the node. In +// the case of link targets that may be outside of the root's package tree, +// this can include some number of /../ path segments. The location of the +// root module is always '.'. node.location thus never contains drive letters +// or absolute paths, and is portable within a given project, suitable for +// inclusion in lockfiles and metadata. +// +// node.path is the path to the place where this node lives on disk. It is +// system-specific and absolute. +// +// node.realpath is the path to where the module actually resides on disk. In +// the case of non-link nodes, node.realpath is equivalent to node.path. In +// the case of link nodes, it is equivalent to node.target.path. +// +// Setting node.parent will set the node's root to the parent's root, as well +// as updating edgesIn and edgesOut to reload dependency resolutions as needed, +// and setting node.path to parent.path/node_modules/name. +// +// node.inventory is a Map of name to a Set() of all the nodes under a given +// root by that name. It's empty for non-root nodes, and changing the root +// reference will remove it from the old root's inventory and add it to the new +// one. This map is useful for cases like `npm update foo` or `npm ls foo` +// where we need to quickly find all instances of a given package name within a +// tree. + +const PackageJson = require('@npmcli/package-json') +const nameFromFolder = require('@npmcli/name-from-folder') +const npa = require('npm-package-arg') +const semver = require('semver') +const util = require('node:util') +const { getPaths: getBinPaths } = require('bin-links') +const { log } = require('proc-log') +const { resolve, relative, dirname, basename } = require('node:path') +const { walkUp } = require('walk-up-path') + +const CaseInsensitiveMap = require('./case-insensitive-map.js') +const Edge = require('./edge.js') +const Inventory = require('./inventory.js') +const OverrideSet = require('./override-set.js') +const consistentResolve = require('./consistent-resolve.js') +const debug = require('./debug.js') +const gatherDepSet = require('./gather-dep-set.js') +const printableTree = require('./printable.js') +const querySelectorAll = require('./query-selector-all.js') +const relpath = require('./relpath.js') +const treeCheck = require('./tree-check.js') + +const _package = Symbol('_package') +const _parent = Symbol('_parent') +const _target = Symbol.for('_target') +const _fsParent = Symbol('_fsParent') +const _reloadNamedEdges = Symbol('_reloadNamedEdges') +// overridden by Link class +const _loadDeps = Symbol.for('Arborist.Node._loadDeps') +const _refreshLocation = Symbol.for('_refreshLocation') +const _changePath = Symbol.for('_changePath') +// used by Link class as well +const _delistFromMeta = Symbol.for('_delistFromMeta') +const _explain = Symbol('_explain') +const _explanation = Symbol('_explanation') + +class Node { + #global + #meta + #root + #workspaces + + constructor (options) { + // NB: path can be null if it's a link target + const { + children, + dev = true, + devOptional = true, + dummy = false, + error, + extraneous = true, + fsChildren, + fsParent, + global = false, + hasShrinkwrap, + inert = false, + installLinks = false, + integrity, + isInStore = false, + legacyPeerDeps = false, + linksIn, + loadOverrides = false, + meta, + name, // allow setting name explicitly when we haven't set a path yet + optional = true, + overrides, + parent, + path, + peer = true, + realpath, + resolved, + root, + sourceReference = null, + } = options + // this object gives querySelectorAll somewhere to stash context about a node + // while processing a query + this.queryContext = {} + + // true if part of a global install + this.#global = global + + this.#workspaces = null + + this.errors = error ? [error] : [] + this.isInStore = isInStore + + // this will usually be null, except when modeling a + // package's dependencies in a virtual root. + this.sourceReference = sourceReference + + // have to set the internal package ref before assigning the parent, because this.package is read when adding to inventory + if (sourceReference) { + this[_package] = sourceReference.package + } else { + // TODO if this came from pacote.manifest we don't have to do this, we can be told to skip this step + const pkg = new PackageJson() + let content = {} + // TODO this is overly guarded. If pkg is not an object we should not allow it at all. + if (options.pkg && typeof options.pkg === 'object') { + content = options.pkg + } + pkg.fromContent(content) + pkg.syncNormalize() + this[_package] = pkg.content + } + + this.name = name || + nameFromFolder(path || this.package.name || realpath) || + this.package.name || + null + + // should be equal if not a link + this.path = path ? resolve(path) : null + + if (!this.name && (!this.path || this.path !== dirname(this.path))) { + throw new TypeError('could not detect node name from path or package') + } + + this.realpath = !this.isLink ? this.path : resolve(realpath) + + this.resolved = resolved || null + if (!this.resolved) { + // note: this *only* works for non-file: deps, so we avoid even + // trying here. + // file: deps are tracked in package.json will _resolved set to the + // full path to the tarball or link target. However, if the package + // is checked into git or moved to another location, that's 100% not + // portable at all! The _where and _location don't provide much help, + // since _location is just where the module ended up in the tree, + // and _where can be different than the actual root if it's a + // meta-dep deeper in the dependency graph. + // + // If we don't have the other oldest indicators of legacy npm, then it's + // probably what we're getting from pacote, which IS trustworthy. + // + // Otherwise, hopefully a shrinkwrap will help us out. + const resolved = consistentResolve(this.package._resolved) + if (resolved && !(/^file:/.test(resolved) && this.package._where)) { + this.resolved = resolved + } + } + this.integrity = integrity || this.package._integrity || null + this.hasShrinkwrap = hasShrinkwrap || this.package._hasShrinkwrap || false + this.installLinks = installLinks + this.legacyPeerDeps = legacyPeerDeps + + this.children = new CaseInsensitiveMap() + this.fsChildren = new Set() + this.inventory = new Inventory() + this.tops = new Set() + this.linksIn = new Set(linksIn || []) + + // these three are set by an Arborist taking a catalog + // after the tree is built. We don't get this along the way, + // because they have a tendency to change as new children are + // added, especially when they're deduped. Eg, a dev dep may be + // a 3-levels-deep dependency of a non-dev dep. If we calc the + // flags along the way, then they'll tend to be invalid by the + // time we need to look at them. + if (!dummy) { + this.dev = dev + this.optional = optional + this.devOptional = devOptional + this.peer = peer + this.extraneous = extraneous + this.dummy = false + } else { + // true if this is a placeholder for the purpose of serving as a + // fsParent to link targets that get their deps resolved outside + // the root tree folder. + this.dummy = true + this.dev = false + this.optional = false + this.devOptional = false + this.peer = false + this.extraneous = false + } + + this.inert = inert + + this.edgesIn = new Set() + this.edgesOut = new CaseInsensitiveMap() + + if (overrides) { + this.overrides = overrides + } else if (loadOverrides) { + const overrides = this.package.overrides || {} + if (Object.keys(overrides).length > 0) { + this.overrides = new OverrideSet({ + overrides: this.package.overrides, + }) + } + } + + // only relevant for the root and top nodes + this.meta = meta + + // Note: this is _slightly_ less efficient for the initial tree + // building than it could be, but in exchange, it's a much simpler + // algorithm. + // If this node has a bunch of children, and those children satisfy + // its various deps, then we're going to _first_ create all the + // edges, and _then_ assign the children into place, re-resolving + // them all in _reloadNamedEdges. + // A more efficient, but more complicated, approach would be to + // flag this node as being a part of a tree build, so it could + // hold off on resolving its deps until its children are in place. + + // call the parent setter + // Must be set prior to calling _loadDeps, because top-ness is relevant + + // will also assign root if present on the parent + this[_parent] = null + this.parent = parent || null + + this[_fsParent] = null + this.fsParent = fsParent || null + + // see parent/root setters below. + // root is set to parent's root if we have a parent; otherwise, if it's + // null, then it's set to the node itself. + if (!parent && !fsParent) { + this.root = root || null + } + + // mostly a convenience for testing, but also a way to create + // trees in a more declarative way than setting parent on each + if (children) { + for (const c of children) { + new Node({ ...c, parent: this }) + } + } + if (fsChildren) { + for (const c of fsChildren) { + new Node({ ...c, fsParent: this }) + } + } + + // now load all the dep edges + this[_loadDeps]() + } + + get meta () { + return this.#meta + } + + set meta (meta) { + this.#meta = meta + if (meta) { + meta.add(this) + } + } + + get global () { + if (this.#root === this) { + return this.#global + } + return this.#root.global + } + + // true for packages installed directly in the global node_modules folder + get globalTop () { + return this.global && this.parent && this.parent.isProjectRoot + } + + get workspaces () { + return this.#workspaces + } + + set workspaces (workspaces) { + // deletes edges if they already exists + if (this.#workspaces) { + for (const name of this.#workspaces.keys()) { + if (!workspaces.has(name)) { + this.edgesOut.get(name).detach() + } + } + } + + this.#workspaces = workspaces + this.#loadWorkspaces() + this[_loadDeps]() + } + + get binPaths () { + if (!this.parent) { + return [] + } + + return getBinPaths({ + pkg: this.package, + path: this.path, + global: this.global, + top: this.globalTop, + }) + } + + get hasInstallScript () { + const { hasInstallScript, scripts } = this.package + const { install, preinstall, postinstall } = scripts || {} + return !!(hasInstallScript || install || preinstall || postinstall) + } + + get version () { + return this.package.version || '' + } + + get packageName () { + return this.package.name || null + } + + get pkgid () { + const { name = '', version = '' } = this.package + // root package will prefer package name over folder name, + // and never be called an alias. + const { isProjectRoot } = this + const myname = isProjectRoot ? name || this.name + : this.name + const alias = !isProjectRoot && name && myname !== name ? `npm:${name}@` + : '' + return `${myname}@${alias}${version}` + } + + get overridden () { + if (!this.overrides) { + return false + } + if (!this.overrides.value) { + return false + } + if (this.overrides.name !== this.name) { + return false + } + + // The overrides rule is for a package with this name, but some override rules only apply to specific + // versions. To make sure this package was actually overridden, we check whether any edge going in + // had the rule applied to it, in which case its overrides set is different than its source node. + for (const edge of this.edgesIn) { + if (edge.overrides && edge.overrides.name === this.name && edge.overrides.value === this.version) { + if (!edge.overrides.isEqual(edge.from.overrides)) { + return true + } + } + } + + return false + } + + get package () { + return this[_package] + } + + set package (pkg) { + // just detach them all. we could make this _slightly_ more efficient + // by only detaching the ones that changed, but we'd still have to walk + // them all, and the comparison logic gets a bit tricky. we generally + // only do this more than once at the root level, so the resolve() calls + // are only one level deep, and there's not much to be saved, anyway. + // simpler to just toss them all out. + for (const edge of this.edgesOut.values()) { + edge.detach() + } + + this[_explanation] = null + /* istanbul ignore next - should be impossible */ + if (!pkg || typeof pkg !== 'object') { + debug(() => { + throw new Error('setting Node.package to non-object') + }) + pkg = {} + } + this[_package] = pkg + this.#loadWorkspaces() + this[_loadDeps]() + // do a hard reload, since the dependents may now be valid or invalid + // as a result of the package change. + this.edgesIn.forEach(edge => edge.reload(true)) + } + + // node.explain(nodes seen already, edge we're trying to satisfy + // if edge is not specified, it lists every edge into the node. + explain (edge = null, seen = []) { + if (this[_explanation]) { + return this[_explanation] + } + + return this[_explanation] = this[_explain](edge, seen) + } + + [_explain] (edge, seen) { + if (this.isProjectRoot && !this.sourceReference) { + return { + location: this.path, + } + } + + const why = { + name: this.isProjectRoot || this.isTop ? this.packageName : this.name, + version: this.package.version, + } + if (this.errors.length || !this.packageName || !this.package.version) { + why.errors = this.errors.length ? this.errors : [ + new Error('invalid package: lacks name and/or version'), + ] + why.package = this.package + } + + if (this.root.sourceReference) { + const { name, version } = this.root.package + why.whileInstalling = { + name, + version, + path: this.root.sourceReference.path, + } + } + + if (this.sourceReference) { + return this.sourceReference.explain(edge, seen) + } + + if (seen.includes(this)) { + return why + } + + why.location = this.location + why.isWorkspace = this.isWorkspace + + // make a new list each time. we can revisit, but not loop. + seen = seen.concat(this) + + why.dependents = [] + if (edge) { + why.dependents.push(edge.explain(seen)) + } else { + // ignore invalid edges, since those aren't satisfied by this thing, + // and are not keeping it held in this spot anyway. + const edges = [] + for (const edge of this.edgesIn) { + if (!edge.valid && !edge.from.isProjectRoot) { + continue + } + + edges.push(edge) + } + for (const edge of edges) { + why.dependents.push(edge.explain(seen)) + } + } + + if (this.linksIn.size) { + why.linksIn = [...this.linksIn].map(link => link[_explain](edge, seen)) + } + + return why + } + + isDescendantOf (node) { + for (let p = this; p; p = p.resolveParent) { + if (p === node) { + return true + } + } + return false + } + + shouldOmit (omitSet) { + if (!omitSet.size) { + return false + } + + const { top } = this + + // if the top is not the root or workspace then we do not want to omit it + if (!top.isProjectRoot && !top.isWorkspace) { + return false + } + + // omit node if the dep type matches any omit flags that were set + return ( + this.peer && omitSet.has('peer') || + this.dev && omitSet.has('dev') || + this.optional && omitSet.has('optional') || + this.devOptional && omitSet.has('optional') && omitSet.has('dev') + ) + } + + getBundler (path = []) { + // made a cycle, definitely not bundled! + if (path.includes(this)) { + return null + } + + path.push(this) + + const parent = this[_parent] + if (!parent) { + return null + } + + const pBundler = parent.getBundler(path) + if (pBundler) { + return pBundler + } + + const ppkg = parent.package + const bd = ppkg && ppkg.bundleDependencies + // explicit bundling + if (Array.isArray(bd) && bd.includes(this.name)) { + return parent + } + + // deps that are deduped up to the bundling level are bundled. + // however, if they get their dep met further up than that, + // then they are not bundled. Ie, installing a package with + // unmet bundled deps will not cause your deps to be bundled. + for (const edge of this.edgesIn) { + const eBundler = edge.from.getBundler(path) + if (!eBundler) { + continue + } + + if (eBundler === parent) { + return eBundler + } + } + + return null + } + + get inBundle () { + return !!this.getBundler() + } + + // when reifying, if a package is technically in a bundleDependencies list, + // but that list is the root project, we still have to install it. This + // getter returns true if it's in a dependency's bundle list, not the root's. + get inDepBundle () { + const bundler = this.getBundler() + return !!bundler && bundler !== this.root + } + + get isWorkspace () { + if (this.isProjectRoot) { + return false + } + const { root } = this + const { type, to } = root.edgesOut.get(this.packageName) || {} + return type === 'workspace' && to && (to.target === this || to === this) + } + + get isRoot () { + return this === this.root + } + + get isProjectRoot () { + // only treat as project root if it's the actual link that is the root, or the target of the root link, but NOT if it's another link to the same root that happens to be somewhere else. + return this === this.root || this === this.root.target + } + + get isRegistryDependency () { + if (this.edgesIn.size === 0) { + return false + } + for (const edge of this.edgesIn) { + if (!npa(edge.spec).registry) { + return false + } + } + return true + } + + * ancestry () { + for (let anc = this; anc; anc = anc.resolveParent) { + yield anc + } + } + + set root (root) { + // setting to null means this is the new root + // should only ever be one step + while (root && root.root !== root) { + root = root.root + } + + root = root || this + + // delete from current root inventory + this[_delistFromMeta]() + + // can't set the root (yet) if there's no way to determine location + // this allows us to do new Node({...}) and then set the root later. + // just make the assignment so we don't lose it, and move on. + if (!this.path || !root.realpath || !root.path) { + this.#root = root + return + } + + // temporarily become a root node + this.#root = this + + // break all linksIn, we're going to re-set them if needed later + for (const link of this.linksIn) { + link[_target] = null + this.linksIn.delete(link) + } + + // temporarily break this link as well, we'll re-set if possible later + const { target } = this + if (this.isLink) { + if (target) { + target.linksIn.delete(this) + if (target.root === this) { + target[_delistFromMeta]() + } + } + this[_target] = null + } + + // if this is part of a cascading root set, then don't do this bit + // but if the parent/fsParent is in a different set, we have to break + // that reference before proceeding + if (this.parent && this.parent.root !== root) { + this.parent.children.delete(this.name) + this[_parent] = null + } + if (this.fsParent && this.fsParent.root !== root) { + this.fsParent.fsChildren.delete(this) + this[_fsParent] = null + } + + if (root === this) { + this[_refreshLocation]() + } else { + // setting to some different node. + const loc = relpath(root.realpath, this.path) + const current = root.inventory.get(loc) + + // clobber whatever is there now + if (current) { + current.root = null + } + + this.#root = root + // set this.location and add to inventory + this[_refreshLocation]() + + // try to find our parent/fsParent in the new root inventory + for (const p of walkUp(dirname(this.path))) { + if (p === this.path) { + continue + } + const ploc = relpath(root.realpath, p) + const parent = root.inventory.get(ploc) + if (parent) { + /* istanbul ignore next - impossible */ + if (parent.isLink) { + debug(() => { + throw Object.assign(new Error('assigning parentage to link'), { + path: this.path, + parent: parent.path, + parentReal: parent.realpath, + }) + }) + continue + } + const childLoc = `${ploc}${ploc ? '/' : ''}node_modules/${this.name}` + const isParent = this.location === childLoc + if (isParent) { + const oldChild = parent.children.get(this.name) + if (oldChild && oldChild !== this) { + oldChild.root = null + } + if (this.parent) { + this.parent.children.delete(this.name) + this.parent[_reloadNamedEdges](this.name) + } + parent.children.set(this.name, this) + this[_parent] = parent + // don't do it for links, because they don't have a target yet + // we'll hit them up a bit later on. + if (!this.isLink) { + parent[_reloadNamedEdges](this.name) + } + } else { + /* istanbul ignore if - should be impossible, since we break + * all fsParent/child relationships when moving? */ + if (this.fsParent) { + this.fsParent.fsChildren.delete(this) + } + parent.fsChildren.add(this) + this[_fsParent] = parent + } + break + } + } + + // if it doesn't have a parent, it's a top node + if (!this.parent) { + root.tops.add(this) + } else { + root.tops.delete(this) + } + + // assign parentage for any nodes that need to have this as a parent + // this can happen when we have a node at nm/a/nm/b added *before* + // the node at nm/a, which might have the root node as a fsParent. + // we can't rely on the public setter here, because it calls into + // this function to set up these references! + // check dirname so that /foo isn't treated as the fsparent of /foo-bar + const nmloc = `${this.location}${this.location ? '/' : ''}node_modules/` + // only walk top nodes, since anything else already has a parent. + for (const child of root.tops) { + const isChild = child.location === nmloc + child.name + const isFsChild = + dirname(child.path).startsWith(this.path) && + child !== this && + !child.parent && + ( + !child.fsParent || + child.fsParent === this || + dirname(this.path).startsWith(child.fsParent.path) + ) + + if (!isChild && !isFsChild) { + continue + } + + // set up the internal parentage links + if (this.isLink) { + child.root = null + } else { + // can't possibly have a parent, because it's in tops + if (child.fsParent) { + child.fsParent.fsChildren.delete(child) + } + child[_fsParent] = null + if (isChild) { + this.children.set(child.name, child) + child[_parent] = this + root.tops.delete(child) + } else { + this.fsChildren.add(child) + child[_fsParent] = this + } + } + } + + // look for any nodes with the same realpath. either they're links + // to that realpath, or a thing at that realpath if we're adding a link + // (if we're adding a regular node, we already deleted the old one) + for (const node of root.inventory.query('realpath', this.realpath)) { + if (node === this) { + continue + } + + /* istanbul ignore next - should be impossible */ + debug(() => { + if (node.root !== root) { + throw new Error('inventory contains node from other root') + } + }) + + if (this.isLink) { + const target = node.target + this[_target] = target + this[_package] = target.package + target.linksIn.add(this) + // reload edges here, because now we have a target + if (this.parent) { + this.parent[_reloadNamedEdges](this.name) + } + break + } else { + /* istanbul ignore else - should be impossible */ + if (node.isLink) { + node[_target] = this + node[_package] = this.package + this.linksIn.add(node) + if (node.parent) { + node.parent[_reloadNamedEdges](node.name) + } + } else { + debug(() => { + throw Object.assign(new Error('duplicate node in root setter'), { + path: this.path, + realpath: this.realpath, + root: root.realpath, + }) + }) + } + } + } + } + + // reload all edgesIn where the root doesn't match, so we don't have + // cross-tree dependency graphs + for (const edge of this.edgesIn) { + if (edge.from.root !== root) { + edge.reload() + } + } + // reload all edgesOut where root doesn't match, or is missing, since + // it might not be missing in the new tree + for (const edge of this.edgesOut.values()) { + if (!edge.to || edge.to.root !== root) { + edge.reload() + } + } + + // now make sure our family comes along for the ride! + const family = new Set([ + ...this.fsChildren, + ...this.children.values(), + ...this.inventory.values(), + ].filter(n => n !== this)) + + for (const child of family) { + if (child.root !== root) { + child[_delistFromMeta]() + child[_parent] = null + this.children.delete(child.name) + child[_fsParent] = null + this.fsChildren.delete(child) + for (const l of child.linksIn) { + l[_target] = null + child.linksIn.delete(l) + } + } + } + for (const child of family) { + if (child.root !== root) { + child.root = root + } + } + + // if we had a target, and didn't find one in the new root, then bring + // it over as well, but only if we're setting the link into a new root, + // as we don't want to lose the target any time we remove a link. + if (this.isLink && target && !this.target && root !== this) { + target.root = root + } + + // tree should always be valid upon root setter completion. + treeCheck(this) + if (this !== root) { + treeCheck(root) + } + } + + get root () { + return this.#root || this + } + + #loadWorkspaces () { + if (!this.#workspaces) { + return + } + + for (const [name, path] of this.#workspaces.entries()) { + new Edge({ from: this, name, spec: `file:${path}`, type: 'workspace' }) + } + } + + [_loadDeps] () { + // Caveat! Order is relevant! + // Packages in optionalDependencies are optional. + // Packages in both deps and devDeps are required. + // Note the subtle breaking change from v6: it is no longer possible + // to have a different spec for a devDep than production dep. + + // Linked targets that are disconnected from the tree are tops, + // but don't have a 'path' field, only a 'realpath', because we + // don't know their canonical location. We don't need their devDeps. + const pd = this.package.peerDependencies + const ad = this.package.acceptDependencies || {} + if (pd && typeof pd === 'object' && !this.legacyPeerDeps) { + const pm = this.package.peerDependenciesMeta || {} + const peerDependencies = {} + const peerOptional = {} + for (const [name, dep] of Object.entries(pd)) { + if (pm[name]?.optional) { + peerOptional[name] = dep + } else { + peerDependencies[name] = dep + } + } + this.#loadDepType(peerDependencies, 'peer', ad) + this.#loadDepType(peerOptional, 'peerOptional', ad) + } + + this.#loadDepType(this.package.dependencies, 'prod', ad) + this.#loadDepType(this.package.optionalDependencies, 'optional', ad) + + const { globalTop, isTop, path, sourceReference } = this + const { + globalTop: srcGlobalTop, + isTop: srcTop, + path: srcPath, + } = sourceReference || {} + const thisDev = isTop && !globalTop && path + const srcDev = !sourceReference || srcTop && !srcGlobalTop && srcPath + if (thisDev && srcDev) { + this.#loadDepType(this.package.devDependencies, 'dev', ad) + } + } + + #loadDepType (deps, type, ad) { + // Because of the order in which _loadDeps runs, we always want to + // prioritize a new edge over an existing one + for (const [name, spec] of Object.entries(deps || {})) { + const current = this.edgesOut.get(name) + if (!current || current.type !== 'workspace') { + new Edge({ from: this, name, spec, accept: ad[name], type }) + } + } + } + + get fsParent () { + // in debug setter prevents fsParent from being this + return this[_fsParent] + } + + set fsParent (fsParent) { + if (!fsParent) { + if (this[_fsParent]) { + this.root = null + } + return + } + + debug(() => { + if (fsParent === this) { + throw new Error('setting node to its own fsParent') + } + + if (fsParent.realpath === this.realpath) { + throw new Error('setting fsParent to same path') + } + + // the initial set MUST be an actual walk-up from the realpath + // subsequent sets will re-root on the new fsParent's path. + if (!this[_fsParent] && this.realpath.indexOf(fsParent.realpath) !== 0) { + throw Object.assign(new Error('setting fsParent improperly'), { + path: this.path, + realpath: this.realpath, + fsParent: { + path: fsParent.path, + realpath: fsParent.realpath, + }, + }) + } + }) + + if (fsParent.isLink) { + fsParent = fsParent.target + } + + // setting a thing to its own fsParent is not normal, but no-op for safety + if (this === fsParent || fsParent.realpath === this.realpath) { + return + } + + // nothing to do + if (this[_fsParent] === fsParent) { + return + } + + const oldFsParent = this[_fsParent] + const newPath = !oldFsParent ? this.path + : resolve(fsParent.path, relative(oldFsParent.path, this.path)) + const nmPath = resolve(fsParent.path, 'node_modules', this.name) + + // this is actually the parent, set that instead + if (newPath === nmPath) { + this.parent = fsParent + return + } + + const pathChange = newPath !== this.path + + // remove from old parent/fsParent + const oldParent = this.parent + const oldName = this.name + if (this.parent) { + this.parent.children.delete(this.name) + this[_parent] = null + } + if (this.fsParent) { + this.fsParent.fsChildren.delete(this) + this[_fsParent] = null + } + + // update this.path/realpath for this and all children/fsChildren + if (pathChange) { + this[_changePath](newPath) + } + + if (oldParent) { + oldParent[_reloadNamedEdges](oldName) + } + + // clobbers anything at that path, resets all appropriate references + this.root = fsParent.root + } + + // is it safe to replace one node with another? check the edges to + // make sure no one will get upset. Note that the node might end up + // having its own unmet dependencies, if the new node has new deps. + // Note that there are cases where Arborist will opt to insert a node + // into the tree even though this function returns false! This is + // necessary when a root dependency is added or updated, or when a + // root dependency brings peer deps along with it. In that case, we + // will go ahead and create the invalid state, and then try to resolve + // it with more tree construction, because it's a user request. + canReplaceWith (node, ignorePeers) { + if (node.name !== this.name) { + return false + } + + if (node.packageName !== this.packageName) { + return false + } + + // If this node has no dependencies, then it's irrelevant to check the override + // rules of the replacement node. + if (this.edgesOut.size) { + // XXX need to check for two root nodes? + if (node.overrides) { + if (!node.overrides.isEqual(this.overrides)) { + return false + } + } else { + if (this.overrides) { + return false + } + } + } + + ignorePeers = new Set(ignorePeers) + + // gather up all the deps of this node and that are only depended + // upon by deps of this node. those ones don't count, since + // they'll be replaced if this node is replaced anyway. + const depSet = gatherDepSet([this], e => e.to !== this && e.valid) + + for (const edge of this.edgesIn) { + // when replacing peer sets, we need to be able to replace the entire + // peer group, which means we ignore incoming edges from other peers + // within the replacement set. + if (!this.isTop && + edge.from.parent === this.parent && + edge.peer && + ignorePeers.has(edge.from.name)) { + continue + } + + // only care about edges that don't originate from this node + if (!depSet.has(edge.from) && !edge.satisfiedBy(node)) { + return false + } + } + + return true + } + + canReplace (node, ignorePeers) { + return node.canReplaceWith(this, ignorePeers) + } + + // return true if it's safe to remove this node, because anything that + // is depending on it would be fine with the thing that they would resolve + // to if it was removed, or nothing is depending on it in the first place. + canDedupe (preferDedupe = false, explicitRequest = false) { + // not allowed to mess with shrinkwraps or bundles + if (this.inDepBundle || this.inShrinkwrap) { + return false + } + + // it's a top level pkg, or a dep of one + if (!this.resolveParent || !this.resolveParent.resolveParent) { + return false + } + + // no one wants it, remove it + if (this.edgesIn.size === 0) { + return true + } + + const other = this.resolveParent.resolveParent.resolve(this.name) + + // nothing else, need this one + if (!other) { + return false + } + + // if it's the same thing, then always fine to remove + if (other.matches(this)) { + return true + } + + // if the other thing can't replace this, then skip it + if (!other.canReplace(this)) { + return false + } + + // if we prefer dedupe, or if the version is equal, take the other + if (preferDedupe || semver.eq(other.version, this.version)) { + return true + } + + // if our current version isn't the result of an override, then prefer to take the greater version + if (!this.overridden && semver.gt(other.version, this.version)) { + return true + } + + // if the other version was an explicit request, then prefer to take the other version + if (explicitRequest) { + return true + } + + return false + } + + satisfies (requested) { + if (requested instanceof Edge) { + return this.name === requested.name && requested.satisfiedBy(this) + } + + const parsed = npa(requested) + const { name = this.name, rawSpec: spec } = parsed + return this.name === name && this.satisfies(new Edge({ + from: new Node({ path: this.root.realpath }), + type: 'prod', + name, + spec, + })) + } + + matches (node) { + // if the nodes are literally the same object, obviously a match. + if (node === this) { + return true + } + + // if the names don't match, they're different things, even if + // the package contents are identical. + if (node.name !== this.name) { + return false + } + + // if they're links, they match if the targets match + if (this.isLink) { + return node.isLink && this.target.matches(node.target) + } + + // if they're two project root nodes, they're different if the paths differ + if (this.isProjectRoot && node.isProjectRoot) { + return this.path === node.path + } + + // if the integrity matches, then they're the same. + if (this.integrity && node.integrity) { + return this.integrity === node.integrity + } + + // if no integrity, check resolved + if (this.resolved && node.resolved) { + return this.resolved === node.resolved + } + + // if no resolved, check both package name and version + // otherwise, conclude that they are different things + return this.packageName && node.packageName && + this.packageName === node.packageName && + this.version && node.version && + this.version === node.version + } + + // replace this node with the supplied argument + // Useful when mutating an ideal tree, so we can avoid having to call + // the parent/root setters more than necessary. + replaceWith (node) { + node.replace(this) + } + + replace (node) { + this[_delistFromMeta]() + + // if the name matches, but is not identical, we are intending to clobber + // something case-insensitively, so merely setting name and path won't + // have the desired effect. just set the path so it'll collide in the + // parent's children map, and leave it at that. + if (node.parent?.children.get(this.name) === node) { + this.path = resolve(node.parent.path, 'node_modules', this.name) + } else { + this.path = node.path + this.name = node.name + } + + if (!this.isLink) { + this.realpath = this.path + } + this[_refreshLocation]() + + // keep children when a node replaces another + if (!this.isLink) { + for (const kid of node.children.values()) { + kid.parent = this + } + if (node.isLink && node.target) { + node.target.root = null + } + } + + if (!node.isRoot) { + this.root = node.root + } + + treeCheck(this) + } + + get inShrinkwrap () { + return this.parent && + (this.parent.hasShrinkwrap || this.parent.inShrinkwrap) + } + + get parent () { + // setter prevents _parent from being this + return this[_parent] + } + + // This setter keeps everything in order when we move a node from + // one point in a logical tree to another. Edges get reloaded, + // metadata updated, etc. It's also called when we *replace* a node + // with another by the same name (eg, to update or dedupe). + // This does a couple of walks out on the node_modules tree, recursing + // into child nodes. However, as setting the parent is typically done + // with nodes that don't have many children, and (deduped) package + // trees tend to be broad rather than deep, it's not that bad. + // The only walk that starts from the parent rather than this node is + // limited by edge name. + set parent (parent) { + // when setting to null, just remove it from the tree entirely + if (!parent) { + // but only delete it if we actually had a parent in the first place + // otherwise it's just setting to null when it's already null + if (this[_parent]) { + this.root = null + } + return + } + + if (parent.isLink) { + parent = parent.target + } + + // setting a thing to its own parent is not normal, but no-op for safety + if (this === parent) { + return + } + + const oldParent = this[_parent] + + // nothing to do + if (oldParent === parent) { + return + } + + // ok now we know something is actually changing, and parent is not a link + const newPath = resolve(parent.path, 'node_modules', this.name) + const pathChange = newPath !== this.path + + // remove from old parent/fsParent + if (oldParent) { + oldParent.children.delete(this.name) + this[_parent] = null + } + if (this.fsParent) { + this.fsParent.fsChildren.delete(this) + this[_fsParent] = null + } + + // update this.path/realpath for this and all children/fsChildren + if (pathChange) { + this[_changePath](newPath) + } + + // clobbers anything at that path, resets all appropriate references + this.root = parent.root + } + + // Call this before changing path or updating the _root reference. + // Removes the node from its root the metadata and inventory. + [_delistFromMeta] () { + const root = this.root + if (!root.realpath || !this.path) { + return + } + root.inventory.delete(this) + root.tops.delete(this) + if (root.meta) { + root.meta.delete(this.path) + } + /* istanbul ignore next - should be impossible */ + debug(() => { + if ([...root.inventory.values()].includes(this)) { + throw new Error('failed to delist') + } + }) + } + + // update this.path/realpath and the paths of all children/fsChildren + [_changePath] (newPath) { + // have to de-list before changing paths + this[_delistFromMeta]() + const oldPath = this.path + this.path = newPath + const namePattern = /(?:^|\/|\\)node_modules[\\/](@[^/\\]+[\\/][^\\/]+|[^\\/]+)$/ + const nameChange = newPath.match(namePattern) + if (nameChange && this.name !== nameChange[1]) { + this.name = nameChange[1].replace(/\\/g, '/') + } + + // if we move a link target, update link realpaths + if (!this.isLink) { + this.realpath = newPath + for (const link of this.linksIn) { + link[_delistFromMeta]() + link.realpath = newPath + link[_refreshLocation]() + } + } + // if we move /x to /y, then a module at /x/a/b becomes /y/a/b + for (const child of this.fsChildren) { + child[_changePath](resolve(newPath, relative(oldPath, child.path))) + } + for (const [name, child] of this.children.entries()) { + child[_changePath](resolve(newPath, 'node_modules', name)) + } + + this[_refreshLocation]() + } + + // Called whenever the root/parent is changed. + // NB: need to remove from former root's meta/inventory and then update + // this.path BEFORE calling this method! + [_refreshLocation] () { + const root = this.root + const loc = relpath(root.realpath, this.path) + + this.location = loc + + root.inventory.add(this) + if (root.meta) { + root.meta.add(this) + } + } + + assertRootOverrides () { + if (!this.isProjectRoot || !this.overrides) { + return + } + + for (const edge of this.edgesOut.values()) { + // if these differ an override has been applied, those are not allowed + // for top level dependencies so throw an error + if (edge.spec !== edge.rawSpec && !edge.spec.startsWith('$')) { + throw Object.assign(new Error(`Override for ${edge.name}@${edge.rawSpec} conflicts with direct dependency`), { code: 'EOVERRIDE' }) + } + } + } + + addEdgeOut (edge) { + if (this.overrides) { + edge.overrides = this.overrides.getEdgeRule(edge) + } + + this.edgesOut.set(edge.name, edge) + } + + recalculateOutEdgesOverrides () { + // For each edge out propagate the new overrides through. + for (const edge of this.edgesOut.values()) { + edge.reload(true) + if (edge.to) { + edge.to.updateOverridesEdgeInAdded(edge.overrides) + } + } + } + + updateOverridesEdgeInRemoved (otherOverrideSet) { + // If this edge's overrides isn't equal to this node's overrides, then removing it won't change newOverrideSet later. + if (!this.overrides || !this.overrides.isEqual(otherOverrideSet)) { + return false + } + let newOverrideSet + for (const edge of this.edgesIn) { + if (newOverrideSet && edge.overrides) { + newOverrideSet = OverrideSet.findSpecificOverrideSet(edge.overrides, newOverrideSet) + } else { + newOverrideSet = edge.overrides + } + } + if (this.overrides.isEqual(newOverrideSet)) { + return false + } + this.overrides = newOverrideSet + if (this.overrides) { + // Optimization: if there's any override set at all, then no non-extraneous node has an empty override set. So if we temporarily have no + // override set (for example, we removed all the edges in), there's no use updating all the edges out right now. Let's just wait until + // we have an actual override set later. + this.recalculateOutEdgesOverrides() + } + return true + } + + // This logic isn't perfect either. When we have two edges in that have different override sets, then we have to decide which set is correct. + // This function assumes the more specific override set is applicable, so if we have dependencies A->B->C and A->C + // and an override set that specifies what happens for C under A->B, this will work even if the new A->C edge comes along and tries to change + // the override set. + // The strictly correct logic is not to allow two edges with different overrides to point to the same node, because even if this node can satisfy + // both, one of its dependencies might need to be different depending on the edge leading to it. + // However, this might cause a lot of duplication, because the conflict in the dependencies might never actually happen. + updateOverridesEdgeInAdded (otherOverrideSet) { + if (!otherOverrideSet) { + // Assuming there are any overrides at all, the overrides field is never undefined for any node at the end state of the tree. + // So if the new edge's overrides is undefined it will be updated later. So we can wait with updating the node's overrides field. + return false + } + if (!this.overrides) { + this.overrides = otherOverrideSet + this.recalculateOutEdgesOverrides() + return true + } + if (this.overrides.isEqual(otherOverrideSet)) { + return false + } + const newOverrideSet = OverrideSet.findSpecificOverrideSet(this.overrides, otherOverrideSet) + if (newOverrideSet) { + if (!this.overrides.isEqual(newOverrideSet)) { + this.overrides = newOverrideSet + this.recalculateOutEdgesOverrides() + return true + } + return false + } + // This is an error condition. We can only get here if the new override set is in conflict with the existing. + log.silly('Conflicting override sets', this.name) + } + + deleteEdgeIn (edge) { + this.edgesIn.delete(edge) + if (edge.overrides) { + this.updateOverridesEdgeInRemoved(edge.overrides) + } + } + + addEdgeIn (edge) { + // We need to handle the case where the new edge in has an overrides field which is different from the current value. + if (!this.overrides || !this.overrides.isEqual(edge.overrides)) { + this.updateOverridesEdgeInAdded(edge.overrides) + } + + this.edgesIn.add(edge) + + // try to get metadata from the yarn.lock file + if (this.root.meta) { + this.root.meta.addEdge(edge) + } + } + + [_reloadNamedEdges] (name, rootLoc = this.location) { + const edge = this.edgesOut.get(name) + // if we don't have an edge, do nothing, but keep descending + const rootLocResolved = edge && edge.to && + edge.to.location === `${rootLoc}/node_modules/${edge.name}` + const sameResolved = edge && this.resolve(name) === edge.to + const recheck = rootLocResolved || !sameResolved + if (edge && recheck) { + edge.reload(true) + } + for (const c of this.children.values()) { + c[_reloadNamedEdges](name, rootLoc) + } + + for (const c of this.fsChildren) { + c[_reloadNamedEdges](name, rootLoc) + } + } + + get isLink () { + return false + } + + get target () { + return this + } + + set target (n) { + debug(() => { + throw Object.assign(new Error('cannot set target on non-Link Nodes'), { + path: this.path, + }) + }) + } + + get depth () { + if (this.isTop) { + return 0 + } + return this.parent.depth + 1 + } + + get isTop () { + return !this.parent || this.globalTop + } + + get top () { + if (this.isTop) { + return this + } + return this.parent.top + } + + get isFsTop () { + return !this.fsParent + } + + get fsTop () { + if (this.isFsTop) { + return this + } + return this.fsParent.fsTop + } + + get resolveParent () { + return this.parent || this.fsParent + } + + resolve (name) { + /* istanbul ignore next - should be impossible, + * but I keep doing this mistake in tests */ + debug(() => { + if (typeof name !== 'string' || !name) { + throw new Error('non-string passed to Node.resolve') + } + }) + const mine = this.children.get(name) + if (mine) { + return mine + } + const resolveParent = this.resolveParent + if (resolveParent) { + return resolveParent.resolve(name) + } + return null + } + + inNodeModules () { + const rp = this.realpath + const name = this.name + const scoped = name.charAt(0) === '@' + const d = dirname(rp) + const nm = scoped ? dirname(d) : d + const dir = dirname(nm) + const base = scoped ? `${basename(d)}/${basename(rp)}` : basename(rp) + return base === name && basename(nm) === 'node_modules' ? dir : false + } + + // maybe accept both string value or array of strings + // seems to be what dom API does + querySelectorAll (query, opts) { + return querySelectorAll(this, query, opts) + } + + toJSON () { + return printableTree(this) + } + + [util.inspect.custom] () { + return this.toJSON() + } + + resetDepFlags () { + this.extraneous = true + this.dev = true + this.optional = true + this.devOptional = true + this.peer = true + } + + unsetDepFlags () { + this.extraneous = false + this.dev = false + this.optional = false + this.devOptional = false + this.peer = false + } +} + +module.exports = Node diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/optional-set.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/optional-set.js new file mode 100644 index 0000000000000000000000000000000000000000..ecb7815b5616fcbb27153c151b31f81c6dcea290 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/optional-set.js @@ -0,0 +1,32 @@ +// when an optional dep fails to install, we need to remove the branch of the +// graph up to the first optionalDependencies, as well as any nodes that are +// only required by other nodes in the set. +// +// This function finds the set of nodes that will need to be removed in that +// case. +// +// Note that this is *only* going to work with trees where calcDepFlags +// has been called, because we rely on the node.optional flag. + +const gatherDepSet = require('./gather-dep-set.js') +const optionalSet = node => { + // start with the node, then walk up the dependency graph until we + // get to the boundaries that define the optional set. since the + // node is optional, we know that all paths INTO this area of the + // graph are optional, but there may be non-optional dependencies + // WITHIN the area. + const set = new Set([node]) + for (const node of set) { + for (const edge of node.edgesIn) { + if (!edge.optional) { + set.add(edge.from) + } + } + } + + // now that we've hit the boundary, gather the rest of the nodes in + // the optional section that don't have dependents outside the set. + return gatherDepSet(set, edge => !set.has(edge.to)) +} + +module.exports = optionalSet diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/override-resolves.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/override-resolves.js new file mode 100644 index 0000000000000000000000000000000000000000..facbabc8012cac55ceb11715049511f787633d5c --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/override-resolves.js @@ -0,0 +1,11 @@ +function overrideResolves (resolved, opts) { + const { omitLockfileRegistryResolved = false } = opts + + if (omitLockfileRegistryResolved) { + return undefined + } + + return resolved +} + +module.exports = { overrideResolves } diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/override-set.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/override-set.js new file mode 100644 index 0000000000000000000000000000000000000000..64c0c3e39029972d3485fa773adfe590bfd39aaa --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/override-set.js @@ -0,0 +1,304 @@ +const npa = require('npm-package-arg') +const semver = require('semver') +const { log } = require('proc-log') + +class OverrideSet { + constructor ({ overrides, key, parent }) { + this.parent = parent + this.children = new Map() + + if (typeof overrides === 'string') { + overrides = { '.': overrides } + } + + // change a literal empty string to * so we can use truthiness checks on + // the value property later + if (overrides['.'] === '') { + overrides['.'] = '*' + } + + if (parent) { + const spec = npa(key) + if (!spec.name) { + throw new Error(`Override without name: ${key}`) + } + + this.name = spec.name + spec.name = '' + this.key = key + this.keySpec = spec.toString() + this.value = overrides['.'] || this.keySpec + } + + for (const [key, childOverrides] of Object.entries(overrides)) { + if (key === '.') { + continue + } + + const child = new OverrideSet({ + parent: this, + key, + overrides: childOverrides, + }) + + this.children.set(child.key, child) + } + } + + childrenAreEqual (other) { + if (this.children.size !== other.children.size) { + return false + } + for (const [key] of this.children) { + if (!other.children.has(key)) { + return false + } + if (this.children.get(key).value !== other.children.get(key).value) { + return false + } + if (!this.children.get(key).childrenAreEqual(other.children.get(key))) { + return false + } + } + return true + } + + isEqual (other) { + if (this === other) { + return true + } + if (!other) { + return false + } + if (this.key !== other.key || this.value !== other.value) { + return false + } + if (!this.childrenAreEqual(other)) { + return false + } + if (!this.parent) { + return !other.parent + } + return this.parent.isEqual(other.parent) + } + + getEdgeRule (edge) { + for (const rule of this.ruleset.values()) { + if (rule.name !== edge.name) { + continue + } + + // if keySpec is * we found our override + if (rule.keySpec === '*') { + return rule + } + + // We need to use the rawSpec here, because the spec has the overrides applied to it already. + // rawSpec can be undefined, so we need to use the fallback value of spec if it is. + let spec = npa(`${edge.name}@${edge.rawSpec || edge.spec}`) + if (spec.type === 'alias') { + spec = spec.subSpec + } + + if (spec.type === 'git') { + if (spec.gitRange && semver.intersects(spec.gitRange, rule.keySpec)) { + return rule + } + + continue + } + + if (spec.type === 'range' || spec.type === 'version') { + if (semver.intersects(spec.fetchSpec, rule.keySpec)) { + return rule + } + + continue + } + + // if we got this far, the spec type is one of tag, directory or file + // which means we have no real way to make version comparisons, so we + // just accept the override + return rule + } + + return this + } + + getNodeRule (node) { + for (const rule of this.ruleset.values()) { + if (rule.name !== node.name) { + continue + } + + if (semver.satisfies(node.version, rule.keySpec) || + semver.satisfies(node.version, rule.value)) { + return rule + } + } + + return this + } + + getMatchingRule (node) { + for (const rule of this.ruleset.values()) { + if (rule.name !== node.name) { + continue + } + + if (semver.satisfies(node.version, rule.keySpec) || + semver.satisfies(node.version, rule.value)) { + return rule + } + } + + return null + } + + * ancestry () { + for (let ancestor = this; ancestor; ancestor = ancestor.parent) { + yield ancestor + } + } + + get isRoot () { + return !this.parent + } + + get ruleset () { + const ruleset = new Map() + + for (const override of this.ancestry()) { + for (const kid of override.children.values()) { + if (!ruleset.has(kid.key)) { + ruleset.set(kid.key, kid) + } + } + + if (!override.isRoot && !ruleset.has(override.key)) { + ruleset.set(override.key, override) + } + } + + return ruleset + } + + static findSpecificOverrideSet (first, second) { + for (let overrideSet = second; overrideSet; overrideSet = overrideSet.parent) { + if (overrideSet.isEqual(first)) { + return second + } + } + for (let overrideSet = first; overrideSet; overrideSet = overrideSet.parent) { + if (overrideSet.isEqual(second)) { + return first + } + } + + // The override sets are incomparable (e.g. siblings like the "react" and "react-dom" children of the root override set). Check if they have semantically conflicting rules before treating this as an error. + if (this.haveConflictingRules(first, second)) { + log.silly('Conflicting override sets', first, second) + return undefined + } + + // The override sets are structurally incomparable but have compatible rules. Fall back to their nearest common ancestor so the node still has a valid override set. + return this.findCommonAncestor(first, second) + } + + static findCommonAncestor (first, second) { + const firstAncestors = [] + for (const ancestor of first.ancestry()) { + firstAncestors.push(ancestor) + } + for (const secondAnc of second.ancestry()) { + for (const firstAnc of firstAncestors) { + if (firstAnc.isEqual(secondAnc)) { + return firstAnc + } + } + } + return null + } + + static doOverrideSetsConflict (first, second) { + // If override sets contain one another then we can try to use the more specific one. + // If neither one is more specific, check for semantic conflicts. + const specificSet = this.findSpecificOverrideSet(first, second) + if (specificSet !== undefined) { + // One contains the other, so no conflict + return false + } + + // The override sets are structurally incomparable, but this doesn't necessarily + // mean they conflict. We need to check if they have conflicting version requirements + // for any package that appears in both rulesets. + return this.haveConflictingRules(first, second) + } + + static haveConflictingRules (first, second) { + // Get all rules from both override sets + const firstRules = first.ruleset + const secondRules = second.ruleset + + // Check each package that appears in both rulesets + for (const [key, firstRule] of firstRules) { + const secondRule = secondRules.get(key) + if (!secondRule) { + // Package only appears in one ruleset, no conflict + continue + } + + // Same rule object means no conflict + if (firstRule === secondRule || firstRule.isEqual(secondRule)) { + continue + } + + // Both rulesets have rules for this package with different values. + // Check if the version requirements are actually incompatible. + const firstValue = firstRule.value + const secondValue = secondRule.value + + // If either value is a reference (starts with $), we can't determine + // compatibility here - the reference might resolve to compatible versions. + // We defer to runtime resolution rather than failing early. + if (firstValue.startsWith('$') || secondValue.startsWith('$')) { + continue + } + + // Check if the version ranges are compatible using semver + // If both specify version ranges, they conflict only if they have no overlap + try { + const firstSpec = npa(`${firstRule.name}@${firstValue}`) + const secondSpec = npa(`${secondRule.name}@${secondValue}`) + + // For range/version types, check if they intersect + if ((firstSpec.type === 'range' || firstSpec.type === 'version') && + (secondSpec.type === 'range' || secondSpec.type === 'version')) { + // Check if the ranges intersect + const firstRange = firstSpec.fetchSpec + const secondRange = secondSpec.fetchSpec + + // If the ranges don't intersect, we have a real conflict + if (!semver.intersects(firstRange, secondRange)) { + log.silly('Found conflicting override rules', { + package: firstRule.name, + first: firstValue, + second: secondValue, + }) + return true + } + } + // For other types (git, file, directory, tag), we can't easily determine + // compatibility, so we conservatively assume no conflict + } catch { + // If we can't parse the specs, conservatively assume no conflict + // Real conflicts will be caught during dependency resolution + } + } + + // No conflicting rules found + return false + } +} + +module.exports = OverrideSet diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/packument-cache.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/packument-cache.js new file mode 100644 index 0000000000000000000000000000000000000000..da8c7b971edff4b6f3c3d9bb75052da35233287f --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/packument-cache.js @@ -0,0 +1,77 @@ +const { LRUCache } = require('lru-cache') +const { getHeapStatistics } = require('node:v8') +const { log } = require('proc-log') + +// This is an in-memory cache that Pacote uses for packuments. +// Packuments are usually cached on disk. This allows for rapid re-requests +// of the same packument to bypass disk reads. The tradeoff here is memory +// usage for disk reads. +class PackumentCache extends LRUCache { + static #heapLimit = Math.floor(getHeapStatistics().heap_size_limit) + + #sizeKey + #disposed = new Set() + + #log (...args) { + log.silly('packumentCache', ...args) + } + + constructor ({ + // How much of this.#heapLimit to take up + heapFactor = 0.25, + // How much of this.#maxSize we allow any one packument to take up + // Anything over this is not cached + maxEntryFactor = 0.5, + sizeKey = '_contentLength', + } = {}) { + const maxSize = Math.floor(PackumentCache.#heapLimit * heapFactor) + const maxEntrySize = Math.floor(maxSize * maxEntryFactor) + super({ + maxSize, + maxEntrySize, + sizeCalculation: (p) => { + // Don't cache if we don't know the size + // Some versions of pacote set this to `0`, newer versions set it to `null` + if (!p[sizeKey]) { + return maxEntrySize + 1 + } + if (p[sizeKey] < 10_000) { + return p[sizeKey] * 2 + } + if (p[sizeKey] < 1_000_000) { + return Math.floor(p[sizeKey] * 1.5) + } + // It is less beneficial to store a small amount of super large things + // at the cost of all other packuments. + return maxEntrySize + 1 + }, + dispose: (v, k) => { + this.#disposed.add(k) + this.#log(k, 'dispose') + }, + }) + this.#sizeKey = sizeKey + this.#log(`heap:${PackumentCache.#heapLimit} maxSize:${maxSize} maxEntrySize:${maxEntrySize}`) + } + + set (k, v, ...args) { + // we use disposed only for a logging signal if we are setting packuments that + // have already been evicted from the cache previously. logging here could help + // us tune this in the future. + const disposed = this.#disposed.has(k) + /* istanbul ignore next - this doesnt happen consistently so hard to test without resorting to unit tests */ + if (disposed) { + this.#disposed.delete(k) + } + this.#log(k, 'set', `size:${v[this.#sizeKey]} disposed:${disposed}`) + return super.set(k, v, ...args) + } + + has (k, ...args) { + const has = super.has(k, ...args) + this.#log(k, `cache-${has ? 'hit' : 'miss'}`) + return has + } +} + +module.exports = PackumentCache diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/peer-entry-sets.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/peer-entry-sets.js new file mode 100644 index 0000000000000000000000000000000000000000..262209bd8a992f348db663818d700820665b6dce --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/peer-entry-sets.js @@ -0,0 +1,77 @@ +// Given a node in a tree, return all of the peer dependency sets that +// it is a part of, with the entry (top or non-peer) edges into the sets +// identified. +// +// With this information, we can determine whether it is appropriate to +// replace the entire peer set with another (and remove the old one), +// push the set deeper into the tree, and so on. +// +// Returns a Map of { edge => Set(peerNodes) }, + +const peerEntrySets = node => { + // this is the union of all peer groups that the node is a part of + // later, we identify all of the entry edges, and create a set of + // 1 or more overlapping sets that this node is a part of. + const unionSet = new Set([node]) + for (const node of unionSet) { + for (const edge of node.edgesOut.values()) { + if (edge.valid && edge.peer && edge.to) { + unionSet.add(edge.to) + } + } + for (const edge of node.edgesIn) { + if (edge.valid && edge.peer) { + unionSet.add(edge.from) + } + } + } + const entrySets = new Map() + for (const peer of unionSet) { + for (const edge of peer.edgesIn) { + // if not valid, it doesn't matter anyway. either it's been previously + // peerConflicted, or it's the thing we're interested in replacing. + if (!edge.valid) { + continue + } + // this is the entry point into the peer set + if (!edge.peer || edge.from.isTop) { + // get the subset of peer brought in by this peer entry edge + const sub = new Set([peer]) + for (const peer of sub) { + for (const edge of peer.edgesOut.values()) { + if (edge.valid && edge.peer && edge.to) { + sub.add(edge.to) + } + } + } + // if this subset does not include the node we are focused on, + // then it is not relevant for our purposes. Example: + // + // a -> (b, c, d) + // b -> PEER(d) b -> d -> e -> f <-> g + // c -> PEER(f, h) c -> (f <-> g, h -> g) + // d -> PEER(e) d -> e -> f <-> g + // e -> PEER(f) + // f -> PEER(g) + // g -> PEER(f) + // h -> PEER(g) + // + // The unionSet(e) will include c, but we don't actually care about + // it. We only expanded to the edge of the peer nodes in order to + // find the entry edges that caused the inclusion of peer sets + // including (e), so we want: + // Map{ + // Edge(a->b) => Set(b, d, e, f, g) + // Edge(a->d) => Set(d, e, f, g) + // } + if (sub.has(node)) { + entrySets.set(edge, sub) + } + } + } + } + + return entrySets +} + +module.exports = peerEntrySets diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js new file mode 100644 index 0000000000000000000000000000000000000000..c8d1e4e6ca73f9ba4f655a040a1b44d02fff5bf2 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js @@ -0,0 +1,569 @@ +// Given a dep, a node that depends on it, and the edge representing that +// dependency, place the dep somewhere in the node's tree, and all of its +// peer dependencies. +// +// Handles all of the tree updating needed to place the dep, including +// removing replaced nodes, pruning now-extraneous or invalidated nodes, +// and saves a set of what was placed and what needs re-evaluation as +// a result. + +const localeCompare = require('@isaacs/string-locale-compare')('en') +const { log } = require('proc-log') +const { redact } = require('@npmcli/redact') +const deepestNestingTarget = require('./deepest-nesting-target.js') +const CanPlaceDep = require('./can-place-dep.js') +const { + KEEP, + CONFLICT, +} = CanPlaceDep +const debug = require('./debug.js') + +const Link = require('./link.js') +const gatherDepSet = require('./gather-dep-set.js') +const peerEntrySets = require('./peer-entry-sets.js') + +class PlaceDep { + constructor (options) { + this.auditReport = options.auditReport + this.dep = options.dep + this.edge = options.edge + this.explicitRequest = options.explicitRequest + this.force = options.force + this.installLinks = options.installLinks + this.installStrategy = options.installStrategy + this.legacyPeerDeps = options.legacyPeerDeps + this.parent = options.parent || null + this.preferDedupe = options.preferDedupe + this.strictPeerDeps = options.strictPeerDeps + this.updateNames = options.updateNames + + this.canPlace = null + this.canPlaceSelf = null + // XXX this only appears to be used by tests + this.checks = new Map() + this.children = [] + this.needEvaluation = new Set() + this.peerConflict = null + this.placed = null + this.target = null + + this.current = this.edge.to + this.name = this.edge.name + this.top = this.parent?.top || this + + // nothing to do if the edge is fine as it is + if (this.edge.to && + !this.edge.error && + !this.explicitRequest && + !this.updateNames.includes(this.edge.name) && + !this.auditReport?.isVulnerable(this.edge.to)) { + return + } + + // walk up the tree until we hit either a top/root node, or a place + // where the dep is not a peer dep. + const start = this.getStartNode() + + for (const target of start.ancestry()) { + // if the current location has a peerDep on it, then we can't place here + // this is pretty rare to hit, since we always prefer deduping peers, + // and the getStartNode will start us out above any peers from the + // thing that depends on it. but we could hit it with something like: + // + // a -> (b@1, c@1) + // +-- c@1 + // +-- b -> PEEROPTIONAL(v) (c@2) + // +-- c@2 -> (v) + // + // So we check if we can place v under c@2, that's fine. + // Then we check under b, and can't, because of the optional peer dep. + // but we CAN place it under a, so the correct thing to do is keep + // walking up the tree. + const targetEdge = target.edgesOut.get(this.edge.name) + if (!target.isTop && targetEdge && targetEdge.peer) { + continue + } + + const cpd = new CanPlaceDep({ + dep: this.dep, + edge: this.edge, + // note: this sets the parent's canPlace as the parent of this + // canPlace, but it does NOT add this canPlace to the parent's + // children. This way, we can know that it's a peer dep, and + // get the top edge easily, while still maintaining the + // tree of checks that factored into the original decision. + parent: this.parent && this.parent.canPlace, + target, + preferDedupe: this.preferDedupe, + explicitRequest: this.explicitRequest, + }) + this.checks.set(target, cpd) + + // It's possible that a "conflict" is a conflict among the *peers* of + // a given node we're trying to place, but there actually is no current + // node. Eg, + // root -> (a, b) + // a -> PEER(c) + // b -> PEER(d) + // d -> PEER(c@2) + // We place (a), and get a peer of (c) along with it. + // then we try to place (b), and get CONFLICT in the check, because + // of the conflicting peer from (b)->(d)->(c@2). In that case, we + // should treat (b) and (d) as OK, and place them in the last place + // where they did not themselves conflict, and skip c@2 if conflict + // is ok by virtue of being forced or not ours and not strict. + if (cpd.canPlaceSelf !== CONFLICT) { + this.canPlaceSelf = cpd + } + + // we found a place this can go, along with all its peer friends. + // we break when we get the first conflict + if (cpd.canPlace !== CONFLICT) { + this.canPlace = cpd + } else { + break + } + + // if it's a load failure, just plop it in the first place attempted, + // since we're going to crash the build or prune it out anyway. + // but, this will frequently NOT be a successful canPlace, because + // it'll have no version or other information. + if (this.dep.errors.length) { + break + } + + // nest packages like npm v1 and v2 + // very disk-inefficient + if (this.installStrategy === 'nested') { + break + } + + // when installing globally, or just in global style, we never place + // deps above the first level. + if (this.installStrategy === 'shallow') { + const rp = target.resolveParent + if (rp && rp.isProjectRoot) { + break + } + } + } + + // if we can't find a target, that means that the last place checked, + // and all the places before it, had a conflict. + if (!this.canPlace) { + // if not forced, and it's our dep, or strictPeerDeps is set, then + // this is an ERESOLVE error. + if (!this.force && (this.isMine || this.strictPeerDeps)) { + return this.failPeerConflict() + } + + // ok! we're gonna allow the conflict, but we should still warn + // if we have a current, then we treat CONFLICT as a KEEP. + // otherwise, we just skip it. Only warn on the one that actually + // could not be placed somewhere. + if (!this.canPlaceSelf) { + this.warnPeerConflict() + return + } + + this.canPlace = this.canPlaceSelf + } + + // now we have a target, a tree of CanPlaceDep results for the peer group, + // and we are ready to go + + /* istanbul ignore next */ + if (!this.canPlace) { + debug(() => { + throw new Error('canPlace not set, but trying to place in tree') + }) + return + } + + const { target } = this.canPlace + + log.silly( + 'placeDep', + target.location || 'ROOT', + `${this.dep.name}@${this.dep.version}`, + this.canPlace.description, + `for: ${this.edge.from.package._id || this.edge.from.location}`, + `want: ${redact(this.edge.spec || '*')}` + ) + + const placementType = this.canPlace.canPlace === CONFLICT + ? this.canPlace.canPlaceSelf + : this.canPlace.canPlace + + // if we're placing in the tree with --force, we can get here even though + // it's a conflict. Treat it as a KEEP, but warn and move on. + if (placementType === KEEP) { + // this was a peerConflicted peer dep + if (this.edge.peer && !this.edge.valid) { + this.warnPeerConflict() + } + + // if we get a KEEP in an update scenario, then we MAY have something + // already duplicating this unnecessarily! For example: + // ``` + // root (dep: y@1) + // +-- x (dep: y@1.1) + // | +-- y@1.1.0 (replacing with 1.1.2, got KEEP at the root) + // +-- y@1.1.2 (updated already from 1.0.0) + // ``` + // Now say we do `reify({update:['y']})`, and the latest version is + // 1.1.2, which we now have in the root. We'll try to place y@1.1.2 + // first in x, then in the root, ending with KEEP, because we already + // have it. In that case, we ought to REMOVE the nm/x/nm/y node, because + // it is an unnecessary duplicate. + this.pruneDedupable(target) + return + } + + // we were told to place it here in the target, so either it does not + // already exist in the tree, OR it's shadowed. + // handle otherwise unresolvable dependency nesting loops by + // creating a symbolic link + // a1 -> b1 -> a2 -> b2 -> a1 -> ... + // instead of nesting forever, when the loop occurs, create + // a symbolic link to the earlier instance + for (let p = target; p; p = p.resolveParent) { + if (p.matches(this.dep) && !p.isTop) { + this.placed = new Link({ parent: target, target: p }) + return + } + } + + // XXX if we are replacing SOME of a peer entry group, we will need to + // remove any that are not being replaced and will now be invalid, and + // re-evaluate them deeper into the tree. + + const virtualRoot = this.dep.parent + this.placed = new this.dep.constructor({ + name: this.dep.name, + pkg: this.dep.package, + resolved: this.dep.resolved, + integrity: this.dep.integrity, + installLinks: this.installLinks, + legacyPeerDeps: this.legacyPeerDeps, + error: this.dep.errors[0], + ...(this.dep.overrides ? { overrides: this.dep.overrides } : {}), + ...(this.dep.isLink ? { target: this.dep.target, realpath: this.dep.realpath } : {}), + }) + + this.oldDep = target.children.get(this.name) + if (this.oldDep) { + this.replaceOldDep() + } else { + this.placed.parent = target + } + + // if it's a peerConflicted peer dep, warn about it + if (this.edge.peer && !this.placed.satisfies(this.edge)) { + this.warnPeerConflict() + } + + // If the edge is not an error, then we're updating something, and + // MAY end up putting a better/identical node further up the tree in + // a way that causes an unnecessary duplication. If so, remove the + // now-unnecessary node. + if (this.edge.valid && this.edge.to && this.edge.to !== this.placed) { + this.pruneDedupable(this.edge.to, false) + } + + // in case we just made some duplicates that can be removed, + // prune anything deeper in the tree that can be replaced by this + for (const node of target.root.inventory.query('name', this.name)) { + if (node.isDescendantOf(target) && !node.isTop) { + this.pruneDedupable(node, false) + // only walk the direct children of the ones we kept + if (node.root === target.root) { + for (const kid of node.children.values()) { + this.pruneDedupable(kid, false) + } + } + } + } + + // also place its unmet or invalid peer deps at this location + // loop through any peer deps from the thing we just placed, and place + // those ones as well. it's safe to do this with the virtual nodes, + // because we're copying rather than moving them out of the virtual root, + // otherwise they'd be gone and the peer set would change throughout + // this loop. + for (const peerEdge of this.placed.edgesOut.values()) { + if (peerEdge.valid || !peerEdge.peer || peerEdge.peerConflicted) { + continue + } + + const peer = virtualRoot.children.get(peerEdge.name) + + // Note: if the virtualRoot *doesn't* have the peer, then that means + // it's an optional peer dep. If it's not being properly met (ie, + // peerEdge.valid is false), then this is likely heading for an + // ERESOLVE error, unless it can walk further up the tree. + if (!peer) { + continue + } + + // peerConflicted peerEdge, just accept what's there already + if (!peer.satisfies(peerEdge)) { + continue + } + + this.children.push(new PlaceDep({ + auditReport: this.auditReport, + explicitRequest: this.explicitRequest, + force: this.force, + installLinks: this.installLinks, + installStrategy: this.installStrategy, + legacyPeerDeps: this.legacyPeerDeps, + preferDedupe: this.preferDedupe, + strictPeerDeps: this.strictPeerDeps, + updateNames: this.updateName, + parent: this, + dep: peer, + node: this.placed, + edge: peerEdge, + })) + } + } + + replaceOldDep () { + const target = this.oldDep.parent + + // XXX handle replacing an entire peer group? + // what about cases where we need to push some other peer groups deeper + // into the tree? all the tree updating should be done here, and track + // all the things that we add and remove, so that we can know what + // to re-evaluate. + + // if we're replacing, we should also remove any nodes for edges that + // are now invalid, and where this (or its deps) is the only dependent, + // and also recurse on that pruning. Otherwise leaving that dep node + // around can result in spurious conflicts pushing nodes deeper into + // the tree than needed in the case of cycles that will be removed + // later anyway. + const oldDeps = [] + for (const [name, edge] of this.oldDep.edgesOut.entries()) { + if (!this.placed.edgesOut.has(name) && edge.to) { + oldDeps.push(...gatherDepSet([edge.to], e => e.to !== edge.to)) + } + } + + // gather all peer edgesIn which are at this level, and will not be + // satisfied by the new dependency. Those are the peer sets that need + // to be either warned about (if they cannot go deeper), or removed and + // re-placed (if they can). + const prunePeerSets = [] + for (const edge of this.oldDep.edgesIn) { + if (this.placed.satisfies(edge) || + !edge.peer || + edge.from.parent !== target || + edge.peerConflicted) { + // not a peer dep, not invalid, or not from this level, so it's fine + // to just let it re-evaluate as a problemEdge later, or let it be + // satisfied by the new dep being placed. + continue + } + for (const entryEdge of peerEntrySets(edge.from).keys()) { + // either this one needs to be pruned and re-evaluated, or marked + // as peerConflicted and warned about. If the entryEdge comes in from + // the root or a workspace, then we have to leave it alone, and in that + // case, it will have already warned or crashed by getting to this point + const entryNode = entryEdge.to + const deepestTarget = deepestNestingTarget(entryNode) + if (deepestTarget !== target && + !(entryEdge.from.isProjectRoot || entryEdge.from.isWorkspace)) { + prunePeerSets.push(...gatherDepSet([entryNode], e => { + return e.to !== entryNode && !e.peerConflicted + })) + } else { + this.warnPeerConflict(edge, this.dep) + } + } + } + + this.placed.replace(this.oldDep) + this.pruneForReplacement(this.placed, oldDeps) + for (const dep of prunePeerSets) { + for (const edge of dep.edgesIn) { + this.needEvaluation.add(edge.from) + } + dep.root = null + } + } + + pruneForReplacement (node, oldDeps) { + // gather up all the now-invalid/extraneous edgesOut, as long as they are + // only depended upon by the old node/deps + const invalidDeps = new Set([...node.edgesOut.values()] + .filter(e => e.to && !e.valid).map(e => e.to)) + for (const dep of oldDeps) { + const set = gatherDepSet([dep], e => e.to !== dep && e.valid) + for (const dep of set) { + invalidDeps.add(dep) + } + } + + // ignore dependency edges from the node being replaced, but + // otherwise filter the set down to just the set with no + // dependencies from outside the set, except the node in question. + const deps = gatherDepSet(invalidDeps, edge => + edge.from !== node && edge.to !== node && edge.valid) + + // now just delete whatever's left, because it's junk + for (const dep of deps) { + dep.root = null + } + } + + // prune all the nodes in a branch of the tree that can be safely removed + // This is only the most basic duplication detection; it finds if there + // is another satisfying node further up the tree, and if so, dedupes. + // Even if installStrategy is nested, we do this amount of deduplication. + pruneDedupable (node, descend = true) { + if (node.canDedupe(this.preferDedupe, this.explicitRequest)) { + // gather up all deps that have no valid edges in from outside + // the dep set, except for this node we're deduping, so that we + // also prune deps that would be made extraneous. + const deps = gatherDepSet([node], e => e.to !== node && e.valid) + for (const node of deps) { + node.root = null + } + return + } + if (descend) { + // sort these so that they're deterministically ordered + // otherwise, resulting tree shape is dependent on the order + // in which they happened to be resolved. + const nodeSort = (a, b) => localeCompare(a.location, b.location) + + const children = [...node.children.values()].sort(nodeSort) + for (const child of children) { + this.pruneDedupable(child) + } + const fsChildren = [...node.fsChildren].sort(nodeSort) + for (const topNode of fsChildren) { + const children = [...topNode.children.values()].sort(nodeSort) + for (const child of children) { + this.pruneDedupable(child) + } + } + } + } + + get isMine () { + const { edge } = this.top + const { from: node } = edge + + if (node.isWorkspace || node.isProjectRoot) { + return true + } + + if (!edge.peer) { + return false + } + + // re-entry case. check if any non-peer edges come from the project, + // or any entryEdges on peer groups are from the root. + let hasPeerEdges = false + for (const edge of node.edgesIn) { + if (edge.peer) { + hasPeerEdges = true + continue + } + if (edge.from.isWorkspace || edge.from.isProjectRoot) { + return true + } + } + if (hasPeerEdges) { + for (const edge of peerEntrySets(node).keys()) { + if (edge.from.isWorkspace || edge.from.isProjectRoot) { + return true + } + } + } + + return false + } + + warnPeerConflict (edge, dep) { + edge = edge || this.edge + dep = dep || this.dep + edge.peerConflicted = true + const expl = this.explainPeerConflict(edge, dep) + log.warn('ERESOLVE', 'overriding peer dependency', expl) + } + + failPeerConflict (edge, dep) { + edge = edge || this.top.edge + dep = dep || this.top.dep + const expl = this.explainPeerConflict(edge, dep) + throw Object.assign(new Error('could not resolve'), expl) + } + + explainPeerConflict (edge, dep) { + const { from: node } = edge + const curNode = node.resolve(edge.name) + + // XXX decorate more with this.canPlace and this.canPlaceSelf, + // this.checks, this.children, walk over conflicted peers, etc. + const expl = { + code: 'ERESOLVE', + edge: edge.explain(), + dep: dep.explain(edge), + force: this.force, + isMine: this.isMine, + strictPeerDeps: this.strictPeerDeps, + } + + if (this.parent) { + // this is the conflicted peer + expl.current = curNode && curNode.explain(edge) + expl.peerConflict = this.current && this.current.explain(this.edge) + } else { + expl.current = curNode && curNode.explain() + if (this.canPlaceSelf && this.canPlaceSelf.canPlaceSelf !== CONFLICT) { + // failed while checking for a child dep + const cps = this.canPlaceSelf + for (const peer of cps.conflictChildren) { + if (peer.current) { + expl.peerConflict = { + current: peer.current.explain(), + peer: peer.dep.explain(peer.edge), + } + break + } + } + } else { + expl.peerConflict = { + current: this.current && this.current.explain(), + peer: this.dep.explain(this.edge), + } + } + } + + return expl + } + + getStartNode () { + // if we are a peer, then we MUST be at least as shallow as the peer + // dependent + const from = this.parent?.getStartNode() || this.edge.from + return deepestNestingTarget(from, this.name) + } + + // XXX this only appears to be used by tests + get allChildren () { + const set = new Set(this.children) + for (const child of set) { + for (const grandchild of child.children) { + set.add(grandchild) + } + } + return [...set] + } +} + +module.exports = PlaceDep diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/printable.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/printable.js new file mode 100644 index 0000000000000000000000000000000000000000..9e520aac89aaa45d2e1452c8c505a4fce3c2da16 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/printable.js @@ -0,0 +1,198 @@ +// helper function to output a clearer visualization +// of the current node and its descendents +const localeCompare = require('@isaacs/string-locale-compare')('en') +const util = require('node:util') +const relpath = require('./relpath.js') + +class ArboristNode { + constructor (tree, path) { + this.name = tree.name + if (tree.packageName && tree.packageName !== this.name) { + this.packageName = tree.packageName + } + if (tree.version) { + this.version = tree.version + } + this.location = tree.location + this.path = tree.path + if (tree.realpath !== this.path) { + this.realpath = tree.realpath + } + if (tree.resolved !== null) { + this.resolved = tree.resolved + } + if (tree.extraneous) { + this.extraneous = true + } + if (tree.dev) { + this.dev = true + } + if (tree.optional) { + this.optional = true + } + if (tree.devOptional && !tree.dev && !tree.optional) { + this.devOptional = true + } + if (tree.peer) { + this.peer = true + } + if (tree.inBundle) { + this.bundled = true + } + if (tree.inDepBundle) { + this.bundler = tree.getBundler().location + } + if (tree.isProjectRoot) { + this.isProjectRoot = true + } + if (tree.isWorkspace) { + this.isWorkspace = true + } + const bd = tree.package && tree.package.bundleDependencies + if (bd && bd.length) { + this.bundleDependencies = bd + } + if (tree.inShrinkwrap) { + this.inShrinkwrap = true + } else if (tree.hasShrinkwrap) { + this.hasShrinkwrap = true + } + if (tree.error) { + this.error = treeError(tree.error) + } + if (tree.errors && tree.errors.length) { + this.errors = tree.errors.map(treeError) + } + + if (tree.overrides) { + this.overrides = new Map([...tree.overrides.ruleset.values()] + .map((override) => [override.key, override.value])) + } + + // edgesOut sorted by name + if (tree.edgesOut.size) { + this.edgesOut = new Map([...tree.edgesOut.entries()] + .sort(([a], [b]) => localeCompare(a, b)) + .map(([name, edge]) => [name, new EdgeOut(edge)])) + } + + // edgesIn sorted by location + if (tree.edgesIn.size) { + this.edgesIn = new Set([...tree.edgesIn] + .sort((a, b) => localeCompare(a.from.location, b.from.location)) + .map(edge => new EdgeIn(edge))) + } + + if (tree.workspaces && tree.workspaces.size) { + this.workspaces = new Map([...tree.workspaces.entries()] + .map(([name, path]) => [name, relpath(tree.root.realpath, path)])) + } + + // fsChildren sorted by path + if (tree.fsChildren.size) { + this.fsChildren = new Set([...tree.fsChildren] + .sort(({ path: a }, { path: b }) => localeCompare(a, b)) + .map(tree => printableTree(tree, path))) + } + + // children sorted by name + if (tree.children.size) { + this.children = new Map([...tree.children.entries()] + .sort(([a], [b]) => localeCompare(a, b)) + .map(([name, tree]) => [name, printableTree(tree, path)])) + } + } +} + +class ArboristVirtualNode extends ArboristNode { + constructor (tree, path) { + super(tree, path) + this.sourceReference = printableTree(tree.sourceReference, path) + } +} + +class ArboristLink extends ArboristNode { + constructor (tree, path) { + super(tree, path) + this.target = printableTree(tree.target, path) + } +} + +const treeError = ({ code, path }) => ({ + code, + ...(path ? { path } : {}), +}) + +// print out edges without dumping the full node all over again +// this base class will toJSON as a plain old object, but the +// util.inspect() output will be a bit cleaner +class Edge { + constructor (edge) { + this.type = edge.type + this.name = edge.name + this.spec = edge.rawSpec || '*' + if (edge.rawSpec !== edge.spec) { + this.override = edge.spec + } + if (edge.error) { + this.error = edge.error + } + if (edge.peerConflicted) { + this.peerConflicted = edge.peerConflicted + } + } +} + +// don't care about 'from' for edges out +class EdgeOut extends Edge { + constructor (edge) { + super(edge) + this.to = edge.to && edge.to.location + } + + [util.inspect.custom] () { + return `{ ${this.type} ${this.name}@${this.spec}${ + this.override ? ` overridden:${this.override}` : '' + }${ + this.to ? ' -> ' + this.to : '' + }${ + this.error ? ' ' + this.error : '' + }${ + this.peerConflicted ? ' peerConflicted' : '' + } }` + } +} + +// don't care about 'to' for edges in +class EdgeIn extends Edge { + constructor (edge) { + super(edge) + this.from = edge.from && edge.from.location + } + + [util.inspect.custom] () { + return `{ ${this.from || '""'} ${this.type} ${this.name}@${this.spec}${ + this.error ? ' ' + this.error : '' + }${ + this.peerConflicted ? ' peerConflicted' : '' + } }` + } +} + +const printableTree = (tree, path = []) => { + if (!tree) { + return tree + } + + const Cls = tree.isLink ? ArboristLink + : tree.sourceReference ? ArboristVirtualNode + : ArboristNode + if (path.includes(tree)) { + const obj = Object.create(Cls.prototype) + return Object.assign(obj, { location: tree.location }) + } + path.push(tree) + return new Cls(tree, path) +} + +module.exports = printableTree diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/query-selector-all.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/query-selector-all.js new file mode 100644 index 0000000000000000000000000000000000000000..757675f3486a313ac9131801a96a74cfb1f57f22 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/query-selector-all.js @@ -0,0 +1,958 @@ +'use strict' + +const { resolve } = require('node:path') +const { parser, arrayDelimiter } = require('@npmcli/query') +const localeCompare = require('@isaacs/string-locale-compare')('en') +const { log } = require('proc-log') +const { minimatch } = require('minimatch') +const npa = require('npm-package-arg') +const pacote = require('pacote') +const semver = require('semver') +const npmFetch = require('npm-registry-fetch') + +// handle results for parsed query asts, results are stored in a map that has a +// key that points to each ast selector node and stores the resulting array of +// arborist nodes as its value, that is essential to how we handle multiple +// query selectors, e.g: `#a, #b, #c` <- 3 diff ast selector nodes +class Results { + #currentAstSelector + #initialItems + #inventory + #outdatedCache = new Map() + #vulnCache + #pendingCombinator + #results = new Map() + #targetNode + + constructor (opts) { + this.#currentAstSelector = opts.rootAstNode.nodes[0] + this.#inventory = opts.inventory + this.#initialItems = opts.initialItems + this.#vulnCache = opts.vulnCache + this.#targetNode = opts.targetNode + + this.currentResults = this.#initialItems + + // We get this when first called and need to pass it to pacote + this.flatOptions = opts.flatOptions || {} + + // reset by rootAstNode walker + this.currentAstNode = opts.rootAstNode + } + + get currentResults () { + return this.#results.get(this.#currentAstSelector) + } + + set currentResults (value) { + this.#results.set(this.#currentAstSelector, value) + } + + // retrieves the initial items to which start the filtering / matching + // for most of the different types of recognized ast nodes, e.g: class (aka + // depType), id, *, etc in different contexts we need to start with the + // current list of filtered results, for example a query for `.workspace` + // actually means the same as `*.workspace` so we want to start with the full + // inventory if that's the first ast node we're reading but if it appears in + // the middle of a query it should respect the previous filtered results, + // combinators are a special case in which we always want to have the + // complete inventory list in order to use the left-hand side ast node as a + // filter combined with the element on its right-hand side + get initialItems () { + const firstParsed = + (this.currentAstNode.parent.nodes[0] === this.currentAstNode) && + (this.currentAstNode.parent.parent.type === 'root') + + if (firstParsed) { + return this.#initialItems + } + + if (this.currentAstNode.prev().type === 'combinator') { + return this.#inventory + } + return this.currentResults + } + + // combinators need information about previously filtered items along + // with info of the items parsed / retrieved from the selector right + // past the combinator, for this reason combinators are stored and + // only ran as the last part of each selector logic + processPendingCombinator (nextResults) { + if (this.#pendingCombinator) { + const res = this.#pendingCombinator(this.currentResults, nextResults) + this.#pendingCombinator = null + this.currentResults = res + } else { + this.currentResults = nextResults + } + } + + // when collecting results to a root astNode, we traverse the list of child + // selector nodes and collect all of their resulting arborist nodes into a + // single/flat Set of items, this ensures we also deduplicate items + collect (rootAstNode) { + return new Set(rootAstNode.nodes.flatMap(n => this.#results.get(n))) + } + + // selector types map to the '.type' property of the ast nodes via `${astNode.type}Type` + // + // attribute selector [name=value], etc + attributeType () { + const nextResults = this.initialItems.filter(node => + attributeMatch(this.currentAstNode, node.package) + ) + this.processPendingCombinator(nextResults) + } + + // dependency type selector (i.e. .prod, .dev, etc) + // css calls this class, we interpret is as dependency type + classType () { + const depTypeFn = depTypes[String(this.currentAstNode)] + if (!depTypeFn) { + throw Object.assign( + new Error(`\`${String(this.currentAstNode)}\` is not a supported dependency type.`), + { code: 'EQUERYNODEPTYPE' } + ) + } + const nextResults = depTypeFn(this.initialItems) + this.processPendingCombinator(nextResults) + } + + // combinators (i.e. '>', ' ', '~') + combinatorType () { + this.#pendingCombinator = combinators[String(this.currentAstNode)] + } + + // name selectors (i.e. #foo) + // css calls this id, we interpret it as name + idType () { + const name = this.currentAstNode.value + const nextResults = this.initialItems.filter(node => + (name === node.name) || (name === node.package.name) + ) + this.processPendingCombinator(nextResults) + } + + // pseudo selectors (prefixed with :) + async pseudoType () { + const pseudoFn = `${this.currentAstNode.value.slice(1)}Pseudo` + if (!this[pseudoFn]) { + throw Object.assign( + new Error(`\`${this.currentAstNode.value + }\` is not a supported pseudo selector.`), + { code: 'EQUERYNOPSEUDO' } + ) + } + const nextResults = await this[pseudoFn]() + this.processPendingCombinator(nextResults) + } + + selectorType () { + this.#currentAstSelector = this.currentAstNode + // starts a new array in which resulting items + // can be stored for each given ast selector + if (!this.currentResults) { + this.currentResults = [] + } + } + + universalType () { + this.processPendingCombinator(this.initialItems) + } + + // pseudo selectors map to the 'value' property of the pseudo selectors in the ast nodes + // via selectors via `${value.slice(1)}Pseudo` + attrPseudo () { + const { lookupProperties, attributeMatcher } = this.currentAstNode + + return this.initialItems.filter(node => { + let objs = [node.package] + for (const prop of lookupProperties) { + // if an isArray symbol is found that means we'll need to iterate + // over the previous found array to basically make sure we traverse + // all its indexes testing for possible objects that may eventually + // hold more keys specified in a selector + if (prop === arrayDelimiter) { + objs = objs.flat() + continue + } + + // otherwise just maps all currently found objs + // to the next prop from the lookup properties list, + // filters out any empty key lookup + objs = objs.flatMap(obj => obj[prop] || []) + + // in case there's no property found in the lookup + // just filters that item out + const noAttr = objs.every(obj => !obj) + if (noAttr) { + return false + } + } + + // if any of the potential object matches + // that item should be in the final result + return objs.some(obj => attributeMatch(attributeMatcher, obj)) + }) + } + + emptyPseudo () { + return this.initialItems.filter(node => node.edgesOut.size === 0) + } + + extraneousPseudo () { + return this.initialItems.filter(node => node.extraneous) + } + + async hasPseudo () { + const found = [] + for (const item of this.initialItems) { + // This is the one time initialItems differs from inventory + const res = await retrieveNodesFromParsedAst({ + flatOptions: this.flatOptions, + initialItems: [item], + inventory: this.#inventory, + rootAstNode: this.currentAstNode.nestedNode, + targetNode: item, + vulnCache: this.#vulnCache, + }) + if (res.size > 0) { + found.push(item) + } + } + return found + } + + invalidPseudo () { + const found = [] + for (const node of this.initialItems) { + for (const edge of node.edgesIn) { + if (edge.invalid) { + found.push(node) + break + } + } + } + return found + } + + async isPseudo () { + const res = await retrieveNodesFromParsedAst({ + flatOptions: this.flatOptions, + initialItems: this.initialItems, + inventory: this.#inventory, + rootAstNode: this.currentAstNode.nestedNode, + targetNode: this.currentAstNode, + vulnCache: this.#vulnCache, + }) + return [...res] + } + + linkPseudo () { + return this.initialItems.filter(node => node.isLink || (node.isTop && !node.isRoot)) + } + + missingPseudo () { + return this.#inventory.reduce((res, node) => { + for (const edge of node.edgesOut.values()) { + if (edge.missing) { + const pkg = { name: edge.name, version: edge.spec } + const item = new this.#targetNode.constructor({ pkg }) + item.queryContext = { + missing: true, + } + item.edgesIn = new Set([edge]) + res.push(item) + } + } + return res + }, []) + } + + async notPseudo () { + const res = await retrieveNodesFromParsedAst({ + flatOptions: this.flatOptions, + initialItems: this.initialItems, + inventory: this.#inventory, + rootAstNode: this.currentAstNode.nestedNode, + targetNode: this.currentAstNode, + vulnCache: this.#vulnCache, + }) + const internalSelector = new Set(res) + return this.initialItems.filter(node => + !internalSelector.has(node)) + } + + overriddenPseudo () { + return this.initialItems.filter(node => node.overridden) + } + + pathPseudo () { + return this.initialItems.filter(node => { + if (!this.currentAstNode.pathValue) { + return true + } + return minimatch( + node.realpath.replace(/\\+/g, '/'), + resolve(node.root.realpath, this.currentAstNode.pathValue).replace(/\\+/g, '/') + ) + }) + } + + privatePseudo () { + return this.initialItems.filter(node => node.package.private) + } + + rootPseudo () { + return this.initialItems.filter(node => node === this.#targetNode.root) + } + + scopePseudo () { + return this.initialItems.filter(node => node === this.#targetNode) + } + + semverPseudo () { + const { + attributeMatcher, + lookupProperties, + semverFunc = 'infer', + semverValue, + } = this.currentAstNode + const { qualifiedAttribute } = attributeMatcher + + if (!semverValue) { + // DEPRECATED: remove this warning and throw an error as part of @npmcli/arborist@6 + log.warn('query', 'usage of :semver() with no parameters is deprecated') + return this.initialItems + } + + if (!semver.valid(semverValue) && !semver.validRange(semverValue)) { + throw Object.assign( + new Error(`\`${semverValue}\` is not a valid semver version or range`), + { code: 'EQUERYINVALIDSEMVER' }) + } + + const valueIsVersion = !!semver.valid(semverValue) + + const nodeMatches = (node, obj) => { + // if we already have an operator, the user provided some test as part of the selector + // we evaluate that first because if it fails we don't want this node anyway + if (attributeMatcher.operator) { + if (!attributeMatch(attributeMatcher, obj)) { + // if the initial operator doesn't match, we're done + return false + } + } + + const attrValue = obj[qualifiedAttribute] + // both valid and validRange return null for undefined, so this will skip both nodes that + // do not have the attribute defined as well as those where the attribute value is invalid + // and those where the value from the package.json is not a string + if ((!semver.valid(attrValue) && !semver.validRange(attrValue)) || + typeof attrValue !== 'string') { + return false + } + + const attrIsVersion = !!semver.valid(attrValue) + + let actualFunc = semverFunc + + // if we're asked to infer, we examine outputs to make a best guess + if (actualFunc === 'infer') { + if (valueIsVersion && attrIsVersion) { + // two versions -> semver.eq + actualFunc = 'eq' + } else if (!valueIsVersion && !attrIsVersion) { + // two ranges -> semver.intersects + actualFunc = 'intersects' + } else { + // anything else -> semver.satisfies + actualFunc = 'satisfies' + } + } + + if (['eq', 'neq', 'gt', 'gte', 'lt', 'lte'].includes(actualFunc)) { + // both sides must be versions, but one is not + if (!valueIsVersion || !attrIsVersion) { + return false + } + + return semver[actualFunc](attrValue, semverValue) + } else if (['gtr', 'ltr', 'satisfies'].includes(actualFunc)) { + // at least one side must be a version, but neither is + if (!valueIsVersion && !attrIsVersion) { + return false + } + + return valueIsVersion + ? semver[actualFunc](semverValue, attrValue) + : semver[actualFunc](attrValue, semverValue) + } else if (['intersects', 'subset'].includes(actualFunc)) { + // these accept two ranges and since a version is also a range, anything goes + return semver[actualFunc](attrValue, semverValue) + } else { + // user provided a function we don't know about, throw an error + throw Object.assign(new Error(`\`semver.${actualFunc}\` is not a supported operator.`), + { code: 'EQUERYINVALIDOPERATOR' }) + } + } + + return this.initialItems.filter((node) => { + // no lookupProperties just means its a top level property, see if it matches + if (!lookupProperties.length) { + return nodeMatches(node, node.package) + } + + // this code is mostly duplicated from attrPseudo to traverse into the package until we get + // to our deepest requested object + let objs = [node.package] + for (const prop of lookupProperties) { + if (prop === arrayDelimiter) { + objs = objs.flat() + continue + } + + objs = objs.flatMap(obj => obj[prop] || []) + const noAttr = objs.every(obj => !obj) + if (noAttr) { + return false + } + + return objs.some(obj => nodeMatches(node, obj)) + } + }) + } + + typePseudo () { + if (!this.currentAstNode.typeValue) { + return this.initialItems + } + // TODO this differs subtly with `:type()` because it now iterates on edgesIn, which means extraneous deps won't show up + // note how "@npmcli/abbrev@2.0.0-beta.45" is in the `:type()` results in the test but not in any of the other results. + return this.initialItems + .flatMap(node => { + const found = [] + const { typeValue } = this.currentAstNode + for (const edge of node.edgesIn) { + const parsedArg = npa(`${edge.name}@${edge.spec}`) + if (typeValue === 'registry') { + if (parsedArg.registry) { + found.push(edge.to) + } + } else if (parsedArg.type === typeValue) { + found.push(edge.to) + } + } + return found + }) + } + + dedupedPseudo () { + return this.initialItems.filter(node => node.target.edgesIn.size > 1) + } + + async vulnPseudo () { + if (!this.initialItems.length) { + return this.initialItems + } + if (!this.#vulnCache) { + const packages = {} + // We have to map the items twice, once to get the request, and a second time to filter out the results of that request + this.initialItems.map((node) => { + if (node.isProjectRoot || node.package.private) { + return + } + if (!packages[node.name]) { + packages[node.name] = [] + } + if (!packages[node.name].includes(node.version)) { + packages[node.name].push(node.version) + } + }) + const res = await npmFetch('/-/npm/v1/security/advisories/bulk', { + ...this.flatOptions, + registry: this.flatOptions.auditRegistry || this.flatOptions.registry, + method: 'POST', + gzip: true, + body: packages, + }) + this.#vulnCache = await res.json() + } + const advisories = this.#vulnCache + const { vulns } = this.currentAstNode + return this.initialItems.filter(item => { + const vulnerable = advisories[item.name]?.filter(advisory => { + // This could be for another version of this package elsewhere in the tree + if (!semver.intersects(advisory.vulnerable_versions, item.version)) { + return false + } + if (!vulns) { + return true + } + // vulns are OR with each other, if any one matches we're done + for (const vuln of vulns) { + if (vuln.severity && !vuln.severity.includes('*')) { + if (!vuln.severity.includes(advisory.severity)) { + continue + } + } + + if (vuln?.cwe) { + // * is special, it means "has a cwe" + if (vuln.cwe.includes('*')) { + if (!advisory.cwe.length) { + continue + } + } else if (!vuln.cwe.every(cwe => advisory.cwe.includes(`CWE-${cwe}`))) { + continue + } + } + return true + } + }) + if (vulnerable?.length) { + item.queryContext = { + advisories: vulnerable, + } + return true + } + return false + }) + } + + async outdatedPseudo () { + const { outdatedKind = 'any' } = this.currentAstNode + + // filter the initialItems + // NOTE: this uses a Promise.all around a map without in-line concurrency handling + // since the only async action taken is retrieving the packument, which is limited + // based on the max-sockets config in make-fetch-happen + const initialResults = await Promise.all(this.initialItems.map(async (node) => { + // the root can't be outdated, skip it + if (node.isProjectRoot) { + return false + } + + // private packages can't be published, skip them + if (node.package.private) { + return false + } + + // we cache the promise representing the full versions list, this helps reduce the + // number of requests we send by keeping population of the cache in a single tick + // making it less likely that multiple requests for the same package will be inflight + if (!this.#outdatedCache.has(node.name)) { + this.#outdatedCache.set(node.name, getPackageVersions(node.name, this.flatOptions)) + } + const availableVersions = await this.#outdatedCache.get(node.name) + + // we attach _all_ versions to the queryContext to allow consumers to do their own + // filtering and comparisons + node.queryContext.versions = availableVersions + + // next we further reduce the set to versions that are greater than the current one + const greaterVersions = availableVersions.filter((available) => { + return semver.gt(available, node.version) + }) + + // no newer versions than the current one, drop this node from the result set + if (!greaterVersions.length) { + return false + } + + // if we got here, we know that newer versions exist, if the kind is 'any' we're done + if (outdatedKind === 'any') { + return node + } + + // look for newer versions that differ from current by a specific part of the semver version + if (['major', 'minor', 'patch'].includes(outdatedKind)) { + // filter the versions greater than our current one based on semver.diff + const filteredVersions = greaterVersions.filter((version) => { + return semver.diff(node.version, version) === outdatedKind + }) + + // no available versions are of the correct diff type + if (!filteredVersions.length) { + return false + } + + return node + } + + // look for newer versions that satisfy at least one edgeIn to this node + if (outdatedKind === 'in-range') { + const inRangeContext = [] + for (const edge of node.edgesIn) { + const inRangeVersions = greaterVersions.filter((version) => { + return semver.satisfies(version, edge.spec) + }) + + // this edge has no in-range candidates, just move on + if (!inRangeVersions.length) { + continue + } + + inRangeContext.push({ + from: edge.from.location, + versions: inRangeVersions, + }) + } + + // if we didn't find at least one match, drop this node + if (!inRangeContext.length) { + return false + } + + // now add to the context each version that is in-range for each edgeIn + node.queryContext.outdated = { + ...node.queryContext.outdated, + inRange: inRangeContext, + } + + return node + } + + // look for newer versions that _do not_ satisfy at least one edgeIn + if (outdatedKind === 'out-of-range') { + const outOfRangeContext = [] + for (const edge of node.edgesIn) { + const outOfRangeVersions = greaterVersions.filter((version) => { + return !semver.satisfies(version, edge.spec) + }) + + // this edge has no out-of-range candidates, skip it + if (!outOfRangeVersions.length) { + continue + } + + outOfRangeContext.push({ + from: edge.from.location, + versions: outOfRangeVersions, + }) + } + + // if we didn't add at least one thing to the context, this node is not a match + if (!outOfRangeContext.length) { + return false + } + + // attach the out-of-range context to the node + node.queryContext.outdated = { + ...node.queryContext.outdated, + outOfRange: outOfRangeContext, + } + + return node + } + + // any other outdatedKind is unknown and will never match + return false + })) + + // return an array with the holes for non-matching nodes removed + return initialResults.filter(Boolean) + } +} + +// operators for attribute selectors +const attributeOperators = { + // attribute value is equivalent + '=' ({ attr, value }) { + return attr === value + }, + // attribute value contains word + '~=' ({ attr, value }) { + return (attr.match(/\w+/g) || []).includes(value) + }, + // attribute value contains string + '*=' ({ attr, value }) { + return attr.includes(value) + }, + // attribute value is equal or starts with + '|=' ({ attr, value }) { + return attr.startsWith(`${value}-`) + }, + // attribute value starts with + '^=' ({ attr, value }) { + return attr.startsWith(value) + }, + // attribute value ends with + '$=' ({ attr, value }) { + return attr.endsWith(value) + }, +} + +const attributeOperator = ({ attr, value, insensitive, operator }) => { + if (typeof attr === 'number') { + attr = String(attr) + } + if (typeof attr !== 'string') { + // It's an object or an array, bail + return false + } + if (insensitive) { + attr = attr.toLowerCase() + } + + return attributeOperators[operator]({ + attr, + insensitive, + value, + }) +} + +const attributeMatch = (matcher, obj) => { + const insensitive = !!matcher.insensitive + const operator = matcher.operator || '' + const attribute = matcher.qualifiedAttribute + let value = matcher.value || '' + // return early if checking existence + if (operator === '') { + return Boolean(obj[attribute]) + } + if (insensitive) { + value = value.toLowerCase() + } + // in case the current object is an array + // then we try to match every item in the array + if (Array.isArray(obj[attribute])) { + return obj[attribute].find((i, index) => { + const attr = obj[attribute][index] || '' + return attributeOperator({ attr, value, insensitive, operator }) + }) + } else { + const attr = obj[attribute] || '' + return attributeOperator({ attr, value, insensitive, operator }) + } +} + +const edgeIsType = (node, type, seen = new Set()) => { + for (const edgeIn of node.edgesIn) { + // TODO Need a test with an infinite loop + if (seen.has(edgeIn)) { + continue + } + seen.add(edgeIn) + if (edgeIn.type === type || edgeIn.from[type] || edgeIsType(edgeIn.from, type, seen)) { + return true + } + } + return false +} + +const filterByType = (nodes, type) => { + const found = [] + for (const node of nodes) { + if (node[type] || edgeIsType(node, type)) { + found.push(node) + } + } + return found +} + +const depTypes = { + // dependency + '.prod' (prevResults) { + const found = [] + for (const node of prevResults) { + if (!node.dev) { + found.push(node) + } + } + return found + }, + // devDependency + '.dev' (prevResults) { + return filterByType(prevResults, 'dev') + }, + // optionalDependency + '.optional' (prevResults) { + return filterByType(prevResults, 'optional') + }, + // peerDependency + '.peer' (prevResults) { + return filterByType(prevResults, 'peer') + }, + // workspace + '.workspace' (prevResults) { + return prevResults.filter(node => node.isWorkspace) + }, + // bundledDependency + '.bundled' (prevResults) { + return prevResults.filter(node => node.inBundle) + }, +} + +// checks if a given node has a direct parent in any of the nodes provided in +// the compare nodes array +const hasParent = (node, compareNodes) => { + // All it takes is one so we loop and return on the first hit + for (let compareNode of compareNodes) { + if (compareNode.isLink) { + compareNode = compareNode.target + } + + // Follows logical parent for link ancestors (e.g. workspaces whose target lives outside node_modules). + // Only match if the node has a link whose parent is the compareNode. Without this check, nodes deep in the store (linked strategy) would incorrectly match as children of root via their fsParent chain. + if (node.isTop && (node.resolveParent === compareNode)) { + for (const link of node.linksIn) { + if (link.parent === compareNode) { + return true + } + } + } + // follows edges-in to check if they match a possible parent + for (const edge of node.edgesIn) { + if (edge && edge.from === compareNode) { + return true + } + } + } + return false +} + +// checks if a given node is a descendant of any of the nodes provided in the +// compareNodes array +const hasAscendant = (node, compareNodes, seen = new Set()) => { + // TODO (future) loop over ancestry property + if (hasParent(node, compareNodes)) { + return true + } + + if (node.isTop && node.resolveParent) { + /* istanbul ignore if - investigate if linksIn check obviates need for this */ + if (hasAscendant(node.resolveParent, compareNodes)) { + return true + } + } + for (const edge of node.edgesIn) { + // TODO Need a test with an infinite loop + if (seen.has(edge)) { + continue + } + seen.add(edge) + if (edge && edge.from && hasAscendant(edge.from, compareNodes, seen)) { + return true + } + } + for (const linkNode of node.linksIn) { + if (hasAscendant(linkNode, compareNodes, seen)) { + return true + } + } + return false +} + +const combinators = { + // direct descendant + '>' (prevResults, nextResults) { + return nextResults.filter(node => hasParent(node, prevResults)) + }, + // any descendant + ' ' (prevResults, nextResults) { + return nextResults.filter(node => hasAscendant(node, prevResults)) + }, + // sibling + '~' (prevResults, nextResults) { + // Return any node in nextResults that is a sibling of (aka shares a + // parent with) a node in prevResults + const parentNodes = new Set() // Parents of everything in prevResults + for (const node of prevResults) { + for (const edge of node.edgesIn) { + // edge.from always exists cause it's from another node's edgesIn + parentNodes.add(edge.from) + } + } + return nextResults.filter(node => + !prevResults.includes(node) && hasParent(node, [...parentNodes]) + ) + }, +} + +// get a list of available versions of a package filtered to respect --before +// NOTE: this runs over each node and should not throw +const getPackageVersions = async (name, opts) => { + let packument + try { + packument = await pacote.packument(name, { + ...opts, + fullMetadata: false, // we only need the corgi + }) + } catch (err) { + // if the fetch fails, log a warning and pretend there are no versions + log.warn('query', `could not retrieve packument for ${name}: ${err.message}`) + return [] + } + + // start with a sorted list of all versions (lowest first) + let candidates = Object.keys(packument.versions).sort(semver.compare) + + // if the packument has a time property, and the user passed a before flag, then + // we filter this list down to only those versions that existed before the specified date + if (packument.time && opts.before) { + candidates = candidates.filter((version) => { + // this version isn't found in the times at all, drop it + if (!packument.time[version]) { + return false + } + + return Date.parse(packument.time[version]) <= opts.before + }) + } + + return candidates +} + +const retrieveNodesFromParsedAst = async (opts) => { + // when we first call this it's the parsed query. all other times it's + // results.currentNode.nestedNode + const rootAstNode = opts.rootAstNode + + if (!rootAstNode.nodes) { + return new Set() + } + + const results = new Results(opts) + + const astNodeQueue = new Set() + // walk is sync, so we have to build up our async functions and then await them later + rootAstNode.walk((nextAstNode) => { + astNodeQueue.add(nextAstNode) + }) + + for (const nextAstNode of astNodeQueue) { + // This is the only place we reset currentAstNode + results.currentAstNode = nextAstNode + const updateFn = `${results.currentAstNode.type}Type` + if (typeof results[updateFn] !== 'function') { + throw Object.assign( + new Error(`\`${results.currentAstNode.type}\` is not a supported selector.`), + { code: 'EQUERYNOSELECTOR' } + ) + } + await results[updateFn]() + } + + return results.collect(rootAstNode) +} + +const querySelectorAll = async (targetNode, query, flatOptions) => { + // This never changes ever we just pass it around. But we can't scope it to + // this whole file if we ever want to support concurrent calls to this + // function. + const inventory = [...targetNode.root.inventory.values()] + // res is a Set of items returned for each parsed css ast selector + const res = await retrieveNodesFromParsedAst({ + initialItems: inventory, + inventory, + flatOptions, + rootAstNode: parser(query), + targetNode, + }) + + // returns nodes ordered by realpath + return [...res].sort((a, b) => localeCompare(a.location, b.location)) +} + +module.exports = querySelectorAll diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/realpath.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/realpath.js new file mode 100644 index 0000000000000000000000000000000000000000..9440f860a07c438cb81817bb87c49e01e625925e --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/realpath.js @@ -0,0 +1,95 @@ +// look up the realpath, but cache stats to minimize overhead +// If the parent folder is in the realpath cache, then we just +// lstat the child, since there's no need to do a full realpath +// This is not a separate module, and is much simpler than Node's +// built-in fs.realpath, because we only care about symbolic links, +// so we can handle many fewer edge cases. + +const { lstat, readlink } = require('node:fs/promises') +const { resolve, basename, dirname } = require('node:path') + +const realpathCached = (path, rpcache, stcache, depth) => { + // just a safety against extremely deep eloops + /* istanbul ignore next */ + if (depth > 2000) { + throw eloop(path) + } + + path = resolve(path) + if (rpcache.has(path)) { + return Promise.resolve(rpcache.get(path)) + } + + const dir = dirname(path) + const base = basename(path) + + if (base && rpcache.has(dir)) { + return realpathChild(dir, base, rpcache, stcache, depth) + } + + // if it's the root, then we know it's real + if (!base) { + rpcache.set(dir, dir) + return Promise.resolve(dir) + } + + // the parent, what is that? + // find out, and then come back. + return realpathCached(dir, rpcache, stcache, depth + 1).then(() => + realpathCached(path, rpcache, stcache, depth + 1)) +} + +const lstatCached = (path, stcache) => { + if (stcache.has(path)) { + return Promise.resolve(stcache.get(path)) + } + + const p = lstat(path).then(st => { + stcache.set(path, st) + return st + }) + stcache.set(path, p) + return p +} + +// This is a slight fib, as it doesn't actually occur during a stat syscall. +// But file systems are giant piles of lies, so whatever. +const eloop = path => + Object.assign(new Error( + `ELOOP: too many symbolic links encountered, stat '${path}'`), { + errno: -62, + syscall: 'stat', + code: 'ELOOP', + path: path, + }) + +const realpathChild = (dir, base, rpcache, stcache, depth) => { + const realdir = rpcache.get(dir) + // that unpossible + /* istanbul ignore next */ + if (typeof realdir === 'undefined') { + throw new Error('in realpathChild without parent being in realpath cache') + } + + const realish = resolve(realdir, base) + return lstatCached(realish, stcache).then(st => { + if (!st.isSymbolicLink()) { + rpcache.set(resolve(dir, base), realish) + return realish + } + + return readlink(realish).then(target => { + const resolved = resolve(realdir, target) + if (realish === resolved) { + throw eloop(realish) + } + + return realpathCached(resolved, rpcache, stcache, depth + 1) + }).then(real => { + rpcache.set(resolve(dir, base), real) + return real + }) + }) +} + +module.exports = realpathCached diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/relpath.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/relpath.js new file mode 100644 index 0000000000000000000000000000000000000000..8bb8da28a880cdf1553df27e6b5c4b661ff86e6a --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/relpath.js @@ -0,0 +1,3 @@ +const { relative } = require('node:path') +const relpath = (from, to) => relative(from, to).replace(/\\/g, '/') +module.exports = relpath diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/reset-dep-flags.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/reset-dep-flags.js new file mode 100644 index 0000000000000000000000000000000000000000..fb69086d4648953507ca6f81c3ec645fead5e0fa --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/reset-dep-flags.js @@ -0,0 +1,11 @@ +// Sometimes we need to actually do a walk from the root, because you can +// have a cycle of deps that all depend on each other, but no path from root. +// Also, since the ideal tree is loaded from the shrinkwrap, it had extraneous +// flags set false that might now be actually extraneous, and dev/optional +// flags that are also now incorrect. This method sets all flags to true, so +// we can find the set that is actually extraneous. +module.exports = tree => { + for (const node of tree.inventory.values()) { + node.resetDepFlags() + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/retire-path.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/retire-path.js new file mode 100644 index 0000000000000000000000000000000000000000..ff9b9e9c19c95f07e590ee58088364da52fcd486 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/retire-path.js @@ -0,0 +1,19 @@ +const crypto = require('node:crypto') +const { dirname, basename, resolve } = require('node:path') + +// use sha1 because it's faster, and collisions extremely unlikely anyway +const pathSafeHash = s => + crypto.createHash('sha1') + .update(s) + .digest('base64') + .replace(/[^a-zA-Z0-9]+/g, '') + .slice(0, 8) + +const retirePath = from => { + const d = dirname(from) + const b = basename(from) + const hash = pathSafeHash(from) + return resolve(d, `.${b}-${hash}`) +} + +module.exports = retirePath diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js new file mode 100644 index 0000000000000000000000000000000000000000..f92d8202ff44350b43114ae51d37e15854592289 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js @@ -0,0 +1,1182 @@ +// a module that manages a shrinkwrap file (npm-shrinkwrap.json or +// package-lock.json). + +// Increment whenever the lockfile version updates +// v1 - npm <=6 +// v2 - arborist v1, npm v7, backwards compatible with v1, add 'packages' +// v3 will drop the 'dependencies' field, backwards comp with v2, not v1 +// +// We cannot bump to v3 until npm v6 is out of common usage, and +// definitely not before npm v8. + +const localeCompare = require('@isaacs/string-locale-compare')('en') +const defaultLockfileVersion = 3 + +// for comparing nodes to yarn.lock entries +const mismatch = (a, b) => a && b && a !== b + +// this.tree => the root node for the tree (ie, same path as this) +// - Set the first time we do `this.add(node)` for a path matching this.path +// +// this.add(node) => +// - decorate the node with the metadata we have, if we have it, and it matches +// - add to the map of nodes needing to be committed, so that subsequent +// changes are captured when we commit that location's metadata. +// +// this.commit() => +// - commit all nodes awaiting update to their metadata entries +// - re-generate this.data and this.yarnLock based on this.tree +// +// Note that between this.add() and this.commit(), `this.data` will be out of +// date! Always call `commit()` before relying on it. +// +// After calling this.commit(), any nodes not present in the tree will have +// been removed from the shrinkwrap data as well. + +const { log } = require('proc-log') +const YarnLock = require('./yarn-lock.js') +const { + readFile, + readdir, + readlink, + rm, + stat, + writeFile, +} = require('node:fs/promises') + +const { resolve, basename, relative } = require('node:path') +const specFromLock = require('./spec-from-lock.js') +const versionFromTgz = require('./version-from-tgz.js') +const npa = require('npm-package-arg') +const pkgJson = require('@npmcli/package-json') +const parseJSON = require('parse-conflict-json') +const nameFromFolder = require('@npmcli/name-from-folder') + +const stringify = require('json-stringify-nice') +const swKeyOrder = [ + 'name', + 'version', + 'lockfileVersion', + 'resolved', + 'integrity', + 'requires', + 'packages', + 'dependencies', +] + +// used to rewrite from yarn registry to npm registry +const yarnRegRe = /^https?:\/\/registry\.yarnpkg\.com\// +const npmRegRe = /^https?:\/\/registry\.npmjs\.org\// + +// sometimes resolved: is weird or broken, or something npa can't handle +const specFromResolved = resolved => { + try { + return npa(resolved) + } catch (er) { + return {} + } +} + +const relpath = require('./relpath.js') + +const consistentResolve = require('./consistent-resolve.js') +const { overrideResolves } = require('./override-resolves.js') + +const pkgMetaKeys = [ + // note: name is included if necessary, for alias packages + 'version', + 'dependencies', + 'peerDependencies', + 'peerDependenciesMeta', + 'optionalDependencies', + 'bundleDependencies', + 'acceptDependencies', + 'funding', + 'engines', + 'os', + 'cpu', + 'libc', + '_integrity', + 'license', + '_hasShrinkwrap', + 'hasInstallScript', + 'bin', + 'deprecated', + 'workspaces', +] + +const nodeMetaKeys = [ + 'integrity', + 'inBundle', + 'hasShrinkwrap', + 'hasInstallScript', +] + +const metaFieldFromPkg = (pkg, key) => { + const val = pkg[key] + if (val) { + // get only the license type, not the full object + if (key === 'license' && typeof val === 'object' && val.type) { + return val.type + } + // skip empty objects and falsey values + if (typeof val !== 'object' || Object.keys(val).length) { + return val + } + } + return null +} + +// check to make sure that there are no packages newer than or missing from the hidden lockfile +const assertNoNewer = async (path, data, lockTime, dir, seen) => { + const base = basename(dir) + const isNM = dir !== path && base === 'node_modules' + const isScope = dir !== path && base.startsWith('@') + const isParent = (dir === path) || isNM || isScope + + const parent = isParent ? dir : resolve(dir, 'node_modules') + const rel = relpath(path, dir) + seen.add(rel) + let entries + if (dir === path) { + entries = [{ name: 'node_modules', isDirectory: () => true }] + } else { + const { mtime: dirTime } = await stat(dir) + if (dirTime > lockTime) { + throw new Error(`out of date, updated: ${rel}`) + } + if (!isScope && !isNM && !data.packages[rel]) { + throw new Error(`missing from lockfile: ${rel}`) + } + entries = await readdir(parent, { withFileTypes: true }).catch(() => []) + } + + // TODO limit concurrency here, this is recursive + await Promise.all(entries.map(async dirent => { + const child = resolve(parent, dirent.name) + if (dirent.isDirectory() && !dirent.name.startsWith('.')) { + await assertNoNewer(path, data, lockTime, child, seen) + } else if (dirent.isSymbolicLink()) { + const target = resolve(parent, await readlink(child)) + const tstat = await stat(target).catch( + /* istanbul ignore next - windows */ () => null) + seen.add(relpath(path, child)) + /* istanbul ignore next - windows cannot do this */ + if (tstat?.isDirectory() && !seen.has(relpath(path, target))) { + await assertNoNewer(path, data, lockTime, target, seen) + } + } + })) + + if (dir !== path) { + return + } + + // assert that all the entries in the lockfile were seen + for (const loc in data.packages) { + if (!seen.has(loc)) { + throw new Error(`missing from node_modules: ${loc}`) + } + } +} + +class Shrinkwrap { + static get defaultLockfileVersion () { + return defaultLockfileVersion + } + + static load (options) { + return new Shrinkwrap(options).load() + } + + static get keyOrder () { + return swKeyOrder + } + + static async reset (options) { + // still need to know if it was loaded from the disk, but don't + // bother reading it if we're gonna just throw it away. + const s = new Shrinkwrap(options) + s.reset() + + const [sw, lock] = await s.resetFiles + + // XXX this is duplicated in this.load(), but using loadFiles instead of resetFiles + if (s.hiddenLockfile) { + s.filename = resolve(s.path, 'node_modules/.package-lock.json') + } else if (s.shrinkwrapOnly || sw) { + s.filename = resolve(s.path, 'npm-shrinkwrap.json') + } else { + s.filename = resolve(s.path, 'package-lock.json') + } + s.loadedFromDisk = !!(sw || lock) + // TODO what uses this? + s.type = basename(s.filename) + + return s + } + + static metaFromNode (node, path, options = {}) { + if (node.isLink) { + return { + resolved: relpath(path, node.realpath), + link: true, + } + } + + const meta = {} + for (const key of pkgMetaKeys) { + const val = metaFieldFromPkg(node.package, key) + if (val) { + meta[key.replace(/^_/, '')] = val + } + } + // we only include name if different from the node path name, and for the + // root to help prevent churn based on the name of the directory the + // project is in + const pname = node.packageName + // when Target package name and Target node share the same name, we include the name, target node should have name as per realpath. + if (pname && (node === node.root || pname !== node.name || nameFromFolder(node.realpath) !== pname)) { + meta.name = pname + } + + if (node.isTop && node.package.devDependencies) { + meta.devDependencies = node.package.devDependencies + } + + for (const key of nodeMetaKeys) { + if (node[key]) { + meta[key] = node[key] + } + } + + const resolved = consistentResolve(node.resolved, node.path, path, true) + // hide resolved from registry dependencies. + if (!resolved) { + // no-op + } else if (node.isRegistryDependency) { + meta.resolved = overrideResolves(resolved, options) + } else { + meta.resolved = resolved + } + + if (node.extraneous) { + meta.extraneous = true + } else { + if (node.peer) { + meta.peer = true + } + if (node.dev) { + meta.dev = true + } + if (node.optional) { + meta.optional = true + } + if (node.devOptional && !node.dev && !node.optional) { + meta.devOptional = true + } + } + return meta + } + + #awaitingUpdate = new Map() + + constructor (options = {}) { + const { + path, + indent = 2, + newline = '\n', + shrinkwrapOnly = false, + hiddenLockfile = false, + lockfileVersion, + resolveOptions = {}, + } = options + + if (hiddenLockfile) { + this.lockfileVersion = 3 + } else if (lockfileVersion) { + this.lockfileVersion = parseInt(lockfileVersion, 10) + } else { + this.lockfileVersion = null + } + + this.tree = null + this.path = resolve(path || '.') + this.filename = null + this.data = null + this.indent = indent + this.newline = newline + this.loadedFromDisk = false + this.type = null + this.yarnLock = null + this.hiddenLockfile = hiddenLockfile + this.loadingError = null + this.resolveOptions = resolveOptions + // only load npm-shrinkwrap.json in dep trees, not package-lock + this.shrinkwrapOnly = shrinkwrapOnly + } + + // check to see if a spec is present in the yarn.lock file, and if so, + // if we should use it, and what it should resolve to. This is only + // done when we did not load a shrinkwrap from disk. Also, decorate + // the options object if provided with the resolved and integrity that + // we expect. + checkYarnLock (spec, options = {}) { + spec = npa(spec) + const { yarnLock, loadedFromDisk } = this + const useYarnLock = yarnLock && !loadedFromDisk + const fromYarn = useYarnLock && yarnLock.entries.get(spec.raw) + if (fromYarn && fromYarn.version) { + // if it's the yarn or npm default registry, use the version as + // our effective spec. if it's any other kind of thing, use that. + const { resolved, version, integrity } = fromYarn + const isYarnReg = spec.registry && yarnRegRe.test(resolved) + const isnpmReg = spec.registry && !isYarnReg && npmRegRe.test(resolved) + const isReg = isnpmReg || isYarnReg + // don't use the simple version if the "registry" url is + // something else entirely! + const tgz = isReg && versionFromTgz(spec.name, resolved) || {} + let yspec = resolved + if (tgz.name === spec.name && tgz.version === version) { + yspec = version + } else if (isReg && tgz.name && tgz.version) { + yspec = `npm:${tgz.name}@${tgz.version}` + } + if (yspec) { + options.resolved = resolved.replace(yarnRegRe, 'https://registry.npmjs.org/') + options.integrity = integrity + return npa(`${spec.name}@${yspec}`) + } + } + return spec + } + + // throw away the shrinkwrap data so we can start fresh + // still worth doing a load() first so we know which files to write. + reset () { + this.tree = null + this.#awaitingUpdate = new Map() + const lockfileVersion = this.lockfileVersion || defaultLockfileVersion + this.originalLockfileVersion = lockfileVersion + + this.data = { + lockfileVersion, + requires: true, + packages: {}, + dependencies: {}, + } + } + + // files to potentially read from and write to, in order of priority + get #filenameSet () { + if (this.shrinkwrapOnly) { + return [`${this.path}/npm-shrinkwrap.json`] + } + if (this.hiddenLockfile) { + return [`${this.path}/node_modules/.package-lock.json`] + } + return [ + `${this.path}/npm-shrinkwrap.json`, + `${this.path}/package-lock.json`, + `${this.path}/yarn.lock`, + ] + } + + get loadFiles () { + return Promise.all( + this.#filenameSet.map(file => file && readFile(file, 'utf8').then(d => d, er => { + /* istanbul ignore else - can't test without breaking module itself */ + if (er.code === 'ENOENT') { + return '' + } else { + throw er + } + })) + ) + } + + get resetFiles () { + // slice out yarn, we only care about lock or shrinkwrap when checking + // this way, since we're not actually loading the full lock metadata + return Promise.all(this.#filenameSet.slice(0, 2) + .map(file => file && stat(file).then(st => st.isFile(), er => { + /* istanbul ignore else - can't test without breaking module itself */ + if (er.code === 'ENOENT') { + return null + } else { + throw er + } + }) + ) + ) + } + + inferFormattingOptions (packageJSONData) { + const { + [Symbol.for('indent')]: indent, + [Symbol.for('newline')]: newline, + } = packageJSONData + if (indent !== undefined) { + this.indent = indent + } + if (newline !== undefined) { + this.newline = newline + } + } + + async load () { + // we don't need to load package-lock.json except for top of tree nodes, + // only npm-shrinkwrap.json. + let data + try { + const [sw, lock, yarn] = await this.loadFiles + data = sw || lock || '{}' + + // use shrinkwrap only for deps; otherwise, prefer package-lock + // and ignore npm-shrinkwrap if both are present. + // TODO: emit a warning here or something if both are present. + if (this.hiddenLockfile) { + this.filename = resolve(this.path, 'node_modules/.package-lock.json') + } else if (this.shrinkwrapOnly || sw) { + this.filename = resolve(this.path, 'npm-shrinkwrap.json') + } else { + this.filename = resolve(this.path, 'package-lock.json') + } + this.type = basename(this.filename) + this.loadedFromDisk = Boolean(sw || lock) + + if (yarn) { + this.yarnLock = new YarnLock() + // ignore invalid yarn data. we'll likely clobber it later anyway. + try { + this.yarnLock.parse(yarn) + } catch { + // ignore errors + } + } + + data = parseJSON(data) + this.inferFormattingOptions(data) + + if (this.hiddenLockfile && data.packages) { + // add a few ms just to account for jitter + const lockTime = +(await stat(this.filename)).mtime + 10 + await assertNoNewer(this.path, data, lockTime, this.path, new Set()) + } + + // all good! hidden lockfile is the newest thing in here. + } catch (er) { + /* istanbul ignore else */ + if (typeof this.filename === 'string') { + const rel = relpath(this.path, this.filename) + log.verbose('shrinkwrap', `failed to load ${rel}`, er.message) + } else { + log.verbose('shrinkwrap', `failed to load ${this.path}`, er.message) + } + this.loadingError = er + this.loadedFromDisk = false + this.ancientLockfile = false + data = {} + } + // auto convert v1 lockfiles to v3 + // leave v2 in place unless configured + // v3 by default + let lockfileVersion = defaultLockfileVersion + if (this.lockfileVersion) { + lockfileVersion = this.lockfileVersion + } else if (data.lockfileVersion && data.lockfileVersion !== 1) { + lockfileVersion = data.lockfileVersion + } + + this.data = { + ...data, + lockfileVersion, + requires: true, + packages: data.packages || {}, + dependencies: data.dependencies || {}, + } + + this.originalLockfileVersion = data.lockfileVersion + + // use default if it wasn't explicitly set, and the current file is + // less than our default. otherwise, keep whatever is in the file, + // unless we had an explicit setting already. + if (!this.lockfileVersion) { + this.lockfileVersion = this.data.lockfileVersion = lockfileVersion + } + this.ancientLockfile = this.loadedFromDisk && + !(data.lockfileVersion >= 2) && !data.requires + + // load old lockfile deps into the packages listing + if (data.dependencies && !data.packages) { + let pkg + try { + pkg = await pkgJson.normalize(this.path) + pkg = pkg.content + } catch { + pkg = {} + } + this.#loadAll('', null, this.data) + this.#fixDependencies(pkg) + } + return this + } + + #loadAll (location, name, lock) { + // migrate a v1 package lock to the new format. + const meta = this.#metaFromLock(location, name, lock) + // dependencies nested under a link are actually under the link target + if (meta.link) { + location = meta.resolved + } + if (lock.dependencies) { + for (const name in lock.dependencies) { + const loc = location + (location ? '/' : '') + 'node_modules/' + name + this.#loadAll(loc, name, lock.dependencies[name]) + } + } + } + + // v1 lockfiles track the optional/dev flags, but they don't tell us + // which thing had what kind of dep on what other thing, so we need + // to correct that now, or every link will be considered prod + #fixDependencies (pkg) { + // we need the root package.json because legacy shrinkwraps just + // have requires:true at the root level, which is even less useful + // than merging all dep types into one object. + const root = this.data.packages[''] + for (const key of pkgMetaKeys) { + const val = metaFieldFromPkg(pkg, key) + if (val) { + root[key.replace(/^_/, '')] = val + } + } + + for (const loc in this.data.packages) { + const meta = this.data.packages[loc] + if (!meta.requires || !loc) { + continue + } + + // resolve each require to a meta entry + // if this node isn't optional, but the dep is, then it's an optionalDep + // likewise for dev deps. + // This isn't perfect, but it's a pretty good approximation, and at + // least gets us out of having all 'prod' edges, which throws off the + // buildIdealTree process + for (const name in meta.requires) { + const dep = this.#resolveMetaNode(loc, name) + // this overwrites the false value set above + // default to dependencies if the dep just isn't in the tree, which + // maybe should be an error, since it means that the shrinkwrap is + // invalid, but we can't do much better without any info. + let depType = 'dependencies' + /* istanbul ignore else - dev deps are only for the root level */ + if (dep?.optional && !meta.optional) { + depType = 'optionalDependencies' + } else if (dep?.dev && !meta.dev) { + // XXX is this even reachable? + depType = 'devDependencies' + } + if (!meta[depType]) { + meta[depType] = {} + } + meta[depType][name] = meta.requires[name] + } + delete meta.requires + } + } + + #resolveMetaNode (loc, name) { + for (let path = loc; true; path = path.replace(/(^|\/)[^/]*$/, '')) { + const check = `${path}${path ? '/' : ''}node_modules/${name}` + if (this.data.packages[check]) { + return this.data.packages[check] + } + + if (!path) { + break + } + } + return null + } + + #lockFromLoc (lock, path, i = 0) { + if (!lock) { + return null + } + + if (path[i] === '') { + i++ + } + + if (i >= path.length) { + return lock + } + + if (!lock.dependencies) { + return null + } + + return this.#lockFromLoc(lock.dependencies[path[i]], path, i + 1) + } + + // pass in a path relative to the root path, or an absolute path, + // get back a /-normalized location based on root path. + #pathToLoc (path) { + return relpath(this.path, resolve(this.path, path)) + } + + delete (nodePath) { + if (!this.data) { + throw new Error('run load() before getting or setting data') + } + const location = this.#pathToLoc(nodePath) + this.#awaitingUpdate.delete(location) + + delete this.data.packages[location] + const path = location.split(/(?:^|\/)node_modules\//) + const name = path.pop() + const pLock = this.#lockFromLoc(this.data, path) + if (pLock && pLock.dependencies) { + delete pLock.dependencies[name] + } + } + + get (nodePath) { + if (!this.data) { + throw new Error('run load() before getting or setting data') + } + + const location = this.#pathToLoc(nodePath) + if (this.#awaitingUpdate.has(location)) { + this.#updateWaitingNode(location) + } + + // first try to get from the newer spot, which we know has + // all the things we need. + if (this.data.packages[location]) { + return this.data.packages[location] + } + + // otherwise, fall back to the legacy metadata, and hope for the best + // get the node in the shrinkwrap corresponding to this spot + const path = location.split(/(?:^|\/)node_modules\//) + const name = path[path.length - 1] + const lock = this.#lockFromLoc(this.data, path) + + return this.#metaFromLock(location, name, lock) + } + + #metaFromLock (location, name, lock) { + // This function tries as hard as it can to figure out the metadata + // from a lockfile which may be outdated or incomplete. Since v1 + // lockfiles used the "version" field to contain a variety of + // different possible types of data, this gets a little complicated. + if (!lock) { + return {} + } + + // try to figure out a npm-package-arg spec from the lockfile entry + // This will return null if we could not get anything valid out of it. + const spec = specFromLock(name, lock, this.path) + + if (spec.type === 'directory') { + // the "version" was a file: url to a non-tarball path + // this is a symlink dep. We don't store much metadata + // about symlinks, just the target. + const target = relpath(this.path, spec.fetchSpec) + this.data.packages[location] = { + link: true, + resolved: target, + } + // also save the link target, omitting version since we don't know + // what it is, but we know it isn't a link to itself! + if (!this.data.packages[target]) { + this.#metaFromLock(target, name, { ...lock, version: null }) + } + return this.data.packages[location] + } + + const meta = {} + // when calling loadAll we'll change these into proper dep objects + if (lock.requires && typeof lock.requires === 'object') { + meta.requires = lock.requires + } + + if (lock.optional) { + meta.optional = true + } + if (lock.dev) { + meta.dev = true + } + + // the root will typically have a name from the root project's + // package.json file. + if (location === '') { + meta.name = lock.name + } + + // if we have integrity, save it now. + if (lock.integrity) { + meta.integrity = lock.integrity + } + + if (lock.version && !lock.integrity) { + // this is usually going to be a git url or symlink, but it could + // also be a registry dependency that did not have integrity at + // the time it was saved. + // Symlinks were already handled above, so that leaves git. + // + // For git, always save the full SSH url. we'll actually fetch the + // tgz most of the time, since it's faster, but it won't work for + // private repos, and we can't get back to the ssh from the tgz, + // so we store the ssh instead. + // For unknown git hosts, just resolve to the raw spec in lock.version + if (spec.type === 'git') { + meta.resolved = consistentResolve(spec, this.path, this.path) + + // return early because there is nothing else we can do with this + return this.data.packages[location] = meta + } else if (spec.registry) { + // registry dep that didn't save integrity. grab the version, and + // fall through to pick up the resolved and potentially name. + meta.version = lock.version + } + // only other possible case is a tarball without integrity. + // fall through to do what we can with the filename later. + } + + // at this point, we know that the spec is either a registry dep + // (ie, version, because locking, which means a resolved url), + // or a remote dep, or file: url. Remote deps and file urls + // have a fetchSpec equal to the fully resolved thing. + // Registry deps, we take what's in the lockfile. + if (lock.resolved || (spec.type && !spec.registry)) { + if (spec.registry) { + meta.resolved = lock.resolved + } else if (spec.type === 'file') { + meta.resolved = consistentResolve(spec, this.path, this.path, true) + } else if (spec.fetchSpec) { + meta.resolved = spec.fetchSpec + } + } + + // at this point, if still we don't have a version, do our best to + // infer it from the tarball url/file. This works a surprising + // amount of the time, even though it's not guaranteed. + if (!meta.version) { + if (spec.type === 'file' || spec.type === 'remote') { + const fromTgz = versionFromTgz(spec.name, spec.fetchSpec) || + versionFromTgz(spec.name, meta.resolved) + if (fromTgz) { + meta.version = fromTgz.version + if (fromTgz.name !== name) { + meta.name = fromTgz.name + } + } + } else if (spec.type === 'alias') { + meta.name = spec.subSpec.name + meta.version = spec.subSpec.fetchSpec + } else if (spec.type === 'version') { + meta.version = spec.fetchSpec + } + // ok, I did my best! good luck! + } + + if (lock.bundled) { + meta.inBundle = true + } + + // save it for next time + return this.data.packages[location] = meta + } + + add (node) { + if (!this.data) { + throw new Error('run load() before getting or setting data') + } + + // will be actually updated on read + const loc = relpath(this.path, node.path) + if (node.path === this.path) { + this.tree = node + } + + // if we have metadata about this node, and it's a match, then + // try to decorate it. + if (node.resolved === null || node.integrity === null) { + const { + resolved, + integrity, + hasShrinkwrap, + version, + } = this.get(node.path) + + let pathFixed = null + if (resolved) { + if (!/^file:/.test(resolved)) { + pathFixed = resolved + } else { + pathFixed = `file:${resolve(this.path, resolved.slice(5))}` + } + } + + // if we have one, only set the other if it matches + // otherwise it could be for a completely different thing. + const resolvedOk = !resolved || !node.resolved || + node.resolved === pathFixed + const integrityOk = !integrity || !node.integrity || + node.integrity === integrity + const versionOk = !version || !node.version || version === node.version + + const allOk = (resolved || integrity || version) && + resolvedOk && integrityOk && versionOk + + if (allOk) { + node.resolved = node.resolved || pathFixed || null + node.integrity = node.integrity || integrity || null + node.hasShrinkwrap = node.hasShrinkwrap || hasShrinkwrap || false + } else { + // try to read off the package or node itself + const { + resolved, + integrity, + hasShrinkwrap, + } = Shrinkwrap.metaFromNode(node, this.path, this.resolveOptions) + node.resolved = node.resolved || resolved || null + node.integrity = node.integrity || integrity || null + node.hasShrinkwrap = node.hasShrinkwrap || hasShrinkwrap || false + } + } + this.#awaitingUpdate.set(loc, node) + } + + addEdge (edge) { + if (!this.yarnLock || !edge.valid) { + return + } + + const { to: node } = edge + + // if it's already set up, nothing to do + if (node.resolved !== null && node.integrity !== null) { + return + } + + // if the yarn lock is empty, nothing to do + if (!this.yarnLock.entries || !this.yarnLock.entries.size) { + return + } + + // we relativize the path here because that's how it shows up in the lock + // XXX why is this different from pathFixed in this.add?? + let pathFixed = null + if (node.resolved) { + if (!/file:/.test(node.resolved)) { + pathFixed = node.resolved + } else { + pathFixed = consistentResolve(node.resolved, node.path, this.path, true) + } + } + + const spec = npa(`${node.name}@${edge.spec}`) + const entry = this.yarnLock.entries.get(`${node.name}@${edge.spec}`) + + if (!entry || + mismatch(node.version, entry.version) || + mismatch(node.integrity, entry.integrity) || + mismatch(pathFixed, entry.resolved)) { + return + } + + if (entry.resolved && yarnRegRe.test(entry.resolved) && spec.registry) { + entry.resolved = entry.resolved.replace(yarnRegRe, 'https://registry.npmjs.org/') + } + + node.integrity = node.integrity || entry.integrity || null + node.resolved = node.resolved || + consistentResolve(entry.resolved, this.path, node.path) || null + + this.#awaitingUpdate.set(relpath(this.path, node.path), node) + } + + #updateWaitingNode (loc) { + const node = this.#awaitingUpdate.get(loc) + this.#awaitingUpdate.delete(loc) + this.data.packages[loc] = Shrinkwrap.metaFromNode( + node, + this.path, + this.resolveOptions) + } + + commit () { + if (this.tree) { + if (this.yarnLock) { + this.yarnLock.fromTree(this.tree) + } + const root = Shrinkwrap.metaFromNode( + this.tree.target, + this.path, + this.resolveOptions) + this.data.packages = {} + if (Object.keys(root).length) { + this.data.packages[''] = root + } + for (const node of this.tree.root.inventory.values()) { + // only way this.tree is not root is if the root is a link to it + if (node === this.tree || node.isRoot || node.location === '') { + continue + } + const loc = relpath(this.path, node.path) + this.data.packages[loc] = Shrinkwrap.metaFromNode( + node, + this.path, + this.resolveOptions) + } + } else if (this.#awaitingUpdate.size > 0) { + for (const loc of this.#awaitingUpdate.keys()) { + this.#updateWaitingNode(loc) + } + } + + // if we haven't set it by now, use the default + if (!this.lockfileVersion) { + this.lockfileVersion = defaultLockfileVersion + } + this.data.lockfileVersion = this.lockfileVersion + + // hidden lockfiles don't include legacy metadata or a root entry + if (this.hiddenLockfile) { + delete this.data.packages[''] + delete this.data.dependencies + } else if (this.tree && this.lockfileVersion <= 3) { + this.#buildLegacyLockfile(this.tree, this.data) + } + + // lf version 1 = dependencies only + // lf version 2 = dependencies and packages + // lf version 3 = packages only + if (this.lockfileVersion >= 3) { + const { dependencies, ...data } = this.data + return data + } else if (this.lockfileVersion < 2) { + const { packages, ...data } = this.data + return data + } else { + return { ...this.data } + } + } + + #buildLegacyLockfile (node, lock, path = []) { + if (node === this.tree) { + // the root node + lock.name = node.packageName || node.name + if (node.version) { + lock.version = node.version + } + } + + // npm v6 and before tracked 'from', meaning "the request that led + // to this package being installed". However, that's inherently + // racy and non-deterministic in a world where deps are deduped + // ahead of fetch time. In order to maintain backwards compatibility + // with v6 in the lockfile, we do this trick where we pick a valid + // dep link out of the edgesIn set. Choose the edge with the fewest + // number of `node_modules` sections in the requestor path, and then + // lexically sort afterwards. + const edge = [...node.edgesIn].filter(e => e.valid).sort((a, b) => { + const aloc = a.from.location.split('node_modules') + const bloc = b.from.location.split('node_modules') + /* istanbul ignore next - sort calling order is indeterminate */ + if (aloc.length > bloc.length) { + return 1 + } + if (bloc.length > aloc.length) { + return -1 + } + return localeCompare(aloc[aloc.length - 1], bloc[bloc.length - 1]) + })[0] + + const res = consistentResolve(node.resolved, this.path, this.path, true) + const rSpec = specFromResolved(res) + + // if we don't have anything (ie, it's extraneous) then use the resolved + // value as if that was where we got it from, since at least it's true. + // if we don't have either, just an empty object so nothing matches below. + // This will effectively just save the version and resolved, as if it's + // a standard version/range dep, which is a reasonable default. + let spec = rSpec + if (edge) { + spec = npa.resolve(node.name, edge.spec, edge.from.realpath) + } + + if (node.isLink) { + lock.version = `file:${relpath(this.path, node.realpath)}` + } else if (spec && (spec.type === 'file' || spec.type === 'remote')) { + lock.version = spec.saveSpec + } else if (spec && spec.type === 'git' || rSpec.type === 'git') { + lock.version = node.resolved + /* istanbul ignore else - don't think there are any cases where a git + * spec (or indeed, ANY npa spec) doesn't have a .raw member */ + if (spec.raw) { + lock.from = spec.raw + } + } else if (!node.isRoot && + node.package && + node.packageName && + node.packageName !== node.name) { + lock.version = `npm:${node.packageName}@${node.version}` + } else if (node.package && node.version) { + lock.version = node.version + } + + if (node.inDepBundle) { + lock.bundled = true + } + + // when we didn't resolve to git, file, or dir, and didn't request + // git, file, dir, or remote, then the resolved value is necessary. + if (node.resolved && + !node.isLink && + rSpec.type !== 'git' && + rSpec.type !== 'file' && + rSpec.type !== 'directory' && + spec.type !== 'directory' && + spec.type !== 'git' && + spec.type !== 'file' && + spec.type !== 'remote') { + lock.resolved = overrideResolves(node.resolved, this.resolveOptions) + } + + if (node.integrity) { + lock.integrity = node.integrity + } + + if (node.extraneous) { + lock.extraneous = true + } else if (!node.isLink) { + if (node.peer) { + lock.peer = true + } + + if (node.devOptional && !node.dev && !node.optional) { + lock.devOptional = true + } + + if (node.dev) { + lock.dev = true + } + + if (node.optional) { + lock.optional = true + } + } + + const depender = node.target + if (depender.edgesOut.size > 0) { + if (node !== this.tree) { + const entries = [...depender.edgesOut.entries()] + lock.requires = entries.reduce((set, [k, v]) => { + // omit peer deps from legacy lockfile requires field, because + // npm v6 doesn't handle peer deps, and this triggers some bad + // behavior if the dep can't be found in the dependencies list. + const { spec, peer } = v + if (peer) { + return set + } + if (spec.startsWith('file:')) { + // turn absolute file: paths into relative paths from the node + // this especially shows up with workspace edges when the root + // node is also a workspace in the set. + const p = resolve(node.realpath, spec.slice('file:'.length)) + set[k] = `file:${relpath(node.realpath, p)}` + } else { + set[k] = spec + } + return set + }, {}) + } else { + lock.requires = true + } + } + + // now we walk the children, putting them in the 'dependencies' object + const { children } = node.target + if (!children.size) { + delete lock.dependencies + } else { + const kidPath = [...path, node.realpath] + const dependencies = {} + // skip any that are already in the descent path, so cyclical link + // dependencies don't blow up with ELOOP. + let found = false + for (const [name, kid] of children.entries()) { + if (path.includes(kid.realpath)) { + continue + } + dependencies[name] = this.#buildLegacyLockfile(kid, {}, kidPath) + found = true + } + if (found) { + lock.dependencies = dependencies + } + } + return lock + } + + toJSON () { + if (!this.data) { + throw new Error('run load() before getting or setting data') + } + + return this.commit() + } + + toString (options = {}) { + const data = this.toJSON() + const { format = true } = options + const defaultIndent = this.indent || 2 + const indent = format === true ? defaultIndent + : format || 0 + const eol = format ? this.newline || '\n' : '' + return stringify(data, swKeyOrder, indent).replace(/\n/g, eol) + } + + save (options = {}) { + if (!this.data) { + throw new Error('run load() before saving data') + } + + // This must be called before the lockfile conversion check below since it sets properties as part of `commit()` + const json = this.toString(options) + if ( + !this.hiddenLockfile + && this.originalLockfileVersion !== undefined + && this.originalLockfileVersion !== this.lockfileVersion + ) { + log.warn( + 'shrinkwrap', + `Converting lock file (${relative(process.cwd(), this.filename)}) from v${this.originalLockfileVersion} -> v${this.lockfileVersion}` + ) + } + + return Promise.all([ + writeFile(this.filename, json).catch(er => { + if (this.hiddenLockfile) { + // well, we did our best. + // if we reify, and there's nothing there, then it might be lacking + // a node_modules folder, but then the lockfile is not important. + // Remove the file, so that in case there WERE deps, but we just + // failed to update the file for some reason, it's not out of sync. + return rm(this.filename, { recursive: true, force: true }) + } + throw er + }), + this.yarnLock && this.yarnLock.entries.size && + writeFile(this.path + '/yarn.lock', this.yarnLock.toString()), + ]) + } +} + +module.exports = Shrinkwrap diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/signal-handling.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/signal-handling.js new file mode 100644 index 0000000000000000000000000000000000000000..eb97eac992ec906b1716ea27ff109288d58e3a0c --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/signal-handling.js @@ -0,0 +1,74 @@ +const signals = require('./signals.js') + +// for testing, expose the process being used +module.exports = Object.assign(fn => setup(fn), { process }) + +// do all of this in a setup function so that we can call it +// multiple times for multiple reifies that might be going on. +// Otherwise, Arborist.reify() is a global action, which is a +// new constraint we'd be adding with this behavior. +const setup = fn => { + const { process } = module.exports + + const sigListeners = { loaded: false } + + const unload = () => { + if (!sigListeners.loaded) { + return + } + for (const sig of signals) { + try { + process.removeListener(sig, sigListeners[sig]) + } catch { + // ignore errors + } + } + process.removeListener('beforeExit', onBeforeExit) + sigListeners.loaded = false + } + + const onBeforeExit = () => { + // this trick ensures that we exit with the same signal we caught + // Ie, if you press ^C and npm gets a SIGINT, we'll do the rollback + // and then exit with a SIGINT signal once we've removed the handler. + // The timeout is there because signals are asynchronous, so we need + // the process to NOT exit on its own, which means we have to have + // something keeping the event loop looping. Hence this hack. + unload() + process.kill(process.pid, signalReceived) + setTimeout(() => {}, 500) + } + + let signalReceived = null + const listener = (sig, fn) => () => { + signalReceived = sig + + // if we exit normally, but caught a signal which would have been fatal, + // then re-send it once we're done with whatever cleanup we have to do. + unload() + if (process.listeners(sig).length < 1) { + process.once('beforeExit', onBeforeExit) + } + + fn({ signal: sig }) + } + + // do the actual loading here + for (const sig of signals) { + sigListeners[sig] = listener(sig, fn) + const max = process.getMaxListeners() + try { + // if we call this a bunch of times, avoid triggering the warning + const { length } = process.listeners(sig) + if (length >= max) { + process.setMaxListeners(length + 1) + } + process.on(sig, sigListeners[sig]) + } catch { + // ignore errors + } + } + sigListeners.loaded = true + + return unload +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/signals.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/signals.js new file mode 100644 index 0000000000000000000000000000000000000000..105a2db627a3481ab27f211433140249fc501ed7 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/signals.js @@ -0,0 +1,58 @@ +// copied from signal-exit + +// This is not the set of all possible signals. +// +// It IS, however, the set of all signals that trigger +// an exit on either Linux or BSD systems. Linux is a +// superset of the signal names supported on BSD, and +// the unknown signals just fail to register, so we can +// catch that easily enough. +// +// Don't bother with SIGKILL. It's uncatchable, which +// means that we can't fire any callbacks anyway. +// +// If a user does happen to register a handler on a non- +// fatal signal like SIGWINCH or something, and then +// exit, it'll end up firing `process.emit('exit')`, so +// the handler will be fired anyway. +// +// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised +// artificially, inherently leave the process in a +// state from which it is not safe to try and enter JS +// listeners. + +const platform = global.__ARBORIST_FAKE_PLATFORM__ || process.platform + +module.exports = [ + 'SIGABRT', + 'SIGALRM', + 'SIGHUP', + 'SIGINT', + 'SIGTERM', +] + +if (platform !== 'win32') { + module.exports.push( + 'SIGVTALRM', + 'SIGXCPU', + 'SIGXFSZ', + 'SIGUSR2', + 'SIGTRAP', + 'SIGSYS', + 'SIGQUIT', + 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ) +} + +if (platform === 'linux') { + module.exports.push( + 'SIGIO', + 'SIGPOLL', + 'SIGPWR', + 'SIGSTKFLT', + 'SIGUNUSED' + ) +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/spec-from-lock.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/spec-from-lock.js new file mode 100644 index 0000000000000000000000000000000000000000..0470a4f3f376d5ae222f8c55c3a58ee77bb44446 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/spec-from-lock.js @@ -0,0 +1,34 @@ +const npa = require('npm-package-arg') + +// extracted from npm v6 lib/install/realize-shrinkwrap-specifier.js +const specFromLock = (name, lock, where) => { + try { + if (lock.version) { + const spec = npa.resolve(name, lock.version, where) + if (lock.integrity || spec.type === 'git') { + return spec + } + } + if (lock.from) { + // legacy metadata includes "from", but not integrity + const spec = npa.resolve(name, lock.from, where) + if (spec.registry && lock.version) { + return npa.resolve(name, lock.version, where) + } else if (!lock.resolved) { + return spec + } + } + if (lock.resolved) { + return npa.resolve(name, lock.resolved, where) + } + } catch { + // ignore errors + } + try { + return npa.resolve(name, lock.version, where) + } catch { + return {} + } +} + +module.exports = specFromLock diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/tracker.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/tracker.js new file mode 100644 index 0000000000000000000000000000000000000000..818c766912bbed82c24117297dc98dbed22a90da --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/tracker.js @@ -0,0 +1,86 @@ +const proggy = require('proggy') + +module.exports = cls => class Tracker extends cls { + #progress = new Map() + + #createTracker (key, name) { + const tracker = new proggy.Tracker(name ?? key) + tracker.on('done', () => this.#progress.delete(key)) + this.#progress.set(key, tracker) + } + + addTracker (section, subsection = null, key = null) { + if (section === null || section === undefined) { + this.#onError(`Tracker can't be null or undefined`) + } + + if (key === null) { + key = subsection + } + + const hasTracker = this.#progress.has(section) + const hasSubtracker = this.#progress.has(`${section}:${key}`) + + if (hasTracker && subsection === null) { + // 0. existing tracker, no subsection + this.#onError(`Tracker "${section}" already exists`) + } else if (!hasTracker && subsection === null) { + // 1. no existing tracker, no subsection + // Create a new progress tracker + this.#createTracker(section) + } else if (!hasTracker && subsection !== null) { + // 2. no parent tracker and subsection + this.#onError(`Parent tracker "${section}" does not exist`) + } else if (!hasTracker || !hasSubtracker) { + // 3. existing parent tracker, no subsection tracker + // Create a new subtracker and update parents + const parentTracker = this.#progress.get(section) + parentTracker.update(parentTracker.value, parentTracker.total + 1) + this.#createTracker(`${section}:${key}`, `${section}:${subsection}`) + } + // 4. existing parent tracker, existing subsection tracker + // skip it + } + + finishTracker (section, subsection = null, key = null) { + if (section === null || section === undefined) { + this.#onError(`Tracker can't be null or undefined`) + } + + if (key === null) { + key = subsection + } + + const hasTracker = this.#progress.has(section) + const hasSubtracker = this.#progress.has(`${section}:${key}`) + + // 0. parent tracker exists, no subsection + // Finish parent tracker and remove from this.#progress + if (hasTracker && subsection === null) { + // check if parent tracker does + // not have any remaining children + const keys = this.#progress.keys() + for (const key of keys) { + if (key.match(new RegExp(section + ':'))) { + this.finishTracker(section, key) + } + } + // remove parent tracker + this.#progress.get(section).finish() + } else if (!hasTracker && subsection === null) { + // 1. no existing parent tracker, no subsection + this.#onError(`Tracker "${section}" does not exist`) + } else if (!hasTracker || hasSubtracker) { + // 2. subtracker exists + // Finish subtracker and remove from this.#progress + const parentTracker = this.#progress.get(section) + parentTracker.update(parentTracker.value + 1) + this.#progress.get(`${section}:${key}`).finish() + } + // 3. existing parent tracker, no subsection + } + + #onError (msg) { + throw new Error(msg) + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/tree-check.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/tree-check.js new file mode 100644 index 0000000000000000000000000000000000000000..5f88e0c464710af6bccad9de875b574b1255e3bb --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/tree-check.js @@ -0,0 +1,155 @@ +const debug = require('./debug.js') + +const checkTree = (tree, checkUnreachable = true) => { + const log = [['START TREE CHECK', tree.path]] + + // this can only happen in tests where we have a "tree" object + // that isn't actually a tree. + if (!tree.root || !tree.root.inventory) { + return tree + } + + const { inventory } = tree.root + const seen = new Set() + const check = (node, via = tree, viaType = 'self') => { + log.push([ + 'CHECK', + node && node.location, + via && via.location, + viaType, + 'seen=' + seen.has(node), + 'promise=' + !!(node && node.then), + 'root=' + !!(node && node.isRoot), + ]) + + if (!node || seen.has(node) || node.then) { + return + } + + seen.add(node) + + if (node.isRoot && node !== tree.root) { + throw Object.assign(new Error('double root'), { + node: node.path, + realpath: node.realpath, + tree: tree.path, + root: tree.root.path, + via: via.path, + viaType, + log, + }) + } + + if (node.root !== tree.root) { + throw Object.assign(new Error('node from other root in tree'), { + node: node.path, + realpath: node.realpath, + tree: tree.path, + root: tree.root.path, + via: via.path, + viaType, + otherRoot: node.root && node.root.path, + log, + }) + } + + if (!node.isRoot && node.inventory.size !== 0) { + throw Object.assign(new Error('non-root has non-zero inventory'), { + node: node.path, + tree: tree.path, + root: tree.root.path, + via: via.path, + viaType, + inventory: [...node.inventory.values()].map(node => + [node.path, node.location]), + log, + }) + } + + if (!node.isRoot && !inventory.has(node) && !node.dummy) { + throw Object.assign(new Error('not in inventory'), { + node: node.path, + tree: tree.path, + root: tree.root.path, + via: via.path, + viaType, + log, + }) + } + + const devEdges = [...node.edgesOut.values()].filter(e => e.dev) + if (!node.isTop && devEdges.length) { + throw Object.assign(new Error('dev edges on non-top node'), { + node: node.path, + tree: tree.path, + root: tree.root.path, + via: via.path, + viaType, + devEdges: devEdges.map(e => [e.type, e.name, e.spec, e.error]), + log, + }) + } + + if (node.path === tree.root.path && node !== tree.root && !tree.root.isLink) { + throw Object.assign(new Error('node with same path as root'), { + node: node.path, + tree: tree.path, + root: tree.root.path, + via: via.path, + viaType, + log, + }) + } + + if (!node.isLink && node.path !== node.realpath) { + throw Object.assign(new Error('non-link with mismatched path/realpath'), { + node: node.path, + tree: tree.path, + realpath: node.realpath, + root: tree.root.path, + via: via.path, + viaType, + log, + }) + } + + const { parent, fsParent, target } = node + check(parent, node, 'parent') + check(fsParent, node, 'fsParent') + check(target, node, 'target') + log.push(['CHILDREN', node.location, ...node.children.keys()]) + for (const kid of node.children.values()) { + check(kid, node, 'children') + } + for (const kid of node.fsChildren) { + check(kid, node, 'fsChildren') + } + for (const link of node.linksIn) { + check(link, node, 'linksIn') + } + for (const top of node.tops) { + check(top, node, 'tops') + } + log.push(['DONE', node.location]) + } + check(tree) + if (checkUnreachable) { + for (const node of inventory.values()) { + if (!seen.has(node) && node !== tree.root) { + throw Object.assign(new Error('unreachable in inventory'), { + node: node.path, + realpath: node.realpath, + location: node.location, + root: tree.root.path, + tree: tree.path, + log, + }) + } + } + } + return tree +} + +// should only ever run this check in debug mode +module.exports = tree => tree +debug(() => module.exports = checkTree) diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/version-from-tgz.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/version-from-tgz.js new file mode 100644 index 0000000000000000000000000000000000000000..4bc6a8c34a7ab084affc5a7b2b6118f3b9e46c65 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/version-from-tgz.js @@ -0,0 +1,47 @@ +const semver = require('semver') +const { basename } = require('node:path') +const { URL } = require('node:url') +module.exports = (name, tgz) => { + const base = basename(tgz) + if (!base.endsWith('.tgz')) { + return null + } + + if (tgz.startsWith('http:/') || tgz.startsWith('https:/')) { + const u = new URL(tgz) + // registry url? check for most likely pattern. + // either /@foo/bar/-/bar-1.2.3.tgz or + // /foo/-/foo-1.2.3.tgz, and fall through to + // basename checking. Note that registries can + // be mounted below the root url, so /a/b/-/x/y/foo/-/foo-1.2.3.tgz + // is a potential option. + const tfsplit = u.pathname.slice(1).split('/-/') + if (tfsplit.length > 1) { + const afterTF = tfsplit.pop() + if (afterTF === base) { + const pre = tfsplit.pop() + const preSplit = pre.split(/\/|%2f/i) + const project = preSplit.pop() + const scope = preSplit.pop() + return versionFromBaseScopeName(base, scope, project) + } + } + } + + const split = name.split(/\/|%2f/i) + const project = split.pop() + const scope = split.pop() + return versionFromBaseScopeName(base, scope, project) +} + +const versionFromBaseScopeName = (base, scope, name) => { + if (!base.startsWith(name + '-')) { + return null + } + + const parsed = semver.parse(base.substring(name.length + 1, base.length - 4)) + return parsed ? { + name: scope && scope.charAt(0) === '@' ? `${scope}/${name}` : name, + version: parsed.version, + } : null +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/vuln.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/vuln.js new file mode 100644 index 0000000000000000000000000000000000000000..597dab4e31eb889cdd47e94d71cb17c69b176f46 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/vuln.js @@ -0,0 +1,214 @@ +// An object representing a vulnerability either as the result of an +// advisory or due to the package in question depending exclusively on +// vulnerable versions of a dep. +// +// - name: package name +// - range: Set of vulnerable versions +// - nodes: Set of nodes affected +// - effects: Set of vulns triggered by this one +// - advisories: Set of advisories (including metavulns) causing this vuln. +// All of the entries in via are vulnerability objects returned by +// @npmcli/metavuln-calculator +// - via: dependency vulns which cause this one + +const { satisfies, simplifyRange } = require('semver') +const semverOpt = { loose: true, includePrerelease: true } + +const localeCompare = require('@isaacs/string-locale-compare')('en') +const npa = require('npm-package-arg') + +const severities = new Map([ + ['info', 0], [0, 'info'], + ['low', 1], [1, 'low'], + ['moderate', 2], [2, 'moderate'], + ['high', 3], [3, 'high'], + ['critical', 4], [4, 'critical'], + [null, -1], [-1, null], +]) + +class Vuln { + #range = null + #simpleRange = null + // assume a fix is available unless it hits a top node + // that locks it in place, setting this false or {isSemVerMajor, version}. + #fixAvailable = true + + constructor ({ name, advisory }) { + this.name = name + this.via = new Set() + this.advisories = new Set() + this.severity = null + this.effects = new Set() + this.topNodes = new Set() + this.nodes = new Set() + this.addAdvisory(advisory) + this.packument = advisory.packument + this.versions = advisory.versions + } + + get fixAvailable () { + return this.#fixAvailable + } + + set fixAvailable (f) { + this.#fixAvailable = f + // if there's a fix available for this at the top level, it means that + // it will also fix the vulns that led to it being there. to get there, + // we set the vias to the most "strict" of fix availables. + // - false: no fix is available + // - {name, version, isSemVerMajor} fix requires -f, is semver major + // - {name, version} fix requires -f, not semver major + // - true: fix does not require -f + // TODO: duped entries may require different fixes but the current + // structure does not support this, so the case were a top level fix + // corrects a duped entry may mean you have to run fix more than once + for (const v of this.via) { + // don't blow up on loops + if (v.fixAvailable === f) { + continue + } + + if (f === false) { + v.fixAvailable = f + } else if (v.fixAvailable === true) { + v.fixAvailable = f + } else if (typeof f === 'object' && ( + typeof v.fixAvailable !== 'object' || !v.fixAvailable.isSemVerMajor)) { + v.fixAvailable = f + } + } + } + + get isDirect () { + for (const node of this.nodes.values()) { + for (const edge of node.edgesIn) { + if (edge.from.isProjectRoot || edge.from.isWorkspace) { + return true + } + } + } + return false + } + + testSpec (spec) { + const specObj = npa(spec) + if (!specObj.registry) { + return true + } + + if (specObj.subSpec) { + spec = specObj.subSpec.rawSpec + } + + for (const v of this.versions) { + if (satisfies(v, spec) && !satisfies(v, this.range, semverOpt)) { + return false + } + } + return true + } + + toJSON () { + return { + name: this.name, + severity: this.severity, + isDirect: this.isDirect, + // just loop over the advisories, since via is only Vuln objects, + // and calculated advisories have all the info we need + via: [...this.advisories].map(v => v.type === 'metavuln' ? v.dependency : { + ...v, + versions: undefined, + vulnerableVersions: undefined, + id: undefined, + }).sort((a, b) => + localeCompare(String(a.source || a), String(b.source || b))), + effects: [...this.effects].map(v => v.name).sort(localeCompare), + range: this.simpleRange, + nodes: [...this.nodes].map(n => n.location).sort(localeCompare), + fixAvailable: this.#fixAvailable, + } + } + + addVia (v) { + this.via.add(v) + v.effects.add(this) + // call the setter since we might add vias _after_ setting fixAvailable + this.fixAvailable = this.fixAvailable + } + + deleteVia (v) { + this.via.delete(v) + v.effects.delete(this) + } + + deleteAdvisory (advisory) { + this.advisories.delete(advisory) + // make sure we have the max severity of all the vulns causing this one + this.severity = null + this.#range = null + this.#simpleRange = null + // refresh severity + for (const advisory of this.advisories) { + this.addAdvisory(advisory) + } + + // remove any effects that are no longer relevant + const vias = new Set([...this.advisories].map(a => a.dependency)) + for (const via of this.via) { + if (!vias.has(via.name)) { + this.deleteVia(via) + } + } + } + + addAdvisory (advisory) { + this.advisories.add(advisory) + const sev = severities.get(advisory.severity) + this.#range = null + this.#simpleRange = null + if (sev > severities.get(this.severity)) { + this.severity = advisory.severity + } + } + + get range () { + if (!this.#range) { + this.#range = [...this.advisories].map(v => v.range).join(' || ') + } + return this.#range + } + + get simpleRange () { + if (this.#simpleRange && this.#simpleRange === this.#range) { + return this.#simpleRange + } + + const versions = [...this.advisories][0].versions + const range = this.range + this.#simpleRange = simplifyRange(versions, range, semverOpt) + this.#range = this.#simpleRange + return this.#simpleRange + } + + isVulnerable (node) { + if (this.nodes.has(node)) { + return true + } + + const { version } = node.package + if (!version) { + return false + } + + for (const v of this.advisories) { + if (v.testVersion(version)) { + this.nodes.add(node) + return true + } + } + + return false + } +} + +module.exports = Vuln diff --git a/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/yarn-lock.js b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/yarn-lock.js new file mode 100644 index 0000000000000000000000000000000000000000..a50c8f637b6d17ace77a5c06ae2197479f5ff5dc --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/arborist/lib/yarn-lock.js @@ -0,0 +1,377 @@ +// parse a yarn lock file +// basic format +// +// [, ...]: +// +// : +// +// +// Assume that any key or value might be quoted, though that's only done +// in practice if certain chars are in the string. When writing back, we follow +// Yarn's rules for quoting, to cause minimal friction. +// +// The data format would support nested objects, but at this time, it +// appears that yarn does not use that for anything, so in the interest +// of a simpler parser algorithm, this implementation only supports a +// single layer of sub objects. +// +// This doesn't deterministically define the shape of the tree, and so +// cannot be used (on its own) for Arborist.loadVirtual. +// But it can give us resolved, integrity, and version, which is useful +// for Arborist.loadActual and for building the ideal tree. +// +// At the very least, when a yarn.lock file is present, we update it +// along the way, and save it back in Shrinkwrap.save() +// +// NIHing this rather than using @yarnpkg/lockfile because that module +// is an impenetrable 10kloc of webpack flow output, which is overkill +// for something relatively simple and tailored to Arborist's use case. + +const localeCompare = require('@isaacs/string-locale-compare')('en') +const consistentResolve = require('./consistent-resolve.js') +const { dirname } = require('node:path') +const { breadth } = require('treeverse') + +// Sort Yarn entries respecting the yarn.lock sort order +const yarnEntryPriorities = { + name: 1, + version: 2, + uid: 3, + resolved: 4, + integrity: 5, + registry: 6, + dependencies: 7, +} + +const priorityThenLocaleCompare = (a, b) => { + if (!yarnEntryPriorities[a] && !yarnEntryPriorities[b]) { + return localeCompare(a, b) + } + /* istanbul ignore next */ + return (yarnEntryPriorities[a] || 100) > (yarnEntryPriorities[b] || 100) ? 1 : -1 +} + +const quoteIfNeeded = val => { + if ( + typeof val === 'boolean' || + typeof val === 'number' || + val.startsWith('true') || + val.startsWith('false') || + /[:\s\n\\",[\]]/g.test(val) || + !/^[a-zA-Z]/g.test(val) + ) { + return JSON.stringify(val) + } + + return val +} + +// sort a key/value object into a string of JSON stringified keys and vals +const sortKV = obj => Object.keys(obj) + .sort(localeCompare) + .map(k => ` ${quoteIfNeeded(k)} ${quoteIfNeeded(obj[k])}`) + .join('\n') + +// for checking against previous entries +const match = (p, n) => + p.integrity && n.integrity ? p.integrity === n.integrity + : p.resolved && n.resolved ? p.resolved === n.resolved + : p.version && n.version ? p.version === n.version + : true + +const prefix = +`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +` + +const nullSymbol = Symbol('null') +class YarnLock { + static parse (data) { + return new YarnLock().parse(data) + } + + static fromTree (tree) { + return new YarnLock().fromTree(tree) + } + + constructor () { + this.entries = null + this.endCurrent() + } + + endCurrent () { + this.current = null + this.subkey = nullSymbol + } + + parse (data) { + const ENTRY_START = /^[^\s].*:$/ + const SUBKEY = /^ {2}[^\s]+:$/ + const SUBVAL = /^ {4}[^\s]+ .+$/ + const METADATA = /^ {2}[^\s]+ .+$/ + this.entries = new Map() + this.current = null + const linere = /([^\r\n]*)\r?\n/gm + let match + let lineNum = 0 + if (!/\n$/.test(data)) { + data += '\n' + } + while (match = linere.exec(data)) { + const line = match[1] + lineNum++ + if (line.charAt(0) === '#') { + continue + } + if (line === '') { + this.endCurrent() + continue + } + if (ENTRY_START.test(line)) { + this.endCurrent() + const specs = this.splitQuoted(line.slice(0, -1), /, */) + this.current = new YarnLockEntry(specs) + specs.forEach(spec => this.entries.set(spec, this.current)) + continue + } + if (SUBKEY.test(line)) { + this.subkey = line.slice(2, -1) + this.current[this.subkey] = {} + continue + } + if (SUBVAL.test(line) && this.current && this.current[this.subkey]) { + const subval = this.splitQuoted(line.trimLeft(), ' ') + if (subval.length === 2) { + this.current[this.subkey][subval[0]] = subval[1] + continue + } + } + // any other metadata + if (METADATA.test(line) && this.current) { + const metadata = this.splitQuoted(line.trimLeft(), ' ') + if (metadata.length === 2) { + // strip off the legacy shasum hashes + if (metadata[0] === 'resolved') { + metadata[1] = metadata[1].replace(/#.*/, '') + } + this.current[metadata[0]] = metadata[1] + continue + } + } + + throw Object.assign(new Error('invalid or corrupted yarn.lock file'), { + position: match.index, + content: match[0], + line: lineNum, + }) + } + this.endCurrent() + return this + } + + splitQuoted (str, delim) { + // a,"b,c",d"e,f => ['a','"b','c"','d"e','f'] => ['a','b,c','d"e','f'] + const split = str.split(delim) + const out = [] + let o = 0 + for (let i = 0; i < split.length; i++) { + const chunk = split[i] + if (/^".*"$/.test(chunk)) { + out[o++] = chunk.trim().slice(1, -1) + } else if (/^"/.test(chunk)) { + let collect = chunk.trimLeft().slice(1) + while (++i < split.length) { + const n = split[i] + // something that is not a slash, followed by an even number + // of slashes then a " then end => ending on an unescaped " + if (/[^\\](\\\\)*"$/.test(n)) { + collect += n.trimRight().slice(0, -1) + break + } else { + collect += n + } + } + out[o++] = collect + } else { + out[o++] = chunk.trim() + } + } + return out + } + + toString () { + return prefix + [...new Set([...this.entries.values()])] + .map(e => e.toString()) + .sort((a, b) => localeCompare(a.replace(/"/g, ''), b.replace(/"/g, ''))).join('\n\n') + '\n' + } + + fromTree (tree) { + this.entries = new Map() + // walk the tree in a deterministic order, breadth-first, alphabetical + breadth({ + tree, + visit: node => this.addEntryFromNode(node), + getChildren: node => [...node.children.values(), ...node.fsChildren] + .sort((a, b) => a.depth - b.depth || localeCompare(a.name, b.name)), + }) + return this + } + + addEntryFromNode (node) { + const specs = [...node.edgesIn] + .map(e => `${node.name}@${e.spec}`) + .sort(localeCompare) + + // Note: + // yarn will do excessive duplication in a case like this: + // root -> (x@1.x, y@1.x, z@1.x) + // y@1.x -> (x@1.1, z@2.x) + // z@1.x -> () + // z@2.x -> (x@1.x) + // + // where x@1.2 exists, because the "x@1.x" spec will *always* resolve + // to x@1.2, which doesn't work for y's dep on x@1.1, so you'll get this: + // + // root + // +-- x@1.2.0 + // +-- y + // | +-- x@1.1.0 + // | +-- z@2 + // | +-- x@1.2.0 + // +-- z@1 + // + // instead of this more deduped tree that arborist builds by default: + // + // root + // +-- x@1.2.0 (dep is x@1.x, from root) + // +-- y + // | +-- x@1.1.0 + // | +-- z@2 (dep on x@1.x deduped to x@1.1.0 under y) + // +-- z@1 + // + // In order to not create an invalid yarn.lock file with conflicting + // entries, AND not tell yarn to create an invalid tree, we need to + // ignore the x@1.x spec coming from z, since it's already in the entries. + // + // So, if the integrity and resolved don't match a previous entry, skip it. + // We call this method on shallower nodes first, so this is fine. + const n = this.entryDataFromNode(node) + let priorEntry = null + const newSpecs = [] + for (const s of specs) { + const prev = this.entries.get(s) + // no previous entry for this spec at all, so it's new + if (!prev) { + // if we saw a match already, then assign this spec to it as well + if (priorEntry) { + priorEntry.addSpec(s) + } else { + newSpecs.push(s) + } + continue + } + + const m = match(prev, n) + // there was a prior entry, but a different thing. skip this one + if (!m) { + continue + } + + // previous matches, but first time seeing it, so already has this spec. + // go ahead and add all the previously unseen specs, though + if (!priorEntry) { + priorEntry = prev + for (const s of newSpecs) { + priorEntry.addSpec(s) + this.entries.set(s, priorEntry) + } + newSpecs.length = 0 + continue + } + + // have a prior entry matching n, and matching the prev we just saw + // add the spec to it + priorEntry.addSpec(s) + this.entries.set(s, priorEntry) + } + + // if we never found a matching prior, then this is a whole new thing + if (!priorEntry) { + const entry = Object.assign(new YarnLockEntry(newSpecs), n) + for (const s of newSpecs) { + this.entries.set(s, entry) + } + } else { + // pick up any new info that we got for this node, so that we can + // decorate with integrity/resolved/etc. + Object.assign(priorEntry, n) + } + } + + entryDataFromNode (node) { + const n = {} + if (node.package.dependencies) { + n.dependencies = node.package.dependencies + } + if (node.package.optionalDependencies) { + n.optionalDependencies = node.package.optionalDependencies + } + if (node.version) { + n.version = node.version + } + if (node.resolved) { + n.resolved = consistentResolve( + node.resolved, + node.isLink ? dirname(node.path) : node.path, + node.root.path, + true + ) + } + if (node.integrity) { + n.integrity = node.integrity + } + + return n + } + + static get Entry () { + return YarnLockEntry + } +} + +class YarnLockEntry { + #specs + constructor (specs) { + this.#specs = new Set(specs) + this.resolved = null + this.version = null + this.integrity = null + this.dependencies = null + this.optionalDependencies = null + } + + toString () { + // sort objects to the bottom, then alphabetical + return ([...this.#specs] + .sort(localeCompare) + .map(quoteIfNeeded).join(', ') + + ':\n' + + Object.getOwnPropertyNames(this) + .filter(prop => this[prop] !== null) + .sort(priorityThenLocaleCompare) + .map(prop => + typeof this[prop] !== 'object' + ? ` ${prop} ${prop === 'integrity' ? this[prop] : JSON.stringify(this[prop])}\n` + : Object.keys(this[prop]).length === 0 ? '' + : ` ${prop}:\n` + sortKV(this[prop]) + '\n') + .join('')).trim() + } + + addSpec (spec) { + this.#specs.add(spec) + } +} + +module.exports = YarnLock diff --git a/node24/node_modules/npm/node_modules/@npmcli/config/lib/definitions/definition.js b/node24/node_modules/npm/node_modules/@npmcli/config/lib/definitions/definition.js new file mode 100644 index 0000000000000000000000000000000000000000..1bb04e6f2302fc25790bd2576cbfcf29feff0487 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/config/lib/definitions/definition.js @@ -0,0 +1,255 @@ +// class that describes a config key we know about +// this keeps us from defining a config key and not +// providing a default, description, etc. +// +// TODO: some kind of categorization system, so we can +// say "these are for registry access", "these are for +// version resolution" etc. + +const required = ['type', 'description', 'default', 'key'] + +const allowed = [ + 'default', + 'defaultDescription', + 'deprecated', + 'description', + 'exclusive', + 'flatten', + 'hint', + 'key', + 'short', + 'type', + 'typeDescription', + 'usage', + 'envExport', + 'alias', + 'required', +] + +const { + semver: { type: semver }, + Umask: { type: Umask }, + url: { type: url }, + path: { type: path }, +} = require('../type-defs.js') + +class Definition { + constructor (key, def) { + this.key = key + // if it's set falsey, don't export it; otherwise, we do by default + this.envExport = true + Object.assign(this, def) + this.validate() + if (!this.defaultDescription) { + this.defaultDescription = describeValue(this.default) + } + if (!this.typeDescription) { + this.typeDescription = describeType(this.type) + } + // hint is only used for non-boolean values + if (!this.hint) { + if (this.type === Number) { + this.hint = '' + } else { + this.hint = `<${this.key}>` + } + } + if (!this.usage) { + this.usage = describeUsage(this) + } + } + + validate () { + for (const req of required) { + if (!Object.prototype.hasOwnProperty.call(this, req)) { + throw new Error(`config lacks ${req}: ${this.key}`) + } + } + if (!this.key) { + throw new Error(`config lacks key: ${this.key}`) + } + for (const field of Object.keys(this)) { + if (!allowed.includes(field)) { + throw new Error(`config defines unknown field ${field}: ${this.key}`) + } + } + } + + // a textual description of this config, suitable for help output + describe () { + const description = unindent(this.description) + const noEnvExport = this.envExport + ? '' + : ` +This value is not exported to the environment for child processes. +` + const deprecated = !this.deprecated ? '' : `* DEPRECATED: ${unindent(this.deprecated)}\n` + /* eslint-disable-next-line max-len */ + const exclusive = !this.exclusive ? '' : `\nThis config cannot be used with: \`${this.exclusive.join('`, `')}\`` + return wrapAll(`#### \`${this.key}\` + +* Default: ${unindent(this.defaultDescription)} +* Type: ${unindent(this.typeDescription)} +${deprecated} +${description} +${exclusive} +${noEnvExport}`) + } +} + +const describeUsage = def => { + let key = '' + + // Single type + if (!Array.isArray(def.type)) { + if (def.short) { + key = `-${def.short}|` + } + + if (def.type === Boolean && def.default !== false) { + key = `${key}--no-${def.key}` + } else { + key = `${key}--${def.key}` + } + + if (def.type !== Boolean) { + key = `${key} ${def.hint}` + } + + return key + } + + key = `--${def.key}` + if (def.short) { + key = `-${def.short}|--${def.key}` + } + + // Multiple types + let types = def.type + const multiple = types.includes(Array) + const bool = types.includes(Boolean) + + // null type means optional and doesn't currently affect usage output since + // all non-optional params have defaults so we render everything as optional + types = types.filter(t => t !== null && t !== Array && t !== Boolean) + + if (!types.length) { + return key + } + + let description + if (!types.some(t => typeof t !== 'string')) { + // Specific values, use specifics given + description = `<${types.filter(d => d).join('|')}>` + } else { + // Generic values, use hint + description = def.hint + } + + if (bool) { + // Currently none of our multi-type configs with boolean values default to + // false so all their hints should show `--no-`, if we ever add ones that + // default to false we can branch the logic here + key = `--no-${def.key}|${key}` + } + + const usage = `${key} ${description}` + if (multiple) { + return `${usage} [${usage} ...]` + } else { + return usage + } +} + +const describeType = type => { + if (Array.isArray(type)) { + const descriptions = type.filter(t => t !== Array).map(t => describeType(t)) + + // [a] => "a" + // [a, b] => "a or b" + // [a, b, c] => "a, b, or c" + // [a, Array] => "a (can be set multiple times)" + // [a, Array, b] => "a or b (can be set multiple times)" + const last = descriptions.length > 1 ? [descriptions.pop()] : [] + const oxford = descriptions.length > 1 ? ', or ' : ' or ' + const words = [descriptions.join(', ')].concat(last).join(oxford) + const multiple = type.includes(Array) ? ' (can be set multiple times)' : '' + return `${words}${multiple}` + } + + // Note: these are not quite the same as the description printed + // when validation fails. In that case, we want to give the user + // a bit more information to help them figure out what's wrong. + switch (type) { + case String: + return 'String' + case Number: + return 'Number' + case Umask: + return 'Octal numeric string in range 0000..0777 (0..511)' + case Boolean: + return 'Boolean' + case Date: + return 'Date' + case path: + return 'Path' + case semver: + return 'SemVer string' + case url: + return 'URL' + default: + return describeValue(type) + } +} + +// if it's a string, quote it. otherwise, just cast to string. +const describeValue = val => (typeof val === 'string' ? JSON.stringify(val) : String(val)) + +const unindent = s => { + // get the first \n followed by a bunch of spaces, and pluck off + // that many spaces from the start of every line. + const match = s.match(/\n +/) + return !match ? s.trim() : s.split(match[0]).join('\n').trim() +} + +const wrap = s => { + const cols = Math.min(Math.max(20, process.stdout.columns) || 80, 80) - 5 + return unindent(s) + .split(/[ \n]+/) + .reduce((left, right) => { + const last = left.split('\n').pop() + const join = last.length && last.length + right.length > cols ? '\n' : ' ' + return left + join + right + }) +} + +const wrapAll = s => { + let inCodeBlock = false + return s + .split('\n\n') + .map(block => { + if (inCodeBlock || block.startsWith('```')) { + inCodeBlock = !block.endsWith('```') + return block + } + + if (block.charAt(0) === '*') { + return ( + '* ' + + block + .slice(1) + .trim() + .split('\n* ') + .map(li => { + return wrap(li).replace(/\n/g, '\n ') + }) + .join('\n* ') + ) + } else { + return wrap(block) + } + }) + .join('\n\n') +} + +module.exports = Definition diff --git a/node24/node_modules/npm/node_modules/@npmcli/config/lib/definitions/definitions.js b/node24/node_modules/npm/node_modules/@npmcli/config/lib/definitions/definitions.js new file mode 100644 index 0000000000000000000000000000000000000000..00d477ced02cbe19ee8ed37d40f315f2eb77bc72 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/config/lib/definitions/definitions.js @@ -0,0 +1,2472 @@ +const Definition = require('./definition.js') + +const ciInfo = require('ci-info') +const querystring = require('node:querystring') +const { join } = require('node:path') + +const isWindows = process.platform === 'win32' + +// used by cafile flattening to flatOptions.ca +const { readFileSync } = require('node:fs') +const maybeReadFile = file => { + try { + return readFileSync(file, 'utf8') + } catch (er) { + if (er.code !== 'ENOENT') { + throw er + } + return null + } +} + +const buildOmitList = obj => { + const include = obj.include || [] + const omit = obj.omit || [] + + const only = obj.only + if (/^prod(uction)?$/.test(only) || obj.production) { + omit.push('dev') + } else if (obj.production === false) { + include.push('dev') + } + + if (/^dev/.test(obj.also)) { + include.push('dev') + } + + if (obj.dev) { + include.push('dev') + } + + if (obj.optional === false) { + omit.push('optional') + } else if (obj.optional === true) { + include.push('optional') + } + + obj.omit = [...new Set(omit)].filter(type => !include.includes(type)) + obj.include = [...new Set(include)] + + if (obj.omit.includes('dev')) { + process.env.NODE_ENV = 'production' + } + + return obj.omit +} + +const editor = process.env.EDITOR || + process.env.VISUAL || + (isWindows ? `${process.env.SYSTEMROOT}\\notepad.exe` : 'vi') + +const shell = isWindows ? process.env.ComSpec || 'cmd' + : process.env.SHELL || 'sh' + +const { networkInterfaces } = require('node:os') +const getLocalAddresses = () => { + try { + return Object.values(networkInterfaces()).map( + int => int.map(({ address }) => address) + ).reduce((set, addrs) => set.concat(addrs), [null]) + } catch (e) { + return [null] + } +} + +const unicode = /UTF-?8$/i.test( + process.env.LC_ALL || + process.env.LC_CTYPE || + process.env.LANG +) + +// use LOCALAPPDATA on Windows, if set +// https://github.com/npm/cli/pull/899 +const cacheRoot = (isWindows && process.env.LOCALAPPDATA) || '~' +const cacheExtra = isWindows ? 'npm-cache' : '.npm' +const cache = `${cacheRoot}/${cacheExtra}` + +// TODO: refactor these type definitions so that they are less +// weird to pull out of the config module. +// TODO: use better type definition/validation API, nopt's is so weird. +const { + semver: { type: Semver }, + Umask: { type: Umask }, + url: { type: url }, + path: { type: path }, +} = require('../type-defs.js') + +// basic flattening function, just copy it over camelCase +const flatten = (key, obj, flatOptions) => { + const camel = key.replace(/-([a-z])/g, (_0, _1) => _1.toUpperCase()) + flatOptions[camel] = obj[key] +} + +// TODO: +// Instead of having each definition provide a flatten method, +// provide the (?list of?) flat option field(s?) that it impacts. +// When that config is set, we mark the relevant flatOption fields +// dirty. Then, a getter for that field defines how we actually +// set it. +// +// So, `save-dev`, `save-optional`, `save-prod`, et al would indicate +// that they affect the `saveType` flat option. Then the config.flat +// object has a `get saveType () { ... }` that looks at the "real" +// config settings from files etc and returns the appropriate value. +// +// Getters will also (maybe?) give us a hook to audit flat option +// usage, so we can document and group these more appropriately. +// +// This will be a problem with cases where we currently do: +// const opts = { ...npm.flatOptions, foo: 'bar' }, but we can maybe +// instead do `npm.config.set('foo', 'bar')` prior to passing the +// config object down where it needs to go. +// +// This way, when we go hunting for "where does saveType come from anyway!?" +// while fixing some Arborist bug, we won't have to hunt through too +// many places. + +// XXX: We should really deprecate all these `--save-blah` switches +// in favor of a single `--save-type` option. The unfortunate shortcut +// we took for `--save-peer --save-optional` being `--save-type=peerOptional` +// makes this tricky, and likely a breaking change. + +// Define all config keys we know about. They are indexed by their own key for +// ease of lookup later. This duplication is an optimization so that we don't +// have to do an extra function call just to "reuse" the key in both places. + +const definitions = { + _auth: new Definition('_auth', { + default: null, + type: [null, String], + description: ` + A basic-auth string to use when authenticating against the npm registry. + This will ONLY be used to authenticate against the npm registry. For other + registries you will need to scope it like "//other-registry.tld/:_auth" + + Warning: This should generally not be set via a command-line option. It + is safer to use a registry-provided authentication bearer token stored in + the ~/.npmrc file by running \`npm login\`. + `, + flatten, + }), + access: new Definition('access', { + default: null, + defaultDescription: ` + 'public' for new packages, existing packages it will not change the current level + `, + type: [null, 'restricted', 'public'], + description: ` + If you do not want your scoped package to be publicly viewable (and + installable) set \`--access=restricted\`. + + Unscoped packages cannot be set to \`restricted\`. + + Note: This defaults to not changing the current access level for existing + packages. Specifying a value of \`restricted\` or \`public\` during + publish will change the access for an existing package the same way that + \`npm access set status\` would. + `, + flatten, + }), + all: new Definition('all', { + default: false, + type: Boolean, + short: 'a', + description: ` + When running \`npm outdated\` and \`npm ls\`, setting \`--all\` will show + all outdated or installed packages, rather than only those directly + depended upon by the current project. + `, + flatten, + }), + 'allow-same-version': new Definition('allow-same-version', { + default: false, + type: Boolean, + description: ` + Prevents throwing an error when \`npm version\` is used to set the new + version to the same value as the current version. + `, + flatten, + }), + 'allow-git': new Definition('allow-git', { + default: 'all', + type: ['all', 'none', 'root'], + description: ` + Limits the ability for npm to fetch dependencies from git references. + That is, dependencies that point to a git repo instead of a version or semver range. + Please note that this could leave your tree incomplete and some packages may not function as intended or designed. + + \`all\` allows any git dependencies to be fetched and installed. + \`none\` prevents any git dependencies from being fetched and installed. + \`root\` only allows git dependencies defined in your project's package.json to be fetched installed. Also allows git dependencies to be fetched for other commands like \`npm view\` + `, + flatten, + }), + also: new Definition('also', { + default: null, + type: [null, 'dev', 'development'], + description: ` + When set to \`dev\` or \`development\`, this is an alias for + \`--include=dev\`. + `, + deprecated: 'Please use --include=dev instead.', + flatten (key, obj, flatOptions) { + definitions.omit.flatten('omit', obj, flatOptions) + }, + }), + audit: new Definition('audit', { + default: true, + type: Boolean, + description: ` + When "true" submit audit reports alongside the current npm command to the + default registry and all registries configured for scopes. See the + documentation for [\`npm audit\`](/commands/npm-audit) for details on what + is submitted. + `, + flatten, + }), + 'audit-level': new Definition('audit-level', { + default: null, + type: [null, 'info', 'low', 'moderate', 'high', 'critical', 'none'], + description: ` + The minimum level of vulnerability for \`npm audit\` to exit with + a non-zero exit code. + `, + flatten, + }), + 'auth-type': new Definition('auth-type', { + default: 'web', + type: ['legacy', 'web'], + description: ` + What authentication strategy to use with \`login\`. + Note that if an \`otp\` config is given, this value will always be set to \`legacy\`. + `, + flatten, + }), + before: new Definition('before', { + default: null, + hint: '', + type: [null, Date], + exclusive: ['min-release-age'], + description: ` + If passed to \`npm install\`, will rebuild the npm tree such that only + versions that were available **on or before** the given date are + installed. If there are no versions available for the current set of + dependencies, the command will error. + + If the requested version is a \`dist-tag\` and the given tag does not + pass the \`--before\` filter, the most recent version less than or equal + to that tag will be used. For example, \`foo@latest\` might install + \`foo@1.2\` even though \`latest\` is \`2.0\`. + `, + flatten, + }), + 'bin-links': new Definition('bin-links', { + default: true, + type: Boolean, + description: ` + Tells npm to create symlinks (or \`.cmd\` shims on Windows) for package + executables. + + Set to false to have it not do this. This can be used to work around the + fact that some file systems don't support symlinks, even on ostensibly + Unix systems. + `, + flatten, + }), + browser: new Definition('browser', { + default: null, + defaultDescription: ` + macOS: \`"open"\`, Windows: \`"start"\`, Others: \`"xdg-open"\` + `, + type: [null, Boolean, String], + description: ` + The browser that is called by npm commands to open websites. + + Set to \`false\` to suppress browser behavior and instead print urls to + terminal. + + Set to \`true\` to use default system URL opener. + `, + flatten, + }), + 'bypass-2fa': new Definition('bypass-2fa', { + default: false, + type: Boolean, + description: ` + When creating a Granular Access Token with \`npm token create\`, + setting this to true will allow the token to bypass two-factor + authentication. This is useful for automation and CI/CD workflows. + `, + flatten, + }), + ca: new Definition('ca', { + default: null, + type: [null, String, Array], + description: ` + The Certificate Authority signing certificate that is trusted for SSL + connections to the registry. Values should be in PEM format (Windows + calls it "Base-64 encoded X.509 (.CER)") with newlines replaced by the + string "\\n". For example: + + \`\`\`ini + ca="-----BEGIN CERTIFICATE-----\\nXXXX\\nXXXX\\n-----END CERTIFICATE-----" + \`\`\` + + Set to \`null\` to only allow "known" registrars, or to a specific CA + cert to trust only that specific signing authority. + + Multiple CAs can be trusted by specifying an array of certificates: + + \`\`\`ini + ca[]="..." + ca[]="..." + \`\`\` + + See also the \`strict-ssl\` config. + `, + flatten, + }), + cache: new Definition('cache', { + default: cache, + defaultDescription: ` + Windows: \`%LocalAppData%\\npm-cache\`, Posix: \`~/.npm\` + `, + type: path, + description: ` + The location of npm's cache directory. + `, + flatten (key, obj, flatOptions) { + flatOptions.cache = join(obj.cache, '_cacache') + flatOptions.npxCache = join(obj.cache, '_npx') + flatOptions.tufCache = join(obj.cache, '_tuf') + }, + }), + 'cache-max': new Definition('cache-max', { + default: Infinity, + type: Number, + description: ` + \`--cache-max=0\` is an alias for \`--prefer-online\` + `, + deprecated: ` + This option has been deprecated in favor of \`--prefer-online\` + `, + flatten (key, obj, flatOptions) { + if (obj[key] <= 0) { + flatOptions.preferOnline = true + } + }, + }), + 'cache-min': new Definition('cache-min', { + default: 0, + type: Number, + description: ` + \`--cache-min=9999 (or bigger)\` is an alias for \`--prefer-offline\`. + `, + deprecated: ` + This option has been deprecated in favor of \`--prefer-offline\`. + `, + flatten (key, obj, flatOptions) { + if (obj[key] >= 9999) { + flatOptions.preferOffline = true + } + }, + }), + cafile: new Definition('cafile', { + default: null, + type: path, + description: ` + A path to a file containing one or multiple Certificate Authority signing + certificates. Similar to the \`ca\` setting, but allows for multiple + CA's, as well as for the CA information to be stored in a file on disk. + `, + flatten (key, obj, flatOptions) { + // always set to null in defaults + if (!obj.cafile) { + return + } + + const raw = maybeReadFile(obj.cafile) + if (!raw) { + return + } + + const delim = '-----END CERTIFICATE-----' + flatOptions.ca = raw.replace(/\r\n/g, '\n').split(delim) + .filter(section => section.trim()) + .map(section => section.trimLeft() + delim) + }, + }), + call: new Definition('call', { + default: '', + type: String, + short: 'c', + description: ` + Optional companion option for \`npm exec\`, \`npx\` that allows for + specifying a custom command to be run along with the installed packages. + + \`\`\`bash + npm exec --package yo --package generator-node --call "yo node" + \`\`\` + `, + flatten, + }), + cert: new Definition('cert', { + default: null, + type: [null, String], + description: ` + A client certificate to pass when accessing the registry. Values should + be in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with + newlines replaced by the string "\\n". For example: + + \`\`\`ini + cert="-----BEGIN CERTIFICATE-----\\nXXXX\\nXXXX\\n-----END CERTIFICATE-----" + \`\`\` + + It is _not_ the path to a certificate file, though you can set a registry-scoped + "certfile" path like "//other-registry.tld/:certfile=/path/to/cert.pem". + `, + deprecated: ` + \`key\` and \`cert\` are no longer used for most registry operations. + Use registry scoped \`keyfile\` and \`certfile\` instead. + Example: + //other-registry.tld/:keyfile=/path/to/key.pem + //other-registry.tld/:certfile=/path/to/cert.crt + `, + flatten, + }), + cidr: new Definition('cidr', { + default: null, + type: [null, String, Array], + description: ` + This is a list of CIDR address to be used when configuring limited access + tokens with the \`npm token create\` command. + `, + flatten, + }), + // This should never be directly used, the flattened value is the derived value + // and is sent to other modules, and is also exposed as `npm.color` for use + // inside npm itself. + color: new Definition('color', { + default: !process.env.NO_COLOR || process.env.NO_COLOR === '0', + usage: '--color|--no-color|--color always', + defaultDescription: ` + true unless the NO_COLOR environ is set to something other than '0' + `, + type: ['always', Boolean], + description: ` + If false, never shows colors. If \`"always"\` then always shows colors. + If true, then only prints color codes for tty file descriptors. + `, + flatten (key, obj, flatOptions) { + flatOptions.color = !obj.color ? false + : obj.color === 'always' ? true + : !!process.stdout.isTTY + flatOptions.logColor = !obj.color ? false + : obj.color === 'always' ? true + : !!process.stderr.isTTY + }, + }), + 'commit-hooks': new Definition('commit-hooks', { + default: true, + type: Boolean, + description: ` + Run git commit hooks when using the \`npm version\` command. + `, + flatten, + }), + cpu: new Definition('cpu', { + default: null, + type: [null, String], + description: ` + Override CPU architecture of native modules to install. + Acceptable values are same as \`cpu\` field of package.json, + which comes from \`process.arch\`. + `, + flatten, + }), + depth: new Definition('depth', { + default: null, + defaultDescription: ` + \`Infinity\` if \`--all\` is set; otherwise, \`0\` + `, + type: [null, Number], + description: ` + The depth to go when recursing packages for \`npm ls\`. + + If not set, \`npm ls\` will show only the immediate dependencies of the + root project. If \`--all\` is set, then npm will show all dependencies + by default. + `, + flatten, + }), + description: new Definition('description', { + default: true, + type: Boolean, + usage: '--no-description', + description: ` + Show the description in \`npm search\` + `, + flatten (key, obj, flatOptions) { + flatOptions.search = flatOptions.search || { limit: 20 } + flatOptions.search[key] = obj[key] + }, + }), + dev: new Definition('dev', { + default: false, + type: Boolean, + description: ` + Alias for \`--include=dev\`. + `, + deprecated: 'Please use --include=dev instead.', + flatten (key, obj, flatOptions) { + definitions.omit.flatten('omit', obj, flatOptions) + }, + }), + diff: new Definition('diff', { + default: [], + hint: '', + type: [String, Array], + description: ` + Define arguments to compare in \`npm diff\`. + `, + flatten, + }), + 'diff-ignore-all-space': new Definition('diff-ignore-all-space', { + default: false, + type: Boolean, + description: ` + Ignore whitespace when comparing lines in \`npm diff\`. + `, + flatten, + }), + 'diff-name-only': new Definition('diff-name-only', { + default: false, + type: Boolean, + description: ` + Prints only filenames when using \`npm diff\`. + `, + flatten, + }), + 'diff-no-prefix': new Definition('diff-no-prefix', { + default: false, + type: Boolean, + description: ` + Do not show any source or destination prefix in \`npm diff\` output. + + Note: this causes \`npm diff\` to ignore the \`--diff-src-prefix\` and + \`--diff-dst-prefix\` configs. + `, + flatten, + }), + 'diff-dst-prefix': new Definition('diff-dst-prefix', { + default: 'b/', + hint: '', + type: String, + description: ` + Destination prefix to be used in \`npm diff\` output. + `, + flatten, + }), + 'diff-src-prefix': new Definition('diff-src-prefix', { + default: 'a/', + hint: '', + type: String, + description: ` + Source prefix to be used in \`npm diff\` output. + `, + flatten, + }), + 'diff-text': new Definition('diff-text', { + default: false, + type: Boolean, + description: ` + Treat all files as text in \`npm diff\`. + `, + flatten, + }), + 'diff-unified': new Definition('diff-unified', { + default: 3, + type: Number, + description: ` + The number of lines of context to print in \`npm diff\`. + `, + flatten, + }), + 'dry-run': new Definition('dry-run', { + default: false, + type: Boolean, + description: ` + Indicates that you don't want npm to make any changes and that it should + only report what it would have done. This can be passed into any of the + commands that modify your local installation, eg, \`install\`, + \`update\`, \`dedupe\`, \`uninstall\`, as well as \`pack\` and + \`publish\`. + + Note: This is NOT honored by other network related commands, eg + \`dist-tags\`, \`owner\`, etc. + `, + flatten, + }), + editor: new Definition('editor', { + default: editor, + defaultDescription: ` + The EDITOR or VISUAL environment variables, or '%SYSTEMROOT%\\notepad.exe' on Windows, + or 'vi' on Unix systems + `, + type: String, + description: ` + The command to run for \`npm edit\` and \`npm config edit\`. + `, + flatten, + }), + 'engine-strict': new Definition('engine-strict', { + default: false, + type: Boolean, + description: ` + If set to true, then npm will stubbornly refuse to install (or even + consider installing) any package that claims to not be compatible with + the current Node.js version. + + This can be overridden by setting the \`--force\` flag. + `, + flatten, + }), + 'expect-result-count': new Definition('expect-result-count', { + default: null, + type: [null, Number], + hint: '', + exclusive: ['expect-results'], + description: ` + Tells to expect a specific number of results from the command. + `, + }), + 'expect-results': new Definition('expect-results', { + default: null, + type: [null, Boolean], + exclusive: ['expect-result-count'], + description: ` + Tells npm whether or not to expect results from the command. + Can be either true (expect some results) or false (expect no results). + `, + }), + expires: new Definition('expires', { + default: null, + type: [null, Number], + description: ` + When creating a Granular Access Token with \`npm token create\`, + this sets the expiration in days. If not specified, the server + will determine the default expiration. + `, + flatten, + }), + 'fetch-retries': new Definition('fetch-retries', { + default: 2, + type: Number, + description: ` + The "retries" config for the \`retry\` module to use when fetching + packages from the registry. + + npm will retry idempotent read requests to the registry in the case + of network failures or 5xx HTTP errors. + `, + flatten (key, obj, flatOptions) { + flatOptions.retry = flatOptions.retry || {} + flatOptions.retry.retries = obj[key] + }, + }), + 'fetch-retry-factor': new Definition('fetch-retry-factor', { + default: 10, + type: Number, + description: ` + The "factor" config for the \`retry\` module to use when fetching + packages. + `, + flatten (key, obj, flatOptions) { + flatOptions.retry = flatOptions.retry || {} + flatOptions.retry.factor = obj[key] + }, + }), + 'fetch-retry-maxtimeout': new Definition('fetch-retry-maxtimeout', { + default: 60000, + defaultDescription: '60000 (1 minute)', + type: Number, + description: ` + The "maxTimeout" config for the \`retry\` module to use when fetching + packages. + `, + flatten (key, obj, flatOptions) { + flatOptions.retry = flatOptions.retry || {} + flatOptions.retry.maxTimeout = obj[key] + }, + }), + 'fetch-retry-mintimeout': new Definition('fetch-retry-mintimeout', { + default: 10000, + defaultDescription: '10000 (10 seconds)', + type: Number, + description: ` + The "minTimeout" config for the \`retry\` module to use when fetching + packages. + `, + flatten (key, obj, flatOptions) { + flatOptions.retry = flatOptions.retry || {} + flatOptions.retry.minTimeout = obj[key] + }, + }), + 'fetch-timeout': new Definition('fetch-timeout', { + default: 5 * 60 * 1000, + defaultDescription: `${5 * 60 * 1000} (5 minutes)`, + type: Number, + description: ` + The maximum amount of time to wait for HTTP requests to complete. + `, + flatten (key, obj, flatOptions) { + flatOptions.timeout = obj[key] + }, + }), + force: new Definition('force', { + default: false, + type: Boolean, + short: 'f', + description: ` + Removes various protections against unfortunate side effects, common + mistakes, unnecessary performance degradation, and malicious input. + + * Allow clobbering non-npm files in global installs. + * Allow the \`npm version\` command to work on an unclean git repository. + * Allow deleting the cache folder with \`npm cache clean\`. + * Allow installing packages that have an \`engines\` declaration + requiring a different version of npm. + * Allow installing packages that have an \`engines\` declaration + requiring a different version of \`node\`, even if \`--engine-strict\` + is enabled. + * Allow \`npm audit fix\` to install modules outside your stated + dependency range (including SemVer-major changes). + * Allow unpublishing all versions of a published package. + * Allow conflicting peerDependencies to be installed in the root project. + * Implicitly set \`--yes\` during \`npm init\`. + * Allow clobbering existing values in \`npm pkg\` + * Allow unpublishing of entire packages (not just a single version). + + If you don't have a clear idea of what you want to do, it is strongly + recommended that you do not use this option! + `, + flatten, + }), + 'foreground-scripts': new Definition('foreground-scripts', { + default: false, + defaultDescription: `\`false\` unless when using \`npm pack\` or \`npm publish\` where it + defaults to \`true\``, + type: Boolean, + description: ` + Run all build scripts (ie, \`preinstall\`, \`install\`, and + \`postinstall\`) scripts for installed packages in the foreground + process, sharing standard input, output, and error with the main npm + process. + + Note that this will generally make installs run slower, and be much + noisier, but can be useful for debugging. + `, + flatten, + }), + 'format-package-lock': new Definition('format-package-lock', { + default: true, + type: Boolean, + description: ` + Format \`package-lock.json\` or \`npm-shrinkwrap.json\` as a human + readable file. + `, + flatten, + }), + fund: new Definition('fund', { + default: true, + type: Boolean, + description: ` + When "true" displays the message at the end of each \`npm install\` + acknowledging the number of dependencies looking for funding. + See [\`npm fund\`](/commands/npm-fund) for details. + `, + flatten, + }), + git: new Definition('git', { + default: 'git', + type: String, + description: ` + The command to use for git commands. If git is installed on the + computer, but is not in the \`PATH\`, then set this to the full path to + the git binary. + `, + flatten, + }), + 'git-tag-version': new Definition('git-tag-version', { + default: true, + type: Boolean, + description: ` + Tag the commit when using the \`npm version\` command. Setting this to + false results in no commit being made at all. + `, + flatten, + }), + global: new Definition('global', { + default: false, + type: Boolean, + short: 'g', + description: ` + Operates in "global" mode, so that packages are installed into the + \`prefix\` folder instead of the current working directory. See + [folders](/configuring-npm/folders) for more on the differences in + behavior. + + * packages are installed into the \`{prefix}/lib/node_modules\` folder, + instead of the current working directory. + * bin files are linked to \`{prefix}/bin\` + * man pages are linked to \`{prefix}/share/man\` + `, + flatten: (key, obj, flatOptions) => { + flatten(key, obj, flatOptions) + if (flatOptions.global) { + flatOptions.location = 'global' + } + }, + }), + // the globalconfig has its default defined outside of this module + globalconfig: new Definition('globalconfig', { + type: path, + default: '', + defaultDescription: ` + The global --prefix setting plus 'etc/npmrc'. For example, + '/usr/local/etc/npmrc' + `, + description: ` + The config file to read for global config options. + `, + flatten, + }), + 'global-style': new Definition('global-style', { + default: false, + type: Boolean, + description: ` + Only install direct dependencies in the top level \`node_modules\`, + but hoist on deeper dependencies. + Sets \`--install-strategy=shallow\`. + `, + deprecated: ` + This option has been deprecated in favor of \`--install-strategy=shallow\` + `, + flatten (key, obj, flatOptions) { + if (obj[key]) { + obj['install-strategy'] = 'shallow' + flatOptions.installStrategy = 'shallow' + } + }, + }), + heading: new Definition('heading', { + default: 'npm', + type: String, + description: ` + The string that starts all the debugging log output. + `, + flatten, + }), + 'https-proxy': new Definition('https-proxy', { + default: null, + type: [null, url], + description: ` + A proxy to use for outgoing https requests. If the \`HTTPS_PROXY\` or + \`https_proxy\` or \`HTTP_PROXY\` or \`http_proxy\` environment variables + are set, proxy settings will be honored by the underlying + \`make-fetch-happen\` library. + `, + flatten, + }), + 'if-present': new Definition('if-present', { + default: false, + type: Boolean, + envExport: false, + description: ` + If true, npm will not exit with an error code when \`run\` is + invoked for a script that isn't defined in the \`scripts\` section of + \`package.json\`. This option can be used when it's desirable to + optionally run a script when it's present and fail if the script fails. + This is useful, for example, when running scripts that may only apply for + some builds in an otherwise generic CI setup. + `, + flatten, + }), + 'ignore-scripts': new Definition('ignore-scripts', { + default: false, + type: Boolean, + description: ` + If true, npm does not run scripts specified in package.json files. + + Note that commands explicitly intended to run a particular script, such + as \`npm start\`, \`npm stop\`, \`npm restart\`, \`npm test\`, and \`npm + run\` will still run their intended script if \`ignore-scripts\` is + set, but they will *not* run any pre- or post-scripts. + `, + flatten, + }), + include: new Definition('include', { + default: [], + type: [Array, 'prod', 'dev', 'optional', 'peer'], + description: ` + Option that allows for defining which types of dependencies to install. + + This is the inverse of \`--omit=\`. + + Dependency types specified in \`--include\` will not be omitted, + regardless of the order in which omit/include are specified on the + command-line. + `, + flatten (key, obj, flatOptions) { + // just call the omit flattener, it reads from obj.include + definitions.omit.flatten('omit', obj, flatOptions) + }, + }), + 'include-staged': new Definition('include-staged', { + default: false, + type: Boolean, + description: ` + Allow installing "staged" published packages, as defined by [npm RFC PR + #92](https://github.com/npm/rfcs/pull/92). + + This is experimental, and not implemented by the npm public registry. + `, + flatten, + }), + 'include-workspace-root': new Definition('include-workspace-root', { + default: false, + type: Boolean, + envExport: false, + description: ` + Include the workspace root when workspaces are enabled for a command. + + When false, specifying individual workspaces via the \`workspace\` config, + or all workspaces via the \`workspaces\` flag, will cause npm to operate only + on the specified workspaces, and not on the root project. + `, + flatten, + }), + 'include-attestations': new Definition('include-attestations', { + default: false, + type: Boolean, + description: ` + When used with \`npm audit signatures --json\`, includes the full + sigstore attestation bundles in the JSON output for each verified + package. The bundles contain DSSE envelopes, verification material, + and transparency log entries. + `, + flatten, + }), + 'init-author-email': new Definition('init-author-email', { + default: '', + hint: '', + type: String, + description: ` + The value \`npm init\` should use by default for the package author's + email. + `, + }), + 'init-author-name': new Definition('init-author-name', { + default: '', + hint: '', + type: String, + description: ` + The value \`npm init\` should use by default for the package author's name. + `, + }), + 'init-author-url': new Definition('init-author-url', { + default: '', + type: ['', url], + hint: '', + description: ` + The value \`npm init\` should use by default for the package author's homepage. + `, + }), + 'init-license': new Definition('init-license', { + default: 'ISC', + hint: '', + type: String, + description: ` + The value \`npm init\` should use by default for the package license. + `, + }), + 'init-module': new Definition('init-module', { + default: '~/.npm-init.js', + type: path, + hint: '', + description: ` + A module that will be loaded by the \`npm init\` command. See the + documentation for the + [init-package-json](https://github.com/npm/init-package-json) module for + more information, or [npm init](/commands/npm-init). + `, + }), + 'init-type': new Definition('init-type', { + default: 'commonjs', + type: String, + hint: '', + description: ` + The value that \`npm init\` should use by default for the package.json type field. + `, + }), + 'init-version': new Definition('init-version', { + default: '1.0.0', + type: Semver, + hint: '', + description: ` + The value that \`npm init\` should use by default for the package + version number, if not already set in package.json. + `, + }), + 'init-private': new Definition('init-private', { + default: false, + type: Boolean, + description: ` + The value \`npm init\` should use by default for the package's private flag. + `, + flatten, + }), + // these "aliases" are historically supported in .npmrc files, unfortunately + // They should be removed in a future npm version. + 'init.author.email': new Definition('init.author.email', { + default: '', + type: String, + deprecated: ` + Use \`--init-author-email\` instead.`, + description: ` + Alias for \`--init-author-email\` + `, + }), + 'init.author.name': new Definition('init.author.name', { + default: '', + type: String, + deprecated: ` + Use \`--init-author-name\` instead. + `, + description: ` + Alias for \`--init-author-name\` + `, + }), + 'init.author.url': new Definition('init.author.url', { + default: '', + type: ['', url], + deprecated: ` + Use \`--init-author-url\` instead. + `, + description: ` + Alias for \`--init-author-url\` + `, + }), + 'init.license': new Definition('init.license', { + default: 'ISC', + type: String, + deprecated: ` + Use \`--init-license\` instead. + `, + description: ` + Alias for \`--init-license\` + `, + }), + 'init.module': new Definition('init.module', { + default: '~/.npm-init.js', + type: path, + deprecated: ` + Use \`--init-module\` instead. + `, + description: ` + Alias for \`--init-module\` + `, + }), + 'init.version': new Definition('init.version', { + default: '1.0.0', + type: Semver, + deprecated: ` + Use \`--init-version\` instead. + `, + description: ` + Alias for \`--init-version\` + `, + }), + 'install-links': new Definition('install-links', { + default: false, + type: Boolean, + description: ` + When set file: protocol dependencies will be packed and installed as + regular dependencies instead of creating a symlink. This option has + no effect on workspaces. + `, + flatten, + }), + 'install-strategy': new Definition('install-strategy', { + default: 'hoisted', + type: ['hoisted', 'nested', 'shallow', 'linked'], + description: ` + Sets the strategy for installing packages in node_modules. + hoisted (default): Install non-duplicated in top-level, and duplicated as + necessary within directory structure. + nested: (formerly --legacy-bundling) install in place, no hoisting. + shallow (formerly --global-style) only install direct deps at top-level. + linked: (experimental) install in node_modules/.store, link in place, + unhoisted. + `, + flatten, + }), + json: new Definition('json', { + default: false, + type: Boolean, + description: ` + Whether or not to output JSON data, rather than the normal output. + + * In \`npm pkg set\` it enables parsing set values with JSON.parse() + before saving them to your \`package.json\`. + + Not supported by all npm commands. + `, + flatten, + }), + key: new Definition('key', { + default: null, + type: [null, String], + description: ` + A client key to pass when accessing the registry. Values should be in + PEM format with newlines replaced by the string "\\n". For example: + + \`\`\`ini + key="-----BEGIN PRIVATE KEY-----\\nXXXX\\nXXXX\\n-----END PRIVATE KEY-----" + \`\`\` + + It is _not_ the path to a key file, though you can set a registry-scoped + "keyfile" path like "//other-registry.tld/:keyfile=/path/to/key.pem". + `, + deprecated: ` + \`key\` and \`cert\` are no longer used for most registry operations. + Use registry scoped \`keyfile\` and \`certfile\` instead. + Example: + //other-registry.tld/:keyfile=/path/to/key.pem + //other-registry.tld/:certfile=/path/to/cert.crt + `, + flatten, + }), + 'legacy-bundling': new Definition('legacy-bundling', { + default: false, + type: Boolean, + description: ` + Instead of hoisting package installs in \`node_modules\`, install packages + in the same manner that they are depended on. This may cause very deep + directory structures and duplicate package installs as there is no + de-duplicating. + Sets \`--install-strategy=nested\`. + `, + deprecated: ` + This option has been deprecated in favor of \`--install-strategy=nested\` + `, + flatten (key, obj, flatOptions) { + if (obj[key]) { + obj['install-strategy'] = 'nested' + flatOptions.installStrategy = 'nested' + } + }, + }), + 'legacy-peer-deps': new Definition('legacy-peer-deps', { + default: false, + type: Boolean, + description: ` + Causes npm to completely ignore \`peerDependencies\` when building a + package tree, as in npm versions 3 through 6. + + If a package cannot be installed because of overly strict + \`peerDependencies\` that collide, it provides a way to move forward + resolving the situation. + + This differs from \`--omit=peer\`, in that \`--omit=peer\` will avoid + unpacking \`peerDependencies\` on disk, but will still design a tree such + that \`peerDependencies\` _could_ be unpacked in a correct place. + + Use of \`legacy-peer-deps\` is not recommended, as it will not enforce + the \`peerDependencies\` contract that meta-dependencies may rely on. + `, + flatten, + }), + libc: new Definition('libc', { + default: null, + type: [null, String], + description: ` + Override libc of native modules to install. + Acceptable values are same as \`libc\` field of package.json + `, + flatten, + }), + link: new Definition('link', { + default: false, + type: Boolean, + description: ` + Used with \`npm ls\`, limiting output to only those packages that are + linked. + `, + }), + 'local-address': new Definition('local-address', { + default: null, + type: getLocalAddresses(), + typeDescription: 'IP Address', + description: ` + The IP address of the local interface to use when making connections to + the npm registry. Must be IPv4 in versions of Node prior to 0.12. + `, + flatten, + }), + location: new Definition('location', { + default: 'user', + short: 'L', + type: [ + 'global', + 'user', + 'project', + ], + defaultDescription: ` + "user" unless \`--global\` is passed, which will also set this value to "global" + `, + description: ` + When passed to \`npm config\` this refers to which config file to use. + + When set to "global" mode, packages are installed into the \`prefix\` folder + instead of the current working directory. See + [folders](/configuring-npm/folders) for more on the differences in behavior. + + * packages are installed into the \`{prefix}/lib/node_modules\` folder, + instead of the current working directory. + * bin files are linked to \`{prefix}/bin\` + * man pages are linked to \`{prefix}/share/man\` + `, + flatten: (key, obj, flatOptions) => { + flatten(key, obj, flatOptions) + if (flatOptions.global) { + flatOptions.location = 'global' + } + if (obj.location === 'global') { + flatOptions.global = true + } + }, + }), + 'lockfile-version': new Definition('lockfile-version', { + default: null, + type: [null, 1, 2, 3, '1', '2', '3'], + defaultDescription: ` + Version 3 if no lockfile, auto-converting v1 lockfiles to v3; otherwise, + maintain current lockfile version.`, + description: ` + Set the lockfile format version to be used in package-lock.json and + npm-shrinkwrap-json files. Possible options are: + + 1: The lockfile version used by npm versions 5 and 6. Lacks some data that + is used during the install, resulting in slower and possibly less + deterministic installs. Prevents lockfile churn when interoperating with + older npm versions. + + 2: The default lockfile version used by npm version 7 and 8. Includes both + the version 1 lockfile data and version 3 lockfile data, for maximum + determinism and interoperability, at the expense of more bytes on disk. + + 3: Only the new lockfile information introduced in npm version 7. Smaller + on disk than lockfile version 2, but not interoperable with older npm + versions. Ideal if all users are on npm version 7 and higher. + `, + flatten: (key, obj, flatOptions) => { + flatOptions.lockfileVersion = obj[key] && parseInt(obj[key], 10) + }, + }), + loglevel: new Definition('loglevel', { + default: 'notice', + type: [ + 'silent', + 'error', + 'warn', + 'notice', + 'http', + 'info', + 'verbose', + 'silly', + ], + description: ` + What level of logs to report. All logs are written to a debug log, + with the path to that file printed if the execution of a command fails. + + Any logs of a higher level than the setting are shown. The default is + "notice". + + See also the \`foreground-scripts\` config. + `, + flatten (key, obj, flatOptions) { + flatOptions.silent = obj[key] === 'silent' + }, + }), + 'logs-dir': new Definition('logs-dir', { + default: null, + type: [null, path], + defaultDescription: ` + A directory named \`_logs\` inside the cache + `, + description: ` + The location of npm's log directory. See [\`npm + logging\`](/using-npm/logging) for more information. + `, + }), + 'logs-max': new Definition('logs-max', { + default: 10, + type: Number, + description: ` + The maximum number of log files to store. + + If set to 0, no log files will be written for the current run. + `, + }), + long: new Definition('long', { + default: false, + type: Boolean, + short: 'l', + description: ` + Show extended information in \`ls\`, \`search\`, and \`help-search\`. + `, + }), + name: new Definition('name', { + default: null, + type: [null, String], + hint: '', + description: ` + When creating a Granular Access Token with \`npm token create\`, + this sets the name/description for the token. + `, + flatten, + }), + maxsockets: new Definition('maxsockets', { + default: 15, + type: Number, + description: ` + The maximum number of connections to use per origin (protocol/host/port + combination). + `, + flatten (key, obj, flatOptions) { + flatOptions.maxSockets = obj[key] + }, + }), + message: new Definition('message', { + default: '%s', + type: String, + short: 'm', + description: ` + Commit message which is used by \`npm version\` when creating version commit. + + Any "%s" in the message will be replaced with the version number. + `, + flatten, + }), + 'min-release-age': new Definition('min-release-age', { + default: null, + hint: '', + type: [null, Number], + exclusive: ['before'], + envExport: false, + description: ` + If set, npm will build the npm tree such that only versions that were + available more than the given number of days ago will be installed. If + there are no versions available for the current set of dependencies, the + command will error. + + This flag is a complement to \`before\`, which accepts an exact date + instead of a relative number of days. + `, + flatten: (key, obj, flatOptions) => { + if (obj['min-release-age'] !== null) { + flatOptions.before = new Date(Date.now() - (86400000 * obj['min-release-age'])) + obj.before = flatOptions.before + delete obj['min-release-age'] + } + }, + }), + 'node-gyp': new Definition('node-gyp', { + default: (() => { + try { + return require.resolve('node-gyp/bin/node-gyp.js') + } catch { + return '' + } + })(), + defaultDescription: ` + The path to the node-gyp bin that ships with npm + `, + type: path, + description: ` + This is the location of the "node-gyp" bin. By default it uses one that ships with npm itself. + + You can use this config to specify your own "node-gyp" to run when it is required to build a package. + `, + flatten, + }), + 'node-options': new Definition('node-options', { + default: null, + type: [null, String], + description: ` + Options to pass through to Node.js via the \`NODE_OPTIONS\` environment + variable. This does not impact how npm itself is executed but it does + impact how lifecycle scripts are called. + `, + }), + noproxy: new Definition('noproxy', { + default: '', + defaultDescription: ` + The value of the NO_PROXY environment variable + `, + type: [String, Array], + description: ` + Domain extensions that should bypass any proxies. + + Also accepts a comma-delimited string. + `, + flatten (key, obj, flatOptions) { + if (Array.isArray(obj[key])) { + flatOptions.noProxy = obj[key].join(',') + } else { + flatOptions.noProxy = obj[key] + } + }, + }), + offline: new Definition('offline', { + default: false, + type: Boolean, + description: ` + Force offline mode: no network requests will be done during install. To allow + the CLI to fill in missing cache data, see \`--prefer-offline\`. + `, + flatten, + }), + omit: new Definition('omit', { + default: process.env.NODE_ENV === 'production' ? ['dev'] : [], + defaultDescription: ` + 'dev' if the \`NODE_ENV\` environment variable is set to 'production'; + otherwise, empty. + `, + type: [Array, 'dev', 'optional', 'peer'], + description: ` + Dependency types to omit from the installation tree on disk. + + Note that these dependencies _are_ still resolved and added to the + \`package-lock.json\` or \`npm-shrinkwrap.json\` file. They are just + not physically installed on disk. + + If a package type appears in both the \`--include\` and \`--omit\` + lists, then it will be included. + + If the resulting omit list includes \`'dev'\`, then the \`NODE_ENV\` + environment variable will be set to \`'production'\` for all lifecycle + scripts. + `, + flatten (key, obj, flatOptions) { + flatOptions.omit = buildOmitList(obj) + }, + }), + 'omit-lockfile-registry-resolved': new Definition('omit-lockfile-registry-resolved', { + default: false, + type: Boolean, + description: ` + This option causes npm to create lock files without a \`resolved\` key for + registry dependencies. Subsequent installs will need to resolve tarball + endpoints with the configured registry, likely resulting in a longer install + time. + `, + flatten, + }), + only: new Definition('only', { + default: null, + type: [null, 'prod', 'production'], + deprecated: ` + Use \`--omit=dev\` to omit dev dependencies from the install. + `, + description: ` + When set to \`prod\` or \`production\`, this is an alias for + \`--omit=dev\`. + `, + flatten (key, obj, flatOptions) { + definitions.omit.flatten('omit', obj, flatOptions) + }, + }), + orgs: new Definition('orgs', { + default: null, + type: [null, String, Array], + description: ` + When creating a Granular Access Token with \`npm token create\`, + this limits the token access to specific organizations. + `, + flatten, + }), + optional: new Definition('optional', { + default: null, + type: [null, Boolean], + deprecated: ` + Use \`--omit=optional\` to exclude optional dependencies, or + \`--include=optional\` to include them. + + Default value does install optional deps unless otherwise omitted. + `, + description: ` + Alias for --include=optional or --omit=optional + `, + flatten (key, obj, flatOptions) { + definitions.omit.flatten('omit', obj, flatOptions) + }, + }), + os: new Definition('os', { + default: null, + type: [null, String], + description: ` + Override OS of native modules to install. + Acceptable values are same as \`os\` field of package.json, + which comes from \`process.platform\`. + `, + flatten, + }), + otp: new Definition('otp', { + default: null, + type: [null, String], + description: ` + This is a one-time password from a two-factor authenticator. It's needed + when publishing or changing package permissions with \`npm access\`. + + If not set, and a registry response fails with a challenge for a one-time + password, npm will prompt on the command line for one. + `, + flatten (key, obj, flatOptions) { + flatten(key, obj, flatOptions) + if (obj.otp) { + obj['auth-type'] = 'legacy' + flatten('auth-type', obj, flatOptions) + } + }, + }), + package: new Definition('package', { + default: [], + hint: '', + type: [String, Array], + description: ` + The package or packages to install for [\`npm exec\`](/commands/npm-exec) + `, + flatten, + }), + 'package-lock': new Definition('package-lock', { + default: true, + type: Boolean, + description: ` + If set to false, then ignore \`package-lock.json\` files when installing. + This will also prevent _writing_ \`package-lock.json\` if \`save\` is + true. + `, + flatten: (key, obj, flatOptions) => { + flatten(key, obj, flatOptions) + if (flatOptions.packageLockOnly) { + flatOptions.packageLock = true + } + }, + }), + 'package-lock-only': new Definition('package-lock-only', { + default: false, + type: Boolean, + description: ` + If set to true, the current operation will only use the \`package-lock.json\`, + ignoring \`node_modules\`. + + For \`update\` this means only the \`package-lock.json\` will be updated, + instead of checking \`node_modules\` and downloading dependencies. + + For \`list\` this means the output will be based on the tree described by the + \`package-lock.json\`, rather than the contents of \`node_modules\`. + `, + flatten: (key, obj, flatOptions) => { + flatten(key, obj, flatOptions) + if (flatOptions.packageLockOnly) { + flatOptions.packageLock = true + } + }, + }), + 'pack-destination': new Definition('pack-destination', { + default: '.', + type: String, + description: ` + Directory in which \`npm pack\` will save tarballs. + `, + flatten, + }), + packages: new Definition('packages', { + default: [], + type: [null, String, Array], + description: ` + When creating a Granular Access Token with \`npm token create\`, + this limits the token access to specific packages. + `, + flatten, + }), + parseable: new Definition('parseable', { + default: false, + type: Boolean, + short: 'p', + description: ` + Output parseable results from commands that write to standard output. For + \`npm search\`, this will be tab-separated table format. + `, + flatten, + }), + 'prefer-dedupe': new Definition('prefer-dedupe', { + default: false, + type: Boolean, + description: ` + Prefer to deduplicate packages if possible, rather than + choosing a newer version of a dependency. + `, + flatten, + }), + 'prefer-offline': new Definition('prefer-offline', { + default: false, + type: Boolean, + description: ` + If true, staleness checks for cached data will be bypassed, but missing + data will be requested from the server. To force full offline mode, use + \`--offline\`. + `, + flatten, + }), + 'prefer-online': new Definition('prefer-online', { + default: false, + type: Boolean, + description: ` + If true, staleness checks for cached data will be forced, making the CLI + look for updates immediately even for fresh package data. + `, + flatten, + }), + // `prefix` has its default defined outside of this module + prefix: new Definition('prefix', { + type: path, + short: 'C', + default: '', + defaultDescription: ` + In global mode, the folder where the node executable is installed. + Otherwise, the nearest parent folder containing either a package.json + file or a node_modules folder. + `, + description: ` + The location to install global items. If set on the command line, then + it forces non-global commands to run in the specified folder. + `, + }), + preid: new Definition('preid', { + default: '', + hint: 'prerelease-id', + type: String, + description: ` + The "prerelease identifier" to use as a prefix for the "prerelease" part + of a semver. Like the \`rc\` in \`1.2.0-rc.8\`. + `, + flatten, + }), + production: new Definition('production', { + default: null, + type: [null, Boolean], + deprecated: 'Use `--omit=dev` instead.', + description: 'Alias for `--omit=dev`', + flatten (key, obj, flatOptions) { + definitions.omit.flatten('omit', obj, flatOptions) + }, + }), + progress: new Definition('progress', { + default: !(ciInfo.isCI || !process.stderr.isTTY || !process.stdout.isTTY || process.env.TERM === 'dumb'), + defaultDescription: ` + \`true\` when not in CI and both stderr and stdout are TTYs and not in a dumb terminal + `, + type: Boolean, + description: ` + When set to \`true\`, npm will display a progress bar during time + intensive operations, if \`process.stderr\` and \`process.stdout\` are a TTY. + + Set to \`false\` to suppress the progress bar. + `, + flatten (key, obj, flatOptions) { + // Only show progress if explicitly enabled AND we have proper TTY environment + flatOptions.progress = !!obj.progress && !!process.stderr.isTTY && !!process.stdout.isTTY && process.env.TERM !== 'dumb' + }, + }), + provenance: new Definition('provenance', { + default: false, + type: Boolean, + exclusive: ['provenance-file'], + description: ` + When publishing from a supported cloud CI/CD system, the package will be + publicly linked to where it was built and published from. + `, + flatten, + }), + 'provenance-file': new Definition('provenance-file', { + default: null, + type: path, + hint: '', + exclusive: ['provenance'], + description: ` + When publishing, the provenance bundle at the given path will be used. + `, + flatten, + }), + proxy: new Definition('proxy', { + default: null, + type: [null, false, url], // allow proxy to be disabled explicitly + description: ` + 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. + `, + flatten, + }), + 'read-only': new Definition('read-only', { + default: false, + type: Boolean, + description: ` + This is used to mark a token as unable to publish when configuring + limited access tokens with the \`npm token create\` command. + `, + flatten, + }), + 'rebuild-bundle': new Definition('rebuild-bundle', { + default: true, + type: Boolean, + description: ` + Rebuild bundled dependencies after installation. + `, + flatten, + }), + registry: new Definition('registry', { + default: 'https://registry.npmjs.org/', + type: url, + description: ` + The base URL of the npm registry. + `, + flatten, + }), + 'replace-registry-host': new Definition('replace-registry-host', { + default: 'npmjs', + hint: ' | hostname', + type: ['npmjs', 'never', 'always', String], + description: ` + Defines behavior for replacing the registry host in a lockfile with the + configured registry. + + The default behavior is to replace package dist URLs from the default + registry (https://registry.npmjs.org) to the configured registry. If set to + "never", then use the registry value. If set to "always", then replace the + registry host with the configured host every time. + + You may also specify a bare hostname (e.g., "registry.npmjs.org"). + `, + flatten, + }), + save: new Definition('save', { + default: true, + defaultDescription: `\`true\` unless when using \`npm update\` where it + defaults to \`false\``, + usage: '-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle', + type: Boolean, + short: 'S', + description: ` + Save installed packages to a \`package.json\` file as dependencies. + + When used with the \`npm rm\` command, removes the dependency from + \`package.json\`. + + Will also prevent writing to \`package-lock.json\` if set to \`false\`. + `, + flatten, + }), + 'save-bundle': new Definition('save-bundle', { + default: false, + type: Boolean, + short: 'B', + description: ` + If a package would be saved at install time by the use of \`--save\`, + \`--save-dev\`, or \`--save-optional\`, then also put it in the + \`bundleDependencies\` list. + + Ignored if \`--save-peer\` is set, since peerDependencies cannot be bundled. + `, + flatten (key, obj, flatOptions) { + // XXX update arborist to just ignore it if resulting saveType is peer + // otherwise this won't have the expected effect: + // + // npm config set save-peer true + // npm i foo --save-bundle --save-prod <-- should bundle + flatOptions.saveBundle = obj['save-bundle'] && !obj['save-peer'] + }, + }), + 'save-dev': new Definition('save-dev', { + default: false, + type: Boolean, + short: 'D', + exclusive: ['save-optional', 'save-peer', 'save-prod'], + description: ` + Save installed packages to a package.json file as \`devDependencies\`. + `, + flatten (key, obj, flatOptions) { + if (!obj[key]) { + if (flatOptions.saveType === 'dev') { + delete flatOptions.saveType + } + return + } + + flatOptions.saveType = 'dev' + }, + }), + 'save-exact': new Definition('save-exact', { + default: false, + type: Boolean, + short: 'E', + description: ` + Dependencies saved to package.json will be configured with an exact + version rather than using npm's default semver range operator. + `, + flatten (key, obj, flatOptions) { + // just call the save-prefix flattener, it reads from obj['save-exact'] + definitions['save-prefix'].flatten('save-prefix', obj, flatOptions) + }, + }), + 'save-optional': new Definition('save-optional', { + default: false, + type: Boolean, + short: 'O', + exclusive: ['save-dev', 'save-peer', 'save-prod'], + description: ` + Save installed packages to a package.json file as + \`optionalDependencies\`. + `, + flatten (key, obj, flatOptions) { + if (!obj[key]) { + if (flatOptions.saveType === 'optional') { + delete flatOptions.saveType + } else if (flatOptions.saveType === 'peerOptional') { + flatOptions.saveType = 'peer' + } + return + } + + if (flatOptions.saveType === 'peerOptional') { + return + } + + if (flatOptions.saveType === 'peer') { + flatOptions.saveType = 'peerOptional' + } else { + flatOptions.saveType = 'optional' + } + }, + }), + 'save-peer': new Definition('save-peer', { + default: false, + type: Boolean, + exclusive: ['save-dev', 'save-optional', 'save-prod'], + description: ` + Save installed packages to a package.json file as \`peerDependencies\` + `, + flatten (key, obj, flatOptions) { + if (!obj[key]) { + if (flatOptions.saveType === 'peer') { + delete flatOptions.saveType + } else if (flatOptions.saveType === 'peerOptional') { + flatOptions.saveType = 'optional' + } + return + } + + if (flatOptions.saveType === 'peerOptional') { + return + } + + if (flatOptions.saveType === 'optional') { + flatOptions.saveType = 'peerOptional' + } else { + flatOptions.saveType = 'peer' + } + }, + }), + 'save-prefix': new Definition('save-prefix', { + default: '^', + type: String, + description: ` + Configure how versions of packages installed to a package.json file via + \`--save\` or \`--save-dev\` get prefixed. + + For example if a package has version \`1.2.3\`, by default its version is + set to \`^1.2.3\` which allows minor upgrades for that package, but after + \`npm config set save-prefix='~'\` it would be set to \`~1.2.3\` which + only allows patch upgrades. + `, + flatten (key, obj, flatOptions) { + flatOptions.savePrefix = obj['save-exact'] ? '' : obj['save-prefix'] + obj['save-prefix'] = flatOptions.savePrefix + }, + }), + 'save-prod': new Definition('save-prod', { + default: false, + type: Boolean, + short: 'P', + exclusive: ['save-dev', 'save-optional', 'save-peer'], + description: ` + Save installed packages into \`dependencies\` specifically. This is + useful if a package already exists in \`devDependencies\` or + \`optionalDependencies\`, but you want to move it to be a non-optional + production dependency. + + This is the default behavior if \`--save\` is true, and neither + \`--save-dev\` or \`--save-optional\` are true. + `, + flatten (key, obj, flatOptions) { + if (!obj[key]) { + if (flatOptions.saveType === 'prod') { + delete flatOptions.saveType + } + return + } + + flatOptions.saveType = 'prod' + }, + }), + 'sbom-format': new Definition('sbom-format', { + default: null, + type: [ + 'cyclonedx', + 'spdx', + ], + description: ` + SBOM format to use when generating SBOMs. + `, + flatten, + }), + 'sbom-type': new Definition('sbom-type', { + default: 'library', + type: [ + 'library', + 'application', + 'framework', + ], + description: ` + The type of package described by the generated SBOM. For SPDX, this is the + value for the \`primaryPackagePurpose\` field. For CycloneDX, this is the + value for the \`type\` field. + `, + flatten, + }), + scope: new Definition('scope', { + default: '', + defaultDescription: ` + the scope of the current project, if any, or "" + `, + type: String, + hint: '<@scope>', + description: ` + Associate an operation with a scope for a scoped registry. + + Useful when logging in to or out of a private registry: + + \`\`\` + # log in, linking the scope to the custom registry + npm login --scope=@mycorp --registry=https://registry.mycorp.com + + # log out, removing the link and the auth token + npm logout --scope=@mycorp + \`\`\` + + This will cause \`@mycorp\` to be mapped to the registry for future + installation of packages specified according to the pattern + \`@mycorp/package\`. + + This will also cause \`npm init\` to create a scoped package. + + \`\`\` + # accept all defaults, and create a package named "@foo/whatever", + # instead of just named "whatever" + npm init --scope=@foo --yes + \`\`\` + `, + flatten (key, obj, flatOptions) { + const value = obj[key] + const scope = value && !/^@/.test(value) ? `@${value}` : value + flatOptions.scope = scope + // projectScope is kept for compatibility with npm-registry-fetch + flatOptions.projectScope = scope + }, + }), + scopes: new Definition('scopes', { + default: null, + type: [null, String, Array], + description: ` + When creating a Granular Access Token with \`npm token create\`, + this limits the token access to specific scopes. Provide + a scope name (with or without @ prefix). + `, + flatten, + }), + 'packages-all': new Definition('packages-all', { + default: false, + type: Boolean, + description: ` + When creating a Granular Access Token with \`npm token create\`, + grants the token access to all packages instead of limiting to + specific packages. + `, + flatten, + }), + 'packages-and-scopes-permission': new Definition('packages-and-scopes-permission', { + default: null, + type: [null, 'read-only', 'read-write', 'no-access'], + description: ` + When creating a Granular Access Token with \`npm token create\`, + sets the permission level for packages and scopes. Options are + "read-only", "read-write", or "no-access". + `, + flatten, + }), + 'orgs-permission': new Definition('orgs-permission', { + default: null, + type: [null, 'read-only', 'read-write', 'no-access'], + description: ` + When creating a Granular Access Token with \`npm token create\`, + sets the permission level for organizations. Options are + "read-only", "read-write", or "no-access". + `, + flatten, + }), + password: new Definition('password', { + default: null, + type: [null, String], + description: ` + Password for authentication. Can be provided via command line when + creating tokens, though it's generally safer to be prompted for it. + `, + flatten, + }), + 'token-description': new Definition('token-description', { + default: null, + type: [null, String], + description: ` + Description text for the token when using \`npm token create\`. + `, + flatten, + }), + 'script-shell': new Definition('script-shell', { + default: null, + defaultDescription: ` + '/bin/sh' on POSIX systems, 'cmd.exe' on Windows + `, + type: [null, String], + description: ` + The shell to use for scripts run with the \`npm exec\`, + \`npm run\` and \`npm init \` commands. + `, + flatten (key, obj, flatOptions) { + flatOptions.scriptShell = obj[key] || undefined + }, + }), + searchexclude: new Definition('searchexclude', { + default: '', + type: String, + description: ` + Space-separated options that limit the results from search. + `, + flatten (key, obj, flatOptions) { + flatOptions.search = flatOptions.search || { limit: 20 } + flatOptions.search.exclude = obj[key].toLowerCase() + }, + }), + searchlimit: new Definition('searchlimit', { + default: 20, + type: Number, + description: ` + Number of items to limit search results to. Will not apply at all to + legacy searches. + `, + flatten (key, obj, flatOptions) { + flatOptions.search = flatOptions.search || {} + flatOptions.search.limit = obj[key] + }, + }), + searchopts: new Definition('searchopts', { + default: '', + type: String, + description: ` + Space-separated options that are always passed to search. + `, + flatten (key, obj, flatOptions) { + flatOptions.search = flatOptions.search || { limit: 20 } + flatOptions.search.opts = querystring.parse(obj[key]) + }, + }), + searchstaleness: new Definition('searchstaleness', { + default: 15 * 60, + type: Number, + description: ` + The age of the cache, in seconds, before another registry request is made + if using legacy search endpoint. + `, + flatten (key, obj, flatOptions) { + flatOptions.search = flatOptions.search || { limit: 20 } + flatOptions.search.staleness = obj[key] + }, + }), + shell: new Definition('shell', { + default: shell, + defaultDescription: ` + SHELL environment variable, or "bash" on Posix, or "cmd.exe" on Windows + `, + type: String, + description: ` + The shell to run for the \`npm explore\` command. + `, + flatten, + }), + shrinkwrap: new Definition('shrinkwrap', { + default: true, + type: Boolean, + deprecated: ` + Use the --package-lock setting instead. + `, + description: ` + Alias for --package-lock + `, + flatten (key, obj, flatOptions) { + obj['package-lock'] = obj.shrinkwrap + definitions['package-lock'].flatten('package-lock', obj, flatOptions) + }, + }), + 'sign-git-commit': new Definition('sign-git-commit', { + default: false, + type: Boolean, + description: ` + If set to true, then the \`npm version\` command will commit the new + package version using \`-S\` to add a signature. + + Note that git requires you to have set up GPG keys in your git configs + for this to work properly. + `, + flatten, + }), + 'sign-git-tag': new Definition('sign-git-tag', { + default: false, + type: Boolean, + description: ` + If set to true, then the \`npm version\` command will tag the version + using \`-s\` to add a signature. + + Note that git requires you to have set up GPG keys in your git configs + for this to work properly. + `, + flatten, + }), + 'strict-peer-deps': new Definition('strict-peer-deps', { + default: false, + type: Boolean, + description: ` + If set to \`true\`, and \`--legacy-peer-deps\` is not set, then _any_ + conflicting \`peerDependencies\` will be treated as an install failure, + even if npm could reasonably guess the appropriate resolution based on + non-peer dependency relationships. + + By default, conflicting \`peerDependencies\` deep in the dependency graph + will be resolved using the nearest non-peer dependency specification, + even if doing so will result in some packages receiving a peer dependency + outside the range set in their package's \`peerDependencies\` object. + + When such an override is performed, a warning is printed, explaining the + conflict and the packages involved. If \`--strict-peer-deps\` is set, + then this warning is treated as a failure. + `, + flatten, + }), + 'strict-ssl': new Definition('strict-ssl', { + default: true, + type: Boolean, + description: ` + Whether or not to do SSL key validation when making requests to the + registry via https. + + See also the \`ca\` config. + `, + flatten (key, obj, flatOptions) { + flatOptions.strictSSL = obj[key] + }, + }), + tag: new Definition('tag', { + default: 'latest', + type: String, + description: ` + If you ask npm to install a package and don't tell it a specific version, + then it will install the specified tag. + + It is the tag added to the package@version specified in the + \`npm dist-tag add\` command, if no explicit tag is given. + + When used by the \`npm diff\` command, this is the tag used to fetch the + tarball that will be compared with the local files by default. + + If used in the \`npm publish\` command, this is the tag that will be + added to the package submitted to the registry. + `, + flatten (key, obj, flatOptions) { + flatOptions.defaultTag = obj[key] + }, + }), + 'tag-version-prefix': new Definition('tag-version-prefix', { + default: 'v', + type: String, + description: ` + If set, alters the prefix used when tagging a new version when performing + a version increment using \`npm version\`. To remove the prefix + altogether, set it to the empty string: \`""\`. + + Because other tools may rely on the convention that npm version tags look + like \`v1.0.0\`, _only use this property if it is absolutely necessary_. + In particular, use care when overriding this setting for public packages. + `, + flatten, + }), + timing: new Definition('timing', { + default: false, + type: Boolean, + description: ` + If true, writes timing information to a process specific json file in + the cache or \`logs-dir\`. The file name ends with \`-timing.json\`. + + You can quickly view it with this [json](https://npm.im/json) command + line: \`cat ~/.npm/_logs/*-timing.json | npm exec -- json -g\`. + + Timing information will also be reported in the terminal. To suppress this + while still writing the timing file, use \`--silent\`. + `, + }), + umask: new Definition('umask', { + default: 0, + type: Umask, + description: ` + The "umask" value to use when setting the file creation mode on files and + folders. + + Folders and executables are given a mode which is \`0o777\` masked + against this value. Other files are given a mode which is \`0o666\` + masked against this value. + + Note that the underlying system will _also_ apply its own umask value to + files and folders that are created, and npm does not circumvent this, but + rather adds the \`--umask\` config to it. + + Thus, the effective default umask value on most POSIX systems is 0o22, + meaning that folders and executables are created with a mode of 0o755 and + other files are created with a mode of 0o644. + `, + flatten, + }), + unicode: new Definition('unicode', { + default: unicode, + defaultDescription: ` + false on windows, true on mac/unix systems with a unicode locale, as + defined by the \`LC_ALL\`, \`LC_CTYPE\`, or \`LANG\` environment variables. + `, + type: Boolean, + description: ` + When set to true, npm uses unicode characters in the tree output. When + false, it uses ascii characters instead of unicode glyphs. + `, + flatten, + }), + 'update-notifier': new Definition('update-notifier', { + default: true, + type: Boolean, + description: ` + Set to false to suppress the update notification when using an older + version of npm than the latest. + `, + }), + usage: new Definition('usage', { + default: false, + type: Boolean, + short: ['?', 'H', 'h'], + description: ` + Show short usage output about the command specified. + `, + }), + 'user-agent': new Definition('user-agent', { + default: 'npm/{npm-version} ' + + 'node/{node-version} ' + + '{platform} ' + + '{arch} ' + + 'workspaces/{workspaces} ' + + '{ci}', + type: String, + description: ` + Sets the User-Agent request header. The following fields are replaced + with their actual counterparts: + + * \`{npm-version}\` - The npm version in use + * \`{node-version}\` - The Node.js version in use + * \`{platform}\` - The value of \`process.platform\` + * \`{arch}\` - The value of \`process.arch\` + * \`{workspaces}\` - Set to \`true\` if the \`workspaces\` or \`workspace\` + options are set. + * \`{ci}\` - The value of the \`ci-name\` config, if set, prefixed with + \`ci/\`, or an empty string if \`ci-name\` is empty. + `, + flatten (key, obj, flatOptions) { + const value = obj[key] + const ciName = ciInfo.name?.toLowerCase().split(' ').join('-') || null + let inWorkspaces = false + if (obj.workspaces || obj.workspace && obj.workspace.length) { + inWorkspaces = true + } + flatOptions.userAgent = + value.replace(/\{node-version\}/gi, process.version) + .replace(/\{npm-version\}/gi, obj['npm-version']) + .replace(/\{platform\}/gi, process.platform) + .replace(/\{arch\}/gi, process.arch) + .replace(/\{workspaces\}/gi, inWorkspaces) + .replace(/\{ci\}/gi, ciName ? `ci/${ciName}` : '') + .trim() + + // We can't clobber the original or else subsequent flattening will fail + // (i.e. when we change the underlying config values) + // obj[key] = flatOptions.userAgent + + // user-agent is a unique kind of config item that gets set from a template + // and ends up translated. Because of this, the normal "should we set this + // to process.env also doesn't work + process.env.npm_config_user_agent = flatOptions.userAgent + }, + }), + userconfig: new Definition('userconfig', { + default: '~/.npmrc', + type: path, + description: ` + The location of user-level configuration settings. + + This may be overridden by the \`npm_config_userconfig\` environment + variable or the \`--userconfig\` command line option, but may _not_ + be overridden by settings in the \`globalconfig\` file. + `, + }), + version: new Definition('version', { + default: false, + type: Boolean, + short: 'v', + description: ` + If true, output the npm version and exit successfully. + + Only relevant when specified explicitly on the command line. + `, + }), + versions: new Definition('versions', { + default: false, + type: Boolean, + description: ` + If true, output the npm version as well as node's \`process.versions\` + map and the version in the current working directory's \`package.json\` + file if one exists, and exit successfully. + + Only relevant when specified explicitly on the command line. + `, + }), + viewer: new Definition('viewer', { + default: isWindows ? 'browser' : 'man', + defaultDescription: ` + "man" on Posix, "browser" on Windows + `, + type: String, + description: ` + The program to use to view help content. + + Set to \`"browser"\` to view html help content in the default web browser. + `, + }), + which: new Definition('which', { + default: null, + hint: '', + type: [null, Number], + description: ` + If there are multiple funding sources, which 1-indexed source URL to open. + `, + }), + workspace: new Definition('workspace', { + default: [], + type: [String, Array], + hint: '', + short: 'w', + envExport: false, + description: ` + Enable running a command in the context of the configured workspaces of the + current project while filtering by running only the workspaces defined by + this configuration option. + + Valid values for the \`workspace\` config are either: + + * Workspace names + * Path to a workspace directory + * Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + + When set for the \`npm init\` command, this may be set to the folder of + a workspace which does not yet exist, to create the folder and set it + up as a brand new workspace within the project. + `, + flatten: (key, obj, flatOptions) => { + definitions['user-agent'].flatten('user-agent', obj, flatOptions) + }, + }), + workspaces: new Definition('workspaces', { + default: null, + type: [null, Boolean], + envExport: false, + description: ` + Set to true to run the command in the context of **all** configured + workspaces. + + Explicitly setting this to false will cause commands like \`install\` to + ignore workspaces altogether. + When not set explicitly: + + - Commands that operate on the \`node_modules\` tree (install, update, + etc.) will link workspaces into the \`node_modules\` folder. + - Commands that do other things (test, exec, publish, etc.) will operate + on the root project, _unless_ one or more workspaces are specified in + the \`workspace\` config. + `, + flatten: (key, obj, flatOptions) => { + definitions['user-agent'].flatten('user-agent', obj, flatOptions) + + // TODO: this is a derived value, and should be reworked when we have a + // pattern for derived value + + // workspacesEnabled is true whether workspaces is null or true + // commands contextually work with workspaces or not regardless of + // configuration, so we need an option specifically to disable workspaces + flatOptions.workspacesEnabled = obj[key] !== false + }, + }), + 'workspaces-update': new Definition('workspaces-update', { + default: true, + type: Boolean, + description: ` + If set to true, the npm cli will run an update after operations that may + possibly change the workspaces installed to the \`node_modules\` folder. + `, + flatten, + }), + yes: new Definition('yes', { + default: null, + type: [null, Boolean], + short: 'y', + description: ` + Automatically answer "yes" to any prompts that npm might print on + the command line. + `, + }), +} + +module.exports = definitions diff --git a/node24/node_modules/npm/node_modules/@npmcli/config/lib/definitions/index.js b/node24/node_modules/npm/node_modules/@npmcli/config/lib/definitions/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a44fd40eba895f6f50208540b95f88902bb9c8ab --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/config/lib/definitions/index.js @@ -0,0 +1,88 @@ +const definitions = require('./definitions.js') + +// use the defined flattening function, and copy over any scoped +// registries and registry-specific "nerfdart" configs verbatim +// +// TODO: make these getters so that we only have to make dirty +// the thing that changed, and then flatten the fields that +// could have changed when a config.set is called. +// +// TODO: move nerfdart auth stuff into a nested object that +// is only passed along to paths that end up calling npm-registry-fetch. +const flatten = (obj, flat = {}) => { + for (const [key, val] of Object.entries(obj)) { + const def = definitions[key] + if (def && def.flatten) { + def.flatten(key, obj, flat) + } else if (/@.*:registry$/i.test(key) || /^\/\//.test(key)) { + flat[key] = val + } + } + return flat +} + +const definitionProps = Object.entries(definitions) + .reduce((acc, [key, { short = [], default: d }]) => { + // can be either an array or string + for (const s of [].concat(short)) { + acc.shorthands[s] = [`--${key}`] + } + acc.defaults[key] = d + return acc + }, { shorthands: {}, defaults: {} }) + +// aliases where they get expanded into a completely different thing +// these are NOT supported in the environment or npmrc files, only +// expanded on the CLI. +// TODO: when we switch off of nopt, use an arg parser that supports +// more reasonable aliasing and short opts right in the definitions set. +const shorthands = { + 'enjoy-by': ['--before'], + d: ['--loglevel', 'info'], + dd: ['--loglevel', 'verbose'], + ddd: ['--loglevel', 'silly'], + quiet: ['--loglevel', 'warn'], + q: ['--loglevel', 'warn'], + s: ['--loglevel', 'silent'], + silent: ['--loglevel', 'silent'], + verbose: ['--loglevel', 'verbose'], + desc: ['--description'], + help: ['--usage'], + local: ['--no-global'], + n: ['--no-yes'], + no: ['--no-yes'], + porcelain: ['--parseable'], + readonly: ['--read-only'], + reg: ['--registry'], + iwr: ['--include-workspace-root'], + ws: ['--workspaces'], + ...definitionProps.shorthands, +} + +// These are the configs that we can nerf-dart. Only _auth even has a config definition so we have to explicitly validate them here. +// This is used to validate during "npm config set" and to not warn on loading unknown configs when we see these. +const nerfDarts = [ + '_auth', // Has a config + '_authToken', // Does not have a config + '_password', // Does not have a config + 'certfile', // Does not have a config + 'email', // Does not have a config + 'keyfile', // Does not have a config + 'username', // Does not have a config +] + +const proxyEnv = [ + 'http_proxy', + 'https_proxy', + 'proxy', + 'no_proxy', +] + +module.exports = { + defaults: definitionProps.defaults, + definitions, + flatten, + nerfDarts, + proxyEnv, + shorthands, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/config/lib/env-replace.js b/node24/node_modules/npm/node_modules/@npmcli/config/lib/env-replace.js new file mode 100644 index 0000000000000000000000000000000000000000..7d724c7c70b33890b7bf14e79c84993c61c8001e --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/config/lib/env-replace.js @@ -0,0 +1,16 @@ +// replace any ${ENV} values with the appropriate environ. +// optional "?" modifier can be used like this: ${ENV?} so in case of the variable being not defined, it evaluates into empty string. + +const envExpr = /(? f.replace(envExpr, (orig, esc, name, modifier) => { + const fallback = modifier === '?' ? '' : `$\{${name}}` + const val = env[name] !== undefined ? env[name] : fallback + + // consume the escape chars that are relevant. + if (esc.length % 2) { + return orig.slice((esc.length + 1) / 2) + } + + return (esc.slice(esc.length / 2)) + val +}) diff --git a/node24/node_modules/npm/node_modules/@npmcli/config/lib/errors.js b/node24/node_modules/npm/node_modules/@npmcli/config/lib/errors.js new file mode 100644 index 0000000000000000000000000000000000000000..95de4ecbda7c17a812376c1d9e4204987eed1e44 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/config/lib/errors.js @@ -0,0 +1,23 @@ +'use strict' + +class ErrInvalidAuth extends Error { + constructor (problems) { + let message = 'Invalid auth configuration found: ' + message += problems.map((problem) => { + // istanbul ignore else + if (problem.action === 'delete') { + return `\`${problem.key}\` is not allowed in ${problem.where} config` + } else if (problem.action === 'rename') { + return `\`${problem.from}\` must be renamed to \`${problem.to}\` in ${problem.where} config` + } + }).join(', ') + message += '\nPlease run `npm config fix` to repair your configuration.`' + super(message) + this.code = 'ERR_INVALID_AUTH' + this.problems = problems + } +} + +module.exports = { + ErrInvalidAuth, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/config/lib/index.js b/node24/node_modules/npm/node_modules/@npmcli/config/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3cc82b15bbe1b3a5b8f891dc8b1be4c24cab910f --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/config/lib/index.js @@ -0,0 +1,1034 @@ +// TODO: set the scope config from package.json or explicit cli config +const { walkUp } = require('walk-up-path') +const ini = require('ini') +const nopt = require('nopt') +const { log, time } = require('proc-log') + +const { resolve, dirname, join } = require('node:path') +const { homedir } = require('node:os') +const { + readFile, + writeFile, + chmod, + unlink, + stat, + mkdir, +} = require('node:fs/promises') + +// TODO global-prefix and local-prefix are set by lib/set-envs.js. This may not be the best way to persist those, if we even want to persist them (see set-envs.js) +const internalEnv = [ + 'npm-version', + 'global-prefix', + 'local-prefix', +] + +const fileExists = (...p) => stat(resolve(...p)) + .then((st) => st.isFile()) + .catch(() => false) + +const dirExists = (...p) => stat(resolve(...p)) + .then((st) => st.isDirectory()) + .catch(() => false) + +const hasOwnProperty = (obj, key) => + Object.prototype.hasOwnProperty.call(obj, key) + +const typeDefs = require('./type-defs.js') +const nerfDart = require('./nerf-dart.js') +const envReplace = require('./env-replace.js') +const parseField = require('./parse-field.js') +const setEnvs = require('./set-envs.js') + +// types that can be saved back to +const confFileTypes = new Set([ + 'global', + 'user', + 'project', +]) + +const confTypes = new Set([ + 'default', + 'builtin', + ...confFileTypes, + 'env', + 'cli', +]) + +class Config { + #loaded = false + #flatten + // populated the first time we flatten the object + #flatOptions = null + #warnings = [] + + static get typeDefs () { + return typeDefs + } + + constructor ({ + definitions, + shorthands, + flatten, + nerfDarts = [], + npmPath, + + // options just to override in tests, mostly + env = process.env, + argv = process.argv, + platform = process.platform, + execPath = process.execPath, + cwd = process.cwd(), + excludeNpmCwd = false, + warn = true, + }) { + this.nerfDarts = nerfDarts + this.definitions = definitions + // turn the definitions into nopt's weirdo syntax + const { types, defaults, deprecated } = getTypesFromDefinitions(definitions) + this.deprecated = deprecated + + this.#flatten = flatten + this.types = types + this.shorthands = shorthands + this.defaults = defaults + + this.npmPath = npmPath + this.npmBin = join(this.npmPath, 'bin/npm-cli.js') + this.argv = argv + this.env = env + this.execPath = execPath + this.platform = platform + this.cwd = cwd + this.excludeNpmCwd = excludeNpmCwd + + // set when we load configs + this.globalPrefix = null + this.localPrefix = null + this.localPackage = null + + // defaults to env.HOME, but will always be *something* + this.home = null + + // set up the prototype chain of config objects + const wheres = [...confTypes] + this.data = new Map() + let parent = null + for (const where of wheres) { + this.data.set(where, parent = new ConfigData(parent)) + } + + this.data.set = () => { + throw new Error('cannot change internal config data structure') + } + this.data.delete = () => { + throw new Error('cannot change internal config data structure') + } + + this.sources = new Map([]) + + for (const { data } of this.data.values()) { + this.list.unshift(data) + } + + this.#loaded = false + this.warn = warn + } + + get list () { + const list = [] + for (const { data } of this.data.values()) { + list.unshift(data) + } + return list + } + + get loaded () { + return this.#loaded + } + + get prefix () { + return this.#get('global') ? this.globalPrefix : this.localPrefix + } + + // return the location where key is found. + find (key) { + if (!this.loaded) { + throw new Error('call config.load() before reading values') + } + + // have to look in reverse order + const entries = [...this.data.entries()] + for (let i = entries.length - 1; i > -1; i--) { + const [where, { data }] = entries[i] + if (hasOwnProperty(data, key)) { + return where + } + } + return null + } + + get (key, where) { + if (!this.loaded) { + throw new Error('call config.load() before reading values') + } + return this.#get(key, where) + } + + // we need to get values sometimes, so use this internal one to do so + // while in the process of loading. + #get (key, where = null) { + if (where !== null && !confTypes.has(where)) { + throw new Error('invalid config location param: ' + where) + } + const { data } = this.data.get(where || 'cli') + return where === null || hasOwnProperty(data, key) ? data[key] : undefined + } + + set (key, val, where = 'cli') { + if (!this.loaded) { + throw new Error('call config.load() before setting values') + } + if (!confTypes.has(where)) { + throw new Error('invalid config location param: ' + where) + } + this.#checkDeprecated(key) + const { data, raw } = this.data.get(where) + data[key] = val + if (['global', 'user', 'project'].includes(where)) { + raw[key] = val + } + + // this is now dirty, the next call to this.valid will have to check it + this.data.get(where)[_valid] = null + + // the flat options are invalidated, regenerate next time they're needed + this.#flatOptions = null + } + + get flat () { + if (this.#flatOptions) { + return this.#flatOptions + } + + // create the object for flat options passed to deps + const timeEnd = time.start('config:load:flatten') + this.#flatOptions = {} + // walk from least priority to highest + for (const { data } of this.data.values()) { + this.#flatten(data, this.#flatOptions) + } + this.#flatOptions.nodeBin = this.execPath + this.#flatOptions.npmBin = this.npmBin + timeEnd() + + return this.#flatOptions + } + + delete (key, where = 'cli') { + if (!this.loaded) { + throw new Error('call config.load() before deleting values') + } + if (!confTypes.has(where)) { + throw new Error('invalid config location param: ' + where) + } + const { data, raw } = this.data.get(where) + delete data[key] + if (['global', 'user', 'project'].includes(where)) { + delete raw[key] + } + } + + async load () { + if (this.loaded) { + throw new Error('attempting to load npm config multiple times') + } + + // first load the defaults, which sets the global prefix + this.loadDefaults() + + // next load the builtin config, as this sets new effective defaults + await this.loadBuiltinConfig() + + // cli and env are not async, and can set the prefix, relevant to project + this.loadCLI() + this.loadEnv() + + // next project config, which can affect userconfig location + await this.loadProjectConfig() + + // then user config, which can affect globalconfig location + await this.loadUserConfig() + + // last but not least, global config file + await this.loadGlobalConfig() + + // set this before calling setEnvs, so that we don't have to share + // private attributes, as that module also does a bunch of get operations + this.#loaded = true + + // set proper globalPrefix now that everything is loaded + this.globalPrefix = this.get('prefix') + + this.setEnvs() + } + + loadDefaults () { + this.loadGlobalPrefix() + this.loadHome() + + const defaultsObject = { + ...this.defaults, + prefix: this.globalPrefix, + } + + try { + // This does not have an actual definition because this is not user definable + defaultsObject['npm-version'] = require(join(this.npmPath, 'package.json')).version + } catch { + // in some weird state where the passed in npmPath does not have a package.json + // this will never happen in npm, but is guarded here in case this is consumed + // in other ways + tests + } + + this.#loadObject(defaultsObject, 'default', 'default values') + + const { data } = this.data.get('default') + + // if the prefix is set on cli, env, or userconfig, then we need to + // default the globalconfig file to that location, instead of the default + // global prefix. It's weird that `npm get globalconfig --prefix=/foo` + // returns `/foo/etc/npmrc`, but better to not change it at this point. + // define a custom getter, but turn into a normal prop + // if we set it. otherwise it can't be set on child objects + Object.defineProperty(data, 'globalconfig', { + get: () => resolve(this.#get('prefix'), 'etc/npmrc'), + set (value) { + Object.defineProperty(data, 'globalconfig', { + value, + configurable: true, + writable: true, + enumerable: true, + }) + }, + configurable: true, + enumerable: true, + }) + } + + loadHome () { + this.home = this.env.HOME || homedir() + } + + loadGlobalPrefix () { + if (this.globalPrefix) { + throw new Error('cannot load default global prefix more than once') + } + + if (this.env.PREFIX) { + this.globalPrefix = this.env.PREFIX + } else if (this.platform === 'win32') { + // c:\node\node.exe --> prefix=c:\node\ + this.globalPrefix = dirname(this.execPath) + } else { + // /usr/local/bin/node --> prefix=/usr/local + this.globalPrefix = dirname(dirname(this.execPath)) + + // destdir only is respected on Unix + if (this.env.DESTDIR) { + this.globalPrefix = join(this.env.DESTDIR, this.globalPrefix) + } + } + } + + loadEnv () { + const conf = Object.create(null) + for (const [envKey, envVal] of Object.entries(this.env)) { + if (!/^npm_config_/i.test(envKey) || envVal === '') { + continue + } + let key = envKey.slice('npm_config_'.length) + if (!key.startsWith('//')) { // don't normalize nerf-darted keys + key = key.replace(/(?!^)_/g, '-') // don't replace _ at the start of the key + .toLowerCase() + } + conf[key] = envVal + } + this.#loadObject(conf, 'env', 'environment') + } + + loadCLI () { + for (const s of Object.keys(this.shorthands)) { + if (s.length > 1 && this.argv.includes(`-${s}`)) { + log.warn(`-${s} is not a valid single-hyphen cli flag and will be removed in the future`) + } + } + nopt.invalidHandler = (k, val, type) => + this.invalidHandler(k, val, type, 'command line options', 'cli') + nopt.unknownHandler = (k, next) => this.unknownHandler(k, next) + nopt.abbrevHandler = this.abbrevHandler + const conf = nopt(this.types, this.shorthands, this.argv) + nopt.invalidHandler = null + nopt.unknownHandler = null + this.parsedArgv = conf.argv + delete conf.argv + this.#loadObject(conf, 'cli', 'command line options') + } + + get valid () { + for (const [where, { valid }] of this.data.entries()) { + if (valid === false || valid === null && !this.validate(where)) { + return false + } + } + return true + } + + validate (where) { + if (!where) { + let valid = true + const authProblems = [] + + for (const entryWhere of this.data.keys()) { + // no need to validate our defaults, we know they're fine + // cli was already validated when parsed the first time + if (entryWhere === 'default' || entryWhere === 'builtin' || entryWhere === 'cli') { + continue + } + const ret = this.validate(entryWhere) + valid = valid && ret + + if (['global', 'user', 'project'].includes(entryWhere)) { + // after validating everything else, we look for old auth configs we no longer support + // if these keys are found, we build up a list of them and the appropriate action and + // attach it as context on the thrown error + + // first, keys that should be removed + for (const key of ['_authtoken', '-authtoken']) { + if (this.get(key, entryWhere)) { + authProblems.push({ action: 'delete', key, where: entryWhere }) + } + } + + // NOTE we pull registry without restricting to the current 'where' because we want to + // suggest scoping things to the registry they would be applied to, which is the default + // regardless of where it was defined + const nerfedReg = nerfDart(this.get('registry')) + // keys that should be nerfed but currently are not + for (const key of ['_auth', '_authToken', 'username', '_password']) { + if (this.get(key, entryWhere)) { + // username and _password must both exist in the same file to be recognized correctly + if (key === 'username' && !this.get('_password', entryWhere)) { + authProblems.push({ action: 'delete', key, where: entryWhere }) + } else if (key === '_password' && !this.get('username', entryWhere)) { + authProblems.push({ action: 'delete', key, where: entryWhere }) + } else { + authProblems.push({ + action: 'rename', + from: key, + to: `${nerfedReg}:${key}`, + where: entryWhere, + }) + } + } + } + } + } + + if (authProblems.length) { + const { ErrInvalidAuth } = require('./errors.js') + throw new ErrInvalidAuth(authProblems) + } + + return valid + } else { + const obj = this.data.get(where) + obj[_valid] = true + + nopt.invalidHandler = (k, val, type) => + this.invalidHandler(k, val, type, obj.source, where) + + nopt.clean(obj.data, this.types, typeDefs) + + nopt.invalidHandler = null + return obj[_valid] + } + } + + // fixes problems identified by validate(), accepts the 'problems' property from a thrown + // ErrInvalidAuth to avoid having to check everything again + repair (problems) { + if (!problems) { + try { + this.validate() + } catch (err) { + // coverage skipped here because we don't need to test re-throwing an error + // istanbul ignore next + if (err.code !== 'ERR_INVALID_AUTH') { + throw err + } + + problems = err.problems + } finally { + if (!problems) { + problems = [] + } + } + } + + for (const problem of problems) { + // coverage disabled for else branch because it doesn't do anything and shouldn't + // istanbul ignore else + if (problem.action === 'delete') { + this.delete(problem.key, problem.where) + } else if (problem.action === 'rename') { + const raw = this.data.get(problem.where).raw?.[problem.from] + const calculated = this.get(problem.from, problem.where) + this.set(problem.to, raw || calculated, problem.where) + this.delete(problem.from, problem.where) + } + } + } + + // Returns true if the value is coming directly from the source defined + // in default definitions, if the current value for the key config is + // coming from any other different source, returns false + isDefault (key) { + const [defaultType, ...types] = [...confTypes] + const defaultData = this.data.get(defaultType).data + + return hasOwnProperty(defaultData, key) + && types.every(type => { + const typeData = this.data.get(type).data + return !hasOwnProperty(typeData, key) + }) + } + + invalidHandler (k, val, type, source, where) { + const typeDescription = require('./type-description.js') + log.warn( + 'invalid config', + k + '=' + JSON.stringify(val), + `set in ${source}` + ) + this.data.get(where)[_valid] = false + + if (Array.isArray(type)) { + if (type.includes(typeDefs.url.type)) { + type = typeDefs.url.type + } else { + /* istanbul ignore if - no actual configs matching this, but + * path types SHOULD be handled this way, like URLs, for the + * same reason */ + if (type.includes(typeDefs.path.type)) { + type = typeDefs.path.type + } + } + } + + const typeDesc = typeDescription(type) + const mustBe = typeDesc + .filter(m => m !== undefined && m !== Array) + const msg = 'Must be' + this.#getOneOfKeywords(mustBe, typeDesc) + const desc = mustBe.length === 1 ? mustBe[0] + : [...new Set(mustBe.map(n => typeof n === 'string' ? n : JSON.stringify(n)))].join(', ') + log.warn('invalid config', msg, desc) + } + + abbrevHandler (short, long) { + log.warn(`Expanding --${short} to --${long}. This will stop working in the next major version of npm.`) + } + + unknownHandler (key, next) { + if (next) { + this.queueWarning(`unknown:${next}`, `"${next}" is being parsed as a normal command line argument.`) + } + } + + #getOneOfKeywords (mustBe, typeDesc) { + let keyword + if (mustBe.length === 1 && typeDesc.includes(Array)) { + keyword = ' one or more' + } else if (mustBe.length > 1 && typeDesc.includes(Array)) { + keyword = ' one or more of:' + } else if (mustBe.length > 1) { + keyword = ' one of:' + } else { + keyword = '' + } + return keyword + } + + #loadObject (obj, where, source, er = null) { + // obj is the raw data read from the file + const conf = this.data.get(where) + if (conf.source) { + const m = `double-loading "${where}" configs from ${source}, ` + + `previously loaded from ${conf.source}` + throw new Error(m) + } + + if (this.sources.has(source)) { + const m = `double-loading config "${source}" as "${where}", ` + + `previously loaded as "${this.sources.get(source)}"` + throw new Error(m) + } + + conf.source = source + this.sources.set(source, where) + if (er) { + conf.loadError = er + if (er.code !== 'ENOENT') { + log.verbose('config', `error loading ${where} config`, er) + } + } else { + conf.raw = obj + outer: for (const [key, value] of Object.entries(obj)) { + const k = envReplace(key, this.env) + const v = this.parseField(value, k) + if (where !== 'default') { + this.#checkDeprecated(k) + if (this.definitions[key]?.exclusive) { + for (const exclusive of this.definitions[key].exclusive) { + if (!this.isDefault(exclusive)) { + // when loading from env, skip only if sibling was explicitly set via CLI + if (where === 'env') { + const cliData = this.data.get('cli').data + if (Object.hasOwn(cliData, exclusive)) { + continue outer + } + } + throw new TypeError(`--${key} cannot be provided when using --${exclusive}`) + } + } + } + } + if (where !== 'default' || key === 'npm-version') { + this.checkUnknown(where, key) + } + conf.data[k] = v + } + } + } + + checkUnknown (where, key) { + if (!this.definitions[key]) { + if (internalEnv.includes(key)) { + return + } + const hint = where !== 'cli' + ? ' See `npm help npmrc` for supported config options.' + : '' + if (!key.includes(':')) { + this.queueWarning(key, `Unknown ${where} config "${where === 'cli' ? '--' : ''}${key}". This will stop working in the next major version of npm.${hint}`) + return + } + const baseKey = key.split(':').pop() + if (!this.definitions[baseKey] && !this.nerfDarts.includes(baseKey)) { + this.queueWarning(baseKey, `Unknown ${where} config "${baseKey}" (${key}). This will stop working in the next major version of npm.${hint}`) + } + } + } + + #checkDeprecated (key) { + if (this.deprecated[key]) { + log.warn('config', key, this.deprecated[key]) + } + } + + // Parse a field, coercing it to the best type available. + parseField (f, key, listElement = false) { + return parseField(f, key, this, listElement) + } + + async #loadFile (file, type) { + // only catch the error from readFile, not from the loadObject call + log.silly('config', `load:file:${file}`) + await readFile(file, 'utf8').then( + data => { + const parsedConfig = ini.parse(data) + if (type === 'project' && parsedConfig.prefix) { + // Log error if prefix is mentioned in project .npmrc + /* eslint-disable-next-line max-len */ + log.error('config', `prefix cannot be changed from project config: ${file}.`) + } + return this.#loadObject(parsedConfig, type, file) + }, + er => this.#loadObject(null, type, file, er) + ) + } + + loadBuiltinConfig () { + return this.#loadFile(resolve(this.npmPath, 'npmrc'), 'builtin') + } + + async loadProjectConfig () { + // the localPrefix can be set by the CLI config, but otherwise is + // found by walking up the folder tree. either way, we load it before + // we return to make sure localPrefix is set + await this.loadLocalPrefix() + + // if we have not detected a local package json yet, try now that we + // have a local prefix + if (this.localPackage == null) { + this.localPackage = await fileExists(this.localPrefix, 'package.json') + } + + if (this.#get('global') === true || this.#get('location') === 'global') { + this.data.get('project').source = '(global mode enabled, ignored)' + this.sources.set(this.data.get('project').source, 'project') + return + } + + const projectFile = resolve(this.localPrefix, '.npmrc') + // if we're in the ~ directory, and there happens to be a node_modules + // folder (which is not TOO uncommon, it turns out), then we can end + // up loading the "project" config where the "userconfig" will be, + // which causes some calamities. So, we only load project config if + // it doesn't match what the userconfig will be. + if (projectFile !== this.#get('userconfig')) { + return this.#loadFile(projectFile, 'project') + } else { + this.data.get('project').source = '(same as "user" config, ignored)' + this.sources.set(this.data.get('project').source, 'project') + } + } + + async loadLocalPrefix () { + const cliPrefix = this.#get('prefix', 'cli') + if (cliPrefix) { + this.localPrefix = cliPrefix + return + } + + const cliWorkspaces = this.#get('workspaces', 'cli') + const isGlobal = this.#get('global') || this.#get('location') === 'global' + + for (const p of walkUp(this.cwd)) { + // HACK: this is an option set in tests to stop the local prefix from being set + // on tests that are created inside the npm repo + if (this.excludeNpmCwd && p === this.npmPath) { + break + } + + const hasPackageJson = await fileExists(p, 'package.json') + + if (!this.localPrefix && (hasPackageJson || await dirExists(p, 'node_modules'))) { + this.localPrefix = p + this.localPackage = hasPackageJson + + // if workspaces are disabled, or we're in global mode, return now + if (cliWorkspaces === false || isGlobal) { + return + } + + // otherwise, continue the loop + continue + } + + if (this.localPrefix && hasPackageJson) { + const pkgJson = require('@npmcli/package-json') + // if we already set localPrefix but this dir has a package.json + // then we need to see if `p` is a workspace root by reading its package.json + // however, if reading it fails then we should just move on + const { content: pkg } = await pkgJson.normalize(p).catch(() => ({ content: {} })) + if (!pkg?.workspaces) { + continue + } + + const mapWorkspaces = require('@npmcli/map-workspaces') + const workspaces = await mapWorkspaces({ cwd: p, pkg }) + for (const w of workspaces.values()) { + if (w === this.localPrefix) { + // see if there's a .npmrc file in the workspace, if so log a warning + if (await fileExists(this.localPrefix, '.npmrc')) { + log.warn('config', `ignoring workspace config at ${this.localPrefix}/.npmrc`) + } + + // set the workspace in the default layer, which allows it to be overridden easily + const { data } = this.data.get('default') + data.workspace = [this.localPrefix] + this.localPrefix = p + this.localPackage = hasPackageJson + log.info('config', `found workspace root at ${this.localPrefix}`) + // we found a root, so we return now + return + } + } + } + } + + if (!this.localPrefix) { + this.localPrefix = this.cwd + } + } + + loadUserConfig () { + return this.#loadFile(this.#get('userconfig'), 'user') + } + + loadGlobalConfig () { + return this.#loadFile(this.#get('globalconfig'), 'global') + } + + async save (where) { + if (!this.loaded) { + throw new Error('call config.load() before saving') + } + if (!confFileTypes.has(where)) { + throw new Error('invalid config location param: ' + where) + } + + const conf = this.data.get(where) + conf[_loadError] = null + + if (where === 'user') { + // if email is nerfed, then we want to de-nerf it + const nerfed = nerfDart(this.get('registry')) + const email = this.get(`${nerfed}:email`, 'user') + if (email) { + this.delete(`${nerfed}:email`, 'user') + this.set('email', email, 'user') + } + } + + // We need the actual raw data before we called parseField so that we are + // saving the same content back to the file + const iniData = ini.stringify(conf.raw).trim() + '\n' + if (!iniData.trim()) { + // ignore the unlink error (eg, if file doesn't exist) + await unlink(conf.source).catch(() => {}) + return + } + const dir = dirname(conf.source) + await mkdir(dir, { recursive: true }) + await writeFile(conf.source, iniData, 'utf8') + const mode = where === 'user' ? 0o600 : 0o666 + await chmod(conf.source, mode) + } + + clearCredentialsByURI (uri, level = 'user') { + const nerfed = nerfDart(uri) + const def = nerfDart(this.get('registry')) + if (def === nerfed) { + this.delete(`-authtoken`, level) + this.delete(`_authToken`, level) + this.delete(`_authtoken`, level) + this.delete(`_auth`, level) + this.delete(`_password`, level) + this.delete(`username`, level) + // de-nerf email if it's nerfed to the default registry + const email = this.get(`${nerfed}:email`, level) + if (email) { + this.set('email', email, level) + } + } + this.delete(`${nerfed}:_authToken`, level) + this.delete(`${nerfed}:_auth`, level) + this.delete(`${nerfed}:_password`, level) + this.delete(`${nerfed}:username`, level) + this.delete(`${nerfed}:email`, level) + this.delete(`${nerfed}:certfile`, level) + this.delete(`${nerfed}:keyfile`, level) + } + + setCredentialsByURI (uri, { token, username, password, certfile, keyfile }) { + const nerfed = nerfDart(uri) + + // field that hasn't been used as documented for a LONG time, + // and as of npm 7.10.0, isn't used at all. We just always + // send auth if we have it, only to the URIs under the nerf dart. + this.delete(`${nerfed}:always-auth`, 'user') + + this.delete(`${nerfed}:email`, 'user') + if (certfile && keyfile) { + this.set(`${nerfed}:certfile`, certfile, 'user') + this.set(`${nerfed}:keyfile`, keyfile, 'user') + // cert/key may be used in conjunction with other credentials, thus no `else` + } + if (token) { + this.set(`${nerfed}:_authToken`, token, 'user') + this.delete(`${nerfed}:_password`, 'user') + this.delete(`${nerfed}:username`, 'user') + } else if (username || password) { + if (!username) { + throw new Error('must include username') + } + if (!password) { + throw new Error('must include password') + } + this.delete(`${nerfed}:_authToken`, 'user') + this.set(`${nerfed}:username`, username, 'user') + // note: not encrypted, no idea why we bothered to do this, but oh well + // protects against shoulder-hacks if password is memorable, I guess? + const encoded = Buffer.from(password, 'utf8').toString('base64') + this.set(`${nerfed}:_password`, encoded, 'user') + } else if (!certfile || !keyfile) { + throw new Error('No credentials to set.') + } + } + + // this has to be a bit more complicated to support legacy data of all forms + getCredentialsByURI (uri) { + const nerfed = nerfDart(uri) + const def = nerfDart(this.get('registry')) + const creds = {} + + // email is handled differently, it used to always be nerfed and now it never should be + // if it's set nerfed to the default registry, then we copy it to the unnerfed key + // TODO: evaluate removing 'email' from the credentials object returned here + const email = this.get(`${nerfed}:email`) || this.get('email') + if (email) { + if (nerfed === def) { + this.set('email', email, 'user') + } + creds.email = email + } + + const certfileReg = this.get(`${nerfed}:certfile`) + const keyfileReg = this.get(`${nerfed}:keyfile`) + if (certfileReg && keyfileReg) { + creds.certfile = certfileReg + creds.keyfile = keyfileReg + // cert/key may be used in conjunction with other credentials, thus no `return` + } + + const tokenReg = this.get(`${nerfed}:_authToken`) + if (tokenReg) { + creds.token = tokenReg + return creds + } + + const userReg = this.get(`${nerfed}:username`) + const passReg = this.get(`${nerfed}:_password`) + if (userReg && passReg) { + creds.username = userReg + creds.password = Buffer.from(passReg, 'base64').toString('utf8') + const auth = `${creds.username}:${creds.password}` + creds.auth = Buffer.from(auth, 'utf8').toString('base64') + return creds + } + + const authReg = this.get(`${nerfed}:_auth`) + if (authReg) { + const authDecode = Buffer.from(authReg, 'base64').toString('utf8') + const authSplit = authDecode.split(':') + creds.username = authSplit.shift() + creds.password = authSplit.join(':') + creds.auth = authReg + return creds + } + + // at this point, nothing else is usable so just return what we do have + return creds + } + + // set up the environment object we have with npm_config_* environs + // for all configs that are different from their default values, and + // set EDITOR and HOME. + setEnvs () { + setEnvs(this) + } + + removeWarning (key) { + this.#warnings = this.#warnings.filter(w => w.type !== key) + } + + getUnknownPositionals () { + return this.#warnings + .filter(w => w.type.startsWith('unknown:')) + .map(w => w.type.slice('unknown:'.length)) + } + + removeUnknownPositional (value) { + this.removeWarning(`unknown:${value}`) + } + + queueWarning (type, ...args) { + if (!this.warn) { + this.#warnings.push({ type, args }) + } else { + log.warn(...args) + } + } + + logWarnings () { + for (const warning of this.#warnings) { + log.warn(...warning.args) + } + this.#warnings = [] + } +} + +const _loadError = Symbol('loadError') +const _valid = Symbol('valid') + +class ConfigData { + #data + #source = null + #raw = null + constructor (parent) { + this.#data = Object.create(parent && parent.data) + this.#raw = {} + this[_valid] = true + } + + get data () { + return this.#data + } + + get valid () { + return this[_valid] + } + + set source (s) { + if (this.#source) { + throw new Error('cannot set ConfigData source more than once') + } + this.#source = s + } + + get source () { + return this.#source + } + + set loadError (e) { + if (this[_loadError] || (Object.keys(this.#raw).length)) { + throw new Error('cannot set ConfigData loadError after load') + } + this[_loadError] = e + } + + get loadError () { + return this[_loadError] + } + + set raw (r) { + if (Object.keys(this.#raw).length || this[_loadError]) { + throw new Error('cannot set ConfigData raw after load') + } + this.#raw = r + } + + get raw () { + return this.#raw + } +} + +const getTypesFromDefinitions = (definitions) => { + const types = {} + const defaults = {} + const deprecated = {} + + for (const [key, def] of Object.entries(definitions)) { + defaults[key] = def.default + types[key] = def.type + if (def.deprecated) { + deprecated[key] = def.deprecated.trim().replace(/\n +/, '\n') + } + } + + return { types, defaults, deprecated } +} + +module.exports = Config +module.exports.getTypesFromDefinitions = getTypesFromDefinitions diff --git a/node24/node_modules/npm/node_modules/@npmcli/config/lib/nerf-dart.js b/node24/node_modules/npm/node_modules/@npmcli/config/lib/nerf-dart.js new file mode 100644 index 0000000000000000000000000000000000000000..4c40913523343204000bbbd4f7de33d9d6c490d2 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/config/lib/nerf-dart.js @@ -0,0 +1,18 @@ +const { URL } = require('node:url') + +/** + * Maps a URL to an identifier. + * + * Name courtesy schiffertronix media LLC, a New Jersey corporation + * + * @param {String} uri The URL to be nerfed. + * + * @returns {String} A nerfed URL. + */ +module.exports = (url) => { + const parsed = new URL(url) + const from = `${parsed.protocol}//${parsed.host}${parsed.pathname}` + const rel = new URL('.', from) + const res = `//${rel.host}${rel.pathname}` + return res +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/config/lib/parse-field.js b/node24/node_modules/npm/node_modules/@npmcli/config/lib/parse-field.js new file mode 100644 index 0000000000000000000000000000000000000000..b459efb6265092339335f272bf55142bbcf92eca --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/config/lib/parse-field.js @@ -0,0 +1,86 @@ +// Parse a field, coercing it to the best type available. +const typeDefs = require('./type-defs.js') +const envReplace = require('./env-replace.js') +const { resolve } = require('node:path') + +const { parse: umaskParse } = require('./umask.js') + +const parseField = (f, key, opts, listElement = false) => { + if (typeof f !== 'string' && !Array.isArray(f)) { + return f + } + + const { platform, types, home, env } = opts + + // type can be array or a single thing. coerce to array. + const typeList = new Set([].concat(types[key])) + const isPath = typeList.has(typeDefs.path.type) + const isBool = typeList.has(typeDefs.Boolean.type) + const isString = isPath || typeList.has(typeDefs.String.type) + const isUmask = typeList.has(typeDefs.Umask.type) + const isNumber = typeList.has(typeDefs.Number.type) + const isList = !listElement && typeList.has(Array) + const isDate = typeList.has(typeDefs.Date.type) + + if (Array.isArray(f)) { + return !isList ? f : f.map(field => parseField(field, key, opts, true)) + } + + // now we know it's a string + f = f.trim() + + // list types get put in the environment separated by double-\n + // usually a single \n would suffice, but ca/cert configs can contain + // line breaks and multiple entries. + if (isList) { + return parseField(f.split('\n\n'), key, opts) + } + + // --foo is like --foo=true for boolean types + if (isBool && !isString && f === '') { + return true + } + + // string types can be the string 'true', 'false', etc. + // otherwise, parse these values out + if (!isString && !isPath && !isNumber) { + switch (f) { + case 'true': return true + case 'false': return false + case 'null': return null + case 'undefined': return undefined + } + } + + f = envReplace(f, env) + + if (isDate) { + return new Date(f) + } + + if (isPath) { + const homePattern = platform === 'win32' ? /^~(\/|\\)/ : /^~\// + if (homePattern.test(f) && home) { + f = resolve(home, f.slice(2)) + } else { + f = resolve(f) + } + } + + if (isUmask) { + try { + return umaskParse(f) + } catch (er) { + // let it warn later when we validate + return f + } + } + + if (isNumber && !isNaN(f)) { + f = +f + } + + return f +} + +module.exports = parseField diff --git a/node24/node_modules/npm/node_modules/@npmcli/config/lib/set-envs.js b/node24/node_modules/npm/node_modules/@npmcli/config/lib/set-envs.js new file mode 100644 index 0000000000000000000000000000000000000000..ed2136e8ee62ddcb4ccc444bec80e371237a03a4 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/config/lib/set-envs.js @@ -0,0 +1,113 @@ +// Set environment variables for any non-default configs, +// so that they're already there when we run lifecycle scripts. +// +// See https://github.com/npm/rfcs/pull/90 + +// Return the env key if this is a thing that belongs in the env. +// Ie, if the key isn't a @scope, //nerf.dart, or _private, +// and the value is a string or array. Otherwise return false. +const envKey = (key, val) => { + return !/^[/@_]/.test(key) && + (typeof envVal(val) === 'string') && + `npm_config_${key.replace(/-/g, '_').toLowerCase()}` +} + +const envVal = val => Array.isArray(val) ? val.map(v => envVal(v)).join('\n\n') + : val === null || val === undefined || val === false ? '' + : typeof val === 'object' ? null + : String(val) + +const sameConfigValue = (def, val) => + !Array.isArray(val) || !Array.isArray(def) ? def === val + : sameArrayValue(def, val) + +const sameArrayValue = (def, val) => { + if (def.length !== val.length) { + return false + } + + for (let i = 0; i < def.length; i++) { + /* istanbul ignore next - there are no array configs where the default + * is not an empty array, so this loop is a no-op, but it's the correct + * thing to do if we ever DO add a config like that. */ + if (def[i] !== val[i]) { + return false + } + } + return true +} + +const setEnv = (env, rawKey, rawVal) => { + const val = envVal(rawVal) + const key = envKey(rawKey, val) + if (key && val !== null) { + env[key] = val + } +} + +const setEnvs = (config) => { + // This ensures that all npm config values that are not the defaults are + // shared appropriately with child processes, without false positives. + const { + env, + defaults, + definitions, + list: [cliConf, envConf], + } = config + + env.INIT_CWD = process.cwd() + + // if the key is deprecated, skip it always. + // if the key is the default value, + // if the environ is NOT the default value, + // set the environ + // else skip it, it's fine + // if the key is NOT the default value, + // if the env is setting it, then leave it (already set) + // otherwise, set the env + const cliSet = new Set(Object.keys(cliConf)) + const envSet = new Set(Object.keys(envConf)) + for (const key in cliConf) { + const { deprecated, envExport = true } = definitions[key] || {} + if (deprecated || envExport === false) { + continue + } + + if (sameConfigValue(defaults[key], cliConf[key])) { + // config is the default, if the env thought different, then we + // have to set it BACK to the default in the environment. + if (!sameConfigValue(envConf[key], cliConf[key])) { + setEnv(env, key, cliConf[key]) + } + } else { + // config is not the default. if the env wasn't the one to set + // it that way, then we have to put it in the env + if (!(envSet.has(key) && !cliSet.has(key))) { + setEnv(env, key, cliConf[key]) + } + } + } + + // also set some other common nice envs that we want to rely on + env.HOME = config.home + // TODO this may not be the best away to persist these + env.npm_config_global_prefix = config.globalPrefix + env.npm_config_local_prefix = config.localPrefix + if (cliConf.editor) { + env.EDITOR = cliConf.editor + } + + // note: this doesn't affect the *current* node process, of course, since + // it's already started, but it does affect the options passed to scripts. + if (cliConf['node-options']) { + env.NODE_OPTIONS = cliConf['node-options'] + } + // the node-gyp bin uses this so we always set it + env.npm_config_node_gyp = cliConf['node-gyp'] + // this doesn't have a full definition so we manually export it here + env.npm_config_npm_version = cliConf['npm-version'] || 'unknown' + env.npm_execpath = config.npmBin + env.NODE = env.npm_node_execpath = config.execPath +} + +module.exports = setEnvs diff --git a/node24/node_modules/npm/node_modules/@npmcli/config/lib/type-defs.js b/node24/node_modules/npm/node_modules/@npmcli/config/lib/type-defs.js new file mode 100644 index 0000000000000000000000000000000000000000..ba2d9d9bd1a8407c64d389ca868a64efe9632fb8 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/config/lib/type-defs.js @@ -0,0 +1,61 @@ +const nopt = require('nopt') + +const { validate: validateUmask } = require('./umask.js') + +class Umask {} +class Semver {} +const semverValid = require('semver/functions/valid') +const validateSemver = (data, k, val) => { + const valid = semverValid(val) + if (!valid) { + return false + } + data[k] = valid +} + +const noptValidatePath = nopt.typeDefs.path.validate +const validatePath = (data, k, val) => { + if (typeof val !== 'string') { + return false + } + return noptValidatePath(data, k, val) +} + +// add descriptions so we can validate more usefully +module.exports = { + ...nopt.typeDefs, + semver: { + type: Semver, + validate: validateSemver, + description: 'full valid SemVer string', + }, + Umask: { + type: Umask, + validate: validateUmask, + description: 'octal number in range 0o000..0o777 (0..511)', + }, + url: { + ...nopt.typeDefs.url, + description: 'full url with "http://"', + }, + path: { + ...nopt.typeDefs.path, + validate: validatePath, + description: 'valid filesystem path', + }, + Number: { + ...nopt.typeDefs.Number, + description: 'numeric value', + }, + Boolean: { + ...nopt.typeDefs.Boolean, + description: 'boolean value (true or false)', + }, + Date: { + ...nopt.typeDefs.Date, + description: 'valid Date string', + }, +} + +// TODO: make nopt less of a global beast so this kludge isn't necessary +nopt.typeDefs = module.exports diff --git a/node24/node_modules/npm/node_modules/@npmcli/config/lib/type-description.js b/node24/node_modules/npm/node_modules/@npmcli/config/lib/type-description.js new file mode 100644 index 0000000000000000000000000000000000000000..595a9ef5df2aa27fabef0d39e726cb8b57f9cc39 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/config/lib/type-description.js @@ -0,0 +1,21 @@ +// return the description of the valid values of a field +// returns a string for one thing, or an array of descriptions +const typeDefs = require('./type-defs.js') +const typeDescription = t => { + if (!t || typeof t !== 'function' && typeof t !== 'object') { + return t + } + + if (Array.isArray(t)) { + return t.map(t => typeDescription(t)) + } + + for (const { type, description } of Object.values(typeDefs)) { + if (type === t) { + return description || type + } + } + + return t +} +module.exports = t => [].concat(typeDescription(t)).filter(t => t !== undefined) diff --git a/node24/node_modules/npm/node_modules/@npmcli/config/lib/umask.js b/node24/node_modules/npm/node_modules/@npmcli/config/lib/umask.js new file mode 100644 index 0000000000000000000000000000000000000000..e0bf1bd08528c65bf49dc37d98b8de258f74fbe0 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/config/lib/umask.js @@ -0,0 +1,35 @@ +const parse = val => { + // this is run via nopt and parse field where everything is + // converted to a string first, ignoring coverage for now + // instead of figuring out what is happening under the hood in nopt + // istanbul ignore else + if (typeof val === 'string') { + if (/^0o?[0-7]+$/.test(val)) { + return parseInt(val.replace(/^0o?/, ''), 8) + } else if (/^[1-9][0-9]*$/.test(val)) { + return parseInt(val, 10) + } else { + throw new Error(`invalid umask value: ${val}`) + } + } else { + if (typeof val !== 'number') { + throw new Error(`invalid umask value: ${val}`) + } + val = Math.floor(val) + if (val < 0 || val > 511) { + throw new Error(`invalid umask value: ${val}`) + } + return val + } +} + +const validate = (data, k, val) => { + try { + data[k] = parse(val) + return true + } catch (er) { + return false + } +} + +module.exports = { parse, validate } diff --git a/node24/node_modules/npm/node_modules/@npmcli/fs/lib/common/get-options.js b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/common/get-options.js new file mode 100644 index 0000000000000000000000000000000000000000..731dce037a129b7217b3e114f7d4dd553e83084f --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/common/get-options.js @@ -0,0 +1,20 @@ +// given an input that may or may not be an object, return an object that has +// a copy of every defined property listed in 'copy'. if the input is not an +// object, assign it to the property named by 'wrap' +const getOptions = (input, { copy, wrap }) => { + const result = {} + + if (input && typeof input === 'object') { + for (const prop of copy) { + if (input[prop] !== undefined) { + result[prop] = input[prop] + } + } + } else { + result[wrap] = input + } + + return result +} + +module.exports = getOptions diff --git a/node24/node_modules/npm/node_modules/@npmcli/fs/lib/common/node.js b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/common/node.js new file mode 100644 index 0000000000000000000000000000000000000000..db7e4aa621ee0a703a0fa0712666fd7b16236b03 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/common/node.js @@ -0,0 +1,9 @@ +const semver = require('semver') + +const satisfies = (range) => { + return semver.satisfies(process.version, range, { includePrerelease: true }) +} + +module.exports = { + satisfies, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/fs/lib/cp/LICENSE b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/cp/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..48876d62e51b64cc7b083526c3dffcde678525f2 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/cp/LICENSE @@ -0,0 +1,15 @@ +(The MIT License) + +Copyright (c) 2011-2017 JP Richardson + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files +(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, + merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node24/node_modules/npm/node_modules/@npmcli/fs/lib/cp/errors.js b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/cp/errors.js new file mode 100644 index 0000000000000000000000000000000000000000..499ff21feee1a0284914750a343a1789a025e1b0 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/cp/errors.js @@ -0,0 +1,129 @@ +'use strict' +const { inspect } = require('util') + +// adapted from node's internal/errors +// https://github.com/nodejs/node/blob/c8a04049/lib/internal/errors.js + +// close copy of node's internal SystemError class. +class SystemError { + constructor (code, prefix, context) { + // XXX context.code is undefined in all constructors used in cp/polyfill + // that may be a bug copied from node, maybe the constructor should use + // `code` not `errno`? nodejs/node#41104 + let message = `${prefix}: ${context.syscall} returned ` + + `${context.code} (${context.message})` + + if (context.path !== undefined) { + message += ` ${context.path}` + } + if (context.dest !== undefined) { + message += ` => ${context.dest}` + } + + this.code = code + Object.defineProperties(this, { + name: { + value: 'SystemError', + enumerable: false, + writable: true, + configurable: true, + }, + message: { + value: message, + enumerable: false, + writable: true, + configurable: true, + }, + info: { + value: context, + enumerable: true, + configurable: true, + writable: false, + }, + errno: { + get () { + return context.errno + }, + set (value) { + context.errno = value + }, + enumerable: true, + configurable: true, + }, + syscall: { + get () { + return context.syscall + }, + set (value) { + context.syscall = value + }, + enumerable: true, + configurable: true, + }, + }) + + if (context.path !== undefined) { + Object.defineProperty(this, 'path', { + get () { + return context.path + }, + set (value) { + context.path = value + }, + enumerable: true, + configurable: true, + }) + } + + if (context.dest !== undefined) { + Object.defineProperty(this, 'dest', { + get () { + return context.dest + }, + set (value) { + context.dest = value + }, + enumerable: true, + configurable: true, + }) + } + } + + toString () { + return `${this.name} [${this.code}]: ${this.message}` + } + + [Symbol.for('nodejs.util.inspect.custom')] (_recurseTimes, ctx) { + return inspect(this, { + ...ctx, + getters: true, + customInspect: false, + }) + } +} + +function E (code, message) { + module.exports[code] = class NodeError extends SystemError { + constructor (ctx) { + super(code, message, ctx) + } + } +} + +E('ERR_FS_CP_DIR_TO_NON_DIR', 'Cannot overwrite directory with non-directory') +E('ERR_FS_CP_EEXIST', 'Target already exists') +E('ERR_FS_CP_EINVAL', 'Invalid src or dest') +E('ERR_FS_CP_FIFO_PIPE', 'Cannot copy a FIFO pipe') +E('ERR_FS_CP_NON_DIR_TO_DIR', 'Cannot overwrite non-directory with directory') +E('ERR_FS_CP_SOCKET', 'Cannot copy a socket file') +E('ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY', 'Cannot overwrite symlink in subdirectory of self') +E('ERR_FS_CP_UNKNOWN', 'Cannot copy an unknown file type') +E('ERR_FS_EISDIR', 'Path is a directory') + +module.exports.ERR_INVALID_ARG_TYPE = class ERR_INVALID_ARG_TYPE extends Error { + constructor (name, expected, actual) { + super() + this.code = 'ERR_INVALID_ARG_TYPE' + this.message = `The ${name} argument must be ${expected}. Received ${typeof actual}` + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/fs/lib/cp/index.js b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/cp/index.js new file mode 100644 index 0000000000000000000000000000000000000000..899436eb9b9bad16f1f645cbc14f658f478d895f --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/cp/index.js @@ -0,0 +1,22 @@ +const fs = require('fs/promises') +const getOptions = require('../common/get-options.js') +const node = require('../common/node.js') +const polyfill = require('./polyfill.js') + +// node 16.7.0 added fs.cp +const useNative = node.satisfies('>=16.7.0') + +const cp = async (src, dest, opts) => { + const options = getOptions(opts, { + copy: ['dereference', 'errorOnExist', 'filter', 'force', 'preserveTimestamps', 'recursive'], + }) + + // the polyfill is tested separately from this module, no need to hack + // process.version to try to trigger it just for coverage + // istanbul ignore next + return useNative + ? fs.cp(src, dest, options) + : polyfill(src, dest, options) +} + +module.exports = cp diff --git a/node24/node_modules/npm/node_modules/@npmcli/fs/lib/cp/polyfill.js b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/cp/polyfill.js new file mode 100644 index 0000000000000000000000000000000000000000..af2cace1780d2775093b12ef7f716f10aecdd4ee --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/cp/polyfill.js @@ -0,0 +1,428 @@ +// this file is a modified version of the code in node 17.2.0 +// which is, in turn, a modified version of the fs-extra module on npm +// node core changes: +// - Use of the assert module has been replaced with core's error system. +// - All code related to the glob dependency has been removed. +// - Bring your own custom fs module is not currently supported. +// - Some basic code cleanup. +// changes here: +// - remove all callback related code +// - drop sync support +// - change assertions back to non-internal methods (see options.js) +// - throws ENOTDIR when rmdir gets an ENOENT for a path that exists in Windows +'use strict' + +const { + ERR_FS_CP_DIR_TO_NON_DIR, + ERR_FS_CP_EEXIST, + ERR_FS_CP_EINVAL, + ERR_FS_CP_FIFO_PIPE, + ERR_FS_CP_NON_DIR_TO_DIR, + ERR_FS_CP_SOCKET, + ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY, + ERR_FS_CP_UNKNOWN, + ERR_FS_EISDIR, + ERR_INVALID_ARG_TYPE, +} = require('./errors.js') +const { + constants: { + errno: { + EEXIST, + EISDIR, + EINVAL, + ENOTDIR, + }, + }, +} = require('os') +const { + chmod, + copyFile, + lstat, + mkdir, + readdir, + readlink, + stat, + symlink, + unlink, + utimes, +} = require('fs/promises') +const { + dirname, + isAbsolute, + join, + parse, + resolve, + sep, + toNamespacedPath, +} = require('path') +const { fileURLToPath } = require('url') + +const defaultOptions = { + dereference: false, + errorOnExist: false, + filter: undefined, + force: true, + preserveTimestamps: false, + recursive: false, +} + +async function cp (src, dest, opts) { + if (opts != null && typeof opts !== 'object') { + throw new ERR_INVALID_ARG_TYPE('options', ['Object'], opts) + } + return cpFn( + toNamespacedPath(getValidatedPath(src)), + toNamespacedPath(getValidatedPath(dest)), + { ...defaultOptions, ...opts }) +} + +function getValidatedPath (fileURLOrPath) { + const path = fileURLOrPath != null && fileURLOrPath.href + && fileURLOrPath.origin + ? fileURLToPath(fileURLOrPath) + : fileURLOrPath + return path +} + +async function cpFn (src, dest, opts) { + // Warn about using preserveTimestamps on 32-bit node + // istanbul ignore next + if (opts.preserveTimestamps && process.arch === 'ia32') { + const warning = 'Using the preserveTimestamps option in 32-bit ' + + 'node is not recommended' + process.emitWarning(warning, 'TimestampPrecisionWarning') + } + const stats = await checkPaths(src, dest, opts) + const { srcStat, destStat } = stats + await checkParentPaths(src, srcStat, dest) + if (opts.filter) { + return handleFilter(checkParentDir, destStat, src, dest, opts) + } + return checkParentDir(destStat, src, dest, opts) +} + +async function checkPaths (src, dest, opts) { + const { 0: srcStat, 1: destStat } = await getStats(src, dest, opts) + if (destStat) { + if (areIdentical(srcStat, destStat)) { + throw new ERR_FS_CP_EINVAL({ + message: 'src and dest cannot be the same', + path: dest, + syscall: 'cp', + errno: EINVAL, + }) + } + if (srcStat.isDirectory() && !destStat.isDirectory()) { + throw new ERR_FS_CP_DIR_TO_NON_DIR({ + message: `cannot overwrite directory ${src} ` + + `with non-directory ${dest}`, + path: dest, + syscall: 'cp', + errno: EISDIR, + }) + } + if (!srcStat.isDirectory() && destStat.isDirectory()) { + throw new ERR_FS_CP_NON_DIR_TO_DIR({ + message: `cannot overwrite non-directory ${src} ` + + `with directory ${dest}`, + path: dest, + syscall: 'cp', + errno: ENOTDIR, + }) + } + } + + if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { + throw new ERR_FS_CP_EINVAL({ + message: `cannot copy ${src} to a subdirectory of self ${dest}`, + path: dest, + syscall: 'cp', + errno: EINVAL, + }) + } + return { srcStat, destStat } +} + +function areIdentical (srcStat, destStat) { + return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && + destStat.dev === srcStat.dev +} + +function getStats (src, dest, opts) { + const statFunc = opts.dereference ? + (file) => stat(file, { bigint: true }) : + (file) => lstat(file, { bigint: true }) + return Promise.all([ + statFunc(src), + statFunc(dest).catch((err) => { + // istanbul ignore next: unsure how to cover. + if (err.code === 'ENOENT') { + return null + } + // istanbul ignore next: unsure how to cover. + throw err + }), + ]) +} + +async function checkParentDir (destStat, src, dest, opts) { + const destParent = dirname(dest) + const dirExists = await pathExists(destParent) + if (dirExists) { + return getStatsForCopy(destStat, src, dest, opts) + } + await mkdir(destParent, { recursive: true }) + return getStatsForCopy(destStat, src, dest, opts) +} + +function pathExists (dest) { + return stat(dest).then( + () => true, + // istanbul ignore next: not sure when this would occur + (err) => (err.code === 'ENOENT' ? false : Promise.reject(err))) +} + +// Recursively check if dest parent is a subdirectory of src. +// It works for all file types including symlinks since it +// checks the src and dest inodes. It starts from the deepest +// parent and stops once it reaches the src parent or the root path. +async function checkParentPaths (src, srcStat, dest) { + const srcParent = resolve(dirname(src)) + const destParent = resolve(dirname(dest)) + if (destParent === srcParent || destParent === parse(destParent).root) { + return + } + let destStat + try { + destStat = await stat(destParent, { bigint: true }) + } catch (err) { + // istanbul ignore else: not sure when this would occur + if (err.code === 'ENOENT') { + return + } + // istanbul ignore next: not sure when this would occur + throw err + } + if (areIdentical(srcStat, destStat)) { + throw new ERR_FS_CP_EINVAL({ + message: `cannot copy ${src} to a subdirectory of self ${dest}`, + path: dest, + syscall: 'cp', + errno: EINVAL, + }) + } + return checkParentPaths(src, srcStat, destParent) +} + +const normalizePathToArray = (path) => + resolve(path).split(sep).filter(Boolean) + +// Return true if dest is a subdir of src, otherwise false. +// It only checks the path strings. +function isSrcSubdir (src, dest) { + const srcArr = normalizePathToArray(src) + const destArr = normalizePathToArray(dest) + return srcArr.every((cur, i) => destArr[i] === cur) +} + +async function handleFilter (onInclude, destStat, src, dest, opts, cb) { + const include = await opts.filter(src, dest) + if (include) { + return onInclude(destStat, src, dest, opts, cb) + } +} + +function startCopy (destStat, src, dest, opts) { + if (opts.filter) { + return handleFilter(getStatsForCopy, destStat, src, dest, opts) + } + return getStatsForCopy(destStat, src, dest, opts) +} + +async function getStatsForCopy (destStat, src, dest, opts) { + const statFn = opts.dereference ? stat : lstat + const srcStat = await statFn(src) + // istanbul ignore else: can't portably test FIFO + if (srcStat.isDirectory() && opts.recursive) { + return onDir(srcStat, destStat, src, dest, opts) + } else if (srcStat.isDirectory()) { + throw new ERR_FS_EISDIR({ + message: `${src} is a directory (not copied)`, + path: src, + syscall: 'cp', + errno: EINVAL, + }) + } else if (srcStat.isFile() || + srcStat.isCharacterDevice() || + srcStat.isBlockDevice()) { + return onFile(srcStat, destStat, src, dest, opts) + } else if (srcStat.isSymbolicLink()) { + return onLink(destStat, src, dest) + } else if (srcStat.isSocket()) { + throw new ERR_FS_CP_SOCKET({ + message: `cannot copy a socket file: ${dest}`, + path: dest, + syscall: 'cp', + errno: EINVAL, + }) + } else if (srcStat.isFIFO()) { + throw new ERR_FS_CP_FIFO_PIPE({ + message: `cannot copy a FIFO pipe: ${dest}`, + path: dest, + syscall: 'cp', + errno: EINVAL, + }) + } + // istanbul ignore next: should be unreachable + throw new ERR_FS_CP_UNKNOWN({ + message: `cannot copy an unknown file type: ${dest}`, + path: dest, + syscall: 'cp', + errno: EINVAL, + }) +} + +function onFile (srcStat, destStat, src, dest, opts) { + if (!destStat) { + return _copyFile(srcStat, src, dest, opts) + } + return mayCopyFile(srcStat, src, dest, opts) +} + +async function mayCopyFile (srcStat, src, dest, opts) { + if (opts.force) { + await unlink(dest) + return _copyFile(srcStat, src, dest, opts) + } else if (opts.errorOnExist) { + throw new ERR_FS_CP_EEXIST({ + message: `${dest} already exists`, + path: dest, + syscall: 'cp', + errno: EEXIST, + }) + } +} + +async function _copyFile (srcStat, src, dest, opts) { + await copyFile(src, dest) + if (opts.preserveTimestamps) { + return handleTimestampsAndMode(srcStat.mode, src, dest) + } + return setDestMode(dest, srcStat.mode) +} + +async function handleTimestampsAndMode (srcMode, src, dest) { + // Make sure the file is writable before setting the timestamp + // otherwise open fails with EPERM when invoked with 'r+' + // (through utimes call) + if (fileIsNotWritable(srcMode)) { + await makeFileWritable(dest, srcMode) + return setDestTimestampsAndMode(srcMode, src, dest) + } + return setDestTimestampsAndMode(srcMode, src, dest) +} + +function fileIsNotWritable (srcMode) { + return (srcMode & 0o200) === 0 +} + +function makeFileWritable (dest, srcMode) { + return setDestMode(dest, srcMode | 0o200) +} + +async function setDestTimestampsAndMode (srcMode, src, dest) { + await setDestTimestamps(src, dest) + return setDestMode(dest, srcMode) +} + +function setDestMode (dest, srcMode) { + return chmod(dest, srcMode) +} + +async function setDestTimestamps (src, dest) { + // The initial srcStat.atime cannot be trusted + // because it is modified by the read(2) system call + // (See https://nodejs.org/api/fs.html#fs_stat_time_values) + const updatedSrcStat = await stat(src) + return utimes(dest, updatedSrcStat.atime, updatedSrcStat.mtime) +} + +function onDir (srcStat, destStat, src, dest, opts) { + if (!destStat) { + return mkDirAndCopy(srcStat.mode, src, dest, opts) + } + return copyDir(src, dest, opts) +} + +async function mkDirAndCopy (srcMode, src, dest, opts) { + await mkdir(dest) + await copyDir(src, dest, opts) + return setDestMode(dest, srcMode) +} + +async function copyDir (src, dest, opts) { + const dir = await readdir(src) + for (let i = 0; i < dir.length; i++) { + const item = dir[i] + const srcItem = join(src, item) + const destItem = join(dest, item) + const { destStat } = await checkPaths(srcItem, destItem, opts) + await startCopy(destStat, srcItem, destItem, opts) + } +} + +async function onLink (destStat, src, dest) { + let resolvedSrc = await readlink(src) + if (!isAbsolute(resolvedSrc)) { + resolvedSrc = resolve(dirname(src), resolvedSrc) + } + if (!destStat) { + return symlink(resolvedSrc, dest) + } + let resolvedDest + try { + resolvedDest = await readlink(dest) + } catch (err) { + // Dest exists and is a regular file or directory, + // Windows may throw UNKNOWN error. If dest already exists, + // fs throws error anyway, so no need to guard against it here. + // istanbul ignore next: can only test on windows + if (err.code === 'EINVAL' || err.code === 'UNKNOWN') { + return symlink(resolvedSrc, dest) + } + // istanbul ignore next: should not be possible + throw err + } + if (!isAbsolute(resolvedDest)) { + resolvedDest = resolve(dirname(dest), resolvedDest) + } + if (isSrcSubdir(resolvedSrc, resolvedDest)) { + throw new ERR_FS_CP_EINVAL({ + message: `cannot copy ${resolvedSrc} to a subdirectory of self ` + + `${resolvedDest}`, + path: dest, + syscall: 'cp', + errno: EINVAL, + }) + } + // Do not copy if src is a subdir of dest since unlinking + // dest in this case would result in removing src contents + // and therefore a broken symlink would be created. + const srcStat = await stat(src) + if (srcStat.isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc)) { + throw new ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY({ + message: `cannot overwrite ${resolvedDest} with ${resolvedSrc}`, + path: dest, + syscall: 'cp', + errno: EINVAL, + }) + } + return copyLink(resolvedSrc, dest) +} + +async function copyLink (resolvedSrc, dest) { + await unlink(dest) + return symlink(resolvedSrc, dest) +} + +module.exports = cp diff --git a/node24/node_modules/npm/node_modules/@npmcli/fs/lib/index.js b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..be8704f685c086f319341f6027d9d959131ee171 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/index.js @@ -0,0 +1,13 @@ +'use strict' + +const cp = require('./cp/index.js') +const withTempDir = require('./with-temp-dir.js') +const readdirScoped = require('./readdir-scoped.js') +const moveFile = require('./move-file.js') + +module.exports = { + cp, + withTempDir, + readdirScoped, + moveFile, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/fs/lib/move-file.js b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/move-file.js new file mode 100644 index 0000000000000000000000000000000000000000..b0daf26002507f46da5ba9a15a8cff71c353f0a0 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/move-file.js @@ -0,0 +1,78 @@ +const { dirname, join, resolve, relative, isAbsolute } = require('path') +const fs = require('fs/promises') + +const pathExists = async path => { + try { + await fs.access(path) + return true + } catch (er) { + return er.code !== 'ENOENT' + } +} + +const moveFile = async (source, destination, options = {}, root = true, symlinks = []) => { + if (!source || !destination) { + throw new TypeError('`source` and `destination` file required') + } + + options = { + overwrite: true, + ...options, + } + + if (!options.overwrite && await pathExists(destination)) { + throw new Error(`The destination file exists: ${destination}`) + } + + await fs.mkdir(dirname(destination), { recursive: true }) + + try { + await fs.rename(source, destination) + } catch (error) { + if (error.code === 'EXDEV' || error.code === 'EPERM') { + const sourceStat = await fs.lstat(source) + if (sourceStat.isDirectory()) { + const files = await fs.readdir(source) + await Promise.all(files.map((file) => + moveFile(join(source, file), join(destination, file), options, false, symlinks) + )) + } else if (sourceStat.isSymbolicLink()) { + symlinks.push({ source, destination }) + } else { + await fs.copyFile(source, destination) + } + } else { + throw error + } + } + + if (root) { + await Promise.all(symlinks.map(async ({ source: symSource, destination: symDestination }) => { + let target = await fs.readlink(symSource) + // junction symlinks in windows will be absolute paths, so we need to + // make sure they point to the symlink destination + if (isAbsolute(target)) { + target = resolve(symDestination, relative(symSource, target)) + } + // try to determine what the actual file is so we can create the correct + // type of symlink in windows + let targetStat = 'file' + try { + targetStat = await fs.stat(resolve(dirname(symSource), target)) + if (targetStat.isDirectory()) { + targetStat = 'junction' + } + } catch { + // targetStat remains 'file' + } + await fs.symlink( + target, + symDestination, + targetStat + ) + })) + await fs.rm(source, { recursive: true, force: true }) + } +} + +module.exports = moveFile diff --git a/node24/node_modules/npm/node_modules/@npmcli/fs/lib/readdir-scoped.js b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/readdir-scoped.js new file mode 100644 index 0000000000000000000000000000000000000000..ed50f793dcd49718d4856efd3a7e0a381c68fa8b --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/readdir-scoped.js @@ -0,0 +1,20 @@ +const { readdir } = require('fs/promises') +const { join } = require('path') + +const readdirScoped = async (dir) => { + const results = [] + + for (const item of await readdir(dir)) { + if (item.startsWith('@')) { + for (const scopedItem of await readdir(join(dir, item))) { + results.push(join(item, scopedItem)) + } + } else { + results.push(item) + } + } + + return results +} + +module.exports = readdirScoped diff --git a/node24/node_modules/npm/node_modules/@npmcli/fs/lib/with-temp-dir.js b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/with-temp-dir.js new file mode 100644 index 0000000000000000000000000000000000000000..fdf9c8c49a9dcdcb55762ba1c141cae8c8aae656 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/fs/lib/with-temp-dir.js @@ -0,0 +1,39 @@ +const { join, sep } = require('path') + +const getOptions = require('./common/get-options.js') +const { mkdir, mkdtemp, rm } = require('fs/promises') + +// create a temp directory, ensure its permissions match its parent, then call +// the supplied function passing it the path to the directory. clean up after +// the function finishes, whether it throws or not +const withTempDir = async (root, fn, opts) => { + const options = getOptions(opts, { + copy: ['tmpPrefix'], + }) + // create the directory + await mkdir(root, { recursive: true }) + + const target = await mkdtemp(join(`${root}${sep}`, options.tmpPrefix || '')) + let err + let result + + try { + result = await fn(target) + } catch (_err) { + err = _err + } + + try { + await rm(target, { force: true, recursive: true }) + } catch { + // ignore errors + } + + if (err) { + throw err + } + + return result +} + +module.exports = withTempDir diff --git a/node24/node_modules/npm/node_modules/@npmcli/git/lib/clone.js b/node24/node_modules/npm/node_modules/@npmcli/git/lib/clone.js new file mode 100644 index 0000000000000000000000000000000000000000..73f3b6cfeea92a118f62ca1453a99722a838399f --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/git/lib/clone.js @@ -0,0 +1,172 @@ +// The goal here is to minimize both git workload and +// the number of refs we download over the network. +// +// Every method ends up with the checked out working dir +// at the specified ref, and resolves with the git sha. + +// Only certain whitelisted hosts get shallow cloning. +// Many hosts (including GHE) don't always support it. +// A failed shallow fetch takes a LOT longer than a full +// fetch in most cases, so we skip it entirely. +// Set opts.gitShallow = true/false to force this behavior +// one way or the other. +const shallowHosts = new Set([ + 'github.com', + 'gist.github.com', + 'gitlab.com', + 'bitbucket.com', + 'bitbucket.org', +]) +// we have to use url.parse until we add the same shim that hosted-git-info has +// to handle scp:// urls +const { parse } = require('url') // eslint-disable-line node/no-deprecated-api +const path = require('path') + +const getRevs = require('./revs.js') +const spawn = require('./spawn.js') +const { isWindows } = require('./utils.js') + +const pickManifest = require('npm-pick-manifest') +const fs = require('fs/promises') + +module.exports = (repo, ref = 'HEAD', target = null, opts = {}) => + getRevs(repo, opts).then(revs => clone( + repo, + revs, + ref, + resolveRef(revs, ref, opts), + target || defaultTarget(repo, opts.cwd), + opts + )) + +const maybeShallow = (repo, opts) => { + if (opts.gitShallow === false || opts.gitShallow) { + return opts.gitShallow + } + return shallowHosts.has(parse(repo).host) +} + +const defaultTarget = (repo, /* istanbul ignore next */ cwd = process.cwd()) => + path.resolve(cwd, path.basename(repo.replace(/[/\\]?\.git$/, ''))) + +const clone = (repo, revs, ref, revDoc, target, opts) => { + if (!revDoc) { + return unresolved(repo, ref, target, opts) + } + if (revDoc.sha === revs.refs.HEAD.sha) { + return plain(repo, revDoc, target, opts) + } + if (revDoc.type === 'tag' || revDoc.type === 'branch') { + return branch(repo, revDoc, target, opts) + } + return other(repo, revDoc, target, opts) +} + +const resolveRef = (revs, ref, opts) => { + const { spec = {} } = opts + ref = spec.gitCommittish || ref + /* istanbul ignore next - will fail anyway, can't pull */ + if (!revs) { + return null + } + if (spec.gitRange) { + return pickManifest(revs, spec.gitRange, opts) + } + if (!ref) { + return revs.refs.HEAD + } + if (revs.refs[ref]) { + return revs.refs[ref] + } + if (revs.shas[ref]) { + return revs.refs[revs.shas[ref][0]] + } + return null +} + +// pull request or some other kind of advertised ref +const other = (repo, revDoc, target, opts) => { + const shallow = maybeShallow(repo, opts) + + const fetchOrigin = ['fetch', 'origin', revDoc.rawRef] + .concat(shallow ? ['--depth=1'] : []) + + const git = (args) => spawn(args, { ...opts, cwd: target }) + return fs.mkdir(target, { recursive: true }) + .then(() => git(['init'])) + .then(() => isWindows(opts) + ? git(['config', '--local', '--add', 'core.longpaths', 'true']) + : null) + .then(() => git(['remote', 'add', 'origin', repo])) + .then(() => git(fetchOrigin)) + .then(() => git(['checkout', revDoc.sha])) + .then(() => updateSubmodules(target, opts)) + .then(() => revDoc.sha) +} + +// tag or branches. use -b +const branch = (repo, revDoc, target, opts) => { + const args = [ + 'clone', + '-b', + revDoc.ref, + repo, + target, + '--recurse-submodules', + ] + if (maybeShallow(repo, opts)) { + args.push('--depth=1') + } + if (isWindows(opts)) { + args.push('--config', 'core.longpaths=true') + } + return spawn(args, opts).then(() => revDoc.sha) +} + +// just the head. clone it +const plain = (repo, revDoc, target, opts) => { + const args = [ + 'clone', + repo, + target, + '--recurse-submodules', + ] + if (maybeShallow(repo, opts)) { + args.push('--depth=1') + } + if (isWindows(opts)) { + args.push('--config', 'core.longpaths=true') + } + return spawn(args, opts).then(() => revDoc.sha) +} + +const updateSubmodules = async (target, opts) => { + const hasSubmodules = await fs.stat(`${target}/.gitmodules`) + .then(() => true) + .catch(() => false) + if (!hasSubmodules) { + return null + } + return spawn([ + 'submodule', + 'update', + '-q', + '--init', + '--recursive', + ], { ...opts, cwd: target }) +} + +const unresolved = (repo, ref, target, opts) => { + // can't do this one shallowly, because the ref isn't advertised + // but we can avoid checking out the working dir twice, at least + const lp = isWindows(opts) ? ['--config', 'core.longpaths=true'] : [] + const cloneArgs = ['clone', '--mirror', '-q', repo, target + '/.git'] + const git = (args) => spawn(args, { ...opts, cwd: target }) + return fs.mkdir(target, { recursive: true }) + .then(() => git(cloneArgs.concat(lp))) + .then(() => git(['init'])) + .then(() => git(['checkout', ref])) + .then(() => updateSubmodules(target, opts)) + .then(() => git(['rev-parse', '--revs-only', 'HEAD'])) + .then(({ stdout }) => stdout.trim()) +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/git/lib/errors.js b/node24/node_modules/npm/node_modules/@npmcli/git/lib/errors.js new file mode 100644 index 0000000000000000000000000000000000000000..cd3cd886578ce0842e186d2d506c3bb63cf9eca2 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/git/lib/errors.js @@ -0,0 +1,36 @@ + +const maxRetry = 3 + +class GitError extends Error { + shouldRetry () { + return false + } +} + +class GitConnectionError extends GitError { + constructor () { + super('A git connection error occurred') + } + + shouldRetry (number) { + return number < maxRetry + } +} + +class GitPathspecError extends GitError { + constructor () { + super('The git reference could not be found') + } +} + +class GitUnknownError extends GitError { + constructor () { + super('An unknown git error occurred') + } +} + +module.exports = { + GitConnectionError, + GitPathspecError, + GitUnknownError, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/git/lib/find.js b/node24/node_modules/npm/node_modules/@npmcli/git/lib/find.js new file mode 100644 index 0000000000000000000000000000000000000000..a55708342ac23bc2f196c74beeb09c827db9df30 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/git/lib/find.js @@ -0,0 +1,15 @@ +const is = require('./is.js') +const { dirname } = require('path') + +module.exports = async ({ cwd = process.cwd(), root } = {}) => { + while (true) { + if (await is({ cwd })) { + return cwd + } + const next = dirname(cwd) + if (cwd === root || cwd === next) { + return null + } + cwd = next + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/git/lib/index.js b/node24/node_modules/npm/node_modules/@npmcli/git/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d8e428b5fa4b6df9297cdd8eb440600e9984e6ad --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/git/lib/index.js @@ -0,0 +1,9 @@ +module.exports = { + clone: require('./clone.js'), + revs: require('./revs.js'), + spawn: require('./spawn.js'), + is: require('./is.js'), + find: require('./find.js'), + isClean: require('./is-clean.js'), + errors: require('./errors.js'), +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/git/lib/is-clean.js b/node24/node_modules/npm/node_modules/@npmcli/git/lib/is-clean.js new file mode 100644 index 0000000000000000000000000000000000000000..900dfcc53afcc346bfb4f904715b855945d31fc3 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/git/lib/is-clean.js @@ -0,0 +1,6 @@ +const spawn = require('./spawn.js') + +module.exports = (opts = {}) => + spawn(['status', '--porcelain=v1', '-uno'], opts) + .then(res => !res.stdout.trim().split(/\r?\n+/) + .map(l => l.trim()).filter(l => l).length) diff --git a/node24/node_modules/npm/node_modules/@npmcli/git/lib/is.js b/node24/node_modules/npm/node_modules/@npmcli/git/lib/is.js new file mode 100644 index 0000000000000000000000000000000000000000..447894548671aab83df1ae36f2bb6c190b67b345 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/git/lib/is.js @@ -0,0 +1,4 @@ +// not an airtight indicator, but a good gut-check to even bother trying +const { stat } = require('fs/promises') +module.exports = ({ cwd = process.cwd() } = {}) => + stat(cwd + '/.git').then(() => true, () => false) diff --git a/node24/node_modules/npm/node_modules/@npmcli/git/lib/lines-to-revs.js b/node24/node_modules/npm/node_modules/@npmcli/git/lib/lines-to-revs.js new file mode 100644 index 0000000000000000000000000000000000000000..12ae94759f57be1f9a0958950bfa094d874d782f --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/git/lib/lines-to-revs.js @@ -0,0 +1,147 @@ +// turn an array of lines from `git ls-remote` into a thing +// vaguely resembling a packument, where docs are a resolved ref + +const semver = require('semver') + +module.exports = lines => finish(lines.reduce(linesToRevsReducer, { + versions: {}, + 'dist-tags': {}, + refs: {}, + shas: {}, +})) + +const finish = revs => distTags(shaList(peelTags(revs))) + +// We can check out shallow clones on specific SHAs if we have a ref +const shaList = revs => { + Object.keys(revs.refs).forEach(ref => { + const doc = revs.refs[ref] + if (!revs.shas[doc.sha]) { + revs.shas[doc.sha] = [ref] + } else { + revs.shas[doc.sha].push(ref) + } + }) + return revs +} + +// Replace any tags with their ^{} counterparts, if those exist +const peelTags = revs => { + Object.keys(revs.refs).filter(ref => ref.endsWith('^{}')).forEach(ref => { + const peeled = revs.refs[ref] + const unpeeled = revs.refs[ref.replace(/\^\{\}$/, '')] + if (unpeeled) { + unpeeled.sha = peeled.sha + delete revs.refs[ref] + } + }) + return revs +} + +const distTags = revs => { + // not entirely sure what situations would result in an + // ichabod repo, but best to be careful in Sleepy Hollow anyway + const HEAD = revs.refs.HEAD || /* istanbul ignore next */ {} + const versions = Object.keys(revs.versions) + versions.forEach(v => { + // simulate a dist-tags with latest pointing at the + // 'latest' branch if one exists and is a version, + // or HEAD if not. + const ver = revs.versions[v] + if (revs.refs.latest && ver.sha === revs.refs.latest.sha) { + revs['dist-tags'].latest = v + } else if (ver.sha === HEAD.sha) { + revs['dist-tags'].HEAD = v + if (!revs.refs.latest) { + revs['dist-tags'].latest = v + } + } + }) + return revs +} + +const refType = ref => { + if (ref.startsWith('refs/tags/')) { + return 'tag' + } + if (ref.startsWith('refs/heads/')) { + return 'branch' + } + if (ref.startsWith('refs/pull/')) { + return 'pull' + } + if (ref === 'HEAD') { + return 'head' + } + // Could be anything, ignore for now + /* istanbul ignore next */ + return 'other' +} + +// return the doc, or null if we should ignore it. +const lineToRevDoc = line => { + const split = line.trim().split(/\s+/, 2) + if (split.length < 2) { + return null + } + + const sha = split[0].trim() + const rawRef = split[1].trim() + const type = refType(rawRef) + + if (type === 'tag') { + // refs/tags/foo^{} is the 'peeled tag', ie the commit + // that is tagged by refs/tags/foo they resolve to the same + // content, just different objects in git's data structure. + // But, we care about the thing the tag POINTS to, not the tag + // object itself, so we only look at the peeled tag refs, and + // ignore the pointer. + // For now, though, we have to save both, because some tags + // don't have peels, if they were not annotated. + const ref = rawRef.slice('refs/tags/'.length) + return { sha, ref, rawRef, type } + } + + if (type === 'branch') { + const ref = rawRef.slice('refs/heads/'.length) + return { sha, ref, rawRef, type } + } + + if (type === 'pull') { + // NB: merged pull requests installable with #pull/123/merge + // for the merged pr, or #pull/123 for the PR head + const ref = rawRef.slice('refs/'.length).replace(/\/head$/, '') + return { sha, ref, rawRef, type } + } + + if (type === 'head') { + const ref = 'HEAD' + return { sha, ref, rawRef, type } + } + + // at this point, all we can do is leave the ref un-munged + return { sha, ref: rawRef, rawRef, type } +} + +const linesToRevsReducer = (revs, line) => { + const doc = lineToRevDoc(line) + + if (!doc) { + return revs + } + + revs.refs[doc.ref] = doc + revs.refs[doc.rawRef] = doc + + if (doc.type === 'tag') { + // try to pull a semver value out of tags like `release-v1.2.3` + // which is a pretty common pattern. + const match = !doc.ref.endsWith('^{}') && + doc.ref.match(/v?(\d+\.\d+\.\d+(?:[-+].+)?)$/) + if (match && semver.valid(match[1], true)) { + revs.versions[semver.clean(match[1], true)] = doc + } + } + + return revs +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/git/lib/make-error.js b/node24/node_modules/npm/node_modules/@npmcli/git/lib/make-error.js new file mode 100644 index 0000000000000000000000000000000000000000..72318d697d8f3719a9bf6dc49f92edf9d67e6b40 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/git/lib/make-error.js @@ -0,0 +1,33 @@ +const { + GitConnectionError, + GitPathspecError, + GitUnknownError, +} = require('./errors.js') + +const connectionErrorRe = new RegExp([ + 'remote error: Internal Server Error', + 'The remote end hung up unexpectedly', + 'Connection timed out', + 'Operation timed out', + 'Failed to connect to .* Timed out', + 'Connection reset by peer', + 'SSL_ERROR_SYSCALL', + 'The requested URL returned error: 503', +].join('|')) + +const missingPathspecRe = /pathspec .* did not match any file\(s\) known to git/ + +function makeError (er) { + const message = er.stderr + let gitEr + if (connectionErrorRe.test(message)) { + gitEr = new GitConnectionError(message) + } else if (missingPathspecRe.test(message)) { + gitEr = new GitPathspecError(message) + } else { + gitEr = new GitUnknownError(message) + } + return Object.assign(gitEr, er) +} + +module.exports = makeError diff --git a/node24/node_modules/npm/node_modules/@npmcli/git/lib/opts.js b/node24/node_modules/npm/node_modules/@npmcli/git/lib/opts.js new file mode 100644 index 0000000000000000000000000000000000000000..6fd9e57771ac7654148e310d207d79b9bf245ca3 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/git/lib/opts.js @@ -0,0 +1,57 @@ +const fs = require('node:fs') +const os = require('node:os') +const path = require('node:path') +const ini = require('ini') + +const gitConfigPath = path.join(os.homedir(), '.gitconfig') + +let cachedConfig = null + +// Function to load and cache the git config +const loadGitConfig = () => { + if (cachedConfig === null) { + try { + cachedConfig = {} + if (fs.existsSync(gitConfigPath)) { + const configContent = fs.readFileSync(gitConfigPath, 'utf-8') + cachedConfig = ini.parse(configContent) + } + } catch (error) { + cachedConfig = {} + } + } + return cachedConfig +} + +const checkGitConfigs = () => { + const config = loadGitConfig() + return { + sshCommandSetInConfig: config?.core?.sshCommand !== undefined, + askPassSetInConfig: config?.core?.askpass !== undefined, + } +} + +const sshCommandSetInEnv = process.env.GIT_SSH_COMMAND !== undefined +const askPassSetInEnv = process.env.GIT_ASKPASS !== undefined +const { sshCommandSetInConfig, askPassSetInConfig } = checkGitConfigs() + +// Values we want to set if they're not already defined by the end user +// This defaults to accepting new ssh host key fingerprints +const finalGitEnv = { + ...(askPassSetInEnv || askPassSetInConfig ? {} : { + GIT_ASKPASS: 'echo', + }), + ...(sshCommandSetInEnv || sshCommandSetInConfig ? {} : { + GIT_SSH_COMMAND: 'ssh -oStrictHostKeyChecking=accept-new', + }), +} + +module.exports = (opts = {}) => ({ + stdioString: true, + ...opts, + shell: false, + env: opts.env || { ...finalGitEnv, ...process.env }, +}) + +// Export the loadGitConfig function for testing +module.exports.loadGitConfig = loadGitConfig diff --git a/node24/node_modules/npm/node_modules/@npmcli/git/lib/revs.js b/node24/node_modules/npm/node_modules/@npmcli/git/lib/revs.js new file mode 100644 index 0000000000000000000000000000000000000000..7e9bcac7144ace1adaa97d4e234052c6ed9cf83c --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/git/lib/revs.js @@ -0,0 +1,22 @@ +const spawn = require('./spawn.js') +const { LRUCache } = require('lru-cache') +const linesToRevs = require('./lines-to-revs.js') + +const revsCache = new LRUCache({ + max: 100, + ttl: 5 * 60 * 1000, +}) + +module.exports = async (repo, opts = {}) => { + if (!opts.noGitRevCache) { + const cached = revsCache.get(repo) + if (cached) { + return cached + } + } + + const { stdout } = await spawn(['ls-remote', repo], opts) + const revs = linesToRevs(stdout.trim().split('\n')) + revsCache.set(repo, revs) + return revs +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/git/lib/spawn.js b/node24/node_modules/npm/node_modules/@npmcli/git/lib/spawn.js new file mode 100644 index 0000000000000000000000000000000000000000..eecba63254a0bf335cc31b377aad2bc8f66a7dd6 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/git/lib/spawn.js @@ -0,0 +1,44 @@ +const spawn = require('@npmcli/promise-spawn') +const { promiseRetry } = require('@gar/promise-retry') +const { log } = require('proc-log') +const makeError = require('./make-error.js') +const makeOpts = require('./opts.js') + +module.exports = (gitArgs, opts = {}) => { + const whichGit = require('./which.js') + const gitPath = whichGit(opts) + + if (gitPath instanceof Error) { + return Promise.reject(gitPath) + } + + // undocumented option, mostly only here for tests + const args = opts.allowReplace || gitArgs[0] === '--no-replace-objects' + ? gitArgs + : ['--no-replace-objects', ...gitArgs] + + let retryOpts = opts.retry + if (retryOpts === null || retryOpts === undefined) { + retryOpts = { + retries: opts.fetchRetries || 2, + factor: opts.fetchRetryFactor || 10, + maxTimeout: opts.fetchRetryMaxtimeout || 60000, + minTimeout: opts.fetchRetryMintimeout || 1000, + } + } + return promiseRetry((retryFn, number) => { + if (number !== 1) { + log.silly('git', `Retrying git command: ${ + args.join(' ')} attempt # ${number}`) + } + + return spawn(gitPath, args, makeOpts(opts)) + .catch(er => { + const gitError = makeError(er) + if (!gitError.shouldRetry(number)) { + throw gitError + } + retryFn(gitError) + }) + }, retryOpts) +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/git/lib/utils.js b/node24/node_modules/npm/node_modules/@npmcli/git/lib/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..c6875e652f6135009376230d8dadd150962ec4a0 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/git/lib/utils.js @@ -0,0 +1,3 @@ +const isWindows = opts => (opts.fakePlatform || process.platform) === 'win32' + +exports.isWindows = isWindows diff --git a/node24/node_modules/npm/node_modules/@npmcli/git/lib/which.js b/node24/node_modules/npm/node_modules/@npmcli/git/lib/which.js new file mode 100644 index 0000000000000000000000000000000000000000..7c54148bed53432d8f62da7e12d09fd6e91d2844 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/git/lib/which.js @@ -0,0 +1,18 @@ +const which = require('which') + +let gitPath +try { + gitPath = which.sync('git') +} catch { + // ignore errors +} + +module.exports = (opts = {}) => { + if (opts.git) { + return opts.git + } + if (!gitPath || opts.git === false) { + return Object.assign(new Error('No git binary found in $PATH'), { code: 'ENOGIT' }) + } + return gitPath +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/installed-package-contents/bin/index.js b/node24/node_modules/npm/node_modules/@npmcli/installed-package-contents/bin/index.js new file mode 100644 index 0000000000000000000000000000000000000000..97136b380e25ee875bd25462a5678a0114d08671 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/installed-package-contents/bin/index.js @@ -0,0 +1,44 @@ +#! /usr/bin/env node + +const { relative } = require('path') +const pkgContents = require('../') + +const usage = `Usage: + installed-package-contents [-d --depth=] + +Lists the files installed for a package specified by . + +Options: + -d --depth= Provide a numeric value ("Infinity" is allowed) + to specify how deep in the file tree to traverse. + Default=1 + -h --help Show this usage information` + +const options = {} + +process.argv.slice(2).forEach(arg => { + let match + if ((match = arg.match(/^(?:--depth=|-d)([0-9]+|Infinity)/))) { + options.depth = +match[1] + } else if (arg === '-h' || arg === '--help') { + console.log(usage) + process.exit(0) + } else { + options.path = arg + } +}) + +if (!options.path) { + console.error('ERROR: no path provided') + console.error(usage) + process.exit(1) +} + +const cwd = process.cwd() + +pkgContents(options) + .then(list => list.sort().forEach(p => console.log(relative(cwd, p)))) + .catch(/* istanbul ignore next - pretty unusual */ er => { + console.error(er) + process.exit(1) + }) diff --git a/node24/node_modules/npm/node_modules/@npmcli/installed-package-contents/lib/index.js b/node24/node_modules/npm/node_modules/@npmcli/installed-package-contents/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..134523585cce0055b422dbcac249c753f79fd3fb --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/installed-package-contents/lib/index.js @@ -0,0 +1,181 @@ +// to GET CONTENTS for folder at PATH (which may be a PACKAGE): +// - if PACKAGE, read path/package.json +// - if bins in ../node_modules/.bin, add those to result +// - if depth >= maxDepth, add PATH to result, and finish +// - readdir(PATH, with file types) +// - add all FILEs in PATH to result +// - if PARENT: +// - if depth < maxDepth, add GET CONTENTS of all DIRs in PATH +// - else, add all DIRs in PATH +// - if no parent +// - if no bundled deps, +// - if depth < maxDepth, add GET CONTENTS of DIRs in path except +// node_modules +// - else, add all DIRs in path other than node_modules +// - if has bundled deps, +// - get list of bundled deps +// - add GET CONTENTS of bundled deps, PACKAGE=true, depth + 1 + +const bundled = require('npm-bundled') +const { readFile, readdir, stat } = require('fs/promises') +const { resolve, basename, dirname } = require('path') +const normalizePackageBin = require('npm-normalize-package-bin') + +const readPackage = ({ path, packageJsonCache }) => packageJsonCache.has(path) + ? Promise.resolve(packageJsonCache.get(path)) + : readFile(path).then(json => { + const pkg = normalizePackageBin(JSON.parse(json)) + packageJsonCache.set(path, pkg) + return pkg + }).catch(() => null) + +// just normalize bundle deps and bin, that's all we care about here. +const normalized = Symbol('package data has been normalized') +const rpj = ({ path, packageJsonCache }) => readPackage({ path, packageJsonCache }) + .then(pkg => { + if (!pkg || pkg[normalized]) { + return pkg + } + if (pkg.bundledDependencies && !pkg.bundleDependencies) { + pkg.bundleDependencies = pkg.bundledDependencies + delete pkg.bundledDependencies + } + const bd = pkg.bundleDependencies + if (bd === true) { + pkg.bundleDependencies = [ + ...Object.keys(pkg.dependencies || {}), + ...Object.keys(pkg.optionalDependencies || {}), + ] + } + if (typeof bd === 'object' && !Array.isArray(bd)) { + pkg.bundleDependencies = Object.keys(bd) + } + pkg[normalized] = true + return pkg + }) + +const pkgContents = async ({ + path, + depth = 1, + currentDepth = 0, + pkg = null, + result = null, + packageJsonCache = null, +}) => { + if (!result) { + result = new Set() + } + + if (!packageJsonCache) { + packageJsonCache = new Map() + } + + if (pkg === true) { + return rpj({ path: path + '/package.json', packageJsonCache }) + .then(p => pkgContents({ + path, + depth, + currentDepth, + pkg: p, + result, + packageJsonCache, + })) + } + + if (pkg) { + // add all bins to result if they exist + if (pkg.bin) { + const dir = dirname(path) + const scope = basename(dir) + const nm = /^@.+/.test(scope) ? dirname(dir) : dir + + const binFiles = [] + Object.keys(pkg.bin).forEach(b => { + const base = resolve(nm, '.bin', b) + binFiles.push(base, base + '.cmd', base + '.ps1') + }) + + const bins = await Promise.all( + binFiles.map(b => stat(b).then(() => b).catch(() => null)) + ) + bins.filter(b => b).forEach(b => result.add(b)) + } + } + + if (currentDepth >= depth) { + result.add(path) + return result + } + + // we'll need bundle list later, so get that now in parallel + const [dirEntries, bundleDeps] = await Promise.all([ + readdir(path, { withFileTypes: true }), + currentDepth === 0 && pkg && pkg.bundleDependencies + ? bundled({ path, packageJsonCache }) : null, + ]).catch(() => []) + + // not a thing, probably a missing folder + if (!dirEntries) { + return result + } + + // empty folder, just add the folder itself to the result + if (!dirEntries.length && !bundleDeps && currentDepth !== 0) { + result.add(path) + return result + } + + const recursePromises = [] + + for (const entry of dirEntries) { + const p = resolve(path, entry.name) + if (entry.isDirectory() === false) { + result.add(p) + continue + } + + if (currentDepth !== 0 || entry.name !== 'node_modules') { + if (currentDepth < depth - 1) { + recursePromises.push(pkgContents({ + path: p, + packageJsonCache, + depth, + currentDepth: currentDepth + 1, + result, + })) + } else { + result.add(p) + } + continue + } + } + + if (bundleDeps) { + // bundle deps are all folders + // we always recurse to get pkg bins, but if currentDepth is too high, + // it'll return early before walking their contents. + recursePromises.push(...bundleDeps.map(dep => { + const p = resolve(path, 'node_modules', dep) + return pkgContents({ + path: p, + packageJsonCache, + pkg: true, + depth, + currentDepth: currentDepth + 1, + result, + }) + })) + } + + if (recursePromises.length) { + await Promise.all(recursePromises) + } + + return result +} + +module.exports = ({ path, ...opts }) => pkgContents({ + path: resolve(path), + ...opts, + pkg: true, +}).then(results => [...results]) diff --git a/node24/node_modules/npm/node_modules/@npmcli/map-workspaces/lib/index.js b/node24/node_modules/npm/node_modules/@npmcli/map-workspaces/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9df864fb5ae379bddce4174dd0acaea30a0e2f00 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/map-workspaces/lib/index.js @@ -0,0 +1,226 @@ +const path = require('path') + +const getName = require('@npmcli/name-from-folder') +const { minimatch } = require('minimatch') +const pkgJson = require('@npmcli/package-json') +const { glob } = require('glob') + +function appendNegatedPatterns (allPatterns) { + const patterns = [] + const negatedPatterns = [] + for (let pattern of allPatterns) { + const excl = pattern.match(/^!+/) + if (excl) { + pattern = pattern.slice(excl[0].length) + } + + // strip off any / or ./ from the start of the pattern. /foo => foo + pattern = pattern.replace(/^\.?\/+/, '') + + // an odd number of ! means a negated pattern. !!foo ==> foo + const negate = excl && excl[0].length % 2 === 1 + if (negate) { + negatedPatterns.push(pattern) + } else { + // remove negated patterns that appeared before this pattern to avoid + // ignoring paths that were matched afterwards + // e.g: ['packages/**', '!packages/b/**', 'packages/b/a'] + // in the above list, the last pattern overrides the negated pattern + // right before it. In effect, the above list would become: + // ['packages/**', 'packages/b/a'] + // The order matters here which is why we must do it inside the loop + // as opposed to doing it all together at the end. + for (let i = 0; i < negatedPatterns.length; ++i) { + const negatedPattern = negatedPatterns[i] + if (minimatch(pattern, negatedPattern)) { + negatedPatterns.splice(i, 1) + } + } + patterns.push(pattern) + } + } + + // use the negated patterns to eagerly remove all the patterns that + // can be removed to avoid unnecessary crawling + for (const negated of negatedPatterns) { + for (const pattern of minimatch.match(patterns, negated)) { + patterns.splice(patterns.indexOf(pattern), 1) + } + } + return { patterns, negatedPatterns } +} + +function getPatterns (workspaces) { + const workspacesDeclaration = + Array.isArray(workspaces.packages) + ? workspaces.packages + : workspaces + + if (!Array.isArray(workspacesDeclaration)) { + throw getError({ + message: 'workspaces config expects an Array', + code: 'EWORKSPACESCONFIG', + }) + } + + return appendNegatedPatterns(workspacesDeclaration) +} + +function getPackageName (pkg, pathname) { + return pkg.name || getName(pathname) +} + +// make sure glob pattern only matches folders +function getGlobPattern (pattern) { + pattern = pattern.replace(/\\/g, '/') + return pattern.endsWith('/') + ? pattern + : `${pattern}/` +} + +function getError ({ Type = TypeError, message, code }) { + return Object.assign(new Type(message), { code }) +} + +function reverseResultMap (map) { + return new Map(Array.from(map, item => item.reverse())) +} + +async function mapWorkspaces (opts = {}) { + if (!opts || !opts.pkg) { + throw getError({ + message: 'mapWorkspaces missing pkg info', + code: 'EMAPWORKSPACESPKG', + }) + } + if (!opts.cwd) { + opts.cwd = process.cwd() + } + + const { workspaces = [] } = opts.pkg + const { patterns, negatedPatterns } = getPatterns(workspaces) + const results = new Map() + + if (!patterns.length && !negatedPatterns.length) { + return results + } + + const seen = new Map() + const getGlobOpts = () => ({ + ...opts, + ignore: [ + ...opts.ignore || [], + '**/node_modules/**', + // just ignore the negated patterns to avoid unnecessary crawling + ...negatedPatterns, + ], + }) + + let matches = await glob(patterns.map((p) => getGlobPattern(p)), getGlobOpts()) + // preserves glob@8 behavior + matches = matches.sort((a, b) => a.localeCompare(b, 'en')) + + // we must preserve the order of results according to the given list of + // workspace patterns + const orderedMatches = [] + for (const pattern of patterns) { + orderedMatches.push(...matches.filter((m) => { + return minimatch(m, pattern, { partial: true, windowsPathsNoEscape: true }) + })) + } + + for (const match of orderedMatches) { + let pkg + try { + pkg = await pkgJson.normalize(path.join(opts.cwd, match)) + } catch (err) { + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') { + continue + } else { + throw err + } + } + + const name = getPackageName(pkg.content, pkg.path) + + let seenPackagePathnames = seen.get(name) + if (!seenPackagePathnames) { + seenPackagePathnames = new Set() + seen.set(name, seenPackagePathnames) + } + seenPackagePathnames.add(pkg.path) + } + + const errorMessageArray = ['must not have multiple workspaces with the same name'] + for (const [packageName, seenPackagePathnames] of seen) { + if (seenPackagePathnames.size > 1) { + addDuplicateErrorMessages(errorMessageArray, packageName, seenPackagePathnames) + } else { + results.set(packageName, seenPackagePathnames.values().next().value) + } + } + + if (errorMessageArray.length > 1) { + throw getError({ + Type: Error, + message: errorMessageArray.join('\n'), + code: 'EDUPLICATEWORKSPACE', + }) + } + + return results +} + +function addDuplicateErrorMessages (messageArray, packageName, packagePathnames) { + messageArray.push( + `package '${packageName}' has conflicts in the following paths:` + ) + + for (const packagePathname of packagePathnames) { + messageArray.push( + ' ' + packagePathname + ) + } +} + +mapWorkspaces.virtual = function (opts = {}) { + if (!opts || !opts.lockfile) { + throw getError({ + message: 'mapWorkspaces.virtual missing lockfile info', + code: 'EMAPWORKSPACESLOCKFILE', + }) + } + if (!opts.cwd) { + opts.cwd = process.cwd() + } + + const { packages = {} } = opts.lockfile + const { workspaces = [] } = packages[''] || {} + // uses a pathname-keyed map in order to negate the exact items + const results = new Map() + const { patterns, negatedPatterns } = getPatterns(workspaces) + if (!patterns.length && !negatedPatterns.length) { + return results + } + negatedPatterns.push('**/node_modules/**') + + const packageKeys = Object.keys(packages) + for (const pattern of negatedPatterns) { + for (const packageKey of minimatch.match(packageKeys, pattern)) { + packageKeys.splice(packageKeys.indexOf(packageKey), 1) + } + } + + for (const pattern of patterns) { + for (const packageKey of minimatch.match(packageKeys, pattern)) { + const packagePathname = path.join(opts.cwd, packageKey) + const name = getPackageName(packages[packageKey], packagePathname) + results.set(packagePathname, name) + } + } + + // Invert pathname-keyed to a proper name-to-pathnames Map + return reverseResultMap(results) +} + +module.exports = mapWorkspaces diff --git a/node24/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/advisory.js b/node24/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/advisory.js new file mode 100644 index 0000000000000000000000000000000000000000..9a43d84f85c491fe16aef9909c802513df499364 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/advisory.js @@ -0,0 +1,435 @@ +const hash = require('./hash.js') +const semver = require('semver') +const semverOpt = { includePrerelease: true, loose: true } +const getDepSpec = require('./get-dep-spec.js') + +// any fields that we don't want in the cache need to be hidden +const _source = Symbol('source') +const _packument = Symbol('packument') +const _versionVulnMemo = Symbol('versionVulnMemo') +const _updated = Symbol('updated') +const _options = Symbol('options') +const _specVulnMemo = Symbol('specVulnMemo') +const _testVersion = Symbol('testVersion') +const _testVersions = Symbol('testVersions') +const _calculateRange = Symbol('calculateRange') +const _markVulnerable = Symbol('markVulnerable') +const _testSpec = Symbol('testSpec') + +class Advisory { + constructor (name, source, options = {}) { + this.source = source.id + this[_source] = source + this[_options] = options + this.name = name + if (!source.name) { + source.name = name + } + + this.dependency = source.name + + if (this.type === 'advisory') { + this.title = source.title + this.url = source.url + } else { + this.title = `Depends on vulnerable versions of ${source.name}` + this.url = null + } + + this.severity = source.severity || 'high' + this.versions = [] + this.vulnerableVersions = [] + this.cwe = source.cwe + this.cvss = source.cvss + + // advisories have the range, metavulns do not + // if an advisory doesn't specify range, assume all are vulnerable + this.range = this.type === 'advisory' ? source.vulnerable_versions || '*' + : null + + this.id = hash(this) + + this[_packument] = null + // memoized list of which versions are vulnerable + this[_versionVulnMemo] = new Map() + // memoized list of which dependency specs are vulnerable + this[_specVulnMemo] = new Map() + this[_updated] = false + } + + // true if we updated from what we had in cache + get updated () { + return this[_updated] + } + + get type () { + return this.dependency === this.name ? 'advisory' : 'metavuln' + } + + get packument () { + return this[_packument] + } + + // load up the data from a cache entry and a fetched packument + load (cached, packument) { + // basic data integrity gutcheck + if (!cached || typeof cached !== 'object') { + throw new TypeError('invalid cached data, expected object') + } + + if (!packument || typeof packument !== 'object') { + throw new TypeError('invalid packument data, expected object') + } + + if (cached.id && cached.id !== this.id) { + throw Object.assign(new Error('loading from incorrect cache entry'), { + expected: this.id, + actual: cached.id, + }) + } + if (packument.name !== this.name) { + throw Object.assign(new Error('loading from incorrect packument'), { + expected: this.name, + actual: packument.name, + }) + } + if (this[_packument]) { + throw new Error('advisory object already loaded') + } + + // if we have a range from the initialization, and the cached + // data has a *different* range, then we know we have to recalc. + // just don't use the cached data, so we will definitely not match later + if (!this.range || cached.range && cached.range === this.range) { + Object.assign(this, cached) + } + + this[_packument] = packument + + const pakuVersions = Object.keys(packument.versions || {}) + const allVersions = new Set([...pakuVersions, ...this.versions]) + const versionsAdded = [] + const versionsRemoved = [] + for (const v of allVersions) { + if (!this.versions.includes(v)) { + versionsAdded.push(v) + this.versions.push(v) + } else if (!pakuVersions.includes(v)) { + versionsRemoved.push(v) + } + } + + // strip out any removed versions from our lists, and sort by semver + this.versions = semver.sort(this.versions.filter(v => + !versionsRemoved.includes(v)), semverOpt) + + // if no changes, then just return what we got from cache + // versions added or removed always means we changed + // otherwise, advisories change if the range changes, and + // metavulns change if the source was updated + const unchanged = this.type === 'advisory' + ? this.range && this.range === cached.range + : !this[_source].updated + + // if the underlying source changed, by an advisory updating the + // range, or a source advisory being updated, then we have to re-check + // otherwise, only recheck the new ones. + this.vulnerableVersions = !unchanged ? [] + : semver.sort(this.vulnerableVersions.filter(v => + !versionsRemoved.includes(v)), semverOpt) + + if (unchanged && !versionsAdded.length && !versionsRemoved.length) { + // nothing added or removed, nothing to do here. use the cached copy. + return this + } + + this[_updated] = true + + // test any versions newly added + if (!unchanged || versionsAdded.length) { + this[_testVersions](unchanged ? versionsAdded : this.versions) + } + this.vulnerableVersions = semver.sort(this.vulnerableVersions, semverOpt) + + // metavulns have to calculate their range, since cache is invalidated + // advisories just get their range from the advisory above + if (this.type === 'metavuln') { + this[_calculateRange]() + } + + return this + } + + [_calculateRange] () { + // calling semver.simplifyRange with a massive list of versions, and those + // versions all concatenated with `||` is a geometric CPU explosion! + // we can try to be a *little* smarter up front by doing x-y for all + // contiguous version sets in the list + const ranges = [] + this.versions = semver.sort(this.versions, semverOpt) + this.vulnerableVersions = semver.sort(this.vulnerableVersions, semverOpt) + for (let v = 0, vulnVer = 0; v < this.versions.length; v++) { + // figure out the vulnerable subrange + const vr = [this.versions[v]] + while (v < this.versions.length) { + if (this.versions[v] !== this.vulnerableVersions[vulnVer]) { + // we don't test prerelease versions, so just skip past it + if (/-/.test(this.versions[v])) { + v++ + continue + } + break + } + if (vr.length > 1) { + vr[1] = this.versions[v] + } else { + vr.push(this.versions[v]) + } + v++ + vulnVer++ + } + // it'll either be just the first version, which means no overlap, + // or the start and end versions, which might be the same version + if (vr.length > 1) { + const tail = this.versions[this.versions.length - 1] + ranges.push(vr[1] === tail ? `>=${vr[0]}` + : vr[0] === vr[1] ? vr[0] + : vr.join(' - ')) + } + } + const metavuln = ranges.join(' || ').trim() + this.range = !metavuln ? '<0.0.0-0' + : semver.simplifyRange(this.versions, metavuln, semverOpt) + } + + // returns true if marked as vulnerable, false if ok + // spec is a dependency specifier, for metavuln cases + // where the version might not be in the packument. if + // we have the packument and spec is not provided, then + // we use the dependency version from the manifest. + testVersion (version, spec = null) { + const sv = String(version) + if (this[_versionVulnMemo].has(sv)) { + return this[_versionVulnMemo].get(sv) + } + + const result = this[_testVersion](version, spec) + if (result) { + this[_markVulnerable](version) + } + this[_versionVulnMemo].set(sv, !!result) + return result + } + + [_markVulnerable] (version) { + const sv = String(version) + if (!this.vulnerableVersions.includes(sv)) { + this.vulnerableVersions.push(sv) + } + } + + [_testVersion] (version, spec) { + const sv = String(version) + if (this.vulnerableVersions.includes(sv)) { + return true + } + + if (this.type === 'advisory') { + // advisory, just test range + return semver.satisfies(version, this.range, semverOpt) + } + + // check the dependency of this version on the vulnerable dep + // if we got a version that's not in the packument, fall back on + // the spec provided, if possible. + const mani = this[_packument]?.versions?.[version] || { + dependencies: { + [this.dependency]: spec, + }, + } + + if (!spec) { + spec = getDepSpec(mani, this.dependency) + } + + // no dep, no vuln + if (spec === null) { + return false + } + + if (!semver.validRange(spec, semverOpt)) { + // not a semver range, nothing we can hope to do about it + return true + } + + const bd = mani.bundleDependencies + const bundled = bd && bd.includes(this[_source].name) + // XXX if bundled, then semver.intersects() means vulnerable + // else, pick a manifest and see if it can't be avoided + // try to pick a version of the dep that isn't vulnerable + const avoid = this[_source].range + + if (bundled) { + return semver.intersects(spec, avoid, semverOpt) + } + + return this[_source].testSpec(spec) + } + + testSpec (spec) { + // testing all the versions is a bit costly, and the spec tends to stay + // consistent across multiple versions, so memoize this as well, in case + // we're testing lots of versions. + const memo = this[_specVulnMemo] + if (memo.has(spec)) { + return memo.get(spec) + } + + const res = this[_testSpec](spec) + memo.set(spec, res) + return res + } + + [_testSpec] (spec) { + for (const v of this.versions) { + const satisfies = semver.satisfies(v, spec, semverOpt) + if (!satisfies) { + continue + } + if (!this.testVersion(v)) { + return false + } + } + // either vulnerable, or not installable because nothing satisfied + // either way, best avoided. + return true + } + + [_testVersions] (versions) { + if (!versions.length) { + return + } + + // set of lists of versions + const versionSets = new Set() + versions = semver.sort(versions.map(v => semver.parse(v, semverOpt))) + + // start out with the versions grouped by major and minor + let last = versions[0].major + '.' + versions[0].minor + let list = [] + versionSets.add(list) + for (const v of versions) { + const k = v.major + '.' + v.minor + if (k !== last) { + last = k + list = [] + versionSets.add(list) + } + list.push(v) + } + + for (const set of versionSets) { + // it's common to have version lists like: + // 1.0.0 + // 1.0.1-alpha.0 + // 1.0.1-alpha.1 + // ... + // 1.0.1-alpha.999 + // 1.0.1 + // 1.0.2-alpha.0 + // ... + // 1.0.2-alpha.99 + // 1.0.2 + // with a huge number of prerelease versions that are not installable + // anyway. + // If mid has a prerelease tag, and set[0] does not, then walk it + // back until we hit a non-prerelease version + // If mid has a prerelease tag, and set[set.length-1] does not, + // then walk it forward until we hit a version without a prerelease tag + // Similarly, if the head/tail is a prerelease, but there is a non-pr + // version in the set, then start there instead. + let h = 0 + const origHeadVuln = this.testVersion(set[h]) + while (h < set.length && /-/.test(String(set[h]))) { + h++ + } + + // don't filter out the whole list! they might all be pr's + if (h === set.length) { + h = 0 + } else if (origHeadVuln) { + // if the original was vulnerable, assume so are all of these + for (let hh = 0; hh < h; hh++) { + this[_markVulnerable](set[hh]) + } + } + + let t = set.length - 1 + const origTailVuln = this.testVersion(set[t]) + while (t > h && /-/.test(String(set[t]))) { + t-- + } + + // don't filter out the whole list! might all be pr's + if (t === h) { + t = set.length - 1 + } else if (origTailVuln) { + // if original tail was vulnerable, assume these are as well + for (let tt = set.length - 1; tt > t; tt--) { + this[_markVulnerable](set[tt]) + } + } + + const headVuln = h === 0 ? origHeadVuln + : this.testVersion(set[h]) + + const tailVuln = t === set.length - 1 ? origTailVuln + : this.testVersion(set[t]) + + // if head and tail both vulnerable, whole list is thrown out + if (headVuln && tailVuln) { + for (let v = h; v < t; v++) { + this[_markVulnerable](set[v]) + } + continue + } + + // if length is 2 or 1, then we marked them all already + if (t < h + 2) { + continue + } + + const mid = Math.floor(set.length / 2) + const pre = set.slice(0, mid) + const post = set.slice(mid) + + // if the parent list wasn't prereleases, then drop pr tags + // from end of the pre list, and beginning of the post list, + // marking as vulnerable if the midpoint item we picked is. + if (!/-/.test(String(pre[0]))) { + const midVuln = this.testVersion(pre[pre.length - 1]) + while (/-/.test(String(pre[pre.length - 1]))) { + const v = pre.pop() + if (midVuln) { + this[_markVulnerable](v) + } + } + } + + if (!/-/.test(String(post[post.length - 1]))) { + const midVuln = this.testVersion(post[0]) + while (/-/.test(String(post[0]))) { + const v = post.shift() + if (midVuln) { + this[_markVulnerable](v) + } + } + } + + versionSets.add(pre) + versionSets.add(post) + } + } +} + +module.exports = Advisory diff --git a/node24/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/get-dep-spec.js b/node24/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/get-dep-spec.js new file mode 100644 index 0000000000000000000000000000000000000000..6f3739c9bace83186f5cb54ef4f9ab4b5b4894c5 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/get-dep-spec.js @@ -0,0 +1,15 @@ +module.exports = (mani, name) => { + // skip dev because that only matters at the root, + // where we aren't fetching a manifest from the registry + // with multiple versions anyway. + const { + dependencies: deps = {}, + optionalDependencies: optDeps = {}, + peerDependencies: peerDeps = {}, + } = mani + + return deps && typeof deps[name] === 'string' ? deps[name] + : optDeps && typeof optDeps[name] === 'string' ? optDeps[name] + : peerDeps && typeof peerDeps[name] === 'string' ? peerDeps[name] + : null +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/hash.js b/node24/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/hash.js new file mode 100644 index 0000000000000000000000000000000000000000..b0fc45de1289ba1eec6aece0d630264e9c9a7972 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/hash.js @@ -0,0 +1,5 @@ +const { createHash } = require('crypto') + +module.exports = ({ name, source }) => createHash('sha512') + .update(JSON.stringify([name, source])) + .digest('base64') diff --git a/node24/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/index.js b/node24/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..35420bcc0f49be422e0a031c34c12a6b1d720f63 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/index.js @@ -0,0 +1,128 @@ +// this is the public class that is used by consumers. +// the Advisory class handles all the calculation, and this +// class handles all the IO with the registry and cache. +const pacote = require('pacote') +const cacache = require('cacache') +const { time } = require('proc-log') +const Advisory = require('./advisory.js') +const { homedir } = require('os') +const jsonParse = require('json-parse-even-better-errors') + +const _packument = Symbol('packument') +const _cachePut = Symbol('cachePut') +const _cacheGet = Symbol('cacheGet') +const _cacheData = Symbol('cacheData') +const _packuments = Symbol('packuments') +const _cache = Symbol('cache') +const _options = Symbol('options') +const _advisories = Symbol('advisories') +const _calculate = Symbol('calculate') + +class Calculator { + constructor (options = {}) { + this[_options] = { ...options } + this[_cache] = this[_options].cache || (homedir() + '/.npm/_cacache') + this[_options].cache = this[_cache] + this[_packuments] = new Map() + this[_cacheData] = new Map() + this[_advisories] = new Map() + } + + get cache () { + return this[_cache] + } + + get options () { + return { ...this[_options] } + } + + async calculate (name, source) { + const k = `security-advisory:${name}:${source.id}` + if (this[_advisories].has(k)) { + return this[_advisories].get(k) + } + + const p = this[_calculate](name, source) + this[_advisories].set(k, p) + return p + } + + async [_calculate] (name, source) { + const k = `security-advisory:${name}:${source.id}` + const timeEnd = time.start(`metavuln:calculate:${k}`) + const advisory = new Advisory(name, source, this[_options]) + // load packument and cached advisory + const [cached, packument] = await Promise.all([ + this[_cacheGet](advisory), + this[_packument](name), + ]) + const timeEndLoad = time.start(`metavuln:load:${k}`) + advisory.load(cached, packument) + timeEndLoad() + if (advisory.updated) { + await this[_cachePut](advisory) + } + this[_advisories].set(k, advisory) + timeEnd() + return advisory + } + + async [_cachePut] (advisory) { + const { name, id } = advisory + const key = `security-advisory:${name}:${id}` + const timeEnd = time.start(`metavuln:cache:put:${key}`) + const data = JSON.stringify(advisory) + const options = { ...this[_options] } + this[_cacheData].set(key, jsonParse(data)) + await cacache.put(this[_cache], key, data, options).catch(() => {}) + timeEnd() + } + + async [_cacheGet] (advisory) { + const { name, id } = advisory + const key = `security-advisory:${name}:${id}` + /* istanbul ignore if - should be impossible, since we memoize the + * advisory object itself using the same key, just being cautious */ + if (this[_cacheData].has(key)) { + return this[_cacheData].get(key) + } + + const timeEnd = time.start(`metavuln:cache:get:${key}`) + const p = cacache.get(this[_cache], key, { ...this[_options] }) + .catch(() => ({ data: '{}' })) + .then(({ data }) => { + data = jsonParse(data) + timeEnd() + this[_cacheData].set(key, data) + return data + }) + this[_cacheData].set(key, p) + return p + } + + async [_packument] (name) { + if (this[_packuments].has(name)) { + return this[_packuments].get(name) + } + + const timeEnd = time.start(`metavuln:packument:${name}`) + const p = pacote.packument(name, { ...this[_options] }) + .catch(() => { + // presumably not something from the registry. + // an empty packument will have an effective range of * + return { + name, + versions: {}, + } + }) + .then(paku => { + timeEnd() + this[_packuments].set(name, paku) + return paku + }) + this[_packuments].set(name, p) + return p + } +} + +module.exports = Calculator diff --git a/node24/node_modules/npm/node_modules/@npmcli/name-from-folder/lib/index.js b/node24/node_modules/npm/node_modules/@npmcli/name-from-folder/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..202859aacb6d54ef5eda94ea7d8e2b916cff982a --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/name-from-folder/lib/index.js @@ -0,0 +1,7 @@ +const { basename, dirname } = require('path') + +const getName = (parent, base) => + parent.charAt(0) === '@' ? `${parent}/${base}` : base + +module.exports = dir => dir ? getName(basename(dirname(dir)), basename(dir)) + : false diff --git a/node24/node_modules/npm/node_modules/@npmcli/node-gyp/lib/index.js b/node24/node_modules/npm/node_modules/@npmcli/node-gyp/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ce619bc2e7ba94d42a9a1de622e0670dd639a4bb --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/node-gyp/lib/index.js @@ -0,0 +1,14 @@ +const util = require('util') +const fs = require('fs') +const { stat } = fs.promises || { stat: util.promisify(fs.stat) } + +async function isNodeGypPackage (path) { + return await stat(`${path}/binding.gyp`) + .then(st => st.isFile()) + .catch(() => false) +} + +module.exports = { + isNodeGypPackage, + defaultGypInstallScript: 'node-gyp rebuild', +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/node-gyp/package.json b/node24/node_modules/npm/node_modules/@npmcli/node-gyp/package.json new file mode 100644 index 0000000000000000000000000000000000000000..390683ddb83a9d721945fe5ffb74746d445dfa53 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/node-gyp/package.json @@ -0,0 +1,50 @@ +{ + "name": "@npmcli/node-gyp", + "version": "5.0.0", + "description": "Tools for dealing with node-gyp packages", + "scripts": { + "test": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/node-gyp.git" + }, + "keywords": [ + "npm", + "cli", + "node-gyp" + ], + "files": [ + "bin/", + "lib/" + ], + "main": "lib/index.js", + "author": "GitHub Inc.", + "license": "ISC", + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "tap": "^16.0.1" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": true + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/package-json/LICENSE b/node24/node_modules/npm/node_modules/@npmcli/package-json/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..05ee04dfb242c1bf436368f96cc861d8c0df0282 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/package-json/LICENSE @@ -0,0 +1,18 @@ +ISC License + +Copyright GitHub Inc. + +Permission to use, copy, modify, and/or distribute this +software for any purpose with or without fee is hereby +granted, provided that the above copyright notice and this +permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO +EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/index.js b/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1113c954a83d835a69672dc7f21ea8c3abfb1a1f --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/index.js @@ -0,0 +1,296 @@ +const { readFile, writeFile } = require('node:fs/promises') +const { resolve } = require('node:path') +const parseJSON = require('json-parse-even-better-errors') + +const updateDeps = require('./update-dependencies.js') +const updateScripts = require('./update-scripts.js') +const updateWorkspaces = require('./update-workspaces.js') +const { normalize, syncNormalize } = require('./normalize.js') +const { read, parse } = require('./read-package.js') +const { packageSort } = require('./sort.js') + +// a list of handy specialized helper functions that take +// care of special cases that are handled by the npm cli +const knownSteps = new Set([ + updateDeps, + updateScripts, + updateWorkspaces, +]) + +// list of all keys that are handled by "knownSteps" helpers +const knownKeys = new Set([ + ...updateDeps.knownKeys, + 'scripts', + 'workspaces', +]) + +class PackageJson { + // npm pkg fix + static fixSteps = Object.freeze([ + 'binRefs', + 'bundleDependencies', + 'fixName', + 'fixVersionField', + 'fixRepositoryField', + 'fixDependencies', + 'devDependencies', + 'scriptpath', + ]) + + static normalizeSteps = Object.freeze([ + '_id', + '_attributes', + 'bundledDependencies', + 'bundleDependencies', + 'optionalDedupe', + 'scripts', + 'funding', + 'bin', + 'binDir', + ]) + + static prepareSteps = Object.freeze([ + '_id', + '_attributes', + 'bundledDependencies', + 'bundleDependencies', + 'bundleDependenciesDeleteFalse', + 'gypfile', + 'serverjs', + 'scriptpath', + 'authors', + 'readme', + 'mans', + 'binDir', + 'gitHead', + 'fillTypes', + 'normalizeData', + 'binRefs', + ]) + + // create a new empty package.json, so we can save at the given path even + // though we didn't start from a parsed file + static async create (path, opts = {}) { + const p = new PackageJson() + await p.create(path) + if (opts.data) { + return p.update(opts.data) + } + return p + } + + // Loads a package.json at given path and JSON parses + static async load (path, opts = {}) { + const p = new PackageJson() + // Avoid try/catch if we aren't going to create + if (!opts.create) { + return p.load(path) + } + + try { + return await p.load(path) + } catch (err) { + if (!err.message.startsWith('Could not read package.json')) { + throw err + } + return await p.create(path) + } + } + + // npm pkg fix + static async fix (path, opts) { + const p = new PackageJson() + await p.load(path, true) + return p.fix(opts) + } + + // read-package-json compatible behavior + static async prepare (path, opts) { + const p = new PackageJson() + await p.load(path, true) + return p.prepare(opts) + } + + // read-package-json-fast compatible behavior + static async normalize (path, opts) { + const p = new PackageJson() + await p.load(path) + return p.normalize(opts) + } + + #path + #manifest + #readFileContent = '' + #canSave = true + + // Load content from given path + async load (path, parseIndex) { + this.#path = path + let parseErr + try { + this.#readFileContent = await read(this.filename) + } catch (err) { + if (!parseIndex) { + throw err + } + parseErr = err + } + + if (parseErr) { + const indexFile = resolve(this.path, 'index.js') + let indexFileContent + try { + indexFileContent = await readFile(indexFile, 'utf8') + } catch (err) { + throw parseErr + } + try { + this.fromComment(indexFileContent) + } catch (err) { + throw parseErr + } + // This wasn't a package.json so prevent saving + this.#canSave = false + return this + } + + return this.fromJSON(this.#readFileContent) + } + + // Load data from a JSON string/buffer + fromJSON (data) { + this.#manifest = parse(data) + return this + } + + // Manually set data from an existing object + fromContent (data) { + if (!data || typeof data !== 'object') { + throw new Error('Content data must be an object') + } + this.#manifest = data + this.#canSave = false + return this + } + + // Load data from a comment + // /**package { "name": "foo", "version": "1.2.3", ... } **/ + fromComment (data) { + data = data.split(/^\/\*\*package(?:\s|$)/m) + + if (data.length < 2) { + throw new Error('File has no package in comments') + } + data = data[1] + data = data.split(/\*\*\/$/m) + + if (data.length < 2) { + throw new Error('File has no package in comments') + } + data = data[0] + data = data.replace(/^\s*\*/mg, '') + + this.#manifest = parseJSON(data) + return this + } + + get content () { + return this.#manifest + } + + get path () { + return this.#path + } + + get filename () { + if (this.path) { + return resolve(this.path, 'package.json') + } + return undefined + } + + create (path) { + this.#path = path + this.#manifest = {} + return this + } + + // This should be the ONLY way to set content in the manifest + update (content) { + if (!this.content) { + throw new Error('Can not update without content. Please `load` or `create`') + } + + for (const step of knownSteps) { + this.#manifest = step({ content, originalContent: this.content }) + } + + // unknown properties will just be overwritten + for (const [key, value] of Object.entries(content)) { + if (!knownKeys.has(key)) { + this.content[key] = value + } + } + + return this + } + + async save ({ sort } = {}) { + if (!this.#canSave) { + throw new Error('No package.json to save to') + } + const { + [Symbol.for('indent')]: indent, + [Symbol.for('newline')]: newline, + ...rest + } = this.content + + const format = indent === undefined ? ' ' : indent + const eol = newline === undefined ? '\n' : newline + + const content = sort ? packageSort(rest) : rest + + const fileContent = `${ + JSON.stringify(content, null, format) + }\n` + .replace(/\n/g, eol) + + if (fileContent.trim() !== this.#readFileContent.trim()) { + const written = await writeFile(this.filename, fileContent) + this.#readFileContent = fileContent + return written + } + } + + // steps is NOT overrideable here because this is a legacy function that's not being used in new places + syncNormalize (opts = {}) { + opts.steps = this.constructor.normalizeSteps.filter(s => s !== '_attributes') + syncNormalize(this, opts) + return this + } + + async normalize (opts = {}) { + if (!opts.steps) { + opts.steps = this.constructor.normalizeSteps + } + await normalize(this, opts) + return this + } + + async prepare (opts = {}) { + if (!opts.steps) { + opts.steps = this.constructor.prepareSteps + } + await normalize(this, opts) + return this + } + + async fix (opts = {}) { + // This one is not overridable + opts.steps = this.constructor.fixSteps + await normalize(this, opts) + return this + } +} + +module.exports = PackageJson diff --git a/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/license.js b/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/license.js new file mode 100644 index 0000000000000000000000000000000000000000..9670803a17ce3994eedb54d55b0427bd2f90cea4 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/license.js @@ -0,0 +1,27 @@ +// This is an implementation of the validForNewPackage flag in validate-npm-package-license, which is no longer maintained + +const parse = require('spdx-expression-parse') + +function usesLicenseRef (ast) { + if (Object.hasOwn(ast, 'license')) { + return ast.license.startsWith('LicenseRef') || ast.license.startsWith('DocumentRef') + } else { + return usesLicenseRef(ast.left) || usesLicenseRef(ast.right) + } +} + +// license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN " +module.exports = function licenseValidForNewPackage (argument) { + if (argument === 'UNLICENSED' || argument === 'UNLICENCED') { + return true + } + if (/^SEE LICEN[CS]E IN ./.test(argument)) { + return true + } + try { + const ast = parse(argument) + return !usesLicenseRef(ast) + } catch { + return false + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/normalize-data.js b/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/normalize-data.js new file mode 100644 index 0000000000000000000000000000000000000000..65ca568e2f1049e0ef7b3d4d14976342523bdb11 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/normalize-data.js @@ -0,0 +1,254 @@ +// Originally normalize-package-data + +const { URL } = require('node:url') +const hostedGitInfo = require('hosted-git-info') +const validateLicense = require('./license.js') + +const typos = { + dependancies: 'dependencies', + dependecies: 'dependencies', + depdenencies: 'dependencies', + devEependencies: 'devDependencies', + depends: 'dependencies', + 'dev-dependencies': 'devDependencies', + devDependences: 'devDependencies', + devDepenencies: 'devDependencies', + devdependencies: 'devDependencies', + repostitory: 'repository', + repo: 'repository', + prefereGlobal: 'preferGlobal', + hompage: 'homepage', + hampage: 'homepage', + autohr: 'author', + autor: 'author', + contributers: 'contributors', + publicationConfig: 'publishConfig', + script: 'scripts', +} + +const isEmail = str => str.includes('@') && (str.indexOf('@') < str.lastIndexOf('.')) + +// Extracts description from contents of a readme file in markdown format +function extractDescription (description) { + // the first block of text before the first heading that isn't the first line heading + const lines = description.trim().split('\n') + let start = 0 + // skip initial empty lines and lines that start with # + while (lines[start]?.trim().match(/^(#|$)/)) { + start++ + } + let end = start + 1 + // keep going till we get to the end or an empty line + while (end < lines.length && lines[end].trim()) { + end++ + } + return lines.slice(start, end).join(' ').trim() +} + +function stringifyPerson (person) { + if (typeof person !== 'string') { + const name = person.name || '' + const u = person.url || person.web + const wrappedUrl = u ? (' (' + u + ')') : '' + const e = person.email || person.mail + const wrappedEmail = e ? (' <' + e + '>') : '' + person = name + wrappedEmail + wrappedUrl + } + const matchedName = person.match(/^([^(<]+)/) + const matchedUrl = person.match(/\(([^()]+)\)/) + const matchedEmail = person.match(/<([^<>]+)>/) + const parsed = {} + if (matchedName?.[0].trim()) { + parsed.name = matchedName[0].trim() + } + if (matchedEmail) { + parsed.email = matchedEmail[1] + } + if (matchedUrl) { + parsed.url = matchedUrl[1] + } + return parsed +} + +function normalizeData (data, changes) { + // fixDescriptionField + if (data.description && typeof data.description !== 'string') { + changes?.push(`'description' field should be a string`) + delete data.description + } + if (data.readme && !data.description && data.readme !== 'ERROR: No README data found!') { + data.description = extractDescription(data.readme) + } + if (data.description === undefined) { + delete data.description + } + if (!data.description) { + changes?.push('No description') + } + + // fixModulesField + if (data.modules) { + changes?.push(`modules field is deprecated`) + delete data.modules + } + + // fixFilesField + const files = data.files + if (files && !Array.isArray(files)) { + changes?.push(`Invalid 'files' member`) + delete data.files + } else if (data.files) { + data.files = data.files.filter(function (file) { + if (!file || typeof file !== 'string') { + changes?.push(`Invalid filename in 'files' list: ${file}`) + return false + } else { + return true + } + }) + } + + // fixManField + if (data.man && typeof data.man === 'string') { + data.man = [data.man] + } + + // fixBugsField + if (!data.bugs && data.repository?.url) { + const hosted = hostedGitInfo.fromUrl(data.repository.url) + if (hosted && hosted.bugs()) { + data.bugs = { url: hosted.bugs() } + } + } else if (data.bugs) { + if (typeof data.bugs === 'string') { + if (isEmail(data.bugs)) { + data.bugs = { email: data.bugs } + } else if (URL.canParse(data.bugs)) { + data.bugs = { url: data.bugs } + } else { + changes?.push(`Bug string field must be url, email, or {email,url}`) + } + } else { + for (const k in data.bugs) { + if (['web', 'name'].includes(k)) { + changes?.push(`bugs['${k}'] should probably be bugs['url'].`) + data.bugs.url = data.bugs[k] + delete data.bugs[k] + } + } + const oldBugs = data.bugs + data.bugs = {} + if (oldBugs.url) { + if (URL.canParse(oldBugs.url)) { + data.bugs.url = oldBugs.url + } else { + changes?.push('bugs.url field must be a string url. Deleted.') + } + } + if (oldBugs.email) { + if (typeof (oldBugs.email) === 'string' && isEmail(oldBugs.email)) { + data.bugs.email = oldBugs.email + } else { + changes?.push('bugs.email field must be a string email. Deleted.') + } + } + } + if (!data.bugs.email && !data.bugs.url) { + delete data.bugs + changes?.push('Normalized value of bugs field is an empty object. Deleted.') + } + } + // fixKeywordsField + if (typeof data.keywords === 'string') { + data.keywords = data.keywords.split(/,\s+/) + } + if (data.keywords && !Array.isArray(data.keywords)) { + delete data.keywords + changes?.push(`keywords should be an array of strings`) + } else if (data.keywords) { + data.keywords = data.keywords.filter(function (kw) { + if (typeof kw !== 'string' || !kw) { + changes?.push(`keywords should be an array of strings`) + return false + } else { + return true + } + }) + } + // fixBundleDependenciesField + const bdd = 'bundledDependencies' + const bd = 'bundleDependencies' + if (data[bdd] && !data[bd]) { + data[bd] = data[bdd] + delete data[bdd] + } + if (data[bd] && !Array.isArray(data[bd])) { + changes?.push(`Invalid 'bundleDependencies' list. Must be array of package names`) + delete data[bd] + } else if (data[bd]) { + data[bd] = data[bd].filter(function (filtered) { + if (!filtered || typeof filtered !== 'string') { + changes?.push(`Invalid bundleDependencies member: ${filtered}`) + return false + } else { + if (!data.dependencies) { + data.dependencies = {} + } + if (!Object.prototype.hasOwnProperty.call(data.dependencies, filtered)) { + changes?.push(`Non-dependency in bundleDependencies: ${filtered}`) + data.dependencies[filtered] = '*' + } + return true + } + }) + } + // fixHomepageField + if (!data.homepage && data.repository && data.repository.url) { + const hosted = hostedGitInfo.fromUrl(data.repository.url) + if (hosted) { + data.homepage = hosted.docs() + } + } + if (data.homepage) { + if (typeof data.homepage !== 'string') { + changes?.push('homepage field must be a string url. Deleted.') + delete data.homepage + } else { + if (!URL.canParse(data.homepage)) { + data.homepage = 'http://' + data.homepage + } + } + } + // fixReadmeField + if (!data.readme) { + changes?.push('No README data') + data.readme = 'ERROR: No README data found!' + } + // fixLicenseField + const license = data.license || data.licence + if (!license) { + changes?.push('No license field.') + } else if (typeof (license) !== 'string' || license.length < 1 || license.trim() === '') { + changes?.push('license should be a valid SPDX license expression') + } else if (!validateLicense(license)) { + changes?.push('license should be a valid SPDX license expression') + } + // fixPeople + if (data.author) { + data.author = stringifyPerson(data.author) + } + ['maintainers', 'contributors'].forEach(function (set) { + if (!Array.isArray(data[set])) { + return + } + data[set] = data[set].map(stringifyPerson) + }) + // fixTypos + for (const d in typos) { + if (Object.prototype.hasOwnProperty.call(data, d)) { + changes?.push(`${d} should probably be ${typos[d]}.`) + } + } +} + +module.exports = { normalizeData } diff --git a/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/normalize.js b/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/normalize.js new file mode 100644 index 0000000000000000000000000000000000000000..e2ba1829f03e3e3c9134f58e7699ec272bac2795 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/normalize.js @@ -0,0 +1,614 @@ +const valid = require('semver/functions/valid') +const clean = require('semver/functions/clean') +const fs = require('node:fs/promises') +const path = require('node:path') +const { log } = require('proc-log') +const moduleBuiltin = require('node:module') + +/** + * @type {import('hosted-git-info')} + */ +let _hostedGitInfo +function lazyHostedGitInfo () { + if (!_hostedGitInfo) { + _hostedGitInfo = require('hosted-git-info') + } + return _hostedGitInfo +} + +/** + * @type {import('glob').glob} + */ +let _glob +function lazyLoadGlob () { + if (!_glob) { + _glob = require('glob').glob + } + return _glob +} + +// used to be npm-normalize-package-bin +function normalizePackageBin (pkg, changes) { + if (pkg.bin) { + if (typeof pkg.bin === 'string' && pkg.name) { + changes?.push('"bin" was converted to an object') + pkg.bin = { [pkg.name]: pkg.bin } + } else if (Array.isArray(pkg.bin)) { + changes?.push('"bin" was converted to an object') + pkg.bin = pkg.bin.reduce((acc, k) => { + acc[path.basename(k)] = k + return acc + }, {}) + } + if (typeof pkg.bin === 'object') { + for (const binKey in pkg.bin) { + if (typeof pkg.bin[binKey] !== 'string') { + delete pkg.bin[binKey] + changes?.push(`removed invalid "bin[${binKey}]"`) + continue + } + const base = path.basename(secureAndUnixifyPath(binKey)) + if (!base) { + delete pkg.bin[binKey] + changes?.push(`removed invalid "bin[${binKey}]"`) + continue + } + + const binTarget = secureAndUnixifyPath(pkg.bin[binKey]) + + if (!binTarget) { + delete pkg.bin[binKey] + changes?.push(`removed invalid "bin[${binKey}]"`) + continue + } + + if (base !== binKey) { + delete pkg.bin[binKey] + changes?.push(`"bin[${binKey}]" was renamed to "bin[${base}]"`) + } + if (binTarget !== pkg.bin[binKey]) { + changes?.push(`"bin[${base}]" script name ${binTarget} was invalid and removed`) + } + pkg.bin[base] = binTarget + } + + if (Object.keys(pkg.bin).length === 0) { + changes?.push('empty "bin" was removed') + delete pkg.bin + } + + return pkg + } + } + delete pkg.bin +} + +function normalizePackageMan (pkg, changes) { + if (pkg.man) { + const mans = [] + for (const man of (Array.isArray(pkg.man) ? pkg.man : [pkg.man])) { + if (typeof man !== 'string') { + changes?.push(`removed invalid "man [${man}]"`) + } else { + mans.push(secureAndUnixifyPath(man)) + } + } + + if (!mans.length) { + changes?.push('empty "man" was removed') + } else { + pkg.man = mans + return pkg + } + } + delete pkg.man +} + +function isCorrectlyEncodedName (spec) { + return !spec.match(/[/@\s+%:]/) && + spec === encodeURIComponent(spec) +} + +function isValidScopedPackageName (spec) { + if (spec.charAt(0) !== '@') { + return false + } + + const rest = spec.slice(1).split('/') + if (rest.length !== 2) { + return false + } + + return rest[0] && rest[1] && + rest[0] === encodeURIComponent(rest[0]) && + rest[1] === encodeURIComponent(rest[1]) +} + +function unixifyPath (ref) { + return ref.replace(/\\|:/g, '/') +} + +function secureAndUnixifyPath (ref) { + const secured = unixifyPath(path.join('.', path.join('/', unixifyPath(ref)))) + return secured.startsWith('./') ? '' : secured +} + +// Only steps that can be ran synchronously. There are some object constructors (i.e. Aborist Node) that need synchronous normalization so here we are. +function syncSteps (pkg, { strict, steps, changes, allowLegacyCase }) { + const data = pkg.content + const pkgId = `${data.name ?? ''}@${data.version ?? ''}` + + // name and version are load bearing so we have to clean them up first + if (steps.includes('fixName') || steps.includes('fixNameField') || steps.includes('normalizeData')) { + if (!data.name && !strict) { + changes?.push('Missing "name" field was set to an empty string') + data.name = '' + } else { + if (typeof data.name !== 'string') { + throw new Error('name field must be a string.') + } + if (!strict) { + const name = data.name.trim() + if (data.name !== name) { + changes?.push(`Whitespace was trimmed from "name"`) + data.name = name + } + } + + if (data.name.startsWith('.') || + !(isValidScopedPackageName(data.name) || isCorrectlyEncodedName(data.name)) || + (strict && (!allowLegacyCase) && data.name !== data.name.toLowerCase()) || + data.name.toLowerCase() === 'node_modules' || + data.name.toLowerCase() === 'favicon.ico') { + throw new Error('Invalid name: ' + JSON.stringify(data.name)) + } + } + } + + if (steps.includes('fixName')) { + // Check for conflicts with builtin modules + if (moduleBuiltin.builtinModules.includes(data.name)) { + log.warn('package-json', pkgId, `Package name "${data.name}" conflicts with a Node.js built-in module name`) + } + } + + if (steps.includes('fixVersionField') || steps.includes('normalizeData')) { + // allow "loose" semver 1.0 versions in non-strict mode + // enforce strict semver 2.0 compliance in strict mode + const loose = !strict + if (!data.version) { + data.version = '' + } else { + if (!valid(data.version, loose)) { + throw new Error(`Invalid version: "${data.version}"`) + } + const version = clean(data.version, loose) + if (version !== data.version) { + changes?.push(`"version" was cleaned and set to "${version}"`) + data.version = version + } + } + } + + // remove attributes that start with "_" + if (steps.includes('_attributes')) { + for (const key in data) { + if (key.startsWith('_')) { + changes?.push(`"${key}" was removed`) + delete pkg.content[key] + } + } + } + + // build the "_id" attribute + if (steps.includes('_id')) { + if (data.name && data.version) { + changes?.push(`"_id" was set to ${pkgId}`) + data._id = pkgId + } + } + + // fix bundledDependencies typo + if (steps.includes('bundledDependencies')) { + if (data.bundleDependencies === undefined && data.bundledDependencies !== undefined) { + data.bundleDependencies = data.bundledDependencies + changes?.push(`Deleted incorrect "bundledDependencies"`) + } + delete data.bundledDependencies + } + + // expand "bundleDependencies: true or translate from object" + if (steps.includes('bundleDependencies')) { + const bd = data.bundleDependencies + if (bd === false && !steps.includes('bundleDependenciesDeleteFalse')) { + changes?.push(`"bundleDependencies" was changed from "false" to "[]"`) + data.bundleDependencies = [] + } else if (bd === true) { + changes?.push(`"bundleDependencies" was auto-populated from "dependencies"`) + data.bundleDependencies = Object.keys(data.dependencies || {}) + } else if (bd && typeof bd === 'object') { + if (!Array.isArray(bd)) { + changes?.push(`"bundleDependencies" was changed from an object to an array`) + data.bundleDependencies = Object.keys(bd) + } + } else if ('bundleDependencies' in data) { + changes?.push(`"bundleDependencies" was removed`) + delete data.bundleDependencies + } + } + + // it was once common practice to list deps both in optionalDependencies and + // in dependencies, to support npm versions that did not know about + // optionalDependencies. This is no longer a relevant need, so duplicating + // the deps in two places is unnecessary and excessive. + if (steps.includes('optionalDedupe')) { + if (data.dependencies && + data.optionalDependencies && typeof data.optionalDependencies === 'object') { + for (const name in data.optionalDependencies) { + changes?.push(`optionalDependencies."${name}" was removed`) + delete data.dependencies[name] + } + if (!Object.keys(data.dependencies).length) { + changes?.push(`Empty "optionalDependencies" was removed`) + delete data.dependencies + } + } + } + + // strip "node_modules/.bin" from scripts entries + // remove invalid scripts entries (non-strings) + if ((steps.includes('scripts') || steps.includes('scriptpath')) && data.scripts !== undefined) { + const spre = /^(\.[/\\])?node_modules[/\\].bin[\\/]/ + if (typeof data.scripts === 'object') { + for (const name in data.scripts) { + if (typeof data.scripts[name] !== 'string') { + delete data.scripts[name] + changes?.push(`Invalid scripts."${name}" was removed`) + } else if (steps.includes('scriptpath') && spre.test(data.scripts[name])) { + data.scripts[name] = data.scripts[name].replace(spre, '') + changes?.push(`scripts entry "${name}" was fixed to remove node_modules/.bin reference`) + } + } + } else { + changes?.push(`Removed invalid "scripts"`) + delete data.scripts + } + } + + if (steps.includes('funding')) { + if (data.funding && typeof data.funding === 'string') { + data.funding = { url: data.funding } + changes?.push(`"funding" was changed to an object with a url attribute`) + } + } + + // "normalizeData" from "read-package-json", which was just a call through to + // "normalize-package-data". We only call the "fixer" functions because + // outside of that it was also clobbering _id (which we already conditionally + // do) and also adding the gypfile script (which we also already + // conditionally do) + + // Some steps are isolated so we can do a limited subset of these in `fix` + if (steps.includes('fixRepositoryField') || steps.includes('normalizeData')) { + if (data.repositories) { + changes?.push(`"repository" was set to the first entry in "repositories" (${data.repository})`) + data.repository = data.repositories[0] + } + if (data.repository) { + if (typeof data.repository === 'string') { + changes?.push('"repository" was changed from a string to an object') + data.repository = { + type: 'git', + url: data.repository, + } + } + if (data.repository.url) { + const hosted = lazyHostedGitInfo().fromUrl(data.repository.url) + let r + if (hosted) { + if (hosted.getDefaultRepresentation() === 'shortcut') { + r = hosted.https() + } else { + r = hosted.toString() + } + if (r !== data.repository.url) { + changes?.push(`"repository.url" was normalized to "${r}"`) + data.repository.url = r + } + } + } + } + } + + if (steps.includes('fixDependencies') || steps.includes('normalizeData')) { + // peerDependencies? + // devDependencies is meaningless here, it's ignored on an installed package + for (const type of ['dependencies', 'devDependencies', 'optionalDependencies']) { + if (data[type]) { + let secondWarning = true + if (typeof data[type] === 'string') { + changes?.push(`"${type}" was converted from a string into an object`) + data[type] = data[type].trim().split(/[\n\r\s\t ,]+/) + secondWarning = false + } + if (Array.isArray(data[type])) { + if (secondWarning) { + changes?.push(`"${type}" was converted from an array into an object`) + } + const o = {} + for (const d of data[type]) { + if (typeof d === 'string') { + const dep = d.trim().split(/(:?[@\s><=])/) + const dn = dep.shift() + const dv = dep.join('').replace(/^@/, '').trim() + o[dn] = dv + } + } + data[type] = o + } + } + } + // normalize-package-data used to put optional dependencies BACK into + // dependencies here, we no longer do this + + for (const deps of ['dependencies', 'devDependencies']) { + if (deps in data) { + if (!data[deps] || typeof data[deps] !== 'object') { + changes?.push(`Removed invalid "${deps}"`) + delete data[deps] + } else { + for (const d in data[deps]) { + const r = data[deps][d] + if (typeof r !== 'string') { + changes?.push(`Removed invalid "${deps}.${d}"`) + delete data[deps][d] + } + const hosted = lazyHostedGitInfo().fromUrl(data[deps][d])?.toString() + if (hosted && hosted !== data[deps][d]) { + changes?.push(`Normalized git reference to "${deps}.${d}"`) + data[deps][d] = hosted.toString() + } + } + } + } + } + } + + // TODO some of this is duplicated in other steps here, a future breaking change may be able to remove the duplicates involved in this step + if (steps.includes('normalizeData')) { + const { normalizeData } = require('./normalize-data.js') + normalizeData(data, changes) + } +} + +// Steps that require await, distinct from sync-steps.js +async function asyncSteps (pkg, { steps, root, changes }) { + const data = pkg.content + const scripts = data.scripts || {} + const pkgId = `${data.name ?? ''}@${data.version ?? ''}` + + // add "install" attribute if any "*.gyp" files exist + if (steps.includes('gypfile')) { + if (!scripts.install && !scripts.preinstall && data.gypfile !== false) { + const files = await lazyLoadGlob()('*.gyp', { cwd: pkg.path }) + if (files.length) { + scripts.install = 'node-gyp rebuild' + data.scripts = scripts + data.gypfile = true + changes?.push(`"scripts.install" was set to "node-gyp rebuild"`) + changes?.push(`"gypfile" was set to "true"`) + } + } + } + + // add "start" attribute if "server.js" exists + if (steps.includes('serverjs') && !scripts.start) { + try { + await fs.access(path.join(pkg.path, 'server.js')) + scripts.start = 'node server.js' + data.scripts = scripts + changes?.push('"scripts.start" was set to "node server.js"') + } catch { + // do nothing + } + } + + // populate "authors" attribute + if (steps.includes('authors') && !data.contributors) { + try { + const authorData = await fs.readFile(path.join(pkg.path, 'AUTHORS'), 'utf8') + const authors = authorData.split(/\r?\n/g) + .map(line => line.replace(/^\s*#.*$/, '').trim()) + .filter(line => line) + data.contributors = authors + changes?.push('"contributors" was auto-populated with the contents of the "AUTHORS" file') + } catch { + // do nothing + } + } + + // populate "readme" attribute + if (steps.includes('readme') && !data.readme) { + const mdre = /\.m?a?r?k?d?o?w?n?$/i + const files = await lazyLoadGlob()('{README,README.*}', { + cwd: pkg.path, + nocase: true, + mark: true, + }) + let readmeFile + for (const file of files) { + // don't accept directories. + if (!file.endsWith(path.sep)) { + if (file.match(mdre)) { + readmeFile = file + break + } + if (file.endsWith('README')) { + readmeFile = file + } + } + } + if (readmeFile) { + const readmeData = await fs.readFile(path.join(pkg.path, readmeFile), 'utf8') + data.readme = readmeData + data.readmeFilename = readmeFile + changes?.push(`"readme" was set to the contents of ${readmeFile}`) + changes?.push(`"readmeFilename" was set to ${readmeFile}`) + } + if (!data.readme) { + data.readme = 'ERROR: No README data found!' + } + } + + // expand directories.man + if (steps.includes('mans')) { + if (data.directories?.man && !data.man) { + const manDir = secureAndUnixifyPath(data.directories.man) + const cwd = path.resolve(pkg.path, manDir) + const files = await lazyLoadGlob()('**/*.[0-9]', { cwd }) + data.man = files.map(man => + path.relative(pkg.path, path.join(cwd, man)).split(path.sep).join('/') + ) + } + normalizePackageMan(data, changes) + } + + // expand "directories.bin" + if (steps.includes('binDir') && data.directories?.bin && !data.bin && pkg.path) { + const binPath = secureAndUnixifyPath(data.directories.bin) + const bins = await lazyLoadGlob()('**', { cwd: path.resolve(pkg.path, binPath) }) + data.bin = bins.reduce((acc, binFile) => { + if (binFile && !binFile.startsWith('.')) { + const binName = path.basename(binFile) + // binPath is already cleaned and unixified, no need to path.join here. + acc[binName] = `${binPath}/${secureAndUnixifyPath(binFile)}` + } + return acc + }, {}) + } else if (steps.includes('bin') || steps.includes('binDir') || steps.includes('binRefs')) { + normalizePackageBin(data, changes) + } + + // populate "gitHead" attribute + if (steps.includes('gitHead') && !data.gitHead) { + const git = require('@npmcli/git') + const gitRoot = await git.find({ cwd: pkg.path, root }) + let head + if (gitRoot) { + try { + head = await fs.readFile(path.resolve(gitRoot, '.git/HEAD'), 'utf8') + } catch (err) { + // do nothing + } + } + let headData + if (head) { + if (head.startsWith('ref: ')) { + const headRef = head.replace(/^ref: /, '').trim() + const headFile = path.resolve(gitRoot, '.git', headRef) + try { + headData = await fs.readFile(headFile, 'utf8') + headData = headData.replace(/^ref: /, '').trim() + } catch (err) { + // do nothing + } + if (!headData) { + const packFile = path.resolve(gitRoot, '.git/packed-refs') + try { + let refs = await fs.readFile(packFile, 'utf8') + if (refs) { + refs = refs.split('\n') + for (let i = 0; i < refs.length; i++) { + const match = refs[i].match(/^([0-9a-f]{40}) (.+)$/) + if (match && match[2].trim() === headRef) { + headData = match[1] + break + } + } + } + } catch { + // do nothing + } + } + } else { + headData = head.trim() + } + } + if (headData) { + data.gitHead = headData + } + } + + // populate "types" attribute + if (steps.includes('fillTypes')) { + const index = data.main || 'index.js' + + if (typeof index !== 'string') { + throw new TypeError('The "main" attribute must be of type string.') + } + + // TODO exports is much more complicated than this in verbose format + // We need to support for instance + + // "exports": { + // ".": [ + // { + // "default": "./lib/npm.js" + // }, + // "./lib/npm.js" + // ], + // "./package.json": "./package.json" + // }, + // as well as conditional exports + + // if (data.exports && typeof data.exports === 'string') { + // index = data.exports + // } + + // if (data.exports && data.exports['.']) { + // index = data.exports['.'] + // if (typeof index !== 'string') { + // } + // } + const extless = path.join(path.dirname(index), path.basename(index, path.extname(index))) + const dts = `./${extless}.d.ts` + const hasDTSFields = 'types' in data || 'typings' in data + if (!hasDTSFields) { + try { + await fs.access(path.join(pkg.path, dts)) + data.types = dts.split(path.sep).join('/') + } catch { + // do nothing + } + } + } + + // Warn if the bin references don't point to anything. This might be better + // in normalize-package-data if it had access to the file path. + if (steps.includes('binRefs') && data.bin instanceof Object) { + for (const key in data.bin) { + try { + await fs.access(path.resolve(pkg.path, data.bin[key])) + } catch { + log.warn('package-json', pkgId, `No bin file found at ${data.bin[key]}`) + // XXX: should a future breaking change delete bin entries that cannot be accessed? + } + } + } +} + +// We don't want the `changes` array in here by default because this is a hot path for parsing packuments during install. The calling method passes it in if it wants to track changes. +async function normalize (pkg, opts) { + if (!pkg.content) { + throw new Error('Can not normalize without content') + } + await asyncSteps(pkg, opts) + // the normalizeData part of this needs to be the last thing ran, so sync comes second + syncSteps(pkg, opts) +} + +function syncNormalize (pkg, opts) { + syncSteps(pkg, opts) +} + +module.exports = { normalize, syncNormalize } diff --git a/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/read-package.js b/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/read-package.js new file mode 100644 index 0000000000000000000000000000000000000000..2a7165b030c3864f099922665f6c116ca7aeb33c --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/read-package.js @@ -0,0 +1,39 @@ +// This is JUST the code needed to open a package.json file and parse it. +// It's isolated out so that code needing to parse a package.json file can do so in the same way as this module does, without needing to require the whole module, or needing to require the underlying parsing library. + +const { readFile } = require('fs/promises') +const parseJSON = require('json-parse-even-better-errors') + +async function read (filename) { + try { + const data = await readFile(filename, 'utf8') + return data + } catch (err) { + err.message = `Could not read package.json: ${err}` + throw err + } +} + +function parse (data) { + try { + const content = parseJSON(data) + return content + } catch (err) { + err.message = `Invalid package.json: ${err}` + throw err + } +} + +// This is what most external libs will use. +// PackageJson will call read and parse separately +async function readPackage (filename) { + const data = await read(filename) + const content = parse(data) + return content +} + +module.exports = { + read, + parse, + readPackage, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/sort.js b/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/sort.js new file mode 100644 index 0000000000000000000000000000000000000000..9300a06ac12f06f715e1dcf5eff29a53f582f558 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/sort.js @@ -0,0 +1,101 @@ +/** + * arbitrary sort order for package.json largely pulled from: + * https://github.com/keithamus/sort-package-json/blob/main/defaultRules.md + * + * cross checked with: + * https://github.com/npm/types/blob/main/types/index.d.ts#L104 + * https://docs.npmjs.com/cli/configuring-npm/package-json + */ +function packageSort (json) { + const { + name, + version, + private: isPrivate, + description, + keywords, + homepage, + bugs, + repository, + funding, + license, + author, + maintainers, + contributors, + type, + imports, + exports, + main, + browser, + types, + bin, + man, + directories, + files, + workspaces, + scripts, + config, + dependencies, + devDependencies, + peerDependencies, + peerDependenciesMeta, + optionalDependencies, + bundledDependencies, + bundleDependencies, + engines, + os, + cpu, + publishConfig, + devEngines, + licenses, + overrides, + ...rest + } = json + + return { + ...(typeof name !== 'undefined' ? { name } : {}), + ...(typeof version !== 'undefined' ? { version } : {}), + ...(typeof isPrivate !== 'undefined' ? { private: isPrivate } : {}), + ...(typeof description !== 'undefined' ? { description } : {}), + ...(typeof keywords !== 'undefined' ? { keywords } : {}), + ...(typeof homepage !== 'undefined' ? { homepage } : {}), + ...(typeof bugs !== 'undefined' ? { bugs } : {}), + ...(typeof repository !== 'undefined' ? { repository } : {}), + ...(typeof funding !== 'undefined' ? { funding } : {}), + ...(typeof license !== 'undefined' ? { license } : {}), + ...(typeof author !== 'undefined' ? { author } : {}), + ...(typeof maintainers !== 'undefined' ? { maintainers } : {}), + ...(typeof contributors !== 'undefined' ? { contributors } : {}), + ...(typeof type !== 'undefined' ? { type } : {}), + ...(typeof imports !== 'undefined' ? { imports } : {}), + ...(typeof exports !== 'undefined' ? { exports } : {}), + ...(typeof main !== 'undefined' ? { main } : {}), + ...(typeof browser !== 'undefined' ? { browser } : {}), + ...(typeof types !== 'undefined' ? { types } : {}), + ...(typeof bin !== 'undefined' ? { bin } : {}), + ...(typeof man !== 'undefined' ? { man } : {}), + ...(typeof directories !== 'undefined' ? { directories } : {}), + ...(typeof files !== 'undefined' ? { files } : {}), + ...(typeof workspaces !== 'undefined' ? { workspaces } : {}), + ...(typeof scripts !== 'undefined' ? { scripts } : {}), + ...(typeof config !== 'undefined' ? { config } : {}), + ...(typeof dependencies !== 'undefined' ? { dependencies } : {}), + ...(typeof devDependencies !== 'undefined' ? { devDependencies } : {}), + ...(typeof peerDependencies !== 'undefined' ? { peerDependencies } : {}), + ...(typeof peerDependenciesMeta !== 'undefined' ? { peerDependenciesMeta } : {}), + ...(typeof optionalDependencies !== 'undefined' ? { optionalDependencies } : {}), + ...(typeof bundledDependencies !== 'undefined' ? { bundledDependencies } : {}), + ...(typeof bundleDependencies !== 'undefined' ? { bundleDependencies } : {}), + ...(typeof engines !== 'undefined' ? { engines } : {}), + ...(typeof os !== 'undefined' ? { os } : {}), + ...(typeof cpu !== 'undefined' ? { cpu } : {}), + ...(typeof publishConfig !== 'undefined' ? { publishConfig } : {}), + ...(typeof devEngines !== 'undefined' ? { devEngines } : {}), + ...(typeof licenses !== 'undefined' ? { licenses } : {}), + ...(typeof overrides !== 'undefined' ? { overrides } : {}), + ...rest, + } +} + +module.exports = { + packageSort, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/update-dependencies.js b/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/update-dependencies.js new file mode 100644 index 0000000000000000000000000000000000000000..54c8c8fe6ae0b12c0909a1729d4ee4f74f533822 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/update-dependencies.js @@ -0,0 +1,75 @@ +const depTypes = new Set([ + 'dependencies', + 'optionalDependencies', + 'devDependencies', + 'peerDependencies', +]) + +// sort alphabetically all types of deps for a given package +const orderDeps = (content) => { + for (const type of depTypes) { + if (content && content[type]) { + content[type] = Object.keys(content[type]) + .sort((a, b) => a.localeCompare(b, 'en')) + .reduce((res, key) => { + res[key] = content[type][key] + return res + }, {}) + } + } + return content +} + +const updateDependencies = ({ content, originalContent }) => { + const pkg = orderDeps({ + ...content, + }) + + // optionalDependencies don't need to be repeated in two places + if (pkg.dependencies) { + if (pkg.optionalDependencies) { + for (const name of Object.keys(pkg.optionalDependencies)) { + delete pkg.dependencies[name] + } + } + } + + const result = { ...originalContent } + + // loop through all types of dependencies and update package json pkg + for (const type of depTypes) { + if (pkg[type]) { + result[type] = pkg[type] + } + + // prune empty type props from resulting object + const emptyDepType = + pkg[type] + && typeof pkg === 'object' + && Object.keys(pkg[type]).length === 0 + if (emptyDepType) { + delete result[type] + } + } + + // if original package.json had dep in peerDeps AND deps, preserve that. + const { dependencies: origProd, peerDependencies: origPeer } = + originalContent || {} + const { peerDependencies: newPeer } = result + if (origProd && origPeer && newPeer) { + // we have original prod/peer deps, and new peer deps + // copy over any that were in both in the original + for (const name of Object.keys(origPeer)) { + if (origProd[name] !== undefined && newPeer[name] !== undefined) { + result.dependencies = result.dependencies || {} + result.dependencies[name] = newPeer[name] + } + } + } + + return result +} + +updateDependencies.knownKeys = depTypes + +module.exports = updateDependencies diff --git a/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/update-scripts.js b/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/update-scripts.js new file mode 100644 index 0000000000000000000000000000000000000000..b68366d2f21ca5c3590522e2816c81c21a87e9d3 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/update-scripts.js @@ -0,0 +1,29 @@ +const updateScripts = ({ content, originalContent = {} }) => { + const newScripts = content.scripts + + if (!newScripts) { + return originalContent + } + + // validate scripts content being appended + const hasInvalidScripts = () => + Object.entries(newScripts) + .some(([key, value]) => + typeof key !== 'string' || typeof value !== 'string') + if (hasInvalidScripts()) { + throw Object.assign( + new TypeError( + 'package.json scripts should be a key-value pair of strings.'), + { code: 'ESCRIPTSINVALID' } + ) + } + + return { + ...originalContent, + scripts: { + ...newScripts, + }, + } +} + +module.exports = updateScripts diff --git a/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/update-workspaces.js b/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/update-workspaces.js new file mode 100644 index 0000000000000000000000000000000000000000..4231639f68bfc31a64a4bf10e9879060f693afbe --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/package-json/lib/update-workspaces.js @@ -0,0 +1,26 @@ +const updateWorkspaces = ({ content, originalContent = {} }) => { + const newWorkspaces = content.workspaces + + if (!newWorkspaces) { + return originalContent + } + + // validate workspaces content being appended + const hasInvalidWorkspaces = () => + newWorkspaces.some(w => !(typeof w === 'string')) + if (!newWorkspaces.length || hasInvalidWorkspaces()) { + throw Object.assign( + new TypeError('workspaces should be an array of strings.'), + { code: 'EWORKSPACESINVALID' } + ) + } + + return { + ...originalContent, + workspaces: [ + ...newWorkspaces, + ], + } +} + +module.exports = updateWorkspaces diff --git a/node24/node_modules/npm/node_modules/@npmcli/package-json/package.json b/node24/node_modules/npm/node_modules/@npmcli/package-json/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d4ecb91152769918d43325d35976b091aaecca8a --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/package-json/package.json @@ -0,0 +1,59 @@ +{ + "name": "@npmcli/package-json", + "version": "7.0.5", + "description": "Programmatic API to update package.json", + "keywords": [ + "npm", + "oss" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/npm/package-json.git" + }, + "license": "ISC", + "author": "GitHub Inc.", + "main": "lib/index.js", + "files": [ + "bin/", + "lib/" + ], + "scripts": { + "snap": "tap", + "test": "tap", + "lint": "npm run eslint", + "lintfix": "npm run eslint -- --fix", + "posttest": "npm run lint", + "postsnap": "npm run lintfix --", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "dependencies": { + "@npmcli/git": "^7.0.0", + "glob": "^13.0.0", + "hosted-git-info": "^9.0.0", + "json-parse-even-better-errors": "^5.0.0", + "proc-log": "^6.0.0", + "semver": "^7.5.3", + "spdx-expression-parse": "^4.0.0" + }, + "devDependencies": { + "@npmcli/eslint-config": "^6.0.0", + "@npmcli/template-oss": "4.28.1", + "tap": "^16.0.1" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.28.1", + "publish": "true" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/promise-spawn/LICENSE b/node24/node_modules/npm/node_modules/@npmcli/promise-spawn/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c4e98e49798ffc82e6daf23d71396cb33bf1b243 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/promise-spawn/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE NPM DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE NPM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, +OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. diff --git a/node24/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/escape.js b/node24/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/escape.js new file mode 100644 index 0000000000000000000000000000000000000000..7a7b8069e6c28c506997ae5fc0eccef027502451 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/escape.js @@ -0,0 +1,67 @@ +'use strict' + +// this code adapted from: https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/ +const cmd = (input, doubleEscape) => { + if (!input.length) { + return '""' + } + + let result + if (!/[ \t\n\v"]/.test(input)) { + result = input + } else { + result = '"' + for (let i = 0; i <= input.length; ++i) { + let slashCount = 0 + while (input[i] === '\\') { + ++i + ++slashCount + } + + if (i === input.length) { + result += '\\'.repeat(slashCount * 2) + break + } + + if (input[i] === '"') { + result += '\\'.repeat(slashCount * 2 + 1) + result += input[i] + } else { + result += '\\'.repeat(slashCount) + result += input[i] + } + } + result += '"' + } + + // and finally, prefix shell meta chars with a ^ + result = result.replace(/[ !%^&()<>|"]/g, '^$&') + if (doubleEscape) { + result = result.replace(/[ !%^&()<>|"]/g, '^$&') + } + + return result +} + +const sh = (input) => { + if (!input.length) { + return `''` + } + + if (!/[\t\n\r "#$&'()*;<>?\\`|~]/.test(input)) { + return input + } + + // replace single quotes with '\'' and wrap the whole result in a fresh set of quotes + const result = `'${input.replace(/'/g, `'\\''`)}'` + // if the input string already had single quotes around it, clean those up + .replace(/^(?:'')+(?!$)/, '') + .replace(/\\'''/g, `\\'`) + + return result +} + +module.exports = { + cmd, + sh, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js b/node24/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..727f47ea734c77433e54f401c1db4b8a5348c1c0 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js @@ -0,0 +1,218 @@ +'use strict' + +const { spawn } = require('child_process') +const os = require('os') +const which = require('which') + +const escape = require('./escape.js') + +// 'extra' object is for decorating the error a bit more +const promiseSpawn = (cmd, args, opts = {}, extra = {}) => { + if (opts.shell) { + return spawnWithShell(cmd, args, opts, extra) + } + + let resolve, reject + const promise = new Promise((_resolve, _reject) => { + resolve = _resolve + reject = _reject + }) + + // Create error here so we have a more useful stack trace when rejecting + const closeError = new Error('command failed') + + const stdout = [] + const stderr = [] + + const getResult = (result) => ({ + cmd, + args, + ...result, + ...stdioResult(stdout, stderr, opts), + ...extra, + }) + const rejectWithOpts = (er, erOpts) => { + const resultError = getResult(erOpts) + reject(Object.assign(er, resultError)) + } + + const proc = spawn(cmd, args, opts) + promise.stdin = proc.stdin + promise.process = proc + + proc.on('error', rejectWithOpts) + + if (proc.stdout) { + proc.stdout.on('data', c => stdout.push(c)) + proc.stdout.on('error', rejectWithOpts) + } + + if (proc.stderr) { + proc.stderr.on('data', c => stderr.push(c)) + proc.stderr.on('error', rejectWithOpts) + } + + proc.on('close', (code, signal) => { + if (code || signal) { + rejectWithOpts(closeError, { code, signal }) + } else { + resolve(getResult({ code, signal })) + } + }) + + return promise +} + +const spawnWithShell = (cmd, args, opts, extra) => { + let command = opts.shell + // if shell is set to true, we use a platform default. we can't let the core + // spawn method decide this for us because we need to know what shell is in use + // ahead of time so that we can escape arguments properly. we don't need coverage here. + if (command === true) { + // istanbul ignore next + command = process.platform === 'win32' ? (process.env.ComSpec || 'cmd.exe') : 'sh' + } + + const options = { ...opts, shell: false } + const realArgs = [] + let script = cmd + + // first, determine if we're in windows because if we are we need to know if we're + // running an .exe or a .cmd/.bat since the latter requires extra escaping + const isCmd = /(?:^|\\)cmd(?:\.exe)?$/i.test(command) + if (isCmd) { + let doubleEscape = false + + // find the actual command we're running + let initialCmd = '' + let insideQuotes = false + for (let i = 0; i < cmd.length; ++i) { + const char = cmd.charAt(i) + if (char === ' ' && !insideQuotes) { + break + } + + initialCmd += char + if (char === '"' || char === "'") { + insideQuotes = !insideQuotes + } + } + + let pathToInitial + try { + pathToInitial = which.sync(initialCmd, { + path: (options.env && findInObject(options.env, 'PATH')) || process.env.PATH, + pathext: (options.env && findInObject(options.env, 'PATHEXT')) || process.env.PATHEXT, + }).toLowerCase() + } catch (err) { + pathToInitial = initialCmd.toLowerCase() + } + + doubleEscape = pathToInitial.endsWith('.cmd') || pathToInitial.endsWith('.bat') + for (const arg of args) { + script += ` ${escape.cmd(arg, doubleEscape)}` + } + realArgs.push('/d', '/s', '/c', script) + options.windowsVerbatimArguments = true + } else { + for (const arg of args) { + script += ` ${escape.sh(arg)}` + } + realArgs.push('-c', script) + } + + return promiseSpawn(command, realArgs, options, extra) +} + +// open a file with the default application as defined by the user's OS +const open = (_args, opts = {}, extra = {}) => { + const options = { ...opts, shell: true } + const args = [].concat(_args) + + let platform = process.platform + // process.platform === 'linux' may actually indicate WSL, if that's the case + // open the argument with sensible-browser which is pre-installed + // In WSL, set the default browser using, for example, + // export BROWSER="/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe" + // or + // export BROWSER="/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" + // To permanently set the default browser, add the appropriate entry to your shell's + // RC file, e.g. .bashrc or .zshrc. + if (platform === 'linux' && os.release().toLowerCase().includes('microsoft')) { + platform = 'wsl' + if (!process.env.BROWSER) { + return Promise.reject( + new Error('Set the BROWSER environment variable to your desired browser.')) + } + } + + let command = options.command + if (!command) { + if (platform === 'win32') { + // spawnWithShell does not do the additional os.release() check, so we + // have to force the shell here to make sure we treat WSL as windows. + options.shell = process.env.ComSpec + // also, the start command accepts a title so to make sure that we don't + // accidentally interpret the first arg as the title, we stick an empty + // string immediately after the start command + command = 'start ""' + } else if (platform === 'wsl') { + command = 'sensible-browser' + } else if (platform === 'darwin') { + command = 'open' + } else { + command = 'xdg-open' + } + } + + return spawnWithShell(command, args, options, extra) +} +promiseSpawn.open = open + +const isPipe = (stdio = 'pipe', fd) => { + if (stdio === 'pipe' || stdio === null) { + return true + } + + if (Array.isArray(stdio)) { + return isPipe(stdio[fd], fd) + } + + return false +} + +const stdioResult = (stdout, stderr, { stdioString = true, stdio }) => { + const result = { + stdout: null, + stderr: null, + } + + // stdio is [stdin, stdout, stderr] + if (isPipe(stdio, 1)) { + result.stdout = Buffer.concat(stdout) + if (stdioString) { + result.stdout = result.stdout.toString().trim() + } + } + + if (isPipe(stdio, 2)) { + result.stderr = Buffer.concat(stderr) + if (stdioString) { + result.stderr = result.stderr.toString().trim() + } + } + + return result +} + +// case insensitive lookup in an object +const findInObject = (obj, key) => { + key = key.toLowerCase() + for (const objKey of Object.keys(obj).sort()) { + if (objKey.toLowerCase() === key) { + return obj[objKey] + } + } +} + +module.exports = promiseSpawn diff --git a/node24/node_modules/npm/node_modules/@npmcli/promise-spawn/package.json b/node24/node_modules/npm/node_modules/@npmcli/promise-spawn/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69fdccb642814036e536ce1ef3aa05d630d056fe --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/promise-spawn/package.json @@ -0,0 +1,51 @@ +{ + "name": "@npmcli/promise-spawn", + "version": "9.0.1", + "files": [ + "bin/", + "lib/" + ], + "main": "./lib/index.js", + "description": "spawn processes the way the npm cli likes to do", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/promise-spawn.git" + }, + "author": "GitHub Inc.", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "lint": "npm run eslint", + "lintfix": "npm run eslint -- --fix", + "posttest": "npm run lint", + "postsnap": "npm run lintfix --", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "tap": { + "check-coverage": true, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "devDependencies": { + "@npmcli/eslint-config": "^6.0.0", + "@npmcli/template-oss": "4.28.0", + "spawk": "^1.7.1", + "tap": "^16.0.1" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.28.0", + "publish": true + }, + "dependencies": { + "which": "^6.0.0" + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/query/LICENSE b/node24/node_modules/npm/node_modules/@npmcli/query/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..8fcffd65391b81f9986edf305f1b956327799d03 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/query/LICENSE @@ -0,0 +1,20 @@ + + +ISC License + +Copyright npm, Inc. + +Permission to use, copy, modify, and/or distribute this +software for any purpose with or without fee is hereby +granted, provided that the above copyright notice and this +permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO +EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node24/node_modules/npm/node_modules/@npmcli/query/lib/index.js b/node24/node_modules/npm/node_modules/@npmcli/query/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..5f36ebe49ed1007b3566fd906ac46bb9ecc09fba --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/query/lib/index.js @@ -0,0 +1,255 @@ +'use strict' + +const parser = require('postcss-selector-parser') + +const arrayDelimiter = Symbol('arrayDelimiter') + +const escapeSlashes = str => + str.replace(/\//g, '\\/') + +const unescapeSlashes = str => + str.replace(/\\\//g, '/') + +// recursively fixes up any :attr pseudo-class found +const fixupAttr = astNode => { + const properties = [] + const matcher = {} + for (const selectorAstNode of astNode.nodes) { + const [firstAstNode] = selectorAstNode.nodes + if (firstAstNode.type === 'tag') { + properties.push(firstAstNode.value) + } + } + + const lastSelectorAstNode = astNode.nodes.pop() + const [attributeAstNode] = lastSelectorAstNode.nodes + + if (attributeAstNode.value === ':attr') { + const appendParts = fixupAttr(attributeAstNode) + properties.push(arrayDelimiter, ...appendParts.lookupProperties) + matcher.qualifiedAttribute = appendParts.attributeMatcher.qualifiedAttribute + matcher.operator = appendParts.attributeMatcher.operator + matcher.value = appendParts.attributeMatcher.value + + // backwards compatibility + matcher.attribute = appendParts.attributeMatcher.attribute + + if (appendParts.attributeMatcher.insensitive) { + matcher.insensitive = true + } + } else { + if (attributeAstNode.type !== 'attribute') { + throw Object.assign( + new Error('`:attr` pseudo-class expects an attribute matcher as the last value'), + { code: 'EQUERYATTR' } + ) + } + + matcher.qualifiedAttribute = unescapeSlashes(attributeAstNode.qualifiedAttribute) + matcher.operator = attributeAstNode.operator + matcher.value = attributeAstNode.value + + // backwards compatibility + matcher.attribute = matcher.qualifiedAttribute + + if (attributeAstNode.insensitive) { + matcher.insensitive = true + } + } + + astNode.lookupProperties = properties + astNode.attributeMatcher = matcher + astNode.nodes.length = 0 + return astNode +} + +// fixed up nested pseudo nodes will have their internal selectors moved +// to a new root node that will be referenced by the `nestedNode` property, +// this tweak makes it simpler to reuse `retrieveNodesFromParsedAst` to +// recursively parse and extract results from the internal selectors +const fixupNestedPseudo = astNode => { + // create a new ast root node and relocate any children + // selectors of the current ast node to this new root + const newRootNode = parser.root() + astNode.nestedNode = newRootNode + newRootNode.nodes = [...astNode.nodes] + + // clean up the ast by removing the children nodes from the + // current ast node while also cleaning up their `parent` refs + astNode.nodes.length = 0 + for (const currAstNode of newRootNode.nodes) { + currAstNode.parent = newRootNode + } + + // recursively fixup nodes of any nested selector + transformAst(newRootNode) +} + +// :semver(, [version|range|selector], [function]) +// note: the first or second parameter must be a static version or range +const fixupSemverSpecs = astNode => { + // if we have three nodes, the last is the semver function to use, pull that out first + if (astNode.nodes.length === 3) { + const funcNode = astNode.nodes.pop().nodes[0] + if (funcNode.type === 'tag') { + astNode.semverFunc = funcNode.value + } else if (funcNode.type === 'string') { + // a string is always in some type of quotes, we don't want those so slice them off + astNode.semverFunc = funcNode.value.slice(1, -1) + } else { + // anything that isn't a tag or a string isn't a function name + throw Object.assign( + new Error('`:semver` pseudo-class expects a function name as last value'), + { code: 'ESEMVERFUNC' } + ) + } + } + + // now if we have 1 node, it's a static value + // istanbul ignore else + if (astNode.nodes.length === 1) { + const semverNode = astNode.nodes.pop() + astNode.semverValue = semverNode.nodes.reduce((res, next) => `${res}${String(next)}`, '') + } else if (astNode.nodes.length === 2) { + // and if we have two nodes, one of them is a static value and we need to determine which it is + for (let i = 0; i < astNode.nodes.length; ++i) { + const type = astNode.nodes[i].nodes[0].type + // the type of the first child may be combinator for ranges, such as >14 + if (type === 'tag' || type === 'combinator') { + const semverNode = astNode.nodes.splice(i, 1)[0] + astNode.semverValue = semverNode.nodes.reduce((res, next) => `${res}${String(next)}`, '') + astNode.semverPosition = i + break + } + } + + if (typeof astNode.semverValue === 'undefined') { + throw Object.assign( + new Error('`:semver` pseudo-class expects a static value in the first or second position'), + { code: 'ESEMVERVALUE' } + ) + } + } + + // if we got here, the last remaining child should be attribute selector + if (astNode.nodes.length === 1) { + fixupAttr(astNode) + } else { + // if we don't have a selector, we default to `[version]` + astNode.attributeMatcher = { + insensitive: false, + attribute: 'version', + qualifiedAttribute: 'version', + } + astNode.lookupProperties = [] + } + + astNode.nodes.length = 0 +} + +const fixupTypes = astNode => { + const [valueAstNode] = astNode.nodes[0].nodes + const { value } = valueAstNode || {} + astNode.typeValue = value + astNode.nodes.length = 0 +} + +const fixupPaths = astNode => { + astNode.pathValue = unescapeSlashes(String(astNode.nodes[0])) + astNode.nodes.length = 0 +} + +const fixupOutdated = astNode => { + if (astNode.nodes.length) { + astNode.outdatedKind = String(astNode.nodes[0]) + astNode.nodes.length = 0 + } +} + +const fixupVuln = astNode => { + const vulns = [] + if (astNode.nodes.length) { + for (const selector of astNode.nodes) { + const vuln = {} + for (const node of selector.nodes) { + if (node.type !== 'attribute') { + throw Object.assign( + new Error(':vuln pseudo-class only accepts attribute matchers or "cwe" tag'), + { code: 'EQUERYATTR' } + ) + } + if (!['severity', 'cwe'].includes(node._attribute)) { + throw Object.assign( + new Error(':vuln pseudo-class only matches "severity" and "cwe" attributes'), + { code: 'EQUERYATTR' } + ) + } + if (!node.operator) { + node.operator = '=' + node.value = '*' + } + if (node.operator !== '=') { + throw Object.assign( + new Error(':vuln pseudo-class attribute selector only accepts "=" operator', node), + { code: 'EQUERYATTR' } + ) + } + if (!vuln[node._attribute]) { + vuln[node._attribute] = [] + } + vuln[node._attribute].push(node._value) + } + vulns.push(vuln) + } + astNode.vulns = vulns + astNode.nodes.length = 0 + } +} + +// a few of the supported ast nodes need to be tweaked in order to properly be +// interpreted as proper arborist query selectors, namely semver ranges from +// both ids and :semver pseudo-class selectors need to be translated from what +// are usually multiple ast nodes, such as: tag:1, class:.0, class:.0 to a +// single `1.0.0` value, other pseudo-class selectors also get preprocessed in +// order to make it simpler to execute later when traversing each ast node +// using rootNode.walk(), such as :path, :type, etc. transformAst handles all +// these modifications to the parsed ast by doing an extra, initial traversal +// of the parsed ast from the query and modifying the parsed nodes accordingly +const transformAst = selector => { + selector.walk((nextAstNode) => { + switch (nextAstNode.value) { + case ':attr': + return fixupAttr(nextAstNode) + case ':is': + case ':has': + case ':not': + return fixupNestedPseudo(nextAstNode) + case ':path': + return fixupPaths(nextAstNode) + case ':semver': + return fixupSemverSpecs(nextAstNode) + case ':type': + return fixupTypes(nextAstNode) + case ':outdated': + return fixupOutdated(nextAstNode) + case ':vuln': + return fixupVuln(nextAstNode) + } + }) +} + +const queryParser = (query) => { + // if query is an empty string or any falsy + // value, just returns an empty result + if (!query) { + return [] + } + + return parser(transformAst) + .astSync(escapeSlashes(query), { lossless: false }) +} + +module.exports = { + parser: queryParser, + arrayDelimiter, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/query/package.json b/node24/node_modules/npm/node_modules/@npmcli/query/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3342d3eea9af658f86811072ef17de2b6ad52c0c --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/query/package.json @@ -0,0 +1,64 @@ +{ + "name": "@npmcli/query", + "version": "5.0.0", + "description": "npm query parser and tools", + "main": "lib/index.js", + "scripts": { + "test": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "contributors": [ + { + "name": "Ruy Adorno", + "url": "https://ruyadorno.com", + "twitter": "ruyadorno" + } + ], + "keywords": [ + "ast", + "npm", + "npmcli", + "parser", + "postcss", + "postcss-selector-parser", + "query" + ], + "author": "GitHub Inc.", + "license": "ISC", + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": true + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "tap": "^16.2.0" + }, + "dependencies": { + "postcss-selector-parser": "^7.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/query.git" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/redact/LICENSE b/node24/node_modules/npm/node_modules/@npmcli/redact/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..271bc13dbcf6443052cfc5a6074721cd90216b49 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/redact/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 npm + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node24/node_modules/npm/node_modules/@npmcli/redact/lib/deep-map.js b/node24/node_modules/npm/node_modules/@npmcli/redact/lib/deep-map.js new file mode 100644 index 0000000000000000000000000000000000000000..0aeb8afb4b936d7ef23cfd364092af79940926a8 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/redact/lib/deep-map.js @@ -0,0 +1,71 @@ +const { serializeError } = require('./error') + +const deepMap = (input, handler = v => v, path = ['$'], seen = new Set([input])) => { + // this is in an effort to maintain bole's error logging behavior + if (path.join('.') === '$' && input instanceof Error) { + return deepMap({ err: serializeError(input) }, handler, path, seen) + } + if (input instanceof Error) { + return deepMap(serializeError(input), handler, path, seen) + } + // allows for non-node js environments, sush as workers + if (typeof Buffer !== 'undefined' && input instanceof Buffer) { + return `[unable to log instanceof buffer]` + } + if (input instanceof Uint8Array) { + return `[unable to log instanceof Uint8Array]` + } + + if (Array.isArray(input)) { + const result = [] + for (let i = 0; i < input.length; i++) { + const element = input[i] + const elementPath = [...path, i] + if (element instanceof Object) { + if (!seen.has(element)) { // avoid getting stuck in circular reference + seen.add(element) + result.push(deepMap(handler(element, elementPath), handler, elementPath, seen)) + } + } else { + result.push(handler(element, elementPath)) + } + } + return result + } + + if (input === null) { + return null + } else if (typeof input === 'object' || typeof input === 'function') { + const result = {} + + for (const propertyName of Object.getOwnPropertyNames(input)) { + // skip logging internal properties + if (propertyName.startsWith('_')) { + continue + } + + try { + const property = input[propertyName] + const propertyPath = [...path, propertyName] + if (property instanceof Object) { + if (!seen.has(property)) { // avoid getting stuck in circular reference + seen.add(property) + result[propertyName] = deepMap( + handler(property, propertyPath), handler, propertyPath, seen + ) + } + } else { + result[propertyName] = handler(property, propertyPath) + } + } catch (err) { + // a getter may throw an error + result[propertyName] = `[error getting value: ${err.message}]` + } + } + return result + } + + return handler(input, path) +} + +module.exports = { deepMap } diff --git a/node24/node_modules/npm/node_modules/@npmcli/redact/lib/error.js b/node24/node_modules/npm/node_modules/@npmcli/redact/lib/error.js new file mode 100644 index 0000000000000000000000000000000000000000..6a9c51ea4cff6a30035d119b3511d538de4dd4e1 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/redact/lib/error.js @@ -0,0 +1,28 @@ +/** takes an error object and serializes it to a plan object */ +function serializeError (input) { + if (!(input instanceof Error)) { + if (typeof input === 'string') { + const error = new Error(`attempted to serialize a non-error, string String, "${input}"`) + return serializeError(error) + } + const error = new Error(`attempted to serialize a non-error, ${typeof input} ${input?.constructor?.name}`) + return serializeError(error) + } + // different error objects store status code differently + // AxiosError uses `status`, other services use `statusCode` + const statusCode = input.statusCode ?? input.status + // CAUTION: what we serialize here gets add to the size of logs + return { + errorType: input.errorType ?? input.constructor.name, + ...(input.message ? { message: input.message } : {}), + ...(input.stack ? { stack: input.stack } : {}), + // think of this as error code + ...(input.code ? { code: input.code } : {}), + // think of this as http status code + ...(statusCode ? { statusCode } : {}), + } +} + +module.exports = { + serializeError, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/redact/lib/index.js b/node24/node_modules/npm/node_modules/@npmcli/redact/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c95fbbded0ae9e1039c15ac17accc4839a8512aa --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/redact/lib/index.js @@ -0,0 +1,44 @@ +const matchers = require('./matchers') +const { redactUrlPassword } = require('./utils') + +const REPLACE = '***' + +const redact = (value) => { + if (typeof value !== 'string' || !value) { + return value + } + return redactUrlPassword(value, REPLACE) + .replace(matchers.NPM_SECRET.pattern, `npm_${REPLACE}`) + .replace(matchers.UUID.pattern, REPLACE) +} + +// split on \s|= similar to how nopt parses options +const splitAndRedact = (str) => { + // stateful regex, don't move out of this scope + const splitChars = /[\s=]/g + + let match = null + let result = '' + let index = 0 + while (match = splitChars.exec(str)) { + result += redact(str.slice(index, match.index)) + match[0] + index = splitChars.lastIndex + } + + return result + redact(str.slice(index)) +} + +// replaces auth info in an array of arguments or in a strings +const redactLog = (arg) => { + if (typeof arg === 'string') { + return splitAndRedact(arg) + } else if (Array.isArray(arg)) { + return arg.map((a) => typeof a === 'string' ? splitAndRedact(a) : a) + } + return arg +} + +module.exports = { + redact, + redactLog, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/redact/lib/matchers.js b/node24/node_modules/npm/node_modules/@npmcli/redact/lib/matchers.js new file mode 100644 index 0000000000000000000000000000000000000000..df2953a268342d3b92b6777edf87755ecccd0494 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/redact/lib/matchers.js @@ -0,0 +1,88 @@ +const TYPE_REGEX = 'regex' +const TYPE_URL = 'url' +const TYPE_PATH = 'path' + +const NPM_SECRET = { + type: TYPE_REGEX, + pattern: /\b(npms?_)[a-zA-Z0-9]{36,48}\b/gi, + replacement: `[REDACTED_NPM_SECRET]`, +} + +const AUTH_HEADER = { + type: TYPE_REGEX, + pattern: /\b(Basic\s+|Bearer\s+)[\w+=\-.]+\b/gi, + replacement: `[REDACTED_AUTH_HEADER]`, +} + +const JSON_WEB_TOKEN = { + type: TYPE_REGEX, + pattern: /\b[A-Za-z0-9-_]{10,}(?!\.\d+\.)\.[A-Za-z0-9-_]{3,}\.[A-Za-z0-9-_]{20,}\b/gi, + replacement: `[REDACTED_JSON_WEB_TOKEN]`, +} + +const UUID = { + type: TYPE_REGEX, + pattern: /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi, + replacement: `[REDACTED_UUID]`, +} + +const URL_MATCHER = { + type: TYPE_REGEX, + pattern: /(?:https?|ftp):\/\/[^\s/"$.?#].[^\s"]*/gi, + replacement: '[REDACTED_URL]', +} + +const DEEP_HEADER_AUTHORIZATION = { + type: TYPE_PATH, + predicate: ({ path }) => path.endsWith('.headers.authorization'), + replacement: '[REDACTED_HEADER_AUTHORIZATION]', +} + +const DEEP_HEADER_SET_COOKIE = { + type: TYPE_PATH, + predicate: ({ path }) => path.endsWith('.headers.set-cookie'), + replacement: '[REDACTED_HEADER_SET_COOKIE]', +} + +const DEEP_HEADER_COOKIE = { + type: TYPE_PATH, + predicate: ({ path }) => path.endsWith('.headers.cookie'), + replacement: '[REDACTED_HEADER_COOKIE]', +} + +const REWRITE_REQUEST = { + type: TYPE_PATH, + predicate: ({ path }) => path.endsWith('.request'), + replacement: (input) => ({ + method: input?.method, + path: input?.path, + headers: input?.headers, + url: input?.url, + }), +} + +const REWRITE_RESPONSE = { + type: TYPE_PATH, + predicate: ({ path }) => path.endsWith('.response'), + replacement: (input) => ({ + data: input?.data, + status: input?.status, + headers: input?.headers, + }), +} + +module.exports = { + TYPE_REGEX, + TYPE_URL, + TYPE_PATH, + NPM_SECRET, + AUTH_HEADER, + JSON_WEB_TOKEN, + UUID, + URL_MATCHER, + DEEP_HEADER_AUTHORIZATION, + DEEP_HEADER_SET_COOKIE, + DEEP_HEADER_COOKIE, + REWRITE_REQUEST, + REWRITE_RESPONSE, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/redact/lib/server.js b/node24/node_modules/npm/node_modules/@npmcli/redact/lib/server.js new file mode 100644 index 0000000000000000000000000000000000000000..04edfee0b785026f434f7fc7aab0f80681623da0 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/redact/lib/server.js @@ -0,0 +1,59 @@ +const { + AUTH_HEADER, + JSON_WEB_TOKEN, + NPM_SECRET, + DEEP_HEADER_AUTHORIZATION, + DEEP_HEADER_SET_COOKIE, + REWRITE_REQUEST, + REWRITE_RESPONSE, + DEEP_HEADER_COOKIE, +} = require('./matchers') + +const { + redactUrlMatcher, + redactUrlPasswordMatcher, + redactMatchers, +} = require('./utils') + +const { serializeError } = require('./error') + +const { deepMap } = require('./deep-map') + +const _redact = redactMatchers( + NPM_SECRET, + AUTH_HEADER, + JSON_WEB_TOKEN, + DEEP_HEADER_AUTHORIZATION, + DEEP_HEADER_SET_COOKIE, + DEEP_HEADER_COOKIE, + REWRITE_REQUEST, + REWRITE_RESPONSE, + redactUrlMatcher( + redactUrlPasswordMatcher() + ) +) + +const redact = (input) => deepMap(input, (value, path) => _redact(value, { path })) + +/** takes an error returns new error keeping some custom properties */ +function redactError (input) { + const { message, ...data } = serializeError(input) + const output = new Error(redact(message)) + return Object.assign(output, redact(data)) +} + +/** runs a function within try / catch and throws error wrapped in redactError */ +function redactThrow (func) { + if (typeof func !== 'function') { + throw new Error('redactThrow expects a function') + } + return async (...args) => { + try { + return await func(...args) + } catch (error) { + throw redactError(error) + } + } +} + +module.exports = { redact, redactError, redactThrow } diff --git a/node24/node_modules/npm/node_modules/@npmcli/redact/lib/utils.js b/node24/node_modules/npm/node_modules/@npmcli/redact/lib/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..35974be1fe20d671606570f82e9317a8dda8f18c --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/redact/lib/utils.js @@ -0,0 +1,202 @@ +const { + URL_MATCHER, + TYPE_URL, + TYPE_REGEX, + TYPE_PATH, +} = require('./matchers') + +/** + * creates a string of asterisks, + * this forces a minimum asterisk for security purposes + */ +const asterisk = (length = 0) => { + length = typeof length === 'string' ? length.length : length + if (length < 8) { + return '*'.repeat(8) + } + return '*'.repeat(length) +} + +/** + * escapes all special regex chars + * @see https://stackoverflow.com/a/9310752 + * @see https://github.com/tc39/proposal-regex-escaping + */ +const escapeRegExp = (text) => { + return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, `\\$&`) +} + +/** + * provieds a regex "or" of the url versions of a string + */ +const urlEncodeRegexGroup = (value) => { + const decoded = decodeURIComponent(value) + const encoded = encodeURIComponent(value) + const union = [...new Set([encoded, decoded, value])].map(escapeRegExp).join('|') + return union +} + +/** + * a tagged template literal that returns a regex ensures all variables are excaped + */ +const urlEncodeRegexTag = (strings, ...values) => { + let pattern = '' + for (let i = 0; i < values.length; i++) { + pattern += strings[i] + `(${urlEncodeRegexGroup(values[i])})` + } + pattern += strings[strings.length - 1] + return new RegExp(pattern) +} + +/** + * creates a matcher for redacting url hostname + */ +const redactUrlHostnameMatcher = ({ hostname, replacement } = {}) => ({ + type: TYPE_URL, + predicate: ({ url }) => url.hostname === hostname, + pattern: ({ url }) => { + return urlEncodeRegexTag`(^${url.protocol}//${url.username}:.+@)?${url.hostname}` + }, + replacement: `$1${replacement || asterisk()}`, +}) + +/** + * creates a matcher for redacting url search / query parameter values + */ +const redactUrlSearchParamsMatcher = ({ param, replacement } = {}) => ({ + type: TYPE_URL, + predicate: ({ url }) => url.searchParams.has(param), + pattern: ({ url }) => urlEncodeRegexTag`(${param}=)${url.searchParams.get(param)}`, + replacement: `$1${replacement || asterisk()}`, +}) + +/** creates a matcher for redacting the url password */ +const redactUrlPasswordMatcher = ({ replacement } = {}) => ({ + type: TYPE_URL, + predicate: ({ url }) => url.password, + pattern: ({ url }) => urlEncodeRegexTag`(^${url.protocol}//${url.username}:)${url.password}`, + replacement: `$1${replacement || asterisk()}`, +}) + +const redactUrlReplacement = (...matchers) => (subValue) => { + try { + const url = new URL(subValue) + return redactMatchers(...matchers)(subValue, { url }) + } catch (err) { + return subValue + } +} + +/** + * creates a matcher / submatcher for urls, this function allows you to first + * collect all urls within a larger string and then pass those urls to a + * submatcher + * + * @example + * console.log("this will first match all urls, then pass those urls to the password patcher") + * redactMatchers(redactUrlMatcher(redactUrlPasswordMatcher())) + * + * @example + * console.log( + * "this will assume you are passing in a string that is a url, and will redact the password" + * ) + * redactMatchers(redactUrlPasswordMatcher()) + * + */ +const redactUrlMatcher = (...matchers) => { + return { + ...URL_MATCHER, + replacement: redactUrlReplacement(...matchers), + } +} + +const matcherFunctions = { + [TYPE_REGEX]: (matcher) => (value) => { + if (typeof value === 'string') { + value = value.replace(matcher.pattern, matcher.replacement) + } + return value + }, + [TYPE_URL]: (matcher) => (value, ctx) => { + if (typeof value === 'string') { + try { + const url = ctx?.url || new URL(value) + const { predicate, pattern } = matcher + const predicateValue = predicate({ url }) + if (predicateValue) { + value = value.replace(pattern({ url }), matcher.replacement) + } + } catch (_e) { + return value + } + } + return value + }, + [TYPE_PATH]: (matcher) => (value, ctx) => { + const rawPath = ctx?.path + const path = rawPath.join('.').toLowerCase() + const { predicate, replacement } = matcher + const replace = typeof replacement === 'function' ? replacement : () => replacement + const shouldRun = predicate({ rawPath, path }) + if (shouldRun) { + value = replace(value, { rawPath, path }) + } + return value + }, +} + +/** converts a matcher to a function */ +const redactMatcher = (matcher) => { + return matcherFunctions[matcher.type](matcher) +} + +/** converts a series of matchers to a function */ +const redactMatchers = (...matchers) => (value, ctx) => { + const flatMatchers = matchers.flat() + return flatMatchers.reduce((result, matcher) => { + const fn = (typeof matcher === 'function') ? matcher : redactMatcher(matcher) + return fn(result, ctx) + }, value) +} + +/** + * replacement handler, keeping $1 (if it exists) and replacing the + * rest of the string with asterisks, maintaining string length + */ +const redactDynamicReplacement = () => (value, start) => { + if (typeof start === 'number') { + return asterisk(value) + } + return start + asterisk(value.substring(start.length).length) +} + +/** + * replacement handler, keeping $1 (if it exists) and replacing the + * rest of the string with a fixed number of asterisks + */ +const redactFixedReplacement = (length) => (_value, start) => { + if (typeof start === 'number') { + return asterisk(length) + } + return start + asterisk(length) +} + +const redactUrlPassword = (value, replacement) => { + return redactMatchers(redactUrlPasswordMatcher({ replacement }))(value) +} + +module.exports = { + asterisk, + escapeRegExp, + urlEncodeRegexGroup, + urlEncodeRegexTag, + redactUrlHostnameMatcher, + redactUrlSearchParamsMatcher, + redactUrlPasswordMatcher, + redactUrlMatcher, + redactUrlReplacement, + redactDynamicReplacement, + redactFixedReplacement, + redactMatchers, + redactUrlPassword, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/redact/package.json b/node24/node_modules/npm/node_modules/@npmcli/redact/package.json new file mode 100644 index 0000000000000000000000000000000000000000..dfa4e8588cbccdf572a656cb7d4f041d90f13543 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/redact/package.json @@ -0,0 +1,52 @@ +{ + "name": "@npmcli/redact", + "version": "4.0.0", + "description": "Redact sensitive npm information from output", + "main": "lib/index.js", + "exports": { + ".": "./lib/index.js", + "./server": "./lib/server.js", + "./package.json": "./package.json" + }, + "scripts": { + "test": "tap", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "snap": "tap", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + }, + "keywords": [], + "author": "GitHub Inc.", + "license": "ISC", + "files": [ + "bin/", + "lib/" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/npm/redact.git" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.27.1", + "publish": true + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ], + "timeout": 120 + }, + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.27.1", + "tap": "^16.3.10" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/run-script/LICENSE b/node24/node_modules/npm/node_modules/@npmcli/run-script/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..3d4e2b4fb62e71b5d7251a510e16c4c8d7c0b287 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/run-script/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/is-server-package.js b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/is-server-package.js new file mode 100644 index 0000000000000000000000000000000000000000..274c1dcd69f0f6363c55e35ca1bab43b0e703676 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/is-server-package.js @@ -0,0 +1,11 @@ +const { stat } = require('node:fs/promises') +const { resolve } = require('node:path') + +module.exports = async path => { + try { + const st = await stat(resolve(path, 'server.js')) + return st.isFile() + } catch (er) { + return false + } +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/make-spawn-args.js b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/make-spawn-args.js new file mode 100644 index 0000000000000000000000000000000000000000..f40a89b215239350293e864a03d14b83a2939682 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/make-spawn-args.js @@ -0,0 +1,53 @@ +/* eslint camelcase: "off" */ +const setPATH = require('./set-path.js') +const { resolve } = require('path') + +let npm_config_node_gyp + +const makeSpawnArgs = options => { + const { + args, + binPaths, + cmd, + env, + event, + nodeGyp, + path, + scriptShell = true, + stdio, + stdioString, + } = options + + if (nodeGyp) { + // npm already pulled this from env and passes it in to options + npm_config_node_gyp = nodeGyp + } else if (env.npm_config_node_gyp) { + // legacy mode for standalone user + npm_config_node_gyp = env.npm_config_node_gyp + } else { + // default + npm_config_node_gyp = require.resolve('node-gyp/bin/node-gyp.js') + } + + const spawnEnv = setPATH(path, binPaths, { + // we need to at least save the PATH environment var + ...process.env, + ...env, + npm_package_json: resolve(path, 'package.json'), + npm_lifecycle_event: event, + npm_lifecycle_script: cmd, + npm_config_node_gyp, + }) + + const spawnOpts = { + env: spawnEnv, + stdioString, + stdio, + cwd: path, + shell: scriptShell, + } + + return [cmd, args, spawnOpts] +} + +module.exports = makeSpawnArgs diff --git a/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp new file mode 100644 index 0000000000000000000000000000000000000000..679191d5a41cadb7892f189363ac9582ab34225d --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +node "$npm_config_node_gyp" "$@" diff --git a/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp.cmd b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp.cmd new file mode 100644 index 0000000000000000000000000000000000000000..4c6987ac9868b2240e6260f0295a85936a2fe1bc --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp.cmd @@ -0,0 +1 @@ +@node "%npm_config_node_gyp%" %* diff --git a/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/package-envs.js b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/package-envs.js new file mode 100644 index 0000000000000000000000000000000000000000..dca197be14c4748c03e38bf169195afe055337f1 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/package-envs.js @@ -0,0 +1,29 @@ +const packageEnvs = (vals, prefix, env = {}) => { + for (const [key, val] of Object.entries(vals)) { + if (val === undefined) { + continue + } else if (val === null || val === false) { + env[`${prefix}${key}`] = '' + } else if (Array.isArray(val)) { + val.forEach((item, index) => { + packageEnvs({ [`${key}_${index}`]: item }, `${prefix}`, env) + }) + } else if (typeof val === 'object') { + packageEnvs(val, `${prefix}${key}_`, env) + } else { + env[`${prefix}${key}`] = String(val) + } + } + return env +} + +// https://github.com/npm/rfcs/pull/183 defines which fields we put into the environment +module.exports = pkg => { + return packageEnvs({ + name: pkg.name, + version: pkg.version, + config: pkg.config, + engines: pkg.engines, + bin: pkg.bin, + }, 'npm_package_') +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js new file mode 100644 index 0000000000000000000000000000000000000000..a4de17f22d560ca114283a5e04880f9e049f130b --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js @@ -0,0 +1,114 @@ +const makeSpawnArgs = require('./make-spawn-args.js') +const promiseSpawn = require('@npmcli/promise-spawn') +const packageEnvs = require('./package-envs.js') +const { isNodeGypPackage, defaultGypInstallScript } = require('@npmcli/node-gyp') +const signalManager = require('./signal-manager.js') +const isServerPackage = require('./is-server-package.js') + +const runScriptPkg = async options => { + const { + args = [], + binPaths = false, + env = {}, + event, + nodeGyp, + path, + pkg, + scriptShell, + // how long to wait for a process.kill signal + // only exposed here so that we can make the test go a bit faster. + signalTimeout = 500, + stdio = 'pipe', + stdioString, + } = options + + const { scripts = {}, gypfile } = pkg + let cmd = null + if (options.cmd) { + cmd = options.cmd + } else if (pkg.scripts && pkg.scripts[event]) { + cmd = pkg.scripts[event] + } else if ( + // If there is no preinstall or install script, default to rebuilding node-gyp packages. + event === 'install' && + !scripts.install && + !scripts.preinstall && + gypfile !== false && + await isNodeGypPackage(path) + ) { + cmd = defaultGypInstallScript + } else if (event === 'start' && await isServerPackage(path)) { + cmd = 'node server.js' + } + + if (!cmd) { + return { code: 0, signal: null } + } + + let inputEnd = () => {} + if (stdio === 'inherit') { + let banner + if (pkg._id) { + banner = `\n> ${pkg._id} ${event}\n` + } else { + banner = `\n> ${event}\n` + } + banner += `> ${cmd.trim().replace(/\n/g, '\n> ')}` + if (args.length) { + banner += ` ${args.join(' ')}` + } + banner += '\n' + const { output, input } = require('proc-log') + output.standard(banner) + inputEnd = input.start() + } + + const [spawnShell, spawnArgs, spawnOpts] = makeSpawnArgs({ + args, + binPaths, + cmd, + env: { ...env, ...packageEnvs(pkg) }, + event, + nodeGyp, + path, + scriptShell, + stdio, + stdioString, + }) + + const p = promiseSpawn(spawnShell, spawnArgs, spawnOpts, { + event, + script: cmd, + pkgid: pkg._id, + path, + }) + + if (stdio === 'inherit') { + signalManager.add(p.process) + } + + if (p.stdin) { + p.stdin.end() + } + + return p.catch(er => { + const { signal } = er + // coverage disabled because win32 never emits signals + /* istanbul ignore next */ + if (stdio === 'inherit' && signal) { + // by the time we reach here, the child has already exited. we send the + // signal back to ourselves again so that npm will exit with the same + // status as the child + process.kill(process.pid, signal) + + // just in case we don't die, reject after 500ms + // this also keeps the node process open long enough to actually + // get the signal, rather than terminating gracefully. + return new Promise((res, rej) => setTimeout(() => rej(er), signalTimeout)) + } else { + throw er + } + }).finally(inputEnd) +} + +module.exports = runScriptPkg diff --git a/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script.js b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script.js new file mode 100644 index 0000000000000000000000000000000000000000..8469d2b3931d266285b074510ba33d6d59abdc7f --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script.js @@ -0,0 +1,15 @@ +const PackageJson = require('@npmcli/package-json') +const runScriptPkg = require('./run-script-pkg.js') +const validateOptions = require('./validate-options.js') +const isServerPackage = require('./is-server-package.js') + +const runScript = async options => { + validateOptions(options) + if (options.pkg) { + return runScriptPkg(options) + } + const { content: pkg } = await PackageJson.normalize(options.path) + return runScriptPkg({ ...options, pkg }) +} + +module.exports = Object.assign(runScript, { isServerPackage }) diff --git a/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/set-path.js b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/set-path.js new file mode 100644 index 0000000000000000000000000000000000000000..8f913d3b797c4decd03a1893ac23cdd15ff29f3c --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/set-path.js @@ -0,0 +1,53 @@ +const { log } = require('proc-log') +const { resolve, dirname, delimiter } = require('path') +// the path here is relative, even though it does not need to be +// in order to make the posix tests pass in windows +const nodeGypPath = resolve(__dirname, '../lib/node-gyp-bin') + +// Windows typically calls its PATH environ 'Path', but this is not +// guaranteed, nor is it guaranteed to be the only one. Merge them +// all together in the order they appear in the object. +const setPATH = (projectPath, binPaths, env) => { + const PATH = Object.keys(env).filter(p => /^path$/i.test(p) && env[p]) + .map(p => env[p].split(delimiter)) + .reduce((set, p) => set.concat(p.filter(concatted => !set.includes(concatted))), []) + .join(delimiter) + + const pathArr = [] + if (binPaths) { + for (const bin of binPaths) { + if (bin.includes(delimiter)) { + const event = env.npm_lifecycle_event + const context = event ? `"${event}" script` : 'script execution' + log.warn('run-script', `Path contains delimiter ("${delimiter}"), ${context} may not behave as expected.`) + } + } + pathArr.push(...binPaths) + } + // unshift the ./node_modules/.bin from every folder + // walk up until dirname() does nothing, at the root + // XXX we should specify a cwd that we don't go above + let p = projectPath + let pp + do { + pathArr.push(resolve(p, 'node_modules', '.bin')) + pp = p + p = dirname(p) + } while (p !== pp) + pathArr.push(nodeGypPath, PATH) + + const pathVal = pathArr.join(delimiter) + + // XXX include the node-gyp-bin path somehow? Probably better for + // npm or arborist or whoever to just provide that by putting it in + // the PATH environ, since that's preserved anyway. + for (const key of Object.keys(env)) { + if (/^path$/i.test(key)) { + env[key] = pathVal + } + } + + return env +} + +module.exports = setPATH diff --git a/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/signal-manager.js b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/signal-manager.js new file mode 100644 index 0000000000000000000000000000000000000000..baef659dfa4d3373d8e4175c4ea0d3c9a58852ff --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/signal-manager.js @@ -0,0 +1,50 @@ +const runningProcs = new Set() +let handlersInstalled = false + +const forwardedSignals = [ + 'SIGINT', + 'SIGTERM', +] + +// no-op, this is so receiving the signal doesn't cause us to exit immediately +// instead, we exit after all children have exited when we re-send the signal +// to ourselves. see the catch handler at the bottom of run-script-pkg.js +const handleSignal = signal => { + for (const proc of runningProcs) { + proc.kill(signal) + } +} + +const setupListeners = () => { + for (const signal of forwardedSignals) { + process.on(signal, handleSignal) + } + handlersInstalled = true +} + +const cleanupListeners = () => { + if (runningProcs.size === 0) { + for (const signal of forwardedSignals) { + process.removeListener(signal, handleSignal) + } + handlersInstalled = false + } +} + +const add = proc => { + runningProcs.add(proc) + if (!handlersInstalled) { + setupListeners() + } + + proc.once('exit', () => { + runningProcs.delete(proc) + cleanupListeners() + }) +} + +module.exports = { + add, + handleSignal, + forwardedSignals, +} diff --git a/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/validate-options.js b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/validate-options.js new file mode 100644 index 0000000000000000000000000000000000000000..02fe36c7ffc12b013c65570fb2574fe51e1b8630 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/run-script/lib/validate-options.js @@ -0,0 +1,39 @@ +const validateOptions = options => { + if (typeof options !== 'object' || !options) { + throw new TypeError('invalid options object provided to runScript') + } + + const { + event, + path, + scriptShell, + env = {}, + stdio = 'pipe', + args = [], + cmd, + } = options + + if (!event || typeof event !== 'string') { + throw new TypeError('valid event not provided to runScript') + } + if (!path || typeof path !== 'string') { + throw new TypeError('valid path not provided to runScript') + } + if (scriptShell !== undefined && typeof scriptShell !== 'string') { + throw new TypeError('invalid scriptShell option provided to runScript') + } + if (typeof env !== 'object' || !env) { + throw new TypeError('invalid env option provided to runScript') + } + if (typeof stdio !== 'string' && !Array.isArray(stdio)) { + throw new TypeError('invalid stdio option provided to runScript') + } + if (!Array.isArray(args) || args.some(a => typeof a !== 'string')) { + throw new TypeError('invalid args option provided to runScript') + } + if (cmd !== undefined && typeof cmd !== 'string') { + throw new TypeError('invalid cmd option provided to runScript') + } +} + +module.exports = validateOptions diff --git a/node24/node_modules/npm/node_modules/@npmcli/run-script/package.json b/node24/node_modules/npm/node_modules/@npmcli/run-script/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2d62a38217d67cc1b243bf06c46ec835814f1ec4 --- /dev/null +++ b/node24/node_modules/npm/node_modules/@npmcli/run-script/package.json @@ -0,0 +1,53 @@ +{ + "name": "@npmcli/run-script", + "version": "10.0.4", + "description": "Run a lifecycle script for a package (descendant of npm-lifecycle)", + "author": "GitHub Inc.", + "license": "ISC", + "scripts": { + "test": "tap", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", + "lint": "npm run eslint", + "lintfix": "npm run eslint -- --fix", + "postlint": "template-oss-check", + "snap": "tap", + "posttest": "npm run lint", + "template-oss-apply": "template-oss-apply --force" + }, + "devDependencies": { + "@npmcli/eslint-config": "^6.0.0", + "@npmcli/template-oss": "4.29.0", + "spawk": "^1.8.1", + "tap": "^16.0.1" + }, + "dependencies": { + "@npmcli/node-gyp": "^5.0.0", + "@npmcli/package-json": "^7.0.0", + "@npmcli/promise-spawn": "^9.0.0", + "node-gyp": "^12.1.0", + "proc-log": "^6.0.0" + }, + "files": [ + "bin/", + "lib/" + ], + "main": "lib/run-script.js", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/run-script.git" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.29.0", + "publish": "true" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +}