diff --git a/.eslintignore b/.eslintignore index 5941496e1a6280..153ac6e24f731e 100644 --- a/.eslintignore +++ b/.eslintignore @@ -6,6 +6,7 @@ test/message/esm_display_syntax_error.mjs tools/icu tools/lint-md/lint-md.mjs benchmark/tmp +benchmark/fixtures doc/**/*.js !doc/api_assets/*.js !.eslintrc.js diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6d69bbf54be1d6..acacee156126af 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -107,7 +107,8 @@ /benchmark/misc/startup.js @nodejs/startup /src/node.cc @nodejs/startup -/src/node_native_module* @nodejs/startup +/src/node_builtins* @nodejs/startup +/src/node_snapshot* @nodejs/startup /lib/internal/bootstrap/* @nodejs/startup /tools/snapshot/* @nodejs/startup diff --git a/.github/ISSUE_TEMPLATE/1-bug-report.yml b/.github/ISSUE_TEMPLATE/1-bug-report.yml index 3edac8d807d905..c40644bfc6d9ba 100644 --- a/.github/ISSUE_TEMPLATE/1-bug-report.yml +++ b/.github/ISSUE_TEMPLATE/1-bug-report.yml @@ -19,7 +19,7 @@ body: label: Platform description: | UNIX: output of `uname -a` - Windows: output of `"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })"` in PowerShell console + Windows: output of `"$([Environment]::OSVersion.VersionString) $(('x86', 'x64')[[Environment]::Is64BitOperatingSystem])"` in PowerShell console - type: input attributes: label: Subsystem diff --git a/.github/workflows/label-flaky-test-issue.yml b/.github/workflows/label-flaky-test-issue.yml new file mode 100644 index 00000000000000..490d0826fb53aa --- /dev/null +++ b/.github/workflows/label-flaky-test-issue.yml @@ -0,0 +1,50 @@ +name: Label Flaky Test Issues + +on: + issues: + types: [opened, labeled] + +jobs: + label: + if: github.event.label.name == 'flaky-test' + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Extract labels + id: extract-labels + env: + BODY: ${{ github.event.issue.body }} + run: | + BODY="${BODY//$'\n'/'\n'}" + + declare -A platform2label + + platform2label["AIX"]="aix"; + platform2label["FreeBSD"]="freebsd"; + platform2label["Linux ARM64"]="linux"; + platform2label["Linux ARMv7"]="arm"; + platform2label["Linux PPC64LE"]="ppc"; + platform2label["Linux s390x"]="s390"; + platform2label["Linux x64"]="linux"; + platform2label["macOS ARM64"]="macos"; + platform2label["macOS x64"]="macos"; + platform2label["SmartOS"]="smartos"; + platform2label["Windows"]="windows"; + + # sed is cleaning up the edges + PLATFORMS=$(echo $BODY | sed 's/^.*Platform\\n\\n//' | sed 's/\(, Other\)\?\\n\\n.*$//') 2> /dev/null + readarray -d , -t list <<< "$PLATFORMS" + labels= + for row in "${list[@]}"; do \ + platform=$(echo $row | xargs); \ + labels="${labels}${platform2label[$platform]},"; \ + done; + + echo "::set-output name=LABELS::${labels::-1}" + + - name: Add labels + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NUMBER: ${{ github.event.issue.number }} + run: gh issue edit "$NUMBER" --repo ${{ github.repository }} --add-label "${{ steps.extract-labels.outputs.LABELS }}" diff --git a/.github/workflows/test-internet.yml b/.github/workflows/test-internet.yml index 4fcb18a14f5ce9..1e968652896f1e 100644 --- a/.github/workflows/test-internet.yml +++ b/.github/workflows/test-internet.yml @@ -29,6 +29,7 @@ permissions: jobs: test-internet: + if: github.repository == 'nodejs/node' || github.event_name != 'schedule' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.mailmap b/.mailmap index f922b76746784f..d17efa8d5beaa7 100644 --- a/.mailmap +++ b/.mailmap @@ -287,6 +287,8 @@ Ke Ding Keith M Wesolowski Kelsey Breseman Kevin Millikin +Keyhan Vakil <60900335+airtable-keyhanvakil@users.noreply.github.com> +Keyhan Vakil Khaidi Chu Khaidi Chu Kimberly Wilber @@ -429,6 +431,8 @@ Ron Korving Ruben Bridgewater Ruben Bridgewater Russell Dempsey +Ruy Adorno +Ruy Adorno Ryan Dahl Ryan Emery Ryan Mahan diff --git a/AUTHORS b/AUTHORS index f792f6357fe1a4..23129898649f10 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1048,7 +1048,7 @@ Joran Siu Vitaly Tomilov Ratikesh Misra Alex Perkins -Beth Griggs +Beth Griggs Joe Esposito Erin Spiceland Ravindra Barthwal @@ -1784,7 +1784,7 @@ Christopher Sidebottom Edward Andrew Robinson Shakeel Mohamed Tobias Kieslich -Ruy Adorno +Ruy Adorno Stefania Sharp Pawel Golda Steven Scott @@ -3457,7 +3457,7 @@ Yagiz Nizipli liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com> Sergey Nazaryev William Marlow -Keyhan Vakil <60900335+airtable-keyhanvakil@users.noreply.github.com> +Keyhan Vakil Feng Yu pupilTong rikapo @@ -3490,5 +3490,22 @@ John Gee Hrishikesh Kadam KrayzeeKev Airing +jiahao.si +Rhys +Mark S. Miller +Jianru Lin +Lenvin Gonsalves <41874033+98lenvi@users.noreply.github.com> +Andreu Botella +shhh7612 <82669765+shhh7612@users.noreply.github.com> +Dominic Saadi +ywave620 <60539365+ywave620@users.noreply.github.com> +NicoNekoru <66227158+NicoNekoru@users.noreply.github.com> +SADIK KUZU +flakey5 <73616808+flakey5@users.noreply.github.com> +Saurabh Daware +BuShe +Nick Sia <31839263+nicksia-vgw@users.noreply.github.com> +Basit Chonka +Jeremiah Gowdy # Generated by tools/update-authors.mjs diff --git a/BUILDING.md b/BUILDING.md index c16f6ffde07d3f..47e2a71772f212 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -37,7 +37,7 @@ file a new issue. * [Option 1: Manual install](#option-1-manual-install) * [Option 2: Automated install with Boxstarter](#option-2-automated-install-with-boxstarter) * [Building Node.js](#building-nodejs-2) - * [Android/Android-based devices (e.g. Firefox OS)](#androidandroid-based-devices-eg-firefox-os) + * [Android](#android) * [`Intl` (ECMA-402) support](#intl-ecma-402-support) * [Build with full ICU support (all locales supported by ICU)](#build-with-full-icu-support-all-locales-supported-by-icu) * [Unix/macOS](#unixmacos) @@ -647,7 +647,7 @@ To test if Node.js was built correctly: > Release\node -e "console.log('Hello from Node.js', process.version)" ``` -### Android/Android-based devices (e.g. Firefox OS) +### Android Android is not a supported platform. Patches to improve the Android build are welcome. There is no testing on Android in the current continuous integration @@ -655,14 +655,17 @@ environment. The participation of people dedicated and determined to improve Android building, testing, and support is encouraged. Be sure you have downloaded and extracted -[Android NDK](https://developer.android.com/tools/sdk/ndk/index.html) before in +[Android NDK](https://developer.android.com/ndk) before in a folder. Then run: ```console -$ ./android-configure /path/to/your/android-ndk -$ make +$ source ./android-configure /path/to/your/android-ndk target_arch android_sdk_version +$ make -j4 ``` +The Android SDK version should be at least 24 (Android 7.0) and the target +architecture supports \[arm, arm64/aarch64, x86, x86\_64]. + ## `Intl` (ECMA-402) support [Intl](https://github.com/nodejs/node/blob/HEAD/doc/api/intl.md) support is diff --git a/CHANGELOG.md b/CHANGELOG.md index fc3487ce620ffb..301c850ffae68f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,7 +35,8 @@ release. -18.7.0
+18.8.0
+18.7.0
18.6.0
18.5.0
18.4.0
diff --git a/README.md b/README.md index 5b6347020b9696..1f3663be3ead30 100644 --- a/README.md +++ b/README.md @@ -310,6 +310,8 @@ For information about the governance of the Node.js project, see **Daniele Belardi** <> (he/him) * [edsadr](https://github.com/edsadr) - **Adrian Estrada** <> (he/him) +* [erickwendel](https://github.com/erickwendel) - + **Erick Wendel** <> (he/him) * [evanlucas](https://github.com/evanlucas) - **Evan Lucas** <> (he/him) * [fhinkel](https://github.com/fhinkel) - @@ -380,6 +382,8 @@ For information about the governance of the Node.js project, see **Milad Fa** <> (he/him) * [mildsunrise](https://github.com/mildsunrise) - **Alba Mendez** <> (she/her) +* [MoLow](https://github.com/MoLow) - + **Moshe Atlow** <> (he/him) * [mscdex](https://github.com/mscdex) - **Brian White** <> * [MylesBorins](https://github.com/MylesBorins) - @@ -405,7 +409,7 @@ For information about the governance of the Node.js project, see * [ronag](https://github.com/ronag) - **Robert Nagy** <> * [ruyadorno](https://github.com/ruyadorno) - - **Ruy Adorno** <> (he/him) + **Ruy Adorno** <> (he/him) * [rvagg](https://github.com/rvagg) - **Rod Vagg** <> * [ryzokuken](https://github.com/ryzokuken) - @@ -424,6 +428,8 @@ For information about the governance of the Node.js project, see **Stewart X Addison** <> (he/him) * [targos](https://github.com/targos) - **Michaël Zasso** <> (he/him) +* [theanarkh](https://github.com/theanarkh) - + **theanarkh** <> (he/him) * [TimothyGu](https://github.com/TimothyGu) - **Tiancheng "Timothy" Gu** <> (he/him) * [tniessen](https://github.com/tniessen) - @@ -658,6 +664,8 @@ maintaining the Node.js project. **Himadri Ganguly** <> (he/him) * [iam-frankqiu](https://github.com/iam-frankqiu) - **Frank Qiu** <> (he/him) +* [kvakil](https://github.com/kvakil) - + **Keyhan Vakil** <> (they/them) * [marsonya](https://github.com/marsonya) - **Akhil Marsonya** <> (he/him) * [meixg](https://github.com/meixg) - diff --git a/android-configure b/android-configure index 43341d1abea765..6200f35200c774 100755 --- a/android-configure +++ b/android-configure @@ -17,16 +17,14 @@ NDK_PATH=$1 ARCH="$2" ANDROID_SDK_VERSION=$3 -if [ $ANDROID_SDK_VERSION -lt 23 ]; then - echo "$ANDROID_SDK_VERSION should equal or later than 23(Android 6.0)" +if [ $ANDROID_SDK_VERSION -lt 24 ]; then + echo "$ANDROID_SDK_VERSION should equal or later than 24 (Android 7.0)" fi -CC_VER="4.9" - case $ARCH in arm) DEST_CPU="arm" - TOOLCHAIN_NAME="armv7-linux-androideabi" + TOOLCHAIN_NAME="armv7a-linux-androideabi" ;; x86) DEST_CPU="ia32" diff --git a/benchmark/es/error-stack.js b/benchmark/es/error-stack.js new file mode 100644 index 00000000000000..907f308ea41558 --- /dev/null +++ b/benchmark/es/error-stack.js @@ -0,0 +1,34 @@ +'use strict'; + +const common = require('../common.js'); +const modPath = require.resolve('../fixtures/simple-error-stack.js'); + +const bench = common.createBenchmark(main, { + method: ['without-sourcemap', 'sourcemap'], + n: [1e5], +}); + +function runN(n) { + delete require.cache[modPath]; + const mod = require(modPath); + bench.start(); + for (let i = 0; i < n; i++) { + mod.simpleErrorStack(); + } + bench.end(n); +} + +function main({ n, method }) { + switch (method) { + case 'without-sourcemap': + process.setSourceMapsEnabled(false); + runN(n); + break; + case 'sourcemap': + process.setSourceMapsEnabled(true); + runN(n); + break; + default: + throw new Error(`Unexpected method "${method}"`); + } +} diff --git a/benchmark/fixtures/simple-error-stack.js b/benchmark/fixtures/simple-error-stack.js new file mode 100644 index 00000000000000..0057807795b072 --- /dev/null +++ b/benchmark/fixtures/simple-error-stack.js @@ -0,0 +1,15 @@ +'use strict'; +exports.__esModule = true; +exports.simpleErrorStack = void 0; +// Compile with `tsc --inlineSourceMap benchmark/fixtures/simple-error-stack.ts`. +var lorem = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'; +function simpleErrorStack() { + try { + lorem.BANG(); + } + catch (e) { + return e.stack; + } +} +exports.simpleErrorStack = simpleErrorStack; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2ltcGxlLWVycm9yLXN0YWNrLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2ltcGxlLWVycm9yLXN0YWNrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFlBQVksQ0FBQzs7O0FBRWIsaUZBQWlGO0FBRWpGLElBQU0sS0FBSyxHQUFHLCtiQUErYixDQUFDO0FBRTljLFNBQVMsZ0JBQWdCO0lBQ3ZCLElBQUk7UUFDRCxLQUFhLENBQUMsSUFBSSxFQUFFLENBQUM7S0FDdkI7SUFBQyxPQUFPLENBQUMsRUFBRTtRQUNWLE9BQU8sQ0FBQyxDQUFDLEtBQUssQ0FBQztLQUNoQjtBQUNILENBQUM7QUFHQyw0Q0FBZ0IifQ== diff --git a/benchmark/fixtures/simple-error-stack.ts b/benchmark/fixtures/simple-error-stack.ts new file mode 100644 index 00000000000000..58034e92f24b98 --- /dev/null +++ b/benchmark/fixtures/simple-error-stack.ts @@ -0,0 +1,17 @@ +'use strict'; + +// Compile with `tsc --inlineSourceMap benchmark/fixtures/simple-error-stack.ts`. + +const lorem = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'; + +function simpleErrorStack() { + try { + (lorem as any).BANG(); + } catch (e) { + return e.stack; + } +} + +export { + simpleErrorStack, +}; diff --git a/common.gypi b/common.gypi index 851816e084565d..3e84350395dfe4 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.9', + 'v8_embedder_string': '-node.11', ##### V8 defaults for Node.js ##### diff --git a/configure.py b/configure.py index e53a83f332ffd6..e105d4e0cca4f6 100755 --- a/configure.py +++ b/configure.py @@ -1237,6 +1237,10 @@ def configure_node(o): o['variables']['want_separate_host_toolset'] = int(cross_compiling) + # Enable branch protection for arm64 + if target_arch == 'arm64': + o['cflags']+=['-msign-return-address=all'] + if options.node_snapshot_main is not None: if options.shared: # This should be possible to fix, but we will need to refactor the diff --git a/deps/base64/base64/lib/arch/neon64/codec.c b/deps/base64/base64/lib/arch/neon64/codec.c index fc953b23e7f9b2..79789bb7d0ecbc 100644 --- a/deps/base64/base64/lib/arch/neon64/codec.c +++ b/deps/base64/base64/lib/arch/neon64/codec.c @@ -58,8 +58,13 @@ load_64byte_table (const uint8_t *p) #include "../generic/32/dec_loop.c" #include "../generic/64/enc_loop.c" #include "dec_loop.c" -#include "enc_reshuffle.c" -#include "enc_loop.c" + +#ifdef BASE64_NEON64_USE_ASM +# include "enc_loop_asm.c" +#else +# include "enc_reshuffle.c" +# include "enc_loop.c" +#endif #endif // BASE64_USE_NEON64 diff --git a/deps/base64/base64/lib/arch/neon64/enc_loop.c b/deps/base64/base64/lib/arch/neon64/enc_loop.c index d1862f7a3aadf2..59a1c59728a139 100644 --- a/deps/base64/base64/lib/arch/neon64/enc_loop.c +++ b/deps/base64/base64/lib/arch/neon64/enc_loop.c @@ -1,72 +1,6 @@ -#ifdef BASE64_NEON64_USE_ASM -static inline void -enc_loop_neon64_inner_asm (const uint8_t **s, uint8_t **o, const uint8x16x4_t tbl_enc) -{ - // This function duplicates the functionality of enc_loop_neon64_inner, - // but entirely with inline assembly. This gives a significant speedup - // over using NEON intrinsics, which do not always generate very good - // code. The logic of the assembly is directly lifted from the - // intrinsics version, so it can be used as a guide to this code. - - // Temporary registers, used as scratch space. - uint8x16_t tmp0, tmp1, tmp2, tmp3; - - // Numeric constant. - const uint8x16_t n63 = vdupq_n_u8(63); - - __asm__ ( - - // Load 48 bytes and deinterleave. The bytes are loaded to - // hard-coded registers v12, v13 and v14, to ensure that they - // are contiguous. Increment the source pointer. - "ld3 {v12.16b, v13.16b, v14.16b}, [%[src]], #48 \n\t" - - // Reshuffle the bytes using temporaries. - "ushr %[t0].16b, v12.16b, #2 \n\t" - "ushr %[t1].16b, v13.16b, #4 \n\t" - "ushr %[t2].16b, v14.16b, #6 \n\t" - "sli %[t1].16b, v12.16b, #4 \n\t" - "sli %[t2].16b, v13.16b, #2 \n\t" - "and %[t1].16b, %[t1].16b, %[n63].16b \n\t" - "and %[t2].16b, %[t2].16b, %[n63].16b \n\t" - "and %[t3].16b, v14.16b, %[n63].16b \n\t" - - // Translate the values to the Base64 alphabet. - "tbl v12.16b, {%[l0].16b, %[l1].16b, %[l2].16b, %[l3].16b}, %[t0].16b \n\t" - "tbl v13.16b, {%[l0].16b, %[l1].16b, %[l2].16b, %[l3].16b}, %[t1].16b \n\t" - "tbl v14.16b, {%[l0].16b, %[l1].16b, %[l2].16b, %[l3].16b}, %[t2].16b \n\t" - "tbl v15.16b, {%[l0].16b, %[l1].16b, %[l2].16b, %[l3].16b}, %[t3].16b \n\t" - - // Store 64 bytes and interleave. Increment the dest pointer. - "st4 {v12.16b, v13.16b, v14.16b, v15.16b}, [%[dst]], #64 \n\t" - - // Outputs (modified). - : [src] "+r" (*s), - [dst] "+r" (*o), - [t0] "=&w" (tmp0), - [t1] "=&w" (tmp1), - [t2] "=&w" (tmp2), - [t3] "=&w" (tmp3) - - // Inputs (not modified). - : [n63] "w" (n63), - [l0] "w" (tbl_enc.val[0]), - [l1] "w" (tbl_enc.val[1]), - [l2] "w" (tbl_enc.val[2]), - [l3] "w" (tbl_enc.val[3]) - - // Clobbers. - : "v12", "v13", "v14", "v15" - ); -} -#endif - static inline void enc_loop_neon64_inner (const uint8_t **s, uint8_t **o, const uint8x16x4_t tbl_enc) { -#ifdef BASE64_NEON64_USE_ASM - enc_loop_neon64_inner_asm(s, o, tbl_enc); -#else // Load 48 bytes and deinterleave: uint8x16x3_t src = vld3q_u8(*s); @@ -86,7 +20,6 @@ enc_loop_neon64_inner (const uint8_t **s, uint8_t **o, const uint8x16x4_t tbl_en *s += 48; *o += 64; -#endif } static inline void diff --git a/deps/base64/base64/lib/arch/neon64/enc_loop_asm.c b/deps/base64/base64/lib/arch/neon64/enc_loop_asm.c new file mode 100644 index 00000000000000..cf2fd27e80d2ca --- /dev/null +++ b/deps/base64/base64/lib/arch/neon64/enc_loop_asm.c @@ -0,0 +1,167 @@ +// Apologies in advance for combining the preprocessor with inline assembly, +// two notoriously gnarly parts of C, but it was necessary to avoid a lot of +// code repetition. The preprocessor is used to template large sections of +// inline assembly that differ only in the registers used. If the code was +// written out by hand, it would become very large and hard to audit. + +// Generate a block of inline assembly that loads three user-defined registers +// A, B, C from memory and deinterleaves them, post-incrementing the src +// pointer. The register set should be sequential. +#define LOAD(A, B, C) \ + "ld3 {"A".16b, "B".16b, "C".16b}, [%[src]], #48 \n\t" + +// Generate a block of inline assembly that takes three deinterleaved registers +// and shuffles the bytes. The output is in temporary registers t0..t3. +#define SHUF(A, B, C) \ + "ushr %[t0].16b, "A".16b, #2 \n\t" \ + "ushr %[t1].16b, "B".16b, #4 \n\t" \ + "ushr %[t2].16b, "C".16b, #6 \n\t" \ + "sli %[t1].16b, "A".16b, #4 \n\t" \ + "sli %[t2].16b, "B".16b, #2 \n\t" \ + "and %[t1].16b, %[t1].16b, %[n63].16b \n\t" \ + "and %[t2].16b, %[t2].16b, %[n63].16b \n\t" \ + "and %[t3].16b, "C".16b, %[n63].16b \n\t" + +// Generate a block of inline assembly that takes temporary registers t0..t3 +// and translates them to the base64 alphabet, using a table loaded into +// v8..v11. The output is in user-defined registers A..D. +#define TRAN(A, B, C, D) \ + "tbl "A".16b, {v8.16b-v11.16b}, %[t0].16b \n\t" \ + "tbl "B".16b, {v8.16b-v11.16b}, %[t1].16b \n\t" \ + "tbl "C".16b, {v8.16b-v11.16b}, %[t2].16b \n\t" \ + "tbl "D".16b, {v8.16b-v11.16b}, %[t3].16b \n\t" + +// Generate a block of inline assembly that interleaves four registers and +// stores them, post-incrementing the destination pointer. +#define STOR(A, B, C, D) \ + "st4 {"A".16b, "B".16b, "C".16b, "D".16b}, [%[dst]], #64 \n\t" + +// Generate a block of inline assembly that generates a single self-contained +// encoder round: fetch the data, process it, and store the result. +#define ROUND() \ + LOAD("v12", "v13", "v14") \ + SHUF("v12", "v13", "v14") \ + TRAN("v12", "v13", "v14", "v15") \ + STOR("v12", "v13", "v14", "v15") + +// Generate a block of assembly that generates a type A interleaved encoder +// round. It uses registers that were loaded by the previous type B round, and +// in turn loads registers for the next type B round. +#define ROUND_A() \ + SHUF("v2", "v3", "v4") \ + LOAD("v12", "v13", "v14") \ + TRAN("v2", "v3", "v4", "v5") \ + STOR("v2", "v3", "v4", "v5") + +// Type B interleaved encoder round. Same as type A, but register sets swapped. +#define ROUND_B() \ + SHUF("v12", "v13", "v14") \ + LOAD("v2", "v3", "v4") \ + TRAN("v12", "v13", "v14", "v15") \ + STOR("v12", "v13", "v14", "v15") + +// The first type A round needs to load its own registers. +#define ROUND_A_FIRST() \ + LOAD("v2", "v3", "v4") \ + ROUND_A() + +// The last type B round omits the load for the next step. +#define ROUND_B_LAST() \ + SHUF("v12", "v13", "v14") \ + TRAN("v12", "v13", "v14", "v15") \ + STOR("v12", "v13", "v14", "v15") + +// Suppress clang's warning that the literal string in the asm statement is +// overlong (longer than the ISO-mandated minimum size of 4095 bytes for C99 +// compilers). It may be true, but the goal here is not C99 portability. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Woverlength-strings" + +static inline void +enc_loop_neon64 (const uint8_t **s, size_t *slen, uint8_t **o, size_t *olen) +{ + size_t rounds = *slen / 48; + + if (rounds == 0) { + return; + } + + *slen -= rounds * 48; // 48 bytes consumed per round. + *olen += rounds * 64; // 64 bytes produced per round. + + // Number of times to go through the 8x loop. + size_t loops = rounds / 8; + + // Number of rounds remaining after the 8x loop. + rounds %= 8; + + // Temporary registers, used as scratch space. + uint8x16_t tmp0, tmp1, tmp2, tmp3; + + __asm__ volatile ( + + // Load the encoding table into v8..v11. + " ld1 {v8.16b-v11.16b}, [%[tbl]] \n\t" + + // If there are eight rounds or more, enter an 8x unrolled loop + // of interleaved encoding rounds. The rounds interleave memory + // operations (load/store) with data operations to maximize + // pipeline throughput. + " cbz %[loops], 4f \n\t" + + // The SIMD instructions do not touch the flags. + "88: subs %[loops], %[loops], #1 \n\t" + " " ROUND_A_FIRST() + " " ROUND_B() + " " ROUND_A() + " " ROUND_B() + " " ROUND_A() + " " ROUND_B() + " " ROUND_A() + " " ROUND_B_LAST() + " b.ne 88b \n\t" + + // Enter a 4x unrolled loop for rounds of 4 or more. + "4: cmp %[rounds], #4 \n\t" + " b.lt 30f \n\t" + " " ROUND_A_FIRST() + " " ROUND_B() + " " ROUND_A() + " " ROUND_B_LAST() + " sub %[rounds], %[rounds], #4 \n\t" + + // Dispatch the remaining rounds 0..3. + "30: cbz %[rounds], 0f \n\t" + " cmp %[rounds], #2 \n\t" + " b.eq 2f \n\t" + " b.lt 1f \n\t" + + // Block of non-interlaced encoding rounds, which can each + // individually be jumped to. Rounds fall through to the next. + "3: " ROUND() + "2: " ROUND() + "1: " ROUND() + "0: \n\t" + + // Outputs (modified). + : [loops] "+r" (loops), + [src] "+r" (*s), + [dst] "+r" (*o), + [t0] "=&w" (tmp0), + [t1] "=&w" (tmp1), + [t2] "=&w" (tmp2), + [t3] "=&w" (tmp3) + + // Inputs (not modified). + : [rounds] "r" (rounds), + [tbl] "r" (base64_table_enc_6bit), + [n63] "w" (vdupq_n_u8(63)) + + // Clobbers. + : "v2", "v3", "v4", "v5", + "v8", "v9", "v10", "v11", + "v12", "v13", "v14", "v15" + ); +} + +#pragma GCC diagnostic pop diff --git a/deps/corepack/CHANGELOG.md b/deps/corepack/CHANGELOG.md index 56b4367692fa70..404ccfae8368b3 100644 --- a/deps/corepack/CHANGELOG.md +++ b/deps/corepack/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [0.12.3](https://github.com/nodejs/corepack/compare/v0.12.2...v0.12.3) (2022-08-12) + + +### Features + +* update package manager versions ([#160](https://github.com/nodejs/corepack/issues/160)) ([ad092a7](https://github.com/nodejs/corepack/commit/ad092a7fb4296143fa5224c04dbd628451b3c158)) + +## [0.12.2](https://github.com/nodejs/corepack/compare/v0.12.1...v0.12.2) (2022-08-05) + +### Features + +* update package manager versions ([#154](https://github.com/nodejs/corepack/issues/154)) ([4b95fd3](https://github.com/nodejs/corepack/commit/4b95fd3b926659855970a887c893c10db0b98e5d)) + ## [0.12.1](https://github.com/nodejs/corepack/compare/v0.12.0...v0.12.1) (2022-07-21) diff --git a/deps/corepack/dist/corepack.js b/deps/corepack/dist/corepack.js index c7dbc6fa9f1a9c..4a0e0fe07df256 100755 --- a/deps/corepack/dist/corepack.js +++ b/deps/corepack/dist/corepack.js @@ -16953,7 +16953,7 @@ const supportsColor = { /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"definitions":{"npm":{"default":"8.15.0+sha1.d4b53cd29b13ea164f0f5767bca274dbe7d8f78d","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"}}}},"pnpm":{"default":"7.5.2+sha1.89331cc7dc542e0d7a33fe4f423989f0c54e9604","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"}},">=6.0.0":{"url":"https://registry.npmjs.org/pnpm/-/pnpm-{}.tgz","bin":{"pnpm":"./bin/pnpm.cjs","pnpx":"./bin/pnpx.cjs"},"registry":{"type":"npm","package":"pnpm"}}}},"yarn":{"default":"1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447","transparent":{"default":"3.2.2+sha224.634d0331703700cabfa9d9389835bd8f7426b0207ed6b74d8d34c81e","commands":[["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"}},">=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":"latest","versions":"tags"}}}}}}}'); +module.exports = JSON.parse('{"definitions":{"npm":{"default":"8.17.0+sha1.05c77fb2794daa3d9b2cd0460859f1f9dc596676","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"}}}},"pnpm":{"default":"7.9.0+sha1.4226ed225337fd55f9ff7736b67048dffe1d7b16","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"}},">=6.0.0":{"url":"https://registry.npmjs.org/pnpm/-/pnpm-{}.tgz","bin":{"pnpm":"./bin/pnpm.cjs","pnpx":"./bin/pnpx.cjs"},"registry":{"type":"npm","package":"pnpm"}}}},"yarn":{"default":"1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447","transparent":{"default":"3.2.2+sha224.634d0331703700cabfa9d9389835bd8f7426b0207ed6b74d8d34c81e","commands":[["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"}},">=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":"latest","versions":"tags"}}}}}}}'); /***/ }), @@ -16964,7 +16964,7 @@ module.exports = JSON.parse('{"definitions":{"npm":{"default":"8.15.0+sha1.d4b53 /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"name":"corepack","version":"0.12.1","homepage":"https://github.com/nodejs/corepack#readme","bugs":{"url":"https://github.com/nodejs/corepack/issues"},"repository":{"type":"git","url":"https://github.com/nodejs/corepack.git"},"license":"MIT","packageManager":"yarn@4.0.0-rc.14+sha224.d3bee29dce07417588d640327d44f1e0b8182c240bc2beb0b81ccf6e","devDependencies":{"@babel/core":"^7.14.3","@babel/plugin-transform-modules-commonjs":"^7.14.0","@babel/preset-typescript":"^7.13.0","@types/debug":"^4.1.5","@types/jest":"^28.0.0","@types/node":"^18.0.0","@types/semver":"^7.1.0","@types/tar":"^6.0.0","@types/which":"^2.0.0","@typescript-eslint/eslint-plugin":"^5.0.0","@typescript-eslint/parser":"^5.0.0","@yarnpkg/eslint-config":"^1.0.0-rc.5","@yarnpkg/fslib":"^2.1.0","@zkochan/cmd-shim":"^5.0.0","babel-plugin-dynamic-import-node":"^2.3.3","clipanion":"^3.0.1","debug":"^4.1.1","eslint":"^8.0.0","eslint-plugin-arca":"^0.15.0","jest":"^28.0.0","nock":"^13.0.4","proxy-agent":"^5.0.0","semver":"^7.1.3","supports-color":"^9.0.0","tar":"^6.0.1","terser-webpack-plugin":"^5.1.2","ts-loader":"^9.0.0","ts-node":"^10.0.0","typescript":"^4.3.2","v8-compile-cache":"^2.3.0","webpack":"^5.38.1","webpack-cli":"^4.0.0","which":"^2.0.2"},"scripts":{"build":"rm -rf dist shims && webpack && ts-node ./mkshims.ts","corepack":"ts-node ./sources/_entryPoint.ts","lint":"yarn eslint","prepack":"yarn build","postpack":"rm -rf dist shims","typecheck":"tsc --noEmit","test":"yarn jest"},"files":["dist","shims","LICENSE.md"],"publishConfig":{"bin":{"corepack":"./dist/corepack.js","pnpm":"./dist/pnpm.js","pnpx":"./dist/pnpx.js","yarn":"./dist/yarn.js","yarnpkg":"./dist/yarnpkg.js"},"executableFiles":["./dist/npm.js","./dist/npx.js","./dist/pnpm.js","./dist/pnpx.js","./dist/yarn.js","./dist/yarnpkg.js","./dist/corepack.js","./shims/npm","./shims/npm.ps1","./shims/npx","./shims/npx.ps1","./shims/pnpm","./shims/pnpm.ps1","./shims/pnpx","./shims/pnpx.ps1","./shims/yarn","./shims/yarn.ps1","./shims/yarnpkg","./shims/yarnpkg.ps1"]},"resolutions":{"vm2":"patch:vm2@npm:3.9.9#.yarn/patches/vm2-npm-3.9.9-03fd1f4dc5.patch"}}'); +module.exports = JSON.parse('{"name":"corepack","version":"0.12.3","homepage":"https://github.com/nodejs/corepack#readme","bugs":{"url":"https://github.com/nodejs/corepack/issues"},"repository":{"type":"git","url":"https://github.com/nodejs/corepack.git"},"license":"MIT","packageManager":"yarn@4.0.0-rc.14+sha224.d3bee29dce07417588d640327d44f1e0b8182c240bc2beb0b81ccf6e","devDependencies":{"@babel/core":"^7.14.3","@babel/plugin-transform-modules-commonjs":"^7.14.0","@babel/preset-typescript":"^7.13.0","@types/debug":"^4.1.5","@types/jest":"^28.0.0","@types/node":"^18.0.0","@types/semver":"^7.1.0","@types/tar":"^6.0.0","@types/which":"^2.0.0","@typescript-eslint/eslint-plugin":"^5.0.0","@typescript-eslint/parser":"^5.0.0","@yarnpkg/eslint-config":"^1.0.0-rc.5","@yarnpkg/fslib":"^2.1.0","@zkochan/cmd-shim":"^5.0.0","babel-plugin-dynamic-import-node":"^2.3.3","clipanion":"^3.0.1","debug":"^4.1.1","eslint":"^8.0.0","eslint-plugin-arca":"^0.15.0","jest":"^28.0.0","nock":"^13.0.4","proxy-agent":"^5.0.0","semver":"^7.1.3","supports-color":"^9.0.0","tar":"^6.0.1","terser-webpack-plugin":"^5.1.2","ts-loader":"^9.0.0","ts-node":"^10.0.0","typescript":"^4.3.2","v8-compile-cache":"^2.3.0","webpack":"^5.38.1","webpack-cli":"^4.0.0","which":"^2.0.2"},"scripts":{"build":"rm -rf dist shims && webpack && ts-node ./mkshims.ts","corepack":"ts-node ./sources/_entryPoint.ts","lint":"yarn eslint","prepack":"yarn build","postpack":"rm -rf dist shims","typecheck":"tsc --noEmit","test":"yarn jest"},"files":["dist","shims","LICENSE.md"],"publishConfig":{"bin":{"corepack":"./dist/corepack.js","pnpm":"./dist/pnpm.js","pnpx":"./dist/pnpx.js","yarn":"./dist/yarn.js","yarnpkg":"./dist/yarnpkg.js"},"executableFiles":["./dist/npm.js","./dist/npx.js","./dist/pnpm.js","./dist/pnpx.js","./dist/yarn.js","./dist/yarnpkg.js","./dist/corepack.js","./shims/npm","./shims/npm.ps1","./shims/npx","./shims/npx.ps1","./shims/pnpm","./shims/pnpm.ps1","./shims/pnpx","./shims/pnpx.ps1","./shims/yarn","./shims/yarn.ps1","./shims/yarnpkg","./shims/yarnpkg.ps1"]},"resolutions":{"vm2":"patch:vm2@npm:3.9.9#.yarn/patches/vm2-npm-3.9.9-03fd1f4dc5.patch"}}'); /***/ }) diff --git a/deps/corepack/package.json b/deps/corepack/package.json index 12a1b1a8035629..6fbae0427073b7 100644 --- a/deps/corepack/package.json +++ b/deps/corepack/package.json @@ -1,6 +1,6 @@ { "name": "corepack", - "version": "0.12.1", + "version": "0.12.3", "homepage": "https://github.com/nodejs/corepack#readme", "bugs": { "url": "https://github.com/nodejs/corepack/issues" diff --git a/deps/npm/docs/content/commands/npm-ci.md b/deps/npm/docs/content/commands/npm-ci.md index 9b8238d05a3b91..3ecd7c6efb0957 100644 --- a/deps/npm/docs/content/commands/npm-ci.md +++ b/deps/npm/docs/content/commands/npm-ci.md @@ -67,7 +67,7 @@ $ npm ci added 154 packages in 5s ``` -Configure Travis to build using `npm ci` instead of `npm install`: +Configure Travis CI to build using `npm ci` instead of `npm install`: ```bash # .travis.yml @@ -84,15 +84,129 @@ cache: -#### `audit` +#### `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` + + + + +#### `global-style` + +* Default: false +* Type: Boolean + +Causes npm to install the package into your local `node_modules` folder with +the same layout it uses with the global `node_modules` folder. Only your +direct dependencies will show in `node_modules` and everything they depend +on will be flattened in their `node_modules` folders. This obviously will +eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` +will be preferred. + + + + +#### `legacy-bundling` + +* Default: false +* Type: Boolean + +Causes npm to install the package such that versions of npm prior to 1.4, +such as the one included with node 0.8, can install the package. This +eliminates all automatic deduping. If used with `global-style` this option +will be preferred. + + + + +#### `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. + + + + +#### `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 and 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 -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. +If set to false, then ignore `package-lock.json` files when installing. This +will also prevent _writing_ `package-lock.json` if `save` is true. + +This configuration does not affect `npm ci`. @@ -127,13 +241,132 @@ will *not* run any pre- or post-scripts. -#### `script-shell` +#### `audit` -* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows -* Type: null or String +* 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 -The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. +When set file: protocol dependencies that exist outside of the project root +will be packed and installed as regular dependencies instead of creating a +symlink. This option has no effect on workspaces. diff --git a/deps/npm/docs/content/commands/npm-exec.md b/deps/npm/docs/content/commands/npm-exec.md index 8ccfa75c73386c..3d8de1ea54ad6f 100644 --- a/deps/npm/docs/content/commands/npm-exec.md +++ b/deps/npm/docs/content/commands/npm-exec.md @@ -127,7 +127,7 @@ $ npm exec -- foo@latest bar --package=@npmcli/foo * Default: * Type: String (can be set multiple times) -The package to install for [`npm exec`](/commands/npm-exec) +The package or packages to install for [`npm exec`](/commands/npm-exec) diff --git a/deps/npm/docs/content/commands/npm-init.md b/deps/npm/docs/content/commands/npm-init.md index cd0be4643e0ead..f3124a7768dfce 100644 --- a/deps/npm/docs/content/commands/npm-init.md +++ b/deps/npm/docs/content/commands/npm-init.md @@ -38,6 +38,8 @@ 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 diff --git a/deps/npm/docs/content/commands/npm-install-ci-test.md b/deps/npm/docs/content/commands/npm-install-ci-test.md index 74ed4667e81bfe..b886f8ab9599ad 100644 --- a/deps/npm/docs/content/commands/npm-install-ci-test.md +++ b/deps/npm/docs/content/commands/npm-install-ci-test.md @@ -30,15 +30,129 @@ This command runs `npm ci` followed immediately by `npm test`. -#### `audit` +#### `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` + + + + +#### `global-style` + +* Default: false +* Type: Boolean + +Causes npm to install the package into your local `node_modules` folder with +the same layout it uses with the global `node_modules` folder. Only your +direct dependencies will show in `node_modules` and everything they depend +on will be flattened in their `node_modules` folders. This obviously will +eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` +will be preferred. + + + + +#### `legacy-bundling` + +* Default: false +* Type: Boolean + +Causes npm to install the package such that versions of npm prior to 1.4, +such as the one included with node 0.8, can install the package. This +eliminates all automatic deduping. If used with `global-style` this option +will be preferred. + + + + +#### `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. + + + + +#### `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 and 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 -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. +If set to false, then ignore `package-lock.json` files when installing. This +will also prevent _writing_ `package-lock.json` if `save` is true. + +This configuration does not affect `npm ci`. @@ -73,13 +187,132 @@ will *not* run any pre- or post-scripts. -#### `script-shell` +#### `audit` -* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows -* Type: null or String +* 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 -The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. +When set file: protocol dependencies that exist outside of the project root +will be packed and installed as regular dependencies instead of creating a +symlink. This option has no effect on workspaces. diff --git a/deps/npm/docs/content/commands/npm-install.md b/deps/npm/docs/content/commands/npm-install.md index 7e5544f85e3dda..35e0df22777336 100644 --- a/deps/npm/docs/content/commands/npm-install.md +++ b/deps/npm/docs/content/commands/npm-install.md @@ -311,7 +311,7 @@ into a tarball (b). 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. + `#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 diff --git a/deps/npm/docs/content/commands/npm-ls.md b/deps/npm/docs/content/commands/npm-ls.md index a97c5168e6e0b4..a7936fafc72a2c 100644 --- a/deps/npm/docs/content/commands/npm-ls.md +++ b/deps/npm/docs/content/commands/npm-ls.md @@ -44,7 +44,7 @@ npm@@VERSION@ /path/to/npm 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 +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 @@ -62,7 +62,7 @@ disk would be roughly identical. With the advent of automatic install-time deduplication of dependencies in npm v3, the `ls` output was modified to display the logical dependency graph as a tree structure, since this was more useful to most users. -However, without using `npm ls -l`, it became impossible show _where_ a +However, without using `npm ls -l`, it became impossible to show _where_ a package was actually installed much of the time! With the advent of automatic installation of `peerDependencies` in npm v7, diff --git a/deps/npm/docs/content/commands/npm-query.md b/deps/npm/docs/content/commands/npm-query.md new file mode 100644 index 00000000000000..6166d5c0e71665 --- /dev/null +++ b/deps/npm/docs/content/commands/npm-query.md @@ -0,0 +1,235 @@ +--- +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": [], + ... + }, + ... +``` + +### 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. + + + + + +## See Also + +* [dependency selector](/using-npm/dependency-selector) diff --git a/deps/npm/docs/content/configuring-npm/package-json.md b/deps/npm/docs/content/configuring-npm/package-json.md index f0315d60efef48..b0231662f69309 100644 --- a/deps/npm/docs/content/configuring-npm/package-json.md +++ b/deps/npm/docs/content/configuring-npm/package-json.md @@ -632,7 +632,7 @@ 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. +specified, then the default branch is used. Examples: diff --git a/deps/npm/docs/content/using-npm/config.md b/deps/npm/docs/content/using-npm/config.md index e3e1bd6c73bb3b..cd13237f34dd38 100644 --- a/deps/npm/docs/content/using-npm/config.md +++ b/deps/npm/docs/content/using-npm/config.md @@ -1244,7 +1244,7 @@ Directory in which `npm pack` will save tarballs. * Default: * Type: String (can be set multiple times) -The package to install for [`npm exec`](/commands/npm-exec) +The package or packages to install for [`npm exec`](/commands/npm-exec) @@ -1393,6 +1393,24 @@ 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` diff --git a/deps/npm/docs/content/using-npm/dependency-selectors.md b/deps/npm/docs/content/using-npm/dependency-selectors.md new file mode 100644 index 00000000000000..45febf7cc7300b --- /dev/null +++ b/deps/npm/docs/content/using-npm/dependency-selectors.md @@ -0,0 +1,168 @@ +--- +title: Dependency Selector Syntax & Querying +section: 7 +description: Dependency Selector Syntax & Querying +--- + +### Description + +The [`npm query`](/commands/npm-query) commmand 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 `v1.0.0` + +#### 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) +- `:override` when a dependency is an override (not implemented yet) +- `: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()` matching a valid [`node-semver`](https://github.com/npm/node-semver) spec +- `: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) + +#### [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 equivalant... +- `[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 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((tree) => { + // query all production dependencies + const results = await tree.querySelectorAll('.prod') + console.log(results) +}) +``` + +```js +// iterative +arb.loadActual((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/deps/npm/docs/content/using-npm/workspaces.md b/deps/npm/docs/content/using-npm/workspaces.md index 82491cd74af823..5b68ef8ce9d3d9 100644 --- a/deps/npm/docs/content/using-npm/workspaces.md +++ b/deps/npm/docs/content/using-npm/workspaces.md @@ -137,6 +137,8 @@ nested workspaces to be consumed elsewhere. 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: @@ -158,7 +160,13 @@ given command in the context of that specific workspace. e.g: npm run test --workspace=a ``` -This will run the `test` script defined within the +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 diff --git a/deps/npm/docs/output/commands/npm-ci.html b/deps/npm/docs/output/commands/npm-ci.html index abc8ce6deb0e31..a67ad8237e7548 100644 --- a/deps/npm/docs/output/commands/npm-ci.html +++ b/deps/npm/docs/output/commands/npm-ci.html @@ -142,7 +142,7 @@

npm-ci

Table of contents

- +

Synopsis

@@ -192,7 +192,7 @@

Example

$ npm ci
 added 154 packages in 5s
 
-

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

+

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

# .travis.yml
 install:
 - npm ci
@@ -205,15 +205,108 @@ 

Configuration

-

audit

+

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
  • +
+ + +

global-style

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

Causes npm to install the package into your local node_modules folder with +the same layout it uses with the global node_modules folder. Only your +direct dependencies will show in node_modules and everything they depend +on will be flattened in their node_modules folders. This obviously will +eliminate some deduping. If used with legacy-bundling, legacy-bundling +will be preferred.

+ + +

legacy-bundling

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

Causes npm to install the package such that versions of npm prior to 1.4, +such as the one included with node 0.8, can install the package. This +eliminates all automatic deduping. If used with global-style this option +will be preferred.

+ + +

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.

+ + +

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 and 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
-

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.

+

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

+

This configuration does not affect npm ci.

foreground-scripts

@@ -240,12 +333,110 @@

ignore-scripts

will not run any pre- or post-scripts.

-

script-shell

+

audit

    -
  • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
  • -
  • Type: null or String
  • +
  • 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
-

The shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands.

+

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

diff --git a/deps/npm/docs/output/commands/npm-exec.html b/deps/npm/docs/output/commands/npm-exec.html index 7a5195ba4a2630..917d71db366883 100644 --- a/deps/npm/docs/output/commands/npm-exec.html +++ b/deps/npm/docs/output/commands/npm-exec.html @@ -236,7 +236,7 @@

package

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

    The package to install for npm exec

    +

    The package or packages to install for npm exec

    call

    diff --git a/deps/npm/docs/output/commands/npm-init.html b/deps/npm/docs/output/commands/npm-init.html index c7c00b3531becf..3897be30c76a9f 100644 --- a/deps/npm/docs/output/commands/npm-init.html +++ b/deps/npm/docs/output/commands/npm-init.html @@ -170,6 +170,8 @@

    Description

  • 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 diff --git a/deps/npm/docs/output/commands/npm-install-ci-test.html b/deps/npm/docs/output/commands/npm-install-ci-test.html index 8d3d9541421fe0..f7d6e04649c48b 100644 --- a/deps/npm/docs/output/commands/npm-install-ci-test.html +++ b/deps/npm/docs/output/commands/npm-install-ci-test.html @@ -142,7 +142,7 @@

    npm-install-ci-test

    Table of contents

    - +

    Synopsis

    @@ -162,15 +162,108 @@

    Configuration

    -

    audit

    +

    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
    • +
    + + +

    global-style

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

    Causes npm to install the package into your local node_modules folder with +the same layout it uses with the global node_modules folder. Only your +direct dependencies will show in node_modules and everything they depend +on will be flattened in their node_modules folders. This obviously will +eliminate some deduping. If used with legacy-bundling, legacy-bundling +will be preferred.

    + + +

    legacy-bundling

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

    Causes npm to install the package such that versions of npm prior to 1.4, +such as the one included with node 0.8, can install the package. This +eliminates all automatic deduping. If used with global-style this option +will be preferred.

    + + +

    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.

    + + +

    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 and 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
    -

    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.

    +

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

    +

    This configuration does not affect npm ci.

    foreground-scripts

    @@ -197,12 +290,110 @@

    ignore-scripts

    will not run any pre- or post-scripts.

    -

    script-shell

    +

    audit

      -
    • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
    • -
    • Type: null or String
    • +
    • 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
    -

    The shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands.

    +

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

    diff --git a/deps/npm/docs/output/commands/npm-install.html b/deps/npm/docs/output/commands/npm-install.html index 48f62f9e4822c7..7702ab5c167750 100644 --- a/deps/npm/docs/output/commands/npm-install.html +++ b/deps/npm/docs/output/commands/npm-install.html @@ -408,7 +408,7 @@

    Description

    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.

    +#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.

    diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index 47b3bbc085e164..08c482c12d004e 100644 --- a/deps/npm/docs/output/commands/npm-ls.html +++ b/deps/npm/docs/output/commands/npm-ls.html @@ -166,13 +166,13 @@

    Description

    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@8.15.0 /path/to/npm
    +
    npm@8.17.0 /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 +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.

    @@ -185,7 +185,7 @@

    Note: Design Changes Pending

    With the advent of automatic install-time deduplication of dependencies in npm v3, the ls output was modified to display the logical dependency graph as a tree structure, since this was more useful to most users. -However, without using npm ls -l, it became impossible show where a +However, without using npm ls -l, it became impossible to show where a package was actually installed much of the time!

    With the advent of automatic installation of peerDependencies in npm v7, this gets even more curious, as peerDependencies are logically diff --git a/deps/npm/docs/output/commands/npm-query.html b/deps/npm/docs/output/commands/npm-query.html new file mode 100644 index 00000000000000..1a11fb9e8cd8b3 --- /dev/null +++ b/deps/npm/docs/output/commands/npm-query.html @@ -0,0 +1,363 @@ + + +npm-query + + + +

    + +
    +
    +

    npm-query

    +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": [],
    +    ...
    +  },
    +  ...
    +
    +

    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.

    + + + +

    See Also

    + +
    + + +
    + + + + \ No newline at end of file diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html index 514017fd875943..52362923750ab4 100644 --- a/deps/npm/docs/output/commands/npm.html +++ b/deps/npm/docs/output/commands/npm.html @@ -149,7 +149,7 @@

    Table of contents

    Version

    -

    8.15.0

    +

    8.17.0

    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 diff --git a/deps/npm/docs/output/configuring-npm/package-json.html b/deps/npm/docs/output/configuring-npm/package-json.html index 354069b1a2c738..2b1240ebee9124 100644 --- a/deps/npm/docs/output/configuring-npm/package-json.html +++ b/deps/npm/docs/output/configuring-npm/package-json.html @@ -622,7 +622,7 @@

    Git URLs as Dependencies

    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.

    +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
    diff --git a/deps/npm/docs/output/using-npm/config.html b/deps/npm/docs/output/using-npm/config.html
    index 79bf005d61e15e..42880a27025546 100644
    --- a/deps/npm/docs/output/using-npm/config.html
    +++ b/deps/npm/docs/output/using-npm/config.html
    @@ -142,7 +142,7 @@ 

    config

    Table of contents

    -
    +

    Description

    @@ -1146,7 +1146,7 @@

    package

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

    The package to install for npm exec

    +

    The package or packages to install for npm exec

    package-lock

    @@ -1265,6 +1265,20 @@

    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