From 01dcf4d1d8d564107f399d806f6f95a78dea36fb Mon Sep 17 00:00:00 2001 From: cjihrig Date: Fri, 12 Mar 2021 18:12:15 -0500 Subject: [PATCH 01/85] tools: update ESLint to 7.22.0 Update ESLint to 7.22.0 PR-URL: https://github.com/nodejs/node/pull/37734 Reviewed-By: Rich Trott Reviewed-By: Luigi Pinca Reviewed-By: Antoine du Hamel --- .../node_modules/bail/package.json | 98 +- .../character-entities-legacy/package.json | 92 +- .../character-entities/package.json | 94 +- .../character-reference-invalid/package.json | 94 +- .../collapse-white-space/package.json | 94 +- .../node_modules/extend/package.json | 92 +- .../node_modules/inherits/package.json | 35 +- .../node_modules/is-alphabetical/package.json | 98 +- .../is-alphanumerical/package.json | 102 +- .../node_modules/is-buffer/package.json | 13 +- .../node_modules/is-decimal/package.json | 98 +- .../node_modules/is-hexadecimal/package.json | 98 +- .../node_modules/is-plain-obj/package.json | 33 +- .../is-whitespace-character/package.json | 102 +- .../is-word-character/package.json | 98 +- .../markdown-escapes/package.json | 96 +- .../node_modules/parse-entities/package.json | 96 +- .../node_modules/remark-parse/package.json | 64 +- .../node_modules/repeat-string/package.json | 78 +- .../node_modules/replace-ext/package.json | 69 +- .../node_modules/state-toggle/package.json | 94 +- .../trim-trailing-lines/package.json | 86 +- .../node_modules/trim/package.json | 30 +- .../node_modules/trough/package.json | 94 +- .../node_modules/unherit/package.json | 84 +- .../node_modules/unified/package.json | 90 +- .../node_modules/unist-util-is/package.json | 100 +- .../unist-util-remove-position/package.json | 98 +- .../package.json | 90 +- .../unist-util-visit-parents/package.json | 80 +- .../unist-util-visit/package.json | 104 +- .../node_modules/vfile-location/package.json | 86 +- .../node_modules/vfile-message/package.json | 78 +- .../node_modules/vfile/package.json | 119 +- .../node_modules/x-is-string/package.json | 46 +- .../node_modules/xtend/package.json | 60 +- .../eslint-plugin-markdown/package.json | 77 +- tools/node_modules/eslint/README.md | 4 +- .../eslint/lib/cli-engine/formatters/html.js | 4 +- .../lib/cli-engine/lint-result-cache.js | 1 - .../eslint/lib/linter/report-translator.js | 17 + .../eslint/lib/rule-tester/rule-tester.js | 4 +- .../node_modules/eslint/lib/rules/eol-last.js | 2 +- .../eslint/lib/rules/lines-around-comment.js | 7 +- .../eslint/lib/rules/max-lines.js | 2 +- .../eslint/lib/rules/object-curly-newline.js | 2 +- .../eslint/lib/shared/runtime-info.js | 3 +- .../@babel/code-frame/package.json | 34 +- .../helper-validator-identifier/package.json | 30 +- .../@babel/highlight/lib/index.js | 23 +- .../node_modules/ansi-styles/index.js | 165 -- .../node_modules/ansi-styles/package.json | 56 - .../highlight/node_modules/chalk/package.json | 149 +- .../node_modules/color-convert/index.js | 78 - .../node_modules/color-name/package.json | 25 - .../highlight/node_modules/has-flag/index.js | 8 - .../node_modules/supports-color/package.json | 53 - .../@babel/highlight/package.json | 36 +- .../node_modules/globals/globals.json | 1586 +++++++++++++++++ .../eslintrc/node_modules/globals/index.js | 2 + .../eslintrc/node_modules/globals/license | 9 + .../node_modules/globals/package.json | 61 + .../eslintrc/node_modules/globals/readme.md | 56 + .../@eslint/eslintrc/package.json | 91 +- .../node_modules/acorn-jsx/package.json | 29 +- .../eslint/node_modules/acorn/package.json | 33 +- .../eslint/node_modules/ajv/package.json | 132 +- .../node_modules/ansi-colors/package.json | 74 +- .../node_modules/ansi-regex/package.json | 117 +- .../eslint/node_modules/ansi-styles/index.js | 136 +- .../node_modules/ansi-styles/package.json | 119 +- .../eslint/node_modules/ansi-styles/readme.md | 33 +- .../eslint/node_modules/argparse/package.json | 55 +- .../node_modules/astral-regex/package.json | 73 +- .../node_modules/balanced-match/package.json | 41 +- .../node_modules/brace-expansion/package.json | 43 +- .../node_modules/callsites/package.json | 85 +- .../chalk/node_modules/ansi-styles/index.js | 163 ++ .../node_modules/ansi-styles/license | 0 .../node_modules/ansi-styles/package.json | 65 + .../node_modules/ansi-styles/readme.md | 33 +- .../node_modules/color-convert/LICENSE | 0 .../node_modules/color-convert/README.md | 0 .../node_modules/color-convert/conversions.js | 591 +++--- .../chalk/node_modules/color-convert/index.js | 81 + .../node_modules/color-convert/package.json | 58 +- .../node_modules/color-convert/route.js | 44 +- .../node_modules/color-name/LICENSE | 0 .../node_modules/color-name/README.md | 0 .../node_modules/color-name/index.js | 0 .../node_modules/color-name/package.json | 33 + .../chalk/node_modules/has-flag/index.js | 8 + .../node_modules/has-flag/license | 0 .../node_modules/has-flag/package.json | 41 +- .../node_modules/has-flag/readme.md | 19 + .../node_modules/supports-color/browser.js | 0 .../node_modules/supports-color/index.js | 52 +- .../node_modules/supports-color/license | 0 .../node_modules/supports-color/package.json | 62 + .../node_modules/supports-color/readme.md | 16 +- .../eslint/node_modules/chalk/package.json | 143 +- .../node_modules/color-convert/conversions.js | 591 +++--- .../node_modules/color-convert/index.js | 51 +- .../node_modules/color-convert/package.json | 58 +- .../node_modules/color-convert/route.js | 44 +- .../node_modules/color-name/package.json | 58 +- .../node_modules/concat-map/package.json | 104 +- .../node_modules/cross-spawn/package.json | 94 +- .../eslint/node_modules/debug/package.json | 87 +- .../eslint/node_modules/deep-is/package.json | 46 +- .../eslint/node_modules/doctrine/package.json | 72 +- .../node_modules/emoji-regex/package.json | 60 +- .../eslint/node_modules/enquirer/package.json | 64 +- .../escape-string-regexp/package.json | 51 +- .../node_modules/eslint-scope/package.json | 57 +- .../eslint-visitor-keys/package.json | 54 +- .../node_modules/eslint-utils/package.json | 64 +- .../eslint-visitor-keys/package.json | 52 +- .../eslint-visitor-keys/package.json | 54 +- .../eslint/node_modules/espree/package.json | 54 +- .../eslint/node_modules/esprima/package.json | 116 +- .../node_modules/estraverse/package.json | 47 +- .../eslint/node_modules/esquery/package.json | 103 +- .../node_modules/estraverse/package.json | 47 +- .../node_modules/esrecurse/package.json | 55 +- .../node_modules/estraverse/package.json | 47 +- .../eslint/node_modules/esutils/package.json | 49 +- .../node_modules/fast-deep-equal/package.json | 72 +- .../fast-json-stable-stringify/package.json | 47 +- .../fast-levenshtein/package.json | 48 +- .../file-entry-cache/package.json | 99 +- .../node_modules/flat-cache/package.json | 111 +- .../eslint/node_modules/flatted/package.json | 70 +- .../node_modules/fs.realpath/package.json | 44 +- .../functional-red-black-tree/package.json | 39 +- .../eslint/node_modules/glob-parent/index.js | 3 +- .../node_modules/glob-parent/package.json | 69 +- .../eslint/node_modules/glob/package.json | 58 +- .../eslint/node_modules/globals/globals.json | 174 +- .../globals/node_modules/type-fest/license | 9 + .../node_modules/type-fest/package.json | 67 + .../globals/node_modules/type-fest/readme.md | 658 +++++++ .../eslint/node_modules/globals/package.json | 114 +- .../eslint/node_modules/globals/readme.md | 8 +- .../eslint/node_modules/has-flag/index.js | 10 +- .../eslint/node_modules/has-flag/package.json | 97 +- .../eslint/node_modules/has-flag/readme.md | 19 - .../eslint/node_modules/ignore/package.json | 81 +- .../node_modules/import-fresh/package.json | 93 +- .../node_modules/imurmurhash/package.json | 46 +- .../eslint/node_modules/inflight/package.json | 40 +- .../eslint/node_modules/inherits/package.json | 35 +- .../node_modules/is-extglob/package.json | 46 +- .../is-fullwidth-code-point/package.json | 91 +- .../eslint/node_modules/is-glob/package.json | 63 +- .../eslint/node_modules/isexe/package.json | 40 +- .../node_modules/js-tokens/package.json | 47 +- .../eslint/node_modules/js-yaml/package.json | 79 +- .../json-schema-traverse/package.json | 48 +- .../package.json | 60 +- .../eslint/node_modules/levn/package.json | 51 +- .../eslint/node_modules/lodash/package.json | 45 +- .../node_modules/lru-cache/package.json | 60 +- .../node_modules/minimatch/package.json | 48 +- .../eslint/node_modules/ms/package.json | 49 +- .../node_modules/natural-compare/package.json | 56 +- .../eslint/node_modules/once/package.json | 40 +- .../node_modules/optionator/package.json | 59 +- .../node_modules/parent-module/package.json | 99 +- .../path-is-absolute/package.json | 33 +- .../eslint/node_modules/path-key/package.json | 85 +- .../node_modules/prelude-ls/package.json | 51 +- .../eslint/node_modules/progress/package.json | 55 +- .../eslint/node_modules/punycode/package.json | 74 +- .../eslint/node_modules/regexpp/package.json | 83 +- .../require-from-string/package.json | 39 +- .../node_modules/resolve-from/package.json | 75 +- .../eslint/node_modules/rimraf/package.json | 53 +- .../eslint/node_modules/semver/package.json | 51 +- .../node_modules/shebang-command/package.json | 75 +- .../node_modules/shebang-regex/package.json | 77 +- .../node_modules/ansi-styles/index.js | 163 ++ .../node_modules/ansi-styles/license | 9 + .../node_modules/ansi-styles/package.json | 65 + .../node_modules/ansi-styles/readme.md | 152 ++ .../node_modules/color-convert/LICENSE | 21 + .../node_modules/color-convert/README.md | 68 + .../node_modules/color-convert/conversions.js | 839 +++++++++ .../node_modules/color-convert/index.js | 81 + .../node_modules/color-convert/package.json | 60 + .../node_modules/color-convert/route.js | 97 + .../node_modules/color-name/LICENSE | 8 + .../node_modules/color-name/README.md | 11 + .../node_modules/color-name/index.js | 152 ++ .../node_modules/color-name/package.json | 33 + .../node_modules/slice-ansi/package.json | 111 +- .../node_modules/sprintf-js/package.json | 51 +- .../node_modules/string-width/package.json | 119 +- .../node_modules/strip-ansi/package.json | 115 +- .../strip-json-comments/package.json | 101 +- .../node_modules/supports-color/index.js | 52 +- .../node_modules/supports-color/package.json | 113 +- .../node_modules/supports-color/readme.md | 16 +- .../table/node_modules/ajv/.tonic_example.js | 10 +- .../table/node_modules/ajv/LICENSE | 2 +- .../table/node_modules/ajv/README.md | 279 +-- .../ajv/dist/compile/codegen/index.js | 14 + .../node_modules/ajv/dist/compile/index.js | 4 +- .../ajv/dist/compile/jtd/parse.js | 341 ++++ .../ajv/dist/compile/jtd/serialize.js | 223 +++ .../ajv/dist/compile/jtd/types.js | 14 + .../node_modules/ajv/dist/compile/names.js | 5 + .../ajv/dist/compile/subschema.js | 1 + .../ajv/dist/compile/timestamp.js | 2 + .../node_modules/ajv/dist/compile/util.js | 9 +- .../dist/compile/validate/applicability.js | 3 +- .../table/node_modules/ajv/dist/core.js | 2 + .../table/node_modules/ajv/dist/jtd.js | 24 + .../ajv/dist/runtime/parseJson.js | 183 ++ .../node_modules/ajv/dist/runtime/quote.js | 28 + .../node_modules/ajv/dist/types/jtd-schema.js | 3 + .../applicator/additionalProperties.js | 7 +- .../vocabularies/applicator/dependencies.js | 6 +- .../vocabularies/applicator/properties.js | 6 +- .../ajv/dist/vocabularies/code.js | 29 +- .../ajv/dist/vocabularies/jtd/properties.js | 9 +- .../ajv/dist/vocabularies/jtd/ref.js | 18 +- .../ajv/dist/vocabularies/jtd/type.js | 23 +- .../dist/vocabularies/validation/required.js | 16 +- .../table/node_modules/ajv/package.json | 141 +- .../node_modules/ajv/scripts/publish-bundles | 4 +- .../node_modules/ajv/scripts/publish-gh-pages | 31 - .../node_modules/ajv/scripts/publish-site | 34 + .../json-schema-traverse/package.json | 50 +- .../eslint/node_modules/table/package.json | 12 +- .../node_modules/text-table/package.json | 92 +- .../node_modules/type-check/package.json | 51 +- .../node_modules/type-fest/package.json | 109 +- .../eslint/node_modules/uri-js/package.json | 79 +- .../v8-compile-cache/package.json | 51 +- .../v8-compile-cache/v8-compile-cache.js | 14 +- .../eslint/node_modules/which/package.json | 56 +- .../node_modules/word-wrap/package.json | 95 +- .../eslint/node_modules/wrappy/package.json | 42 +- .../eslint/node_modules/yallist/package.json | 42 +- tools/node_modules/eslint/package.json | 121 +- 246 files changed, 12641 insertions(+), 6050 deletions(-) delete mode 100644 tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/index.js delete mode 100644 tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/package.json delete mode 100644 tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/index.js delete mode 100644 tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/package.json delete mode 100644 tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/index.js delete mode 100644 tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/package.json create mode 100644 tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/globals.json create mode 100644 tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/index.js create mode 100644 tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/license create mode 100644 tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/package.json create mode 100644 tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/readme.md create mode 100644 tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/index.js rename tools/node_modules/eslint/node_modules/{@babel/highlight => chalk}/node_modules/ansi-styles/license (100%) create mode 100644 tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/package.json rename tools/node_modules/eslint/node_modules/{@babel/highlight => chalk}/node_modules/ansi-styles/readme.md (77%) rename tools/node_modules/eslint/node_modules/{@babel/highlight => chalk}/node_modules/color-convert/LICENSE (100%) rename tools/node_modules/eslint/node_modules/{@babel/highlight => chalk}/node_modules/color-convert/README.md (100%) rename tools/node_modules/eslint/node_modules/{@babel/highlight => chalk}/node_modules/color-convert/conversions.js (51%) create mode 100644 tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/index.js rename tools/node_modules/eslint/node_modules/{@babel/highlight => chalk}/node_modules/color-convert/package.json (53%) rename tools/node_modules/eslint/node_modules/{@babel/highlight => chalk}/node_modules/color-convert/route.js (59%) rename tools/node_modules/eslint/node_modules/{@babel/highlight => chalk}/node_modules/color-name/LICENSE (100%) rename tools/node_modules/eslint/node_modules/{@babel/highlight => chalk}/node_modules/color-name/README.md (100%) rename tools/node_modules/eslint/node_modules/{@babel/highlight => chalk}/node_modules/color-name/index.js (100%) create mode 100644 tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/package.json create mode 100644 tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/index.js rename tools/node_modules/eslint/node_modules/{@babel/highlight => chalk}/node_modules/has-flag/license (100%) rename tools/node_modules/eslint/node_modules/{@babel/highlight => chalk}/node_modules/has-flag/package.json (53%) rename tools/node_modules/eslint/node_modules/{@babel/highlight => chalk}/node_modules/has-flag/readme.md (61%) rename tools/node_modules/eslint/node_modules/{@babel/highlight => chalk}/node_modules/supports-color/browser.js (100%) rename tools/node_modules/eslint/node_modules/{@babel/highlight => chalk}/node_modules/supports-color/index.js (62%) rename tools/node_modules/eslint/node_modules/{@babel/highlight => chalk}/node_modules/supports-color/license (100%) create mode 100644 tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/package.json rename tools/node_modules/eslint/node_modules/{@babel/highlight => chalk}/node_modules/supports-color/readme.md (67%) create mode 100644 tools/node_modules/eslint/node_modules/globals/node_modules/type-fest/license create mode 100644 tools/node_modules/eslint/node_modules/globals/node_modules/type-fest/package.json create mode 100644 tools/node_modules/eslint/node_modules/globals/node_modules/type-fest/readme.md create mode 100644 tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/index.js create mode 100644 tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/license create mode 100644 tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/package.json create mode 100644 tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/readme.md create mode 100644 tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/LICENSE create mode 100644 tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/README.md create mode 100644 tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/conversions.js create mode 100644 tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/index.js create mode 100644 tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/package.json create mode 100644 tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/route.js create mode 100644 tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/LICENSE create mode 100644 tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/README.md create mode 100644 tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/index.js create mode 100644 tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/package.json create mode 100644 tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/parse.js create mode 100644 tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js create mode 100644 tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/types.js create mode 100644 tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/parseJson.js create mode 100644 tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/quote.js create mode 100644 tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/jtd-schema.js delete mode 100755 tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/publish-gh-pages create mode 100755 tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/publish-site diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/bail/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/bail/package.json index 8f8539d32b89b6..1544ac972fde04 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/bail/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/bail/package.json @@ -1,29 +1,23 @@ { - "name": "bail", - "version": "1.0.5", - "description": "Throw a given error", - "license": "MIT", - "keywords": [ - "fail", - "bail", - "throw", - "callback", - "error" - ], - "repository": "wooorm/bail", - "bugs": "https://github.com/wooorm/bail/issues", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" }, - "author": "Titus Wormer (https://wooorm.com)", + "bugs": { + "url": "https://github.com/wooorm/bail/issues" + }, + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "files": [ - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": {}, + "deprecated": false, + "description": "Throw a given error", "devDependencies": { "browserify": "^16.0.0", "nyc": "^15.0.0", @@ -34,14 +28,28 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify index.js -s bail -o bail.js", - "build-mangle": "browserify index.js -s bail -p tinyify -o bail.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/bail#readme", + "keywords": [ + "fail", + "bail", + "throw", + "callback", + "error" + ], + "license": "MIT", + "name": "bail", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 }, "prettier": { "tabWidth": 2, @@ -51,22 +59,30 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/bail.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js -s bail -o bail.js", + "build-mangle": "browserify index.js -s bail -p tinyify -o bail.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.5", "xo": { "prettier": true, "esnext": false, "ignores": [ "bail.js" ] - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/character-entities-legacy/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/character-entities-legacy/package.json index e532b8714df3e8..701c76396e0c2f 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/character-entities-legacy/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/character-entities-legacy/package.json @@ -1,32 +1,23 @@ { - "name": "character-entities-legacy", - "version": "1.1.4", - "description": "HTML legacy character entity information", - "license": "MIT", - "keywords": [ - "html", - "entity", - "entities", - "character", - "reference", - "name", - "replacement" - ], - "repository": "wooorm/character-entities-legacy", - "bugs": "https://github.com/wooorm/character-entities-legacy/issues", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/character-entities-legacy/issues" }, - "author": "Titus Wormer (https://wooorm.com)", + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "main": "index.json", - "files": [ - "index.json" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": {}, + "deprecated": false, + "description": "HTML legacy character entity information", "devDependencies": { "bail": "^1.0.0", "browserify": "^16.0.0", @@ -38,15 +29,26 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "scripts": { - "generate": "node build", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify index.json -s characterEntitiesLegacy -o character-entities-legacy.js", - "build-mangle": "browserify index.json -s characterEntitiesLegacy -p tinyify -o character-entities-legacy.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test": "npm run generate && npm run format && npm run build && npm run test-api" + "files": [ + "index.json" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" }, + "homepage": "https://github.com/wooorm/character-entities-legacy#readme", + "keywords": [ + "html", + "entity", + "entities", + "character", + "reference", + "name", + "replacement" + ], + "license": "MIT", + "main": "index.json", + "name": "character-entities-legacy", "prettier": { "tabWidth": 2, "useTabs": false, @@ -55,16 +57,30 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/character-entities-legacy.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.json -s characterEntitiesLegacy -o character-entities-legacy.js", + "build-mangle": "browserify index.json -s characterEntitiesLegacy -p tinyify -o character-entities-legacy.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "generate": "node build", + "test": "npm run generate && npm run format && npm run build && npm run test-api", + "test-api": "node test" + }, + "version": "1.1.4", "xo": { "prettier": true, "esnext": false, "ignores": [ "character-entities-legacy.js" ] - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/character-entities/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/character-entities/package.json index e1151d249e23dd..62ea9531be971e 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/character-entities/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/character-entities/package.json @@ -1,32 +1,23 @@ { - "name": "character-entities", - "version": "1.2.4", - "description": "HTML character entity information", - "license": "MIT", - "keywords": [ - "html", - "entity", - "entities", - "character", - "reference", - "name", - "replacement" - ], - "repository": "wooorm/character-entities", - "bugs": "https://github.com/wooorm/character-entities/issues", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/character-entities/issues" }, - "author": "Titus Wormer (https://wooorm.com)", + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "main": "index.json", - "files": [ - "index.json" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": {}, + "deprecated": false, + "description": "HTML character entity information", "devDependencies": { "bail": "^1.0.0", "browserify": "^16.0.0", @@ -38,16 +29,26 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "scripts": { - "generate": "node build", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify index.json -s characterEntities -o character-entities.js", - "build-mangle": "browserify index.json -s characterEntities -p tinyify -o character-entities.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "lint": "xo", - "test-api": "node test", - "test": "npm run generate && npm run format && npm run build && npm run test-api" + "files": [ + "index.json" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" }, + "homepage": "https://github.com/wooorm/character-entities#readme", + "keywords": [ + "html", + "entity", + "entities", + "character", + "reference", + "name", + "replacement" + ], + "license": "MIT", + "main": "index.json", + "name": "character-entities", "prettier": { "tabWidth": 2, "useTabs": false, @@ -56,16 +57,31 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/character-entities.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.json -s characterEntities -o character-entities.js", + "build-mangle": "browserify index.json -s characterEntities -p tinyify -o character-entities.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "generate": "node build", + "lint": "xo", + "test": "npm run generate && npm run format && npm run build && npm run test-api", + "test-api": "node test" + }, + "version": "1.2.4", "xo": { "prettier": true, "esnext": false, "ignores": [ "character-entities.js" ] - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/character-reference-invalid/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/character-reference-invalid/package.json index 069dc4b2b53901..52c4e1361f7c8e 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/character-reference-invalid/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/character-reference-invalid/package.json @@ -1,33 +1,23 @@ { - "name": "character-reference-invalid", - "version": "1.1.4", - "description": "HTML invalid numeric character reference information", - "license": "MIT", - "keywords": [ - "html", - "entity", - "numeric", - "character", - "reference", - "replacement", - "invalid", - "name" - ], - "repository": "wooorm/character-reference-invalid", - "bugs": "https://github.com/wooorm/character-reference-invalid/issues", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" }, - "author": "Titus Wormer (https://wooorm.com)", + "bugs": { + "url": "https://github.com/wooorm/character-reference-invalid/issues" + }, + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "main": "index.json", - "files": [ - "index.json" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": {}, + "deprecated": false, + "description": "HTML invalid numeric character reference information", "devDependencies": { "bail": "^1.0.0", "browserify": "^16.0.0", @@ -42,15 +32,27 @@ "unified": "^8.0.0", "xo": "^0.25.0" }, - "scripts": { - "generate": "node build", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify index.json -s characterReferenceInvalid -o character-reference-invalid.js", - "build-mangle": "browserify index.json -s characterReferenceInvalid -p tinyify -o character-reference-invalid.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test": "npm run generate && npm run format && npm run build && npm run test-api" + "files": [ + "index.json" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" }, + "homepage": "https://github.com/wooorm/character-reference-invalid#readme", + "keywords": [ + "html", + "entity", + "numeric", + "character", + "reference", + "replacement", + "invalid", + "name" + ], + "license": "MIT", + "main": "index.json", + "name": "character-reference-invalid", "prettier": { "tabWidth": 2, "useTabs": false, @@ -59,16 +61,30 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/character-reference-invalid.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.json -s characterReferenceInvalid -o character-reference-invalid.js", + "build-mangle": "browserify index.json -s characterReferenceInvalid -p tinyify -o character-reference-invalid.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "generate": "node build", + "test": "npm run generate && npm run format && npm run build && npm run test-api", + "test-api": "node test" + }, + "version": "1.1.4", "xo": { "prettier": true, "esnext": false, "ignores": [ "character-reference-invalid.js" ] - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/collapse-white-space/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/collapse-white-space/package.json index 6c9e8f348f4bc1..fd02ee65e2ed13 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/collapse-white-space/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/collapse-white-space/package.json @@ -1,27 +1,23 @@ { - "name": "collapse-white-space", - "version": "1.0.6", - "description": "Replace multiple white-space characters with a single space", - "license": "MIT", - "keywords": [ - "collapse", - "white", - "space" - ], - "repository": "wooorm/collapse-white-space", - "bugs": "https://github.com/wooorm/collapse-white-space/issues", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/collapse-white-space/issues" }, - "author": "Titus Wormer (https://wooorm.com)", + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "files": [ - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": {}, + "deprecated": false, + "description": "Replace multiple white-space characters with a single space", "devDependencies": { "browserify": "^16.0.0", "nyc": "^15.0.0", @@ -32,14 +28,26 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify . -s collapseWhiteSpace -o collapse-white-space.js", - "build-mangle": "browserify . -s collapseWhiteSpace -p tinyify -o collapse-white-space.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/collapse-white-space#readme", + "keywords": [ + "collapse", + "white", + "space" + ], + "license": "MIT", + "name": "collapse-white-space", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 }, "prettier": { "tabWidth": 2, @@ -49,22 +57,30 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/collapse-white-space.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s collapseWhiteSpace -o collapse-white-space.js", + "build-mangle": "browserify . -s collapseWhiteSpace -p tinyify -o collapse-white-space.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.6", "xo": { "prettier": true, "esnext": false, "ignores": [ "collapse-white-space.js" ] - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/extend/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/extend/package.json index 85279f78054e5c..429364c0c37d04 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/extend/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/extend/package.json @@ -1,42 +1,52 @@ { - "name": "extend", - "author": "Stefan Thomas (http://www.justmoon.net)", - "version": "3.0.2", - "description": "Port of jQuery.extend for node.js and the browser", - "main": "index", - "scripts": { - "pretest": "npm run lint", - "test": "npm run tests-only", - "posttest": "npm run coverage-quiet", - "tests-only": "node test", - "coverage": "covert test/index.js", - "coverage-quiet": "covert test/index.js --quiet", - "lint": "npm run jscs && npm run eslint", - "jscs": "jscs *.js */*.js", - "eslint": "eslint *.js */*.js" - }, - "contributors": [ - { - "name": "Jordan Harband", - "url": "https://github.com/ljharb" - } - ], - "keywords": [ - "extend", - "clone", - "merge" - ], - "repository": { - "type": "git", - "url": "https://github.com/justmoon/node-extend.git" - }, - "dependencies": {}, - "devDependencies": { - "@ljharb/eslint-config": "^12.2.1", - "covert": "^1.1.0", - "eslint": "^4.19.1", - "jscs": "^3.0.7", - "tape": "^4.9.1" - }, - "license": "MIT" -} + "author": { + "name": "Stefan Thomas", + "email": "justmoon@members.fsf.org", + "url": "http://www.justmoon.net" + }, + "bugs": { + "url": "https://github.com/justmoon/node-extend/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Port of jQuery.extend for node.js and the browser", + "devDependencies": { + "@ljharb/eslint-config": "^12.2.1", + "covert": "^1.1.0", + "eslint": "^4.19.1", + "jscs": "^3.0.7", + "tape": "^4.9.1" + }, + "homepage": "https://github.com/justmoon/node-extend#readme", + "keywords": [ + "extend", + "clone", + "merge" + ], + "license": "MIT", + "main": "index", + "name": "extend", + "repository": { + "type": "git", + "url": "git+https://github.com/justmoon/node-extend.git" + }, + "scripts": { + "coverage": "covert test/index.js", + "coverage-quiet": "covert test/index.js --quiet", + "eslint": "eslint *.js */*.js", + "jscs": "jscs *.js */*.js", + "lint": "npm run jscs && npm run eslint", + "posttest": "npm run coverage-quiet", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "node test" + }, + "version": "3.0.2" +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/inherits/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/inherits/package.json index 37b4366b83e63e..9642125b71d65f 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/inherits/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/inherits/package.json @@ -1,7 +1,19 @@ { - "name": "inherits", + "browser": "./inherits_browser.js", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "bundleDependencies": false, + "deprecated": false, "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", - "version": "2.0.4", + "devDependencies": { + "tap": "^14.2.4" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ], + "homepage": "https://github.com/isaacs/inherits#readme", "keywords": [ "inheritance", "class", @@ -12,18 +24,15 @@ "browser", "browserify" ], - "main": "./inherits.js", - "browser": "./inherits_browser.js", - "repository": "git://github.com/isaacs/inherits", "license": "ISC", + "main": "./inherits.js", + "name": "inherits", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits.git" + }, "scripts": { "test": "tap" }, - "devDependencies": { - "tap": "^14.2.4" - }, - "files": [ - "inherits.js", - "inherits_browser.js" - ] -} + "version": "2.0.4" +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/is-alphabetical/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/is-alphabetical/package.json index c7764f2a09e8c8..312a56e6e0add2 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/is-alphabetical/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/is-alphabetical/package.json @@ -1,29 +1,23 @@ { - "name": "is-alphabetical", - "version": "1.0.4", - "description": "Check if a character is alphabetical", - "license": "MIT", - "keywords": [ - "string", - "character", - "char", - "code", - "alphabetical" - ], - "repository": "wooorm/is-alphabetical", - "bugs": "https://github.com/wooorm/is-alphabetical/issues", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" }, - "author": "Titus Wormer (https://wooorm.com)", + "bugs": { + "url": "https://github.com/wooorm/is-alphabetical/issues" + }, + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "files": [ - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": {}, + "deprecated": false, + "description": "Check if a character is alphabetical", "devDependencies": { "browserify": "^16.0.0", "nyc": "^15.0.0", @@ -34,14 +28,28 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify -s isAlphabetical -o is-alphabetical.js", - "build-mangle": "browserify -s isAlphabetical -p tinyify -o is-alphabetical.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/is-alphabetical#readme", + "keywords": [ + "string", + "character", + "char", + "code", + "alphabetical" + ], + "license": "MIT", + "name": "is-alphabetical", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 }, "prettier": { "tabWidth": 2, @@ -51,6 +59,25 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/is-alphabetical.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify -s isAlphabetical -o is-alphabetical.js", + "build-mangle": "browserify -s isAlphabetical -p tinyify -o is-alphabetical.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.4", "xo": { "prettier": true, "esnext": false, @@ -60,16 +87,5 @@ "ignores": [ "is-alphabetical.js" ] - }, - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/is-alphanumerical/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/is-alphanumerical/package.json index edaa31e66f0ea1..09c2212afe3978 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/is-alphanumerical/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/is-alphanumerical/package.json @@ -1,34 +1,26 @@ { - "name": "is-alphanumerical", - "version": "1.0.4", - "description": "Check if a character is alphanumerical", - "license": "MIT", - "keywords": [ - "string", - "character", - "char", - "code", - "alphabetical", - "numerical", - "alphanumerical" - ], - "repository": "wooorm/is-alphanumerical", - "bugs": "https://github.com/wooorm/is-alphanumerical/issues", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/is-alphanumerical/issues" }, - "author": "Titus Wormer (https://wooorm.com)", + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "files": [ - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": { "is-alphabetical": "^1.0.0", "is-decimal": "^1.0.0" }, + "deprecated": false, + "description": "Check if a character is alphanumerical", "devDependencies": { "browserify": "^16.0.0", "nyc": "^15.0.0", @@ -39,14 +31,30 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify . -s isAlphanumerical -o is-alphanumerical.js", - "build-mangle": "browserify . -s isAlphanumerical -p tinyify -o is-alphanumerical.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/is-alphanumerical#readme", + "keywords": [ + "string", + "character", + "char", + "code", + "alphabetical", + "numerical", + "alphanumerical" + ], + "license": "MIT", + "name": "is-alphanumerical", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 }, "prettier": { "tabWidth": 2, @@ -56,22 +64,30 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/is-alphanumerical.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s isAlphanumerical -o is-alphanumerical.js", + "build-mangle": "browserify . -s isAlphanumerical -p tinyify -o is-alphanumerical.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.4", "xo": { "prettier": true, "esnext": false, "ignores": [ "is-alphanumerical.js" ] - }, - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/is-buffer/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/is-buffer/package.json index ea12137a63cf0f..ccde4062936080 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/is-buffer/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/is-buffer/package.json @@ -1,7 +1,4 @@ { - "name": "is-buffer", - "description": "Determine if an object is a Buffer", - "version": "1.1.6", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", @@ -10,12 +7,16 @@ "bugs": { "url": "https://github.com/feross/is-buffer/issues" }, + "bundleDependencies": false, "dependencies": {}, + "deprecated": false, + "description": "Determine if an object is a Buffer", "devDependencies": { "standard": "*", "tape": "^4.0.0", "zuul": "^3.0.0" }, + "homepage": "https://github.com/feross/is-buffer#readme", "keywords": [ "buffer", "buffers", @@ -35,6 +36,7 @@ ], "license": "MIT", "main": "index.js", + "name": "is-buffer", "repository": { "type": "git", "url": "git://github.com/feross/is-buffer.git" @@ -47,5 +49,6 @@ }, "testling": { "files": "test/*.js" - } -} + }, + "version": "1.1.6" +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/is-decimal/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/is-decimal/package.json index 5589c2a4f1f1b7..9c9d45e06dc51d 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/is-decimal/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/is-decimal/package.json @@ -1,29 +1,23 @@ { - "name": "is-decimal", - "version": "1.0.4", - "description": "Check if a character is decimal", - "license": "MIT", - "keywords": [ - "string", - "character", - "char", - "code", - "decimal" - ], - "repository": "wooorm/is-decimal", - "bugs": "https://github.com/wooorm/is-decimal/issues", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" }, - "author": "Titus Wormer (https://wooorm.com)", + "bugs": { + "url": "https://github.com/wooorm/is-decimal/issues" + }, + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "files": [ - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": {}, + "deprecated": false, + "description": "Check if a character is decimal", "devDependencies": { "browserify": "^16.0.0", "nyc": "^15.0.0", @@ -34,14 +28,28 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify . -s isDecimal -o is-decimal.js", - "build-mangle": "browserify . -s isDecimal -p tinyify -o is-decimal.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/is-decimal#readme", + "keywords": [ + "string", + "character", + "char", + "code", + "decimal" + ], + "license": "MIT", + "name": "is-decimal", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 }, "prettier": { "tabWidth": 2, @@ -51,22 +59,30 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/is-decimal.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s isDecimal -o is-decimal.js", + "build-mangle": "browserify . -s isDecimal -p tinyify -o is-decimal.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.4", "xo": { "prettier": true, "esnext": false, "ignores": [ "is-decimal.js" ] - }, - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/is-hexadecimal/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/is-hexadecimal/package.json index b8741fe102945a..acd830adc42206 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/is-hexadecimal/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/is-hexadecimal/package.json @@ -1,29 +1,23 @@ { - "name": "is-hexadecimal", - "version": "1.0.4", - "description": "Check if a character is hexadecimal", - "license": "MIT", - "keywords": [ - "string", - "character", - "char", - "code", - "hexadecimal" - ], - "repository": "wooorm/is-hexadecimal", - "bugs": "https://github.com/wooorm/is-hexadecimal/issues", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" }, - "author": "Titus Wormer (https://wooorm.com)", + "bugs": { + "url": "https://github.com/wooorm/is-hexadecimal/issues" + }, + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "files": [ - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": {}, + "deprecated": false, + "description": "Check if a character is hexadecimal", "devDependencies": { "browserify": "^16.0.0", "nyc": "^15.0.0", @@ -34,14 +28,28 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify . -s isHexadecimal -o is-hexadecimal.js", - "build-mangle": "browserify . -s isHexadecimal -p tinyify -o is-hexadecimal.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/is-hexadecimal#readme", + "keywords": [ + "string", + "character", + "char", + "code", + "hexadecimal" + ], + "license": "MIT", + "name": "is-hexadecimal", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 }, "prettier": { "tabWidth": 2, @@ -51,22 +59,30 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/is-hexadecimal.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s isHexadecimal -o is-hexadecimal.js", + "build-mangle": "browserify . -s isHexadecimal -p tinyify -o is-hexadecimal.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.4", "xo": { "prettier": true, "esnext": false, "ignores": [ "is-hexadecimal.js" ] - }, - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/is-plain-obj/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/is-plain-obj/package.json index d331f6e8169900..64475946dac06c 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/is-plain-obj/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/is-plain-obj/package.json @@ -1,23 +1,25 @@ { - "name": "is-plain-obj", - "version": "1.1.0", - "description": "Check if a value is a plain object", - "license": "MIT", - "repository": "sindresorhus/is-plain-obj", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, + "bugs": { + "url": "https://github.com/sindresorhus/is-plain-obj/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if a value is a plain object", + "devDependencies": { + "ava": "0.0.4" + }, "engines": { "node": ">=0.10.0" }, - "scripts": { - "test": "node test.js" - }, "files": [ "index.js" ], + "homepage": "https://github.com/sindresorhus/is-plain-obj#readme", "keywords": [ "obj", "object", @@ -30,7 +32,14 @@ "pure", "simple" ], - "devDependencies": { - "ava": "0.0.4" - } -} + "license": "MIT", + "name": "is-plain-obj", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-plain-obj.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.1.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/is-whitespace-character/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/is-whitespace-character/package.json index d6b35d9a0b5df4..6a7a6597798e5e 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/is-whitespace-character/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/is-whitespace-character/package.json @@ -1,31 +1,23 @@ { - "name": "is-whitespace-character", - "version": "1.0.4", - "description": "Check if a character is a whitespace character", - "license": "MIT", - "keywords": [ - "string", - "character", - "char", - "code", - "whitespace", - "white", - "space" - ], - "repository": "wooorm/is-whitespace-character", - "bugs": "https://github.com/wooorm/is-whitespace-character/issues", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/is-whitespace-character/issues" }, - "author": "Titus Wormer (https://wooorm.com)", + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "files": [ - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": {}, + "deprecated": false, + "description": "Check if a character is a whitespace character", "devDependencies": { "browserify": "^16.0.0", "nyc": "^15.0.0", @@ -36,14 +28,30 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify . -s isWhitespaceCharacter -o is-whitespace-character.js", - "build-mangle": "browserify . -s isWhitespaceCharacter -p tinyify -o is-whitespace-character.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/is-whitespace-character#readme", + "keywords": [ + "string", + "character", + "char", + "code", + "whitespace", + "white", + "space" + ], + "license": "MIT", + "name": "is-whitespace-character", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 }, "prettier": { "tabWidth": 2, @@ -53,22 +61,30 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/is-whitespace-character.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s isWhitespaceCharacter -o is-whitespace-character.js", + "build-mangle": "browserify . -s isWhitespaceCharacter -p tinyify -o is-whitespace-character.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.4", "xo": { "prettier": true, "esnext": false, "ignores": [ "is-whitespace-character.js" ] - }, - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/is-word-character/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/is-word-character/package.json index 42c262cf64fa63..b2fc0a1558ce2d 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/is-word-character/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/is-word-character/package.json @@ -1,29 +1,23 @@ { - "name": "is-word-character", - "version": "1.0.4", - "description": "Check if a character is a word character", - "license": "MIT", - "keywords": [ - "string", - "character", - "char", - "code", - "word" - ], - "repository": "wooorm/is-word-character", - "bugs": "https://github.com/wooorm/is-word-character/issues", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" }, - "author": "Titus Wormer (https://wooorm.com)", + "bugs": { + "url": "https://github.com/wooorm/is-word-character/issues" + }, + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "files": [ - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": {}, + "deprecated": false, + "description": "Check if a character is a word character", "devDependencies": { "browserify": "^16.0.0", "nyc": "^15.0.0", @@ -34,14 +28,28 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify . -s isWordCharacter -o is-word-character.js", - "build-mangle": "browserify . -s isWordCharacter -p tinyify -o is-word-character.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/is-word-character#readme", + "keywords": [ + "string", + "character", + "char", + "code", + "word" + ], + "license": "MIT", + "name": "is-word-character", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 }, "prettier": { "tabWidth": 2, @@ -51,22 +59,30 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/is-word-character.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s isWordCharacter -o is-word-character.js", + "build-mangle": "browserify . -s isWordCharacter -p tinyify -o is-word-character.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.4", "xo": { "prettier": true, "esnext": false, "ignores": [ "is-word-character.js" ] - }, - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/markdown-escapes/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/markdown-escapes/package.json index 7f94d86ad7acc9..0e4eed169f2b65 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/markdown-escapes/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/markdown-escapes/package.json @@ -1,29 +1,23 @@ { - "name": "markdown-escapes", - "version": "1.0.4", - "description": "List of escapable characters in markdown", - "license": "MIT", - "keywords": [ - "markdown", - "escape", - "pedantic", - "gfm", - "commonmark" - ], - "repository": "wooorm/markdown-escapes", - "bugs": "https://github.com/wooorm/markdown-escapes/issues", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" }, - "author": "Titus Wormer (https://wooorm.com)", + "bugs": { + "url": "https://github.com/wooorm/markdown-escapes/issues" + }, + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "files": [ - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": {}, + "deprecated": false, + "description": "List of escapable characters in markdown", "devDependencies": { "browserify": "^16.0.0", "nyc": "^14.0.0", @@ -34,19 +28,28 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify . -s markdownEscapes -o markdown-escapes.js", - "build-mangle": "browserify . -s markdownEscapes -p tinyify -o markdown-escapes.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] + "homepage": "https://github.com/wooorm/markdown-escapes#readme", + "keywords": [ + "markdown", + "escape", + "pedantic", + "gfm", + "commonmark" + ], + "license": "MIT", + "name": "markdown-escapes", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 }, "prettier": { "tabWidth": 2, @@ -56,17 +59,30 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/markdown-escapes.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s markdownEscapes -o markdown-escapes.js", + "build-mangle": "browserify . -s markdownEscapes -p tinyify -o markdown-escapes.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.4", "xo": { "prettier": true, "esnext": false, "ignores": [ "markdown-escapes.js" ] - }, - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/package.json index a5e1bc46f6a9ba..f2eee3452e6f79 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/package.json @@ -1,32 +1,22 @@ { - "name": "parse-entities", - "version": "1.2.2", - "description": "Parse HTML character references: fast, spec-compliant, positional information", - "license": "MIT", - "keywords": [ - "parse", - "html", - "character", - "reference", - "entity", - "entities" - ], - "repository": "wooorm/parse-entities", - "bugs": "https://github.com/wooorm/parse-entities/issues", - "author": "Titus Wormer (https://wooorm.com)", - "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, "browser": { "./decode-entity.js": "./decode-entity.browser.js" }, - "react-native": { - "./decode-entity.js": "./decode-entity.js" + "bugs": { + "url": "https://github.com/wooorm/parse-entities/issues" }, - "files": [ - "index.js", - "decode-entity.js", - "decode-entity.browser.js" + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": { "character-entities": "^1.0.0", @@ -36,6 +26,8 @@ "is-decimal": "^1.0.0", "is-hexadecimal": "^1.0.0" }, + "deprecated": false, + "description": "Parse HTML character references: fast, spec-compliant, positional information", "devDependencies": { "browserify": "^16.0.0", "nyc": "^14.0.0", @@ -47,16 +39,22 @@ "tinyify": "^2.4.3", "xo": "^0.24.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify . -s parseEntities > parse-entities.js", - "build-mangle": "browserify . -s parseEntities -p tinyify > parse-entities.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test-browser": "browserify test.js | tape-run", - "test": "npm run format && npm run build && npm run test-coverage && npm run test-browser" - }, + "files": [ + "index.js", + "decode-entity.js", + "decode-entity.browser.js" + ], + "homepage": "https://github.com/wooorm/parse-entities#readme", + "keywords": [ + "parse", + "html", + "character", + "reference", + "entity", + "entities" + ], + "license": "MIT", + "name": "parse-entities", "nyc": { "check-coverage": true, "lines": 100, @@ -71,6 +69,29 @@ "semi": false, "trailingComma": "none" }, + "react-native": { + "./decode-entity.js": "./decode-entity.js" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/parse-entities.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s parseEntities > parse-entities.js", + "build-mangle": "browserify . -s parseEntities -p tinyify > parse-entities.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage && npm run test-browser", + "test-api": "node test", + "test-browser": "browserify test.js | tape-run", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.2.2", "xo": { "prettier": true, "esnext": false, @@ -82,10 +103,5 @@ "ignores": [ "parse-entities.js" ] - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/remark-parse/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/remark-parse/package.json index 822420cb25200a..b47866c95b256b 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/remark-parse/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/remark-parse/package.json @@ -1,27 +1,23 @@ { - "name": "remark-parse", - "version": "5.0.0", - "description": "Markdown parser for remark", - "license": "MIT", - "keywords": [ - "markdown", - "abstract", - "syntax", - "tree", - "ast", - "parse" - ], - "homepage": "http://remark.js.org", - "repository": "https://github.com/remarkjs/remark/tree/master/packages/remark-parse", - "bugs": "https://github.com/remarkjs/remark/issues", - "author": "Titus Wormer (http://wooorm.com)", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/remarkjs/remark/issues" + }, + "bundleDependencies": false, "contributors": [ - "Titus Wormer (http://wooorm.com)", - "Eugene Sharygin " - ], - "files": [ - "index.js", - "lib" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + { + "name": "Eugene Sharygin", + "email": "eush77@gmail.com" + } ], "dependencies": { "collapse-white-space": "^1.0.2", @@ -40,5 +36,27 @@ "vfile-location": "^2.0.0", "xtend": "^4.0.1" }, + "deprecated": false, + "description": "Markdown parser for remark", + "files": [ + "index.js", + "lib" + ], + "homepage": "http://remark.js.org", + "keywords": [ + "markdown", + "abstract", + "syntax", + "tree", + "ast", + "parse" + ], + "license": "MIT", + "name": "remark-parse", + "repository": { + "type": "git", + "url": "https://github.com/remarkjs/remark/tree/master/packages/remark-parse" + }, + "version": "5.0.0", "xo": false -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/repeat-string/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/repeat-string/package.json index 09f889299b6683..90fa9a34d8afb7 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/repeat-string/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/repeat-string/package.json @@ -1,31 +1,41 @@ { - "name": "repeat-string", - "description": "Repeat the given string n times. Fastest implementation for repeating a string.", - "version": "1.6.1", - "homepage": "https://github.com/jonschlinkert/repeat-string", - "author": "Jon Schlinkert (http://github.com/jonschlinkert)", - "contributors": [ - "Brian Woodward (https://github.com/doowb)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)", - "Linus Unnebäck (http://linus.unnebäck.se)", - "Thijs Busser (http://tbusser.net)", - "Titus (wooorm.com)" - ], - "repository": "jonschlinkert/repeat-string", + "author": { + "name": "Jon Schlinkert", + "url": "http://github.com/jonschlinkert" + }, "bugs": { "url": "https://github.com/jonschlinkert/repeat-string/issues" }, - "license": "MIT", - "files": [ - "index.js" + "bundleDependencies": false, + "contributors": [ + { + "name": "Brian Woodward", + "email": "brian.woodward@gmail.com", + "url": "https://github.com/doowb" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Linus Unnebäck", + "email": "linus@folkdatorn.se", + "url": "http://linus.unnebäck.se" + }, + { + "name": "Thijs Busser", + "email": "tbusser@gmail.com", + "url": "http://tbusser.net" + }, + { + "name": "Titus", + "email": "tituswormer@gmail.com", + "url": "wooorm.com" + } ], - "main": "index.js", - "engines": { - "node": ">=0.10" - }, - "scripts": { - "test": "mocha" - }, + "deprecated": false, + "description": "Repeat the given string n times. Fastest implementation for repeating a string.", "devDependencies": { "ansi-cyan": "^0.1.1", "benchmarked": "^0.2.5", @@ -36,6 +46,13 @@ "text-table": "^0.2.0", "yargs-parser": "^4.0.2" }, + "engines": { + "node": ">=0.10" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/repeat-string", "keywords": [ "fast", "fastest", @@ -53,6 +70,16 @@ "string", "times" ], + "license": "MIT", + "main": "index.js", + "name": "repeat-string", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/repeat-string.git" + }, + "scripts": { + "test": "mocha" + }, "verb": { "toc": false, "layout": "default", @@ -73,5 +100,6 @@ "reflinks": [ "verb" ] - } -} + }, + "version": "1.6.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/replace-ext/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/replace-ext/package.json index 27dbe31042d0ff..e616e7c2258223 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/replace-ext/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/replace-ext/package.json @@ -1,30 +1,26 @@ { - "name": "replace-ext", - "version": "1.0.0", - "description": "Replaces a file extension with another one", - "author": "Gulp Team (http://gulpjs.com/)", - "contributors": [ - "Eric Schoffstall ", - "Blaine Bublitz " - ], - "repository": "gulpjs/replace-ext", - "license": "MIT", - "engines": { - "node": ">= 0.10" + "author": { + "name": "Gulp Team", + "email": "team@gulpjs.com", + "url": "http://gulpjs.com/" }, - "main": "index.js", - "files": [ - "LICENSE", - "index.js" - ], - "scripts": { - "lint": "eslint . && jscs index.js test/", - "pretest": "npm run lint", - "test": "mocha --async-only", - "cover": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly", - "coveralls": "npm run cover && istanbul-coveralls" + "bugs": { + "url": "https://github.com/gulpjs/replace-ext/issues" }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Eric Schoffstall", + "email": "yo@contra.io" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com" + } + ], "dependencies": {}, + "deprecated": false, + "description": "Replaces a file extension with another one", "devDependencies": { "eslint": "^1.10.3", "eslint-config-gulp": "^2.0.0", @@ -35,10 +31,33 @@ "jscs-preset-gulp": "^1.0.0", "mocha": "^2.4.5" }, + "engines": { + "node": ">= 0.10" + }, + "files": [ + "LICENSE", + "index.js" + ], + "homepage": "https://github.com/gulpjs/replace-ext#readme", "keywords": [ "gulp", "extensions", "filepath", "basename" - ] -} + ], + "license": "MIT", + "main": "index.js", + "name": "replace-ext", + "repository": { + "type": "git", + "url": "git+https://github.com/gulpjs/replace-ext.git" + }, + "scripts": { + "cover": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly", + "coveralls": "npm run cover && istanbul-coveralls", + "lint": "eslint . && jscs index.js test/", + "pretest": "npm run lint", + "test": "mocha --async-only" + }, + "version": "1.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/state-toggle/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/state-toggle/package.json index 1111db063669a9..573df7117bfe98 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/state-toggle/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/state-toggle/package.json @@ -1,27 +1,23 @@ { - "name": "state-toggle", - "version": "1.0.3", - "description": "Enter/exit a state", - "license": "MIT", - "keywords": [ - "enter", - "exit", - "state" - ], - "repository": "wooorm/state-toggle", - "bugs": "https://github.com/wooorm/state-toggle/issues", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/state-toggle/issues" }, - "author": "Titus Wormer (https://wooorm.com)", + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "files": [ - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": {}, + "deprecated": false, + "description": "Enter/exit a state", "devDependencies": { "browserify": "^16.0.0", "nyc": "^15.0.0", @@ -32,14 +28,26 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify . -s stateToggle -o state-toggle.js", - "build-mangle": "browserify . -s stateToggle -p tinyify -o state-toggle.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/state-toggle#readme", + "keywords": [ + "enter", + "exit", + "state" + ], + "license": "MIT", + "name": "state-toggle", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 }, "prettier": { "tabWidth": 2, @@ -49,22 +57,30 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/state-toggle.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s stateToggle -o state-toggle.js", + "build-mangle": "browserify . -s stateToggle -p tinyify -o state-toggle.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.3", "xo": { "prettier": true, "esnext": false, "ignores": [ "state-toggle.js" ] - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/trim-trailing-lines/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/trim-trailing-lines/package.json index 861198394c3220..c0242dc1299bdc 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/trim-trailing-lines/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/trim-trailing-lines/package.json @@ -1,29 +1,23 @@ { - "name": "trim-trailing-lines", - "version": "1.1.4", - "description": "Remove final line feeds from a string", - "license": "MIT", - "keywords": [ - "trim", - "final", - "line", - "newline", - "characters" - ], - "repository": "wooorm/trim-trailing-lines", - "bugs": "https://github.com/wooorm/trim-trailing-lines/issues", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/trim-trailing-lines/issues" }, - "author": "Titus Wormer (https://wooorm.com)", + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "files": [ - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": {}, + "deprecated": false, + "description": "Remove final line feeds from a string", "devDependencies": { "browserify": "^17.0.0", "nyc": "^15.0.0", @@ -34,15 +28,23 @@ "tinyify": "^3.0.0", "xo": "^0.34.0" }, - "scripts": { - "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", - "build-bundle": "browserify . -s trimTrailingLines -o trim-trailing-lines.js", - "build-mangle": "browserify . -s trimTrailingLines -p tinyify -o trim-trailing-lines.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" }, + "homepage": "https://github.com/wooorm/trim-trailing-lines#readme", + "keywords": [ + "trim", + "final", + "line", + "newline", + "characters" + ], + "license": "MIT", + "name": "trim-trailing-lines", "nyc": { "check-coverage": true, "lines": 100, @@ -57,16 +59,30 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/trim-trailing-lines.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s trimTrailingLines -o trim-trailing-lines.js", + "build-mangle": "browserify . -s trimTrailingLines -p tinyify -o trim-trailing-lines.min.js", + "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.1.4", "xo": { "prettier": true, "esnext": false, "ignores": [ "trim-trailing-lines.js" ] - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/trim/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/trim/package.json index 64ee5c69d84c32..b6c977af444974 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/trim/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/trim/package.json @@ -1,18 +1,26 @@ { - "name": "trim", - "version": "0.0.1", - "description": "Trim string whitespace", - "keywords": ["string", "trim"], - "author": "TJ Holowaychuk ", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "bundleDependencies": false, + "component": { + "scripts": { + "trim/index.js": "index.js" + } + }, "dependencies": {}, + "deprecated": false, + "description": "Trim string whitespace", "devDependencies": { "mocha": "*", "should": "*" }, + "keywords": [ + "string", + "trim" + ], "main": "index", - "component": { - "scripts": { - "trim/index.js": "index.js" - } - } -} + "name": "trim", + "version": "0.0.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/trough/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/trough/package.json index cbf7782f89a445..d4203f3a15d71f 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/trough/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/trough/package.json @@ -1,27 +1,23 @@ { - "name": "trough", - "version": "1.0.5", - "description": "Middleware: a channel used to convey a liquid", - "license": "MIT", - "keywords": [ - "middleware", - "ware" - ], - "repository": "wooorm/trough", - "bugs": "https://github.com/wooorm/trough/issues", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" }, - "author": "Titus Wormer (https://wooorm.com)", + "bugs": { + "url": "https://github.com/wooorm/trough/issues" + }, + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "files": [ - "index.js", - "wrap.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": {}, + "deprecated": false, + "description": "Middleware: a channel used to convey a liquid", "devDependencies": { "browserify": "^16.0.0", "nyc": "^15.0.0", @@ -32,14 +28,26 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify index.js -s trough > trough.js", - "build-mangle": "browserify index.js -s trough -p tinyify > trough.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" + "files": [ + "index.js", + "wrap.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/trough#readme", + "keywords": [ + "middleware", + "ware" + ], + "license": "MIT", + "name": "trough", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 }, "prettier": { "tabWidth": 2, @@ -49,6 +57,25 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/trough.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js -s trough > trough.js", + "build-mangle": "browserify index.js -s trough -p tinyify > trough.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.5", "xo": { "prettier": true, "esnext": false, @@ -60,16 +87,5 @@ "ignores": [ "trough.js" ] - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/unherit/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/unherit/package.json index 445a500650255e..b3cb27e60d4ebe 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/unherit/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/unherit/package.json @@ -1,31 +1,26 @@ { - "name": "unherit", - "version": "1.1.3", - "description": "Clone a constructor without affecting the super-class", - "license": "MIT", - "keywords": [ - "clone", - "super", - "class", - "constructor" - ], - "repository": "wooorm/unherit", - "bugs": "https://github.com/wooorm/unherit/issues", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/unherit/issues" }, - "author": "Titus Wormer (https://wooorm.com)", + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "files": [ - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": { "inherits": "^2.0.0", "xtend": "^4.0.0" }, + "deprecated": false, + "description": "Clone a constructor without affecting the super-class", "devDependencies": { "browserify": "^16.0.0", "nyc": "^15.0.0", @@ -36,15 +31,22 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify . -s unherit -o unherit.js", - "build-mangle": "browserify . -s unherit -p tinyify -o unherit.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" }, + "homepage": "https://github.com/wooorm/unherit#readme", + "keywords": [ + "clone", + "super", + "class", + "constructor" + ], + "license": "MIT", + "name": "unherit", "prettier": { "tabWidth": 2, "useTabs": false, @@ -53,6 +55,25 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/unherit.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s unherit -o unherit.js", + "build-mangle": "browserify . -s unherit -p tinyify -o unherit.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.1.3", "xo": { "prettier": true, "esnext": false, @@ -63,10 +84,5 @@ "ignores": [ "unherit.js" ] - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/unified/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/unified/package.json index 21777216934520..5142140ddfdf9c 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/unified/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/unified/package.json @@ -1,27 +1,19 @@ { - "name": "unified", - "version": "6.2.0", - "description": "Pluggable text processing interface", - "license": "MIT", - "keywords": [ - "process", - "parse", - "transform", - "compile", - "stringify", - "rehype", - "retext", - "remark" - ], - "repository": "unifiedjs/unified", - "bugs": "https://github.com/unifiedjs/unified/issues", - "author": "Titus Wormer (http://wooorm.com)", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/unifiedjs/unified/issues" + }, + "bundleDependencies": false, "contributors": [ - "Titus Wormer (http://wooorm.com)" - ], - "files": [ - "index.js", - "lib" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } ], "dependencies": { "bail": "^1.0.0", @@ -31,6 +23,8 @@ "vfile": "^2.0.0", "x-is-string": "^0.1.0" }, + "deprecated": false, + "description": "Pluggable text processing interface", "devDependencies": { "browserify": "^16.0.0", "esmangle": "^1.0.0", @@ -41,15 +35,23 @@ "tape": "^4.4.0", "xo": "^0.20.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write '**/*.js' && xo --fix", - "build-bundle": "browserify index.js -s unified > unified.js", - "build-mangle": "esmangle unified.js > unified.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test", - "test": "npm run format && npm run build && npm run test-coverage" - }, + "files": [ + "index.js", + "lib" + ], + "homepage": "https://github.com/unifiedjs/unified#readme", + "keywords": [ + "process", + "parse", + "transform", + "compile", + "stringify", + "rehype", + "retext", + "remark" + ], + "license": "MIT", + "name": "unified", "nyc": { "check-coverage": true, "lines": 100, @@ -64,6 +66,25 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/unifiedjs/unified.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js -s unified > unified.js", + "build-mangle": "esmangle unified.js > unified.min.js", + "format": "remark . -qfo && prettier --write '**/*.js' && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test" + }, + "version": "6.2.0", "xo": { "prettier": true, "esnext": false, @@ -77,10 +98,5 @@ "ignores": [ "unified.js" ] - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-is/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-is/package.json index 25193acddd8a0d..780e6d7618a9fd 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-is/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-is/package.json @@ -1,29 +1,23 @@ { - "name": "unist-util-is", - "version": "3.0.0", - "description": "Utility to check if a node passes a test", - "license": "MIT", - "keywords": [ - "unist", - "node", - "is", - "equal", - "test", - "type", - "util", - "utility" - ], - "repository": "syntax-tree/unist-util-is", - "bugs": "https://github.com/syntax-tree/unist-util-is/issues", - "author": "Titus Wormer (https://wooorm.com)", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/syntax-tree/unist-util-is/issues" + }, + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "files": [ - "index.js", - "convert.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": {}, + "deprecated": false, + "description": "Utility to check if a node passes a test", "devDependencies": { "browserify": "^16.0.0", "nyc": "^14.0.0", @@ -34,14 +28,28 @@ "tinyify": "^2.0.0", "xo": "^0.24.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify . -s unistUtilIs > unist-util-is.js", - "build-mangle": "browserify . -s unistUtilIs -p tinyify > unist-util-is.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" + "files": [ + "index.js", + "convert.js" + ], + "homepage": "https://github.com/syntax-tree/unist-util-is#readme", + "keywords": [ + "unist", + "node", + "is", + "equal", + "test", + "type", + "util", + "utility" + ], + "license": "MIT", + "name": "unist-util-is", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 }, "prettier": { "tabWidth": 2, @@ -51,6 +59,25 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/syntax-tree/unist-util-is.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s unistUtilIs > unist-util-is.js", + "build-mangle": "browserify . -s unistUtilIs -p tinyify > unist-util-is.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "3.0.0", "xo": { "prettier": true, "esnext": false, @@ -60,16 +87,5 @@ "ignore": [ "unist-util-is.js" ] - }, - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-remove-position/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-remove-position/package.json index e1166471c37d6e..768b0c3e6cbc56 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-remove-position/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-remove-position/package.json @@ -1,31 +1,25 @@ { - "name": "unist-util-remove-position", - "version": "1.1.4", - "description": "Remove `position`s from a unist tree", - "license": "MIT", - "keywords": [ - "unist", - "utility", - "remove", - "position", - "location" - ], - "repository": "syntax-tree/unist-util-remove-position", - "bugs": "https://github.com/syntax-tree/unist-util-remove-position/issues", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" }, - "author": "Titus Wormer (https://wooorm.com)", + "bugs": { + "url": "https://github.com/syntax-tree/unist-util-remove-position/issues" + }, + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "files": [ - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": { "unist-util-visit": "^1.1.0" }, + "deprecated": false, + "description": "Remove `position`s from a unist tree", "devDependencies": { "browserify": "^16.0.0", "nyc": "^14.0.0", @@ -38,14 +32,28 @@ "unist-builder": "^2.0.0", "xo": "^0.25.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify . -s unistUtilRemovePosition > unist-util-remove-position.js", - "build-mangle": "browserify . -s unistUtilRemovePosition -p tinyify > unist-util-remove-position.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" + "files": [ + "index.js" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "homepage": "https://github.com/syntax-tree/unist-util-remove-position#readme", + "keywords": [ + "unist", + "utility", + "remove", + "position", + "location" + ], + "license": "MIT", + "name": "unist-util-remove-position", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 }, "prettier": { "tabWidth": 2, @@ -55,22 +63,30 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/syntax-tree/unist-util-remove-position.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s unistUtilRemovePosition > unist-util-remove-position.js", + "build-mangle": "browserify . -s unistUtilRemovePosition -p tinyify > unist-util-remove-position.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.1.4", "xo": { "prettier": true, "esnext": false, "ignores": [ "unist-util-remove-position.js" ] - }, - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-stringify-position/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-stringify-position/package.json index 2e20b672051031..fe85a400cb8590 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-stringify-position/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-stringify-position/package.json @@ -1,29 +1,23 @@ { - "name": "unist-util-stringify-position", - "version": "1.1.2", - "description": "Stringify a Unist node, position, or point", - "license": "MIT", - "keywords": [ - "unist", - "position", - "location", - "point", - "node", - "stringify", - "tostring", - "util", - "utility" - ], - "repository": "syntax-tree/unist-util-stringify-position", - "bugs": "https://github.com/syntax-tree/unist-util-stringify-position/issues", - "author": "Titus Wormer (http://wooorm.com)", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/syntax-tree/unist-util-stringify-position/issues" + }, + "bundleDependencies": false, "contributors": [ - "Titus Wormer (http://wooorm.com)" - ], - "files": [ - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } ], "dependencies": {}, + "deprecated": false, + "description": "Stringify a Unist node, position, or point", "devDependencies": { "browserify": "^16.0.0", "esmangle": "^1.0.0", @@ -34,15 +28,23 @@ "tape": "^4.5.1", "xo": "^0.20.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write '**/*.js' && xo --fix", - "build-bundle": "browserify index.js --no-builtins -s unistUtilStringifyPosition > unist-util-stringify-position.js", - "build-mangle": "esmangle unist-util-stringify-position.js > unist-util-stringify-position.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" - }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/syntax-tree/unist-util-stringify-position#readme", + "keywords": [ + "unist", + "position", + "location", + "point", + "node", + "stringify", + "tostring", + "util", + "utility" + ], + "license": "MIT", + "name": "unist-util-stringify-position", "nyc": { "check-coverage": true, "lines": 100, @@ -57,6 +59,25 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/syntax-tree/unist-util-stringify-position.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --no-builtins -s unistUtilStringifyPosition > unist-util-stringify-position.js", + "build-mangle": "esmangle unist-util-stringify-position.js > unist-util-stringify-position.min.js", + "format": "remark . -qfo && prettier --write '**/*.js' && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.1.2", "xo": { "prettier": true, "esnext": false, @@ -68,10 +89,5 @@ "ignores": [ "unist-util-stringify-position.js" ] - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-visit-parents/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-visit-parents/package.json index 26e187202d145b..79a66d8458bd3b 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-visit-parents/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-visit-parents/package.json @@ -1,26 +1,25 @@ { - "name": "unist-util-visit-parents", - "version": "2.1.2", - "description": "Recursively walk over unist nodes, with ancestral information", - "license": "MIT", - "keywords": [ - "unist", - "walk", - "util", - "utility" - ], - "repository": "syntax-tree/unist-util-visit-parents", - "bugs": "https://github.com/syntax-tree/unist-util-visit-parents/issues", - "author": "Titus Wormer (https://wooorm.com)", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/syntax-tree/unist-util-visit-parents/issues" + }, + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "files": [ - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": { "unist-util-is": "^3.0.0" }, + "deprecated": false, + "description": "Recursively walk over unist nodes, with ancestral information", "devDependencies": { "browserify": "^16.0.0", "nyc": "^14.0.0", @@ -32,15 +31,18 @@ "tinyify": "^2.0.0", "xo": "^0.24.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify index.js -s unistUtilVisitParents > unist-util-visit-parents.js", - "build-mangle": "browserify index.js -s unistUtilVisitParents -p tinyify > unist-util-visit-parents.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" - }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/syntax-tree/unist-util-visit-parents#readme", + "keywords": [ + "unist", + "walk", + "util", + "utility" + ], + "license": "MIT", + "name": "unist-util-visit-parents", "nyc": { "check-coverage": true, "lines": 100, @@ -55,16 +57,30 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/syntax-tree/unist-util-visit-parents.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js -s unistUtilVisitParents > unist-util-visit-parents.js", + "build-mangle": "browserify index.js -s unistUtilVisitParents -p tinyify > unist-util-visit-parents.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "2.1.2", "xo": { "prettier": true, "esnext": false, "ignores": [ "unist-util-visit-parents.js" ] - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-visit/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-visit/package.json index 44b8bd4897b398..a0ef4a3cc172d3 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-visit/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-visit/package.json @@ -1,35 +1,33 @@ { - "name": "unist-util-visit", - "version": "1.4.1", - "description": "Recursively walk over unist nodes", - "license": "MIT", - "keywords": [ - "unist", - "remark", - "markdown", - "retext", - "natural", - "language", - "node", - "visit", - "walk", - "util", - "utility" - ], - "repository": "syntax-tree/unist-util-visit", - "bugs": "https://github.com/syntax-tree/unist-util-visit/issues", - "author": "Titus Wormer (https://wooorm.com)", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/syntax-tree/unist-util-visit/issues" + }, + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)", - "Eugene Sharygin ", - "Richard Gibson " - ], - "files": [ - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + { + "name": "Eugene Sharygin", + "email": "eush77@gmail.com" + }, + { + "name": "Richard Gibson", + "email": "richard.gibson@gmail.com" + } ], "dependencies": { "unist-util-visit-parents": "^2.0.0" }, + "deprecated": false, + "description": "Recursively walk over unist nodes", "devDependencies": { "browserify": "^16.0.0", "nyc": "^14.0.0", @@ -41,15 +39,25 @@ "tinyify": "^2.0.0", "xo": "^0.24.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify . -s unistUtilVisit > unist-util-visit.js", - "build-mangle": "browserify . -s unistUtilVisit -p tinyify > unist-util-visit.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" - }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/syntax-tree/unist-util-visit#readme", + "keywords": [ + "unist", + "remark", + "markdown", + "retext", + "natural", + "language", + "node", + "visit", + "walk", + "util", + "utility" + ], + "license": "MIT", + "name": "unist-util-visit", "nyc": { "check-coverage": true, "lines": 100, @@ -64,16 +72,30 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/syntax-tree/unist-util-visit.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s unistUtilVisit > unist-util-visit.js", + "build-mangle": "browserify . -s unistUtilVisit -p tinyify > unist-util-visit.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.4.1", "xo": { "prettier": true, "esnext": false, "ignores": [ "unist-util-visit.js" ] - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/vfile-location/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile-location/package.json index f66857cf1c9cec..9db9207b5cb3c6 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/vfile-location/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile-location/package.json @@ -1,29 +1,23 @@ { - "name": "vfile-location", - "version": "2.0.6", - "description": "Convert between positions (line and column-based) and offsets (range-based) locations in a virtual file", - "license": "MIT", - "keywords": [ - "remark", - "comment", - "message", - "marker", - "control" - ], - "repository": "vfile/vfile-location", - "bugs": "https://github.com/vfile/vfile-location/issues", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/vfile/vfile-location/issues" }, - "author": "Titus Wormer (https://wooorm.com)", + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "files": [ - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": {}, + "deprecated": false, + "description": "Convert between positions (line and column-based) and offsets (range-based) locations in a virtual file", "devDependencies": { "browserify": "^16.0.0", "nyc": "^14.0.0", @@ -35,15 +29,23 @@ "vfile": "^4.0.0", "xo": "^0.25.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "build-bundle": "browserify . -s vfileLocation > vfile-location.js", - "build-mangle": "browserify . -s vfileLocation -p tinyify > vfile-location.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" + "files": [ + "index.js" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" }, + "homepage": "https://github.com/vfile/vfile-location#readme", + "keywords": [ + "remark", + "comment", + "message", + "marker", + "control" + ], + "license": "MIT", + "name": "vfile-location", "nyc": { "check-coverage": true, "lines": 100, @@ -58,16 +60,30 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/vfile/vfile-location.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s vfileLocation > vfile-location.js", + "build-mangle": "browserify . -s vfileLocation -p tinyify > vfile-location.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "2.0.6", "xo": { "prettier": true, "esnext": false, "ignores": [ "vfile-location.js" ] - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/package.json index 7396bb68e54f70..4a7b5a9867ff74 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/package.json @@ -1,25 +1,25 @@ { - "name": "vfile-message", - "version": "1.1.1", - "description": "Create a virtual message", - "license": "MIT", - "keywords": [ - "vfile", - "virtual", - "message" - ], - "repository": "vfile/vfile-message", - "bugs": "https://github.com/vfile/vfile-message/issues", - "author": "Titus Wormer (https://wooorm.com)", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/vfile/vfile-message/issues" + }, + "bundleDependencies": false, "contributors": [ - "Titus Wormer (https://wooorm.com)" - ], - "files": [ - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } ], "dependencies": { "unist-util-stringify-position": "^1.1.1" }, + "deprecated": false, + "description": "Create a virtual message", "devDependencies": { "browserify": "^16.0.0", "nyc": "^13.0.0", @@ -30,15 +30,17 @@ "tinyify": "^2.4.3", "xo": "^0.23.0" }, - "scripts": { - "format": "remark . -qfo && prettier --write '**/*.js' && xo --fix", - "build-bundle": "browserify . -s vfileMessage > vfile-message.js", - "build-mangle": "browserify . -s vfileMessage -p tinyify > vfile-message.min.js", - "build": "npm run build-bundle && npm run build-mangle", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run format && npm run build && npm run test-coverage" - }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/vfile/vfile-message#readme", + "keywords": [ + "vfile", + "virtual", + "message" + ], + "license": "MIT", + "name": "vfile-message", "nyc": { "check-coverage": true, "lines": 100, @@ -53,6 +55,25 @@ "semi": false, "trailingComma": "none" }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/vfile/vfile-message.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s vfileMessage > vfile-message.js", + "build-mangle": "browserify . -s vfileMessage -p tinyify > vfile-message.min.js", + "format": "remark . -qfo && prettier --write '**/*.js' && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.1.1", "xo": { "prettier": true, "esnext": false, @@ -64,10 +85,5 @@ "ignores": [ "vfile-message.js" ] - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/package.json index aba5f34dd9d5ab..98a004f48b3ce3 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/package.json @@ -1,33 +1,39 @@ { - "name": "vfile", - "version": "2.3.0", - "description": "Virtual file format for text processing", - "license": "MIT", - "keywords": [ - "virtual", - "file", - "text", - "processing", - "message", - "warning", - "error", - "remark", - "retext" - ], - "repository": "vfile/vfile", - "bugs": "https://github.com/vfile/vfile/issues", - "author": "Titus Wormer (http://wooorm.com)", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/vfile/vfile/issues" + }, + "bundleDependencies": false, "contributors": [ - "Titus Wormer (http://wooorm.com)", - "Brendan Abbott ", - "Denys Dovhan ", - "Kyle Mathews ", - "Shinnosuke Watanabe ", - "Sindre Sorhus " - ], - "files": [ - "core.js", - "index.js" + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + { + "name": "Brendan Abbott", + "email": "brendan.abbott@temando.com" + }, + { + "name": "Denys Dovhan", + "email": "email@denysdovhan.com" + }, + { + "name": "Kyle Mathews", + "email": "mathews.kyle@gmail.com" + }, + { + "name": "Shinnosuke Watanabe", + "email": "snnskwtnb@gmail.com" + }, + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com" + } ], "dependencies": { "is-buffer": "^1.1.4", @@ -35,6 +41,8 @@ "unist-util-stringify-position": "^1.0.0", "vfile-message": "^1.0.0" }, + "deprecated": false, + "description": "Virtual file format for text processing", "devDependencies": { "browserify": "^14.0.0", "esmangle": "^1.0.0", @@ -44,22 +52,50 @@ "tape": "^4.4.0", "xo": "^0.18.0" }, - "scripts": { - "build-md": "remark . -qfo", - "build-bundle": "browserify index.js -s VFile > vfile.js", - "build-mangle": "esmangle vfile.js > vfile.min.js", - "build": "npm run build-md && npm run build-bundle && npm run build-mangle", - "lint": "xo", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js", - "test": "npm run build && npm run lint && npm run test-coverage" - }, + "files": [ + "core.js", + "index.js" + ], + "homepage": "https://github.com/vfile/vfile#readme", + "keywords": [ + "virtual", + "file", + "text", + "processing", + "message", + "warning", + "error", + "remark", + "retext" + ], + "license": "MIT", + "name": "vfile", "nyc": { "check-coverage": true, "lines": 100, "functions": 100, "branches": 100 }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/vfile/vfile.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js -s VFile > vfile.js", + "build-mangle": "esmangle vfile.js > vfile.min.js", + "build-md": "remark . -qfo", + "lint": "xo", + "test": "npm run build && npm run lint && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "2.3.0", "xo": { "space": true, "esnext": false, @@ -69,10 +105,5 @@ "ignores": [ "vfile.js" ] - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/x-is-string/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/x-is-string/package.json index ea267ce35112e1..95f98fc9577d31 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/x-is-string/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/x-is-string/package.json @@ -1,40 +1,47 @@ { - "name": "x-is-string", - "version": "0.1.0", - "description": "Simple string test", - "keywords": [], - "author": "Matt-Esch ", - "repository": "git://github.com/Matt-Esch/x-is-string.git", - "main": "index", - "homepage": "https://github.com/Matt-Esch/x-is-string", + "author": { + "name": "Matt-Esch", + "email": "matt@mattesch.info" + }, + "bugs": { + "url": "https://github.com/Matt-Esch/x-is-string/issues", + "email": "matt@mattesch.info" + }, + "bundleDependencies": false, "contributors": [ { "name": "Matt-Esch" } ], - "bugs": { - "url": "https://github.com/Matt-Esch/x-is-string/issues", - "email": "matt@mattesch.info" - }, "dependencies": {}, + "deprecated": false, + "description": "Simple string test", "devDependencies": { "tape": "^2.12.2" }, + "homepage": "https://github.com/Matt-Esch/x-is-string", + "keywords": [], "licenses": [ { "type": "MIT", "url": "http://github.com/Matt-Esch/x-is-string/raw/master/LICENSE" } ], + "main": "index", + "name": "x-is-string", + "repository": { + "type": "git", + "url": "git://github.com/Matt-Esch/x-is-string.git" + }, "scripts": { - "test": "node ./test/index.js", + "cover": "istanbul cover --report none --print detail ./test/index.js", "start": "node ./index.js", - "watch": "nodemon -w ./index.js index.js", + "test": "node ./test/index.js", + "test-browser": "testem-browser ./test/browser/index.js", + "testem": "testem-both -b=./test/browser/index.js", "travis-test": "istanbul cover ./test/index.js && ((cat coverage/lcov.info | coveralls) || exit 0)", - "cover": "istanbul cover --report none --print detail ./test/index.js", "view-cover": "istanbul report html && google-chrome ./coverage/index.html", - "test-browser": "testem-browser ./test/browser/index.js", - "testem": "testem-both -b=./test/browser/index.js" + "watch": "nodemon -w ./index.js index.js" }, "testling": { "files": "test/index.js", @@ -51,5 +58,6 @@ "iphone/6.0..latest", "android-browser/4.2..latest" ] - } -} + }, + "version": "0.1.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/xtend/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/xtend/package.json index f7a39d10af5f5e..970fcf29de706d 100644 --- a/tools/node_modules/eslint-plugin-markdown/node_modules/xtend/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/xtend/package.json @@ -1,7 +1,31 @@ { - "name": "xtend", - "version": "4.0.2", + "author": { + "name": "Raynos", + "email": "raynos2@gmail.com" + }, + "bugs": { + "url": "https://github.com/Raynos/xtend/issues", + "email": "raynos2@gmail.com" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jake Verbaten" + }, + { + "name": "Matt Esch" + } + ], + "dependencies": {}, + "deprecated": false, "description": "extend like a boss", + "devDependencies": { + "tape": "~1.1.0" + }, + "engines": { + "node": ">=0.4" + }, + "homepage": "https://github.com/Raynos/xtend", "keywords": [ "extend", "merge", @@ -10,30 +34,16 @@ "object", "array" ], - "author": "Raynos ", - "repository": "git://github.com/Raynos/xtend.git", + "license": "MIT", "main": "immutable", + "name": "xtend", + "repository": { + "type": "git", + "url": "git://github.com/Raynos/xtend.git" + }, "scripts": { "test": "node test" }, - "dependencies": {}, - "devDependencies": { - "tape": "~1.1.0" - }, - "homepage": "https://github.com/Raynos/xtend", - "contributors": [ - { - "name": "Jake Verbaten" - }, - { - "name": "Matt Esch" - } - ], - "bugs": { - "url": "https://github.com/Raynos/xtend/issues", - "email": "raynos2@gmail.com" - }, - "license": "MIT", "testling": { "files": "test.js", "browsers": [ @@ -49,7 +59,5 @@ "iphone/6.0..latest" ] }, - "engines": { - "node": ">=0.4" - } -} + "version": "4.0.2" +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/package.json b/tools/node_modules/eslint-plugin-markdown/package.json index ffdf6f45d0133d..493af337f1a5eb 100644 --- a/tools/node_modules/eslint-plugin-markdown/package.json +++ b/tools/node_modules/eslint-plugin-markdown/package.json @@ -1,41 +1,18 @@ { - "name": "eslint-plugin-markdown", - "version": "2.0.0", - "description": "An ESLint plugin to lint JavaScript in Markdown code fences.", - "license": "MIT", "author": { "name": "Brandon Mills", "url": "https://github.com/btmills" }, - "repository": "eslint/eslint-plugin-markdown", "bugs": { "url": "https://github.com/eslint/eslint-plugin-markdown/issues" }, - "homepage": "https://github.com/eslint/eslint-plugin-markdown#readme", - "keywords": [ - "eslint", - "eslintplugin", - "markdown", - "lint", - "linter" - ], - "scripts": { - "lint": "eslint --ext js,md .", - "prepare": "node ./npm-prepare.js", - "test": "npm run lint && npm run test-cov", - "test-cov": "nyc _mocha -- -c tests/{examples,lib}/**/*.js", - "generate-release": "eslint-generate-release", - "generate-alpharelease": "eslint-generate-prerelease alpha", - "generate-betarelease": "eslint-generate-prerelease beta", - "generate-rcrelease": "eslint-generate-prerelease rc", - "publish-release": "eslint-publish-release" + "bundleDependencies": false, + "dependencies": { + "remark-parse": "^5.0.0", + "unified": "^6.1.2" }, - "main": "index.js", - "files": [ - "index.js", - "lib/index.js", - "lib/processor.js" - ], + "deprecated": false, + "description": "An ESLint plugin to lint JavaScript in Markdown code fences.", "devDependencies": { "chai": "^4.2.0", "eslint": "^6.8.0", @@ -46,14 +23,42 @@ "mocha": "^6.2.2", "nyc": "^14.1.1" }, - "dependencies": { - "remark-parse": "^5.0.0", - "unified": "^6.1.2" + "engines": { + "node": "^8.10.0 || ^10.12.0 || >= 12.0.0" }, + "files": [ + "index.js", + "lib/index.js", + "lib/processor.js" + ], + "homepage": "https://github.com/eslint/eslint-plugin-markdown#readme", + "keywords": [ + "eslint", + "eslintplugin", + "markdown", + "lint", + "linter" + ], + "license": "MIT", + "main": "index.js", + "name": "eslint-plugin-markdown", "peerDependencies": { "eslint": ">=6.0.0" }, - "engines": { - "node": "^8.10.0 || ^10.12.0 || >= 12.0.0" - } -} + "repository": { + "type": "git", + "url": "git+https://github.com/eslint/eslint-plugin-markdown.git" + }, + "scripts": { + "generate-alpharelease": "eslint-generate-prerelease alpha", + "generate-betarelease": "eslint-generate-prerelease beta", + "generate-rcrelease": "eslint-generate-prerelease rc", + "generate-release": "eslint-generate-release", + "lint": "eslint --ext js,md .", + "prepare": "node ./npm-prepare.js", + "publish-release": "eslint-publish-release", + "test": "npm run lint && npm run test-cov", + "test-cov": "nyc _mocha -- -c tests/{examples,lib}/**/*.js" + }, + "version": "2.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/README.md b/tools/node_modules/eslint/README.md index f384aa8e687fb4..2edb836bbaf68b 100644 --- a/tools/node_modules/eslint/README.md +++ b/tools/node_modules/eslint/README.md @@ -282,8 +282,8 @@ The following companies, organizations, and individuals support ESLint's ongoing

Platinum Sponsors

Automattic

Gold Sponsors

Nx (by Nrwl) Chrome's Web Framework & Tools Performance Fund Shopify Salesforce Airbnb Substack Microsoft FOSS Fund Sponsorships

Silver Sponsors

-

Retool Liftoff AMP Project

Bronze Sponsors

-

Papersowl Writers Per Hour March 2021 calendar Buy.Fineproxy.Org Anagram Solver Bugsnag Stability Monitoring Mixpanel VPS Server Icons8: free icons, photos, illustrations, and music Discord ThemeIsle Fire Stick Tricks

+

Retool Liftoff

Bronze Sponsors

+

Buy.Fineproxy.Org Anagram Solver Bugsnag Stability Monitoring Mixpanel VPS Server Icons8: free icons, photos, illustrations, and music Discord ThemeIsle Fire Stick Tricks

## Technology Sponsors diff --git a/tools/node_modules/eslint/lib/cli-engine/formatters/html.js b/tools/node_modules/eslint/lib/cli-engine/formatters/html.js index 69f7395550f2e2..5d4b7e5606038c 100644 --- a/tools/node_modules/eslint/lib/cli-engine/formatters/html.js +++ b/tools/node_modules/eslint/lib/cli-engine/formatters/html.js @@ -72,7 +72,7 @@ function renderMessages(messages, parentIndex, rulesMeta) { * @param {Object} message Message. * @returns {string} HTML (table row) describing a message. */ - return lodash.map(messages, message => { + return messages.map(message => { const lineNumber = message.line || 0; const columnNumber = message.column || 0; let ruleUrl; @@ -103,7 +103,7 @@ function renderMessages(messages, parentIndex, rulesMeta) { * @returns {string} HTML string describing the results. */ function renderResults(results, rulesMeta) { - return lodash.map(results, (result, index) => resultTemplate({ + return results.map((result, index) => resultTemplate({ index, color: renderColor(result.errorCount, result.warningCount), filePath: result.filePath, diff --git a/tools/node_modules/eslint/lib/cli-engine/lint-result-cache.js b/tools/node_modules/eslint/lib/cli-engine/lint-result-cache.js index 25b856f2f91612..3304d429debe85 100644 --- a/tools/node_modules/eslint/lib/cli-engine/lint-result-cache.js +++ b/tools/node_modules/eslint/lib/cli-engine/lint-result-cache.js @@ -67,7 +67,6 @@ class LintResultCache { /** * Creates a new LintResultCache instance. * @param {string} cacheFileLocation The cache file location. - * configuration lookup by file path). * @param {"metadata" | "content"} cacheStrategy The cache strategy to use. */ constructor(cacheFileLocation, cacheStrategy) { diff --git a/tools/node_modules/eslint/lib/linter/report-translator.js b/tools/node_modules/eslint/lib/linter/report-translator.js index bed5af81e5dcec..75005c16e58089 100644 --- a/tools/node_modules/eslint/lib/linter/report-translator.js +++ b/tools/node_modules/eslint/lib/linter/report-translator.js @@ -115,6 +115,17 @@ function normalizeReportLoc(descriptor) { return descriptor.node.loc; } +/** + * Check that a fix has a valid range. + * @param {Fix|null} fix The fix to validate. + * @returns {void} + */ +function assertValidFix(fix) { + if (fix) { + assert(fix.range && typeof fix.range[0] === "number" && typeof fix.range[1] === "number", `Fix has invalid range: ${JSON.stringify(fix, null, 2)}`); + } +} + /** * Compares items in a fixes array by range. * @param {Fix} a The first message. @@ -133,6 +144,10 @@ function compareFixesByRange(a, b) { * @returns {{text: string, range: number[]}} The merged fixes */ function mergeFixes(fixes, sourceCode) { + for (const fix of fixes) { + assertValidFix(fix); + } + if (fixes.length === 0) { return null; } @@ -181,6 +196,8 @@ function normalizeFixes(descriptor, sourceCode) { if (fix && Symbol.iterator in fix) { return mergeFixes(Array.from(fix), sourceCode); } + + assertValidFix(fix); return fix; } diff --git a/tools/node_modules/eslint/lib/rule-tester/rule-tester.js b/tools/node_modules/eslint/lib/rule-tester/rule-tester.js index 905f3418121882..23b78fba279130 100644 --- a/tools/node_modules/eslint/lib/rule-tester/rule-tester.js +++ b/tools/node_modules/eslint/lib/rule-tester/rule-tester.js @@ -427,12 +427,12 @@ class RuleTester { scenarioErrors = [], linter = this.linter; - if (lodash.isNil(test) || typeof test !== "object") { + if (!test || typeof test !== "object") { throw new TypeError(`Test Scenarios for rule ${ruleName} : Could not find test scenario object`); } requiredScenarios.forEach(scenarioType => { - if (lodash.isNil(test[scenarioType])) { + if (!test[scenarioType]) { scenarioErrors.push(`Could not find any ${scenarioType} test scenarios`); } }); diff --git a/tools/node_modules/eslint/lib/rules/eol-last.js b/tools/node_modules/eslint/lib/rules/eol-last.js index fbba6c8f5e8be5..89c76acb2023a8 100644 --- a/tools/node_modules/eslint/lib/rules/eol-last.js +++ b/tools/node_modules/eslint/lib/rules/eol-last.js @@ -54,7 +54,7 @@ module.exports = { }, LF = "\n", CRLF = `\r${LF}`, - endsWithNewline = lodash.endsWith(src, LF); + endsWithNewline = src.endsWith(LF); /* * Empty source is always valid: No content in file so we don't diff --git a/tools/node_modules/eslint/lib/rules/lines-around-comment.js b/tools/node_modules/eslint/lib/rules/lines-around-comment.js index 5e1b83cdd5d24c..6806e793cd193b 100644 --- a/tools/node_modules/eslint/lib/rules/lines-around-comment.js +++ b/tools/node_modules/eslint/lib/rules/lines-around-comment.js @@ -8,8 +8,7 @@ // Requirements //------------------------------------------------------------------------------ -const lodash = require("lodash"), - astUtils = require("./utils/ast-utils"); +const astUtils = require("./utils/ast-utils"); //------------------------------------------------------------------------------ // Helpers @@ -347,7 +346,7 @@ module.exports = { const nextTokenOrComment = sourceCode.getTokenAfter(token, { includeComments: true }); // check for newline before - if (!exceptionStartAllowed && before && !lodash.includes(commentAndEmptyLines, prevLineNum) && + if (!exceptionStartAllowed && before && !commentAndEmptyLines.includes(prevLineNum) && !(astUtils.isCommentToken(previousTokenOrComment) && astUtils.isTokenOnSameLine(previousTokenOrComment, token))) { const lineStart = token.range[0] - token.loc.start.column; const range = [lineStart, lineStart]; @@ -362,7 +361,7 @@ module.exports = { } // check for newline after - if (!exceptionEndAllowed && after && !lodash.includes(commentAndEmptyLines, nextLineNum) && + if (!exceptionEndAllowed && after && !commentAndEmptyLines.includes(nextLineNum) && !(astUtils.isCommentToken(nextTokenOrComment) && astUtils.isTokenOnSameLine(token, nextTokenOrComment))) { context.report({ node: token, diff --git a/tools/node_modules/eslint/lib/rules/max-lines.js b/tools/node_modules/eslint/lib/rules/max-lines.js index 0c7e761fa613b4..ceb014aff71be2 100644 --- a/tools/node_modules/eslint/lib/rules/max-lines.js +++ b/tools/node_modules/eslint/lib/rules/max-lines.js @@ -151,7 +151,7 @@ module.exports = { ); lines = lines.filter( - l => !lodash.includes(commentLines, l.lineNumber) + l => !commentLines.includes(l.lineNumber) ); } diff --git a/tools/node_modules/eslint/lib/rules/object-curly-newline.js b/tools/node_modules/eslint/lib/rules/object-curly-newline.js index 616d59851d646d..c5c098e130150c 100644 --- a/tools/node_modules/eslint/lib/rules/object-curly-newline.js +++ b/tools/node_modules/eslint/lib/rules/object-curly-newline.js @@ -82,7 +82,7 @@ function normalizeOptionValue(value) { function normalizeOptions(options) { const isNodeSpecificOption = lodash.overSome([lodash.isPlainObject, lodash.isString]); - if (lodash.isPlainObject(options) && lodash.some(options, isNodeSpecificOption)) { + if (lodash.isPlainObject(options) && Object.values(options).some(isNodeSpecificOption)) { return { ObjectExpression: normalizeOptionValue(options.ObjectExpression), ObjectPattern: normalizeOptionValue(options.ObjectPattern), diff --git a/tools/node_modules/eslint/lib/shared/runtime-info.js b/tools/node_modules/eslint/lib/shared/runtime-info.js index feed005330e622..3f16c9152e352b 100644 --- a/tools/node_modules/eslint/lib/shared/runtime-info.js +++ b/tools/node_modules/eslint/lib/shared/runtime-info.js @@ -11,7 +11,6 @@ const path = require("path"); const spawn = require("cross-spawn"); -const { isEmpty } = require("lodash"); const log = require("../shared/logging"); const packageJson = require("../../package.json"); @@ -107,7 +106,7 @@ function environment() { * Checking globally returns an empty JSON object, while local checks * include the name and version of the local project. */ - if (isEmpty(parsedStdout) || !(parsedStdout.dependencies && parsedStdout.dependencies.eslint)) { + if (Object.keys(parsedStdout).length === 0 || !(parsedStdout.dependencies && parsedStdout.dependencies.eslint)) { return "Not found"; } diff --git a/tools/node_modules/eslint/node_modules/@babel/code-frame/package.json b/tools/node_modules/eslint/node_modules/@babel/code-frame/package.json index 07a28a6bda4ec3..213c1916a9ec81 100644 --- a/tools/node_modules/eslint/node_modules/@babel/code-frame/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/code-frame/package.json @@ -1,25 +1,33 @@ { - "name": "@babel/code-frame", - "version": "7.12.11", + "author": { + "name": "Sebastian McKenzie", + "email": "sebmck@gmail.com" + }, + "bugs": { + "url": "https://github.com/babel/babel/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@babel/highlight": "^7.10.4" + }, + "deprecated": false, "description": "Generate errors that contain a code frame that point to source locations.", - "author": "Sebastian McKenzie ", + "devDependencies": { + "@types/chalk": "^2.0.0", + "chalk": "^2.0.0", + "strip-ansi": "^4.0.0" + }, "homepage": "https://babeljs.io/", "license": "MIT", + "main": "lib/index.js", + "name": "@babel/code-frame", "publishConfig": { "access": "public" }, "repository": { "type": "git", - "url": "https://github.com/babel/babel.git", + "url": "git+https://github.com/babel/babel.git", "directory": "packages/babel-code-frame" }, - "main": "lib/index.js", - "dependencies": { - "@babel/highlight": "^7.10.4" - }, - "devDependencies": { - "@types/chalk": "^2.0.0", - "chalk": "^2.0.0", - "strip-ansi": "^4.0.0" - } + "version": "7.12.11" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/package.json b/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/package.json index 464dbfa3aace49..e70625729dd6c3 100644 --- a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/package.json @@ -1,20 +1,26 @@ { - "name": "@babel/helper-validator-identifier", - "version": "7.12.11", + "bugs": { + "url": "https://github.com/babel/babel/issues" + }, + "bundleDependencies": false, + "deprecated": false, "description": "Validate identifier/keywords name", - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-helper-validator-identifier" + "devDependencies": { + "charcodes": "^0.2.0", + "unicode-13.0.0": "^0.8.0" }, + "exports": "./lib/index.js", + "homepage": "https://github.com/babel/babel#readme", "license": "MIT", + "main": "./lib/index.js", + "name": "@babel/helper-validator-identifier", "publishConfig": { "access": "public" }, - "main": "./lib/index.js", - "exports": "./lib/index.js", - "devDependencies": { - "charcodes": "^0.2.0", - "unicode-13.0.0": "^0.8.0" - } + "repository": { + "type": "git", + "url": "git+https://github.com/babel/babel.git", + "directory": "packages/babel-helper-validator-identifier" + }, + "version": "7.12.11" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js index fa8897134a57f5..14ca2e36f86904 100644 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js @@ -7,17 +7,11 @@ exports.shouldHighlight = shouldHighlight; exports.getChalk = getChalk; exports.default = highlight; -var jsTokensNs = _interopRequireWildcard(require("js-tokens")); - var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); -var _chalk = _interopRequireDefault(require("chalk")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } +const jsTokens = require("js-tokens"); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +const Chalk = require("chalk"); const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]); @@ -39,9 +33,6 @@ const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; const BRACKET = /^[()[\]{}]$/; let tokenize; { - const { - matchToToken - } = jsTokensNs; const JSX_TAG = /^[a-z][\w-]*$/i; const getTokenType = function (token, offset, text) { @@ -73,8 +64,8 @@ let tokenize; tokenize = function* (text) { let match; - while (match = jsTokensNs.default.exec(text)) { - const token = matchToToken(match); + while (match = jsTokens.default.exec(text)) { + const token = jsTokens.matchToToken(match); yield { type: getTokenType(token, match.index, text), value: token.value @@ -103,14 +94,14 @@ function highlightTokens(defs, text) { } function shouldHighlight(options) { - return !!_chalk.default.supportsColor || options.forceColor; + return !!Chalk.supportsColor || options.forceColor; } function getChalk(options) { - return options.forceColor ? new _chalk.default.constructor({ + return options.forceColor ? new Chalk.constructor({ enabled: true, level: 1 - }) : _chalk.default; + }) : Chalk; } function highlight(code, options = {}) { diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/index.js deleted file mode 100644 index 90a871c4d78f6f..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/index.js +++ /dev/null @@ -1,165 +0,0 @@ -'use strict'; -const colorConvert = require('color-convert'); - -const wrapAnsi16 = (fn, offset) => function () { - const code = fn.apply(colorConvert, arguments); - return `\u001B[${code + offset}m`; -}; - -const wrapAnsi256 = (fn, offset) => function () { - const code = fn.apply(colorConvert, arguments); - return `\u001B[${38 + offset};5;${code}m`; -}; - -const wrapAnsi16m = (fn, offset) => function () { - const rgb = fn.apply(colorConvert, arguments); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; - -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - gray: [90, 39], - - // Bright color - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - - // Fix humans - styles.color.grey = styles.color.gray; - - for (const groupName of Object.keys(styles)) { - const group = styles[groupName]; - - for (const styleName of Object.keys(group)) { - const style = group[styleName]; - - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; - - group[styleName] = styles[styleName]; - - codes.set(style[0], style[1]); - } - - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); - } - - const ansi2ansi = n => n; - const rgb2rgb = (r, g, b) => [r, g, b]; - - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; - - styles.color.ansi = { - ansi: wrapAnsi16(ansi2ansi, 0) - }; - styles.color.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 0) - }; - styles.color.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 0) - }; - - styles.bgColor.ansi = { - ansi: wrapAnsi16(ansi2ansi, 10) - }; - styles.bgColor.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 10) - }; - styles.bgColor.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 10) - }; - - for (let key of Object.keys(colorConvert)) { - if (typeof colorConvert[key] !== 'object') { - continue; - } - - const suite = colorConvert[key]; - - if (key === 'ansi16') { - key = 'ansi'; - } - - if ('ansi16' in suite) { - styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); - styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); - } - - if ('ansi256' in suite) { - styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); - styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); - } - - if ('rgb' in suite) { - styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); - styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); - } - } - - return styles; -} - -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/package.json deleted file mode 100644 index 65edb48c399c5c..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "ansi-styles", - "version": "3.2.1", - "description": "ANSI escape codes for styling strings in the terminal", - "license": "MIT", - "repository": "chalk/ansi-styles", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava", - "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" - }, - "files": [ - "index.js" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "color-convert": "^1.9.0" - }, - "devDependencies": { - "ava": "*", - "babel-polyfill": "^6.23.0", - "svg-term-cli": "^2.1.1", - "xo": "*" - }, - "ava": { - "require": "babel-polyfill" - } -} diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/package.json index bc324685a7625f..270fecdc347d42 100644 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/package.json @@ -1,71 +1,80 @@ { - "name": "chalk", - "version": "2.4.2", - "description": "Terminal string styling done right", - "license": "MIT", - "repository": "chalk/chalk", - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava", - "bench": "matcha benchmark.js", - "coveralls": "nyc report --reporter=text-lcov | coveralls" - }, - "files": [ - "index.js", - "templates.js", - "types/index.d.ts", - "index.js.flow" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "str", - "ansi", - "style", - "styles", - "tty", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "devDependencies": { - "ava": "*", - "coveralls": "^3.0.0", - "execa": "^0.9.0", - "flow-bin": "^0.68.0", - "import-fresh": "^2.0.0", - "matcha": "^0.7.0", - "nyc": "^11.0.2", - "resolve-from": "^4.0.0", - "typescript": "^2.5.3", - "xo": "*" - }, - "types": "types/index.d.ts", - "xo": { - "envs": [ - "node", - "mocha" - ], - "ignores": [ - "test/_flow.js" - ] - } -} + "bugs": { + "url": "https://github.com/chalk/chalk/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "deprecated": false, + "description": "Terminal string styling done right", + "devDependencies": { + "ava": "*", + "coveralls": "^3.0.0", + "execa": "^0.9.0", + "flow-bin": "^0.68.0", + "import-fresh": "^2.0.0", + "matcha": "^0.7.0", + "nyc": "^11.0.2", + "resolve-from": "^4.0.0", + "typescript": "^2.5.3", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js", + "templates.js", + "types/index.d.ts", + "index.js.flow" + ], + "homepage": "https://github.com/chalk/chalk#readme", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "name": "chalk", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/chalk.git" + }, + "scripts": { + "bench": "matcha benchmark.js", + "coveralls": "nyc report --reporter=text-lcov | coveralls", + "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava" + }, + "types": "types/index.d.ts", + "version": "2.4.2", + "xo": { + "envs": [ + "node", + "mocha" + ], + "ignores": [ + "test/_flow.js" + ] + } +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/index.js deleted file mode 100644 index e65b5d775da353..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/index.js +++ /dev/null @@ -1,78 +0,0 @@ -var conversions = require('./conversions'); -var route = require('./route'); - -var convert = {}; - -var models = Object.keys(conversions); - -function wrapRaw(fn) { - var wrappedFn = function (args) { - if (args === undefined || args === null) { - return args; - } - - if (arguments.length > 1) { - args = Array.prototype.slice.call(arguments); - } - - return fn(args); - }; - - // preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; - } - - return wrappedFn; -} - -function wrapRounded(fn) { - var wrappedFn = function (args) { - if (args === undefined || args === null) { - return args; - } - - if (arguments.length > 1) { - args = Array.prototype.slice.call(arguments); - } - - var result = fn(args); - - // we're assuming the result is an array here. - // see notice in conversions.js; don't use box types - // in conversion functions. - if (typeof result === 'object') { - for (var len = result.length, i = 0; i < len; i++) { - result[i] = Math.round(result[i]); - } - } - - return result; - }; - - // preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; - } - - return wrappedFn; -} - -models.forEach(function (fromModel) { - convert[fromModel] = {}; - - Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); - Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); - - var routes = route(fromModel); - var routeModels = Object.keys(routes); - - routeModels.forEach(function (toModel) { - var fn = routes[toModel]; - - convert[fromModel][toModel] = wrapRounded(fn); - convert[fromModel][toModel].raw = wrapRaw(fn); - }); -}); - -module.exports = convert; diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/package.json deleted file mode 100644 index d061123ef02f40..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "color-name", - "version": "1.1.3", - "description": "A list of color names and its values", - "main": "index.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git@github.com:dfcreative/color-name.git" - }, - "keywords": [ - "color-name", - "color", - "color-keyword", - "keyword" - ], - "author": "DY ", - "license": "MIT", - "bugs": { - "url": "https://github.com/dfcreative/color-name/issues" - }, - "homepage": "https://github.com/dfcreative/color-name" -} diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/index.js deleted file mode 100644 index 5139728fba6a26..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; -module.exports = (flag, argv) => { - argv = argv || process.argv; - const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); - const pos = argv.indexOf(prefix + flag); - const terminatorPos = argv.indexOf('--'); - return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); -}; diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/package.json deleted file mode 100644 index ad199f5cdb0436..00000000000000 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "supports-color", - "version": "5.5.0", - "description": "Detect whether a terminal supports color", - "license": "MIT", - "repository": "chalk/supports-color", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js", - "browser.js" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "ansi", - "styles", - "tty", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "support", - "supports", - "capability", - "detect", - "truecolor", - "16m" - ], - "dependencies": { - "has-flag": "^3.0.0" - }, - "devDependencies": { - "ava": "^0.25.0", - "import-fresh": "^2.0.0", - "xo": "^0.20.0" - }, - "browser": "browser.js" -} diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/package.json index 4504cd15a14ed5..09dc745cb47d97 100644 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/package.json @@ -1,26 +1,34 @@ { - "name": "@babel/highlight", - "version": "7.13.8", - "description": "Syntax highlight JavaScript strings for output in terminals.", - "author": "suchipi ", - "homepage": "https://babel.dev/docs/en/next/babel-highlight", - "license": "MIT", - "publishConfig": { - "access": "public" + "author": { + "name": "suchipi", + "email": "me@suchipi.com" }, - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-highlight" + "bugs": { + "url": "https://github.com/babel/babel/issues" }, - "main": "lib/index.js", + "bundleDependencies": false, "dependencies": { "@babel/helper-validator-identifier": "^7.12.11", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, + "deprecated": false, + "description": "Syntax highlight JavaScript strings for output in terminals.", "devDependencies": { "@types/chalk": "^2.0.0", "strip-ansi": "^4.0.0" - } + }, + "homepage": "https://babel.dev/docs/en/next/babel-highlight", + "license": "MIT", + "main": "lib/index.js", + "name": "@babel/highlight", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/babel/babel.git", + "directory": "packages/babel-highlight" + }, + "version": "7.13.10" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/globals.json b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/globals.json new file mode 100644 index 00000000000000..b85dc3f80d5148 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/globals.json @@ -0,0 +1,1586 @@ +{ + "builtin": { + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "BigInt": false, + "BigInt64Array": false, + "BigUint64Array": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "globalThis": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakSet": false + }, + "es5": { + "Array": false, + "Boolean": false, + "constructor": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Function": false, + "hasOwnProperty": false, + "Infinity": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "propertyIsEnumerable": false, + "RangeError": false, + "ReferenceError": false, + "RegExp": false, + "String": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false + }, + "es2015": { + "Array": false, + "ArrayBuffer": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakSet": false + }, + "es2017": { + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakSet": false + }, + "browser": { + "AbortController": false, + "AbortSignal": false, + "addEventListener": false, + "alert": false, + "AnalyserNode": false, + "Animation": false, + "AnimationEffectReadOnly": false, + "AnimationEffectTiming": false, + "AnimationEffectTimingReadOnly": false, + "AnimationEvent": false, + "AnimationPlaybackEvent": false, + "AnimationTimeline": false, + "applicationCache": false, + "ApplicationCache": false, + "ApplicationCacheErrorEvent": false, + "atob": false, + "Attr": false, + "Audio": false, + "AudioBuffer": false, + "AudioBufferSourceNode": false, + "AudioContext": false, + "AudioDestinationNode": false, + "AudioListener": false, + "AudioNode": false, + "AudioParam": false, + "AudioProcessingEvent": false, + "AudioScheduledSourceNode": false, + "AudioWorkletGlobalScope ": false, + "AudioWorkletNode": false, + "AudioWorkletProcessor": false, + "BarProp": false, + "BaseAudioContext": false, + "BatteryManager": false, + "BeforeUnloadEvent": false, + "BiquadFilterNode": false, + "Blob": false, + "BlobEvent": false, + "blur": false, + "BroadcastChannel": false, + "btoa": false, + "BudgetService": false, + "ByteLengthQueuingStrategy": false, + "Cache": false, + "caches": false, + "CacheStorage": false, + "cancelAnimationFrame": false, + "cancelIdleCallback": false, + "CanvasCaptureMediaStreamTrack": false, + "CanvasGradient": false, + "CanvasPattern": false, + "CanvasRenderingContext2D": false, + "ChannelMergerNode": false, + "ChannelSplitterNode": false, + "CharacterData": false, + "clearInterval": false, + "clearTimeout": false, + "clientInformation": false, + "ClipboardEvent": false, + "close": false, + "closed": false, + "CloseEvent": false, + "Comment": false, + "CompositionEvent": false, + "confirm": false, + "console": false, + "ConstantSourceNode": false, + "ConvolverNode": false, + "CountQueuingStrategy": false, + "createImageBitmap": false, + "Credential": false, + "CredentialsContainer": false, + "crypto": false, + "Crypto": false, + "CryptoKey": false, + "CSS": false, + "CSSConditionRule": false, + "CSSFontFaceRule": false, + "CSSGroupingRule": false, + "CSSImportRule": false, + "CSSKeyframeRule": false, + "CSSKeyframesRule": false, + "CSSMediaRule": false, + "CSSNamespaceRule": false, + "CSSPageRule": false, + "CSSRule": false, + "CSSRuleList": false, + "CSSStyleDeclaration": false, + "CSSStyleRule": false, + "CSSStyleSheet": false, + "CSSSupportsRule": false, + "CustomElementRegistry": false, + "customElements": false, + "CustomEvent": false, + "DataTransfer": false, + "DataTransferItem": false, + "DataTransferItemList": false, + "defaultstatus": false, + "defaultStatus": false, + "DelayNode": false, + "DeviceMotionEvent": false, + "DeviceOrientationEvent": false, + "devicePixelRatio": false, + "dispatchEvent": false, + "document": false, + "Document": false, + "DocumentFragment": false, + "DocumentType": false, + "DOMError": false, + "DOMException": false, + "DOMImplementation": false, + "DOMMatrix": false, + "DOMMatrixReadOnly": false, + "DOMParser": false, + "DOMPoint": false, + "DOMPointReadOnly": false, + "DOMQuad": false, + "DOMRect": false, + "DOMRectReadOnly": false, + "DOMStringList": false, + "DOMStringMap": false, + "DOMTokenList": false, + "DragEvent": false, + "DynamicsCompressorNode": false, + "Element": false, + "ErrorEvent": false, + "event": false, + "Event": false, + "EventSource": false, + "EventTarget": false, + "external": false, + "fetch": false, + "File": false, + "FileList": false, + "FileReader": false, + "find": false, + "focus": false, + "FocusEvent": false, + "FontFace": false, + "FontFaceSetLoadEvent": false, + "FormData": false, + "frameElement": false, + "frames": false, + "GainNode": false, + "Gamepad": false, + "GamepadButton": false, + "GamepadEvent": false, + "getComputedStyle": false, + "getSelection": false, + "HashChangeEvent": false, + "Headers": false, + "history": false, + "History": false, + "HTMLAllCollection": false, + "HTMLAnchorElement": false, + "HTMLAreaElement": false, + "HTMLAudioElement": false, + "HTMLBaseElement": false, + "HTMLBodyElement": false, + "HTMLBRElement": false, + "HTMLButtonElement": false, + "HTMLCanvasElement": false, + "HTMLCollection": false, + "HTMLContentElement": false, + "HTMLDataElement": false, + "HTMLDataListElement": false, + "HTMLDetailsElement": false, + "HTMLDialogElement": false, + "HTMLDirectoryElement": false, + "HTMLDivElement": false, + "HTMLDListElement": false, + "HTMLDocument": false, + "HTMLElement": false, + "HTMLEmbedElement": false, + "HTMLFieldSetElement": false, + "HTMLFontElement": false, + "HTMLFormControlsCollection": false, + "HTMLFormElement": false, + "HTMLFrameElement": false, + "HTMLFrameSetElement": false, + "HTMLHeadElement": false, + "HTMLHeadingElement": false, + "HTMLHRElement": false, + "HTMLHtmlElement": false, + "HTMLIFrameElement": false, + "HTMLImageElement": false, + "HTMLInputElement": false, + "HTMLLabelElement": false, + "HTMLLegendElement": false, + "HTMLLIElement": false, + "HTMLLinkElement": false, + "HTMLMapElement": false, + "HTMLMarqueeElement": false, + "HTMLMediaElement": false, + "HTMLMenuElement": false, + "HTMLMetaElement": false, + "HTMLMeterElement": false, + "HTMLModElement": false, + "HTMLObjectElement": false, + "HTMLOListElement": false, + "HTMLOptGroupElement": false, + "HTMLOptionElement": false, + "HTMLOptionsCollection": false, + "HTMLOutputElement": false, + "HTMLParagraphElement": false, + "HTMLParamElement": false, + "HTMLPictureElement": false, + "HTMLPreElement": false, + "HTMLProgressElement": false, + "HTMLQuoteElement": false, + "HTMLScriptElement": false, + "HTMLSelectElement": false, + "HTMLShadowElement": false, + "HTMLSlotElement": false, + "HTMLSourceElement": false, + "HTMLSpanElement": false, + "HTMLStyleElement": false, + "HTMLTableCaptionElement": false, + "HTMLTableCellElement": false, + "HTMLTableColElement": false, + "HTMLTableElement": false, + "HTMLTableRowElement": false, + "HTMLTableSectionElement": false, + "HTMLTemplateElement": false, + "HTMLTextAreaElement": false, + "HTMLTimeElement": false, + "HTMLTitleElement": false, + "HTMLTrackElement": false, + "HTMLUListElement": false, + "HTMLUnknownElement": false, + "HTMLVideoElement": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "IdleDeadline": false, + "IIRFilterNode": false, + "Image": false, + "ImageBitmap": false, + "ImageBitmapRenderingContext": false, + "ImageCapture": false, + "ImageData": false, + "indexedDB": false, + "innerHeight": false, + "innerWidth": false, + "InputEvent": false, + "IntersectionObserver": false, + "IntersectionObserverEntry": false, + "Intl": false, + "isSecureContext": false, + "KeyboardEvent": false, + "KeyframeEffect": false, + "KeyframeEffectReadOnly": false, + "length": false, + "localStorage": false, + "location": true, + "Location": false, + "locationbar": false, + "matchMedia": false, + "MediaDeviceInfo": false, + "MediaDevices": false, + "MediaElementAudioSourceNode": false, + "MediaEncryptedEvent": false, + "MediaError": false, + "MediaKeyMessageEvent": false, + "MediaKeySession": false, + "MediaKeyStatusMap": false, + "MediaKeySystemAccess": false, + "MediaList": false, + "MediaQueryList": false, + "MediaQueryListEvent": false, + "MediaRecorder": false, + "MediaSettingsRange": false, + "MediaSource": false, + "MediaStream": false, + "MediaStreamAudioDestinationNode": false, + "MediaStreamAudioSourceNode": false, + "MediaStreamEvent": false, + "MediaStreamTrack": false, + "MediaStreamTrackEvent": false, + "menubar": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "MIDIAccess": false, + "MIDIConnectionEvent": false, + "MIDIInput": false, + "MIDIInputMap": false, + "MIDIMessageEvent": false, + "MIDIOutput": false, + "MIDIOutputMap": false, + "MIDIPort": false, + "MimeType": false, + "MimeTypeArray": false, + "MouseEvent": false, + "moveBy": false, + "moveTo": false, + "MutationEvent": false, + "MutationObserver": false, + "MutationRecord": false, + "name": false, + "NamedNodeMap": false, + "NavigationPreloadManager": false, + "navigator": false, + "Navigator": false, + "NetworkInformation": false, + "Node": false, + "NodeFilter": false, + "NodeIterator": false, + "NodeList": false, + "Notification": false, + "OfflineAudioCompletionEvent": false, + "OfflineAudioContext": false, + "offscreenBuffering": false, + "OffscreenCanvas": true, + "onabort": true, + "onafterprint": true, + "onanimationend": true, + "onanimationiteration": true, + "onanimationstart": true, + "onappinstalled": true, + "onauxclick": true, + "onbeforeinstallprompt": true, + "onbeforeprint": true, + "onbeforeunload": true, + "onblur": true, + "oncancel": true, + "oncanplay": true, + "oncanplaythrough": true, + "onchange": true, + "onclick": true, + "onclose": true, + "oncontextmenu": true, + "oncuechange": true, + "ondblclick": true, + "ondevicemotion": true, + "ondeviceorientation": true, + "ondeviceorientationabsolute": true, + "ondrag": true, + "ondragend": true, + "ondragenter": true, + "ondragleave": true, + "ondragover": true, + "ondragstart": true, + "ondrop": true, + "ondurationchange": true, + "onemptied": true, + "onended": true, + "onerror": true, + "onfocus": true, + "ongotpointercapture": true, + "onhashchange": true, + "oninput": true, + "oninvalid": true, + "onkeydown": true, + "onkeypress": true, + "onkeyup": true, + "onlanguagechange": true, + "onload": true, + "onloadeddata": true, + "onloadedmetadata": true, + "onloadstart": true, + "onlostpointercapture": true, + "onmessage": true, + "onmessageerror": true, + "onmousedown": true, + "onmouseenter": true, + "onmouseleave": true, + "onmousemove": true, + "onmouseout": true, + "onmouseover": true, + "onmouseup": true, + "onmousewheel": true, + "onoffline": true, + "ononline": true, + "onpagehide": true, + "onpageshow": true, + "onpause": true, + "onplay": true, + "onplaying": true, + "onpointercancel": true, + "onpointerdown": true, + "onpointerenter": true, + "onpointerleave": true, + "onpointermove": true, + "onpointerout": true, + "onpointerover": true, + "onpointerup": true, + "onpopstate": true, + "onprogress": true, + "onratechange": true, + "onrejectionhandled": true, + "onreset": true, + "onresize": true, + "onscroll": true, + "onsearch": true, + "onseeked": true, + "onseeking": true, + "onselect": true, + "onstalled": true, + "onstorage": true, + "onsubmit": true, + "onsuspend": true, + "ontimeupdate": true, + "ontoggle": true, + "ontransitionend": true, + "onunhandledrejection": true, + "onunload": true, + "onvolumechange": true, + "onwaiting": true, + "onwheel": true, + "open": false, + "openDatabase": false, + "opener": false, + "Option": false, + "origin": false, + "OscillatorNode": false, + "outerHeight": false, + "outerWidth": false, + "PageTransitionEvent": false, + "pageXOffset": false, + "pageYOffset": false, + "PannerNode": false, + "parent": false, + "Path2D": false, + "PaymentAddress": false, + "PaymentRequest": false, + "PaymentRequestUpdateEvent": false, + "PaymentResponse": false, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceLongTaskTiming": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceNavigation": false, + "PerformanceNavigationTiming": false, + "PerformanceObserver": false, + "PerformanceObserverEntryList": false, + "PerformancePaintTiming": false, + "PerformanceResourceTiming": false, + "PerformanceTiming": false, + "PeriodicWave": false, + "Permissions": false, + "PermissionStatus": false, + "personalbar": false, + "PhotoCapabilities": false, + "Plugin": false, + "PluginArray": false, + "PointerEvent": false, + "PopStateEvent": false, + "postMessage": false, + "Presentation": false, + "PresentationAvailability": false, + "PresentationConnection": false, + "PresentationConnectionAvailableEvent": false, + "PresentationConnectionCloseEvent": false, + "PresentationConnectionList": false, + "PresentationReceiver": false, + "PresentationRequest": false, + "print": false, + "ProcessingInstruction": false, + "ProgressEvent": false, + "PromiseRejectionEvent": false, + "prompt": false, + "PushManager": false, + "PushSubscription": false, + "PushSubscriptionOptions": false, + "queueMicrotask": false, + "RadioNodeList": false, + "Range": false, + "ReadableStream": false, + "registerProcessor": false, + "RemotePlayback": false, + "removeEventListener": false, + "Request": false, + "requestAnimationFrame": false, + "requestIdleCallback": false, + "resizeBy": false, + "ResizeObserver": false, + "ResizeObserverEntry": false, + "resizeTo": false, + "Response": false, + "RTCCertificate": false, + "RTCDataChannel": false, + "RTCDataChannelEvent": false, + "RTCDtlsTransport": false, + "RTCIceCandidate": false, + "RTCIceGatherer": false, + "RTCIceTransport": false, + "RTCPeerConnection": false, + "RTCPeerConnectionIceEvent": false, + "RTCRtpContributingSource": false, + "RTCRtpReceiver": false, + "RTCRtpSender": false, + "RTCSctpTransport": false, + "RTCSessionDescription": false, + "RTCStatsReport": false, + "RTCTrackEvent": false, + "screen": false, + "Screen": false, + "screenLeft": false, + "ScreenOrientation": false, + "screenTop": false, + "screenX": false, + "screenY": false, + "ScriptProcessorNode": false, + "scroll": false, + "scrollbars": false, + "scrollBy": false, + "scrollTo": false, + "scrollX": false, + "scrollY": false, + "SecurityPolicyViolationEvent": false, + "Selection": false, + "self": false, + "ServiceWorker": false, + "ServiceWorkerContainer": false, + "ServiceWorkerRegistration": false, + "sessionStorage": false, + "setInterval": false, + "setTimeout": false, + "ShadowRoot": false, + "SharedWorker": false, + "SourceBuffer": false, + "SourceBufferList": false, + "speechSynthesis": false, + "SpeechSynthesisEvent": false, + "SpeechSynthesisUtterance": false, + "StaticRange": false, + "status": false, + "statusbar": false, + "StereoPannerNode": false, + "stop": false, + "Storage": false, + "StorageEvent": false, + "StorageManager": false, + "styleMedia": false, + "StyleSheet": false, + "StyleSheetList": false, + "SubtleCrypto": false, + "SVGAElement": false, + "SVGAngle": false, + "SVGAnimatedAngle": false, + "SVGAnimatedBoolean": false, + "SVGAnimatedEnumeration": false, + "SVGAnimatedInteger": false, + "SVGAnimatedLength": false, + "SVGAnimatedLengthList": false, + "SVGAnimatedNumber": false, + "SVGAnimatedNumberList": false, + "SVGAnimatedPreserveAspectRatio": false, + "SVGAnimatedRect": false, + "SVGAnimatedString": false, + "SVGAnimatedTransformList": false, + "SVGAnimateElement": false, + "SVGAnimateMotionElement": false, + "SVGAnimateTransformElement": false, + "SVGAnimationElement": false, + "SVGCircleElement": false, + "SVGClipPathElement": false, + "SVGComponentTransferFunctionElement": false, + "SVGDefsElement": false, + "SVGDescElement": false, + "SVGDiscardElement": false, + "SVGElement": false, + "SVGEllipseElement": false, + "SVGFEBlendElement": false, + "SVGFEColorMatrixElement": false, + "SVGFEComponentTransferElement": false, + "SVGFECompositeElement": false, + "SVGFEConvolveMatrixElement": false, + "SVGFEDiffuseLightingElement": false, + "SVGFEDisplacementMapElement": false, + "SVGFEDistantLightElement": false, + "SVGFEDropShadowElement": false, + "SVGFEFloodElement": false, + "SVGFEFuncAElement": false, + "SVGFEFuncBElement": false, + "SVGFEFuncGElement": false, + "SVGFEFuncRElement": false, + "SVGFEGaussianBlurElement": false, + "SVGFEImageElement": false, + "SVGFEMergeElement": false, + "SVGFEMergeNodeElement": false, + "SVGFEMorphologyElement": false, + "SVGFEOffsetElement": false, + "SVGFEPointLightElement": false, + "SVGFESpecularLightingElement": false, + "SVGFESpotLightElement": false, + "SVGFETileElement": false, + "SVGFETurbulenceElement": false, + "SVGFilterElement": false, + "SVGForeignObjectElement": false, + "SVGGElement": false, + "SVGGeometryElement": false, + "SVGGradientElement": false, + "SVGGraphicsElement": false, + "SVGImageElement": false, + "SVGLength": false, + "SVGLengthList": false, + "SVGLinearGradientElement": false, + "SVGLineElement": false, + "SVGMarkerElement": false, + "SVGMaskElement": false, + "SVGMatrix": false, + "SVGMetadataElement": false, + "SVGMPathElement": false, + "SVGNumber": false, + "SVGNumberList": false, + "SVGPathElement": false, + "SVGPatternElement": false, + "SVGPoint": false, + "SVGPointList": false, + "SVGPolygonElement": false, + "SVGPolylineElement": false, + "SVGPreserveAspectRatio": false, + "SVGRadialGradientElement": false, + "SVGRect": false, + "SVGRectElement": false, + "SVGScriptElement": false, + "SVGSetElement": false, + "SVGStopElement": false, + "SVGStringList": false, + "SVGStyleElement": false, + "SVGSVGElement": false, + "SVGSwitchElement": false, + "SVGSymbolElement": false, + "SVGTextContentElement": false, + "SVGTextElement": false, + "SVGTextPathElement": false, + "SVGTextPositioningElement": false, + "SVGTitleElement": false, + "SVGTransform": false, + "SVGTransformList": false, + "SVGTSpanElement": false, + "SVGUnitTypes": false, + "SVGUseElement": false, + "SVGViewElement": false, + "TaskAttributionTiming": false, + "Text": false, + "TextDecoder": false, + "TextEncoder": false, + "TextEvent": false, + "TextMetrics": false, + "TextTrack": false, + "TextTrackCue": false, + "TextTrackCueList": false, + "TextTrackList": false, + "TimeRanges": false, + "toolbar": false, + "top": false, + "Touch": false, + "TouchEvent": false, + "TouchList": false, + "TrackEvent": false, + "TransitionEvent": false, + "TreeWalker": false, + "UIEvent": false, + "URL": false, + "URLSearchParams": false, + "ValidityState": false, + "visualViewport": false, + "VisualViewport": false, + "VTTCue": false, + "WaveShaperNode": false, + "WebAssembly": false, + "WebGL2RenderingContext": false, + "WebGLActiveInfo": false, + "WebGLBuffer": false, + "WebGLContextEvent": false, + "WebGLFramebuffer": false, + "WebGLProgram": false, + "WebGLQuery": false, + "WebGLRenderbuffer": false, + "WebGLRenderingContext": false, + "WebGLSampler": false, + "WebGLShader": false, + "WebGLShaderPrecisionFormat": false, + "WebGLSync": false, + "WebGLTexture": false, + "WebGLTransformFeedback": false, + "WebGLUniformLocation": false, + "WebGLVertexArrayObject": false, + "WebSocket": false, + "WheelEvent": false, + "window": false, + "Window": false, + "Worker": false, + "WritableStream": false, + "XMLDocument": false, + "XMLHttpRequest": false, + "XMLHttpRequestEventTarget": false, + "XMLHttpRequestUpload": false, + "XMLSerializer": false, + "XPathEvaluator": false, + "XPathExpression": false, + "XPathResult": false, + "XSLTProcessor": false + }, + "worker": { + "addEventListener": false, + "applicationCache": false, + "atob": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, + "Cache": false, + "caches": false, + "clearInterval": false, + "clearTimeout": false, + "close": true, + "console": false, + "fetch": false, + "FileReaderSync": false, + "FormData": false, + "Headers": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "ImageData": false, + "importScripts": true, + "indexedDB": false, + "location": false, + "MessageChannel": false, + "MessagePort": false, + "name": false, + "navigator": false, + "Notification": false, + "onclose": true, + "onconnect": true, + "onerror": true, + "onlanguagechange": true, + "onmessage": true, + "onoffline": true, + "ononline": true, + "onrejectionhandled": true, + "onunhandledrejection": true, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceNavigation": false, + "PerformanceResourceTiming": false, + "PerformanceTiming": false, + "postMessage": true, + "Promise": false, + "queueMicrotask": false, + "removeEventListener": false, + "Request": false, + "Response": false, + "self": true, + "ServiceWorkerRegistration": false, + "setInterval": false, + "setTimeout": false, + "TextDecoder": false, + "TextEncoder": false, + "URL": false, + "URLSearchParams": false, + "WebSocket": false, + "Worker": false, + "WorkerGlobalScope": false, + "XMLHttpRequest": false + }, + "node": { + "__dirname": false, + "__filename": false, + "Buffer": false, + "clearImmediate": false, + "clearInterval": false, + "clearTimeout": false, + "console": false, + "exports": true, + "global": false, + "Intl": false, + "module": false, + "process": false, + "queueMicrotask": false, + "require": false, + "setImmediate": false, + "setInterval": false, + "setTimeout": false, + "TextDecoder": false, + "TextEncoder": false, + "URL": false, + "URLSearchParams": false + }, + "nodeBuiltin": { + "Buffer": false, + "clearImmediate": false, + "clearInterval": false, + "clearTimeout": false, + "console": false, + "global": false, + "Intl": false, + "process": false, + "queueMicrotask": false, + "setImmediate": false, + "setInterval": false, + "setTimeout": false, + "TextDecoder": false, + "TextEncoder": false, + "URL": false, + "URLSearchParams": false + }, + "commonjs": { + "exports": true, + "global": false, + "module": false, + "require": false + }, + "amd": { + "define": false, + "require": false + }, + "mocha": { + "after": false, + "afterEach": false, + "before": false, + "beforeEach": false, + "context": false, + "describe": false, + "it": false, + "mocha": false, + "run": false, + "setup": false, + "specify": false, + "suite": false, + "suiteSetup": false, + "suiteTeardown": false, + "teardown": false, + "test": false, + "xcontext": false, + "xdescribe": false, + "xit": false, + "xspecify": false + }, + "jasmine": { + "afterAll": false, + "afterEach": false, + "beforeAll": false, + "beforeEach": false, + "describe": false, + "expect": false, + "expectAsync": false, + "fail": false, + "fdescribe": false, + "fit": false, + "it": false, + "jasmine": false, + "pending": false, + "runs": false, + "spyOn": false, + "spyOnAllFunctions": false, + "spyOnProperty": false, + "waits": false, + "waitsFor": false, + "xdescribe": false, + "xit": false + }, + "jest": { + "afterAll": false, + "afterEach": false, + "beforeAll": false, + "beforeEach": false, + "describe": false, + "expect": false, + "fdescribe": false, + "fit": false, + "it": false, + "jest": false, + "pit": false, + "require": false, + "test": false, + "xdescribe": false, + "xit": false, + "xtest": false + }, + "qunit": { + "asyncTest": false, + "deepEqual": false, + "equal": false, + "expect": false, + "module": false, + "notDeepEqual": false, + "notEqual": false, + "notOk": false, + "notPropEqual": false, + "notStrictEqual": false, + "ok": false, + "propEqual": false, + "QUnit": false, + "raises": false, + "start": false, + "stop": false, + "strictEqual": false, + "test": false, + "throws": false + }, + "phantomjs": { + "console": true, + "exports": true, + "phantom": true, + "require": true, + "WebPage": true + }, + "couch": { + "emit": false, + "exports": false, + "getRow": false, + "log": false, + "module": false, + "provides": false, + "require": false, + "respond": false, + "send": false, + "start": false, + "sum": false + }, + "rhino": { + "defineClass": false, + "deserialize": false, + "gc": false, + "help": false, + "importClass": false, + "importPackage": false, + "java": false, + "load": false, + "loadClass": false, + "Packages": false, + "print": false, + "quit": false, + "readFile": false, + "readUrl": false, + "runCommand": false, + "seal": false, + "serialize": false, + "spawn": false, + "sync": false, + "toint32": false, + "version": false + }, + "nashorn": { + "__DIR__": false, + "__FILE__": false, + "__LINE__": false, + "com": false, + "edu": false, + "exit": false, + "java": false, + "Java": false, + "javafx": false, + "JavaImporter": false, + "javax": false, + "JSAdapter": false, + "load": false, + "loadWithNewGlobal": false, + "org": false, + "Packages": false, + "print": false, + "quit": false + }, + "wsh": { + "ActiveXObject": true, + "CollectGarbage": true, + "Debug": true, + "Enumerator": true, + "GetObject": true, + "RuntimeObject": true, + "ScriptEngine": true, + "ScriptEngineBuildVersion": true, + "ScriptEngineMajorVersion": true, + "ScriptEngineMinorVersion": true, + "VBArray": true, + "WScript": true, + "WSH": true, + "XDomainRequest": true + }, + "jquery": { + "$": false, + "jQuery": false + }, + "yui": { + "YAHOO": false, + "YAHOO_config": false, + "YUI": false, + "YUI_config": false + }, + "shelljs": { + "cat": false, + "cd": false, + "chmod": false, + "config": false, + "cp": false, + "dirs": false, + "echo": false, + "env": false, + "error": false, + "exec": false, + "exit": false, + "find": false, + "grep": false, + "ln": false, + "ls": false, + "mkdir": false, + "mv": false, + "popd": false, + "pushd": false, + "pwd": false, + "rm": false, + "sed": false, + "set": false, + "target": false, + "tempdir": false, + "test": false, + "touch": false, + "which": false + }, + "prototypejs": { + "$": false, + "$$": false, + "$A": false, + "$break": false, + "$continue": false, + "$F": false, + "$H": false, + "$R": false, + "$w": false, + "Abstract": false, + "Ajax": false, + "Autocompleter": false, + "Builder": false, + "Class": false, + "Control": false, + "Draggable": false, + "Draggables": false, + "Droppables": false, + "Effect": false, + "Element": false, + "Enumerable": false, + "Event": false, + "Field": false, + "Form": false, + "Hash": false, + "Insertion": false, + "ObjectRange": false, + "PeriodicalExecuter": false, + "Position": false, + "Prototype": false, + "Scriptaculous": false, + "Selector": false, + "Sortable": false, + "SortableObserver": false, + "Sound": false, + "Template": false, + "Toggle": false, + "Try": false + }, + "meteor": { + "_": false, + "$": false, + "Accounts": false, + "AccountsClient": false, + "AccountsCommon": false, + "AccountsServer": false, + "App": false, + "Assets": false, + "Blaze": false, + "check": false, + "Cordova": false, + "DDP": false, + "DDPRateLimiter": false, + "DDPServer": false, + "Deps": false, + "EJSON": false, + "Email": false, + "HTTP": false, + "Log": false, + "Match": false, + "Meteor": false, + "Mongo": false, + "MongoInternals": false, + "Npm": false, + "Package": false, + "Plugin": false, + "process": false, + "Random": false, + "ReactiveDict": false, + "ReactiveVar": false, + "Router": false, + "ServiceConfiguration": false, + "Session": false, + "share": false, + "Spacebars": false, + "Template": false, + "Tinytest": false, + "Tracker": false, + "UI": false, + "Utils": false, + "WebApp": false, + "WebAppInternals": false + }, + "mongo": { + "_isWindows": false, + "_rand": false, + "BulkWriteResult": false, + "cat": false, + "cd": false, + "connect": false, + "db": false, + "getHostName": false, + "getMemInfo": false, + "hostname": false, + "ISODate": false, + "listFiles": false, + "load": false, + "ls": false, + "md5sumFile": false, + "mkdir": false, + "Mongo": false, + "NumberInt": false, + "NumberLong": false, + "ObjectId": false, + "PlanCache": false, + "print": false, + "printjson": false, + "pwd": false, + "quit": false, + "removeFile": false, + "rs": false, + "sh": false, + "UUID": false, + "version": false, + "WriteResult": false + }, + "applescript": { + "$": false, + "Application": false, + "Automation": false, + "console": false, + "delay": false, + "Library": false, + "ObjC": false, + "ObjectSpecifier": false, + "Path": false, + "Progress": false, + "Ref": false + }, + "serviceworker": { + "addEventListener": false, + "applicationCache": false, + "atob": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, + "Cache": false, + "caches": false, + "CacheStorage": false, + "clearInterval": false, + "clearTimeout": false, + "Client": false, + "clients": false, + "Clients": false, + "close": true, + "console": false, + "ExtendableEvent": false, + "ExtendableMessageEvent": false, + "fetch": false, + "FetchEvent": false, + "FileReaderSync": false, + "FormData": false, + "Headers": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "ImageData": false, + "importScripts": false, + "indexedDB": false, + "location": false, + "MessageChannel": false, + "MessagePort": false, + "name": false, + "navigator": false, + "Notification": false, + "onclose": true, + "onconnect": true, + "onerror": true, + "onfetch": true, + "oninstall": true, + "onlanguagechange": true, + "onmessage": true, + "onmessageerror": true, + "onnotificationclick": true, + "onnotificationclose": true, + "onoffline": true, + "ononline": true, + "onpush": true, + "onpushsubscriptionchange": true, + "onrejectionhandled": true, + "onsync": true, + "onunhandledrejection": true, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceNavigation": false, + "PerformanceResourceTiming": false, + "PerformanceTiming": false, + "postMessage": true, + "Promise": false, + "queueMicrotask": false, + "registration": false, + "removeEventListener": false, + "Request": false, + "Response": false, + "self": false, + "ServiceWorker": false, + "ServiceWorkerContainer": false, + "ServiceWorkerGlobalScope": false, + "ServiceWorkerMessageEvent": false, + "ServiceWorkerRegistration": false, + "setInterval": false, + "setTimeout": false, + "skipWaiting": false, + "TextDecoder": false, + "TextEncoder": false, + "URL": false, + "URLSearchParams": false, + "WebSocket": false, + "WindowClient": false, + "Worker": false, + "WorkerGlobalScope": false, + "XMLHttpRequest": false + }, + "atomtest": { + "advanceClock": false, + "fakeClearInterval": false, + "fakeClearTimeout": false, + "fakeSetInterval": false, + "fakeSetTimeout": false, + "resetTimeouts": false, + "waitsForPromise": false + }, + "embertest": { + "andThen": false, + "click": false, + "currentPath": false, + "currentRouteName": false, + "currentURL": false, + "fillIn": false, + "find": false, + "findAll": false, + "findWithAssert": false, + "keyEvent": false, + "pauseTest": false, + "resumeTest": false, + "triggerEvent": false, + "visit": false, + "wait": false + }, + "protractor": { + "$": false, + "$$": false, + "browser": false, + "by": false, + "By": false, + "DartObject": false, + "element": false, + "protractor": false + }, + "shared-node-browser": { + "clearInterval": false, + "clearTimeout": false, + "console": false, + "setInterval": false, + "setTimeout": false, + "URL": false, + "URLSearchParams": false + }, + "webextensions": { + "browser": false, + "chrome": false, + "opr": false + }, + "greasemonkey": { + "cloneInto": false, + "createObjectIn": false, + "exportFunction": false, + "GM": false, + "GM_addStyle": false, + "GM_deleteValue": false, + "GM_getResourceText": false, + "GM_getResourceURL": false, + "GM_getValue": false, + "GM_info": false, + "GM_listValues": false, + "GM_log": false, + "GM_openInTab": false, + "GM_registerMenuCommand": false, + "GM_setClipboard": false, + "GM_setValue": false, + "GM_xmlhttpRequest": false, + "unsafeWindow": false + }, + "devtools": { + "$": false, + "$_": false, + "$$": false, + "$0": false, + "$1": false, + "$2": false, + "$3": false, + "$4": false, + "$x": false, + "chrome": false, + "clear": false, + "copy": false, + "debug": false, + "dir": false, + "dirxml": false, + "getEventListeners": false, + "inspect": false, + "keys": false, + "monitor": false, + "monitorEvents": false, + "profile": false, + "profileEnd": false, + "queryObjects": false, + "table": false, + "undebug": false, + "unmonitor": false, + "unmonitorEvents": false, + "values": false + } +} diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/index.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/index.js new file mode 100644 index 00000000000000..a951582e4176e8 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/index.js @@ -0,0 +1,2 @@ +'use strict'; +module.exports = require('./globals.json'); diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/license b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/license new file mode 100644 index 00000000000000..fa7ceba3eb4a96 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/package.json b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/package.json new file mode 100644 index 00000000000000..66435a6834e8f4 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/package.json @@ -0,0 +1,61 @@ +{ + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/globals/issues" + }, + "bundleDependencies": false, + "dependencies": { + "type-fest": "^0.8.1" + }, + "deprecated": false, + "description": "Global identifiers from different JavaScript environments", + "devDependencies": { + "ava": "^2.2.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts", + "globals.json" + ], + "funding": "https://github.com/sponsors/sindresorhus", + "homepage": "https://github.com/sindresorhus/globals#readme", + "keywords": [ + "globals", + "global", + "identifiers", + "variables", + "vars", + "jshint", + "eslint", + "environments" + ], + "license": "MIT", + "name": "globals", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/globals.git" + }, + "scripts": { + "test": "xo && ava" + }, + "tsd": { + "compilerOptions": { + "resolveJsonModule": true + } + }, + "version": "12.4.0", + "xo": { + "ignores": [ + "get-browser-globals.js" + ] + } +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/readme.md b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/readme.md new file mode 100644 index 00000000000000..fdcfa087ab1107 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/globals/readme.md @@ -0,0 +1,56 @@ +# globals [![Build Status](https://travis-ci.org/sindresorhus/globals.svg?branch=master)](https://travis-ci.org/sindresorhus/globals) + +> Global identifiers from different JavaScript environments + +Extracted from [JSHint](https://github.com/jshint/jshint/blob/3a8efa979dbb157bfb5c10b5826603a55a33b9ad/src/vars.js) and [ESLint](https://github.com/eslint/eslint/blob/b648406218f8a2d7302b98f5565e23199f44eb31/conf/environments.json) and merged. + +It's just a [JSON file](globals.json), so use it in whatever environment you like. + +**This module [no longer accepts](https://github.com/sindresorhus/globals/issues/82) new environments. If you need it for ESLint, just [create a plugin](http://eslint.org/docs/developer-guide/working-with-plugins#environments-in-plugins).** + +## Install + +``` +$ npm install globals +``` + +## Usage + +```js +const globals = require('globals'); + +console.log(globals.browser); +/* +{ + addEventListener: false, + applicationCache: false, + ArrayBuffer: false, + atob: false, + … +} +*/ +``` + +Each global is given a value of `true` or `false`. A value of `true` indicates that the variable may be overwritten. A value of `false` indicates that the variable should be considered read-only. This information is used by static analysis tools to flag incorrect behavior. We assume all variables should be `false` unless we hear otherwise. + +For Node.js this package provides two sets of globals: + +- `globals.nodeBuiltin`: Globals available to all code running in Node.js. + These will usually be available as properties on the `global` object and include `process`, `Buffer`, but not CommonJS arguments like `require`. + See: https://nodejs.org/api/globals.html +- `globals.node`: A combination of the globals from `nodeBuiltin` plus all CommonJS arguments ("CommonJS module scope"). + See: https://nodejs.org/api/modules.html#modules_the_module_scope + +When analyzing code that is known to run outside of a CommonJS wrapper, for example, JavaScript modules, `nodeBuiltin` can find accidental CommonJS references. + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/package.json b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/package.json index d4dbb4b71342c2..9a730ea76f3c2c 100644 --- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/package.json +++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/package.json @@ -1,37 +1,24 @@ { - "name": "@eslint/eslintrc", - "version": "0.4.0", - "description": "The legacy ESLintRC config file format for ESLint", - "main": "lib/index.js", - "files": [ - "lib", - "conf", - "LICENSE" - ], - "publishConfig": { - "access": "public" + "author": { + "name": "Nicholas C. Zakas" }, - "scripts": { - "lint": "eslint .", - "test": "mocha -R progress -c 'tests/lib/**/*.js'", - "generate-release": "eslint-generate-release", - "generate-alpharelease": "eslint-generate-prerelease alpha", - "generate-betarelease": "eslint-generate-prerelease beta", - "generate-rcrelease": "eslint-generate-prerelease rc", - "publish-release": "eslint-publish-release" - }, - "repository": "eslint/eslintrc", - "keywords": [ - "ESLint", - "ESLintRC", - "Configuration" - ], - "author": "Nicholas C. Zakas", - "license": "MIT", "bugs": { "url": "https://github.com/eslint/eslintrc/issues" }, - "homepage": "https://github.com/eslint/eslintrc#readme", + "bundleDependencies": false, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "deprecated": false, + "description": "The legacy ESLintRC config file format for ESLint", "devDependencies": { "chai": "^4.2.0", "eslint": "^7.7.0", @@ -45,18 +32,38 @@ "sinon": "^9.2.0", "temp-dir": "^2.0.0" }, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, "engines": { "node": "^10.12.0 || >=12.0.0" - } -} + }, + "files": [ + "lib", + "conf", + "LICENSE" + ], + "homepage": "https://github.com/eslint/eslintrc#readme", + "keywords": [ + "ESLint", + "ESLintRC", + "Configuration" + ], + "license": "MIT", + "main": "lib/index.js", + "name": "@eslint/eslintrc", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/eslint/eslintrc.git" + }, + "scripts": { + "generate-alpharelease": "eslint-generate-prerelease alpha", + "generate-betarelease": "eslint-generate-prerelease beta", + "generate-rcrelease": "eslint-generate-prerelease rc", + "generate-release": "eslint-generate-release", + "lint": "eslint .", + "publish-release": "eslint-publish-release", + "test": "mocha -R progress -c 'tests/lib/**/*.js'" + }, + "version": "0.4.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/acorn-jsx/package.json b/tools/node_modules/eslint/node_modules/acorn-jsx/package.json index f42a7ea1437c8c..e26bc863624eb8 100644 --- a/tools/node_modules/eslint/node_modules/acorn-jsx/package.json +++ b/tools/node_modules/eslint/node_modules/acorn-jsx/package.json @@ -1,27 +1,32 @@ { - "name": "acorn-jsx", + "bugs": { + "url": "https://github.com/acornjs/acorn-jsx/issues" + }, + "bundleDependencies": false, + "deprecated": false, "description": "Modern, fast React.js JSX parser", + "devDependencies": { + "acorn": "^8.0.1" + }, "homepage": "https://github.com/acornjs/acorn-jsx", - "version": "5.3.1", + "license": "MIT", "maintainers": [ { "name": "Ingvar Stepanyan", "email": "me@rreverser.com", - "web": "http://rreverser.com/" + "url": "http://rreverser.com/" } ], + "name": "acorn-jsx", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, "repository": { "type": "git", - "url": "https://github.com/acornjs/acorn-jsx" + "url": "git+https://github.com/acornjs/acorn-jsx.git" }, - "license": "MIT", "scripts": { "test": "node test/run.js" }, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "devDependencies": { - "acorn": "^8.0.1" - } -} + "version": "5.3.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/acorn/package.json b/tools/node_modules/eslint/node_modules/acorn/package.json index 10699306d369f8..a0944f1372f605 100644 --- a/tools/node_modules/eslint/node_modules/acorn/package.json +++ b/tools/node_modules/eslint/node_modules/acorn/package.json @@ -1,35 +1,44 @@ { - "name": "acorn", + "bin": { + "acorn": "bin/acorn" + }, + "bugs": { + "url": "https://github.com/acornjs/acorn/issues" + }, + "bundleDependencies": false, + "deprecated": false, "description": "ECMAScript parser", + "engines": { + "node": ">=0.4.0" + }, "homepage": "https://github.com/acornjs/acorn", + "license": "MIT", "main": "dist/acorn.js", - "types": "dist/acorn.d.ts", - "module": "dist/acorn.mjs", - "version": "7.4.1", - "engines": {"node": ">=0.4.0"}, "maintainers": [ { "name": "Marijn Haverbeke", "email": "marijnh@gmail.com", - "web": "https://marijnhaverbeke.nl" + "url": "https://marijnhaverbeke.nl" }, { "name": "Ingvar Stepanyan", "email": "me@rreverser.com", - "web": "https://rreverser.com/" + "url": "https://rreverser.com/" }, { "name": "Adrian Heine", - "web": "http://adrianheine.de" + "url": "http://adrianheine.de" } ], + "module": "dist/acorn.mjs", + "name": "acorn", "repository": { "type": "git", - "url": "https://github.com/acornjs/acorn.git" + "url": "git+https://github.com/acornjs/acorn.git" }, - "license": "MIT", "scripts": { "prepare": "cd ..; npm run build:main && npm run build:bin" }, - "bin": {"acorn": "./bin/acorn"} -} + "types": "dist/acorn.d.ts", + "version": "7.4.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/ajv/package.json b/tools/node_modules/eslint/node_modules/ajv/package.json index 559a933c8c1c03..6657aaf6c4ab24 100644 --- a/tools/node_modules/eslint/node_modules/ajv/package.json +++ b/tools/node_modules/eslint/node_modules/ajv/package.json @@ -1,72 +1,23 @@ { - "name": "ajv", - "version": "6.12.6", - "description": "Another JSON Schema Validator", - "main": "lib/ajv.js", - "typings": "lib/ajv.d.ts", - "files": [ - "lib/", - "dist/", - "scripts/", - "LICENSE", - ".tonic_example.js" - ], - "scripts": { - "eslint": "eslint lib/{compile/,}*.js spec/{**/,}*.js scripts --ignore-pattern spec/JSON-Schema-Test-Suite", - "jshint": "jshint lib/{compile/,}*.js", - "lint": "npm run jshint && npm run eslint", - "test-spec": "mocha spec/{**/,}*.spec.js -R spec", - "test-fast": "AJV_FAST_TEST=true npm run test-spec", - "test-debug": "npm run test-spec -- --inspect-brk", - "test-cov": "nyc npm run test-spec", - "test-ts": "tsc --target ES5 --noImplicitAny --noEmit spec/typescript/index.ts", - "bundle": "del-cli dist && node ./scripts/bundle.js . Ajv pure_getters", - "bundle-beautify": "node ./scripts/bundle.js js-beautify", - "build": "del-cli lib/dotjs/*.js \"!lib/dotjs/index.js\" && node scripts/compile-dots.js", - "test-karma": "karma start", - "test-browser": "del-cli .browser && npm run bundle && scripts/prepare-tests && npm run test-karma", - "test-all": "npm run test-cov && if-node-version 10 npm run test-browser", - "test": "npm run lint && npm run build && npm run test-all", - "prepublish": "npm run build && npm run bundle", - "watch": "watch \"npm run build\" ./lib/dot" - }, - "nyc": { - "exclude": [ - "**/spec/**", - "node_modules" - ], - "reporter": [ - "lcov", - "text-summary" - ] - }, - "repository": { - "type": "git", - "url": "https://github.com/ajv-validator/ajv.git" + "author": { + "name": "Evgeny Poberezkin" }, - "keywords": [ - "JSON", - "schema", - "validator", - "validation", - "jsonschema", - "json-schema", - "json-schema-validator", - "json-schema-validation" - ], - "author": "Evgeny Poberezkin", - "license": "MIT", "bugs": { "url": "https://github.com/ajv-validator/ajv/issues" }, - "homepage": "https://github.com/ajv-validator/ajv", - "tonicExampleFilename": ".tonic_example.js", + "bundleDependencies": false, + "collective": { + "type": "opencollective", + "url": "https://opencollective.com/ajv" + }, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" }, + "deprecated": false, + "description": "Another JSON Schema Validator", "devDependencies": { "ajv-async": "^1.0.0", "bluebird": "^3.5.3", @@ -95,12 +46,65 @@ "uglify-js": "^3.6.9", "watch": "^1.0.0" }, - "collective": { - "type": "opencollective", - "url": "https://opencollective.com/ajv" - }, + "files": [ + "lib/", + "dist/", + "scripts/", + "LICENSE", + ".tonic_example.js" + ], "funding": { "type": "github", "url": "https://github.com/sponsors/epoberezkin" - } -} + }, + "homepage": "https://github.com/ajv-validator/ajv", + "keywords": [ + "JSON", + "schema", + "validator", + "validation", + "jsonschema", + "json-schema", + "json-schema-validator", + "json-schema-validation" + ], + "license": "MIT", + "main": "lib/ajv.js", + "name": "ajv", + "nyc": { + "exclude": [ + "**/spec/**", + "node_modules" + ], + "reporter": [ + "lcov", + "text-summary" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ajv-validator/ajv.git" + }, + "scripts": { + "build": "del-cli lib/dotjs/*.js \"!lib/dotjs/index.js\" && node scripts/compile-dots.js", + "bundle": "del-cli dist && node ./scripts/bundle.js . Ajv pure_getters", + "bundle-beautify": "node ./scripts/bundle.js js-beautify", + "eslint": "eslint lib/{compile/,}*.js spec/{**/,}*.js scripts --ignore-pattern spec/JSON-Schema-Test-Suite", + "jshint": "jshint lib/{compile/,}*.js", + "lint": "npm run jshint && npm run eslint", + "prepublish": "npm run build && npm run bundle", + "test": "npm run lint && npm run build && npm run test-all", + "test-all": "npm run test-cov && if-node-version 10 npm run test-browser", + "test-browser": "del-cli .browser && npm run bundle && scripts/prepare-tests && npm run test-karma", + "test-cov": "nyc npm run test-spec", + "test-debug": "npm run test-spec -- --inspect-brk", + "test-fast": "AJV_FAST_TEST=true npm run test-spec", + "test-karma": "karma start", + "test-spec": "mocha spec/{**/,}*.spec.js -R spec", + "test-ts": "tsc --target ES5 --noImplicitAny --noEmit spec/typescript/index.ts", + "watch": "watch \"npm run build\" ./lib/dot" + }, + "tonicExampleFilename": ".tonic_example.js", + "typings": "lib/ajv.d.ts", + "version": "6.12.6" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/ansi-colors/package.json b/tools/node_modules/eslint/node_modules/ansi-colors/package.json index e11093140b3277..8c23184218ac6b 100644 --- a/tools/node_modules/eslint/node_modules/ansi-colors/package.json +++ b/tools/node_modules/eslint/node_modules/ansi-colors/package.json @@ -1,33 +1,32 @@ { - "name": "ansi-colors", - "description": "Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in replacement for chalk, kleur and turbocolor (without the dependencies and rendering bugs).", - "version": "4.1.1", - "homepage": "https://github.com/doowb/ansi-colors", - "author": "Brian Woodward (https://github.com/doowb)", - "contributors": [ - "Brian Woodward (https://twitter.com/doowb)", - "Jason Schilling (https://sourecode.de)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)", - "Jordan (https://github.com/Silic0nS0ldier)" - ], - "repository": "doowb/ansi-colors", + "author": { + "name": "Brian Woodward", + "url": "https://github.com/doowb" + }, "bugs": { "url": "https://github.com/doowb/ansi-colors/issues" }, - "license": "MIT", - "files": [ - "index.js", - "symbols.js", - "types/index.d.ts" + "bundleDependencies": false, + "contributors": [ + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Jason Schilling", + "url": "https://sourecode.de" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Jordan", + "url": "https://github.com/Silic0nS0ldier" + } ], - "main": "index.js", - "types": "./types/index.d.ts", - "engines": { - "node": ">=6" - }, - "scripts": { - "test": "mocha" - }, + "deprecated": false, + "description": "Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in replacement for chalk, kleur and turbocolor (without the dependencies and rendering bugs).", "devDependencies": { "decache": "^4.5.1", "gulp-format-md": "^2.0.0", @@ -35,6 +34,15 @@ "mocha": "^6.1.4", "text-table": "^0.2.0" }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js", + "symbols.js", + "types/index.d.ts" + ], + "homepage": "https://github.com/doowb/ansi-colors", "keywords": [ "ansi", "bgblack", @@ -75,6 +83,17 @@ "white", "yellow" ], + "license": "MIT", + "main": "index.js", + "name": "ansi-colors", + "repository": { + "type": "git", + "url": "git+https://github.com/doowb/ansi-colors.git" + }, + "scripts": { + "test": "mocha" + }, + "types": "./types/index.d.ts", "verb": { "toc": false, "layout": "default", @@ -105,5 +124,6 @@ "colors", "kleur" ] - } -} + }, + "version": "4.1.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/ansi-regex/package.json b/tools/node_modules/eslint/node_modules/ansi-regex/package.json index 7af801f3522206..d0574afde48599 100644 --- a/tools/node_modules/eslint/node_modules/ansi-regex/package.json +++ b/tools/node_modules/eslint/node_modules/ansi-regex/package.json @@ -1,55 +1,64 @@ { - "name": "ansi-regex", - "version": "5.0.0", - "description": "Regular expression for matching ANSI escape codes", - "license": "MIT", - "repository": "chalk/ansi-regex", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd", - "view-supported": "node fixtures/view-codes.js" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern" - ], - "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.9.0", - "xo": "^0.25.3" - } -} + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Regular expression for matching ANSI escape codes", + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/chalk/ansi-regex#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "license": "MIT", + "name": "ansi-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-regex.git" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "version": "5.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/ansi-styles/index.js b/tools/node_modules/eslint/node_modules/ansi-styles/index.js index 5d82581a13f990..90a871c4d78f6f 100644 --- a/tools/node_modules/eslint/node_modules/ansi-styles/index.js +++ b/tools/node_modules/eslint/node_modules/ansi-styles/index.js @@ -1,63 +1,21 @@ 'use strict'; +const colorConvert = require('color-convert'); -const wrapAnsi16 = (fn, offset) => (...args) => { - const code = fn(...args); +const wrapAnsi16 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); return `\u001B[${code + offset}m`; }; -const wrapAnsi256 = (fn, offset) => (...args) => { - const code = fn(...args); +const wrapAnsi256 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); return `\u001B[${38 + offset};5;${code}m`; }; -const wrapAnsi16m = (fn, offset) => (...args) => { - const rgb = fn(...args); +const wrapAnsi16m = (fn, offset) => function () { + const rgb = fn.apply(colorConvert, arguments); return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; }; -const ansi2ansi = n => n; -const rgb2rgb = (r, g, b) => [r, g, b]; - -const setLazyProperty = (object, property, get) => { - Object.defineProperty(object, property, { - get: () => { - const value = get(); - - Object.defineProperty(object, property, { - value, - enumerable: true, - configurable: true - }); - - return value; - }, - enumerable: true, - configurable: true - }); -}; - -/** @type {typeof import('color-convert')} */ -let colorConvert; -const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { - if (colorConvert === undefined) { - colorConvert = require('color-convert'); - } - - const offset = isBackground ? 10 : 0; - const styles = {}; - - for (const [sourceSpace, suite] of Object.entries(colorConvert)) { - const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; - if (sourceSpace === targetSpace) { - styles[name] = wrap(identity, offset); - } else if (typeof suite === 'object') { - styles[name] = wrap(suite[targetSpace], offset); - } - } - - return styles; -}; - function assembleStyles() { const codes = new Map(); const styles = { @@ -81,9 +39,9 @@ function assembleStyles() { magenta: [35, 39], cyan: [36, 39], white: [37, 39], + gray: [90, 39], // Bright color - blackBright: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], @@ -114,14 +72,15 @@ function assembleStyles() { } }; - // Alias bright black as gray (and grey) - styles.color.gray = styles.color.blackBright; - styles.bgColor.bgGray = styles.bgColor.bgBlackBright; - styles.color.grey = styles.color.blackBright; - styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + // Fix humans + styles.color.grey = styles.color.gray; + + for (const groupName of Object.keys(styles)) { + const group = styles[groupName]; + + for (const styleName of Object.keys(group)) { + const style = group[styleName]; - for (const [groupName, group] of Object.entries(styles)) { - for (const [styleName, style] of Object.entries(group)) { styles[styleName] = { open: `\u001B[${style[0]}m`, close: `\u001B[${style[1]}m` @@ -136,22 +95,65 @@ function assembleStyles() { value: group, enumerable: false }); + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); } - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); + const ansi2ansi = n => n; + const rgb2rgb = (r, g, b) => [r, g, b]; styles.color.close = '\u001B[39m'; styles.bgColor.close = '\u001B[49m'; - setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); - setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); + styles.color.ansi = { + ansi: wrapAnsi16(ansi2ansi, 0) + }; + styles.color.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 0) + }; + styles.color.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 0) + }; + + styles.bgColor.ansi = { + ansi: wrapAnsi16(ansi2ansi, 10) + }; + styles.bgColor.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 10) + }; + styles.bgColor.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 10) + }; + + for (let key of Object.keys(colorConvert)) { + if (typeof colorConvert[key] !== 'object') { + continue; + } + + const suite = colorConvert[key]; + + if (key === 'ansi16') { + key = 'ansi'; + } + + if ('ansi16' in suite) { + styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); + styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); + } + + if ('ansi256' in suite) { + styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); + styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); + } + + if ('rgb' in suite) { + styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); + styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); + } + } return styles; } diff --git a/tools/node_modules/eslint/node_modules/ansi-styles/package.json b/tools/node_modules/eslint/node_modules/ansi-styles/package.json index 75393284d7e474..5663ace24b4607 100644 --- a/tools/node_modules/eslint/node_modules/ansi-styles/package.json +++ b/tools/node_modules/eslint/node_modules/ansi-styles/package.json @@ -1,56 +1,65 @@ { - "name": "ansi-styles", - "version": "4.3.0", - "description": "ANSI escape codes for styling strings in the terminal", - "license": "MIT", - "repository": "chalk/ansi-styles", - "funding": "https://github.com/chalk/ansi-styles?sponsor=1", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd", - "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "color-convert": "^2.0.1" - }, - "devDependencies": { - "@types/color-convert": "^1.9.0", - "ava": "^2.3.0", - "svg-term-cli": "^2.1.1", - "tsd": "^0.11.0", - "xo": "^0.25.3" - } -} + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "ava": { + "require": "babel-polyfill" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-styles/issues" + }, + "bundleDependencies": false, + "dependencies": { + "color-convert": "^1.9.0" + }, + "deprecated": false, + "description": "ANSI escape codes for styling strings in the terminal", + "devDependencies": { + "ava": "*", + "babel-polyfill": "^6.23.0", + "svg-term-cli": "^2.1.1", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/chalk/ansi-styles#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "name": "ansi-styles", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-styles.git" + }, + "scripts": { + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor", + "test": "xo && ava" + }, + "version": "3.2.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/ansi-styles/readme.md b/tools/node_modules/eslint/node_modules/ansi-styles/readme.md index 24883de808be6a..3158e2df59ce66 100644 --- a/tools/node_modules/eslint/node_modules/ansi-styles/readme.md +++ b/tools/node_modules/eslint/node_modules/ansi-styles/readme.md @@ -1,10 +1,11 @@ # ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) -> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal +> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. - + + ## Install @@ -12,6 +13,7 @@ You probably want the higher-level [chalk](https://github.com/chalk/chalk) modul $ npm install ansi-styles ``` + ## Usage ```js @@ -27,13 +29,14 @@ console.log(`${style.green.open}Hello world!${style.green.close}`); // original color. console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); -console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close); +console.log(style.color.ansi16m.hex('#ABCDEF') + 'Hello world!' + style.color.close); ``` ## API Each style has an `open` and `close` property. + ## Styles ### Modifiers @@ -57,7 +60,7 @@ Each style has an `open` and `close` property. - `magenta` - `cyan` - `white` -- `blackBright` (alias: `gray`, `grey`) +- `gray` ("bright black") - `redBright` - `greenBright` - `yellowBright` @@ -76,7 +79,7 @@ Each style has an `open` and `close` property. - `bgMagenta` - `bgCyan` - `bgWhite` -- `bgBlackBright` (alias: `bgGray`, `bgGrey`) +- `bgBlackBright` - `bgRedBright` - `bgGreenBright` - `bgYellowBright` @@ -85,6 +88,7 @@ Each style has an `open` and `close` property. - `bgCyanBright` - `bgWhiteBright` + ## Advanced usage By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. @@ -108,21 +112,11 @@ console.log(style.codes.get(36)); //=> 39 ``` + ## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) `ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. -The following color spaces from `color-convert` are supported: - -- `rgb` -- `hex` -- `keyword` -- `hsl` -- `hsv` -- `hwb` -- `ansi` -- `ansi256` - To use these, call the associated conversion function with the intended output, for example: ```js @@ -136,17 +130,18 @@ style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code ``` + ## Related - [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal + ## Maintainers - [Sindre Sorhus](https://github.com/sindresorhus) - [Josh Junon](https://github.com/qix-) -## For enterprise -Available as part of the Tidelift Subscription. +## License -The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) +MIT diff --git a/tools/node_modules/eslint/node_modules/argparse/package.json b/tools/node_modules/eslint/node_modules/argparse/package.json index 62fba0a9fcfc87..12f9cf1395b90e 100644 --- a/tools/node_modules/eslint/node_modules/argparse/package.json +++ b/tools/node_modules/eslint/node_modules/argparse/package.json @@ -1,7 +1,32 @@ { - "name": "argparse", + "bugs": { + "url": "https://github.com/nodeca/argparse/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Eugene Shkuropat" + }, + { + "name": "Paul Jacobson" + } + ], + "dependencies": { + "sprintf-js": "~1.0.2" + }, + "deprecated": false, "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library", - "version": "1.0.10", + "devDependencies": { + "eslint": "^2.13.1", + "istanbul": "^0.4.5", + "mocha": "^3.1.0", + "ndoc": "^5.0.1" + }, + "files": [ + "index.js", + "lib/" + ], + "homepage": "https://github.com/nodeca/argparse#readme", "keywords": [ "cli", "parser", @@ -9,26 +34,14 @@ "option", "args" ], - "contributors": [ - "Eugene Shkuropat", - "Paul Jacobson" - ], - "files": [ - "index.js", - "lib/" - ], "license": "MIT", - "repository": "nodeca/argparse", + "name": "argparse", + "repository": { + "type": "git", + "url": "git+https://github.com/nodeca/argparse.git" + }, "scripts": { "test": "make test" }, - "dependencies": { - "sprintf-js": "~1.0.2" - }, - "devDependencies": { - "eslint": "^2.13.1", - "istanbul": "^0.4.5", - "mocha": "^3.1.0", - "ndoc": "^5.0.1" - } -} + "version": "1.0.10" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/astral-regex/package.json b/tools/node_modules/eslint/node_modules/astral-regex/package.json index d1ceea7f3add66..50ad84da9d6243 100644 --- a/tools/node_modules/eslint/node_modules/astral-regex/package.json +++ b/tools/node_modules/eslint/node_modules/astral-regex/package.json @@ -1,33 +1,42 @@ { - "name": "astral-regex", - "version": "2.0.0", - "description": "Regular expression for matching astral symbols", - "license": "MIT", - "repository": "kevva/astral-regex", - "author": { - "name": "Kevin Mårtensson", - "email": "kevinmartensson@gmail.com", - "url": "github.com/kevva" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "astral", - "emoji", - "regex", - "surrogate" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} + "author": { + "name": "Kevin Mårtensson", + "email": "kevinmartensson@gmail.com", + "url": "github.com/kevva" + }, + "bugs": { + "url": "https://github.com/kevva/astral-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Regular expression for matching astral symbols", + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/kevva/astral-regex#readme", + "keywords": [ + "astral", + "emoji", + "regex", + "surrogate" + ], + "license": "MIT", + "name": "astral-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/kevva/astral-regex.git" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "version": "2.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/balanced-match/package.json b/tools/node_modules/eslint/node_modules/balanced-match/package.json index 61349c6edad627..354df6cf2f70da 100644 --- a/tools/node_modules/eslint/node_modules/balanced-match/package.json +++ b/tools/node_modules/eslint/node_modules/balanced-match/package.json @@ -1,22 +1,21 @@ { - "name": "balanced-match", - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "version": "1.0.0", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" }, - "homepage": "https://github.com/juliangruber/balanced-match", - "main": "index.js", - "scripts": { - "test": "make test", - "bench": "make bench" + "bugs": { + "url": "https://github.com/juliangruber/balanced-match/issues" }, + "bundleDependencies": false, "dependencies": {}, + "deprecated": false, + "description": "Match balanced character pairs, like \"{\" and \"}\"", "devDependencies": { "matcha": "^0.7.0", "tape": "^4.6.0" }, + "homepage": "https://github.com/juliangruber/balanced-match", "keywords": [ "match", "regexp", @@ -24,12 +23,17 @@ "balanced", "parse" ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, "license": "MIT", + "main": "index.js", + "name": "balanced-match", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "scripts": { + "bench": "make bench", + "test": "make test" + }, "testling": { "files": "test/*.js", "browsers": [ @@ -45,5 +49,6 @@ "iphone/6.0..latest", "android-browser/4.2..latest" ] - } -} + }, + "version": "1.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/brace-expansion/package.json b/tools/node_modules/eslint/node_modules/brace-expansion/package.json index a18faa8fd67b82..af3bc67cac86e1 100644 --- a/tools/node_modules/eslint/node_modules/brace-expansion/package.json +++ b/tools/node_modules/eslint/node_modules/brace-expansion/package.json @@ -1,33 +1,37 @@ { - "name": "brace-expansion", - "description": "Brace expansion as known from sh/bash", - "version": "1.1.11", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" }, - "homepage": "https://github.com/juliangruber/brace-expansion", - "main": "index.js", - "scripts": { - "test": "tape test/*.js", - "gentest": "bash test/generate.sh", - "bench": "matcha test/perf/bench.js" + "bugs": { + "url": "https://github.com/juliangruber/brace-expansion/issues" }, + "bundleDependencies": false, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" }, + "deprecated": false, + "description": "Brace expansion as known from sh/bash", "devDependencies": { "matcha": "^0.7.0", "tape": "^4.6.0" }, + "homepage": "https://github.com/juliangruber/brace-expansion", "keywords": [], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, "license": "MIT", + "main": "index.js", + "name": "brace-expansion", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "scripts": { + "bench": "matcha test/perf/bench.js", + "gentest": "bash test/generate.sh", + "test": "tape test/*.js" + }, "testling": { "files": "test/*.js", "browsers": [ @@ -43,5 +47,6 @@ "iphone/6.0..latest", "android-browser/4.2..latest" ] - } -} + }, + "version": "1.1.11" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/callsites/package.json b/tools/node_modules/eslint/node_modules/callsites/package.json index 93463c34b25dab..b36dc6b150f396 100644 --- a/tools/node_modules/eslint/node_modules/callsites/package.json +++ b/tools/node_modules/eslint/node_modules/callsites/package.json @@ -1,39 +1,48 @@ { - "name": "callsites", - "version": "3.1.0", - "description": "Get callsites from the V8 stack trace API", - "license": "MIT", - "repository": "sindresorhus/callsites", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=6" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "stacktrace", - "v8", - "callsite", - "callsites", - "stack", - "trace", - "function", - "file", - "line", - "debug" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/callsites/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Get callsites from the V8 stack trace API", + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/sindresorhus/callsites#readme", + "keywords": [ + "stacktrace", + "v8", + "callsite", + "callsites", + "stack", + "trace", + "function", + "file", + "line", + "debug" + ], + "license": "MIT", + "name": "callsites", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/callsites.git" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "version": "3.1.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/index.js b/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/index.js new file mode 100644 index 00000000000000..5d82581a13f990 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/index.js @@ -0,0 +1,163 @@ +'use strict'; + +const wrapAnsi16 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => (...args) => { + const rgb = fn(...args); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +const ansi2ansi = n => n; +const rgb2rgb = (r, g, b) => [r, g, b]; + +const setLazyProperty = (object, property, get) => { + Object.defineProperty(object, property, { + get: () => { + const value = get(); + + Object.defineProperty(object, property, { + value, + enumerable: true, + configurable: true + }); + + return value; + }, + enumerable: true, + configurable: true + }); +}; + +/** @type {typeof import('color-convert')} */ +let colorConvert; +const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { + if (colorConvert === undefined) { + colorConvert = require('color-convert'); + } + + const offset = isBackground ? 10 : 0; + const styles = {}; + + for (const [sourceSpace, suite] of Object.entries(colorConvert)) { + const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; + if (sourceSpace === targetSpace) { + styles[name] = wrap(identity, offset); + } else if (typeof suite === 'object') { + styles[name] = wrap(suite[targetSpace], offset); + } + } + + return styles; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + + // Bright color + blackBright: [90, 39], + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Alias bright black as gray (and grey) + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); + setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/license b/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/license similarity index 100% rename from tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/license rename to tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/license diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/package.json b/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/package.json new file mode 100644 index 00000000000000..d276e03d2549c8 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/package.json @@ -0,0 +1,65 @@ +{ + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-styles/issues" + }, + "bundleDependencies": false, + "dependencies": { + "color-convert": "^2.0.1" + }, + "deprecated": false, + "description": "ANSI escape codes for styling strings in the terminal", + "devDependencies": { + "@types/color-convert": "^1.9.0", + "ava": "^2.3.0", + "svg-term-cli": "^2.1.1", + "tsd": "^0.11.0", + "xo": "^0.25.3" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "funding": "https://github.com/chalk/ansi-styles?sponsor=1", + "homepage": "https://github.com/chalk/ansi-styles#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "name": "ansi-styles", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-styles.git" + }, + "scripts": { + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor", + "test": "xo && ava && tsd" + }, + "version": "4.3.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/readme.md b/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/readme.md similarity index 77% rename from tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/readme.md rename to tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/readme.md index 3158e2df59ce66..24883de808be6a 100644 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/readme.md +++ b/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/readme.md @@ -1,11 +1,10 @@ # ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) -> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal +> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. - - + ## Install @@ -13,7 +12,6 @@ You probably want the higher-level [chalk](https://github.com/chalk/chalk) modul $ npm install ansi-styles ``` - ## Usage ```js @@ -29,14 +27,13 @@ console.log(`${style.green.open}Hello world!${style.green.close}`); // original color. console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); -console.log(style.color.ansi16m.hex('#ABCDEF') + 'Hello world!' + style.color.close); +console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close); ``` ## API Each style has an `open` and `close` property. - ## Styles ### Modifiers @@ -60,7 +57,7 @@ Each style has an `open` and `close` property. - `magenta` - `cyan` - `white` -- `gray` ("bright black") +- `blackBright` (alias: `gray`, `grey`) - `redBright` - `greenBright` - `yellowBright` @@ -79,7 +76,7 @@ Each style has an `open` and `close` property. - `bgMagenta` - `bgCyan` - `bgWhite` -- `bgBlackBright` +- `bgBlackBright` (alias: `bgGray`, `bgGrey`) - `bgRedBright` - `bgGreenBright` - `bgYellowBright` @@ -88,7 +85,6 @@ Each style has an `open` and `close` property. - `bgCyanBright` - `bgWhiteBright` - ## Advanced usage By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. @@ -112,11 +108,21 @@ console.log(style.codes.get(36)); //=> 39 ``` - ## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) `ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. +The following color spaces from `color-convert` are supported: + +- `rgb` +- `hex` +- `keyword` +- `hsl` +- `hsv` +- `hwb` +- `ansi` +- `ansi256` + To use these, call the associated conversion function with the intended output, for example: ```js @@ -130,18 +136,17 @@ style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code ``` - ## Related - [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal - ## Maintainers - [Sindre Sorhus](https://github.com/sindresorhus) - [Josh Junon](https://github.com/qix-) +## For enterprise -## License +Available as part of the Tidelift Subscription. -MIT +The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/LICENSE b/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/LICENSE similarity index 100% rename from tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/LICENSE rename to tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/LICENSE diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/README.md b/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/README.md similarity index 100% rename from tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/README.md rename to tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/README.md diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/conversions.js b/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/conversions.js similarity index 51% rename from tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/conversions.js rename to tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/conversions.js index 32172007ec0b17..2657f265c9e102 100644 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/conversions.js +++ b/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/conversions.js @@ -1,18 +1,17 @@ /* MIT license */ -var cssKeywords = require('color-name'); +/* eslint-disable no-mixed-operators */ +const cssKeywords = require('color-name'); // NOTE: conversions should only return primitive values (i.e. arrays, or // values that give correct `typeof` results). // do not use box values types (i.e. Number(), String(), etc.) -var reverseKeywords = {}; -for (var key in cssKeywords) { - if (cssKeywords.hasOwnProperty(key)) { - reverseKeywords[cssKeywords[key]] = key; - } +const reverseKeywords = {}; +for (const key of Object.keys(cssKeywords)) { + reverseKeywords[cssKeywords[key]] = key; } -var convert = module.exports = { +const convert = { rgb: {channels: 3, labels: 'rgb'}, hsl: {channels: 3, labels: 'hsl'}, hsv: {channels: 3, labels: 'hsv'}, @@ -30,40 +29,38 @@ var convert = module.exports = { gray: {channels: 1, labels: ['gray']} }; -// hide .channels and .labels properties -for (var model in convert) { - if (convert.hasOwnProperty(model)) { - if (!('channels' in convert[model])) { - throw new Error('missing channels property: ' + model); - } +module.exports = convert; - if (!('labels' in convert[model])) { - throw new Error('missing channel labels property: ' + model); - } +// Hide .channels and .labels properties +for (const model of Object.keys(convert)) { + if (!('channels' in convert[model])) { + throw new Error('missing channels property: ' + model); + } - if (convert[model].labels.length !== convert[model].channels) { - throw new Error('channel and label counts mismatch: ' + model); - } + if (!('labels' in convert[model])) { + throw new Error('missing channel labels property: ' + model); + } - var channels = convert[model].channels; - var labels = convert[model].labels; - delete convert[model].channels; - delete convert[model].labels; - Object.defineProperty(convert[model], 'channels', {value: channels}); - Object.defineProperty(convert[model], 'labels', {value: labels}); + if (convert[model].labels.length !== convert[model].channels) { + throw new Error('channel and label counts mismatch: ' + model); } + + const {channels, labels} = convert[model]; + delete convert[model].channels; + delete convert[model].labels; + Object.defineProperty(convert[model], 'channels', {value: channels}); + Object.defineProperty(convert[model], 'labels', {value: labels}); } convert.rgb.hsl = function (rgb) { - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; - var min = Math.min(r, g, b); - var max = Math.max(r, g, b); - var delta = max - min; - var h; - var s; - var l; + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const min = Math.min(r, g, b); + const max = Math.max(r, g, b); + const delta = max - min; + let h; + let s; if (max === min) { h = 0; @@ -81,7 +78,7 @@ convert.rgb.hsl = function (rgb) { h += 360; } - l = (min + max) / 2; + const l = (min + max) / 2; if (max === min) { s = 0; @@ -95,23 +92,24 @@ convert.rgb.hsl = function (rgb) { }; convert.rgb.hsv = function (rgb) { - var rdif; - var gdif; - var bdif; - var h; - var s; - - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; - var v = Math.max(r, g, b); - var diff = v - Math.min(r, g, b); - var diffc = function (c) { + let rdif; + let gdif; + let bdif; + let h; + let s; + + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const v = Math.max(r, g, b); + const diff = v - Math.min(r, g, b); + const diffc = function (c) { return (v - c) / 6 / diff + 1 / 2; }; if (diff === 0) { - h = s = 0; + h = 0; + s = 0; } else { s = diff / v; rdif = diffc(r); @@ -125,6 +123,7 @@ convert.rgb.hsv = function (rgb) { } else if (b === v) { h = (2 / 3) + gdif - rdif; } + if (h < 0) { h += 1; } else if (h > 1) { @@ -140,11 +139,11 @@ convert.rgb.hsv = function (rgb) { }; convert.rgb.hwb = function (rgb) { - var r = rgb[0]; - var g = rgb[1]; - var b = rgb[2]; - var h = convert.rgb.hsl(rgb)[0]; - var w = 1 / 255 * Math.min(r, Math.min(g, b)); + const r = rgb[0]; + const g = rgb[1]; + let b = rgb[2]; + const h = convert.rgb.hsl(rgb)[0]; + const w = 1 / 255 * Math.min(r, Math.min(g, b)); b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); @@ -152,54 +151,48 @@ convert.rgb.hwb = function (rgb) { }; convert.rgb.cmyk = function (rgb) { - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; - var c; - var m; - var y; - var k; - - k = Math.min(1 - r, 1 - g, 1 - b); - c = (1 - r - k) / (1 - k) || 0; - m = (1 - g - k) / (1 - k) || 0; - y = (1 - b - k) / (1 - k) || 0; + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + + const k = Math.min(1 - r, 1 - g, 1 - b); + const c = (1 - r - k) / (1 - k) || 0; + const m = (1 - g - k) / (1 - k) || 0; + const y = (1 - b - k) / (1 - k) || 0; return [c * 100, m * 100, y * 100, k * 100]; }; -/** - * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance - * */ function comparativeDistance(x, y) { + /* + See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance + */ return ( - Math.pow(x[0] - y[0], 2) + - Math.pow(x[1] - y[1], 2) + - Math.pow(x[2] - y[2], 2) + ((x[0] - y[0]) ** 2) + + ((x[1] - y[1]) ** 2) + + ((x[2] - y[2]) ** 2) ); } convert.rgb.keyword = function (rgb) { - var reversed = reverseKeywords[rgb]; + const reversed = reverseKeywords[rgb]; if (reversed) { return reversed; } - var currentClosestDistance = Infinity; - var currentClosestKeyword; + let currentClosestDistance = Infinity; + let currentClosestKeyword; - for (var keyword in cssKeywords) { - if (cssKeywords.hasOwnProperty(keyword)) { - var value = cssKeywords[keyword]; + for (const keyword of Object.keys(cssKeywords)) { + const value = cssKeywords[keyword]; - // Compute comparative distance - var distance = comparativeDistance(rgb, value); + // Compute comparative distance + const distance = comparativeDistance(rgb, value); - // Check if its less, if so set as closest - if (distance < currentClosestDistance) { - currentClosestDistance = distance; - currentClosestKeyword = keyword; - } + // Check if its less, if so set as closest + if (distance < currentClosestDistance) { + currentClosestDistance = distance; + currentClosestKeyword = keyword; } } @@ -211,55 +204,50 @@ convert.keyword.rgb = function (keyword) { }; convert.rgb.xyz = function (rgb) { - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; + let r = rgb[0] / 255; + let g = rgb[1] / 255; + let b = rgb[2] / 255; - // assume sRGB - r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92); - g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92); - b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92); + // Assume sRGB + r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92); + g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92); + b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92); - var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); - var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); - var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); + const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); + const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); + const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); return [x * 100, y * 100, z * 100]; }; convert.rgb.lab = function (rgb) { - var xyz = convert.rgb.xyz(rgb); - var x = xyz[0]; - var y = xyz[1]; - var z = xyz[2]; - var l; - var a; - var b; + const xyz = convert.rgb.xyz(rgb); + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; x /= 95.047; y /= 100; z /= 108.883; - x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); + x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); - l = (116 * y) - 16; - a = 500 * (x - y); - b = 200 * (y - z); + const l = (116 * y) - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); return [l, a, b]; }; convert.hsl.rgb = function (hsl) { - var h = hsl[0] / 360; - var s = hsl[1] / 100; - var l = hsl[2] / 100; - var t1; - var t2; - var t3; - var rgb; - var val; + const h = hsl[0] / 360; + const s = hsl[1] / 100; + const l = hsl[2] / 100; + let t2; + let t3; + let val; if (s === 0) { val = l * 255; @@ -272,14 +260,15 @@ convert.hsl.rgb = function (hsl) { t2 = l + s - l * s; } - t1 = 2 * l - t2; + const t1 = 2 * l - t2; - rgb = [0, 0, 0]; - for (var i = 0; i < 3; i++) { + const rgb = [0, 0, 0]; + for (let i = 0; i < 3; i++) { t3 = h + 1 / 3 * -(i - 1); if (t3 < 0) { t3++; } + if (t3 > 1) { t3--; } @@ -301,33 +290,31 @@ convert.hsl.rgb = function (hsl) { }; convert.hsl.hsv = function (hsl) { - var h = hsl[0]; - var s = hsl[1] / 100; - var l = hsl[2] / 100; - var smin = s; - var lmin = Math.max(l, 0.01); - var sv; - var v; + const h = hsl[0]; + let s = hsl[1] / 100; + let l = hsl[2] / 100; + let smin = s; + const lmin = Math.max(l, 0.01); l *= 2; s *= (l <= 1) ? l : 2 - l; smin *= lmin <= 1 ? lmin : 2 - lmin; - v = (l + s) / 2; - sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); + const v = (l + s) / 2; + const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); return [h, sv * 100, v * 100]; }; convert.hsv.rgb = function (hsv) { - var h = hsv[0] / 60; - var s = hsv[1] / 100; - var v = hsv[2] / 100; - var hi = Math.floor(h) % 6; - - var f = h - Math.floor(h); - var p = 255 * v * (1 - s); - var q = 255 * v * (1 - (s * f)); - var t = 255 * v * (1 - (s * (1 - f))); + const h = hsv[0] / 60; + const s = hsv[1] / 100; + let v = hsv[2] / 100; + const hi = Math.floor(h) % 6; + + const f = h - Math.floor(h); + const p = 255 * v * (1 - s); + const q = 255 * v * (1 - (s * f)); + const t = 255 * v * (1 - (s * (1 - f))); v *= 255; switch (hi) { @@ -347,16 +334,15 @@ convert.hsv.rgb = function (hsv) { }; convert.hsv.hsl = function (hsv) { - var h = hsv[0]; - var s = hsv[1] / 100; - var v = hsv[2] / 100; - var vmin = Math.max(v, 0.01); - var lmin; - var sl; - var l; + const h = hsv[0]; + const s = hsv[1] / 100; + const v = hsv[2] / 100; + const vmin = Math.max(v, 0.01); + let sl; + let l; l = (2 - s) * v; - lmin = (2 - s) * vmin; + const lmin = (2 - s) * vmin; sl = s * vmin; sl /= (lmin <= 1) ? lmin : 2 - lmin; sl = sl || 0; @@ -367,87 +353,83 @@ convert.hsv.hsl = function (hsv) { // http://dev.w3.org/csswg/css-color/#hwb-to-rgb convert.hwb.rgb = function (hwb) { - var h = hwb[0] / 360; - var wh = hwb[1] / 100; - var bl = hwb[2] / 100; - var ratio = wh + bl; - var i; - var v; - var f; - var n; - - // wh + bl cant be > 1 + const h = hwb[0] / 360; + let wh = hwb[1] / 100; + let bl = hwb[2] / 100; + const ratio = wh + bl; + let f; + + // Wh + bl cant be > 1 if (ratio > 1) { wh /= ratio; bl /= ratio; } - i = Math.floor(6 * h); - v = 1 - bl; + const i = Math.floor(6 * h); + const v = 1 - bl; f = 6 * h - i; if ((i & 0x01) !== 0) { f = 1 - f; } - n = wh + f * (v - wh); // linear interpolation + const n = wh + f * (v - wh); // Linear interpolation - var r; - var g; - var b; + let r; + let g; + let b; + /* eslint-disable max-statements-per-line,no-multi-spaces */ switch (i) { default: case 6: - case 0: r = v; g = n; b = wh; break; - case 1: r = n; g = v; b = wh; break; - case 2: r = wh; g = v; b = n; break; - case 3: r = wh; g = n; b = v; break; - case 4: r = n; g = wh; b = v; break; - case 5: r = v; g = wh; b = n; break; + case 0: r = v; g = n; b = wh; break; + case 1: r = n; g = v; b = wh; break; + case 2: r = wh; g = v; b = n; break; + case 3: r = wh; g = n; b = v; break; + case 4: r = n; g = wh; b = v; break; + case 5: r = v; g = wh; b = n; break; } + /* eslint-enable max-statements-per-line,no-multi-spaces */ return [r * 255, g * 255, b * 255]; }; convert.cmyk.rgb = function (cmyk) { - var c = cmyk[0] / 100; - var m = cmyk[1] / 100; - var y = cmyk[2] / 100; - var k = cmyk[3] / 100; - var r; - var g; - var b; - - r = 1 - Math.min(1, c * (1 - k) + k); - g = 1 - Math.min(1, m * (1 - k) + k); - b = 1 - Math.min(1, y * (1 - k) + k); + const c = cmyk[0] / 100; + const m = cmyk[1] / 100; + const y = cmyk[2] / 100; + const k = cmyk[3] / 100; + + const r = 1 - Math.min(1, c * (1 - k) + k); + const g = 1 - Math.min(1, m * (1 - k) + k); + const b = 1 - Math.min(1, y * (1 - k) + k); return [r * 255, g * 255, b * 255]; }; convert.xyz.rgb = function (xyz) { - var x = xyz[0] / 100; - var y = xyz[1] / 100; - var z = xyz[2] / 100; - var r; - var g; - var b; + const x = xyz[0] / 100; + const y = xyz[1] / 100; + const z = xyz[2] / 100; + let r; + let g; + let b; r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); - // assume sRGB + // Assume sRGB r = r > 0.0031308 - ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055) + ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055) : r * 12.92; g = g > 0.0031308 - ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055) + ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055) : g * 12.92; b = b > 0.0031308 - ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055) + ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055) : b * 12.92; r = Math.min(Math.max(0, r), 1); @@ -458,43 +440,40 @@ convert.xyz.rgb = function (xyz) { }; convert.xyz.lab = function (xyz) { - var x = xyz[0]; - var y = xyz[1]; - var z = xyz[2]; - var l; - var a; - var b; + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; x /= 95.047; y /= 100; z /= 108.883; - x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); + x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); - l = (116 * y) - 16; - a = 500 * (x - y); - b = 200 * (y - z); + const l = (116 * y) - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); return [l, a, b]; }; convert.lab.xyz = function (lab) { - var l = lab[0]; - var a = lab[1]; - var b = lab[2]; - var x; - var y; - var z; + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let x; + let y; + let z; y = (l + 16) / 116; x = a / 500 + y; z = y - b / 200; - var y2 = Math.pow(y, 3); - var x2 = Math.pow(x, 3); - var z2 = Math.pow(z, 3); + const y2 = y ** 3; + const x2 = x ** 3; + const z2 = z ** 3; y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; @@ -507,45 +486,38 @@ convert.lab.xyz = function (lab) { }; convert.lab.lch = function (lab) { - var l = lab[0]; - var a = lab[1]; - var b = lab[2]; - var hr; - var h; - var c; - - hr = Math.atan2(b, a); + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let h; + + const hr = Math.atan2(b, a); h = hr * 360 / 2 / Math.PI; if (h < 0) { h += 360; } - c = Math.sqrt(a * a + b * b); + const c = Math.sqrt(a * a + b * b); return [l, c, h]; }; convert.lch.lab = function (lch) { - var l = lch[0]; - var c = lch[1]; - var h = lch[2]; - var a; - var b; - var hr; + const l = lch[0]; + const c = lch[1]; + const h = lch[2]; - hr = h / 360 * 2 * Math.PI; - a = c * Math.cos(hr); - b = c * Math.sin(hr); + const hr = h / 360 * 2 * Math.PI; + const a = c * Math.cos(hr); + const b = c * Math.sin(hr); return [l, a, b]; }; -convert.rgb.ansi16 = function (args) { - var r = args[0]; - var g = args[1]; - var b = args[2]; - var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization +convert.rgb.ansi16 = function (args, saturation = null) { + const [r, g, b] = args; + let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization value = Math.round(value / 50); @@ -553,7 +525,7 @@ convert.rgb.ansi16 = function (args) { return 30; } - var ansi = 30 + let ansi = 30 + ((Math.round(b / 255) << 2) | (Math.round(g / 255) << 1) | Math.round(r / 255)); @@ -566,17 +538,17 @@ convert.rgb.ansi16 = function (args) { }; convert.hsv.ansi16 = function (args) { - // optimization here; we already know the value and don't need to get + // Optimization here; we already know the value and don't need to get // it converted for us. return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); }; convert.rgb.ansi256 = function (args) { - var r = args[0]; - var g = args[1]; - var b = args[2]; + const r = args[0]; + const g = args[1]; + const b = args[2]; - // we use the extended greyscale palette here, with the exception of + // We use the extended greyscale palette here, with the exception of // black and white. normal palette only has 4 greyscale shades. if (r === g && g === b) { if (r < 8) { @@ -590,7 +562,7 @@ convert.rgb.ansi256 = function (args) { return Math.round(((r - 8) / 247) * 24) + 232; } - var ansi = 16 + const ansi = 16 + (36 * Math.round(r / 255 * 5)) + (6 * Math.round(g / 255 * 5)) + Math.round(b / 255 * 5); @@ -599,9 +571,9 @@ convert.rgb.ansi256 = function (args) { }; convert.ansi16.rgb = function (args) { - var color = args % 10; + let color = args % 10; - // handle greyscale + // Handle greyscale if (color === 0 || color === 7) { if (args > 50) { color += 3.5; @@ -612,71 +584,71 @@ convert.ansi16.rgb = function (args) { return [color, color, color]; } - var mult = (~~(args > 50) + 1) * 0.5; - var r = ((color & 1) * mult) * 255; - var g = (((color >> 1) & 1) * mult) * 255; - var b = (((color >> 2) & 1) * mult) * 255; + const mult = (~~(args > 50) + 1) * 0.5; + const r = ((color & 1) * mult) * 255; + const g = (((color >> 1) & 1) * mult) * 255; + const b = (((color >> 2) & 1) * mult) * 255; return [r, g, b]; }; convert.ansi256.rgb = function (args) { - // handle greyscale + // Handle greyscale if (args >= 232) { - var c = (args - 232) * 10 + 8; + const c = (args - 232) * 10 + 8; return [c, c, c]; } args -= 16; - var rem; - var r = Math.floor(args / 36) / 5 * 255; - var g = Math.floor((rem = args % 36) / 6) / 5 * 255; - var b = (rem % 6) / 5 * 255; + let rem; + const r = Math.floor(args / 36) / 5 * 255; + const g = Math.floor((rem = args % 36) / 6) / 5 * 255; + const b = (rem % 6) / 5 * 255; return [r, g, b]; }; convert.rgb.hex = function (args) { - var integer = ((Math.round(args[0]) & 0xFF) << 16) + const integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF); - var string = integer.toString(16).toUpperCase(); + const string = integer.toString(16).toUpperCase(); return '000000'.substring(string.length) + string; }; convert.hex.rgb = function (args) { - var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); if (!match) { return [0, 0, 0]; } - var colorString = match[0]; + let colorString = match[0]; if (match[0].length === 3) { - colorString = colorString.split('').map(function (char) { + colorString = colorString.split('').map(char => { return char + char; }).join(''); } - var integer = parseInt(colorString, 16); - var r = (integer >> 16) & 0xFF; - var g = (integer >> 8) & 0xFF; - var b = integer & 0xFF; + const integer = parseInt(colorString, 16); + const r = (integer >> 16) & 0xFF; + const g = (integer >> 8) & 0xFF; + const b = integer & 0xFF; return [r, g, b]; }; convert.rgb.hcg = function (rgb) { - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; - var max = Math.max(Math.max(r, g), b); - var min = Math.min(Math.min(r, g), b); - var chroma = (max - min); - var grayscale; - var hue; + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const max = Math.max(Math.max(r, g), b); + const min = Math.min(Math.min(r, g), b); + const chroma = (max - min); + let grayscale; + let hue; if (chroma < 1) { grayscale = min / (1 - chroma); @@ -693,7 +665,7 @@ convert.rgb.hcg = function (rgb) { if (max === g) { hue = 2 + (b - r) / chroma; } else { - hue = 4 + (r - g) / chroma + 4; + hue = 4 + (r - g) / chroma; } hue /= 6; @@ -703,17 +675,12 @@ convert.rgb.hcg = function (rgb) { }; convert.hsl.hcg = function (hsl) { - var s = hsl[1] / 100; - var l = hsl[2] / 100; - var c = 1; - var f = 0; + const s = hsl[1] / 100; + const l = hsl[2] / 100; - if (l < 0.5) { - c = 2.0 * s * l; - } else { - c = 2.0 * s * (1.0 - l); - } + const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l)); + let f = 0; if (c < 1.0) { f = (l - 0.5 * c) / (1.0 - c); } @@ -722,11 +689,11 @@ convert.hsl.hcg = function (hsl) { }; convert.hsv.hcg = function (hsv) { - var s = hsv[1] / 100; - var v = hsv[2] / 100; + const s = hsv[1] / 100; + const v = hsv[2] / 100; - var c = s * v; - var f = 0; + const c = s * v; + let f = 0; if (c < 1.0) { f = (v - c) / (1 - c); @@ -736,20 +703,21 @@ convert.hsv.hcg = function (hsv) { }; convert.hcg.rgb = function (hcg) { - var h = hcg[0] / 360; - var c = hcg[1] / 100; - var g = hcg[2] / 100; + const h = hcg[0] / 360; + const c = hcg[1] / 100; + const g = hcg[2] / 100; if (c === 0.0) { return [g * 255, g * 255, g * 255]; } - var pure = [0, 0, 0]; - var hi = (h % 1) * 6; - var v = hi % 1; - var w = 1 - v; - var mg = 0; + const pure = [0, 0, 0]; + const hi = (h % 1) * 6; + const v = hi % 1; + const w = 1 - v; + let mg = 0; + /* eslint-disable max-statements-per-line */ switch (Math.floor(hi)) { case 0: pure[0] = 1; pure[1] = v; pure[2] = 0; break; @@ -764,6 +732,7 @@ convert.hcg.rgb = function (hcg) { default: pure[0] = 1; pure[1] = 0; pure[2] = w; } + /* eslint-enable max-statements-per-line */ mg = (1.0 - c) * g; @@ -775,11 +744,11 @@ convert.hcg.rgb = function (hcg) { }; convert.hcg.hsv = function (hcg) { - var c = hcg[1] / 100; - var g = hcg[2] / 100; + const c = hcg[1] / 100; + const g = hcg[2] / 100; - var v = c + g * (1.0 - c); - var f = 0; + const v = c + g * (1.0 - c); + let f = 0; if (v > 0.0) { f = c / v; @@ -789,11 +758,11 @@ convert.hcg.hsv = function (hcg) { }; convert.hcg.hsl = function (hcg) { - var c = hcg[1] / 100; - var g = hcg[2] / 100; + const c = hcg[1] / 100; + const g = hcg[2] / 100; - var l = g * (1.0 - c) + 0.5 * c; - var s = 0; + const l = g * (1.0 - c) + 0.5 * c; + let s = 0; if (l > 0.0 && l < 0.5) { s = c / (2 * l); @@ -806,18 +775,18 @@ convert.hcg.hsl = function (hcg) { }; convert.hcg.hwb = function (hcg) { - var c = hcg[1] / 100; - var g = hcg[2] / 100; - var v = c + g * (1.0 - c); + const c = hcg[1] / 100; + const g = hcg[2] / 100; + const v = c + g * (1.0 - c); return [hcg[0], (v - c) * 100, (1 - v) * 100]; }; convert.hwb.hcg = function (hwb) { - var w = hwb[1] / 100; - var b = hwb[2] / 100; - var v = 1 - b; - var c = v - w; - var g = 0; + const w = hwb[1] / 100; + const b = hwb[2] / 100; + const v = 1 - b; + const c = v - w; + let g = 0; if (c < 1) { g = (v - c) / (1 - c); @@ -838,10 +807,12 @@ convert.gray.rgb = function (args) { return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; }; -convert.gray.hsl = convert.gray.hsv = function (args) { +convert.gray.hsl = function (args) { return [0, 0, args[0]]; }; +convert.gray.hsv = convert.gray.hsl; + convert.gray.hwb = function (gray) { return [0, 100, gray[0]]; }; @@ -855,14 +826,14 @@ convert.gray.lab = function (gray) { }; convert.gray.hex = function (gray) { - var val = Math.round(gray[0] / 100 * 255) & 0xFF; - var integer = (val << 16) + (val << 8) + val; + const val = Math.round(gray[0] / 100 * 255) & 0xFF; + const integer = (val << 16) + (val << 8) + val; - var string = integer.toString(16).toUpperCase(); + const string = integer.toString(16).toUpperCase(); return '000000'.substring(string.length) + string; }; convert.rgb.gray = function (rgb) { - var val = (rgb[0] + rgb[1] + rgb[2]) / 3; + const val = (rgb[0] + rgb[1] + rgb[2]) / 3; return [val / 255 * 100]; }; diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/index.js b/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/index.js new file mode 100644 index 00000000000000..b648e5737be616 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/index.js @@ -0,0 +1,81 @@ +const conversions = require('./conversions'); +const route = require('./route'); + +const convert = {}; + +const models = Object.keys(conversions); + +function wrapRaw(fn) { + const wrappedFn = function (...args) { + const arg0 = args[0]; + if (arg0 === undefined || arg0 === null) { + return arg0; + } + + if (arg0.length > 1) { + args = arg0; + } + + return fn(args); + }; + + // Preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } + + return wrappedFn; +} + +function wrapRounded(fn) { + const wrappedFn = function (...args) { + const arg0 = args[0]; + + if (arg0 === undefined || arg0 === null) { + return arg0; + } + + if (arg0.length > 1) { + args = arg0; + } + + const result = fn(args); + + // We're assuming the result is an array here. + // see notice in conversions.js; don't use box types + // in conversion functions. + if (typeof result === 'object') { + for (let len = result.length, i = 0; i < len; i++) { + result[i] = Math.round(result[i]); + } + } + + return result; + }; + + // Preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } + + return wrappedFn; +} + +models.forEach(fromModel => { + convert[fromModel] = {}; + + Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); + Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); + + const routes = route(fromModel); + const routeModels = Object.keys(routes); + + routeModels.forEach(toModel => { + const fn = routes[toModel]; + + convert[fromModel][toModel] = wrapRounded(fn); + convert[fromModel][toModel].raw = wrapRaw(fn); + }); +}); + +module.exports = convert; diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/package.json b/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/package.json similarity index 53% rename from tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/package.json rename to tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/package.json index dfbc471407ff4c..427616bd0587d8 100644 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/package.json +++ b/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/package.json @@ -1,14 +1,30 @@ { - "name": "color-convert", + "author": { + "name": "Heather Arthur", + "email": "fayearthur@gmail.com" + }, + "bugs": { + "url": "https://github.com/Qix-/color-convert/issues" + }, + "bundleDependencies": false, + "dependencies": { + "color-name": "~1.1.4" + }, + "deprecated": false, "description": "Plain color conversion functions", - "version": "1.9.3", - "author": "Heather Arthur ", - "license": "MIT", - "repository": "Qix-/color-convert", - "scripts": { - "pretest": "xo", - "test": "node test/basic.js" + "devDependencies": { + "chalk": "^2.4.2", + "xo": "^0.24.0" }, + "engines": { + "node": ">=7.0.0" + }, + "files": [ + "index.js", + "conversions.js", + "route.js" + ], + "homepage": "https://github.com/Qix-/color-convert#readme", "keywords": [ "color", "colour", @@ -23,24 +39,22 @@ "ansi", "ansi16" ], - "files": [ - "index.js", - "conversions.js", - "css-keywords.js", - "route.js" - ], + "license": "MIT", + "name": "color-convert", + "repository": { + "type": "git", + "url": "git+https://github.com/Qix-/color-convert.git" + }, + "scripts": { + "pretest": "xo", + "test": "node test/basic.js" + }, + "version": "2.0.1", "xo": { "rules": { "default-case": 0, "no-inline-comments": 0, "operator-linebreak": 0 } - }, - "devDependencies": { - "chalk": "1.1.1", - "xo": "0.11.2" - }, - "dependencies": { - "color-name": "1.1.3" } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/route.js b/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/route.js similarity index 59% rename from tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/route.js rename to tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/route.js index 0a1fdea689e2a7..1a08521b5a0017 100644 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/route.js +++ b/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/route.js @@ -1,7 +1,7 @@ -var conversions = require('./conversions'); +const conversions = require('./conversions'); /* - this function routes a model to all other models. + This function routes a model to all other models. all functions that are routed have a property `.conversion` attached to the returned synthetic function. This property is an array @@ -12,11 +12,11 @@ var conversions = require('./conversions'); */ function buildGraph() { - var graph = {}; + const graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3 - var models = Object.keys(conversions); + const models = Object.keys(conversions); - for (var len = models.length, i = 0; i < len; i++) { + for (let len = models.length, i = 0; i < len; i++) { graph[models[i]] = { // http://jsperf.com/1-vs-infinity // micro-opt, but this is simple. @@ -30,18 +30,18 @@ function buildGraph() { // https://en.wikipedia.org/wiki/Breadth-first_search function deriveBFS(fromModel) { - var graph = buildGraph(); - var queue = [fromModel]; // unshift -> queue -> pop + const graph = buildGraph(); + const queue = [fromModel]; // Unshift -> queue -> pop graph[fromModel].distance = 0; while (queue.length) { - var current = queue.pop(); - var adjacents = Object.keys(conversions[current]); + const current = queue.pop(); + const adjacents = Object.keys(conversions[current]); - for (var len = adjacents.length, i = 0; i < len; i++) { - var adjacent = adjacents[i]; - var node = graph[adjacent]; + for (let len = adjacents.length, i = 0; i < len; i++) { + const adjacent = adjacents[i]; + const node = graph[adjacent]; if (node.distance === -1) { node.distance = graph[current].distance + 1; @@ -61,10 +61,10 @@ function link(from, to) { } function wrapConversion(toModel, graph) { - var path = [graph[toModel].parent, toModel]; - var fn = conversions[graph[toModel].parent][toModel]; + const path = [graph[toModel].parent, toModel]; + let fn = conversions[graph[toModel].parent][toModel]; - var cur = graph[toModel].parent; + let cur = graph[toModel].parent; while (graph[cur].parent) { path.unshift(graph[cur].parent); fn = link(conversions[graph[cur].parent][cur], fn); @@ -76,16 +76,16 @@ function wrapConversion(toModel, graph) { } module.exports = function (fromModel) { - var graph = deriveBFS(fromModel); - var conversion = {}; + const graph = deriveBFS(fromModel); + const conversion = {}; - var models = Object.keys(graph); - for (var len = models.length, i = 0; i < len; i++) { - var toModel = models[i]; - var node = graph[toModel]; + const models = Object.keys(graph); + for (let len = models.length, i = 0; i < len; i++) { + const toModel = models[i]; + const node = graph[toModel]; if (node.parent === null) { - // no possible conversion, or this node is the source model. + // No possible conversion, or this node is the source model. continue; } diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/LICENSE b/tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/LICENSE similarity index 100% rename from tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/LICENSE rename to tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/LICENSE diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/README.md b/tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/README.md similarity index 100% rename from tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/README.md rename to tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/README.md diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/index.js b/tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/index.js similarity index 100% rename from tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/index.js rename to tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/index.js diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/package.json b/tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/package.json new file mode 100644 index 00000000000000..07b8f6ece8170a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/package.json @@ -0,0 +1,33 @@ +{ + "author": { + "name": "DY", + "email": "dfcreative@gmail.com" + }, + "bugs": { + "url": "https://github.com/colorjs/color-name/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A list of color names and its values", + "files": [ + "index.js" + ], + "homepage": "https://github.com/colorjs/color-name", + "keywords": [ + "color-name", + "color", + "color-keyword", + "keyword" + ], + "license": "MIT", + "main": "index.js", + "name": "color-name", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/colorjs/color-name.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.1.4" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/index.js b/tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/index.js new file mode 100644 index 00000000000000..b6f80b1f8ffd76 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/index.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = (flag, argv = process.argv) => { + const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf('--'); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); +}; diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/license b/tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/license similarity index 100% rename from tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/license rename to tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/license diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/package.json b/tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/package.json similarity index 53% rename from tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/package.json rename to tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/package.json index e1eb17a15ed880..c71a95689f337f 100644 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/package.json +++ b/tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/package.json @@ -1,23 +1,28 @@ { - "name": "has-flag", - "version": "3.0.0", - "description": "Check if argv has a specific flag", - "license": "MIT", - "repository": "sindresorhus/has-flag", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, - "engines": { - "node": ">=4" + "bugs": { + "url": "https://github.com/sindresorhus/has-flag/issues" }, - "scripts": { - "test": "xo && ava" + "bundleDependencies": false, + "deprecated": false, + "description": "Check if argv has a specific flag", + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], + "homepage": "https://github.com/sindresorhus/has-flag#readme", "keywords": [ "has", "check", @@ -37,8 +42,14 @@ "minimist", "optimist" ], - "devDependencies": { - "ava": "*", - "xo": "*" - } -} + "license": "MIT", + "name": "has-flag", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/has-flag.git" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "version": "4.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/readme.md b/tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/readme.md similarity index 61% rename from tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/readme.md rename to tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/readme.md index 677893c278a2e3..3f72dff29a6961 100644 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/readme.md +++ b/tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/readme.md @@ -4,6 +4,20 @@ Correctly stops looking after an `--` argument terminator. +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- + ## Install @@ -65,6 +79,11 @@ Default: `process.argv` CLI arguments. +## Security + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + + ## License MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/browser.js b/tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/browser.js similarity index 100% rename from tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/browser.js rename to tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/browser.js diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/index.js b/tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/index.js similarity index 62% rename from tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/index.js rename to tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/index.js index 1704131bdf6c8f..6fada390fb88d8 100644 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/index.js +++ b/tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/index.js @@ -1,22 +1,31 @@ 'use strict'; const os = require('os'); +const tty = require('tty'); const hasFlag = require('has-flag'); -const env = process.env; +const {env} = process; let forceColor; if (hasFlag('no-color') || hasFlag('no-colors') || - hasFlag('color=false')) { - forceColor = false; + hasFlag('color=false') || + hasFlag('color=never')) { + forceColor = 0; } else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) { - forceColor = true; + forceColor = 1; } + if ('FORCE_COLOR' in env) { - forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; + if (env.FORCE_COLOR === 'true') { + forceColor = 1; + } else if (env.FORCE_COLOR === 'false') { + forceColor = 0; + } else { + forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); + } } function translateLevel(level) { @@ -32,8 +41,8 @@ function translateLevel(level) { }; } -function supportsColor(stream) { - if (forceColor === false) { +function supportsColor(haveStream, streamIsTTY) { + if (forceColor === 0) { return 0; } @@ -47,22 +56,21 @@ function supportsColor(stream) { return 2; } - if (stream && !stream.isTTY && forceColor !== true) { + if (haveStream && !streamIsTTY && forceColor === undefined) { return 0; } - const min = forceColor ? 1 : 0; + const min = forceColor || 0; + + if (env.TERM === 'dumb') { + return min; + } if (process.platform === 'win32') { - // Node.js 7.5.0 is the first version of Node.js to include a patch to - // libuv that enables 256 color output on Windows. Anything earlier and it - // won't work. However, here we target Node.js 8 at minimum as it is an LTS - // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows - // release that supports 256 colors. Windows 10 build 14931 is the first release - // that supports 16m/TrueColor. + // Windows 10 build 10586 is the first Windows release that supports 256 colors. + // Windows 10 build 14931 is the first release that supports 16m/TrueColor. const osRelease = os.release().split('.'); if ( - Number(process.versions.node.split('.')[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586 ) { @@ -73,7 +81,7 @@ function supportsColor(stream) { } if ('CI' in env) { - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { return 1; } @@ -112,20 +120,16 @@ function supportsColor(stream) { return 1; } - if (env.TERM === 'dumb') { - return min; - } - return min; } function getSupportLevel(stream) { - const level = supportsColor(stream); + const level = supportsColor(stream, stream && stream.isTTY); return translateLevel(level); } module.exports = { supportsColor: getSupportLevel, - stdout: getSupportLevel(process.stdout), - stderr: getSupportLevel(process.stderr) + stdout: translateLevel(supportsColor(true, tty.isatty(1))), + stderr: translateLevel(supportsColor(true, tty.isatty(2))) }; diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/license b/tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/license similarity index 100% rename from tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/license rename to tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/license diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/package.json b/tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/package.json new file mode 100644 index 00000000000000..5f90dfc93a7936 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/package.json @@ -0,0 +1,62 @@ +{ + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "browser": "browser.js", + "bugs": { + "url": "https://github.com/chalk/supports-color/issues" + }, + "bundleDependencies": false, + "dependencies": { + "has-flag": "^4.0.0" + }, + "deprecated": false, + "description": "Detect whether a terminal supports color", + "devDependencies": { + "ava": "^1.4.1", + "import-fresh": "^3.0.0", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "browser.js" + ], + "homepage": "https://github.com/chalk/supports-color#readme", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect", + "truecolor", + "16m" + ], + "license": "MIT", + "name": "supports-color", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/supports-color.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "7.2.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/readme.md b/tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/readme.md similarity index 67% rename from tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/readme.md rename to tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/readme.md index f6e40195730ae8..36542285863330 100644 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/readme.md +++ b/tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/readme.md @@ -44,7 +44,7 @@ The `stdout`/`stderr` objects specifies a level of support for color through a ` It obeys the `--color` and `--no-color` CLI flags. -Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. +For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. @@ -61,6 +61,16 @@ Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color= - [Josh Junon](https://github.com/qix-) -## License +--- -MIT +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- diff --git a/tools/node_modules/eslint/node_modules/chalk/package.json b/tools/node_modules/eslint/node_modules/chalk/package.json index 0d99f0f28621f2..fbb12850511d0e 100644 --- a/tools/node_modules/eslint/node_modules/chalk/package.json +++ b/tools/node_modules/eslint/node_modules/chalk/package.json @@ -1,68 +1,77 @@ { - "name": "chalk", - "version": "4.1.0", - "description": "Terminal string styling done right", - "license": "MIT", - "repository": "chalk/chalk", - "funding": "https://github.com/chalk/chalk?sponsor=1", - "main": "source", - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && nyc ava && tsd", - "bench": "matcha benchmark.js" - }, - "files": [ - "source", - "index.d.ts" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "str", - "ansi", - "style", - "styles", - "tty", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "devDependencies": { - "ava": "^2.4.0", - "coveralls": "^3.0.7", - "execa": "^4.0.0", - "import-fresh": "^3.1.0", - "matcha": "^0.7.0", - "nyc": "^15.0.0", - "resolve-from": "^5.0.0", - "tsd": "^0.7.4", - "xo": "^0.28.2" - }, - "xo": { - "rules": { - "unicorn/prefer-string-slice": "off", - "unicorn/prefer-includes": "off", - "@typescript-eslint/member-ordering": "off", - "no-redeclare": "off", - "unicorn/string-content": "off", - "unicorn/better-regex": "off" - } - } -} + "bugs": { + "url": "https://github.com/chalk/chalk/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "deprecated": false, + "description": "Terminal string styling done right", + "devDependencies": { + "ava": "^2.4.0", + "coveralls": "^3.0.7", + "execa": "^4.0.0", + "import-fresh": "^3.1.0", + "matcha": "^0.7.0", + "nyc": "^15.0.0", + "resolve-from": "^5.0.0", + "tsd": "^0.7.4", + "xo": "^0.28.2" + }, + "engines": { + "node": ">=10" + }, + "files": [ + "source", + "index.d.ts" + ], + "funding": "https://github.com/chalk/chalk?sponsor=1", + "homepage": "https://github.com/chalk/chalk#readme", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "main": "source", + "name": "chalk", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/chalk.git" + }, + "scripts": { + "bench": "matcha benchmark.js", + "test": "xo && nyc ava && tsd" + }, + "version": "4.1.0", + "xo": { + "rules": { + "unicorn/prefer-string-slice": "off", + "unicorn/prefer-includes": "off", + "@typescript-eslint/member-ordering": "off", + "no-redeclare": "off", + "unicorn/string-content": "off", + "unicorn/better-regex": "off" + } + } +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/color-convert/conversions.js b/tools/node_modules/eslint/node_modules/color-convert/conversions.js index 2657f265c9e102..32172007ec0b17 100644 --- a/tools/node_modules/eslint/node_modules/color-convert/conversions.js +++ b/tools/node_modules/eslint/node_modules/color-convert/conversions.js @@ -1,17 +1,18 @@ /* MIT license */ -/* eslint-disable no-mixed-operators */ -const cssKeywords = require('color-name'); +var cssKeywords = require('color-name'); // NOTE: conversions should only return primitive values (i.e. arrays, or // values that give correct `typeof` results). // do not use box values types (i.e. Number(), String(), etc.) -const reverseKeywords = {}; -for (const key of Object.keys(cssKeywords)) { - reverseKeywords[cssKeywords[key]] = key; +var reverseKeywords = {}; +for (var key in cssKeywords) { + if (cssKeywords.hasOwnProperty(key)) { + reverseKeywords[cssKeywords[key]] = key; + } } -const convert = { +var convert = module.exports = { rgb: {channels: 3, labels: 'rgb'}, hsl: {channels: 3, labels: 'hsl'}, hsv: {channels: 3, labels: 'hsv'}, @@ -29,38 +30,40 @@ const convert = { gray: {channels: 1, labels: ['gray']} }; -module.exports = convert; +// hide .channels and .labels properties +for (var model in convert) { + if (convert.hasOwnProperty(model)) { + if (!('channels' in convert[model])) { + throw new Error('missing channels property: ' + model); + } -// Hide .channels and .labels properties -for (const model of Object.keys(convert)) { - if (!('channels' in convert[model])) { - throw new Error('missing channels property: ' + model); - } + if (!('labels' in convert[model])) { + throw new Error('missing channel labels property: ' + model); + } - if (!('labels' in convert[model])) { - throw new Error('missing channel labels property: ' + model); - } + if (convert[model].labels.length !== convert[model].channels) { + throw new Error('channel and label counts mismatch: ' + model); + } - if (convert[model].labels.length !== convert[model].channels) { - throw new Error('channel and label counts mismatch: ' + model); + var channels = convert[model].channels; + var labels = convert[model].labels; + delete convert[model].channels; + delete convert[model].labels; + Object.defineProperty(convert[model], 'channels', {value: channels}); + Object.defineProperty(convert[model], 'labels', {value: labels}); } - - const {channels, labels} = convert[model]; - delete convert[model].channels; - delete convert[model].labels; - Object.defineProperty(convert[model], 'channels', {value: channels}); - Object.defineProperty(convert[model], 'labels', {value: labels}); } convert.rgb.hsl = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const min = Math.min(r, g, b); - const max = Math.max(r, g, b); - const delta = max - min; - let h; - let s; + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var min = Math.min(r, g, b); + var max = Math.max(r, g, b); + var delta = max - min; + var h; + var s; + var l; if (max === min) { h = 0; @@ -78,7 +81,7 @@ convert.rgb.hsl = function (rgb) { h += 360; } - const l = (min + max) / 2; + l = (min + max) / 2; if (max === min) { s = 0; @@ -92,24 +95,23 @@ convert.rgb.hsl = function (rgb) { }; convert.rgb.hsv = function (rgb) { - let rdif; - let gdif; - let bdif; - let h; - let s; - - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const v = Math.max(r, g, b); - const diff = v - Math.min(r, g, b); - const diffc = function (c) { + var rdif; + var gdif; + var bdif; + var h; + var s; + + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var v = Math.max(r, g, b); + var diff = v - Math.min(r, g, b); + var diffc = function (c) { return (v - c) / 6 / diff + 1 / 2; }; if (diff === 0) { - h = 0; - s = 0; + h = s = 0; } else { s = diff / v; rdif = diffc(r); @@ -123,7 +125,6 @@ convert.rgb.hsv = function (rgb) { } else if (b === v) { h = (2 / 3) + gdif - rdif; } - if (h < 0) { h += 1; } else if (h > 1) { @@ -139,11 +140,11 @@ convert.rgb.hsv = function (rgb) { }; convert.rgb.hwb = function (rgb) { - const r = rgb[0]; - const g = rgb[1]; - let b = rgb[2]; - const h = convert.rgb.hsl(rgb)[0]; - const w = 1 / 255 * Math.min(r, Math.min(g, b)); + var r = rgb[0]; + var g = rgb[1]; + var b = rgb[2]; + var h = convert.rgb.hsl(rgb)[0]; + var w = 1 / 255 * Math.min(r, Math.min(g, b)); b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); @@ -151,48 +152,54 @@ convert.rgb.hwb = function (rgb) { }; convert.rgb.cmyk = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - - const k = Math.min(1 - r, 1 - g, 1 - b); - const c = (1 - r - k) / (1 - k) || 0; - const m = (1 - g - k) / (1 - k) || 0; - const y = (1 - b - k) / (1 - k) || 0; + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var c; + var m; + var y; + var k; + + k = Math.min(1 - r, 1 - g, 1 - b); + c = (1 - r - k) / (1 - k) || 0; + m = (1 - g - k) / (1 - k) || 0; + y = (1 - b - k) / (1 - k) || 0; return [c * 100, m * 100, y * 100, k * 100]; }; +/** + * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance + * */ function comparativeDistance(x, y) { - /* - See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance - */ return ( - ((x[0] - y[0]) ** 2) + - ((x[1] - y[1]) ** 2) + - ((x[2] - y[2]) ** 2) + Math.pow(x[0] - y[0], 2) + + Math.pow(x[1] - y[1], 2) + + Math.pow(x[2] - y[2], 2) ); } convert.rgb.keyword = function (rgb) { - const reversed = reverseKeywords[rgb]; + var reversed = reverseKeywords[rgb]; if (reversed) { return reversed; } - let currentClosestDistance = Infinity; - let currentClosestKeyword; + var currentClosestDistance = Infinity; + var currentClosestKeyword; - for (const keyword of Object.keys(cssKeywords)) { - const value = cssKeywords[keyword]; + for (var keyword in cssKeywords) { + if (cssKeywords.hasOwnProperty(keyword)) { + var value = cssKeywords[keyword]; - // Compute comparative distance - const distance = comparativeDistance(rgb, value); + // Compute comparative distance + var distance = comparativeDistance(rgb, value); - // Check if its less, if so set as closest - if (distance < currentClosestDistance) { - currentClosestDistance = distance; - currentClosestKeyword = keyword; + // Check if its less, if so set as closest + if (distance < currentClosestDistance) { + currentClosestDistance = distance; + currentClosestKeyword = keyword; + } } } @@ -204,50 +211,55 @@ convert.keyword.rgb = function (keyword) { }; convert.rgb.xyz = function (rgb) { - let r = rgb[0] / 255; - let g = rgb[1] / 255; - let b = rgb[2] / 255; + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; - // Assume sRGB - r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92); - g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92); - b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92); + // assume sRGB + r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92); + g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92); + b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92); - const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); - const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); - const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); + var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); + var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); + var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); return [x * 100, y * 100, z * 100]; }; convert.rgb.lab = function (rgb) { - const xyz = convert.rgb.xyz(rgb); - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; + var xyz = convert.rgb.xyz(rgb); + var x = xyz[0]; + var y = xyz[1]; + var z = xyz[2]; + var l; + var a; + var b; x /= 95.047; y /= 100; z /= 108.883; - x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); + x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); - const l = (116 * y) - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); + l = (116 * y) - 16; + a = 500 * (x - y); + b = 200 * (y - z); return [l, a, b]; }; convert.hsl.rgb = function (hsl) { - const h = hsl[0] / 360; - const s = hsl[1] / 100; - const l = hsl[2] / 100; - let t2; - let t3; - let val; + var h = hsl[0] / 360; + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var t1; + var t2; + var t3; + var rgb; + var val; if (s === 0) { val = l * 255; @@ -260,15 +272,14 @@ convert.hsl.rgb = function (hsl) { t2 = l + s - l * s; } - const t1 = 2 * l - t2; + t1 = 2 * l - t2; - const rgb = [0, 0, 0]; - for (let i = 0; i < 3; i++) { + rgb = [0, 0, 0]; + for (var i = 0; i < 3; i++) { t3 = h + 1 / 3 * -(i - 1); if (t3 < 0) { t3++; } - if (t3 > 1) { t3--; } @@ -290,31 +301,33 @@ convert.hsl.rgb = function (hsl) { }; convert.hsl.hsv = function (hsl) { - const h = hsl[0]; - let s = hsl[1] / 100; - let l = hsl[2] / 100; - let smin = s; - const lmin = Math.max(l, 0.01); + var h = hsl[0]; + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var smin = s; + var lmin = Math.max(l, 0.01); + var sv; + var v; l *= 2; s *= (l <= 1) ? l : 2 - l; smin *= lmin <= 1 ? lmin : 2 - lmin; - const v = (l + s) / 2; - const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); + v = (l + s) / 2; + sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); return [h, sv * 100, v * 100]; }; convert.hsv.rgb = function (hsv) { - const h = hsv[0] / 60; - const s = hsv[1] / 100; - let v = hsv[2] / 100; - const hi = Math.floor(h) % 6; - - const f = h - Math.floor(h); - const p = 255 * v * (1 - s); - const q = 255 * v * (1 - (s * f)); - const t = 255 * v * (1 - (s * (1 - f))); + var h = hsv[0] / 60; + var s = hsv[1] / 100; + var v = hsv[2] / 100; + var hi = Math.floor(h) % 6; + + var f = h - Math.floor(h); + var p = 255 * v * (1 - s); + var q = 255 * v * (1 - (s * f)); + var t = 255 * v * (1 - (s * (1 - f))); v *= 255; switch (hi) { @@ -334,15 +347,16 @@ convert.hsv.rgb = function (hsv) { }; convert.hsv.hsl = function (hsv) { - const h = hsv[0]; - const s = hsv[1] / 100; - const v = hsv[2] / 100; - const vmin = Math.max(v, 0.01); - let sl; - let l; + var h = hsv[0]; + var s = hsv[1] / 100; + var v = hsv[2] / 100; + var vmin = Math.max(v, 0.01); + var lmin; + var sl; + var l; l = (2 - s) * v; - const lmin = (2 - s) * vmin; + lmin = (2 - s) * vmin; sl = s * vmin; sl /= (lmin <= 1) ? lmin : 2 - lmin; sl = sl || 0; @@ -353,83 +367,87 @@ convert.hsv.hsl = function (hsv) { // http://dev.w3.org/csswg/css-color/#hwb-to-rgb convert.hwb.rgb = function (hwb) { - const h = hwb[0] / 360; - let wh = hwb[1] / 100; - let bl = hwb[2] / 100; - const ratio = wh + bl; - let f; - - // Wh + bl cant be > 1 + var h = hwb[0] / 360; + var wh = hwb[1] / 100; + var bl = hwb[2] / 100; + var ratio = wh + bl; + var i; + var v; + var f; + var n; + + // wh + bl cant be > 1 if (ratio > 1) { wh /= ratio; bl /= ratio; } - const i = Math.floor(6 * h); - const v = 1 - bl; + i = Math.floor(6 * h); + v = 1 - bl; f = 6 * h - i; if ((i & 0x01) !== 0) { f = 1 - f; } - const n = wh + f * (v - wh); // Linear interpolation + n = wh + f * (v - wh); // linear interpolation - let r; - let g; - let b; - /* eslint-disable max-statements-per-line,no-multi-spaces */ + var r; + var g; + var b; switch (i) { default: case 6: - case 0: r = v; g = n; b = wh; break; - case 1: r = n; g = v; b = wh; break; - case 2: r = wh; g = v; b = n; break; - case 3: r = wh; g = n; b = v; break; - case 4: r = n; g = wh; b = v; break; - case 5: r = v; g = wh; b = n; break; + case 0: r = v; g = n; b = wh; break; + case 1: r = n; g = v; b = wh; break; + case 2: r = wh; g = v; b = n; break; + case 3: r = wh; g = n; b = v; break; + case 4: r = n; g = wh; b = v; break; + case 5: r = v; g = wh; b = n; break; } - /* eslint-enable max-statements-per-line,no-multi-spaces */ return [r * 255, g * 255, b * 255]; }; convert.cmyk.rgb = function (cmyk) { - const c = cmyk[0] / 100; - const m = cmyk[1] / 100; - const y = cmyk[2] / 100; - const k = cmyk[3] / 100; - - const r = 1 - Math.min(1, c * (1 - k) + k); - const g = 1 - Math.min(1, m * (1 - k) + k); - const b = 1 - Math.min(1, y * (1 - k) + k); + var c = cmyk[0] / 100; + var m = cmyk[1] / 100; + var y = cmyk[2] / 100; + var k = cmyk[3] / 100; + var r; + var g; + var b; + + r = 1 - Math.min(1, c * (1 - k) + k); + g = 1 - Math.min(1, m * (1 - k) + k); + b = 1 - Math.min(1, y * (1 - k) + k); return [r * 255, g * 255, b * 255]; }; convert.xyz.rgb = function (xyz) { - const x = xyz[0] / 100; - const y = xyz[1] / 100; - const z = xyz[2] / 100; - let r; - let g; - let b; + var x = xyz[0] / 100; + var y = xyz[1] / 100; + var z = xyz[2] / 100; + var r; + var g; + var b; r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); - // Assume sRGB + // assume sRGB r = r > 0.0031308 - ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055) + ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055) : r * 12.92; g = g > 0.0031308 - ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055) + ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055) : g * 12.92; b = b > 0.0031308 - ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055) + ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055) : b * 12.92; r = Math.min(Math.max(0, r), 1); @@ -440,40 +458,43 @@ convert.xyz.rgb = function (xyz) { }; convert.xyz.lab = function (xyz) { - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; + var x = xyz[0]; + var y = xyz[1]; + var z = xyz[2]; + var l; + var a; + var b; x /= 95.047; y /= 100; z /= 108.883; - x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); + x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); - const l = (116 * y) - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); + l = (116 * y) - 16; + a = 500 * (x - y); + b = 200 * (y - z); return [l, a, b]; }; convert.lab.xyz = function (lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let x; - let y; - let z; + var l = lab[0]; + var a = lab[1]; + var b = lab[2]; + var x; + var y; + var z; y = (l + 16) / 116; x = a / 500 + y; z = y - b / 200; - const y2 = y ** 3; - const x2 = x ** 3; - const z2 = z ** 3; + var y2 = Math.pow(y, 3); + var x2 = Math.pow(x, 3); + var z2 = Math.pow(z, 3); y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; @@ -486,38 +507,45 @@ convert.lab.xyz = function (lab) { }; convert.lab.lch = function (lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let h; - - const hr = Math.atan2(b, a); + var l = lab[0]; + var a = lab[1]; + var b = lab[2]; + var hr; + var h; + var c; + + hr = Math.atan2(b, a); h = hr * 360 / 2 / Math.PI; if (h < 0) { h += 360; } - const c = Math.sqrt(a * a + b * b); + c = Math.sqrt(a * a + b * b); return [l, c, h]; }; convert.lch.lab = function (lch) { - const l = lch[0]; - const c = lch[1]; - const h = lch[2]; + var l = lch[0]; + var c = lch[1]; + var h = lch[2]; + var a; + var b; + var hr; - const hr = h / 360 * 2 * Math.PI; - const a = c * Math.cos(hr); - const b = c * Math.sin(hr); + hr = h / 360 * 2 * Math.PI; + a = c * Math.cos(hr); + b = c * Math.sin(hr); return [l, a, b]; }; -convert.rgb.ansi16 = function (args, saturation = null) { - const [r, g, b] = args; - let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization +convert.rgb.ansi16 = function (args) { + var r = args[0]; + var g = args[1]; + var b = args[2]; + var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization value = Math.round(value / 50); @@ -525,7 +553,7 @@ convert.rgb.ansi16 = function (args, saturation = null) { return 30; } - let ansi = 30 + var ansi = 30 + ((Math.round(b / 255) << 2) | (Math.round(g / 255) << 1) | Math.round(r / 255)); @@ -538,17 +566,17 @@ convert.rgb.ansi16 = function (args, saturation = null) { }; convert.hsv.ansi16 = function (args) { - // Optimization here; we already know the value and don't need to get + // optimization here; we already know the value and don't need to get // it converted for us. return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); }; convert.rgb.ansi256 = function (args) { - const r = args[0]; - const g = args[1]; - const b = args[2]; + var r = args[0]; + var g = args[1]; + var b = args[2]; - // We use the extended greyscale palette here, with the exception of + // we use the extended greyscale palette here, with the exception of // black and white. normal palette only has 4 greyscale shades. if (r === g && g === b) { if (r < 8) { @@ -562,7 +590,7 @@ convert.rgb.ansi256 = function (args) { return Math.round(((r - 8) / 247) * 24) + 232; } - const ansi = 16 + var ansi = 16 + (36 * Math.round(r / 255 * 5)) + (6 * Math.round(g / 255 * 5)) + Math.round(b / 255 * 5); @@ -571,9 +599,9 @@ convert.rgb.ansi256 = function (args) { }; convert.ansi16.rgb = function (args) { - let color = args % 10; + var color = args % 10; - // Handle greyscale + // handle greyscale if (color === 0 || color === 7) { if (args > 50) { color += 3.5; @@ -584,71 +612,71 @@ convert.ansi16.rgb = function (args) { return [color, color, color]; } - const mult = (~~(args > 50) + 1) * 0.5; - const r = ((color & 1) * mult) * 255; - const g = (((color >> 1) & 1) * mult) * 255; - const b = (((color >> 2) & 1) * mult) * 255; + var mult = (~~(args > 50) + 1) * 0.5; + var r = ((color & 1) * mult) * 255; + var g = (((color >> 1) & 1) * mult) * 255; + var b = (((color >> 2) & 1) * mult) * 255; return [r, g, b]; }; convert.ansi256.rgb = function (args) { - // Handle greyscale + // handle greyscale if (args >= 232) { - const c = (args - 232) * 10 + 8; + var c = (args - 232) * 10 + 8; return [c, c, c]; } args -= 16; - let rem; - const r = Math.floor(args / 36) / 5 * 255; - const g = Math.floor((rem = args % 36) / 6) / 5 * 255; - const b = (rem % 6) / 5 * 255; + var rem; + var r = Math.floor(args / 36) / 5 * 255; + var g = Math.floor((rem = args % 36) / 6) / 5 * 255; + var b = (rem % 6) / 5 * 255; return [r, g, b]; }; convert.rgb.hex = function (args) { - const integer = ((Math.round(args[0]) & 0xFF) << 16) + var integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF); - const string = integer.toString(16).toUpperCase(); + var string = integer.toString(16).toUpperCase(); return '000000'.substring(string.length) + string; }; convert.hex.rgb = function (args) { - const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); if (!match) { return [0, 0, 0]; } - let colorString = match[0]; + var colorString = match[0]; if (match[0].length === 3) { - colorString = colorString.split('').map(char => { + colorString = colorString.split('').map(function (char) { return char + char; }).join(''); } - const integer = parseInt(colorString, 16); - const r = (integer >> 16) & 0xFF; - const g = (integer >> 8) & 0xFF; - const b = integer & 0xFF; + var integer = parseInt(colorString, 16); + var r = (integer >> 16) & 0xFF; + var g = (integer >> 8) & 0xFF; + var b = integer & 0xFF; return [r, g, b]; }; convert.rgb.hcg = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const max = Math.max(Math.max(r, g), b); - const min = Math.min(Math.min(r, g), b); - const chroma = (max - min); - let grayscale; - let hue; + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var max = Math.max(Math.max(r, g), b); + var min = Math.min(Math.min(r, g), b); + var chroma = (max - min); + var grayscale; + var hue; if (chroma < 1) { grayscale = min / (1 - chroma); @@ -665,7 +693,7 @@ convert.rgb.hcg = function (rgb) { if (max === g) { hue = 2 + (b - r) / chroma; } else { - hue = 4 + (r - g) / chroma; + hue = 4 + (r - g) / chroma + 4; } hue /= 6; @@ -675,12 +703,17 @@ convert.rgb.hcg = function (rgb) { }; convert.hsl.hcg = function (hsl) { - const s = hsl[1] / 100; - const l = hsl[2] / 100; + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var c = 1; + var f = 0; - const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l)); + if (l < 0.5) { + c = 2.0 * s * l; + } else { + c = 2.0 * s * (1.0 - l); + } - let f = 0; if (c < 1.0) { f = (l - 0.5 * c) / (1.0 - c); } @@ -689,11 +722,11 @@ convert.hsl.hcg = function (hsl) { }; convert.hsv.hcg = function (hsv) { - const s = hsv[1] / 100; - const v = hsv[2] / 100; + var s = hsv[1] / 100; + var v = hsv[2] / 100; - const c = s * v; - let f = 0; + var c = s * v; + var f = 0; if (c < 1.0) { f = (v - c) / (1 - c); @@ -703,21 +736,20 @@ convert.hsv.hcg = function (hsv) { }; convert.hcg.rgb = function (hcg) { - const h = hcg[0] / 360; - const c = hcg[1] / 100; - const g = hcg[2] / 100; + var h = hcg[0] / 360; + var c = hcg[1] / 100; + var g = hcg[2] / 100; if (c === 0.0) { return [g * 255, g * 255, g * 255]; } - const pure = [0, 0, 0]; - const hi = (h % 1) * 6; - const v = hi % 1; - const w = 1 - v; - let mg = 0; + var pure = [0, 0, 0]; + var hi = (h % 1) * 6; + var v = hi % 1; + var w = 1 - v; + var mg = 0; - /* eslint-disable max-statements-per-line */ switch (Math.floor(hi)) { case 0: pure[0] = 1; pure[1] = v; pure[2] = 0; break; @@ -732,7 +764,6 @@ convert.hcg.rgb = function (hcg) { default: pure[0] = 1; pure[1] = 0; pure[2] = w; } - /* eslint-enable max-statements-per-line */ mg = (1.0 - c) * g; @@ -744,11 +775,11 @@ convert.hcg.rgb = function (hcg) { }; convert.hcg.hsv = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; + var c = hcg[1] / 100; + var g = hcg[2] / 100; - const v = c + g * (1.0 - c); - let f = 0; + var v = c + g * (1.0 - c); + var f = 0; if (v > 0.0) { f = c / v; @@ -758,11 +789,11 @@ convert.hcg.hsv = function (hcg) { }; convert.hcg.hsl = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; + var c = hcg[1] / 100; + var g = hcg[2] / 100; - const l = g * (1.0 - c) + 0.5 * c; - let s = 0; + var l = g * (1.0 - c) + 0.5 * c; + var s = 0; if (l > 0.0 && l < 0.5) { s = c / (2 * l); @@ -775,18 +806,18 @@ convert.hcg.hsl = function (hcg) { }; convert.hcg.hwb = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const v = c + g * (1.0 - c); + var c = hcg[1] / 100; + var g = hcg[2] / 100; + var v = c + g * (1.0 - c); return [hcg[0], (v - c) * 100, (1 - v) * 100]; }; convert.hwb.hcg = function (hwb) { - const w = hwb[1] / 100; - const b = hwb[2] / 100; - const v = 1 - b; - const c = v - w; - let g = 0; + var w = hwb[1] / 100; + var b = hwb[2] / 100; + var v = 1 - b; + var c = v - w; + var g = 0; if (c < 1) { g = (v - c) / (1 - c); @@ -807,12 +838,10 @@ convert.gray.rgb = function (args) { return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; }; -convert.gray.hsl = function (args) { +convert.gray.hsl = convert.gray.hsv = function (args) { return [0, 0, args[0]]; }; -convert.gray.hsv = convert.gray.hsl; - convert.gray.hwb = function (gray) { return [0, 100, gray[0]]; }; @@ -826,14 +855,14 @@ convert.gray.lab = function (gray) { }; convert.gray.hex = function (gray) { - const val = Math.round(gray[0] / 100 * 255) & 0xFF; - const integer = (val << 16) + (val << 8) + val; + var val = Math.round(gray[0] / 100 * 255) & 0xFF; + var integer = (val << 16) + (val << 8) + val; - const string = integer.toString(16).toUpperCase(); + var string = integer.toString(16).toUpperCase(); return '000000'.substring(string.length) + string; }; convert.rgb.gray = function (rgb) { - const val = (rgb[0] + rgb[1] + rgb[2]) / 3; + var val = (rgb[0] + rgb[1] + rgb[2]) / 3; return [val / 255 * 100]; }; diff --git a/tools/node_modules/eslint/node_modules/color-convert/index.js b/tools/node_modules/eslint/node_modules/color-convert/index.js index b648e5737be616..e65b5d775da353 100644 --- a/tools/node_modules/eslint/node_modules/color-convert/index.js +++ b/tools/node_modules/eslint/node_modules/color-convert/index.js @@ -1,25 +1,24 @@ -const conversions = require('./conversions'); -const route = require('./route'); +var conversions = require('./conversions'); +var route = require('./route'); -const convert = {}; +var convert = {}; -const models = Object.keys(conversions); +var models = Object.keys(conversions); function wrapRaw(fn) { - const wrappedFn = function (...args) { - const arg0 = args[0]; - if (arg0 === undefined || arg0 === null) { - return arg0; + var wrappedFn = function (args) { + if (args === undefined || args === null) { + return args; } - if (arg0.length > 1) { - args = arg0; + if (arguments.length > 1) { + args = Array.prototype.slice.call(arguments); } return fn(args); }; - // Preserve .conversion property if there is one + // preserve .conversion property if there is one if ('conversion' in fn) { wrappedFn.conversion = fn.conversion; } @@ -28,24 +27,22 @@ function wrapRaw(fn) { } function wrapRounded(fn) { - const wrappedFn = function (...args) { - const arg0 = args[0]; - - if (arg0 === undefined || arg0 === null) { - return arg0; + var wrappedFn = function (args) { + if (args === undefined || args === null) { + return args; } - if (arg0.length > 1) { - args = arg0; + if (arguments.length > 1) { + args = Array.prototype.slice.call(arguments); } - const result = fn(args); + var result = fn(args); - // We're assuming the result is an array here. + // we're assuming the result is an array here. // see notice in conversions.js; don't use box types // in conversion functions. if (typeof result === 'object') { - for (let len = result.length, i = 0; i < len; i++) { + for (var len = result.length, i = 0; i < len; i++) { result[i] = Math.round(result[i]); } } @@ -53,7 +50,7 @@ function wrapRounded(fn) { return result; }; - // Preserve .conversion property if there is one + // preserve .conversion property if there is one if ('conversion' in fn) { wrappedFn.conversion = fn.conversion; } @@ -61,17 +58,17 @@ function wrapRounded(fn) { return wrappedFn; } -models.forEach(fromModel => { +models.forEach(function (fromModel) { convert[fromModel] = {}; Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); - const routes = route(fromModel); - const routeModels = Object.keys(routes); + var routes = route(fromModel); + var routeModels = Object.keys(routes); - routeModels.forEach(toModel => { - const fn = routes[toModel]; + routeModels.forEach(function (toModel) { + var fn = routes[toModel]; convert[fromModel][toModel] = wrapRounded(fn); convert[fromModel][toModel].raw = wrapRaw(fn); diff --git a/tools/node_modules/eslint/node_modules/color-convert/package.json b/tools/node_modules/eslint/node_modules/color-convert/package.json index 6e48000c7c98fd..991f69308c29f4 100644 --- a/tools/node_modules/eslint/node_modules/color-convert/package.json +++ b/tools/node_modules/eslint/node_modules/color-convert/package.json @@ -1,17 +1,28 @@ { - "name": "color-convert", - "description": "Plain color conversion functions", - "version": "2.0.1", - "author": "Heather Arthur ", - "license": "MIT", - "repository": "Qix-/color-convert", - "scripts": { - "pretest": "xo", - "test": "node test/basic.js" + "author": { + "name": "Heather Arthur", + "email": "fayearthur@gmail.com" + }, + "bugs": { + "url": "https://github.com/Qix-/color-convert/issues" + }, + "bundleDependencies": false, + "dependencies": { + "color-name": "1.1.3" }, - "engines": { - "node": ">=7.0.0" + "deprecated": false, + "description": "Plain color conversion functions", + "devDependencies": { + "chalk": "1.1.1", + "xo": "0.11.2" }, + "files": [ + "index.js", + "conversions.js", + "css-keywords.js", + "route.js" + ], + "homepage": "https://github.com/Qix-/color-convert#readme", "keywords": [ "color", "colour", @@ -26,23 +37,22 @@ "ansi", "ansi16" ], - "files": [ - "index.js", - "conversions.js", - "route.js" - ], + "license": "MIT", + "name": "color-convert", + "repository": { + "type": "git", + "url": "git+https://github.com/Qix-/color-convert.git" + }, + "scripts": { + "pretest": "xo", + "test": "node test/basic.js" + }, + "version": "1.9.3", "xo": { "rules": { "default-case": 0, "no-inline-comments": 0, "operator-linebreak": 0 } - }, - "devDependencies": { - "chalk": "^2.4.2", - "xo": "^0.24.0" - }, - "dependencies": { - "color-name": "~1.1.4" } -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/color-convert/route.js b/tools/node_modules/eslint/node_modules/color-convert/route.js index 1a08521b5a0017..0a1fdea689e2a7 100644 --- a/tools/node_modules/eslint/node_modules/color-convert/route.js +++ b/tools/node_modules/eslint/node_modules/color-convert/route.js @@ -1,7 +1,7 @@ -const conversions = require('./conversions'); +var conversions = require('./conversions'); /* - This function routes a model to all other models. + this function routes a model to all other models. all functions that are routed have a property `.conversion` attached to the returned synthetic function. This property is an array @@ -12,11 +12,11 @@ const conversions = require('./conversions'); */ function buildGraph() { - const graph = {}; + var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3 - const models = Object.keys(conversions); + var models = Object.keys(conversions); - for (let len = models.length, i = 0; i < len; i++) { + for (var len = models.length, i = 0; i < len; i++) { graph[models[i]] = { // http://jsperf.com/1-vs-infinity // micro-opt, but this is simple. @@ -30,18 +30,18 @@ function buildGraph() { // https://en.wikipedia.org/wiki/Breadth-first_search function deriveBFS(fromModel) { - const graph = buildGraph(); - const queue = [fromModel]; // Unshift -> queue -> pop + var graph = buildGraph(); + var queue = [fromModel]; // unshift -> queue -> pop graph[fromModel].distance = 0; while (queue.length) { - const current = queue.pop(); - const adjacents = Object.keys(conversions[current]); + var current = queue.pop(); + var adjacents = Object.keys(conversions[current]); - for (let len = adjacents.length, i = 0; i < len; i++) { - const adjacent = adjacents[i]; - const node = graph[adjacent]; + for (var len = adjacents.length, i = 0; i < len; i++) { + var adjacent = adjacents[i]; + var node = graph[adjacent]; if (node.distance === -1) { node.distance = graph[current].distance + 1; @@ -61,10 +61,10 @@ function link(from, to) { } function wrapConversion(toModel, graph) { - const path = [graph[toModel].parent, toModel]; - let fn = conversions[graph[toModel].parent][toModel]; + var path = [graph[toModel].parent, toModel]; + var fn = conversions[graph[toModel].parent][toModel]; - let cur = graph[toModel].parent; + var cur = graph[toModel].parent; while (graph[cur].parent) { path.unshift(graph[cur].parent); fn = link(conversions[graph[cur].parent][cur], fn); @@ -76,16 +76,16 @@ function wrapConversion(toModel, graph) { } module.exports = function (fromModel) { - const graph = deriveBFS(fromModel); - const conversion = {}; + var graph = deriveBFS(fromModel); + var conversion = {}; - const models = Object.keys(graph); - for (let len = models.length, i = 0; i < len; i++) { - const toModel = models[i]; - const node = graph[toModel]; + var models = Object.keys(graph); + for (var len = models.length, i = 0; i < len; i++) { + var toModel = models[i]; + var node = graph[toModel]; if (node.parent === null) { - // No possible conversion, or this node is the source model. + // no possible conversion, or this node is the source model. continue; } diff --git a/tools/node_modules/eslint/node_modules/color-name/package.json b/tools/node_modules/eslint/node_modules/color-name/package.json index 782dd82878030a..87d0e72ec56239 100644 --- a/tools/node_modules/eslint/node_modules/color-name/package.json +++ b/tools/node_modules/eslint/node_modules/color-name/package.json @@ -1,28 +1,30 @@ -{ - "name": "color-name", - "version": "1.1.4", - "description": "A list of color names and its values", - "main": "index.js", - "files": [ - "index.js" - ], - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git@github.com:colorjs/color-name.git" - }, - "keywords": [ - "color-name", - "color", - "color-keyword", - "keyword" - ], - "author": "DY ", - "license": "MIT", - "bugs": { - "url": "https://github.com/colorjs/color-name/issues" - }, - "homepage": "https://github.com/colorjs/color-name" -} +{ + "author": { + "name": "DY", + "email": "dfcreative@gmail.com" + }, + "bugs": { + "url": "https://github.com/dfcreative/color-name/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A list of color names and its values", + "homepage": "https://github.com/dfcreative/color-name", + "keywords": [ + "color-name", + "color", + "color-keyword", + "keyword" + ], + "license": "MIT", + "main": "index.js", + "name": "color-name", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/dfcreative/color-name.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.1.3" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/concat-map/package.json b/tools/node_modules/eslint/node_modules/concat-map/package.json index d3640e6b027b9e..4abe42193c4cc4 100644 --- a/tools/node_modules/eslint/node_modules/concat-map/package.json +++ b/tools/node_modules/eslint/node_modules/concat-map/package.json @@ -1,43 +1,65 @@ { - "name" : "concat-map", - "description" : "concatenative mapdashery", - "version" : "0.0.1", - "repository" : { - "type" : "git", - "url" : "git://github.com/substack/node-concat-map.git" - }, - "main" : "index.js", - "keywords" : [ - "concat", - "concatMap", - "map", - "functional", - "higher-order" - ], - "directories" : { - "example" : "example", - "test" : "test" - }, - "scripts" : { - "test" : "tape test/*.js" - }, - "devDependencies" : { - "tape" : "~2.4.0" - }, - "license" : "MIT", - "author" : { - "name" : "James Halliday", - "email" : "mail@substack.net", - "url" : "http://substack.net" - }, - "testling" : { - "files" : "test/*.js", - "browsers" : { - "ie" : [ 6, 7, 8, 9 ], - "ff" : [ 3.5, 10, 15.0 ], - "chrome" : [ 10, 22 ], - "safari" : [ 5.1 ], - "opera" : [ 12 ] - } + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/node-concat-map/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "concatenative mapdashery", + "devDependencies": { + "tape": "~2.4.0" + }, + "directories": { + "example": "example", + "test": "test" + }, + "homepage": "https://github.com/substack/node-concat-map#readme", + "keywords": [ + "concat", + "concatMap", + "map", + "functional", + "higher-order" + ], + "license": "MIT", + "main": "index.js", + "name": "concat-map", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-concat-map.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": { + "ie": [ + 6, + 7, + 8, + 9 + ], + "ff": [ + 3.5, + 10, + 15 + ], + "chrome": [ + 10, + 22 + ], + "safari": [ + 5.1 + ], + "opera": [ + 12 + ] } -} + }, + "version": "0.0.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/cross-spawn/package.json b/tools/node_modules/eslint/node_modules/cross-spawn/package.json index 232ff97e04b213..5ed16e25e312a4 100644 --- a/tools/node_modules/eslint/node_modules/cross-spawn/package.json +++ b/tools/node_modules/eslint/node_modules/cross-spawn/package.json @@ -1,47 +1,12 @@ { - "name": "cross-spawn", - "version": "7.0.3", - "description": "Cross platform child_process#spawn and child_process#spawnSync", - "keywords": [ - "spawn", - "spawnSync", - "windows", - "cross-platform", - "path-ext", - "shebang", - "cmd", - "execute" - ], - "author": "André Cruz ", - "homepage": "https://github.com/moxystudio/node-cross-spawn", - "repository": { - "type": "git", - "url": "git@github.com:moxystudio/node-cross-spawn.git" - }, - "license": "MIT", - "main": "index.js", - "files": [ - "lib" - ], - "scripts": { - "lint": "eslint .", - "test": "jest --env node --coverage", - "prerelease": "npm t && npm run lint", - "release": "standard-version", - "postrelease": "git push --follow-tags origin HEAD && npm publish" + "author": { + "name": "André Cruz", + "email": "andre@moxy.studio" }, - "husky": { - "hooks": { - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", - "pre-commit": "lint-staged" - } - }, - "lint-staged": { - "*.js": [ - "eslint --fix", - "git add" - ] + "bugs": { + "url": "https://github.com/moxystudio/node-cross-spawn/issues" }, + "bundleDependencies": false, "commitlint": { "extends": [ "@commitlint/config-conventional" @@ -52,6 +17,8 @@ "shebang-command": "^2.0.0", "which": "^2.0.1" }, + "deprecated": false, + "description": "Cross platform child_process#spawn and child_process#spawnSync", "devDependencies": { "@commitlint/cli": "^8.1.0", "@commitlint/config-conventional": "^8.1.0", @@ -69,5 +36,46 @@ }, "engines": { "node": ">= 8" - } -} + }, + "files": [ + "lib" + ], + "homepage": "https://github.com/moxystudio/node-cross-spawn", + "husky": { + "hooks": { + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", + "pre-commit": "lint-staged" + } + }, + "keywords": [ + "spawn", + "spawnSync", + "windows", + "cross-platform", + "path-ext", + "shebang", + "cmd", + "execute" + ], + "license": "MIT", + "lint-staged": { + "*.js": [ + "eslint --fix", + "git add" + ] + }, + "main": "index.js", + "name": "cross-spawn", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/moxystudio/node-cross-spawn.git" + }, + "scripts": { + "lint": "eslint .", + "postrelease": "git push --follow-tags origin HEAD && npm publish", + "prerelease": "npm t && npm run lint", + "release": "standard-version", + "test": "jest --env node --coverage" + }, + "version": "7.0.3" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/debug/package.json b/tools/node_modules/eslint/node_modules/debug/package.json index da809d2b8d28b2..2b1dece47b8c9d 100644 --- a/tools/node_modules/eslint/node_modules/debug/package.json +++ b/tools/node_modules/eslint/node_modules/debug/package.json @@ -1,38 +1,33 @@ { - "name": "debug", - "version": "4.3.1", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" }, - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" - ], - "files": [ - "src", - "LICENSE", - "README.md" - ], - "author": "TJ Holowaychuk ", + "browser": "./src/browser.js", + "bugs": { + "url": "https://github.com/visionmedia/debug/issues" + }, + "bundleDependencies": false, "contributors": [ - "Nathan Rajlich (http://n8.io)", - "Andrew Rhyne ", - "Josh Junon " + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io" + }, + { + "name": "Andrew Rhyne", + "email": "rhyneandrew@gmail.com" + }, + { + "name": "Josh Junon", + "email": "josh@junon.me" + } ], - "license": "MIT", - "scripts": { - "lint": "xo", - "test": "npm run test:node && npm run test:browser && npm run lint", - "test:node": "istanbul cover _mocha -- test.js", - "test:browser": "karma start --single-run", - "test:coverage": "cat ./coverage/lcov.info | coveralls" - }, "dependencies": { "ms": "2.1.2" }, + "deprecated": false, + "description": "small debugging utility", "devDependencies": { "brfs": "^2.0.1", "browserify": "^16.2.3", @@ -46,14 +41,38 @@ "mocha-lcov-reporter": "^1.2.0", "xo": "^0.23.0" }, + "engines": { + "node": ">=6.0" + }, + "files": [ + "src", + "LICENSE", + "README.md" + ], + "homepage": "https://github.com/visionmedia/debug#readme", + "keywords": [ + "debug", + "log", + "debugger" + ], + "license": "MIT", + "main": "./src/index.js", + "name": "debug", "peerDependenciesMeta": { "supports-color": { "optional": true } }, - "main": "./src/index.js", - "browser": "./src/browser.js", - "engines": { - "node": ">=6.0" - } -} + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "scripts": { + "lint": "xo", + "test": "npm run test:node && npm run test:browser && npm run lint", + "test:browser": "karma start --single-run", + "test:coverage": "cat ./coverage/lcov.info | coveralls", + "test:node": "istanbul cover _mocha -- test.js" + }, + "version": "4.3.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/deep-is/package.json b/tools/node_modules/eslint/node_modules/deep-is/package.json index 63628f0d015c9e..c921e8a0e8b105 100644 --- a/tools/node_modules/eslint/node_modules/deep-is/package.json +++ b/tools/node_modules/eslint/node_modules/deep-is/package.json @@ -1,37 +1,42 @@ { - "name": "deep-is", - "version": "0.1.3", - "description": "node's assert.deepEqual algorithm except for NaN being equal to NaN", - "main": "index.js", - "directories": { - "lib": ".", - "example": "example", - "test": "test" + "author": { + "name": "Thorsten Lorenz", + "email": "thlorenz@gmx.de", + "url": "http://thlorenz.com" }, - "scripts": { - "test": "tape test/*.js" + "bugs": { + "url": "https://github.com/thlorenz/deep-is/issues" }, + "bundleDependencies": false, + "deprecated": false, + "description": "node's assert.deepEqual algorithm except for NaN being equal to NaN", "devDependencies": { "tape": "~1.0.2" }, - "repository": { - "type": "git", - "url": "http://github.com/thlorenz/deep-is.git" + "directories": { + "lib": ".", + "example": "example", + "test": "test" }, + "homepage": "https://github.com/thlorenz/deep-is#readme", "keywords": [ "equality", "equal", "compare" ], - "author": { - "name": "Thorsten Lorenz", - "email": "thlorenz@gmx.de", - "url": "http://thlorenz.com" - }, "license": { "type": "MIT", "url": "https://github.com/thlorenz/deep-is/blob/master/LICENSE" }, + "main": "index.js", + "name": "deep-is", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/thlorenz/deep-is.git" + }, + "scripts": { + "test": "tape test/*.js" + }, "testling": { "files": "test/*.js", "browsers": { @@ -57,5 +62,6 @@ 12 ] } - } -} + }, + "version": "0.1.3" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/doctrine/package.json b/tools/node_modules/eslint/node_modules/doctrine/package.json index b66099863d4479..b9a378a090734c 100644 --- a/tools/node_modules/eslint/node_modules/doctrine/package.json +++ b/tools/node_modules/eslint/node_modules/doctrine/package.json @@ -1,58 +1,66 @@ { - "name": "doctrine", + "bugs": { + "url": "https://github.com/eslint/doctrine/issues" + }, + "bundleDependencies": false, + "dependencies": { + "esutils": "^2.0.2" + }, + "deprecated": false, "description": "JSDoc parser", - "homepage": "https://github.com/eslint/doctrine", - "main": "lib/doctrine.js", - "version": "3.0.0", - "engines": { - "node": ">=6.0.0" + "devDependencies": { + "coveralls": "^3.0.1", + "dateformat": "^1.0.11", + "eslint": "^1.10.3", + "eslint-release": "^1.0.0", + "linefix": "^0.1.1", + "mocha": "^3.4.2", + "npm-license": "^0.3.1", + "nyc": "^10.3.2", + "semver": "^5.0.3", + "shelljs": "^0.5.3", + "shelljs-nodecli": "^0.1.1", + "should": "^5.0.1" }, "directories": { "lib": "./lib" }, + "engines": { + "node": ">=6.0.0" + }, "files": [ "lib" ], + "homepage": "https://github.com/eslint/doctrine", + "license": "Apache-2.0", + "main": "lib/doctrine.js", "maintainers": [ { "name": "Nicholas C. Zakas", "email": "nicholas+npm@nczconsulting.com", - "web": "https://www.nczonline.net" + "url": "https://www.nczonline.net" }, { "name": "Yusuke Suzuki", "email": "utatane.tea@gmail.com", - "web": "https://github.com/Constellation" + "url": "https://github.com/Constellation" } ], - "repository": "eslint/doctrine", - "devDependencies": { - "coveralls": "^3.0.1", - "dateformat": "^1.0.11", - "eslint": "^1.10.3", - "eslint-release": "^1.0.0", - "linefix": "^0.1.1", - "mocha": "^3.4.2", - "npm-license": "^0.3.1", - "nyc": "^10.3.2", - "semver": "^5.0.3", - "shelljs": "^0.5.3", - "shelljs-nodecli": "^0.1.1", - "should": "^5.0.1" + "name": "doctrine", + "repository": { + "type": "git", + "url": "git+https://github.com/eslint/doctrine.git" }, - "license": "Apache-2.0", "scripts": { - "pretest": "npm run lint", - "test": "nyc mocha", "coveralls": "nyc report --reporter=text-lcov | coveralls", - "lint": "eslint lib/", - "generate-release": "eslint-generate-release", "generate-alpharelease": "eslint-generate-prerelease alpha", "generate-betarelease": "eslint-generate-prerelease beta", "generate-rcrelease": "eslint-generate-prerelease rc", - "publish-release": "eslint-publish-release" + "generate-release": "eslint-generate-release", + "lint": "eslint lib/", + "pretest": "npm run lint", + "publish-release": "eslint-publish-release", + "test": "nyc mocha" }, - "dependencies": { - "esutils": "^2.0.2" - } -} + "version": "3.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/emoji-regex/package.json b/tools/node_modules/eslint/node_modules/emoji-regex/package.json index 6d323528292b00..eecc5eb318cd0a 100644 --- a/tools/node_modules/eslint/node_modules/emoji-regex/package.json +++ b/tools/node_modules/eslint/node_modules/emoji-regex/package.json @@ -1,10 +1,32 @@ { - "name": "emoji-regex", - "version": "8.0.0", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "bugs": { + "url": "https://github.com/mathiasbynens/emoji-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, "description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.", + "devDependencies": { + "@babel/cli": "^7.2.3", + "@babel/core": "^7.3.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.2.0", + "@babel/preset-env": "^7.3.4", + "mocha": "^6.0.2", + "regexgen": "^1.3.0", + "unicode-12.0.0": "^0.7.9" + }, + "files": [ + "LICENSE-MIT.txt", + "index.js", + "index.d.ts", + "text.js", + "es2015/index.js", + "es2015/text.js" + ], "homepage": "https://mths.be/emoji-regex", - "main": "index.js", - "types": "index.d.ts", "keywords": [ "unicode", "regex", @@ -16,35 +38,17 @@ "emoji" ], "license": "MIT", - "author": { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, + "main": "index.js", + "name": "emoji-regex", "repository": { "type": "git", - "url": "https://github.com/mathiasbynens/emoji-regex.git" + "url": "git+https://github.com/mathiasbynens/emoji-regex.git" }, - "bugs": "https://github.com/mathiasbynens/emoji-regex/issues", - "files": [ - "LICENSE-MIT.txt", - "index.js", - "index.d.ts", - "text.js", - "es2015/index.js", - "es2015/text.js" - ], "scripts": { "build": "rm -rf -- es2015; babel src -d .; NODE_ENV=es2015 babel src -d ./es2015; node script/inject-sequences.js", "test": "mocha", "test:watch": "npm run test -- --watch" }, - "devDependencies": { - "@babel/cli": "^7.2.3", - "@babel/core": "^7.3.4", - "@babel/plugin-proposal-unicode-property-regex": "^7.2.0", - "@babel/preset-env": "^7.3.4", - "mocha": "^6.0.2", - "regexgen": "^1.3.0", - "unicode-12.0.0": "^0.7.9" - } -} + "types": "index.d.ts", + "version": "8.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/enquirer/package.json b/tools/node_modules/eslint/node_modules/enquirer/package.json index 1d986c735661ab..c6d3a5ae0b8d7c 100644 --- a/tools/node_modules/eslint/node_modules/enquirer/package.json +++ b/tools/node_modules/eslint/node_modules/enquirer/package.json @@ -1,34 +1,27 @@ { - "name": "enquirer", - "description": "Stylish, intuitive and user-friendly prompt system. Fast and lightweight enough for small projects, powerful and extensible enough for the most advanced use cases.", - "version": "2.3.6", - "homepage": "https://github.com/enquirer/enquirer", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Brian Woodward (https://twitter.com/doowb)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)" - ], - "repository": "enquirer/enquirer", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, "bugs": { "url": "https://github.com/enquirer/enquirer/issues" }, - "license": "MIT", - "files": [ - "index.js", - "index.d.ts", - "lib" + "bundleDependencies": false, + "contributors": [ + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + } ], - "main": "index.js", - "engines": { - "node": ">=8.6" - }, - "scripts": { - "test": "mocha && tsc -p ./test/types", - "cover": "nyc --reporter=text --reporter=html mocha" - }, "dependencies": { "ansi-colors": "^4.1.1" }, + "deprecated": false, + "description": "Stylish, intuitive and user-friendly prompt system. Fast and lightweight enough for small projects, powerful and extensible enough for the most advanced use cases.", "devDependencies": { "@types/node": "^8", "gulp-format-md": "^2.0.0", @@ -39,6 +32,15 @@ "time-require": "github:jonschlinkert/time-require", "typescript": "^3.1.6" }, + "engines": { + "node": ">=8.6" + }, + "files": [ + "index.js", + "index.d.ts", + "lib" + ], + "homepage": "https://github.com/enquirer/enquirer", "keywords": [ "answer", "answers", @@ -77,6 +79,7 @@ "yo", "zsh" ], + "license": "MIT", "lintDeps": { "devDependencies": { "files": { @@ -88,6 +91,16 @@ } } }, + "main": "index.js", + "name": "enquirer", + "repository": { + "type": "git", + "url": "git+https://github.com/enquirer/enquirer.git" + }, + "scripts": { + "cover": "nyc --reporter=text --reporter=html mocha", + "test": "mocha && tsc -p ./test/types" + }, "verb": { "toc": false, "layout": false, @@ -107,5 +120,6 @@ "inquirer", "prompt-skeleton" ] - } -} + }, + "version": "2.3.6" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/escape-string-regexp/package.json b/tools/node_modules/eslint/node_modules/escape-string-regexp/package.json index f307df34a232c0..ced6973347e903 100644 --- a/tools/node_modules/eslint/node_modules/escape-string-regexp/package.json +++ b/tools/node_modules/eslint/node_modules/escape-string-regexp/package.json @@ -1,27 +1,26 @@ { - "name": "escape-string-regexp", - "version": "1.0.5", - "description": "Escape RegExp special characters", - "license": "MIT", - "repository": "sindresorhus/escape-string-regexp", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, - "maintainers": [ - "Sindre Sorhus (sindresorhus.com)", - "Joshua Boy Nicolai Appelman (jbna.nl)" - ], + "bugs": { + "url": "https://github.com/sindresorhus/escape-string-regexp/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Escape RegExp special characters", + "devDependencies": { + "ava": "*", + "xo": "*" + }, "engines": { "node": ">=0.8.0" }, - "scripts": { - "test": "xo && ava" - }, "files": [ "index.js" ], + "homepage": "https://github.com/sindresorhus/escape-string-regexp#readme", "keywords": [ "escape", "regex", @@ -34,8 +33,26 @@ "special", "characters" ], - "devDependencies": { - "ava": "*", - "xo": "*" - } -} + "license": "MIT", + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + { + "name": "Joshua Boy Nicolai Appelman", + "email": "joshua@jbna.nl", + "url": "jbna.nl" + } + ], + "name": "escape-string-regexp", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/escape-string-regexp.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.5" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-scope/package.json b/tools/node_modules/eslint/node_modules/eslint-scope/package.json index b700b92afbea29..bc425ebbd0bea4 100644 --- a/tools/node_modules/eslint/node_modules/eslint-scope/package.json +++ b/tools/node_modules/eslint/node_modules/eslint-scope/package.json @@ -1,35 +1,14 @@ { - "name": "eslint-scope", - "description": "ECMAScript scope analyzer for ESLint", - "homepage": "http://github.com/eslint/eslint-scope", - "main": "lib/index.js", - "version": "5.1.1", - "engines": { - "node": ">=8.0.0" - }, - "repository": "eslint/eslint-scope", "bugs": { "url": "https://github.com/eslint/eslint-scope/issues" }, - "license": "BSD-2-Clause", - "scripts": { - "test": "node Makefile.js test", - "lint": "node Makefile.js lint", - "generate-release": "eslint-generate-release", - "generate-alpharelease": "eslint-generate-prerelease alpha", - "generate-betarelease": "eslint-generate-prerelease beta", - "generate-rcrelease": "eslint-generate-prerelease rc", - "publish-release": "eslint-publish-release" - }, - "files": [ - "LICENSE", - "README.md", - "lib" - ], + "bundleDependencies": false, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" }, + "deprecated": false, + "description": "ECMAScript scope analyzer for ESLint", "devDependencies": { "@typescript-eslint/parser": "^1.11.0", "chai": "^4.2.0", @@ -44,5 +23,31 @@ "npm-license": "^0.3.3", "shelljs": "^0.8.3", "typescript": "^3.5.2" - } -} + }, + "engines": { + "node": ">=8.0.0" + }, + "files": [ + "LICENSE", + "README.md", + "lib" + ], + "homepage": "http://github.com/eslint/eslint-scope", + "license": "BSD-2-Clause", + "main": "lib/index.js", + "name": "eslint-scope", + "repository": { + "type": "git", + "url": "git+https://github.com/eslint/eslint-scope.git" + }, + "scripts": { + "generate-alpharelease": "eslint-generate-prerelease alpha", + "generate-betarelease": "eslint-generate-prerelease beta", + "generate-rcrelease": "eslint-generate-prerelease rc", + "generate-release": "eslint-generate-release", + "lint": "node Makefile.js lint", + "publish-release": "eslint-publish-release", + "test": "node Makefile.js test" + }, + "version": "5.1.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json b/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json index 63267be6437e03..2765f6d5537237 100644 --- a/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json +++ b/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json @@ -1,15 +1,15 @@ { - "name": "eslint-visitor-keys", - "version": "1.3.0", - "description": "Constants and utilities about visitor keys to traverse AST.", - "main": "lib/index.js", - "files": [ - "lib" - ], - "engines": { - "node": ">=4" + "author": { + "name": "Toru Nagashima", + "url": "https://github.com/mysticatea" }, + "bugs": { + "url": "https://github.com/eslint/eslint-visitor-keys/issues" + }, + "bundleDependencies": false, "dependencies": {}, + "deprecated": false, + "description": "Constants and utilities about visitor keys to traverse AST.", "devDependencies": { "eslint": "^4.7.2", "eslint-config-eslint": "^4.0.0", @@ -18,23 +18,31 @@ "nyc": "^11.2.1", "opener": "^1.4.3" }, + "engines": { + "node": ">=4" + }, + "files": [ + "lib" + ], + "homepage": "https://github.com/eslint/eslint-visitor-keys#readme", + "keywords": [], + "license": "Apache-2.0", + "main": "lib/index.js", + "name": "eslint-visitor-keys", + "repository": { + "type": "git", + "url": "git+https://github.com/eslint/eslint-visitor-keys.git" + }, "scripts": { - "lint": "eslint lib tests/lib", - "pretest": "npm run -s lint", - "test": "nyc mocha tests/lib", "coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html", - "generate-release": "eslint-generate-release", "generate-alpharelease": "eslint-generate-prerelease alpha", "generate-betarelease": "eslint-generate-prerelease beta", "generate-rcrelease": "eslint-generate-prerelease rc", - "publish-release": "eslint-publish-release" - }, - "repository": "eslint/eslint-visitor-keys", - "keywords": [], - "author": "Toru Nagashima (https://github.com/mysticatea)", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/eslint/eslint-visitor-keys/issues" + "generate-release": "eslint-generate-release", + "lint": "eslint lib tests/lib", + "pretest": "npm run -s lint", + "publish-release": "eslint-publish-release", + "test": "nyc mocha tests/lib" }, - "homepage": "https://github.com/eslint/eslint-visitor-keys#readme" -} + "version": "1.3.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-utils/package.json b/tools/node_modules/eslint/node_modules/eslint-utils/package.json index 661a97fb097865..38ea2a071cdf83 100644 --- a/tools/node_modules/eslint/node_modules/eslint-utils/package.json +++ b/tools/node_modules/eslint/node_modules/eslint-utils/package.json @@ -1,19 +1,16 @@ { - "name": "eslint-utils", - "version": "2.1.0", - "description": "Utilities for ESLint plugins.", - "engines": { - "node": ">=6" + "author": { + "name": "Toru Nagashima" }, - "sideEffects": false, - "main": "index", - "module": "index.mjs", - "files": [ - "index.*" - ], + "bugs": { + "url": "https://github.com/mysticatea/eslint-utils/issues" + }, + "bundleDependencies": false, "dependencies": { "eslint-visitor-keys": "^1.1.0" }, + "deprecated": false, + "description": "Utilities for ESLint plugins.", "devDependencies": { "@mysticatea/eslint-plugin": "^12.0.0", "codecov": "^3.6.1", @@ -32,8 +29,26 @@ "vuepress": "^1.2.0", "warun": "^1.0.0" }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.*" + ], + "funding": "https://github.com/sponsors/mysticatea", + "homepage": "https://github.com/mysticatea/eslint-utils#readme", + "keywords": [ + "eslint" + ], + "license": "MIT", + "main": "index", + "module": "index.mjs", + "name": "eslint-utils", + "repository": { + "type": "git", + "url": "git+https://github.com/mysticatea/eslint-utils.git" + }, "scripts": { - "prebuild": "npm run -s clean", "build": "rollup -c", "clean": "rimraf .nyc_output coverage index.*", "codecov": "nyc report -r lcovonly && codecov", @@ -41,25 +56,14 @@ "docs:build": "vuepress build docs", "docs:watch": "vuepress dev docs", "lint": "eslint src test", - "test": "run-s lint build test:mocha", - "test:mocha": "nyc mocha --reporter dot \"test/*.js\"", - "preversion": "npm test && npm run -s build", "postversion": "git push && git push --tags", + "prebuild": "npm run -s clean", + "preversion": "npm test && npm run -s build", "prewatch": "npm run -s clean", + "test": "run-s lint build test:mocha", + "test:mocha": "nyc mocha --reporter dot \"test/*.js\"", "watch": "warun \"{src,test}/**/*.js\" -- npm run -s test:mocha" }, - "repository": { - "type": "git", - "url": "git+https://github.com/mysticatea/eslint-utils.git" - }, - "keywords": [ - "eslint" - ], - "author": "Toru Nagashima", - "license": "MIT", - "bugs": { - "url": "https://github.com/mysticatea/eslint-utils/issues" - }, - "homepage": "https://github.com/mysticatea/eslint-utils#readme", - "funding": "https://github.com/sponsors/mysticatea" -} + "sideEffects": false, + "version": "2.1.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/package.json b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/package.json index a3b8dd684ab145..5845760935ce9b 100644 --- a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/package.json +++ b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/package.json @@ -1,15 +1,15 @@ { - "name": "eslint-visitor-keys", - "version": "2.0.0", - "description": "Constants and utilities about visitor keys to traverse AST.", - "main": "lib/index.js", - "files": [ - "lib" - ], - "engines": { - "node": ">=10" + "author": { + "name": "Toru Nagashima", + "url": "https://github.com/mysticatea" }, + "bugs": { + "url": "https://github.com/eslint/eslint-visitor-keys/issues" + }, + "bundleDependencies": false, "dependencies": {}, + "deprecated": false, + "description": "Constants and utilities about visitor keys to traverse AST.", "devDependencies": { "eslint": "^4.7.2", "eslint-config-eslint": "^4.0.0", @@ -18,22 +18,30 @@ "nyc": "^11.2.1", "opener": "^1.4.3" }, + "engines": { + "node": ">=10" + }, + "files": [ + "lib" + ], + "homepage": "https://github.com/eslint/eslint-visitor-keys#readme", + "keywords": [], + "license": "Apache-2.0", + "main": "lib/index.js", + "name": "eslint-visitor-keys", + "repository": { + "type": "git", + "url": "git+https://github.com/eslint/eslint-visitor-keys.git" + }, "scripts": { - "lint": "eslint lib tests/lib", - "test": "nyc mocha tests/lib", "coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html", - "generate-release": "eslint-generate-release", "generate-alpharelease": "eslint-generate-prerelease alpha", "generate-betarelease": "eslint-generate-prerelease beta", "generate-rcrelease": "eslint-generate-prerelease rc", - "publish-release": "eslint-publish-release" - }, - "repository": "eslint/eslint-visitor-keys", - "keywords": [], - "author": "Toru Nagashima (https://github.com/mysticatea)", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/eslint/eslint-visitor-keys/issues" + "generate-release": "eslint-generate-release", + "lint": "eslint lib tests/lib", + "publish-release": "eslint-publish-release", + "test": "nyc mocha tests/lib" }, - "homepage": "https://github.com/eslint/eslint-visitor-keys#readme" -} + "version": "2.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/package.json b/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/package.json index 63267be6437e03..2765f6d5537237 100644 --- a/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/package.json +++ b/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/package.json @@ -1,15 +1,15 @@ { - "name": "eslint-visitor-keys", - "version": "1.3.0", - "description": "Constants and utilities about visitor keys to traverse AST.", - "main": "lib/index.js", - "files": [ - "lib" - ], - "engines": { - "node": ">=4" + "author": { + "name": "Toru Nagashima", + "url": "https://github.com/mysticatea" }, + "bugs": { + "url": "https://github.com/eslint/eslint-visitor-keys/issues" + }, + "bundleDependencies": false, "dependencies": {}, + "deprecated": false, + "description": "Constants and utilities about visitor keys to traverse AST.", "devDependencies": { "eslint": "^4.7.2", "eslint-config-eslint": "^4.0.0", @@ -18,23 +18,31 @@ "nyc": "^11.2.1", "opener": "^1.4.3" }, + "engines": { + "node": ">=4" + }, + "files": [ + "lib" + ], + "homepage": "https://github.com/eslint/eslint-visitor-keys#readme", + "keywords": [], + "license": "Apache-2.0", + "main": "lib/index.js", + "name": "eslint-visitor-keys", + "repository": { + "type": "git", + "url": "git+https://github.com/eslint/eslint-visitor-keys.git" + }, "scripts": { - "lint": "eslint lib tests/lib", - "pretest": "npm run -s lint", - "test": "nyc mocha tests/lib", "coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html", - "generate-release": "eslint-generate-release", "generate-alpharelease": "eslint-generate-prerelease alpha", "generate-betarelease": "eslint-generate-prerelease beta", "generate-rcrelease": "eslint-generate-prerelease rc", - "publish-release": "eslint-publish-release" - }, - "repository": "eslint/eslint-visitor-keys", - "keywords": [], - "author": "Toru Nagashima (https://github.com/mysticatea)", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/eslint/eslint-visitor-keys/issues" + "generate-release": "eslint-generate-release", + "lint": "eslint lib tests/lib", + "pretest": "npm run -s lint", + "publish-release": "eslint-publish-release", + "test": "nyc mocha tests/lib" }, - "homepage": "https://github.com/eslint/eslint-visitor-keys#readme" -} + "version": "1.3.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/espree/package.json b/tools/node_modules/eslint/node_modules/espree/package.json index 724e6fcee72c3f..9fd6ee14a34c8f 100644 --- a/tools/node_modules/eslint/node_modules/espree/package.json +++ b/tools/node_modules/eslint/node_modules/espree/package.json @@ -1,27 +1,19 @@ { - "name": "espree", - "description": "An Esprima-compatible JavaScript parser built on Acorn", - "author": "Nicholas C. Zakas ", - "homepage": "https://github.com/eslint/espree", - "main": "espree.js", - "version": "7.3.1", - "files": [ - "lib", - "espree.js" - ], - "engines": { - "node": "^10.12.0 || >=12.0.0" + "author": { + "name": "Nicholas C. Zakas", + "email": "nicholas+npm@nczconsulting.com" }, - "repository": "eslint/espree", "bugs": { "url": "http://github.com/eslint/espree.git" }, - "license": "BSD-2-Clause", + "bundleDependencies": false, "dependencies": { "acorn": "^7.4.0", "acorn-jsx": "^5.3.1", "eslint-visitor-keys": "^1.3.0" }, + "deprecated": false, + "description": "An Esprima-compatible JavaScript parser built on Acorn", "devDependencies": { "browserify": "^16.5.0", "chai": "^4.2.0", @@ -40,6 +32,14 @@ "shelljs-nodecli": "^0.1.1", "unicode-6.3.0": "^0.7.5" }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "files": [ + "lib", + "espree.js" + ], + "homepage": "https://github.com/eslint/espree", "keywords": [ "ast", "ecmascript", @@ -48,17 +48,25 @@ "syntax", "acorn" ], + "license": "BSD-2-Clause", + "main": "espree.js", + "name": "espree", + "repository": { + "type": "git", + "url": "git+https://github.com/eslint/espree.git" + }, "scripts": { - "generate-regex": "node tools/generate-identifier-regex.js", - "test": "npm run-script lint && node Makefile.js test", - "lint": "node Makefile.js lint", - "fixlint": "node Makefile.js lint --fix", - "sync-docs": "node Makefile.js docs", "browserify": "node Makefile.js browserify", - "generate-release": "eslint-generate-release", + "fixlint": "node Makefile.js lint --fix", "generate-alpharelease": "eslint-generate-prerelease alpha", "generate-betarelease": "eslint-generate-prerelease beta", "generate-rcrelease": "eslint-generate-prerelease rc", - "publish-release": "eslint-publish-release" - } -} + "generate-regex": "node tools/generate-identifier-regex.js", + "generate-release": "eslint-generate-release", + "lint": "node Makefile.js lint", + "publish-release": "eslint-publish-release", + "sync-docs": "node Makefile.js docs", + "test": "npm run-script lint && node Makefile.js test" + }, + "version": "7.3.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/esprima/package.json b/tools/node_modules/eslint/node_modules/esprima/package.json index 4148b8ce4f4fa7..03d154ee722a3c 100644 --- a/tools/node_modules/eslint/node_modules/esprima/package.json +++ b/tools/node_modules/eslint/node_modules/esprima/package.json @@ -1,39 +1,18 @@ { - "name": "esprima", - "description": "ECMAScript parsing infrastructure for multipurpose analysis", - "homepage": "http://esprima.org", - "main": "dist/esprima.js", - "bin": { - "esparse": "./bin/esparse.js", - "esvalidate": "./bin/esvalidate.js" - }, - "version": "4.0.1", - "files": [ - "bin", - "dist/esprima.js" - ], - "engines": { - "node": ">=4" - }, "author": { "name": "Ariya Hidayat", "email": "ariya.hidayat@gmail.com" }, - "maintainers": [ - { - "name": "Ariya Hidayat", - "email": "ariya.hidayat@gmail.com", - "web": "http://ariya.ofilabs.com" - } - ], - "repository": { - "type": "git", - "url": "https://github.com/jquery/esprima.git" + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" }, "bugs": { "url": "https://github.com/jquery/esprima/issues" }, - "license": "BSD-2-Clause", + "bundleDependencies": false, + "deprecated": false, + "description": "ECMAScript parsing infrastructure for multipurpose analysis", "devDependencies": { "codecov.io": "~0.1.6", "escomplex-js": "1.2.0", @@ -62,6 +41,14 @@ "unicode-8.0.0": "~0.7.0", "webpack": "~1.14.0" }, + "engines": { + "node": ">=4" + }, + "files": [ + "bin", + "dist/esprima.js" + ], + "homepage": "http://esprima.org", "keywords": [ "ast", "ecmascript", @@ -70,43 +57,58 @@ "parser", "syntax" ], + "license": "BSD-2-Clause", + "main": "dist/esprima.js", + "maintainers": [ + { + "name": "Ariya Hidayat", + "email": "ariya.hidayat@gmail.com", + "url": "http://ariya.ofilabs.com" + } + ], + "name": "esprima", + "repository": { + "type": "git", + "url": "git+https://github.com/jquery/esprima.git" + }, "scripts": { + "all-tests": "npm run verify-line-ending && npm run generate-fixtures && npm run unit-tests && npm run api-tests && npm run grammar-tests && npm run regression-tests && npm run hostile-env-tests", + "analyze-coverage": "istanbul cover test/unit-tests.js", + "api-tests": "mocha -R dot test/api-tests.js", + "appveyor": "npm run compile && npm run all-tests && npm run browser-tests", + "benchmark": "npm run benchmark-parser && npm run benchmark-tokenizer", + "benchmark-parser": "node -expose_gc test/benchmark-parser.js", + "benchmark-tokenizer": "node --expose_gc test/benchmark-tokenizer.js", + "browser-tests": "npm run compile && npm run generate-fixtures && cd test && karma start --single-run", + "check-coverage": "istanbul check-coverage --statement 100 --branch 100 --function 100", "check-version": "node test/check-version.js", - "tslint": "tslint src/*.ts", + "circleci": "npm test && npm run codecov && npm run downstream", "code-style": "tsfmt --verify src/*.ts && tsfmt --verify test/*.js", - "format-code": "tsfmt -r src/*.ts && tsfmt -r test/*.js", + "codecov": "istanbul report cobertura && codecov < ./coverage/cobertura-coverage.xml", + "compile": "tsc -p src/ && webpack && node tools/fixupbundle.js", "complexity": "node test/check-complexity.js", - "static-analysis": "npm run check-version && npm run tslint && npm run code-style && npm run complexity", - "hostile-env-tests": "node test/hostile-environment-tests.js", - "unit-tests": "node test/unit-tests.js", - "api-tests": "mocha -R dot test/api-tests.js", + "downstream": "node test/downstream.js", + "droneio": "npm run compile && npm run all-tests && npm run saucelabs", + "dynamic-analysis": "npm run analyze-coverage && npm run check-coverage", + "format-code": "tsfmt -r src/*.ts && tsfmt -r test/*.js", + "generate-fixtures": "node tools/generate-fixtures.js", + "generate-regex": "node tools/generate-identifier-regex.js", + "generate-xhtml-entities": "node tools/generate-xhtml-entities.js", "grammar-tests": "node test/grammar-tests.js", + "hostile-env-tests": "node test/hostile-environment-tests.js", + "prepublish": "npm run compile", + "profile": "node --prof test/profile.js && mv isolate*.log v8.log && node-tick-processor", "regression-tests": "node test/regression-tests.js", - "all-tests": "npm run verify-line-ending && npm run generate-fixtures && npm run unit-tests && npm run api-tests && npm run grammar-tests && npm run regression-tests && npm run hostile-env-tests", - "verify-line-ending": "node test/verify-line-ending.js", - "generate-fixtures": "node tools/generate-fixtures.js", - "browser-tests": "npm run compile && npm run generate-fixtures && cd test && karma start --single-run", + "saucelabs": "npm run saucelabs-evergreen && npm run saucelabs-ie && npm run saucelabs-safari", "saucelabs-evergreen": "cd test && karma start saucelabs-evergreen.conf.js", - "saucelabs-safari": "cd test && karma start saucelabs-safari.conf.js", "saucelabs-ie": "cd test && karma start saucelabs-ie.conf.js", - "saucelabs": "npm run saucelabs-evergreen && npm run saucelabs-ie && npm run saucelabs-safari", - "analyze-coverage": "istanbul cover test/unit-tests.js", - "check-coverage": "istanbul check-coverage --statement 100 --branch 100 --function 100", - "dynamic-analysis": "npm run analyze-coverage && npm run check-coverage", - "compile": "tsc -p src/ && webpack && node tools/fixupbundle.js", + "saucelabs-safari": "cd test && karma start saucelabs-safari.conf.js", + "static-analysis": "npm run check-version && npm run tslint && npm run code-style && npm run complexity", "test": "npm run compile && npm run all-tests && npm run static-analysis && npm run dynamic-analysis", - "prepublish": "npm run compile", - "profile": "node --prof test/profile.js && mv isolate*.log v8.log && node-tick-processor", - "benchmark-parser": "node -expose_gc test/benchmark-parser.js", - "benchmark-tokenizer": "node --expose_gc test/benchmark-tokenizer.js", - "benchmark": "npm run benchmark-parser && npm run benchmark-tokenizer", - "codecov": "istanbul report cobertura && codecov < ./coverage/cobertura-coverage.xml", - "downstream": "node test/downstream.js", "travis": "npm test", - "circleci": "npm test && npm run codecov && npm run downstream", - "appveyor": "npm run compile && npm run all-tests && npm run browser-tests", - "droneio": "npm run compile && npm run all-tests && npm run saucelabs", - "generate-regex": "node tools/generate-identifier-regex.js", - "generate-xhtml-entities": "node tools/generate-xhtml-entities.js" - } -} + "tslint": "tslint src/*.ts", + "unit-tests": "node test/unit-tests.js", + "verify-line-ending": "node test/verify-line-ending.js" + }, + "version": "4.0.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/package.json b/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/package.json index bc99e7c4a64674..4d336a00e8b526 100644 --- a/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/package.json +++ b/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/package.json @@ -1,23 +1,10 @@ { - "name": "estraverse", - "description": "ECMAScript JS AST traversal functions", - "homepage": "https://github.com/estools/estraverse", - "main": "estraverse.js", - "version": "5.2.0", - "engines": { - "node": ">=4.0" - }, - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "web": "http://github.com/Constellation" - } - ], - "repository": { - "type": "git", - "url": "http://github.com/estools/estraverse.git" + "bugs": { + "url": "https://github.com/estools/estraverse/issues" }, + "bundleDependencies": false, + "deprecated": false, + "description": "ECMAScript JS AST traversal functions", "devDependencies": { "babel-preset-env": "^1.6.1", "babel-register": "^6.3.13", @@ -31,10 +18,28 @@ "jshint": "^2.5.6", "mocha": "^2.1.0" }, + "engines": { + "node": ">=4.0" + }, + "homepage": "https://github.com/estools/estraverse", "license": "BSD-2-Clause", + "main": "estraverse.js", + "maintainers": [ + { + "name": "Yusuke Suzuki", + "email": "utatane.tea@gmail.com", + "url": "http://github.com/Constellation" + } + ], + "name": "estraverse", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/estools/estraverse.git" + }, "scripts": { - "test": "npm run-script lint && npm run-script unit-test", "lint": "jshint estraverse.js", + "test": "npm run-script lint && npm run-script unit-test", "unit-test": "mocha --compilers js:babel-register" - } -} + }, + "version": "5.2.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/esquery/package.json b/tools/node_modules/eslint/node_modules/esquery/package.json index 3d818750d38a6d..6f9a3e44bf0794 100644 --- a/tools/node_modules/eslint/node_modules/esquery/package.json +++ b/tools/node_modules/eslint/node_modules/esquery/package.json @@ -1,11 +1,39 @@ { - "name": "esquery", - "version": "1.4.0", - "author": "Joel Feenstra ", + "author": { + "name": "Joel Feenstra", + "email": "jrfeenst+esquery@gmail.com" + }, + "bugs": { + "url": "https://github.com/estools/esquery/issues" + }, + "bundleDependencies": false, "contributors": [], + "dependencies": { + "estraverse": "^5.1.0" + }, + "deprecated": false, "description": "A query library for ECMAScript AST using a CSS selector like query language.", - "main": "dist/esquery.min.js", - "module": "dist/esquery.esm.min.js", + "devDependencies": { + "@babel/core": "^7.9.0", + "@babel/preset-env": "^7.9.5", + "@babel/register": "^7.9.0", + "@rollup/plugin-commonjs": "^11.1.0", + "@rollup/plugin-json": "^4.0.2", + "@rollup/plugin-node-resolve": "^7.1.3", + "babel-plugin-transform-es2017-object-entries": "0.0.5", + "chai": "^4.2.0", + "eslint": "^6.8.0", + "esprima": "~4.0.1", + "mocha": "^7.1.1", + "nyc": "^15.0.1", + "pegjs": "~0.10.0", + "rollup": "^1.32.1", + "rollup-plugin-babel": "^4.4.0", + "rollup-plugin-terser": "^5.3.0" + }, + "engines": { + "node": ">=0.10" + }, "files": [ "dist/*.js", "dist/*.map", @@ -13,6 +41,17 @@ "license.txt", "README.md" ], + "homepage": "https://github.com/estools/esquery/", + "keywords": [ + "ast", + "ecmascript", + "javascript", + "query" + ], + "license": "BSD-3-Clause", + "main": "dist/esquery.min.js", + "module": "dist/esquery.esm.min.js", + "name": "esquery", "nyc": { "branches": 100, "lines": 100, @@ -28,51 +67,19 @@ "tests" ] }, + "repository": { + "type": "git", + "url": "git+https://github.com/estools/esquery.git" + }, "scripts": { - "prepublishOnly": "npm run build && npm test", - "build:parser": "rm parser.js && pegjs --cache --format umd -o \"parser.js\" \"grammar.pegjs\"", - "build:browser": "rollup -c", "build": "npm run build:parser && npm run build:browser", + "build:browser": "rollup -c", + "build:parser": "rm parser.js && pegjs --cache --format umd -o \"parser.js\" \"grammar.pegjs\"", + "lint": "eslint .", "mocha": "mocha --require chai/register-assert --require @babel/register tests", + "prepublishOnly": "npm run build && npm test", "test": "nyc npm run mocha && npm run lint", - "test:ci": "npm run mocha", - "lint": "eslint ." + "test:ci": "npm run mocha" }, - "repository": { - "type": "git", - "url": "https://github.com/estools/esquery.git" - }, - "bugs": "https://github.com/estools/esquery/issues", - "homepage": "https://github.com/estools/esquery/", - "keywords": [ - "ast", - "ecmascript", - "javascript", - "query" - ], - "devDependencies": { - "@babel/core": "^7.9.0", - "@babel/preset-env": "^7.9.5", - "@babel/register": "^7.9.0", - "@rollup/plugin-commonjs": "^11.1.0", - "@rollup/plugin-json": "^4.0.2", - "@rollup/plugin-node-resolve": "^7.1.3", - "babel-plugin-transform-es2017-object-entries": "0.0.5", - "chai": "^4.2.0", - "eslint": "^6.8.0", - "esprima": "~4.0.1", - "mocha": "^7.1.1", - "nyc": "^15.0.1", - "pegjs": "~0.10.0", - "rollup": "^1.32.1", - "rollup-plugin-babel": "^4.4.0", - "rollup-plugin-terser": "^5.3.0" - }, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10" - }, - "dependencies": { - "estraverse": "^5.1.0" - } -} + "version": "1.4.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/package.json b/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/package.json index bc99e7c4a64674..4d336a00e8b526 100644 --- a/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/package.json +++ b/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/package.json @@ -1,23 +1,10 @@ { - "name": "estraverse", - "description": "ECMAScript JS AST traversal functions", - "homepage": "https://github.com/estools/estraverse", - "main": "estraverse.js", - "version": "5.2.0", - "engines": { - "node": ">=4.0" - }, - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "web": "http://github.com/Constellation" - } - ], - "repository": { - "type": "git", - "url": "http://github.com/estools/estraverse.git" + "bugs": { + "url": "https://github.com/estools/estraverse/issues" }, + "bundleDependencies": false, + "deprecated": false, + "description": "ECMAScript JS AST traversal functions", "devDependencies": { "babel-preset-env": "^1.6.1", "babel-register": "^6.3.13", @@ -31,10 +18,28 @@ "jshint": "^2.5.6", "mocha": "^2.1.0" }, + "engines": { + "node": ">=4.0" + }, + "homepage": "https://github.com/estools/estraverse", "license": "BSD-2-Clause", + "main": "estraverse.js", + "maintainers": [ + { + "name": "Yusuke Suzuki", + "email": "utatane.tea@gmail.com", + "url": "http://github.com/Constellation" + } + ], + "name": "estraverse", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/estools/estraverse.git" + }, "scripts": { - "test": "npm run-script lint && npm run-script unit-test", "lint": "jshint estraverse.js", + "test": "npm run-script lint && npm run-script unit-test", "unit-test": "mocha --compilers js:babel-register" - } -} + }, + "version": "5.2.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/esrecurse/package.json b/tools/node_modules/eslint/node_modules/esrecurse/package.json index dec5b1bc1fd3ac..8e2661c63262b1 100755 --- a/tools/node_modules/eslint/node_modules/esrecurse/package.json +++ b/tools/node_modules/eslint/node_modules/esrecurse/package.json @@ -1,26 +1,18 @@ { - "name": "esrecurse", - "description": "ECMAScript AST recursive visitor", - "homepage": "https://github.com/estools/esrecurse", - "main": "esrecurse.js", - "version": "4.3.0", - "engines": { - "node": ">=4.0" + "babel": { + "presets": [ + "es2015" + ] }, - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "web": "https://github.com/Constellation" - } - ], - "repository": { - "type": "git", - "url": "https://github.com/estools/esrecurse.git" + "bugs": { + "url": "https://github.com/estools/esrecurse/issues" }, + "bundleDependencies": false, "dependencies": { "estraverse": "^5.2.0" }, + "deprecated": false, + "description": "ECMAScript AST recursive visitor", "devDependencies": { "babel-cli": "^6.24.1", "babel-eslint": "^7.2.3", @@ -38,15 +30,28 @@ "jsdoc": "^3.3.0-alpha10", "minimist": "^1.1.0" }, + "engines": { + "node": ">=4.0" + }, + "homepage": "https://github.com/estools/esrecurse", "license": "BSD-2-Clause", + "main": "esrecurse.js", + "maintainers": [ + { + "name": "Yusuke Suzuki", + "email": "utatane.tea@gmail.com", + "url": "https://github.com/Constellation" + } + ], + "name": "esrecurse", + "repository": { + "type": "git", + "url": "git+https://github.com/estools/esrecurse.git" + }, "scripts": { + "lint": "gulp lint", "test": "gulp travis", - "unit-test": "gulp test", - "lint": "gulp lint" + "unit-test": "gulp test" }, - "babel": { - "presets": [ - "es2015" - ] - } -} + "version": "4.3.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/estraverse/package.json b/tools/node_modules/eslint/node_modules/estraverse/package.json index 1138238672309b..8a9a242d0fd34a 100644 --- a/tools/node_modules/eslint/node_modules/estraverse/package.json +++ b/tools/node_modules/eslint/node_modules/estraverse/package.json @@ -1,23 +1,10 @@ { - "name": "estraverse", - "description": "ECMAScript JS AST traversal functions", - "homepage": "https://github.com/estools/estraverse", - "main": "estraverse.js", - "version": "4.3.0", - "engines": { - "node": ">=4.0" - }, - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "web": "http://github.com/Constellation" - } - ], - "repository": { - "type": "git", - "url": "http://github.com/estools/estraverse.git" + "bugs": { + "url": "https://github.com/estools/estraverse/issues" }, + "bundleDependencies": false, + "deprecated": false, + "description": "ECMAScript JS AST traversal functions", "devDependencies": { "babel-preset-env": "^1.6.1", "babel-register": "^6.3.13", @@ -31,10 +18,28 @@ "jshint": "^2.5.6", "mocha": "^2.1.0" }, + "engines": { + "node": ">=4.0" + }, + "homepage": "https://github.com/estools/estraverse", "license": "BSD-2-Clause", + "main": "estraverse.js", + "maintainers": [ + { + "name": "Yusuke Suzuki", + "email": "utatane.tea@gmail.com", + "url": "http://github.com/Constellation" + } + ], + "name": "estraverse", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/estools/estraverse.git" + }, "scripts": { - "test": "npm run-script lint && npm run-script unit-test", "lint": "jshint estraverse.js", + "test": "npm run-script lint && npm run-script unit-test", "unit-test": "mocha --compilers js:babel-register" - } -} + }, + "version": "4.3.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/esutils/package.json b/tools/node_modules/eslint/node_modules/esutils/package.json index 8396f4cee3f7e8..cffa439c8dafce 100644 --- a/tools/node_modules/eslint/node_modules/esutils/package.json +++ b/tools/node_modules/eslint/node_modules/esutils/package.json @@ -1,44 +1,49 @@ { - "name": "esutils", + "bugs": { + "url": "https://github.com/estools/esutils/issues" + }, + "bundleDependencies": false, + "deprecated": false, "description": "utility box for ECMAScript language tools", - "homepage": "https://github.com/estools/esutils", - "main": "lib/utils.js", - "version": "2.0.3", - "engines": { - "node": ">=0.10.0" + "devDependencies": { + "chai": "~1.7.2", + "coffee-script": "~1.6.3", + "jshint": "2.6.3", + "mocha": "~2.2.1", + "regenerate": "~1.3.1", + "unicode-9.0.0": "~0.7.0" }, "directories": { "lib": "./lib" }, + "engines": { + "node": ">=0.10.0" + }, "files": [ "LICENSE.BSD", "README.md", "lib" ], + "homepage": "https://github.com/estools/esutils", + "license": "BSD-2-Clause", + "main": "lib/utils.js", "maintainers": [ { "name": "Yusuke Suzuki", "email": "utatane.tea@gmail.com", - "web": "http://github.com/Constellation" + "url": "http://github.com/Constellation" } ], + "name": "esutils", "repository": { "type": "git", - "url": "http://github.com/estools/esutils.git" - }, - "devDependencies": { - "chai": "~1.7.2", - "coffee-script": "~1.6.3", - "jshint": "2.6.3", - "mocha": "~2.2.1", - "regenerate": "~1.3.1", - "unicode-9.0.0": "~0.7.0" + "url": "git+ssh://git@github.com/estools/esutils.git" }, - "license": "BSD-2-Clause", "scripts": { - "test": "npm run-script lint && npm run-script unit-test", + "generate-regex": "node tools/generate-identifier-regex.js", "lint": "jshint lib/*.js", - "unit-test": "mocha --compilers coffee:coffee-script -R spec", - "generate-regex": "node tools/generate-identifier-regex.js" - } -} + "test": "npm run-script lint && npm run-script unit-test", + "unit-test": "mocha --compilers coffee:coffee-script -R spec" + }, + "version": "2.0.3" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/fast-deep-equal/package.json b/tools/node_modules/eslint/node_modules/fast-deep-equal/package.json index 3cfe66c68e832b..6377dca7e45e79 100644 --- a/tools/node_modules/eslint/node_modules/fast-deep-equal/package.json +++ b/tools/node_modules/eslint/node_modules/fast-deep-equal/package.json @@ -1,33 +1,13 @@ { - "name": "fast-deep-equal", - "version": "3.1.3", - "description": "Fast deep equal", - "main": "index.js", - "scripts": { - "eslint": "eslint *.js benchmark/*.js spec/*.js", - "build": "node build", - "benchmark": "npm i && npm run build && cd ./benchmark && npm i && node ./", - "test-spec": "mocha spec/*.spec.js -R spec", - "test-cov": "nyc npm run test-spec", - "test-ts": "tsc --target ES5 --noImplicitAny index.d.ts", - "test": "npm run build && npm run eslint && npm run test-ts && npm run test-cov", - "prepublish": "npm run build" + "author": { + "name": "Evgeny Poberezkin" }, - "repository": { - "type": "git", - "url": "git+https://github.com/epoberezkin/fast-deep-equal.git" - }, - "keywords": [ - "fast", - "equal", - "deep-equal" - ], - "author": "Evgeny Poberezkin", - "license": "MIT", "bugs": { "url": "https://github.com/epoberezkin/fast-deep-equal/issues" }, - "homepage": "https://github.com/epoberezkin/fast-deep-equal#readme", + "bundleDependencies": false, + "deprecated": false, + "description": "Fast deep equal", "devDependencies": { "coveralls": "^3.1.0", "dot": "^1.1.2", @@ -40,6 +20,22 @@ "sinon": "^9.0.2", "typescript": "^3.9.5" }, + "files": [ + "index.js", + "index.d.ts", + "react.js", + "react.d.ts", + "es6/" + ], + "homepage": "https://github.com/epoberezkin/fast-deep-equal#readme", + "keywords": [ + "fast", + "equal", + "deep-equal" + ], + "license": "MIT", + "main": "index.js", + "name": "fast-deep-equal", "nyc": { "exclude": [ "**/spec/**", @@ -50,12 +46,20 @@ "text-summary" ] }, - "files": [ - "index.js", - "index.d.ts", - "react.js", - "react.d.ts", - "es6/" - ], - "types": "index.d.ts" -} + "repository": { + "type": "git", + "url": "git+https://github.com/epoberezkin/fast-deep-equal.git" + }, + "scripts": { + "benchmark": "npm i && npm run build && cd ./benchmark && npm i && node ./", + "build": "node build", + "eslint": "eslint *.js benchmark/*.js spec/*.js", + "prepublish": "npm run build", + "test": "npm run build && npm run eslint && npm run test-ts && npm run test-cov", + "test-cov": "nyc npm run test-spec", + "test-spec": "mocha spec/*.spec.js -R spec", + "test-ts": "tsc --target ES5 --noImplicitAny index.d.ts" + }, + "types": "index.d.ts", + "version": "3.1.3" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/fast-json-stable-stringify/package.json b/tools/node_modules/eslint/node_modules/fast-json-stable-stringify/package.json index ad2c8bff7c94e2..46f5c8e221cc45 100644 --- a/tools/node_modules/eslint/node_modules/fast-json-stable-stringify/package.json +++ b/tools/node_modules/eslint/node_modules/fast-json-stable-stringify/package.json @@ -1,10 +1,16 @@ { - "name": "fast-json-stable-stringify", - "version": "2.1.0", - "description": "deterministic `JSON.stringify()` - a faster version of substack's json-stable-strigify without jsonify", - "main": "index.js", - "types": "index.d.ts", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/epoberezkin/fast-json-stable-stringify/issues" + }, + "bundleDependencies": false, "dependencies": {}, + "deprecated": false, + "description": "deterministic `JSON.stringify()` - a faster version of substack's json-stable-strigify without jsonify", "devDependencies": { "benchmark": "^2.1.4", "coveralls": "^3.0.0", @@ -16,15 +22,6 @@ "pre-commit": "^1.2.2", "tape": "^4.11.0" }, - "scripts": { - "eslint": "eslint index.js test", - "test-spec": "tape test/*.js", - "test": "npm run eslint && nyc npm run test-spec" - }, - "repository": { - "type": "git", - "url": "git://github.com/epoberezkin/fast-json-stable-stringify.git" - }, "homepage": "https://github.com/epoberezkin/fast-json-stable-stringify", "keywords": [ "json", @@ -33,12 +30,9 @@ "hash", "stable" ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, "license": "MIT", + "main": "index.js", + "name": "fast-json-stable-stringify", "nyc": { "exclude": [ "test", @@ -48,5 +42,16 @@ "lcov", "text-summary" ] - } -} + }, + "repository": { + "type": "git", + "url": "git://github.com/epoberezkin/fast-json-stable-stringify.git" + }, + "scripts": { + "eslint": "eslint index.js test", + "test": "npm run eslint && nyc npm run test-spec", + "test-spec": "tape test/*.js" + }, + "types": "index.d.ts", + "version": "2.1.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/fast-levenshtein/package.json b/tools/node_modules/eslint/node_modules/fast-levenshtein/package.json index 5b4736d4537a5e..85c3001e0bff5e 100644 --- a/tools/node_modules/eslint/node_modules/fast-levenshtein/package.json +++ b/tools/node_modules/eslint/node_modules/fast-levenshtein/package.json @@ -1,17 +1,15 @@ { - "name": "fast-levenshtein", - "version": "2.0.6", - "description": "Efficient implementation of Levenshtein algorithm with locale-specific collator support.", - "main": "levenshtein.js", - "files": [ - "levenshtein.js" - ], - "scripts": { - "build": "grunt build", - "prepublish": "npm run build", - "benchmark": "grunt benchmark", - "test": "mocha" + "author": { + "name": "Ramesh Nair", + "email": "ram@hiddentao.com", + "url": "http://www.hiddentao.com/" + }, + "bugs": { + "url": "https://github.com/hiddentao/fast-levenshtein/issues" }, + "bundleDependencies": false, + "deprecated": false, + "description": "Efficient implementation of Levenshtein algorithm with locale-specific collator support.", "devDependencies": { "chai": "~1.5.0", "grunt": "~0.4.1", @@ -25,15 +23,27 @@ "lodash": "^4.0.1", "mocha": "~1.9.0" }, - "repository": { - "type": "git", - "url": "https://github.com/hiddentao/fast-levenshtein.git" - }, + "files": [ + "levenshtein.js" + ], + "homepage": "https://github.com/hiddentao/fast-levenshtein#readme", "keywords": [ "levenshtein", "distance", "string" ], - "author": "Ramesh Nair (http://www.hiddentao.com/)", - "license": "MIT" -} + "license": "MIT", + "main": "levenshtein.js", + "name": "fast-levenshtein", + "repository": { + "type": "git", + "url": "git+https://github.com/hiddentao/fast-levenshtein.git" + }, + "scripts": { + "benchmark": "grunt benchmark", + "build": "grunt build", + "prepublish": "npm run build", + "test": "mocha" + }, + "version": "2.0.6" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/file-entry-cache/package.json b/tools/node_modules/eslint/node_modules/file-entry-cache/package.json index f03ef48cc6f523..b9010e8a4993f6 100644 --- a/tools/node_modules/eslint/node_modules/file-entry-cache/package.json +++ b/tools/node_modules/eslint/node_modules/file-entry-cache/package.json @@ -1,50 +1,12 @@ { - "name": "file-entry-cache", - "version": "6.0.1", - "description": "Super simple cache for file metadata, useful for process that work o a given series of files and that only need to repeat the job on the changed ones since the previous run of the process", - "repository": "royriojas/file-entry-cache", - "license": "MIT", "author": { "name": "Roy Riojas", "url": "http://royriojas.com" }, - "main": "cache.js", - "files": [ - "cache.js" - ], - "engines": { - "node": "^10.12.0 || >=12.0.0" + "bugs": { + "url": "https://github.com/royriojas/file-entry-cache/issues" }, - "scripts": { - "eslint": "eslint --cache --cache-location=node_modules/.cache/ 'cache.js' 'test/**/*.js' 'perf.js'", - "autofix": "npm run eslint -- --fix", - "install-hooks": "prepush install && changelogx install-hook && precommit install", - "changelog": "changelogx -f markdown -o ./changelog.md", - "do-changelog": "npm run changelog && git add ./changelog.md && git commit -m 'DOC: Generate changelog' --no-verify", - "pre-v": "npm run test", - "post-v": "npm run do-changelog && git push --no-verify && git push --tags --no-verify", - "bump-major": "npm run pre-v && npm version major -m 'BLD: Release v%s' && npm run post-v", - "bump-minor": "npm run pre-v && npm version minor -m 'BLD: Release v%s' && npm run post-v", - "bump-patch": "npm run pre-v && npm version patch -m 'BLD: Release v%s' && npm run post-v", - "test": "npm run eslint --silent && mocha -R spec test/specs", - "perf": "node perf.js", - "cover": "istanbul cover test/runner.js html text-summary", - "watch": "watch-run -i -p 'test/specs/**/*.js' istanbul cover test/runner.js html text-summary" - }, - "prepush": [ - "npm run eslint --silent" - ], - "precommit": [ - "npm run eslint --silent" - ], - "keywords": [ - "file cache", - "task cache files", - "file cache", - "key par", - "key value", - "cache" - ], + "bundleDependencies": false, "changelogx": { "ignoreRegExp": [ "BLD: Release", @@ -57,6 +19,11 @@ "issueIDURL": "https://github.com/royriojas/file-entry-cache/issues/{0}", "projectName": "file-entry-cache" }, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "deprecated": false, + "description": "Super simple cache for file metadata, useful for process that work o a given series of files and that only need to repeat the job on the changed ones since the previous run of the process", "devDependencies": { "chai": "^4.2.0", "changelogx": "^5.0.6", @@ -74,7 +41,49 @@ "watch-run": "^1.2.5", "write": "^2.0.0" }, - "dependencies": { - "flat-cache": "^3.0.4" - } -} + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "files": [ + "cache.js" + ], + "homepage": "https://github.com/royriojas/file-entry-cache#readme", + "keywords": [ + "file cache", + "task cache files", + "file cache", + "key par", + "key value", + "cache" + ], + "license": "MIT", + "main": "cache.js", + "name": "file-entry-cache", + "precommit": [ + "npm run eslint --silent" + ], + "prepush": [ + "npm run eslint --silent" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/royriojas/file-entry-cache.git" + }, + "scripts": { + "autofix": "npm run eslint -- --fix", + "bump-major": "npm run pre-v && npm version major -m 'BLD: Release v%s' && npm run post-v", + "bump-minor": "npm run pre-v && npm version minor -m 'BLD: Release v%s' && npm run post-v", + "bump-patch": "npm run pre-v && npm version patch -m 'BLD: Release v%s' && npm run post-v", + "changelog": "changelogx -f markdown -o ./changelog.md", + "cover": "istanbul cover test/runner.js html text-summary", + "do-changelog": "npm run changelog && git add ./changelog.md && git commit -m 'DOC: Generate changelog' --no-verify", + "eslint": "eslint --cache --cache-location=node_modules/.cache/ 'cache.js' 'test/**/*.js' 'perf.js'", + "install-hooks": "prepush install && changelogx install-hook && precommit install", + "perf": "node perf.js", + "post-v": "npm run do-changelog && git push --no-verify && git push --tags --no-verify", + "pre-v": "npm run test", + "test": "npm run eslint --silent && mocha -R spec test/specs", + "watch": "watch-run -i -p 'test/specs/**/*.js' istanbul cover test/runner.js html text-summary" + }, + "version": "6.0.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/flat-cache/package.json b/tools/node_modules/eslint/node_modules/flat-cache/package.json index 8bc6f87c51083b..a08d68db3dd4f1 100644 --- a/tools/node_modules/eslint/node_modules/flat-cache/package.json +++ b/tools/node_modules/eslint/node_modules/flat-cache/package.json @@ -1,55 +1,12 @@ { - "name": "flat-cache", - "version": "3.0.4", - "description": "A stupidly simple key/value storage using files to persist some data", - "repository": "royriojas/flat-cache", - "license": "MIT", "author": { "name": "Roy Riojas", "url": "http://royriojas.com" }, - "main": "src/cache.js", - "files": [ - "src/cache.js", - "src/del.js", - "src/utils.js" - ], - "engines": { - "node": "^10.12.0 || >=12.0.0" + "bugs": { + "url": "https://github.com/royriojas/flat-cache/issues" }, - "precommit": [ - "npm run verify --silent" - ], - "prepush": [ - "npm run verify --silent" - ], - "scripts": { - "eslint": "eslint --cache --cache-location=node_modules/.cache/ ./src/**/*.js ./test/**/*.js", - "eslint-fix": "npm run eslint -- --fix", - "autofix": "npm run eslint-fix", - "check": "npm run eslint", - "verify": "npm run eslint && npm run test:cache", - "install-hooks": "prepush install && changelogx install-hook && precommit install", - "changelog": "changelogx -f markdown -o ./changelog.md", - "do-changelog": "npm run changelog && git add ./changelog.md && git commit -m 'DOC: Generate changelog' --no-verify", - "pre-v": "npm run verify", - "post-v": "npm run do-changelog && git push --no-verify && git push --tags --no-verify", - "bump-major": "npm run pre-v && npm version major -m 'BLD: Release v%s' && npm run post-v", - "bump-minor": "npm run pre-v && npm version minor -m 'BLD: Release v%s' && npm run post-v", - "bump-patch": "npm run pre-v && npm version patch -m 'BLD: Release v%s' && npm run post-v", - "test:cache": "mocha -R spec test/specs", - "test": "npm run verify --silent", - "cover": "istanbul cover test/runner.js html text-summary", - "watch": "watch-run -i -p 'test/specs/**/*.js' istanbul cover test/runner.js html text-summary" - }, - "keywords": [ - "json cache", - "simple cache", - "file cache", - "key par", - "key value", - "cache" - ], + "bundleDependencies": false, "changelogx": { "ignoreRegExp": [ "BLD: Release", @@ -62,6 +19,12 @@ "issueIDURL": "https://github.com/royriojas/flat-cache/issues/{0}", "projectName": "flat-cache" }, + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "deprecated": false, + "description": "A stupidly simple key/value storage using files to persist some data", "devDependencies": { "chai": "^4.2.0", "changelogx": "^5.0.6", @@ -77,8 +40,54 @@ "prettier": "^2.1.2", "watch-run": "^1.2.5" }, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - } -} + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "files": [ + "src/cache.js", + "src/del.js", + "src/utils.js" + ], + "homepage": "https://github.com/royriojas/flat-cache#readme", + "keywords": [ + "json cache", + "simple cache", + "file cache", + "key par", + "key value", + "cache" + ], + "license": "MIT", + "main": "src/cache.js", + "name": "flat-cache", + "precommit": [ + "npm run verify --silent" + ], + "prepush": [ + "npm run verify --silent" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/royriojas/flat-cache.git" + }, + "scripts": { + "autofix": "npm run eslint-fix", + "bump-major": "npm run pre-v && npm version major -m 'BLD: Release v%s' && npm run post-v", + "bump-minor": "npm run pre-v && npm version minor -m 'BLD: Release v%s' && npm run post-v", + "bump-patch": "npm run pre-v && npm version patch -m 'BLD: Release v%s' && npm run post-v", + "changelog": "changelogx -f markdown -o ./changelog.md", + "check": "npm run eslint", + "cover": "istanbul cover test/runner.js html text-summary", + "do-changelog": "npm run changelog && git add ./changelog.md && git commit -m 'DOC: Generate changelog' --no-verify", + "eslint": "eslint --cache --cache-location=node_modules/.cache/ ./src/**/*.js ./test/**/*.js", + "eslint-fix": "npm run eslint -- --fix", + "install-hooks": "prepush install && changelogx install-hook && precommit install", + "post-v": "npm run do-changelog && git push --no-verify && git push --tags --no-verify", + "pre-v": "npm run verify", + "test": "npm run verify --silent", + "test:cache": "mocha -R spec test/specs", + "verify": "npm run eslint && npm run test:cache", + "watch": "watch-run -i -p 'test/specs/**/*.js' istanbul cover test/runner.js html text-summary" + }, + "version": "3.0.4" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/flatted/package.json b/tools/node_modules/eslint/node_modules/flatted/package.json index 7b106e797c1c8d..41a5b5defc6d20 100644 --- a/tools/node_modules/eslint/node_modules/flatted/package.json +++ b/tools/node_modules/eslint/node_modules/flatted/package.json @@ -1,37 +1,13 @@ { - "name": "flatted", - "version": "3.1.1", - "description": "A super light and fast circular JSON parser.", - "unpkg": "min.js", - "types": "types.d.ts", - "main": "./cjs/index.js", - "scripts": { - "build": "npm run cjs && npm run rollup:es && npm run rollup:babel && npm run min && npm run test && npm run size", - "cjs": "ascjs esm cjs", - "rollup:es": "rollup --config rollup/es.config.js && sed -i.bck 's/^var /self./' es.js && rm -rf es.js.bck", - "rollup:babel": "rollup --config rollup/babel.config.js && sed -i.bck 's/^var /self./' index.js && rm -rf index.js.bck && drop-babel-typeof index.js", - "min": "terser index.js -c -m -o min.js", - "size": "cat index.js | wc -c;cat min.js | wc -c;gzip -c9 min.js | wc -c;cat min.js | brotli | wc -c; cat es.js | brotli | wc -c", - "coveralls": "nyc report --reporter=text-lcov | coveralls", - "test": "nyc node test/index.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/WebReflection/flatted.git" + "author": { + "name": "Andrea Giammarchi" }, - "keywords": [ - "circular", - "JSON", - "fast", - "parser", - "minimal" - ], - "author": "Andrea Giammarchi", - "license": "ISC", "bugs": { "url": "https://github.com/WebReflection/flatted/issues" }, - "homepage": "https://github.com/WebReflection/flatted#readme", + "bundleDependencies": false, + "deprecated": false, + "description": "A super light and fast circular JSON parser.", "devDependencies": { "@babel/core": "^7.11.6", "@babel/preset-env": "^7.11.5", @@ -48,10 +24,38 @@ "rollup-plugin-terser": "^7.0.2", "terser": "^5.3.0" }, - "module": "./esm/index.js", - "type": "module", "exports": { "import": "./esm/index.js", "default": "./cjs/index.js" - } -} + }, + "homepage": "https://github.com/WebReflection/flatted#readme", + "keywords": [ + "circular", + "JSON", + "fast", + "parser", + "minimal" + ], + "license": "ISC", + "main": "./cjs/index.js", + "module": "./esm/index.js", + "name": "flatted", + "repository": { + "type": "git", + "url": "git+https://github.com/WebReflection/flatted.git" + }, + "scripts": { + "build": "npm run cjs && npm run rollup:es && npm run rollup:babel && npm run min && npm run test && npm run size", + "cjs": "ascjs esm cjs", + "coveralls": "nyc report --reporter=text-lcov | coveralls", + "min": "terser index.js -c -m -o min.js", + "rollup:babel": "rollup --config rollup/babel.config.js && sed -i.bck 's/^var /self./' index.js && rm -rf index.js.bck && drop-babel-typeof index.js", + "rollup:es": "rollup --config rollup/es.config.js && sed -i.bck 's/^var /self./' es.js && rm -rf es.js.bck", + "size": "cat index.js | wc -c;cat min.js | wc -c;gzip -c9 min.js | wc -c;cat min.js | brotli | wc -c; cat es.js | brotli | wc -c", + "test": "nyc node test/index.js" + }, + "type": "module", + "types": "types.d.ts", + "unpkg": "min.js", + "version": "3.1.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/fs.realpath/package.json b/tools/node_modules/eslint/node_modules/fs.realpath/package.json index 3edc57d21c7137..9007f26d64f78d 100644 --- a/tools/node_modules/eslint/node_modules/fs.realpath/package.json +++ b/tools/node_modules/eslint/node_modules/fs.realpath/package.json @@ -1,26 +1,36 @@ { - "name": "fs.realpath", - "version": "1.0.0", - "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", - "main": "index.js", - "dependencies": {}, - "devDependencies": {}, - "scripts": { - "test": "tap test/*.js --cov" + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" }, - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/fs.realpath.git" + "bugs": { + "url": "https://github.com/isaacs/fs.realpath/issues" }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", + "devDependencies": {}, + "files": [ + "old.js", + "index.js" + ], + "homepage": "https://github.com/isaacs/fs.realpath#readme", "keywords": [ "realpath", "fs", "polyfill" ], - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", - "files": [ - "old.js", - "index.js" - ] -} + "main": "index.js", + "name": "fs.realpath", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/fs.realpath.git" + }, + "scripts": { + "test": "tap test/*.js --cov" + }, + "version": "1.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/functional-red-black-tree/package.json b/tools/node_modules/eslint/node_modules/functional-red-black-tree/package.json index 13d6f270cb95a6..27edb36786b7e7 100644 --- a/tools/node_modules/eslint/node_modules/functional-red-black-tree/package.json +++ b/tools/node_modules/eslint/node_modules/functional-red-black-tree/package.json @@ -1,23 +1,22 @@ { - "name": "functional-red-black-tree", - "version": "1.0.1", - "description": "A fully persistent balanced binary search tree", - "main": "rbtree.js", - "directories": { - "test": "test" + "author": { + "name": "Mikola Lysenko" + }, + "bugs": { + "url": "https://github.com/mikolalysenko/functional-red-black-tree/issues" }, + "bundleDependencies": false, "dependencies": {}, + "deprecated": false, + "description": "A fully persistent balanced binary search tree", "devDependencies": { "iota-array": "^0.0.1", "tape": "^2.12.0" }, - "scripts": { - "test": "tape test/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/mikolalysenko/functional-red-black-tree.git" + "directories": { + "test": "test" }, + "homepage": "https://github.com/mikolalysenko/functional-red-black-tree#readme", "keywords": [ "functional", "red", @@ -32,9 +31,15 @@ "data", "structure" ], - "author": "Mikola Lysenko", "license": "MIT", - "bugs": { - "url": "https://github.com/mikolalysenko/functional-red-black-tree/issues" - } -} + "main": "rbtree.js", + "name": "functional-red-black-tree", + "repository": { + "type": "git", + "url": "git://github.com/mikolalysenko/functional-red-black-tree.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "version": "1.0.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/glob-parent/index.js b/tools/node_modules/eslint/node_modules/glob-parent/index.js index 789dbbf2ff09ef..09e257ea306cd4 100644 --- a/tools/node_modules/eslint/node_modules/glob-parent/index.js +++ b/tools/node_modules/eslint/node_modules/glob-parent/index.js @@ -6,7 +6,7 @@ var isWin32 = require('os').platform() === 'win32'; var slash = '/'; var backslash = /\\/g; -var enclosure = /[\{\[].*[\/]*.*[\}\]]$/; +var enclosure = /[\{\[].*[\}\]]$/; var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; @@ -14,6 +14,7 @@ var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; * @param {string} str * @param {Object} opts * @param {boolean} [opts.flipBackslashes=true] + * @returns {string} */ module.exports = function globParent(str, opts) { var options = Object.assign({ flipBackslashes: true }, opts); diff --git a/tools/node_modules/eslint/node_modules/glob-parent/package.json b/tools/node_modules/eslint/node_modules/glob-parent/package.json index 1dfd6bc39000f9..13ca103caf238f 100644 --- a/tools/node_modules/eslint/node_modules/glob-parent/package.json +++ b/tools/node_modules/eslint/node_modules/glob-parent/package.json @@ -1,32 +1,28 @@ { - "name": "glob-parent", - "version": "5.1.1", - "description": "Extract the non-magic parent path from a glob string.", - "author": "Gulp Team (https://gulpjs.com/)", - "contributors": [ - "Elan Shanker (https://github.com/es128)", - "Blaine Bublitz " - ], - "repository": "gulpjs/glob-parent", - "license": "ISC", - "engines": { - "node": ">= 6" + "author": { + "name": "Gulp Team", + "email": "team@gulpjs.com", + "url": "https://gulpjs.com/" }, - "main": "index.js", - "files": [ - "LICENSE", - "index.js" - ], - "scripts": { - "lint": "eslint .", - "pretest": "npm run lint", - "test": "nyc mocha --async-only", - "azure-pipelines": "nyc mocha --async-only --reporter xunit -O output=test.xunit", - "coveralls": "nyc report --reporter=text-lcov | coveralls" + "bugs": { + "url": "https://github.com/gulpjs/glob-parent/issues" }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Elan Shanker", + "url": "https://github.com/es128" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com" + } + ], "dependencies": { "is-glob": "^4.0.1" }, + "deprecated": false, + "description": "Extract the non-magic parent path from a glob string.", "devDependencies": { "coveralls": "^3.0.11", "eslint": "^2.13.1", @@ -35,6 +31,14 @@ "mocha": "^6.0.2", "nyc": "^13.3.0" }, + "engines": { + "node": ">= 6" + }, + "files": [ + "LICENSE", + "index.js" + ], + "homepage": "https://github.com/gulpjs/glob-parent#readme", "keywords": [ "glob", "parent", @@ -44,5 +48,20 @@ "directory", "base", "wildcard" - ] -} + ], + "license": "ISC", + "main": "index.js", + "name": "glob-parent", + "repository": { + "type": "git", + "url": "git+https://github.com/gulpjs/glob-parent.git" + }, + "scripts": { + "azure-pipelines": "nyc mocha --async-only --reporter xunit -O output=test.xunit", + "coveralls": "nyc report --reporter=text-lcov | coveralls", + "lint": "eslint .", + "pretest": "npm run lint", + "test": "nyc mocha --async-only" + }, + "version": "5.1.2" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/glob/package.json b/tools/node_modules/eslint/node_modules/glob/package.json index 6477c3070cb14e..bf5a63608ca133 100644 --- a/tools/node_modules/eslint/node_modules/glob/package.json +++ b/tools/node_modules/eslint/node_modules/glob/package.json @@ -1,21 +1,13 @@ { - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "name": "glob", - "description": "a little globber", - "version": "7.1.6", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-glob.git" + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" }, - "main": "glob.js", - "files": [ - "glob.js", - "sync.js", - "common.js" - ], - "engines": { - "node": "*" + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" }, + "bundleDependencies": false, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -24,23 +16,41 @@ "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, + "deprecated": false, + "description": "a little globber", "devDependencies": { "mkdirp": "0", "rimraf": "^2.2.8", "tap": "^12.0.1", "tick": "0.0.6" }, + "engines": { + "node": "*" + }, + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "homepage": "https://github.com/isaacs/node-glob#readme", + "license": "ISC", + "main": "glob.js", + "name": "glob", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, "scripts": { + "bench": "bash benchmark.sh", + "benchclean": "node benchclean.js", "prepublish": "npm run benchclean", + "prof": "bash prof.sh && cat profile.txt", "profclean": "rm -f v8.log profile.txt", "test": "tap test/*.js --cov", - "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", - "bench": "bash benchmark.sh", - "prof": "bash prof.sh && cat profile.txt", - "benchclean": "node benchclean.js" + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" }, - "license": "ISC", - "funding": { - "url": "https://github.com/sponsors/isaacs" - } -} + "version": "7.1.6" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/globals/globals.json b/tools/node_modules/eslint/node_modules/globals/globals.json index b85dc3f80d5148..d518aa24140cf1 100644 --- a/tools/node_modules/eslint/node_modules/globals/globals.json +++ b/tools/node_modules/eslint/node_modules/globals/globals.json @@ -1,5 +1,6 @@ { "builtin": { + "AggregateError": false, "Array": false, "ArrayBuffer": false, "Atomics": false, @@ -18,6 +19,7 @@ "escape": false, "eval": false, "EvalError": false, + "FinalizationRegistry": false, "Float32Array": false, "Float64Array": false, "Function": false, @@ -62,6 +64,7 @@ "URIError": false, "valueOf": false, "WeakMap": false, + "WeakRef": false, "WeakSet": false }, "es5": { @@ -224,6 +227,139 @@ "WeakMap": false, "WeakSet": false }, + "es2020": { + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "BigInt": false, + "BigInt64Array": false, + "BigUint64Array": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "globalThis": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakSet": false + }, + "es2021": { + "AggregateError": false, + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "BigInt": false, + "BigInt64Array": false, + "BigUint64Array": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "FinalizationRegistry": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "globalThis": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakRef": false, + "WeakSet": false + }, "browser": { "AbortController": false, "AbortSignal": false, @@ -546,6 +682,7 @@ "OfflineAudioContext": false, "offscreenBuffering": false, "OffscreenCanvas": true, + "OffscreenCanvasRenderingContext2D": false, "onabort": true, "onafterprint": true, "onanimationend": true, @@ -1203,20 +1340,19 @@ "quit": false }, "wsh": { - "ActiveXObject": true, - "CollectGarbage": true, - "Debug": true, - "Enumerator": true, - "GetObject": true, - "RuntimeObject": true, - "ScriptEngine": true, - "ScriptEngineBuildVersion": true, - "ScriptEngineMajorVersion": true, - "ScriptEngineMinorVersion": true, - "VBArray": true, - "WScript": true, - "WSH": true, - "XDomainRequest": true + "ActiveXObject": false, + "CollectGarbage": false, + "Debug": false, + "Enumerator": false, + "GetObject": false, + "RuntimeObject": false, + "ScriptEngine": false, + "ScriptEngineBuildVersion": false, + "ScriptEngineMajorVersion": false, + "ScriptEngineMinorVersion": false, + "VBArray": false, + "WScript": false, + "WSH": false }, "jquery": { "$": false, @@ -1299,7 +1435,6 @@ "Try": false }, "meteor": { - "_": false, "$": false, "Accounts": false, "AccountsClient": false, @@ -1485,6 +1620,7 @@ }, "atomtest": { "advanceClock": false, + "atom": false, "fakeClearInterval": false, "fakeClearTimeout": false, "fakeSetInterval": false, @@ -1539,17 +1675,25 @@ "exportFunction": false, "GM": false, "GM_addStyle": false, + "GM_addValueChangeListener": false, "GM_deleteValue": false, + "GM_download": false, "GM_getResourceText": false, "GM_getResourceURL": false, + "GM_getTab": false, + "GM_getTabs": false, "GM_getValue": false, "GM_info": false, "GM_listValues": false, "GM_log": false, + "GM_notification": false, "GM_openInTab": false, "GM_registerMenuCommand": false, + "GM_removeValueChangeListener": false, + "GM_saveTab": false, "GM_setClipboard": false, "GM_setValue": false, + "GM_unregisterMenuCommand": false, "GM_xmlhttpRequest": false, "unsafeWindow": false }, diff --git a/tools/node_modules/eslint/node_modules/globals/node_modules/type-fest/license b/tools/node_modules/eslint/node_modules/globals/node_modules/type-fest/license new file mode 100644 index 00000000000000..3e4c85ab7effdc --- /dev/null +++ b/tools/node_modules/eslint/node_modules/globals/node_modules/type-fest/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https:/sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/globals/node_modules/type-fest/package.json b/tools/node_modules/eslint/node_modules/globals/node_modules/type-fest/package.json new file mode 100644 index 00000000000000..607b879b96506a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/globals/node_modules/type-fest/package.json @@ -0,0 +1,67 @@ +{ + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/type-fest/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A collection of essential TypeScript types", + "devDependencies": { + "@sindresorhus/tsconfig": "~0.7.0", + "tsd": "^0.13.1", + "typescript": "^4.1.2", + "xo": "^0.35.0" + }, + "engines": { + "node": ">=10" + }, + "files": [ + "index.d.ts", + "base.d.ts", + "source", + "ts41" + ], + "funding": "https://github.com/sponsors/sindresorhus", + "homepage": "https://github.com/sindresorhus/type-fest#readme", + "keywords": [ + "typescript", + "ts", + "types", + "utility", + "util", + "utilities", + "omit", + "merge", + "json" + ], + "license": "(MIT OR CC0-1.0)", + "name": "type-fest", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/type-fest.git" + }, + "scripts": { + "//test": "xo && tsd && tsc", + "test": "xo && tsc" + }, + "types": "./index.d.ts", + "typesVersions": { + ">=4.1": { + "*": [ + "ts41/*" + ] + } + }, + "version": "0.20.2", + "xo": { + "rules": { + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/indent": "off", + "node/no-unsupported-features/es-builtins": "off" + } + } +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/globals/node_modules/type-fest/readme.md b/tools/node_modules/eslint/node_modules/globals/node_modules/type-fest/readme.md new file mode 100644 index 00000000000000..714df7868e1372 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/globals/node_modules/type-fest/readme.md @@ -0,0 +1,658 @@ +
+
+
+ type-fest +
+
+ A collection of essential TypeScript types +
+
+
+
+
+ +[![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://giphy.com/gifs/illustration-rainbow-unicorn-26AHG5KGFxSkUWw1i) + + +Many of the types here should have been built-in. You can help by suggesting some of them to the [TypeScript project](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). + +Either add this package as a dependency or copy-paste the needed types. No credit required. 👌 + +PR welcome for additional commonly needed types and docs improvements. Read the [contributing guidelines](.github/contributing.md) first. + +## Install + +``` +$ npm install type-fest +``` + +*Requires TypeScript >=3.4* + +## Usage + +```ts +import {Except} from 'type-fest'; + +type Foo = { + unicorn: string; + rainbow: boolean; +}; + +type FooWithoutRainbow = Except; +//=> {unicorn: string} +``` + +## API + +Click the type names for complete docs. + +### Basic + +- [`Primitive`](source/basic.d.ts) - Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). +- [`Class`](source/basic.d.ts) - Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). +- [`TypedArray`](source/basic.d.ts) - Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`. +- [`JsonObject`](source/basic.d.ts) - Matches a JSON object. +- [`JsonArray`](source/basic.d.ts) - Matches a JSON array. +- [`JsonValue`](source/basic.d.ts) - Matches any valid JSON value. +- [`ObservableLike`](source/basic.d.ts) - Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable). + +### Utilities + +- [`Except`](source/except.d.ts) - Create a type from an object type without certain keys. This is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). +- [`Mutable`](source/mutable.d.ts) - Convert an object with `readonly` keys into a mutable object. The inverse of `Readonly`. +- [`Merge`](source/merge.d.ts) - Merge two types into a new type. Keys of the second type overrides keys of the first type. +- [`MergeExclusive`](source/merge-exclusive.d.ts) - Create a type that has mutually exclusive keys. +- [`RequireAtLeastOne`](source/require-at-least-one.d.ts) - Create a type that requires at least one of the given keys. +- [`RequireExactlyOne`](source/require-exactly-one.d.ts) - Create a type that requires exactly a single key of the given keys and disallows more. +- [`PartialDeep`](source/partial-deep.d.ts) - Create a deeply optional version of another type. Use [`Partial`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) if you only need one level deep. +- [`ReadonlyDeep`](source/readonly-deep.d.ts) - Create a deeply immutable version of an `object`/`Map`/`Set`/`Array` type. Use [`Readonly`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) if you only need one level deep. +- [`LiteralUnion`](source/literal-union.d.ts) - Create a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. Workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). +- [`Promisable`](source/promisable.d.ts) - Create a type that represents either the value or the value wrapped in `PromiseLike`. +- [`Opaque`](source/opaque.d.ts) - Create an [opaque type](https://codemix.com/opaque-types-in-javascript/). +- [`SetOptional`](source/set-optional.d.ts) - Create a type that makes the given keys optional. +- [`SetRequired`](source/set-required.d.ts) - Create a type that makes the given keys required. +- [`ValueOf`](source/value-of.d.ts) - Create a union of the given object's values, and optionally specify which keys to get the values from. +- [`PromiseValue`](source/promise-value.d.ts) - Returns the type that is wrapped inside a `Promise`. +- [`AsyncReturnType`](source/async-return-type.d.ts) - Unwrap the return type of a function that returns a `Promise`. +- [`ConditionalKeys`](source/conditional-keys.d.ts) - Extract keys from a shape where values extend the given `Condition` type. +- [`ConditionalPick`](source/conditional-pick.d.ts) - Like `Pick` except it selects properties from a shape where the values extend the given `Condition` type. +- [`ConditionalExcept`](source/conditional-except.d.ts) - Like `Omit` except it removes properties from a shape where the values extend the given `Condition` type. +- [`UnionToIntersection`](source/union-to-intersection.d.ts) - Convert a union type to an intersection type. +- [`Stringified`](source/stringified.d.ts) - Create a type with the keys of the given type changed to `string` type. +- [`FixedLengthArray`](source/fixed-length-array.d.ts) - Create a type that represents an array of the given type and length. +- [`IterableElement`](source/iterable-element.d.ts) - Get the element type of an `Iterable`/`AsyncIterable`. For example, an array or a generator. +- [`Entry`](source/entry.d.ts) - Create a type that represents the type of an entry of a collection. +- [`Entries`](source/entries.d.ts) - Create a type that represents the type of the entries of a collection. +- [`SetReturnType`](source/set-return-type.d.ts) - Create a function type with a return type of your choice and the same parameters as the given function type. +- [`Asyncify`](source/asyncify.d.ts) - Create an async version of the given function type. + +### Template literal types + +*Note:* These require [TypeScript 4.1 or newer](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/#template-literal-types). + +- [`CamelCase`](ts41/camel-case.d.ts) – Convert a string literal to camel-case (`fooBar`). +- [`KebabCase`](ts41/kebab-case.d.ts) – Convert a string literal to kebab-case (`foo-bar`). +- [`PascalCase`](ts41/pascal-case.d.ts) – Converts a string literal to pascal-case (`FooBar`) +- [`SnakeCase`](ts41/snake-case.d.ts) – Convert a string literal to snake-case (`foo_bar`). +- [`DelimiterCase`](ts41/delimiter-case.d.ts) – Convert a string literal to a custom string delimiter casing. + +### Miscellaneous + +- [`PackageJson`](source/package-json.d.ts) - Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). +- [`TsConfigJson`](source/tsconfig-json.d.ts) - Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 3.7). + +## Declined types + +*If we decline a type addition, we will make sure to document the better solution here.* + +- [`Diff` and `Spread`](https://github.com/sindresorhus/type-fest/pull/7) - The PR author didn't provide any real-world use-cases and the PR went stale. If you think this type is useful, provide some real-world use-cases and we might reconsider. +- [`Dictionary`](https://github.com/sindresorhus/type-fest/issues/33) - You only save a few characters (`Dictionary` vs `Record`) from [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434), which is more flexible and well-known. Also, you shouldn't use an object as a dictionary. We have `Map` in JavaScript now. +- [`SubType`](https://github.com/sindresorhus/type-fest/issues/22) - The type is powerful, but lacks good use-cases and is prone to misuse. +- [`ExtractProperties` and `ExtractMethods`](https://github.com/sindresorhus/type-fest/pull/4) - The types violate the single responsibility principle. Instead, refine your types into more granular type hierarchies. + +## Tips + +### Built-in types + +There are many advanced types most users don't know about. + +- [`Partial`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) - Make all properties in `T` optional. +
+ + Example + + + [Playground](https://www.typescriptlang.org/play/#code/JYOwLgpgTgZghgYwgAgHIHsAmEDC6QzADmyA3gLABQyycADnanALYQBcyAzmFKEQNxUaddFDAcQAV2YAjaIMoBfKlQQAbOJ05osEAIIMAQpOBrsUMkOR1eANziRkCfISKSoD4Pg4ZseAsTIALyW1DS0DEysHADkvvoMMQA0VsKi4sgAzAAMuVaKClY2wPaOknSYDrguADwA0sgQAB6QIJjaANYQAJ7oMDp+LsQAfAAUXd0cdUnI9mo+uv6uANp1ALoAlKHhyGAAFsCcAHTOAW4eYF4gyxNrwbNwago0ypRWp66jH8QcAApwYmAjxq8SWIy2FDCNDA3ToKFBQyIdR69wmfQG1TOhShyBgomQX3w3GQE2Q6IA8jIAFYQBBgI4TTiEs5bTQYsFInrLTbbHZOIlgZDlSqQABqj0kKBC3yINx6a2xfOQwH6o2FVXFaklwSCIUkbQghBAEEwENSfNOlykEGefNe5uhB2O6sgS3GPRmLogmslG1tLxUOKgEDA7hAuydtteryAA) + + ```ts + interface NodeConfig { + appName: string; + port: number; + } + + class NodeAppBuilder { + private configuration: NodeConfig = { + appName: 'NodeApp', + port: 3000 + }; + + private updateConfig(key: Key, value: NodeConfig[Key]) { + this.configuration[key] = value; + } + + config(config: Partial) { + type NodeConfigKey = keyof NodeConfig; + + for (const key of Object.keys(config) as NodeConfigKey[]) { + const updateValue = config[key]; + + if (updateValue === undefined) { + continue; + } + + this.updateConfig(key, updateValue); + } + + return this; + } + } + + // `Partial`` allows us to provide only a part of the + // NodeConfig interface. + new NodeAppBuilder().config({appName: 'ToDoApp'}); + ``` +
+ +- [`Required`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1408-L1413) - Make all properties in `T` required. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgGED21VQGJZwC2wA3gFCjXAzFJgA2A-AFzADOUckA5gNxUaIYjA4ckvGG07c+g6gF8KQkAgCuEFFDA5O6gEbEwUbLm2ESwABQIixACJIoSdgCUYAR3Vg4MACYAPGYuFvYAfACU5Ko0APRxwADKMBD+wFAAFuh2Vv7OSBlYGdmc8ABu8LHKsRyGxqY4oQT21pTCIHQMjOwA5DAAHgACxAAOjDAAdChYxL0ANLHUouKSMH0AEmAAhJhY6ozpAJ77GTCMjMCiV0ToSAb7UJPPC9WRgrEJwAAqR6MwSRQPFGUFocDgRHYxnEfGAowh-zgUCOwF6KwkUl6tXqJhCeEsxDaS1AXSYfUGI3GUxmc0WSneQA) + + ```ts + interface ContactForm { + email?: string; + message?: string; + } + + function submitContactForm(formData: Required) { + // Send the form data to the server. + } + + submitContactForm({ + email: 'ex@mple.com', + message: 'Hi! Could you tell me more about…', + }); + + // TypeScript error: missing property 'message' + submitContactForm({ + email: 'ex@mple.com', + }); + ``` +
+ +- [`Readonly`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) - Make all properties in `T` readonly. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4UwOwVwW2AZA9gc3mAbmANsA3gKFCOAHkAzMgGkOJABEwAjKZa2kAUQCcvEu32AMQCGAF2FYBIAL4BufDRABLCKLBcywgMZgEKZOoDCiCGSXI8i4hGEwwALmABnUVxXJ57YFgzZHSVF8sT1BpBSItLGEnJz1kAy5LLy0TM2RHACUwYQATEywATwAeAITjU3MAPnkrCJMXLigtUT4AClxgGztKbyDgaX99I1TzAEokr1BRAAslJwA6FIqLAF48TtswHp9MHDla9hJGACswZvmyLjAwAC8wVpm5xZHkUZDaMKIwqyWXYCW0oN4sNlsA1h0ug5gAByACyBQAggAHJHQ7ZBIFoXbzBjMCz7OoQP5YIaJNYQMAAdziCVaALGNSIAHomcAACoFJFgADKWjcSNEwG4vC4ji0wggEEQguiTnMEGALWAV1yAFp8gVgEjeFyuKICvMrCTgVxnst5jtsGC4ljsPNhXxGaAWcAAOq6YRXYDCRg+RWIcA5JSC+kWdCepQ+v3RYCU3RInzRMCGwlpC19NYBW1Ye08R1AA) + + ```ts + enum LogLevel { + Off, + Debug, + Error, + Fatal + }; + + interface LoggerConfig { + name: string; + level: LogLevel; + } + + class Logger { + config: Readonly; + + constructor({name, level}: LoggerConfig) { + this.config = {name, level}; + Object.freeze(this.config); + } + } + + const config: LoggerConfig = { + name: 'MyApp', + level: LogLevel.Debug + }; + + const logger = new Logger(config); + + // TypeScript Error: cannot assign to read-only property. + logger.config.level = LogLevel.Error; + + // We are able to edit config variable as we please. + config.level = LogLevel.Error; + ``` +
+ +- [`Pick`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1422-L1427) - From `T`, pick a set of properties whose keys are in the union `K`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgEE5TCgNugN4BQoZwOUBAXMAM5RyQDmA3KeSFABYCuAtgCMISMHloMmENh04oA9tBjQJjFuzIBfYrOAB6PcADCcGElh1gEGAHcKATwAO6ebyjB5CTNlwFwSxFR0BX5HeToYABNgBDh5fm8cfBg6AHIKG3ldA2BHOOcfFNpUygJ0pAhokr4hETFUgDpswywkggAFUwA3MFtgAF5gQgowKhhVKTYKGuFRcXo1aVZgbTIoJ3RW3xhOmB6+wfbcAGsAHi3kgBpgEtGy4AAfG54BWfqAPnZm4AAlZUj4MAkMA8GAGB4vEgfMlLLw6CwPBA8PYRmMgZVgAC6CgmI4cIommQELwICh8RBgKZKvALh1ur0bHQABR5PYMui0Wk7em2ADaAF0AJS0AASABUALIAGQAogR+Mp3CROCAFBBwVC2ikBpj5CgBIqGjizLA5TAFdAmalImAuqlBRoVQh5HBgEy1eDWfs7J5cjzGYKhroVfpDEhHM4MV6GRR5NN0JrtnRg6BVirTFBeHAKYmYY6QNpdB73LmCJZBlSAXAubtvczeSmQMNSuMbmKNgBlHFgPEUNwusBIPAAQlS1xetTmxT0SDoESgdD0C4aACtHMwxytLrohawgA) + + ```ts + interface Article { + title: string; + thumbnail: string; + content: string; + } + + // Creates new type out of the `Article` interface composed + // from the Articles' two properties: `title` and `thumbnail`. + // `ArticlePreview = {title: string; thumbnail: string}` + type ArticlePreview = Pick; + + // Render a list of articles using only title and description. + function renderArticlePreviews(previews: ArticlePreview[]): HTMLElement { + const articles = document.createElement('div'); + + for (const preview of previews) { + // Append preview to the articles. + } + + return articles; + } + + const articles = renderArticlePreviews([ + { + title: 'TypeScript tutorial!', + thumbnail: '/assets/ts.jpg' + } + ]); + ``` +
+ +- [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434) - Construct a type with a set of properties `K` of type `T`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4ejYAUHsGcCWAXBMB2dgwGbAKYC2ADgDYwCeeemCaWArgE7ADGMxAhmuQHQBQoYEnJE8wALKEARnkaxEKdMAC8wAOS0kstGuAAfdQBM8ANzxlRjXQbVaWACwC0JPB0NqA3HwGgIwAJJoWozYHCxixnAsjAhStADmwESMMJYo1Fi4HMCIaPEu+MRklHj8gpqyoeHAAKJFFFTAAN4+giDYCIxwSAByHAR4AFw5SDF5Xm2gJBzdfQPD3WPxE5PAlBxdAPLYNQAelgh4aOHDaPQEMowrIAC+3oJ+AMKMrlrAXFhSAFZ4LEhC9g4-0BmA4JBISXgiCkBQABpILrJ5MhUGhYcATGD6Bk4Hh-jNgABrPDkOBlXyQAAq9ngYmJpOAAHcEOCRjAXqwYODfoo6DhakUSph+Uh7GI4P0xER4Cj0OSQGwMP8tP1hgAlX7swwAHgRl2RvIANALSA08ABtAC6AD4VM1Wm0Kow0MMrYaHYJjGYLLJXZb3at1HYnC43Go-QHQDcvA6-JsmEJXARgCDgMYWAhjIYhDAU+YiMAAFIwex0ZmilMITCGF79TLAGRsAgJYAAZRwSEZGzEABFTOZUrJ5Yn+jwnWgeER6HB7AAKJrADpdXqS4ZqYultTG6azVfqHswPBbtauLY7fayQ7HIbAAAMwBuAEoYw9IBq2Ixs9h2eFMOQYPQObALQKJgggABeYhghCIpikkKRpOQRIknAsZUiIeCttECBEP8NSMCkjDDAARMGziuIYxHwYOjDCMBmDNnAuTxA6irdCOBB1Lh5Dqpqn66tISIykawBnOCtqqC0gbjqc9DgpGkxegOliyfJDrRkAA) + + ```ts + // Positions of employees in our company. + type MemberPosition = 'intern' | 'developer' | 'tech-lead'; + + // Interface describing properties of a single employee. + interface Employee { + firstName: string; + lastName: string; + yearsOfExperience: number; + } + + // Create an object that has all possible `MemberPosition` values set as keys. + // Those keys will store a collection of Employees of the same position. + const team: Record = { + intern: [], + developer: [], + 'tech-lead': [], + }; + + // Our team has decided to help John with his dream of becoming Software Developer. + team.intern.push({ + firstName: 'John', + lastName: 'Doe', + yearsOfExperience: 0 + }); + + // `Record` forces you to initialize all of the property keys. + // TypeScript Error: "tech-lead" property is missing + const teamEmpty: Record = { + intern: null, + developer: null, + }; + ``` +
+ +- [`Exclude`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1436-L1439) - Exclude from `T` those types that are assignable to `U`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgMrQG7QMIHsQzADmyA3gFDLIAOuUYAXMiAK4A2byAPsgM5hRQJHqwC2AI2gBucgF9y5MAE9qKAEoQAjiwj8AEnBAATNtGQBeZAAooWphu26wAGmS3e93bRC8IASgsAPmRDJRlyAHoI5ABRAA8ENhYjFFYOZGVVZBgoXFFkAAM0zh5+QRBhZhYJaAKAOkjogEkQZAQ4X2QAdwALCFbaemRgXmQtFjhOMFwq9K6ULuB0lk6U+HYwZAxJnQaYFhAEMGB8ZCIIMAAFOjAANR2IK0HGWISklIAedCgsKDwCYgAbQA5M9gQBdVzFQJ+JhiSRQMiUYYwayZCC4VHPCzmSzAspCYEBWxgFhQAZwKC+FpgJ43VwARgADH4ZFQSWSBjcZPJyPtDsdTvxKWBvr8rD1DCZoJ5HPopaYoK4EPhCEQmGKcKriLCtrhgEYkVQVT5Nr4fmZLLZtMBbFZgT0wGBqES6ghbHBIJqoBKFdBWQpjfh+DQbhY2tqiHVsbjLMVkAB+ZAAZiZaeQTHOVxu9ySjxNaujNwDVHNvzqbBGkBAdPoAfkQA) + + ```ts + interface ServerConfig { + port: null | string | number; + } + + type RequestHandler = (request: Request, response: Response) => void; + + // Exclude `null` type from `null | string | number`. + // In case the port is equal to `null`, we will use default value. + function getPortValue(port: Exclude): number { + if (typeof port === 'string') { + return parseInt(port, 10); + } + + return port; + } + + function startServer(handler: RequestHandler, config: ServerConfig): void { + const server = require('http').createServer(handler); + + const port = config.port === null ? 3000 : getPortValue(config.port); + server.listen(port); + } + ``` +
+ +- [`Extract`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1441-L1444) - Extract from `T` those types that are assignable to `U`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXzSwEdkQBJYACgEoAueVZAWwCMQYBuAKDDwGcM8MgBF4AXngBlAJ6scESgHIRi6ty5ZUGdoihgEABXZ888AN5d48ANoiAuvUat23K6ihMQ9ATE0BzV3goPy8GZjZOLgBfLi4Aejj4AEEICBwAdz54MAALKFQQ+BxEeAAHY1NgKAwoIKy0grr4DByEUpgccpgMaXgAaxBerCzi+B9-ZulygDouFHRsU1z8kKMYE1RhaqgAHkt4AHkWACt4EAAPbVRgLLWNgBp9gGlBs8uQa6yAUUuYPQwdgNpKM7nh7mMML4CgA+R5WABqUAgpDeVxuhxO1he0jsXGh8EoOBO9COx3BQPo2PBADckaR6IjkSA6PBqTgsMBzPsicdrEC7OJWXSQNwYvFEgAVTS9JLXODpeDpKBZFg4GCoWa8VACIJykAKiQWKy2YQOAioYikCg0OEMDyhRSy4DyxS24KhAAMjyi6gS8AAwjh5OD0iBFHAkJoEOksC1mnkMJq8gUQKDNttKPlnfrwYp3J5XfBHXqoKpfYkAOI4ansTxaeDADmoRSCCBYAbxhC6TDx6rwYHIRX5bScjA4bLJwoDmDwDkfbA9JMrVMVdM1TN69LgkTgwgkchUahqIA) + + ```ts + declare function uniqueId(): number; + + const ID = Symbol('ID'); + + interface Person { + [ID]: number; + name: string; + age: number; + } + + // Allows changing the person data as long as the property key is of string type. + function changePersonData< + Obj extends Person, + Key extends Extract, + Value extends Obj[Key] + > (obj: Obj, key: Key, value: Value): void { + obj[key] = value; + } + + // Tiny Andrew was born. + const andrew = { + [ID]: uniqueId(), + name: 'Andrew', + age: 0, + }; + + // Cool, we're fine with that. + changePersonData(andrew, 'name', 'Pony'); + + // Goverment didn't like the fact that you wanted to change your identity. + changePersonData(andrew, ID, uniqueId()); + ``` +
+ +- [`NonNullable`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1446-L1449) - Exclude `null` and `undefined` from `T`. +
+ + Example + + Works with strictNullChecks set to true. (Read more here) + + [Playground](https://typescript-play.js.org/?target=6#code/C4TwDgpgBACg9gJ2AOQK4FsBGEFQLxQDOwCAlgHYDmUAPlORtrnQwDasDcAUFwPQBU-WAEMkUOADMowqAGNWwwoSgATCBIqlgpOOSjAAFsOBRSy1IQgr9cKJlSlW1mZYQA3HFH68u8xcoBlHA8EACEHJ08Aby4oKDBUTFZSWXjEFEYcAEIALihkXTR2YSSIAB54JDQsHAA+blj4xOTUsHSACkMzPKD3HHDHNQQAGjSkPMqMmoQASh7g-oihqBi4uNIpdraxPAI2VhmVxrX9AzMAOm2ppnwoAA4ABifuE4BfKAhWSyOTuK7CS7pao3AhXF5rV48E4ICDAVAIPT-cGQyG+XTEIgLMJLTx7CAAdygvRCA0iCHaMwarhJOIQjUBSHaACJHk8mYdeLwxtdcVAAOSsh58+lXdr7Dlcq7A3n3J4PEUdADMcspUE53OluAIUGVTx46oAKuAIAFZGQwCYAKIIBCILjUxaDHAMnla+iodjcIA) + + ```ts + type PortNumber = string | number | null; + + /** Part of a class definition that is used to build a server */ + class ServerBuilder { + portNumber!: NonNullable; + + port(this: ServerBuilder, port: PortNumber): ServerBuilder { + if (port == null) { + this.portNumber = 8000; + } else { + this.portNumber = port; + } + + return this; + } + } + + const serverBuilder = new ServerBuilder(); + + serverBuilder + .port('8000') // portNumber = '8000' + .port(null) // portNumber = 8000 + .port(3000); // portNumber = 3000 + + // TypeScript error + serverBuilder.portNumber = null; + ``` +
+ +- [`Parameters`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1451-L1454) - Obtain the parameters of a function type in a tuple. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/GYVwdgxgLglg9mABAZwBYmMANgUwBQxgAOIUAXIgIZgCeA2gLoCUFAbnDACaIDeAUIkQB6IYgCypSlBxUATrMo1ECsJzgBbLEoipqAc0J7EMKMgDkiHLnU4wp46pwAPHMgB0fAL58+oSLARECEosLAA5ABUYG2QAHgAxJGdpVWREPDdMylk9ZApqemZEAF4APipacrw-CApEgBogkKwAYThwckQwEHUAIxxZJl4BYVEImiIZKF0oZRwiWVdbeygJmThgOYgcGFYcbhqApCJsyhtpWXcR1cnEePBoeDAABVPzgbTixFeFd8uEsClADcIxGiygIFkSEOT3SmTc2VydQeRx+ZxwF2QQ34gkEwDgsnSuFmMBKiAADEDjIhYk1Qm0OlSYABqZnYka4xA1DJZHJYkGc7yCbyeRA+CAIZCzNAYbA4CIAdxg2zJwVCkWirjwMswuEaACYmCCgA) + + ```ts + function shuffle(input: any[]): void { + // Mutate array randomly changing its' elements indexes. + } + + function callNTimes any> (func: Fn, callCount: number) { + // Type that represents the type of the received function parameters. + type FunctionParameters = Parameters; + + return function (...args: FunctionParameters) { + for (let i = 0; i < callCount; i++) { + func(...args); + } + } + } + + const shuffleTwice = callNTimes(shuffle, 2); + ``` +
+ +- [`ConstructorParameters`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1456-L1459) - Obtain the parameters of a constructor function type in a tuple. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECCBOAXAlqApgWQPYBM0mgG8AoaaFRENALmgkXmQDsBzAblOmCycTV4D8teo1YdO3JiICuwRFngAKClWENmLAJRFOZRAAtkEAHQq00ALzlklNBzIBfYk+KhIMAJJTEYJsDQAwmDA+mgAPAAq0GgAHnxMODCKTGgA7tCKxllg8CwQtL4AngDaALraFgB80EWa1SRkAA6MAG5gfNAB4FABPDJyCrQR9tDNyG0dwMGhtBhgjWEiGgA00F70vv4RhY3hEZXVVinpc42KmuJkkv3y8Bly8EPaDWTkhiZd7r3e8LK3llwGCMXGQWGhEOsfH5zJlsrl8p0+gw-goAAo5MAAW3BaHgEEilU0tEhmzQ212BJ0ry4SOg+kg+gBBiMximIGA0nAfAQLGk2N4EAAEgzYcYcnkLsRdDTvNEYkYUKwSdCme9WdM0MYwYhFPSIPpJdTkAAzDKxBUaZX+aAAQgsVmkCTQxuYaBw2ng4Ok8CYcotSu8pMur09iG9vuObxZnx6SN+AyUWTF8MN0CcZE4Ywm5jZHK5aB5fP4iCFIqT4oRRTKRLo6lYVNeAHpG50wOzOe1zHr9NLQ+HoABybsD4HOKXXRA1JCoKhBELmI5pNaB6Fz0KKBAodDYPAgSUTmqYsAALx4m5nC6nW9nGq14KtaEUA9gR9PvuNCjQ9BgACNvcwNBtAcLiAA) + + ```ts + class ArticleModel { + title: string; + content?: string; + + constructor(title: string) { + this.title = title; + } + } + + class InstanceCache any)> { + private ClassConstructor: T; + private cache: Map> = new Map(); + + constructor (ctr: T) { + this.ClassConstructor = ctr; + } + + getInstance (...args: ConstructorParameters): InstanceType { + const hash = this.calculateArgumentsHash(...args); + + const existingInstance = this.cache.get(hash); + if (existingInstance !== undefined) { + return existingInstance; + } + + return new this.ClassConstructor(...args); + } + + private calculateArgumentsHash(...args: any[]): string { + // Calculate hash. + return 'hash'; + } + } + + const articleCache = new InstanceCache(ArticleModel); + const amazonArticle = articleCache.getInstance('Amazon forests burining!'); + ``` +
+ +- [`ReturnType`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1461-L1464) – Obtain the return type of a function type. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA) + + ```ts + /** Provides every element of the iterable `iter` into the `callback` function and stores the results in an array. */ + function mapIter< + Elem, + Func extends (elem: Elem) => any, + Ret extends ReturnType + >(iter: Iterable, callback: Func): Ret[] { + const mapped: Ret[] = []; + + for (const elem of iter) { + mapped.push(callback(elem)); + } + + return mapped; + } + + const setObject: Set = new Set(); + const mapObject: Map = new Map(); + + mapIter(setObject, (value: string) => value.indexOf('Foo')); // number[] + + mapIter(mapObject, ([key, value]: [number, string]) => { + return key % 2 === 0 ? value : 'Odd'; + }); // string[] + ``` +
+ +- [`InstanceType`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1466-L1469) – Obtain the instance type of a constructor function type. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA) + + ```ts + class IdleService { + doNothing (): void {} + } + + class News { + title: string; + content: string; + + constructor(title: string, content: string) { + this.title = title; + this.content = content; + } + } + + const instanceCounter: Map = new Map(); + + interface Constructor { + new(...args: any[]): any; + } + + // Keep track how many instances of `Constr` constructor have been created. + function getInstance< + Constr extends Constructor, + Args extends ConstructorParameters + >(constructor: Constr, ...args: Args): InstanceType { + let count = instanceCounter.get(constructor) || 0; + + const instance = new constructor(...args); + + instanceCounter.set(constructor, count + 1); + + console.log(`Created ${count + 1} instances of ${Constr.name} class`); + + return instance; + } + + + const idleService = getInstance(IdleService); + // Will log: `Created 1 instances of IdleService class` + const newsEntry = getInstance(News, 'New ECMAScript proposals!', 'Last month...'); + // Will log: `Created 1 instances of News class` + ``` +
+ +- [`Omit`](https://github.com/microsoft/TypeScript/blob/71af02f7459dc812e85ac31365bfe23daf14b4e4/src/lib/es5.d.ts#L1446) – Constructs a type by picking all properties from T and then removing K. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgIImAWzgG2QbwChlks4BzCAVShwC5kBnMKUcgbmKYAcIFgIjBs1YgOXMpSFMWbANoBdTiW5woFddwAW0kfKWEAvoUIB6U8gDCUCHEiNkICAHdkYAJ69kz4GC3JcPG4oAHteKDABBxCYNAxsPFBIWEQUCAAPJG4wZABySUFcgJAAEzMLXNV1ck0dIuCw6EjBADpy5AB1FAQ4EGQAV0YUP2AHDy8wEOQbUugmBLwtEIA3OcmQnEjuZBgQqE7gAGtgZAhwKHdkHFGwNvGUdDIcAGUliIBJEF3kAF5kAHlML4ADyPBIAGjyBUYRQAPnkqho4NoYQA+TiEGD9EAISIhPozErQMG4AASK2gn2+AApek9pCSXm8wFSQooAJQMUkAFQAsgAZACiOAgmDOOSIJAQ+OYyGl4DgoDmf2QJRCCH6YvALQQNjsEGFovF1NyJWAy1y7OUyHMyE+yRAuFImG4Iq1YDswHxbRINjA-SgfXlHqVUE4xiAA) + + ```ts + interface Animal { + imageUrl: string; + species: string; + images: string[]; + paragraphs: string[]; + } + + // Creates new type with all properties of the `Animal` interface + // except 'images' and 'paragraphs' properties. We can use this + // type to render small hover tooltip for a wiki entry list. + type AnimalShortInfo = Omit; + + function renderAnimalHoverInfo (animals: AnimalShortInfo[]): HTMLElement { + const container = document.createElement('div'); + // Internal implementation. + return container; + } + ``` +
+ +You can find some examples in the [TypeScript docs](https://www.typescriptlang.org/docs/handbook/advanced-types.html#predefined-conditional-types). + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Jarek Radosz](https://github.com/CvX) +- [Dimitri Benin](https://github.com/BendingBender) +- [Pelle Wessman](https://github.com/voxpelli) + +## License + +(MIT OR CC0-1.0) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/tools/node_modules/eslint/node_modules/globals/package.json b/tools/node_modules/eslint/node_modules/globals/package.json index 1569748ef90c16..40f6e173930794 100644 --- a/tools/node_modules/eslint/node_modules/globals/package.json +++ b/tools/node_modules/eslint/node_modules/globals/package.json @@ -1,52 +1,64 @@ { - "name": "globals", - "version": "12.4.0", - "description": "Global identifiers from different JavaScript environments", - "license": "MIT", - "repository": "sindresorhus/globals", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js", - "index.d.ts", - "globals.json" - ], - "keywords": [ - "globals", - "global", - "identifiers", - "variables", - "vars", - "jshint", - "eslint", - "environments" - ], - "dependencies": { - "type-fest": "^0.8.1" - }, - "devDependencies": { - "ava": "^2.2.0", - "tsd": "^0.9.0", - "xo": "^0.25.3" - }, - "xo": { - "ignores": [ - "get-browser-globals.js" - ] - }, - "tsd": { - "compilerOptions": { - "resolveJsonModule": true - } - } -} + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/globals/issues" + }, + "bundleDependencies": false, + "dependencies": { + "type-fest": "^0.20.2" + }, + "deprecated": false, + "description": "Global identifiers from different JavaScript environments", + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.14.0", + "xo": "^0.36.1" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts", + "globals.json" + ], + "funding": "https://github.com/sponsors/sindresorhus", + "homepage": "https://github.com/sindresorhus/globals#readme", + "keywords": [ + "globals", + "global", + "identifiers", + "variables", + "vars", + "jshint", + "eslint", + "environments" + ], + "license": "MIT", + "name": "globals", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/globals.git" + }, + "scripts": { + "test": "xo && ava" + }, + "tsd": { + "compilerOptions": { + "resolveJsonModule": true + } + }, + "version": "13.6.0", + "xo": { + "ignores": [ + "get-browser-globals.js" + ], + "rules": { + "node/no-unsupported-features/es-syntax": "off" + } + } +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/globals/readme.md b/tools/node_modules/eslint/node_modules/globals/readme.md index fdcfa087ab1107..0ef22c30451630 100644 --- a/tools/node_modules/eslint/node_modules/globals/readme.md +++ b/tools/node_modules/eslint/node_modules/globals/readme.md @@ -1,12 +1,12 @@ -# globals [![Build Status](https://travis-ci.org/sindresorhus/globals.svg?branch=master)](https://travis-ci.org/sindresorhus/globals) +# globals > Global identifiers from different JavaScript environments -Extracted from [JSHint](https://github.com/jshint/jshint/blob/3a8efa979dbb157bfb5c10b5826603a55a33b9ad/src/vars.js) and [ESLint](https://github.com/eslint/eslint/blob/b648406218f8a2d7302b98f5565e23199f44eb31/conf/environments.json) and merged. +It's just a [JSON file](globals.json), so use it in any environment. -It's just a [JSON file](globals.json), so use it in whatever environment you like. +This package is used by ESLint. -**This module [no longer accepts](https://github.com/sindresorhus/globals/issues/82) new environments. If you need it for ESLint, just [create a plugin](http://eslint.org/docs/developer-guide/working-with-plugins#environments-in-plugins).** +**This package [no longer accepts](https://github.com/sindresorhus/globals/issues/82) new environments. If you need it for ESLint, just [create a plugin](http://eslint.org/docs/developer-guide/working-with-plugins#environments-in-plugins).** ## Install diff --git a/tools/node_modules/eslint/node_modules/has-flag/index.js b/tools/node_modules/eslint/node_modules/has-flag/index.js index b6f80b1f8ffd76..5139728fba6a26 100644 --- a/tools/node_modules/eslint/node_modules/has-flag/index.js +++ b/tools/node_modules/eslint/node_modules/has-flag/index.js @@ -1,8 +1,8 @@ 'use strict'; - -module.exports = (flag, argv = process.argv) => { +module.exports = (flag, argv) => { + argv = argv || process.argv; const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf('--'); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); + const pos = argv.indexOf(prefix + flag); + const terminatorPos = argv.indexOf('--'); + return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); }; diff --git a/tools/node_modules/eslint/node_modules/has-flag/package.json b/tools/node_modules/eslint/node_modules/has-flag/package.json index a9cba4b856d046..1903ff01cf6766 100644 --- a/tools/node_modules/eslint/node_modules/has-flag/package.json +++ b/tools/node_modules/eslint/node_modules/has-flag/package.json @@ -1,46 +1,53 @@ { - "name": "has-flag", - "version": "4.0.0", - "description": "Check if argv has a specific flag", - "license": "MIT", - "repository": "sindresorhus/has-flag", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "has", - "check", - "detect", - "contains", - "find", - "flag", - "cli", - "command-line", - "argv", - "process", - "arg", - "args", - "argument", - "arguments", - "getopt", - "minimist", - "optimist" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/has-flag/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if argv has a specific flag", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/has-flag#readme", + "keywords": [ + "has", + "check", + "detect", + "contains", + "find", + "flag", + "cli", + "command-line", + "argv", + "process", + "arg", + "args", + "argument", + "arguments", + "getopt", + "minimist", + "optimist" + ], + "license": "MIT", + "name": "has-flag", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/has-flag.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/has-flag/readme.md b/tools/node_modules/eslint/node_modules/has-flag/readme.md index 3f72dff29a6961..677893c278a2e3 100644 --- a/tools/node_modules/eslint/node_modules/has-flag/readme.md +++ b/tools/node_modules/eslint/node_modules/has-flag/readme.md @@ -4,20 +4,6 @@ Correctly stops looking after an `--` argument terminator. ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
- ---- - ## Install @@ -79,11 +65,6 @@ Default: `process.argv` CLI arguments. -## Security - -To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. - - ## License MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/tools/node_modules/eslint/node_modules/ignore/package.json b/tools/node_modules/eslint/node_modules/ignore/package.json index 8cb1b7873257b4..1c14f37a316960 100644 --- a/tools/node_modules/eslint/node_modules/ignore/package.json +++ b/tools/node_modules/eslint/node_modules/ignore/package.json @@ -1,28 +1,38 @@ { - "name": "ignore", - "version": "4.0.6", + "author": { + "name": "kael" + }, + "bugs": { + "url": "https://github.com/kaelzhang/node-ignore/issues" + }, + "bundleDependencies": false, + "deprecated": false, "description": "Ignore is a manager and filter for .gitignore rules.", + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-preset-env": "^1.7.0", + "codecov": "^3.0.4", + "eslint": "^5.3.0", + "eslint-config-ostai": "^1.3.2", + "eslint-plugin-import": "^2.13.0", + "mkdirp": "^0.5.1", + "pre-suf": "^1.1.0", + "rimraf": "^2.6.2", + "spawn-sync": "^2.0.0", + "tap": "^12.0.1", + "tmp": "0.0.33", + "typescript": "^3.0.1" + }, + "engines": { + "node": ">= 4" + }, "files": [ "legacy.js", "index.js", "index.d.ts", "LICENSE-MIT" ], - "scripts": { - "prepublish": "npm run build", - "build": "babel -o legacy.js index.js", - "test:lint": "eslint .", - "test:tsc": "tsc ./test/ts/simple.ts", - "test:git": "tap test/git-check-ignore.js", - "test:ignore": "tap test/ignore.js --coverage", - "test-no-cov": "npm run test:lint && npm run test:tsc && tap test/*.js --coverage", - "test": "npm run test-no-cov", - "posttest": "tap --coverage-report=html && codecov" - }, - "repository": { - "type": "git", - "url": "git@github.com:kaelzhang/node-ignore.git" - }, + "homepage": "https://github.com/kaelzhang/node-ignore#readme", "keywords": [ "ignore", ".gitignore", @@ -38,27 +48,22 @@ "asterisks", "regular-expression" ], - "author": "kael", "license": "MIT", - "bugs": { - "url": "https://github.com/kaelzhang/node-ignore/issues" + "name": "ignore", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/kaelzhang/node-ignore.git" }, - "devDependencies": { - "babel-cli": "^6.26.0", - "babel-preset-env": "^1.7.0", - "codecov": "^3.0.4", - "eslint": "^5.3.0", - "eslint-config-ostai": "^1.3.2", - "eslint-plugin-import": "^2.13.0", - "mkdirp": "^0.5.1", - "pre-suf": "^1.1.0", - "rimraf": "^2.6.2", - "spawn-sync": "^2.0.0", - "tap": "^12.0.1", - "tmp": "0.0.33", - "typescript": "^3.0.1" + "scripts": { + "build": "babel -o legacy.js index.js", + "posttest": "tap --coverage-report=html && codecov", + "prepublish": "npm run build", + "test": "npm run test-no-cov", + "test-no-cov": "npm run test:lint && npm run test:tsc && tap test/*.js --coverage", + "test:git": "tap test/git-check-ignore.js", + "test:ignore": "tap test/ignore.js --coverage", + "test:lint": "eslint .", + "test:tsc": "tsc ./test/ts/simple.ts" }, - "engines": { - "node": ">= 4" - } -} + "version": "4.0.6" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/import-fresh/package.json b/tools/node_modules/eslint/node_modules/import-fresh/package.json index 0c093620687612..5a30f8061505fc 100644 --- a/tools/node_modules/eslint/node_modules/import-fresh/package.json +++ b/tools/node_modules/eslint/node_modules/import-fresh/package.json @@ -1,43 +1,52 @@ { - "name": "import-fresh", - "version": "3.3.0", - "description": "Import a module while bypassing the cache", - "license": "MIT", - "repository": "sindresorhus/import-fresh", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "engines": { - "node": ">=6" - }, - "scripts": { - "test": "xo && ava && tsd", - "heapdump": "node heapdump.js" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "require", - "cache", - "uncache", - "uncached", - "module", - "fresh", - "bypass" - ], - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "devDependencies": { - "ava": "^1.0.1", - "heapdump": "^0.3.12", - "tsd": "^0.7.3", - "xo": "^0.23.0" - } -} + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/import-fresh/issues" + }, + "bundleDependencies": false, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "deprecated": false, + "description": "Import a module while bypassing the cache", + "devDependencies": { + "ava": "^1.0.1", + "heapdump": "^0.3.12", + "tsd": "^0.7.3", + "xo": "^0.23.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "funding": "https://github.com/sponsors/sindresorhus", + "homepage": "https://github.com/sindresorhus/import-fresh#readme", + "keywords": [ + "require", + "cache", + "uncache", + "uncached", + "module", + "fresh", + "bypass" + ], + "license": "MIT", + "name": "import-fresh", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/import-fresh.git" + }, + "scripts": { + "heapdump": "node heapdump.js", + "test": "xo && ava && tsd" + }, + "version": "3.3.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/imurmurhash/package.json b/tools/node_modules/eslint/node_modules/imurmurhash/package.json index 8a93edb55a2245..b07b2935ed7a79 100644 --- a/tools/node_modules/eslint/node_modules/imurmurhash/package.json +++ b/tools/node_modules/eslint/node_modules/imurmurhash/package.json @@ -1,22 +1,27 @@ { - "name": "imurmurhash", - "version": "0.1.4", + "author": { + "name": "Jens Taylor", + "email": "jensyt@gmail.com", + "url": "https://github.com/homebrewing" + }, + "bugs": { + "url": "https://github.com/jensyt/imurmurhash-js/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, "description": "An incremental implementation of MurmurHash3", - "homepage": "https://github.com/jensyt/imurmurhash-js", - "main": "imurmurhash.js", + "devDependencies": {}, + "engines": { + "node": ">=0.8.19" + }, "files": [ "imurmurhash.js", "imurmurhash.min.js", "package.json", "README.md" ], - "repository": { - "type": "git", - "url": "https://github.com/jensyt/imurmurhash-js" - }, - "bugs": { - "url": "https://github.com/jensyt/imurmurhash-js/issues" - }, + "homepage": "https://github.com/jensyt/imurmurhash-js", "keywords": [ "murmur", "murmurhash", @@ -24,17 +29,12 @@ "hash", "incremental" ], - "author": { - "name": "Jens Taylor", - "email": "jensyt@gmail.com", - "url": "https://github.com/homebrewing" - }, "license": "MIT", - "dependencies": { - }, - "devDependencies": { + "main": "imurmurhash.js", + "name": "imurmurhash", + "repository": { + "type": "git", + "url": "git+https://github.com/jensyt/imurmurhash-js.git" }, - "engines": { - "node": ">=0.8.19" - } -} + "version": "0.1.4" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/inflight/package.json b/tools/node_modules/eslint/node_modules/inflight/package.json index 6084d3509a5d6d..c5576ffbad6ee6 100644 --- a/tools/node_modules/eslint/node_modules/inflight/package.json +++ b/tools/node_modules/eslint/node_modules/inflight/package.json @@ -1,29 +1,35 @@ { - "name": "inflight", - "version": "1.0.6", - "description": "Add callbacks to requests in flight to avoid async duplication", - "main": "inflight.js", - "files": [ - "inflight.js" - ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/inflight/issues" + }, + "bundleDependencies": false, "dependencies": { "once": "^1.3.0", "wrappy": "1" }, + "deprecated": false, + "description": "Add callbacks to requests in flight to avoid async duplication", "devDependencies": { "tap": "^7.1.2" }, - "scripts": { - "test": "tap test.js --100" - }, + "files": [ + "inflight.js" + ], + "homepage": "https://github.com/isaacs/inflight", + "license": "ISC", + "main": "inflight.js", + "name": "inflight", "repository": { "type": "git", - "url": "https://github.com/npm/inflight.git" + "url": "git+https://github.com/npm/inflight.git" }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "bugs": { - "url": "https://github.com/isaacs/inflight/issues" + "scripts": { + "test": "tap test.js --100" }, - "homepage": "https://github.com/isaacs/inflight", - "license": "ISC" -} + "version": "1.0.6" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/inherits/package.json b/tools/node_modules/eslint/node_modules/inherits/package.json index 37b4366b83e63e..9642125b71d65f 100644 --- a/tools/node_modules/eslint/node_modules/inherits/package.json +++ b/tools/node_modules/eslint/node_modules/inherits/package.json @@ -1,7 +1,19 @@ { - "name": "inherits", + "browser": "./inherits_browser.js", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "bundleDependencies": false, + "deprecated": false, "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", - "version": "2.0.4", + "devDependencies": { + "tap": "^14.2.4" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ], + "homepage": "https://github.com/isaacs/inherits#readme", "keywords": [ "inheritance", "class", @@ -12,18 +24,15 @@ "browser", "browserify" ], - "main": "./inherits.js", - "browser": "./inherits_browser.js", - "repository": "git://github.com/isaacs/inherits", "license": "ISC", + "main": "./inherits.js", + "name": "inherits", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits.git" + }, "scripts": { "test": "tap" }, - "devDependencies": { - "tap": "^14.2.4" - }, - "files": [ - "inherits.js", - "inherits_browser.js" - ] -} + "version": "2.0.4" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/is-extglob/package.json b/tools/node_modules/eslint/node_modules/is-extglob/package.json index 7a908369d39f55..3ae794888e29c7 100644 --- a/tools/node_modules/eslint/node_modules/is-extglob/package.json +++ b/tools/node_modules/eslint/node_modules/is-extglob/package.json @@ -1,28 +1,25 @@ { - "name": "is-extglob", - "description": "Returns true if a string has an extglob.", - "version": "2.1.1", - "homepage": "https://github.com/jonschlinkert/is-extglob", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "repository": "jonschlinkert/is-extglob", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, "bugs": { "url": "https://github.com/jonschlinkert/is-extglob/issues" }, - "license": "MIT", - "files": [ - "index.js" - ], - "main": "index.js", - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha" - }, + "bundleDependencies": false, + "deprecated": false, + "description": "Returns true if a string has an extglob.", "devDependencies": { "gulp-format-md": "^0.1.10", "mocha": "^3.0.2" }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-extglob", "keywords": [ "bash", "braces", @@ -42,6 +39,16 @@ "string", "test" ], + "license": "MIT", + "main": "index.js", + "name": "is-extglob", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-extglob.git" + }, + "scripts": { + "test": "mocha" + }, "verb": { "toc": false, "layout": "default", @@ -65,5 +72,6 @@ "lint": { "reflinks": true } - } -} + }, + "version": "2.1.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/package.json b/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/package.json index 2137e888fa503d..c556c1c78dd459 100644 --- a/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/package.json +++ b/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/package.json @@ -1,42 +1,51 @@ { - "name": "is-fullwidth-code-point", - "version": "3.0.0", - "description": "Check if the character represented by a given Unicode code point is fullwidth", - "license": "MIT", - "repository": "sindresorhus/is-fullwidth-code-point", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd-check" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "fullwidth", - "full-width", - "full", - "width", - "unicode", - "character", - "string", - "codepoint", - "code", - "point", - "is", - "detect", - "check" - ], - "devDependencies": { - "ava": "^1.3.1", - "tsd-check": "^0.5.0", - "xo": "^0.24.0" - } -} + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "devDependencies": { + "ava": "^1.3.1", + "tsd-check": "^0.5.0", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "string", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "license": "MIT", + "name": "is-fullwidth-code-point", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" + }, + "scripts": { + "test": "xo && ava && tsd-check" + }, + "version": "3.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/is-glob/package.json b/tools/node_modules/eslint/node_modules/is-glob/package.json index 806000dbdafcc7..d8973094f63003 100644 --- a/tools/node_modules/eslint/node_modules/is-glob/package.json +++ b/tools/node_modules/eslint/node_modules/is-glob/package.json @@ -1,36 +1,42 @@ { - "name": "is-glob", - "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.", - "version": "4.0.1", - "homepage": "https://github.com/micromatch/is-glob", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Brian Woodward (https://twitter.com/doowb)", - "Daniel Perez (https://tuvistavie.com)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)" - ], - "repository": "micromatch/is-glob", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, "bugs": { "url": "https://github.com/micromatch/is-glob/issues" }, - "license": "MIT", - "files": [ - "index.js" + "bundleDependencies": false, + "contributors": [ + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Daniel Perez", + "url": "https://tuvistavie.com" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + } ], - "main": "index.js", - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha" - }, "dependencies": { "is-extglob": "^2.1.1" }, + "deprecated": false, + "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.", "devDependencies": { "gulp-format-md": "^0.1.10", "mocha": "^3.0.2" }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/micromatch/is-glob", "keywords": [ "bash", "braces", @@ -50,6 +56,16 @@ "string", "test" ], + "license": "MIT", + "main": "index.js", + "name": "is-glob", + "repository": { + "type": "git", + "url": "git+https://github.com/micromatch/is-glob.git" + }, + "scripts": { + "test": "mocha" + }, "verb": { "layout": "default", "plugins": [ @@ -77,5 +93,6 @@ "verb", "vinyl" ] - } -} + }, + "version": "4.0.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/isexe/package.json b/tools/node_modules/eslint/node_modules/isexe/package.json index e452689442f201..6403682bbe2c80 100644 --- a/tools/node_modules/eslint/node_modules/isexe/package.json +++ b/tools/node_modules/eslint/node_modules/isexe/package.json @@ -1,31 +1,37 @@ { - "name": "isexe", - "version": "2.0.0", - "description": "Minimal module to check if a file is executable.", - "main": "index.js", - "directories": { - "test": "test" + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/isexe/issues" }, + "bundleDependencies": false, + "deprecated": false, + "description": "Minimal module to check if a file is executable.", "devDependencies": { "mkdirp": "^0.5.1", "rimraf": "^2.5.0", "tap": "^10.3.0" }, - "scripts": { - "test": "tap test/*.js --100", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --all; git push origin --tags" + "directories": { + "test": "test" }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "homepage": "https://github.com/isaacs/isexe#readme", + "keywords": [], "license": "ISC", + "main": "index.js", + "name": "isexe", "repository": { "type": "git", "url": "git+https://github.com/isaacs/isexe.git" }, - "keywords": [], - "bugs": { - "url": "https://github.com/isaacs/isexe/issues" + "scripts": { + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap test/*.js --100" }, - "homepage": "https://github.com/isaacs/isexe#readme" -} + "version": "2.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/js-tokens/package.json b/tools/node_modules/eslint/node_modules/js-tokens/package.json index 66752fab275101..ccfb4ef3dc3100 100644 --- a/tools/node_modules/eslint/node_modules/js-tokens/package.json +++ b/tools/node_modules/eslint/node_modules/js-tokens/package.json @@ -1,9 +1,23 @@ { - "name": "js-tokens", - "version": "4.0.0", - "author": "Simon Lydell", - "license": "MIT", + "author": { + "name": "Simon Lydell" + }, + "bugs": { + "url": "https://github.com/lydell/js-tokens/issues" + }, + "bundleDependencies": false, + "deprecated": false, "description": "A regex that tokenizes JavaScript.", + "devDependencies": { + "coffeescript": "2.1.1", + "esprima": "4.0.0", + "everything.js": "1.0.3", + "mocha": "5.0.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/lydell/js-tokens#readme", "keywords": [ "JavaScript", "js", @@ -11,20 +25,17 @@ "tokenize", "regex" ], - "files": [ - "index.js" - ], - "repository": "lydell/js-tokens", + "license": "MIT", + "name": "js-tokens", + "repository": { + "type": "git", + "url": "git+https://github.com/lydell/js-tokens.git" + }, "scripts": { - "test": "mocha --ui tdd", - "esprima-compare": "node esprima-compare ./index.js everything.js/es5.js", "build": "node generate-index.js", - "dev": "npm run build && npm test" + "dev": "npm run build && npm test", + "esprima-compare": "node esprima-compare ./index.js everything.js/es5.js", + "test": "mocha --ui tdd" }, - "devDependencies": { - "coffeescript": "2.1.1", - "esprima": "4.0.0", - "everything.js": "1.0.3", - "mocha": "5.0.0" - } -} + "version": "4.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/js-yaml/package.json b/tools/node_modules/eslint/node_modules/js-yaml/package.json index 0d2366762c5448..6f63d1aed92082 100644 --- a/tools/node_modules/eslint/node_modules/js-yaml/package.json +++ b/tools/node_modules/eslint/node_modules/js-yaml/package.json @@ -1,37 +1,38 @@ { - "name": "js-yaml", - "version": "3.14.1", - "description": "YAML 1.2 parser and serializer", - "keywords": [ - "yaml", - "parser", - "serializer", - "pyyaml" - ], - "homepage": "https://github.com/nodeca/js-yaml", - "author": "Vladimir Zapparov ", - "contributors": [ - "Aleksey V Zapparov (http://www.ixti.net/)", - "Vitaly Puzrin (https://github.com/puzrin)", - "Martin Grenfell (http://got-ravings.blogspot.com)" - ], - "license": "MIT", - "repository": "nodeca/js-yaml", - "files": [ - "index.js", - "lib/", - "bin/", - "dist/" - ], + "author": { + "name": "Vladimir Zapparov", + "email": "dervus.grim@gmail.com" + }, "bin": { "js-yaml": "bin/js-yaml.js" }, - "unpkg": "dist/js-yaml.min.js", - "jsdelivr": "dist/js-yaml.min.js", + "bugs": { + "url": "https://github.com/nodeca/js-yaml/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Aleksey V Zapparov", + "email": "ixti@member.fsf.org", + "url": "http://www.ixti.net/" + }, + { + "name": "Vitaly Puzrin", + "email": "vitaly@rcdesign.ru", + "url": "https://github.com/puzrin" + }, + { + "name": "Martin Grenfell", + "email": "martin.grenfell@gmail.com", + "url": "http://got-ravings.blogspot.com" + } + ], "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" }, + "deprecated": false, + "description": "YAML 1.2 parser and serializer", "devDependencies": { "ansi": "^0.3.1", "benchmark": "^2.1.4", @@ -43,7 +44,29 @@ "mocha": "^7.1.2", "uglify-js": "^3.0.1" }, + "files": [ + "index.js", + "lib/", + "bin/", + "dist/" + ], + "homepage": "https://github.com/nodeca/js-yaml", + "jsdelivr": "dist/js-yaml.min.js", + "keywords": [ + "yaml", + "parser", + "serializer", + "pyyaml" + ], + "license": "MIT", + "name": "js-yaml", + "repository": { + "type": "git", + "url": "git+https://github.com/nodeca/js-yaml.git" + }, "scripts": { "test": "make test" - } -} + }, + "unpkg": "dist/js-yaml.min.js", + "version": "3.14.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/json-schema-traverse/package.json b/tools/node_modules/eslint/node_modules/json-schema-traverse/package.json index 156606327babdd..d5060aff01fbf6 100644 --- a/tools/node_modules/eslint/node_modules/json-schema-traverse/package.json +++ b/tools/node_modules/eslint/node_modules/json-schema-traverse/package.json @@ -1,28 +1,13 @@ { - "name": "json-schema-traverse", - "version": "0.4.1", - "description": "Traverse JSON Schema passing each schema object to callback", - "main": "index.js", - "scripts": { - "eslint": "eslint index.js spec", - "test-spec": "mocha spec -R spec", - "test": "npm run eslint && nyc npm run test-spec" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/epoberezkin/json-schema-traverse.git" + "author": { + "name": "Evgeny Poberezkin" }, - "keywords": [ - "JSON-Schema", - "traverse", - "iterate" - ], - "author": "Evgeny Poberezkin", - "license": "MIT", "bugs": { "url": "https://github.com/epoberezkin/json-schema-traverse/issues" }, - "homepage": "https://github.com/epoberezkin/json-schema-traverse#readme", + "bundleDependencies": false, + "deprecated": false, + "description": "Traverse JSON Schema passing each schema object to callback", "devDependencies": { "coveralls": "^2.13.1", "eslint": "^3.19.0", @@ -30,6 +15,15 @@ "nyc": "^11.0.2", "pre-commit": "^1.2.2" }, + "homepage": "https://github.com/epoberezkin/json-schema-traverse#readme", + "keywords": [ + "JSON-Schema", + "traverse", + "iterate" + ], + "license": "MIT", + "main": "index.js", + "name": "json-schema-traverse", "nyc": { "exclude": [ "**/spec/**", @@ -39,5 +33,15 @@ "lcov", "text-summary" ] - } -} + }, + "repository": { + "type": "git", + "url": "git+https://github.com/epoberezkin/json-schema-traverse.git" + }, + "scripts": { + "eslint": "eslint index.js spec", + "test": "npm run eslint && nyc npm run test-spec", + "test-spec": "mocha spec -R spec" + }, + "version": "0.4.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/json-stable-stringify-without-jsonify/package.json b/tools/node_modules/eslint/node_modules/json-stable-stringify-without-jsonify/package.json index c59c87edbe0b5c..8cc2f1397506e7 100644 --- a/tools/node_modules/eslint/node_modules/json-stable-stringify-without-jsonify/package.json +++ b/tools/node_modules/eslint/node_modules/json-stable-stringify-without-jsonify/package.json @@ -1,13 +1,35 @@ { - "name": "json-stable-stringify-without-jsonify", - "version": "1.0.1", - "description": "deterministic JSON.stringify() with custom sorting to get deterministic hashes from stringified results, with no public domain dependencies", - "main": "index.js", - "dependencies": { + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/samn/json-stable-stringify/issues" }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "deterministic JSON.stringify() with custom sorting to get deterministic hashes from stringified results, with no public domain dependencies", "devDependencies": { "tape": "~1.0.4" }, + "homepage": "https://github.com/samn/json-stable-stringify", + "keywords": [ + "json", + "stringify", + "deterministic", + "hash", + "sort", + "stable" + ], + "license": "MIT", + "main": "index.js", + "name": "json-stable-stringify-without-jsonify", + "repository": { + "type": "git", + "url": "git://github.com/samn/json-stable-stringify.git" + }, "scripts": { "test": "tape test/*.js" }, @@ -15,29 +37,13 @@ "files": "test/*.js", "browsers": [ "ie/8..latest", - "ff/5", "ff/latest", - "chrome/15", "chrome/latest", + "ff/5", + "ff/latest", + "chrome/15", + "chrome/latest", "safari/latest", "opera/latest" ] }, - "repository": { - "type": "git", - "url": "git://github.com/samn/json-stable-stringify.git" - }, - "homepage": "https://github.com/samn/json-stable-stringify", - "keywords": [ - "json", - "stringify", - "deterministic", - "hash", - "sort", - "stable" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "license": "MIT" -} + "version": "1.0.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/levn/package.json b/tools/node_modules/eslint/node_modules/levn/package.json index 0c356d6978eef0..a9868ae5880948 100644 --- a/tools/node_modules/eslint/node_modules/levn/package.json +++ b/tools/node_modules/eslint/node_modules/levn/package.json @@ -1,8 +1,30 @@ { - "name": "levn", - "version": "0.4.1", - "author": "George Zahariev ", + "author": { + "name": "George Zahariev", + "email": "z@georgezahariev.com" + }, + "bugs": { + "url": "https://github.com/gkz/levn/issues" + }, + "bundleDependencies": false, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "deprecated": false, "description": "Light ECMAScript (JavaScript) Value Notation - human written, concise, typed, flexible", + "devDependencies": { + "livescript": "^1.6.0", + "mocha": "^7.1.1" + }, + "engines": { + "node": ">= 0.8.0" + }, + "files": [ + "lib", + "README.md", + "LICENSE" + ], "homepage": "https://github.com/gkz/levn", "keywords": [ "levn", @@ -17,17 +39,9 @@ "typed", "flexible" ], - "files": [ - "lib", - "README.md", - "LICENSE" - ], - "main": "./lib/", - "bugs": "https://github.com/gkz/levn/issues", "license": "MIT", - "engines": { - "node": ">= 0.8.0" - }, + "main": "./lib/", + "name": "levn", "repository": { "type": "git", "url": "git://github.com/gkz/levn.git" @@ -35,12 +49,5 @@ "scripts": { "test": "make test" }, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "devDependencies": { - "livescript": "^1.6.0", - "mocha": "^7.1.1" - } -} + "version": "0.4.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/lodash/package.json b/tools/node_modules/eslint/node_modules/lodash/package.json index b35fd95cc7aa28..e5fe5bf3f4e308 100644 --- a/tools/node_modules/eslint/node_modules/lodash/package.json +++ b/tools/node_modules/eslint/node_modules/lodash/package.json @@ -1,17 +1,40 @@ { - "name": "lodash", - "version": "4.17.21", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be" + } + ], + "deprecated": false, "description": "Lodash modular utilities.", - "keywords": "modules, stdlib, util", "homepage": "https://lodash.com/", - "repository": "lodash/lodash", "icon": "https://lodash.com/icon.svg", + "keywords": [ + "modules", + "stdlib", + "util" + ], "license": "MIT", "main": "lodash.js", - "author": "John-David Dalton ", - "contributors": [ - "John-David Dalton ", - "Mathias Bynens " - ], - "scripts": { "test": "echo \"See https://travis-ci.org/lodash-archive/lodash-cli for testing details.\"" } -} + "name": "lodash", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash-archive/lodash-cli for testing details.\"" + }, + "version": "4.17.21" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/lru-cache/package.json b/tools/node_modules/eslint/node_modules/lru-cache/package.json index 43b7502c3e7c79..a7a6da707b62fe 100644 --- a/tools/node_modules/eslint/node_modules/lru-cache/package.json +++ b/tools/node_modules/eslint/node_modules/lru-cache/package.json @@ -1,34 +1,46 @@ { - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "6.0.0", - "author": "Isaac Z. Schlueter ", - "keywords": [ - "mru", - "lru", - "cache" - ], - "scripts": { - "test": "tap", - "snap": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags" + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me" }, - "main": "index.js", - "repository": "git://github.com/isaacs/node-lru-cache.git", + "bugs": { + "url": "https://github.com/isaacs/node-lru-cache/issues" + }, + "bundleDependencies": false, + "dependencies": { + "yallist": "^4.0.0" + }, + "deprecated": false, + "description": "A cache object that deletes the least-recently-used items.", "devDependencies": { "benchmark": "^2.1.4", "tap": "^14.10.7" }, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" + "engines": { + "node": ">=10" }, "files": [ "index.js" ], - "engines": { - "node": ">=10" - } -} + "homepage": "https://github.com/isaacs/node-lru-cache#readme", + "keywords": [ + "mru", + "lru", + "cache" + ], + "license": "ISC", + "main": "index.js", + "name": "lru-cache", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-lru-cache.git" + }, + "scripts": { + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "preversion": "npm test", + "snap": "tap", + "test": "tap" + }, + "version": "6.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/minimatch/package.json b/tools/node_modules/eslint/node_modules/minimatch/package.json index c4514c807776de..3cd0d037a03d23 100644 --- a/tools/node_modules/eslint/node_modules/minimatch/package.json +++ b/tools/node_modules/eslint/node_modules/minimatch/package.json @@ -1,30 +1,40 @@ { - "author": "Isaac Z. Schlueter (http://blog.izs.me)", - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "3.0.4", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "test": "tap test/*.js --cov", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --all; git push origin --tags" + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" }, - "engines": { - "node": "*" + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" }, + "bundleDependencies": false, "dependencies": { "brace-expansion": "^1.1.7" }, + "deprecated": false, + "description": "a glob matcher in javascript", "devDependencies": { "tap": "^10.3.2" }, - "license": "ISC", + "engines": { + "node": "*" + }, "files": [ "minimatch.js" - ] -} + ], + "homepage": "https://github.com/isaacs/minimatch#readme", + "license": "ISC", + "main": "minimatch.js", + "name": "minimatch", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "scripts": { + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap test/*.js --cov" + }, + "version": "3.0.4" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/ms/package.json b/tools/node_modules/eslint/node_modules/ms/package.json index eea666e1fb03d6..7192a30c57c910 100644 --- a/tools/node_modules/eslint/node_modules/ms/package.json +++ b/tools/node_modules/eslint/node_modules/ms/package.json @@ -1,16 +1,16 @@ { - "name": "ms", - "version": "2.1.2", + "bugs": { + "url": "https://github.com/zeit/ms/issues" + }, + "bundleDependencies": false, + "deprecated": false, "description": "Tiny millisecond conversion utility", - "repository": "zeit/ms", - "main": "./index", - "files": [ - "index.js" - ], - "scripts": { - "precommit": "lint-staged", - "lint": "eslint lib/* bin/*", - "test": "mocha tests.js" + "devDependencies": { + "eslint": "4.12.1", + "expect.js": "0.3.1", + "husky": "0.14.3", + "lint-staged": "5.0.0", + "mocha": "4.0.1" }, "eslintConfig": { "extends": "eslint:recommended", @@ -19,6 +19,11 @@ "es6": true } }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/zeit/ms#readme", + "license": "MIT", "lint-staged": { "*.js": [ "npm run lint", @@ -26,12 +31,16 @@ "git add" ] }, - "license": "MIT", - "devDependencies": { - "eslint": "4.12.1", - "expect.js": "0.3.1", - "husky": "0.14.3", - "lint-staged": "5.0.0", - "mocha": "4.0.1" - } -} + "main": "./index", + "name": "ms", + "repository": { + "type": "git", + "url": "git+https://github.com/zeit/ms.git" + }, + "scripts": { + "lint": "eslint lib/* bin/*", + "precommit": "lint-staged", + "test": "mocha tests.js" + }, + "version": "2.1.2" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/natural-compare/package.json b/tools/node_modules/eslint/node_modules/natural-compare/package.json index 1a71362eea81a2..af8b2be0162cc8 100644 --- a/tools/node_modules/eslint/node_modules/natural-compare/package.json +++ b/tools/node_modules/eslint/node_modules/natural-compare/package.json @@ -1,10 +1,28 @@ { - "name": "natural-compare", - "version": "1.4.0", - "stability": 3, - "author": "Lauri Rooden (https://github.com/litejs/natural-compare-lite)", - "license": "MIT", + "author": { + "name": "Lauri Rooden", + "url": "https://github.com/litejs/natural-compare-lite" + }, + "bugs": { + "url": "https://github.com/litejs/natural-compare-lite/issues" + }, + "buildman": { + "dist/index-min.js": { + "banner": "/*! litejs.com/MIT-LICENSE.txt */", + "input": "index.js" + } + }, + "bundleDependencies": false, + "deprecated": false, "description": "Compare strings containing a mix of letters and numbers in the way a human being would in sort order.", + "devDependencies": { + "buildman": "*", + "testman": "*" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/litejs/natural-compare-lite#readme", "keywords": [ "string", "natural", @@ -16,27 +34,17 @@ "alphanum", "litejs" ], + "license": "MIT", "main": "index.js", - "readmeFilename": "README.md", - "files": [ - "index.js" - ], + "name": "natural-compare", + "repository": { + "type": "git", + "url": "git://github.com/litejs/natural-compare-lite.git" + }, "scripts": { "build": "node node_modules/buildman/index.js --all", "test": "node tests/index.js" }, - "repository": "git://github.com/litejs/natural-compare-lite.git", - "bugs": { - "url": "https://github.com/litejs/natural-compare-lite/issues" - }, - "devDependencies": { - "buildman": "*", - "testman": "*" - }, - "buildman": { - "dist/index-min.js": { - "banner": "/*! litejs.com/MIT-LICENSE.txt */", - "input": "index.js" - } - } -} + "stability": 3, + "version": "1.4.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/once/package.json b/tools/node_modules/eslint/node_modules/once/package.json index 16815b2fa11193..8635367075655a 100644 --- a/tools/node_modules/eslint/node_modules/once/package.json +++ b/tools/node_modules/eslint/node_modules/once/package.json @@ -1,33 +1,43 @@ { - "name": "once", - "version": "1.4.0", - "description": "Run a function exactly one time", - "main": "once.js", - "directories": { - "test": "test" + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/once/issues" }, + "bundleDependencies": false, "dependencies": { "wrappy": "1" }, + "deprecated": false, + "description": "Run a function exactly one time", "devDependencies": { "tap": "^7.0.1" }, - "scripts": { - "test": "tap test/*.js" + "directories": { + "test": "test" }, "files": [ "once.js" ], - "repository": { - "type": "git", - "url": "git://github.com/isaacs/once" - }, + "homepage": "https://github.com/isaacs/once#readme", "keywords": [ "once", "function", "one", "single" ], - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC" -} + "license": "ISC", + "main": "once.js", + "name": "once", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/once.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.4.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/optionator/package.json b/tools/node_modules/eslint/node_modules/optionator/package.json index 83fb1c2c930a47..b76e0b4f4c532d 100644 --- a/tools/node_modules/eslint/node_modules/optionator/package.json +++ b/tools/node_modules/eslint/node_modules/optionator/package.json @@ -1,8 +1,34 @@ { - "name": "optionator", - "version": "0.9.1", - "author": "George Zahariev ", + "author": { + "name": "George Zahariev", + "email": "z@georgezahariev.com" + }, + "bugs": { + "url": "https://github.com/gkz/optionator/issues" + }, + "bundleDependencies": false, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "deprecated": false, "description": "option parsing and help generation", + "devDependencies": { + "livescript": "^1.6.0", + "mocha": "^7.1.1" + }, + "engines": { + "node": ">= 0.8.0" + }, + "files": [ + "lib", + "README.md", + "LICENSE" + ], "homepage": "https://github.com/gkz/optionator", "keywords": [ "options", @@ -10,17 +36,9 @@ "option parsing", "cli" ], - "files": [ - "lib", - "README.md", - "LICENSE" - ], - "main": "./lib/", - "bugs": "https://github.com/gkz/optionator/issues", "license": "MIT", - "engines": { - "node": ">= 0.8.0" - }, + "main": "./lib/", + "name": "optionator", "repository": { "type": "git", "url": "git://github.com/gkz/optionator.git" @@ -28,16 +46,5 @@ "scripts": { "test": "make test" }, - "dependencies": { - "prelude-ls": "^1.2.1", - "deep-is": "^0.1.3", - "word-wrap": "^1.2.3", - "type-check": "^0.4.0", - "levn": "^0.4.1", - "fast-levenshtein": "^2.0.6" - }, - "devDependencies": { - "livescript": "^1.6.0", - "mocha": "^7.1.1" - } -} + "version": "0.9.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/parent-module/package.json b/tools/node_modules/eslint/node_modules/parent-module/package.json index 790333d0b1a659..1f5b6cb1757a63 100644 --- a/tools/node_modules/eslint/node_modules/parent-module/package.json +++ b/tools/node_modules/eslint/node_modules/parent-module/package.json @@ -1,46 +1,55 @@ { - "name": "parent-module", - "version": "1.0.1", - "description": "Get the path of the parent module", - "license": "MIT", - "repository": "sindresorhus/parent-module", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=6" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "parent", - "module", - "package", - "pkg", - "caller", - "calling", - "module", - "path", - "callsites", - "callsite", - "stacktrace", - "stack", - "trace", - "function", - "file" - ], - "dependencies": { - "callsites": "^3.0.0" - }, - "devDependencies": { - "ava": "^1.4.1", - "execa": "^1.0.0", - "xo": "^0.24.0" - } -} + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/parent-module/issues" + }, + "bundleDependencies": false, + "dependencies": { + "callsites": "^3.0.0" + }, + "deprecated": false, + "description": "Get the path of the parent module", + "devDependencies": { + "ava": "^1.4.1", + "execa": "^1.0.0", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/parent-module#readme", + "keywords": [ + "parent", + "module", + "package", + "pkg", + "caller", + "calling", + "module", + "path", + "callsites", + "callsite", + "stacktrace", + "stack", + "trace", + "function", + "file" + ], + "license": "MIT", + "name": "parent-module", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/parent-module.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/path-is-absolute/package.json b/tools/node_modules/eslint/node_modules/path-is-absolute/package.json index 91196d5e9c1336..9280158131fa5a 100644 --- a/tools/node_modules/eslint/node_modules/path-is-absolute/package.json +++ b/tools/node_modules/eslint/node_modules/path-is-absolute/package.json @@ -1,23 +1,25 @@ { - "name": "path-is-absolute", - "version": "1.0.1", - "description": "Node.js 0.12 path.isAbsolute() ponyfill", - "license": "MIT", - "repository": "sindresorhus/path-is-absolute", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, + "bugs": { + "url": "https://github.com/sindresorhus/path-is-absolute/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Node.js 0.12 path.isAbsolute() ponyfill", + "devDependencies": { + "xo": "^0.16.0" + }, "engines": { "node": ">=0.10.0" }, - "scripts": { - "test": "xo && node test.js" - }, "files": [ "index.js" ], + "homepage": "https://github.com/sindresorhus/path-is-absolute#readme", "keywords": [ "path", "paths", @@ -37,7 +39,14 @@ "detect", "check" ], - "devDependencies": { - "xo": "^0.16.0" - } -} + "license": "MIT", + "name": "path-is-absolute", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-is-absolute.git" + }, + "scripts": { + "test": "xo && node test.js" + }, + "version": "1.0.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/path-key/package.json b/tools/node_modules/eslint/node_modules/path-key/package.json index c8cbd383afc955..7c2ea096485043 100644 --- a/tools/node_modules/eslint/node_modules/path-key/package.json +++ b/tools/node_modules/eslint/node_modules/path-key/package.json @@ -1,39 +1,48 @@ { - "name": "path-key", - "version": "3.1.1", - "description": "Get the PATH environment variable key cross-platform", - "license": "MIT", - "repository": "sindresorhus/path-key", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "path", - "key", - "environment", - "env", - "variable", - "var", - "get", - "cross-platform", - "windows" - ], - "devDependencies": { - "@types/node": "^11.13.0", - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/path-key/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Get the PATH environment variable key cross-platform", + "devDependencies": { + "@types/node": "^11.13.0", + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/sindresorhus/path-key#readme", + "keywords": [ + "path", + "key", + "environment", + "env", + "variable", + "var", + "get", + "cross-platform", + "windows" + ], + "license": "MIT", + "name": "path-key", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-key.git" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "version": "3.1.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/prelude-ls/package.json b/tools/node_modules/eslint/node_modules/prelude-ls/package.json index c313c3da34a9dc..ff1fcd6e1a8b50 100644 --- a/tools/node_modules/eslint/node_modules/prelude-ls/package.json +++ b/tools/node_modules/eslint/node_modules/prelude-ls/package.json @@ -1,8 +1,30 @@ { - "name": "prelude-ls", - "version": "1.2.1", - "author": "George Zahariev ", + "author": { + "name": "George Zahariev", + "email": "z@georgezahariev.com" + }, + "bugs": { + "url": "https://github.com/gkz/prelude-ls/issues" + }, + "bundleDependencies": false, + "deprecated": false, "description": "prelude.ls is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript.", + "devDependencies": { + "browserify": "^16.5.1", + "livescript": "^1.6.0", + "mocha": "^7.1.1", + "sinon": "~8.0.1", + "uglify-js": "^3.8.1" + }, + "engines": { + "node": ">= 0.8.0" + }, + "files": [ + "lib/", + "README.md", + "LICENSE" + ], + "homepage": "http://preludels.com", "keywords": [ "prelude", "livescript", @@ -17,18 +39,9 @@ "object", "string" ], - "main": "lib/", - "files": [ - "lib/", - "README.md", - "LICENSE" - ], - "homepage": "http://preludels.com", - "bugs": "https://github.com/gkz/prelude-ls/issues", "license": "MIT", - "engines": { - "node": ">= 0.8.0" - }, + "main": "lib/", + "name": "prelude-ls", "repository": { "type": "git", "url": "git://github.com/gkz/prelude-ls.git" @@ -36,11 +49,5 @@ "scripts": { "test": "make test" }, - "devDependencies": { - "livescript": "^1.6.0", - "uglify-js": "^3.8.1", - "mocha": "^7.1.1", - "browserify": "^16.5.1", - "sinon": "~8.0.1" - } -} + "version": "1.2.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/progress/package.json b/tools/node_modules/eslint/node_modules/progress/package.json index bb81fa0bcd2b1d..64511f8344114f 100644 --- a/tools/node_modules/eslint/node_modules/progress/package.json +++ b/tools/node_modules/eslint/node_modules/progress/package.json @@ -1,26 +1,47 @@ { - "name": "progress", - "version": "2.0.3", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "bugs": { + "url": "https://github.com/visionmedia/node-progress/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Christoffer Hallas", + "email": "christoffer.hallas@gmail.com" + }, + { + "name": "Jordan Scales", + "email": "scalesjordan@gmail.com" + }, + { + "name": "Andrew Rhyne", + "email": "rhyneandrew@gmail.com" + }, + { + "name": "Marco Brack", + "email": "PapstDonB@Googlemail.com" + } + ], + "dependencies": {}, + "deprecated": false, "description": "Flexible ascii progress bar", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/node-progress" + "engines": { + "node": ">=0.4.0" }, + "homepage": "https://github.com/visionmedia/node-progress#readme", "keywords": [ "cli", "progress" ], - "author": "TJ Holowaychuk ", - "contributors": [ - "Christoffer Hallas ", - "Jordan Scales ", - "Andrew Rhyne ", - "Marco Brack " - ], - "dependencies": {}, + "license": "MIT", "main": "./index.js", - "engines": { - "node": ">=0.4.0" + "name": "progress", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/node-progress.git" }, - "license": "MIT" -} + "version": "2.0.3" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/punycode/package.json b/tools/node_modules/eslint/node_modules/punycode/package.json index 9202ccf8c0c8f7..36ee74b2ef460e 100644 --- a/tools/node_modules/eslint/node_modules/punycode/package.json +++ b/tools/node_modules/eslint/node_modules/punycode/package.json @@ -1,58 +1,62 @@ { - "name": "punycode", - "version": "2.1.1", - "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", - "homepage": "https://mths.be/punycode", - "main": "punycode.js", - "jsnext:main": "punycode.es6.js", - "module": "punycode.es6.js", - "engines": { - "node": ">=6" - }, - "keywords": [ - "punycode", - "unicode", - "idn", - "idna", - "dns", - "url", - "domain" - ], - "license": "MIT", "author": { "name": "Mathias Bynens", "url": "https://mathiasbynens.be/" }, + "bugs": { + "url": "https://github.com/bestiejs/punycode.js/issues" + }, + "bundleDependencies": false, "contributors": [ { "name": "Mathias Bynens", "url": "https://mathiasbynens.be/" } ], - "repository": { - "type": "git", - "url": "https://github.com/bestiejs/punycode.js.git" + "deprecated": false, + "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", + "devDependencies": { + "codecov": "^1.0.1", + "istanbul": "^0.4.1", + "mocha": "^2.5.3" + }, + "engines": { + "node": ">=6" }, - "bugs": "https://github.com/bestiejs/punycode.js/issues", "files": [ "LICENSE-MIT.txt", "punycode.js", "punycode.es6.js" ], - "scripts": { - "test": "mocha tests", - "prepublish": "node scripts/prepublish.js" - }, - "devDependencies": { - "codecov": "^1.0.1", - "istanbul": "^0.4.1", - "mocha": "^2.5.3" - }, + "homepage": "https://mths.be/punycode", + "jsnext:main": "punycode.es6.js", "jspm": { "map": { "./punycode.js": { "node": "@node/punycode" } } - } -} + }, + "keywords": [ + "punycode", + "unicode", + "idn", + "idna", + "dns", + "url", + "domain" + ], + "license": "MIT", + "main": "punycode.js", + "module": "punycode.es6.js", + "name": "punycode", + "repository": { + "type": "git", + "url": "git+https://github.com/bestiejs/punycode.js.git" + }, + "scripts": { + "prepublish": "node scripts/prepublish.js", + "test": "mocha tests" + }, + "version": "2.1.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/regexpp/package.json b/tools/node_modules/eslint/node_modules/regexpp/package.json index 029cbe74e37f60..1c2b0eb82ba809 100644 --- a/tools/node_modules/eslint/node_modules/regexpp/package.json +++ b/tools/node_modules/eslint/node_modules/regexpp/package.json @@ -1,15 +1,15 @@ { - "name": "regexpp", - "version": "3.1.0", - "description": "Regular expression parser for ECMAScript.", - "engines": { - "node": ">=8" + "author": { + "name": "Toru Nagashima", + "url": "https://github.com/mysticatea" }, - "main": "index", - "files": [ - "index.*" - ], + "bugs": { + "url": "https://github.com/mysticatea/regexpp/issues" + }, + "bundleDependencies": false, "dependencies": {}, + "deprecated": false, + "description": "Regular expression parser for ECMAScript.", "devDependencies": { "@mysticatea/eslint-plugin": "^11.0.0", "@types/eslint": "^4.16.2", @@ -30,31 +30,14 @@ "ts-node": "^8.3.0", "typescript": "^3.5.3" }, - "scripts": { - "prebuild": "npm run -s clean", - "build": "run-s build:*", - "build:tsc": "tsc --module es2015", - "build:rollup": "rollup -c", - "build:dts": "dts-bundle --name regexpp --main .temp/index.d.ts --out ../index.d.ts", - "clean": "rimraf .temp index.*", - "codecov": "nyc report -r lcovonly && codecov -t ${CODECOV_TOKEN} --disable=gcov", - "lint": "eslint scripts src test --ext .ts", - "pretest": "run-s build lint", - "test": "nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000", - "update:test": "ts-node scripts/update-fixtures.ts", - "update:unicode": "run-s update:unicode:*", - "update:unicode:ids": "ts-node scripts/update-unicode-ids.ts", - "update:unicode:props": "ts-node scripts/update-unicode-properties.ts", - "preversion": "npm test", - "version": "npm run -s build", - "postversion": "git push && git push --tags", - "prewatch": "npm run -s clean", - "watch": "_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/mysticatea/regexpp.git" + "engines": { + "node": ">=8" }, + "files": [ + "index.*" + ], + "funding": "https://github.com/sponsors/mysticatea", + "homepage": "https://github.com/mysticatea/regexpp#readme", "keywords": [ "regexp", "regular", @@ -74,11 +57,33 @@ "es2020", "annexB" ], - "author": "Toru Nagashima (https://github.com/mysticatea)", "license": "MIT", - "bugs": { - "url": "https://github.com/mysticatea/regexpp/issues" + "main": "index", + "name": "regexpp", + "repository": { + "type": "git", + "url": "git+https://github.com/mysticatea/regexpp.git" }, - "homepage": "https://github.com/mysticatea/regexpp#readme", - "funding": "https://github.com/sponsors/mysticatea" -} + "scripts": { + "build": "run-s build:*", + "build:dts": "dts-bundle --name regexpp --main .temp/index.d.ts --out ../index.d.ts", + "build:rollup": "rollup -c", + "build:tsc": "tsc --module es2015", + "clean": "rimraf .temp index.*", + "codecov": "nyc report -r lcovonly && codecov -t ${CODECOV_TOKEN} --disable=gcov", + "lint": "eslint scripts src test --ext .ts", + "postversion": "git push && git push --tags", + "prebuild": "npm run -s clean", + "pretest": "run-s build lint", + "preversion": "npm test", + "prewatch": "npm run -s clean", + "test": "nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000", + "update:test": "ts-node scripts/update-fixtures.ts", + "update:unicode": "run-s update:unicode:*", + "update:unicode:ids": "ts-node scripts/update-unicode-ids.ts", + "update:unicode:props": "ts-node scripts/update-unicode-properties.ts", + "version": "npm run -s build", + "watch": "_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl" + }, + "version": "3.1.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/require-from-string/package.json b/tools/node_modules/eslint/node_modules/require-from-string/package.json index 800d46efcb00b3..4ca96a63470da5 100644 --- a/tools/node_modules/eslint/node_modules/require-from-string/package.json +++ b/tools/node_modules/eslint/node_modules/require-from-string/package.json @@ -1,28 +1,35 @@ { - "name": "require-from-string", - "version": "2.0.2", - "description": "Require module from string", - "license": "MIT", - "repository": "floatdrop/require-from-string", "author": { "name": "Vsevolod Strukchinsky", "email": "floatdrop@gmail.com", "url": "github.com/floatdrop" }, + "bugs": { + "url": "https://github.com/floatdrop/require-from-string/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Require module from string", + "devDependencies": { + "mocha": "*" + }, "engines": { "node": ">=0.10.0" }, - "scripts": { - "test": "mocha" - }, "files": [ "index.js" ], - "keywords": [ - "" - ], - "dependencies": {}, - "devDependencies": { - "mocha": "*" - } -} + "homepage": "https://github.com/floatdrop/require-from-string#readme", + "keywords": [], + "license": "MIT", + "name": "require-from-string", + "repository": { + "type": "git", + "url": "git+https://github.com/floatdrop/require-from-string.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "2.0.2" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/resolve-from/package.json b/tools/node_modules/eslint/node_modules/resolve-from/package.json index 96bade58824569..dde5eec0bc6102 100644 --- a/tools/node_modules/eslint/node_modules/resolve-from/package.json +++ b/tools/node_modules/eslint/node_modules/resolve-from/package.json @@ -1,34 +1,43 @@ { - "name": "resolve-from", - "version": "4.0.0", - "description": "Resolve the path of a module like `require.resolve()` but from a given path", - "license": "MIT", - "repository": "sindresorhus/resolve-from", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "require", - "resolve", - "path", - "module", - "from", - "like", - "import" - ], - "devDependencies": { - "ava": "*", - "xo": "*" - } -} + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/resolve-from/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Resolve the path of a module like `require.resolve()` but from a given path", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/resolve-from#readme", + "keywords": [ + "require", + "resolve", + "path", + "module", + "from", + "like", + "import" + ], + "license": "MIT", + "name": "resolve-from", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/resolve-from.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "4.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/rimraf/package.json b/tools/node_modules/eslint/node_modules/rimraf/package.json index 1bf8d5e38775d7..036517586b227f 100644 --- a/tools/node_modules/eslint/node_modules/rimraf/package.json +++ b/tools/node_modules/eslint/node_modules/rimraf/package.json @@ -1,32 +1,47 @@ { - "name": "rimraf", - "version": "3.0.2", - "main": "rimraf.js", - "description": "A deep deletion module for node (like `rm -rf`)", - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "repository": "git://github.com/isaacs/rimraf.git", - "scripts": { - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --follow-tags", - "test": "tap test/*.js" + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bin": { + "rimraf": "bin.js" }, - "bin": "./bin.js", + "bugs": { + "url": "https://github.com/isaacs/rimraf/issues" + }, + "bundleDependencies": false, "dependencies": { "glob": "^7.1.3" }, + "deprecated": false, + "description": "A deep deletion module for node (like `rm -rf`)", + "devDependencies": { + "mkdirp": "^0.5.1", + "tap": "^12.1.1" + }, "files": [ "LICENSE", "README.md", "bin.js", "rimraf.js" ], - "devDependencies": { - "mkdirp": "^0.5.1", - "tap": "^12.1.1" - }, "funding": { "url": "https://github.com/sponsors/isaacs" - } -} + }, + "homepage": "https://github.com/isaacs/rimraf#readme", + "license": "ISC", + "main": "rimraf.js", + "name": "rimraf", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/rimraf.git" + }, + "scripts": { + "postpublish": "git push origin --follow-tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap test/*.js" + }, + "version": "3.0.2" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/semver/package.json b/tools/node_modules/eslint/node_modules/semver/package.json index d4043d38a13529..2aa14e5a6dd7e9 100644 --- a/tools/node_modules/eslint/node_modules/semver/package.json +++ b/tools/node_modules/eslint/node_modules/semver/package.json @@ -1,22 +1,21 @@ { - "name": "semver", - "version": "7.3.4", - "description": "The semantic version parser used by npm.", - "main": "index.js", - "scripts": { - "test": "tap", - "snap": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --follow-tags" + "bin": { + "semver": "bin/semver.js" }, + "bugs": { + "url": "https://github.com/npm/node-semver/issues" + }, + "bundleDependencies": false, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "deprecated": false, + "description": "The semantic version parser used by npm.", "devDependencies": { "tap": "^14.10.7" }, - "license": "ISC", - "repository": "https://github.com/npm/node-semver", - "bin": { - "semver": "bin/semver.js" + "engines": { + "node": ">=10" }, "files": [ "bin/**/*.js", @@ -28,14 +27,24 @@ "index.js", "preload.js" ], + "homepage": "https://github.com/npm/node-semver#readme", + "license": "ISC", + "main": "index.js", + "name": "semver", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/node-semver.git" + }, + "scripts": { + "postpublish": "git push origin --follow-tags", + "postversion": "npm publish", + "preversion": "npm test", + "snap": "tap", + "test": "tap" + }, "tap": { "check-coverage": true, "coverage-map": "map.js" }, - "engines": { - "node": ">=10" - }, - "dependencies": { - "lru-cache": "^6.0.0" - } -} + "version": "7.3.4" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/shebang-command/package.json b/tools/node_modules/eslint/node_modules/shebang-command/package.json index 18e3c04638cb68..3dc3563bceda96 100644 --- a/tools/node_modules/eslint/node_modules/shebang-command/package.json +++ b/tools/node_modules/eslint/node_modules/shebang-command/package.json @@ -1,34 +1,43 @@ { - "name": "shebang-command", - "version": "2.0.0", - "description": "Get the command from a shebang", - "license": "MIT", - "repository": "kevva/shebang-command", - "author": { - "name": "Kevin Mårtensson", - "email": "kevinmartensson@gmail.com", - "url": "github.com/kevva" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "cmd", - "command", - "parse", - "shebang" - ], - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "devDependencies": { - "ava": "^2.3.0", - "xo": "^0.24.0" - } -} + "author": { + "name": "Kevin Mårtensson", + "email": "kevinmartensson@gmail.com", + "url": "github.com/kevva" + }, + "bugs": { + "url": "https://github.com/kevva/shebang-command/issues" + }, + "bundleDependencies": false, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "deprecated": false, + "description": "Get the command from a shebang", + "devDependencies": { + "ava": "^2.3.0", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/kevva/shebang-command#readme", + "keywords": [ + "cmd", + "command", + "parse", + "shebang" + ], + "license": "MIT", + "name": "shebang-command", + "repository": { + "type": "git", + "url": "git+https://github.com/kevva/shebang-command.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/shebang-regex/package.json b/tools/node_modules/eslint/node_modules/shebang-regex/package.json index 00ab30feeefe89..22a96573aadd2d 100644 --- a/tools/node_modules/eslint/node_modules/shebang-regex/package.json +++ b/tools/node_modules/eslint/node_modules/shebang-regex/package.json @@ -1,35 +1,44 @@ { - "name": "shebang-regex", - "version": "3.0.0", - "description": "Regular expression for matching a shebang line", - "license": "MIT", - "repository": "sindresorhus/shebang-regex", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "regex", - "regexp", - "shebang", - "match", - "test", - "line" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/shebang-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Regular expression for matching a shebang line", + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/sindresorhus/shebang-regex#readme", + "keywords": [ + "regex", + "regexp", + "shebang", + "match", + "test", + "line" + ], + "license": "MIT", + "name": "shebang-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/shebang-regex.git" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "version": "3.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/index.js b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/index.js new file mode 100644 index 00000000000000..5d82581a13f990 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/index.js @@ -0,0 +1,163 @@ +'use strict'; + +const wrapAnsi16 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => (...args) => { + const rgb = fn(...args); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +const ansi2ansi = n => n; +const rgb2rgb = (r, g, b) => [r, g, b]; + +const setLazyProperty = (object, property, get) => { + Object.defineProperty(object, property, { + get: () => { + const value = get(); + + Object.defineProperty(object, property, { + value, + enumerable: true, + configurable: true + }); + + return value; + }, + enumerable: true, + configurable: true + }); +}; + +/** @type {typeof import('color-convert')} */ +let colorConvert; +const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { + if (colorConvert === undefined) { + colorConvert = require('color-convert'); + } + + const offset = isBackground ? 10 : 0; + const styles = {}; + + for (const [sourceSpace, suite] of Object.entries(colorConvert)) { + const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; + if (sourceSpace === targetSpace) { + styles[name] = wrap(identity, offset); + } else if (typeof suite === 'object') { + styles[name] = wrap(suite[targetSpace], offset); + } + } + + return styles; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + + // Bright color + blackBright: [90, 39], + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Alias bright black as gray (and grey) + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); + setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/license b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/package.json b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/package.json new file mode 100644 index 00000000000000..d276e03d2549c8 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/package.json @@ -0,0 +1,65 @@ +{ + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-styles/issues" + }, + "bundleDependencies": false, + "dependencies": { + "color-convert": "^2.0.1" + }, + "deprecated": false, + "description": "ANSI escape codes for styling strings in the terminal", + "devDependencies": { + "@types/color-convert": "^1.9.0", + "ava": "^2.3.0", + "svg-term-cli": "^2.1.1", + "tsd": "^0.11.0", + "xo": "^0.25.3" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "funding": "https://github.com/chalk/ansi-styles?sponsor=1", + "homepage": "https://github.com/chalk/ansi-styles#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "name": "ansi-styles", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-styles.git" + }, + "scripts": { + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor", + "test": "xo && ava && tsd" + }, + "version": "4.3.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/readme.md b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/readme.md new file mode 100644 index 00000000000000..24883de808be6a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/readme.md @@ -0,0 +1,152 @@ +# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) + +> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + + + +## Install + +``` +$ npm install ansi-styles +``` + +## Usage + +```js +const style = require('ansi-styles'); + +console.log(`${style.green.open}Hello world!${style.green.close}`); + + +// Color conversion between 16/256/truecolor +// NOTE: If conversion goes to 16 colors or 256 colors, the original color +// may be degraded to fit that color palette. This means terminals +// that do not support 16 million colors will best-match the +// original color. +console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); +console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); +console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close); +``` + +## API + +Each style has an `open` and `close` property. + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(Not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(Not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `blackBright` (alias: `gray`, `grey`) +- `redBright` +- `greenBright` +- `yellowBright` +- `blueBright` +- `magentaBright` +- `cyanBright` +- `whiteBright` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` +- `bgBlackBright` (alias: `bgGray`, `bgGrey`) +- `bgRedBright` +- `bgGreenBright` +- `bgYellowBright` +- `bgBlueBright` +- `bgMagentaBright` +- `bgCyanBright` +- `bgWhiteBright` + +## Advanced usage + +By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `style.modifier` +- `style.color` +- `style.bgColor` + +###### Example + +```js +console.log(style.color.green.open); +``` + +Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. + +###### Example + +```js +console.log(style.codes.get(36)); +//=> 39 +``` + +## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) + +`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. + +The following color spaces from `color-convert` are supported: + +- `rgb` +- `hex` +- `keyword` +- `hsl` +- `hsv` +- `hwb` +- `ansi` +- `ansi256` + +To use these, call the associated conversion function with the intended output, for example: + +```js +style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code +style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code + +style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code +style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code + +style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code +style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code +``` + +## Related + +- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + +## For enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/LICENSE b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/LICENSE new file mode 100644 index 00000000000000..5b4c386f9269b3 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2011-2016 Heather Arthur + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/README.md b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/README.md new file mode 100644 index 00000000000000..d4b08fc369948d --- /dev/null +++ b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/README.md @@ -0,0 +1,68 @@ +# color-convert + +[![Build Status](https://travis-ci.org/Qix-/color-convert.svg?branch=master)](https://travis-ci.org/Qix-/color-convert) + +Color-convert is a color conversion library for JavaScript and node. +It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest): + +```js +var convert = require('color-convert'); + +convert.rgb.hsl(140, 200, 100); // [96, 48, 59] +convert.keyword.rgb('blue'); // [0, 0, 255] + +var rgbChannels = convert.rgb.channels; // 3 +var cmykChannels = convert.cmyk.channels; // 4 +var ansiChannels = convert.ansi16.channels; // 1 +``` + +# Install + +```console +$ npm install color-convert +``` + +# API + +Simply get the property of the _from_ and _to_ conversion that you're looking for. + +All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function. + +All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha). + +```js +var convert = require('color-convert'); + +// Hex to LAB +convert.hex.lab('DEADBF'); // [ 76, 21, -2 ] +convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ] + +// RGB to CMYK +convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ] +convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ] +``` + +### Arrays +All functions that accept multiple arguments also support passing an array. + +Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.) + +```js +var convert = require('color-convert'); + +convert.rgb.hex(123, 45, 67); // '7B2D43' +convert.rgb.hex([123, 45, 67]); // '7B2D43' +``` + +## Routing + +Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex). + +Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js). + +# Contribute + +If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request. + +# License +Copyright © 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE). diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/conversions.js b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/conversions.js new file mode 100644 index 00000000000000..2657f265c9e102 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/conversions.js @@ -0,0 +1,839 @@ +/* MIT license */ +/* eslint-disable no-mixed-operators */ +const cssKeywords = require('color-name'); + +// NOTE: conversions should only return primitive values (i.e. arrays, or +// values that give correct `typeof` results). +// do not use box values types (i.e. Number(), String(), etc.) + +const reverseKeywords = {}; +for (const key of Object.keys(cssKeywords)) { + reverseKeywords[cssKeywords[key]] = key; +} + +const convert = { + rgb: {channels: 3, labels: 'rgb'}, + hsl: {channels: 3, labels: 'hsl'}, + hsv: {channels: 3, labels: 'hsv'}, + hwb: {channels: 3, labels: 'hwb'}, + cmyk: {channels: 4, labels: 'cmyk'}, + xyz: {channels: 3, labels: 'xyz'}, + lab: {channels: 3, labels: 'lab'}, + lch: {channels: 3, labels: 'lch'}, + hex: {channels: 1, labels: ['hex']}, + keyword: {channels: 1, labels: ['keyword']}, + ansi16: {channels: 1, labels: ['ansi16']}, + ansi256: {channels: 1, labels: ['ansi256']}, + hcg: {channels: 3, labels: ['h', 'c', 'g']}, + apple: {channels: 3, labels: ['r16', 'g16', 'b16']}, + gray: {channels: 1, labels: ['gray']} +}; + +module.exports = convert; + +// Hide .channels and .labels properties +for (const model of Object.keys(convert)) { + if (!('channels' in convert[model])) { + throw new Error('missing channels property: ' + model); + } + + if (!('labels' in convert[model])) { + throw new Error('missing channel labels property: ' + model); + } + + if (convert[model].labels.length !== convert[model].channels) { + throw new Error('channel and label counts mismatch: ' + model); + } + + const {channels, labels} = convert[model]; + delete convert[model].channels; + delete convert[model].labels; + Object.defineProperty(convert[model], 'channels', {value: channels}); + Object.defineProperty(convert[model], 'labels', {value: labels}); +} + +convert.rgb.hsl = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const min = Math.min(r, g, b); + const max = Math.max(r, g, b); + const delta = max - min; + let h; + let s; + + if (max === min) { + h = 0; + } else if (r === max) { + h = (g - b) / delta; + } else if (g === max) { + h = 2 + (b - r) / delta; + } else if (b === max) { + h = 4 + (r - g) / delta; + } + + h = Math.min(h * 60, 360); + + if (h < 0) { + h += 360; + } + + const l = (min + max) / 2; + + if (max === min) { + s = 0; + } else if (l <= 0.5) { + s = delta / (max + min); + } else { + s = delta / (2 - max - min); + } + + return [h, s * 100, l * 100]; +}; + +convert.rgb.hsv = function (rgb) { + let rdif; + let gdif; + let bdif; + let h; + let s; + + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const v = Math.max(r, g, b); + const diff = v - Math.min(r, g, b); + const diffc = function (c) { + return (v - c) / 6 / diff + 1 / 2; + }; + + if (diff === 0) { + h = 0; + s = 0; + } else { + s = diff / v; + rdif = diffc(r); + gdif = diffc(g); + bdif = diffc(b); + + if (r === v) { + h = bdif - gdif; + } else if (g === v) { + h = (1 / 3) + rdif - bdif; + } else if (b === v) { + h = (2 / 3) + gdif - rdif; + } + + if (h < 0) { + h += 1; + } else if (h > 1) { + h -= 1; + } + } + + return [ + h * 360, + s * 100, + v * 100 + ]; +}; + +convert.rgb.hwb = function (rgb) { + const r = rgb[0]; + const g = rgb[1]; + let b = rgb[2]; + const h = convert.rgb.hsl(rgb)[0]; + const w = 1 / 255 * Math.min(r, Math.min(g, b)); + + b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); + + return [h, w * 100, b * 100]; +}; + +convert.rgb.cmyk = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + + const k = Math.min(1 - r, 1 - g, 1 - b); + const c = (1 - r - k) / (1 - k) || 0; + const m = (1 - g - k) / (1 - k) || 0; + const y = (1 - b - k) / (1 - k) || 0; + + return [c * 100, m * 100, y * 100, k * 100]; +}; + +function comparativeDistance(x, y) { + /* + See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance + */ + return ( + ((x[0] - y[0]) ** 2) + + ((x[1] - y[1]) ** 2) + + ((x[2] - y[2]) ** 2) + ); +} + +convert.rgb.keyword = function (rgb) { + const reversed = reverseKeywords[rgb]; + if (reversed) { + return reversed; + } + + let currentClosestDistance = Infinity; + let currentClosestKeyword; + + for (const keyword of Object.keys(cssKeywords)) { + const value = cssKeywords[keyword]; + + // Compute comparative distance + const distance = comparativeDistance(rgb, value); + + // Check if its less, if so set as closest + if (distance < currentClosestDistance) { + currentClosestDistance = distance; + currentClosestKeyword = keyword; + } + } + + return currentClosestKeyword; +}; + +convert.keyword.rgb = function (keyword) { + return cssKeywords[keyword]; +}; + +convert.rgb.xyz = function (rgb) { + let r = rgb[0] / 255; + let g = rgb[1] / 255; + let b = rgb[2] / 255; + + // Assume sRGB + r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92); + g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92); + b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92); + + const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); + const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); + const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); + + return [x * 100, y * 100, z * 100]; +}; + +convert.rgb.lab = function (rgb) { + const xyz = convert.rgb.xyz(rgb); + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; + + x /= 95.047; + y /= 100; + z /= 108.883; + + x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); + + const l = (116 * y) - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); + + return [l, a, b]; +}; + +convert.hsl.rgb = function (hsl) { + const h = hsl[0] / 360; + const s = hsl[1] / 100; + const l = hsl[2] / 100; + let t2; + let t3; + let val; + + if (s === 0) { + val = l * 255; + return [val, val, val]; + } + + if (l < 0.5) { + t2 = l * (1 + s); + } else { + t2 = l + s - l * s; + } + + const t1 = 2 * l - t2; + + const rgb = [0, 0, 0]; + for (let i = 0; i < 3; i++) { + t3 = h + 1 / 3 * -(i - 1); + if (t3 < 0) { + t3++; + } + + if (t3 > 1) { + t3--; + } + + if (6 * t3 < 1) { + val = t1 + (t2 - t1) * 6 * t3; + } else if (2 * t3 < 1) { + val = t2; + } else if (3 * t3 < 2) { + val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; + } else { + val = t1; + } + + rgb[i] = val * 255; + } + + return rgb; +}; + +convert.hsl.hsv = function (hsl) { + const h = hsl[0]; + let s = hsl[1] / 100; + let l = hsl[2] / 100; + let smin = s; + const lmin = Math.max(l, 0.01); + + l *= 2; + s *= (l <= 1) ? l : 2 - l; + smin *= lmin <= 1 ? lmin : 2 - lmin; + const v = (l + s) / 2; + const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); + + return [h, sv * 100, v * 100]; +}; + +convert.hsv.rgb = function (hsv) { + const h = hsv[0] / 60; + const s = hsv[1] / 100; + let v = hsv[2] / 100; + const hi = Math.floor(h) % 6; + + const f = h - Math.floor(h); + const p = 255 * v * (1 - s); + const q = 255 * v * (1 - (s * f)); + const t = 255 * v * (1 - (s * (1 - f))); + v *= 255; + + switch (hi) { + case 0: + return [v, t, p]; + case 1: + return [q, v, p]; + case 2: + return [p, v, t]; + case 3: + return [p, q, v]; + case 4: + return [t, p, v]; + case 5: + return [v, p, q]; + } +}; + +convert.hsv.hsl = function (hsv) { + const h = hsv[0]; + const s = hsv[1] / 100; + const v = hsv[2] / 100; + const vmin = Math.max(v, 0.01); + let sl; + let l; + + l = (2 - s) * v; + const lmin = (2 - s) * vmin; + sl = s * vmin; + sl /= (lmin <= 1) ? lmin : 2 - lmin; + sl = sl || 0; + l /= 2; + + return [h, sl * 100, l * 100]; +}; + +// http://dev.w3.org/csswg/css-color/#hwb-to-rgb +convert.hwb.rgb = function (hwb) { + const h = hwb[0] / 360; + let wh = hwb[1] / 100; + let bl = hwb[2] / 100; + const ratio = wh + bl; + let f; + + // Wh + bl cant be > 1 + if (ratio > 1) { + wh /= ratio; + bl /= ratio; + } + + const i = Math.floor(6 * h); + const v = 1 - bl; + f = 6 * h - i; + + if ((i & 0x01) !== 0) { + f = 1 - f; + } + + const n = wh + f * (v - wh); // Linear interpolation + + let r; + let g; + let b; + /* eslint-disable max-statements-per-line,no-multi-spaces */ + switch (i) { + default: + case 6: + case 0: r = v; g = n; b = wh; break; + case 1: r = n; g = v; b = wh; break; + case 2: r = wh; g = v; b = n; break; + case 3: r = wh; g = n; b = v; break; + case 4: r = n; g = wh; b = v; break; + case 5: r = v; g = wh; b = n; break; + } + /* eslint-enable max-statements-per-line,no-multi-spaces */ + + return [r * 255, g * 255, b * 255]; +}; + +convert.cmyk.rgb = function (cmyk) { + const c = cmyk[0] / 100; + const m = cmyk[1] / 100; + const y = cmyk[2] / 100; + const k = cmyk[3] / 100; + + const r = 1 - Math.min(1, c * (1 - k) + k); + const g = 1 - Math.min(1, m * (1 - k) + k); + const b = 1 - Math.min(1, y * (1 - k) + k); + + return [r * 255, g * 255, b * 255]; +}; + +convert.xyz.rgb = function (xyz) { + const x = xyz[0] / 100; + const y = xyz[1] / 100; + const z = xyz[2] / 100; + let r; + let g; + let b; + + r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); + g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); + b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); + + // Assume sRGB + r = r > 0.0031308 + ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055) + : r * 12.92; + + g = g > 0.0031308 + ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055) + : g * 12.92; + + b = b > 0.0031308 + ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055) + : b * 12.92; + + r = Math.min(Math.max(0, r), 1); + g = Math.min(Math.max(0, g), 1); + b = Math.min(Math.max(0, b), 1); + + return [r * 255, g * 255, b * 255]; +}; + +convert.xyz.lab = function (xyz) { + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; + + x /= 95.047; + y /= 100; + z /= 108.883; + + x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); + + const l = (116 * y) - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); + + return [l, a, b]; +}; + +convert.lab.xyz = function (lab) { + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let x; + let y; + let z; + + y = (l + 16) / 116; + x = a / 500 + y; + z = y - b / 200; + + const y2 = y ** 3; + const x2 = x ** 3; + const z2 = z ** 3; + y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; + x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; + z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; + + x *= 95.047; + y *= 100; + z *= 108.883; + + return [x, y, z]; +}; + +convert.lab.lch = function (lab) { + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let h; + + const hr = Math.atan2(b, a); + h = hr * 360 / 2 / Math.PI; + + if (h < 0) { + h += 360; + } + + const c = Math.sqrt(a * a + b * b); + + return [l, c, h]; +}; + +convert.lch.lab = function (lch) { + const l = lch[0]; + const c = lch[1]; + const h = lch[2]; + + const hr = h / 360 * 2 * Math.PI; + const a = c * Math.cos(hr); + const b = c * Math.sin(hr); + + return [l, a, b]; +}; + +convert.rgb.ansi16 = function (args, saturation = null) { + const [r, g, b] = args; + let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization + + value = Math.round(value / 50); + + if (value === 0) { + return 30; + } + + let ansi = 30 + + ((Math.round(b / 255) << 2) + | (Math.round(g / 255) << 1) + | Math.round(r / 255)); + + if (value === 2) { + ansi += 60; + } + + return ansi; +}; + +convert.hsv.ansi16 = function (args) { + // Optimization here; we already know the value and don't need to get + // it converted for us. + return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); +}; + +convert.rgb.ansi256 = function (args) { + const r = args[0]; + const g = args[1]; + const b = args[2]; + + // We use the extended greyscale palette here, with the exception of + // black and white. normal palette only has 4 greyscale shades. + if (r === g && g === b) { + if (r < 8) { + return 16; + } + + if (r > 248) { + return 231; + } + + return Math.round(((r - 8) / 247) * 24) + 232; + } + + const ansi = 16 + + (36 * Math.round(r / 255 * 5)) + + (6 * Math.round(g / 255 * 5)) + + Math.round(b / 255 * 5); + + return ansi; +}; + +convert.ansi16.rgb = function (args) { + let color = args % 10; + + // Handle greyscale + if (color === 0 || color === 7) { + if (args > 50) { + color += 3.5; + } + + color = color / 10.5 * 255; + + return [color, color, color]; + } + + const mult = (~~(args > 50) + 1) * 0.5; + const r = ((color & 1) * mult) * 255; + const g = (((color >> 1) & 1) * mult) * 255; + const b = (((color >> 2) & 1) * mult) * 255; + + return [r, g, b]; +}; + +convert.ansi256.rgb = function (args) { + // Handle greyscale + if (args >= 232) { + const c = (args - 232) * 10 + 8; + return [c, c, c]; + } + + args -= 16; + + let rem; + const r = Math.floor(args / 36) / 5 * 255; + const g = Math.floor((rem = args % 36) / 6) / 5 * 255; + const b = (rem % 6) / 5 * 255; + + return [r, g, b]; +}; + +convert.rgb.hex = function (args) { + const integer = ((Math.round(args[0]) & 0xFF) << 16) + + ((Math.round(args[1]) & 0xFF) << 8) + + (Math.round(args[2]) & 0xFF); + + const string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; +}; + +convert.hex.rgb = function (args) { + const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + if (!match) { + return [0, 0, 0]; + } + + let colorString = match[0]; + + if (match[0].length === 3) { + colorString = colorString.split('').map(char => { + return char + char; + }).join(''); + } + + const integer = parseInt(colorString, 16); + const r = (integer >> 16) & 0xFF; + const g = (integer >> 8) & 0xFF; + const b = integer & 0xFF; + + return [r, g, b]; +}; + +convert.rgb.hcg = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const max = Math.max(Math.max(r, g), b); + const min = Math.min(Math.min(r, g), b); + const chroma = (max - min); + let grayscale; + let hue; + + if (chroma < 1) { + grayscale = min / (1 - chroma); + } else { + grayscale = 0; + } + + if (chroma <= 0) { + hue = 0; + } else + if (max === r) { + hue = ((g - b) / chroma) % 6; + } else + if (max === g) { + hue = 2 + (b - r) / chroma; + } else { + hue = 4 + (r - g) / chroma; + } + + hue /= 6; + hue %= 1; + + return [hue * 360, chroma * 100, grayscale * 100]; +}; + +convert.hsl.hcg = function (hsl) { + const s = hsl[1] / 100; + const l = hsl[2] / 100; + + const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l)); + + let f = 0; + if (c < 1.0) { + f = (l - 0.5 * c) / (1.0 - c); + } + + return [hsl[0], c * 100, f * 100]; +}; + +convert.hsv.hcg = function (hsv) { + const s = hsv[1] / 100; + const v = hsv[2] / 100; + + const c = s * v; + let f = 0; + + if (c < 1.0) { + f = (v - c) / (1 - c); + } + + return [hsv[0], c * 100, f * 100]; +}; + +convert.hcg.rgb = function (hcg) { + const h = hcg[0] / 360; + const c = hcg[1] / 100; + const g = hcg[2] / 100; + + if (c === 0.0) { + return [g * 255, g * 255, g * 255]; + } + + const pure = [0, 0, 0]; + const hi = (h % 1) * 6; + const v = hi % 1; + const w = 1 - v; + let mg = 0; + + /* eslint-disable max-statements-per-line */ + switch (Math.floor(hi)) { + case 0: + pure[0] = 1; pure[1] = v; pure[2] = 0; break; + case 1: + pure[0] = w; pure[1] = 1; pure[2] = 0; break; + case 2: + pure[0] = 0; pure[1] = 1; pure[2] = v; break; + case 3: + pure[0] = 0; pure[1] = w; pure[2] = 1; break; + case 4: + pure[0] = v; pure[1] = 0; pure[2] = 1; break; + default: + pure[0] = 1; pure[1] = 0; pure[2] = w; + } + /* eslint-enable max-statements-per-line */ + + mg = (1.0 - c) * g; + + return [ + (c * pure[0] + mg) * 255, + (c * pure[1] + mg) * 255, + (c * pure[2] + mg) * 255 + ]; +}; + +convert.hcg.hsv = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; + + const v = c + g * (1.0 - c); + let f = 0; + + if (v > 0.0) { + f = c / v; + } + + return [hcg[0], f * 100, v * 100]; +}; + +convert.hcg.hsl = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; + + const l = g * (1.0 - c) + 0.5 * c; + let s = 0; + + if (l > 0.0 && l < 0.5) { + s = c / (2 * l); + } else + if (l >= 0.5 && l < 1.0) { + s = c / (2 * (1 - l)); + } + + return [hcg[0], s * 100, l * 100]; +}; + +convert.hcg.hwb = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; + const v = c + g * (1.0 - c); + return [hcg[0], (v - c) * 100, (1 - v) * 100]; +}; + +convert.hwb.hcg = function (hwb) { + const w = hwb[1] / 100; + const b = hwb[2] / 100; + const v = 1 - b; + const c = v - w; + let g = 0; + + if (c < 1) { + g = (v - c) / (1 - c); + } + + return [hwb[0], c * 100, g * 100]; +}; + +convert.apple.rgb = function (apple) { + return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; +}; + +convert.rgb.apple = function (rgb) { + return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; +}; + +convert.gray.rgb = function (args) { + return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; +}; + +convert.gray.hsl = function (args) { + return [0, 0, args[0]]; +}; + +convert.gray.hsv = convert.gray.hsl; + +convert.gray.hwb = function (gray) { + return [0, 100, gray[0]]; +}; + +convert.gray.cmyk = function (gray) { + return [0, 0, 0, gray[0]]; +}; + +convert.gray.lab = function (gray) { + return [gray[0], 0, 0]; +}; + +convert.gray.hex = function (gray) { + const val = Math.round(gray[0] / 100 * 255) & 0xFF; + const integer = (val << 16) + (val << 8) + val; + + const string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; +}; + +convert.rgb.gray = function (rgb) { + const val = (rgb[0] + rgb[1] + rgb[2]) / 3; + return [val / 255 * 100]; +}; diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/index.js b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/index.js new file mode 100644 index 00000000000000..b648e5737be616 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/index.js @@ -0,0 +1,81 @@ +const conversions = require('./conversions'); +const route = require('./route'); + +const convert = {}; + +const models = Object.keys(conversions); + +function wrapRaw(fn) { + const wrappedFn = function (...args) { + const arg0 = args[0]; + if (arg0 === undefined || arg0 === null) { + return arg0; + } + + if (arg0.length > 1) { + args = arg0; + } + + return fn(args); + }; + + // Preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } + + return wrappedFn; +} + +function wrapRounded(fn) { + const wrappedFn = function (...args) { + const arg0 = args[0]; + + if (arg0 === undefined || arg0 === null) { + return arg0; + } + + if (arg0.length > 1) { + args = arg0; + } + + const result = fn(args); + + // We're assuming the result is an array here. + // see notice in conversions.js; don't use box types + // in conversion functions. + if (typeof result === 'object') { + for (let len = result.length, i = 0; i < len; i++) { + result[i] = Math.round(result[i]); + } + } + + return result; + }; + + // Preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } + + return wrappedFn; +} + +models.forEach(fromModel => { + convert[fromModel] = {}; + + Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); + Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); + + const routes = route(fromModel); + const routeModels = Object.keys(routes); + + routeModels.forEach(toModel => { + const fn = routes[toModel]; + + convert[fromModel][toModel] = wrapRounded(fn); + convert[fromModel][toModel].raw = wrapRaw(fn); + }); +}); + +module.exports = convert; diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/package.json b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/package.json new file mode 100644 index 00000000000000..427616bd0587d8 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/package.json @@ -0,0 +1,60 @@ +{ + "author": { + "name": "Heather Arthur", + "email": "fayearthur@gmail.com" + }, + "bugs": { + "url": "https://github.com/Qix-/color-convert/issues" + }, + "bundleDependencies": false, + "dependencies": { + "color-name": "~1.1.4" + }, + "deprecated": false, + "description": "Plain color conversion functions", + "devDependencies": { + "chalk": "^2.4.2", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=7.0.0" + }, + "files": [ + "index.js", + "conversions.js", + "route.js" + ], + "homepage": "https://github.com/Qix-/color-convert#readme", + "keywords": [ + "color", + "colour", + "convert", + "converter", + "conversion", + "rgb", + "hsl", + "hsv", + "hwb", + "cmyk", + "ansi", + "ansi16" + ], + "license": "MIT", + "name": "color-convert", + "repository": { + "type": "git", + "url": "git+https://github.com/Qix-/color-convert.git" + }, + "scripts": { + "pretest": "xo", + "test": "node test/basic.js" + }, + "version": "2.0.1", + "xo": { + "rules": { + "default-case": 0, + "no-inline-comments": 0, + "operator-linebreak": 0 + } + } +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/route.js b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/route.js new file mode 100644 index 00000000000000..1a08521b5a0017 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/route.js @@ -0,0 +1,97 @@ +const conversions = require('./conversions'); + +/* + This function routes a model to all other models. + + all functions that are routed have a property `.conversion` attached + to the returned synthetic function. This property is an array + of strings, each with the steps in between the 'from' and 'to' + color models (inclusive). + + conversions that are not possible simply are not included. +*/ + +function buildGraph() { + const graph = {}; + // https://jsperf.com/object-keys-vs-for-in-with-closure/3 + const models = Object.keys(conversions); + + for (let len = models.length, i = 0; i < len; i++) { + graph[models[i]] = { + // http://jsperf.com/1-vs-infinity + // micro-opt, but this is simple. + distance: -1, + parent: null + }; + } + + return graph; +} + +// https://en.wikipedia.org/wiki/Breadth-first_search +function deriveBFS(fromModel) { + const graph = buildGraph(); + const queue = [fromModel]; // Unshift -> queue -> pop + + graph[fromModel].distance = 0; + + while (queue.length) { + const current = queue.pop(); + const adjacents = Object.keys(conversions[current]); + + for (let len = adjacents.length, i = 0; i < len; i++) { + const adjacent = adjacents[i]; + const node = graph[adjacent]; + + if (node.distance === -1) { + node.distance = graph[current].distance + 1; + node.parent = current; + queue.unshift(adjacent); + } + } + } + + return graph; +} + +function link(from, to) { + return function (args) { + return to(from(args)); + }; +} + +function wrapConversion(toModel, graph) { + const path = [graph[toModel].parent, toModel]; + let fn = conversions[graph[toModel].parent][toModel]; + + let cur = graph[toModel].parent; + while (graph[cur].parent) { + path.unshift(graph[cur].parent); + fn = link(conversions[graph[cur].parent][cur], fn); + cur = graph[cur].parent; + } + + fn.conversion = path; + return fn; +} + +module.exports = function (fromModel) { + const graph = deriveBFS(fromModel); + const conversion = {}; + + const models = Object.keys(graph); + for (let len = models.length, i = 0; i < len; i++) { + const toModel = models[i]; + const node = graph[toModel]; + + if (node.parent === null) { + // No possible conversion, or this node is the source model. + continue; + } + + conversion[toModel] = wrapConversion(toModel, graph); + } + + return conversion; +}; + diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/LICENSE b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/LICENSE new file mode 100644 index 00000000000000..c6b10012540c24 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/LICENSE @@ -0,0 +1,8 @@ +The MIT License (MIT) +Copyright (c) 2015 Dmitry Ivanov + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/README.md b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/README.md new file mode 100644 index 00000000000000..932b979176f33b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/README.md @@ -0,0 +1,11 @@ +A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors. + +[![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/) + + +```js +var colors = require('color-name'); +colors.red //[255,0,0] +``` + + diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/index.js b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/index.js new file mode 100644 index 00000000000000..b7c198a6f3d7c5 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/index.js @@ -0,0 +1,152 @@ +'use strict' + +module.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] +}; diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/package.json b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/package.json new file mode 100644 index 00000000000000..07b8f6ece8170a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/package.json @@ -0,0 +1,33 @@ +{ + "author": { + "name": "DY", + "email": "dfcreative@gmail.com" + }, + "bugs": { + "url": "https://github.com/colorjs/color-name/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A list of color names and its values", + "files": [ + "index.js" + ], + "homepage": "https://github.com/colorjs/color-name", + "keywords": [ + "color-name", + "color", + "color-keyword", + "keyword" + ], + "license": "MIT", + "main": "index.js", + "name": "color-name", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/colorjs/color-name.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.1.4" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/package.json b/tools/node_modules/eslint/node_modules/slice-ansi/package.json index 7d6ea6956dcfb1..1e32ac1c4a9650 100644 --- a/tools/node_modules/eslint/node_modules/slice-ansi/package.json +++ b/tools/node_modules/eslint/node_modules/slice-ansi/package.json @@ -1,52 +1,61 @@ { - "name": "slice-ansi", - "version": "4.0.0", - "description": "Slice a string with ANSI escape codes", - "license": "MIT", - "repository": "chalk/slice-ansi", - "funding": "https://github.com/chalk/slice-ansi?sponsor=1", - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "slice", - "string", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "devDependencies": { - "ava": "^2.1.0", - "chalk": "^3.0.0", - "random-item": "^3.0.0", - "strip-ansi": "^6.0.0", - "xo": "^0.26.1" - } -} + "bugs": { + "url": "https://github.com/chalk/slice-ansi/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "deprecated": false, + "description": "Slice a string with ANSI escape codes", + "devDependencies": { + "ava": "^2.1.0", + "chalk": "^3.0.0", + "random-item": "^3.0.0", + "strip-ansi": "^6.0.0", + "xo": "^0.26.1" + }, + "engines": { + "node": ">=10" + }, + "files": [ + "index.js" + ], + "funding": "https://github.com/chalk/slice-ansi?sponsor=1", + "homepage": "https://github.com/chalk/slice-ansi#readme", + "keywords": [ + "slice", + "string", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "name": "slice-ansi", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/slice-ansi.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "4.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/sprintf-js/package.json b/tools/node_modules/eslint/node_modules/sprintf-js/package.json index 75f7eca71ea37f..da639c61582bbe 100644 --- a/tools/node_modules/eslint/node_modules/sprintf-js/package.json +++ b/tools/node_modules/eslint/node_modules/sprintf-js/package.json @@ -1,22 +1,31 @@ { - "name": "sprintf-js", - "version": "1.0.3", - "description": "JavaScript sprintf implementation", - "author": "Alexandru Marasteanu (http://alexei.ro/)", - "main": "src/sprintf.js", - "scripts": { - "test": "mocha test/test.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/alexei/sprintf.js.git" - }, - "license": "BSD-3-Clause", - "readmeFilename": "README.md", - "devDependencies": { - "mocha": "*", - "grunt": "*", - "grunt-contrib-watch": "*", - "grunt-contrib-uglify": "*" - } -} + "author": { + "name": "Alexandru Marasteanu", + "email": "hello@alexei.ro", + "url": "http://alexei.ro/" + }, + "bugs": { + "url": "https://github.com/alexei/sprintf.js/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "JavaScript sprintf implementation", + "devDependencies": { + "grunt": "*", + "grunt-contrib-uglify": "*", + "grunt-contrib-watch": "*", + "mocha": "*" + }, + "homepage": "https://github.com/alexei/sprintf.js#readme", + "license": "BSD-3-Clause", + "main": "src/sprintf.js", + "name": "sprintf-js", + "repository": { + "type": "git", + "url": "git+https://github.com/alexei/sprintf.js.git" + }, + "scripts": { + "test": "mocha test/test.js" + }, + "version": "1.0.3" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/string-width/package.json b/tools/node_modules/eslint/node_modules/string-width/package.json index b9b20caaf6f1cd..e2b884cb399042 100644 --- a/tools/node_modules/eslint/node_modules/string-width/package.json +++ b/tools/node_modules/eslint/node_modules/string-width/package.json @@ -1,56 +1,65 @@ { - "name": "string-width", - "version": "4.2.2", - "description": "Get the visual width of a string - the number of columns required to display it", - "license": "MIT", - "repository": "sindresorhus/string-width", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "string", - "character", - "unicode", - "width", - "visual", - "column", - "columns", - "fullwidth", - "full-width", - "full", - "ansi", - "escape", - "codes", - "cli", - "command-line", - "terminal", - "console", - "cjk", - "chinese", - "japanese", - "korean", - "fixed-width" - ], - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.1", - "xo": "^0.24.0" - } -} + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/string-width/issues" + }, + "bundleDependencies": false, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "deprecated": false, + "description": "Get the visual width of a string - the number of columns required to display it", + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.1", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/sindresorhus/string-width#readme", + "keywords": [ + "string", + "character", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "license": "MIT", + "name": "string-width", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/string-width.git" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "version": "4.2.2" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/strip-ansi/package.json b/tools/node_modules/eslint/node_modules/strip-ansi/package.json index 65a6c95161f747..5db6f68dc0aef7 100644 --- a/tools/node_modules/eslint/node_modules/strip-ansi/package.json +++ b/tools/node_modules/eslint/node_modules/strip-ansi/package.json @@ -1,54 +1,63 @@ { - "name": "strip-ansi", - "version": "6.0.0", - "description": "Strip ANSI escape codes from a string", - "license": "MIT", - "repository": "chalk/strip-ansi", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "strip", - "trim", - "remove", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.10.0", - "xo": "^0.25.3" - } -} + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/strip-ansi/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "deprecated": false, + "description": "Strip ANSI escape codes from a string", + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/chalk/strip-ansi#readme", + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "name": "strip-ansi", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/strip-ansi.git" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "version": "6.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/strip-json-comments/package.json b/tools/node_modules/eslint/node_modules/strip-json-comments/package.json index ce7875aa0d1963..d28e657025b6e9 100644 --- a/tools/node_modules/eslint/node_modules/strip-json-comments/package.json +++ b/tools/node_modules/eslint/node_modules/strip-json-comments/package.json @@ -1,47 +1,56 @@ { - "name": "strip-json-comments", - "version": "3.1.1", - "description": "Strip comments from JSON. Lets you use comments in your JSON files!", - "license": "MIT", - "repository": "sindresorhus/strip-json-comments", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd", - "bench": "matcha benchmark.js" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "json", - "strip", - "comments", - "remove", - "delete", - "trim", - "multiline", - "parse", - "config", - "configuration", - "settings", - "util", - "env", - "environment", - "jsonc" - ], - "devDependencies": { - "ava": "^1.4.1", - "matcha": "^0.7.0", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/strip-json-comments/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Strip comments from JSON. Lets you use comments in your JSON files!", + "devDependencies": { + "ava": "^1.4.1", + "matcha": "^0.7.0", + "tsd": "^0.7.2", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "funding": "https://github.com/sponsors/sindresorhus", + "homepage": "https://github.com/sindresorhus/strip-json-comments#readme", + "keywords": [ + "json", + "strip", + "comments", + "remove", + "delete", + "trim", + "multiline", + "parse", + "config", + "configuration", + "settings", + "util", + "env", + "environment", + "jsonc" + ], + "license": "MIT", + "name": "strip-json-comments", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/strip-json-comments.git" + }, + "scripts": { + "bench": "matcha benchmark.js", + "test": "xo && ava && tsd" + }, + "version": "3.1.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/supports-color/index.js b/tools/node_modules/eslint/node_modules/supports-color/index.js index 6fada390fb88d8..1704131bdf6c8f 100644 --- a/tools/node_modules/eslint/node_modules/supports-color/index.js +++ b/tools/node_modules/eslint/node_modules/supports-color/index.js @@ -1,31 +1,22 @@ 'use strict'; const os = require('os'); -const tty = require('tty'); const hasFlag = require('has-flag'); -const {env} = process; +const env = process.env; let forceColor; if (hasFlag('no-color') || hasFlag('no-colors') || - hasFlag('color=false') || - hasFlag('color=never')) { - forceColor = 0; + hasFlag('color=false')) { + forceColor = false; } else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) { - forceColor = 1; + forceColor = true; } - if ('FORCE_COLOR' in env) { - if (env.FORCE_COLOR === 'true') { - forceColor = 1; - } else if (env.FORCE_COLOR === 'false') { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); - } + forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; } function translateLevel(level) { @@ -41,8 +32,8 @@ function translateLevel(level) { }; } -function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { +function supportsColor(stream) { + if (forceColor === false) { return 0; } @@ -56,21 +47,22 @@ function supportsColor(haveStream, streamIsTTY) { return 2; } - if (haveStream && !streamIsTTY && forceColor === undefined) { + if (stream && !stream.isTTY && forceColor !== true) { return 0; } - const min = forceColor || 0; - - if (env.TERM === 'dumb') { - return min; - } + const min = forceColor ? 1 : 0; if (process.platform === 'win32') { - // Windows 10 build 10586 is the first Windows release that supports 256 colors. - // Windows 10 build 14931 is the first release that supports 16m/TrueColor. + // Node.js 7.5.0 is the first version of Node.js to include a patch to + // libuv that enables 256 color output on Windows. Anything earlier and it + // won't work. However, here we target Node.js 8 at minimum as it is an LTS + // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows + // release that supports 256 colors. Windows 10 build 14931 is the first release + // that supports 16m/TrueColor. const osRelease = os.release().split('.'); if ( + Number(process.versions.node.split('.')[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586 ) { @@ -81,7 +73,7 @@ function supportsColor(haveStream, streamIsTTY) { } if ('CI' in env) { - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { return 1; } @@ -120,16 +112,20 @@ function supportsColor(haveStream, streamIsTTY) { return 1; } + if (env.TERM === 'dumb') { + return min; + } + return min; } function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); + const level = supportsColor(stream); return translateLevel(level); } module.exports = { supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) + stdout: getSupportLevel(process.stdout), + stderr: getSupportLevel(process.stderr) }; diff --git a/tools/node_modules/eslint/node_modules/supports-color/package.json b/tools/node_modules/eslint/node_modules/supports-color/package.json index f7182edcea2baa..9e4eafa8573232 100644 --- a/tools/node_modules/eslint/node_modules/supports-color/package.json +++ b/tools/node_modules/eslint/node_modules/supports-color/package.json @@ -1,53 +1,62 @@ { - "name": "supports-color", - "version": "7.2.0", - "description": "Detect whether a terminal supports color", - "license": "MIT", - "repository": "chalk/supports-color", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js", - "browser.js" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "ansi", - "styles", - "tty", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "support", - "supports", - "capability", - "detect", - "truecolor", - "16m" - ], - "dependencies": { - "has-flag": "^4.0.0" - }, - "devDependencies": { - "ava": "^1.4.1", - "import-fresh": "^3.0.0", - "xo": "^0.24.0" - }, - "browser": "browser.js" -} + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "browser": "browser.js", + "bugs": { + "url": "https://github.com/chalk/supports-color/issues" + }, + "bundleDependencies": false, + "dependencies": { + "has-flag": "^3.0.0" + }, + "deprecated": false, + "description": "Detect whether a terminal supports color", + "devDependencies": { + "ava": "^0.25.0", + "import-fresh": "^2.0.0", + "xo": "^0.20.0" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js", + "browser.js" + ], + "homepage": "https://github.com/chalk/supports-color#readme", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect", + "truecolor", + "16m" + ], + "license": "MIT", + "name": "supports-color", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/supports-color.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "5.5.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/supports-color/readme.md b/tools/node_modules/eslint/node_modules/supports-color/readme.md index 36542285863330..f6e40195730ae8 100644 --- a/tools/node_modules/eslint/node_modules/supports-color/readme.md +++ b/tools/node_modules/eslint/node_modules/supports-color/readme.md @@ -44,7 +44,7 @@ The `stdout`/`stderr` objects specifies a level of support for color through a ` It obeys the `--color` and `--no-color` CLI flags. -For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. +Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. @@ -61,16 +61,6 @@ Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color= - [Josh Junon](https://github.com/qix-) ---- +## License -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
- ---- +MIT diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/.tonic_example.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/.tonic_example.js index 2b0d6683eefe29..7579d21c5bafcf 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/.tonic_example.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/.tonic_example.js @@ -1,20 +1,20 @@ -var Ajv = require("ajv") -var ajv = new Ajv({allErrors: true}) +const Ajv = require("ajv").default +const ajv = new Ajv({allErrors: true}) -var schema = { +const schema = { properties: { foo: {type: "string"}, bar: {type: "number", maximum: 3}, }, } -var validate = ajv.compile(schema) +const validate = ajv.compile(schema) test({foo: "abc", bar: 2}) test({foo: 2, bar: 4}) function test(data) { - var valid = validate(data) + const valid = validate(data) if (valid) console.log("Valid!") else console.log("Invalid: " + ajv.errorsText(validate.errors)) } diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/LICENSE b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/LICENSE index 96ee719987f778..139162ad2c389a 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/LICENSE +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2017 Evgeny Poberezkin +Copyright (c) 2015-2021 Evgeny Poberezkin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/README.md b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/README.md index ec11b9be7c503a..2641e8b5d97310 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/README.md +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/README.md @@ -1,8 +1,10 @@ -Ajv logo +Ajv logo + +  # Ajv: Another JSON schema validator -The fastest JSON schema validator for Node.js and browser. +Super fast JSON schema validator for Node.js and browser. Supports JSON Schema draft-06/07/2019-09 (draft-04 is supported in [version 6](https://github.com/ajv-validator/ajv/tree/v6)) and JSON Type Definition [RFC8927](https://datatracker.ietf.org/doc/rfc8927/). @@ -15,14 +17,14 @@ Supports JSON Schema draft-06/07/2019-09 (draft-04 is supported in [version 6](h ## Platinum sponsors -[](https://www.mozilla.org)[](https://opencollective.com/ajv)[](https://opencollective.com/ajv) +[](https://www.mozilla.org)[](https://opencollective.com/ajv) ## Using version 7 Ajv version 7 has these new features: -- support of JSON Schema draft-2019-09 features: [`unevaluatedProperties`](./docs/json-schema.md#unevaluatedproperties) and [`unevaluatedItems`](./docs/json-schema.md#unevaluateditems), [dynamic recursive references](./docs/validation.md#extending-recursive-schemas) and other [additional keywords](./docs/json-schema.md#json-schema-draft-2019-09). -- NEW: support of JSON Type Definition [RFC8927](https://datatracker.ietf.org/doc/rfc8927/) (from [v7.1.0](https://github.com/ajv-validator/ajv-keywords/releases/tag/v7.1.0)) +- NEW: support of JSON Type Definition [RFC8927](https://datatracker.ietf.org/doc/rfc8927/) (from [v7.1.0](https://github.com/ajv-validator/ajv-keywords/releases/tag/v7.1.0)), including generation of [serializers](./docs/api.md#jtd-serialize) and [parsers](./docs/api.md#jtd-parse) from JTD schemas that are more efficient than native JSON serialization/parsing, combining JSON string parsing and validation in one function. +- support of JSON Schema draft-2019-09 features: [`unevaluatedProperties`](./docs/json-schema.md#unevaluatedproperties) and [`unevaluatedItems`](./docs/json-schema.md#unevaluateditems), [dynamic recursive references](./docs/guide/combining-schemas.md#extending-recursive-schemas) and other [additional keywords](./docs/json-schema.md#json-schema-draft-2019-09). - to reduce the mistakes in JSON schemas and unexpected validation results, [strict mode](./docs/strict-mode.md) is added - it prohibits ignored or ambiguous JSON Schema elements. - to make code injection from untrusted schemas impossible, [code generation](./docs/codegen.md) is fully re-written to be safe and to allow code optimization (compiled schema code size is reduced by more than 10%). - to simplify Ajv extensions, the new keyword API that is used by pre-defined keywords is available to user-defined keywords - it is much easier to define any keywords now, especially with subschemas. [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package was updated to use the new API (in [v4.0.0](https://github.com/ajv-validator/ajv-keywords/releases/tag/v4.0.0)) @@ -46,9 +48,25 @@ See [Getting started](#usage) for code example. ## Contributing -100+ people contributed to Ajv. You are very welcome to join by implementing new features that are valuable to many users and by improving documentation. +More than 100 people contributed to Ajv, and we would love to have you join the development. We welcome implementing new features that will benefit many users and ideas to improve our documentation. + +At Ajv, we are committed to creating more equitable and inclusive spaces for our community and team members to contribute to discussions that affect both this project and our ongoing work in the open source ecosystem. + +We strive to create an environment of respect and healthy discourse by setting standards for our interactions and we expect it from all members of our community - from long term project member to first time visitor. For more information, review our [code of conduct](./CODE_OF_CONDUCT.md) and values. + +### How we make decisions + +We value conscious curation of our library size, and balancing performance and functionality. To that end, we cannot accept every suggestion. When evaluating pull requests we consider: -Please do not be disappointed if your suggestion is not accepted - it is important to maintain the balance between the library size, performance and functionality. If it seems that a feature would benefit only a small number of users, its addition may be delayed until there is more support from the users community - so please submit the issue first to explain why this feature is important. +- Will this benefit many users or a niche use case? +- How will this impact the performance of Ajv? +- How will this expand our library size? + +To help us evaluate and understand, when you submit an issue and pull request: + +- Explain why this feature is important to the user base +- Include documentation +- Include test coverage with any new feature implementations Please include documentation and test coverage with any new feature implementations. @@ -62,7 +80,7 @@ npm test `npm run build` - compiles typescript to `dist` folder. -Please review [Contributing guidelines](./CONTRIBUTING.md) and [Code components](./docs/components.md). +Please also review [Contributing guidelines](./CONTRIBUTING.md) and [Code components](./docs/components.md). ## Contents @@ -74,14 +92,12 @@ Please review [Contributing guidelines](./CONTRIBUTING.md) and [Code components] - [Performance](#performance) - [Features](#features) - [Getting started](#usage) -- [Choosing schema language](#choosing-schema-language) - - [JSON Schema](#json-schema) - - [JSON Type Definition](#json-type-definition) +- [Choosing schema language: JSON Schema vs JSON Type Definition](./docs/guide/schema-language.md#comparison) - [Frequently Asked Questions](./docs/faq.md) -- [Using in browser](#using-in-browser) +- [Using in browser](./docs/guide/environments.md#browsers) - [Content Security Policy](./docs/security.md#content-security-policy) -- [Using in ES5 environment](#using-in-es5-environment) -- [Command line interface](#command-line-interface) +- [Using in ES5 environment](./docs/guide/environments.md#es5-environments) +- [Command line interface](./docs/guide/environments.md#command-line-interface) - [API reference](./docs/api.md) - [Methods](./docs/api.md#ajv-constructor-and-methods) - [Options](./docs/api.md#options) @@ -91,16 +107,17 @@ Please review [Contributing guidelines](./CONTRIBUTING.md) and [Code components] - [Prevent unexpected validation](./docs/strict-mode.md#prevent-unexpected-validation) - [Strict types](./docs/strict-mode.md#strict-types) - [Strict number validation](./docs/strict-mode.md#strict-number-validation) -- [Data validation](./docs/validation.md) - - [Validation basics](./docs/validation.md#validation-basics): [JSON Schema keywords](./docs/validation.md#validation-keywords), [annotations](./docs/validation.md#annotation-keywords), [formats](./docs/validation.md#formats) - - [Modular schemas](./docs/validation.md#modular-schemas): [combining with \$ref](./docs/validation.md#ref), [\$data reference](./docs/validation.md#data-reference), [$merge and $patch](./docs/validation.md#merge-and-patch-keywords) - - [Asynchronous schema compilation](./docs/validation.md#asynchronous-schema-compilation) +- [Validation guide](./docs/guide/getting-started.md) + - [Getting started](./docs/guide/getting-started.md) + - [Validating formats](./docs/guide/formats.md) + - [Modular schemas](./docs/guide/combining-schemas.md): [combining with \$ref](./docs/guide/combining-schemas#ref), [\$data reference](./docs/guide/combining-schemas.md#data-reference), [$merge and $patch](./docs/guide/combining-schemas#merge-and-patch-keywords) + - [Asynchronous schema compilation](./docs/guide/managing-schemas.md#asynchronous-schema-compilation) - [Standalone validation code](./docs/standalone.md) - - [Asynchronous validation](./docs/validation.md#asynchronous-validation) - - [Modifying data](./docs/validation.md#modifying-data-during-validation): [additional properties](./docs/validation.md#removing-additional-properties), [defaults](./docs/validation.md#assigning-defaults), [type coercion](./docs/validation.md#coercing-data-types) + - [Asynchronous validation](./docs/guide/async-validation.md) + - [Modifying data](./docs/guide/modifying-data.md): [additional properties](./docs/guide/modifying-data.md#removing-additional-properties), [defaults](./docs/guide/modifying-data.md#assigning-defaults), [type coercion](./docs/guide/modifying-data.md#coercing-data-types) - [Extending Ajv](#extending-ajv) - User-defined keywords: - - [basics](./docs/validation.md#user-defined-keywords) + - [basics](./docs/guide/user-keywords.md) - [guide](./docs/keywords.md) - [Plugins](#plugins) - [Related packages](#related-packages) @@ -117,7 +134,7 @@ Please review [Contributing guidelines](./CONTRIBUTING.md) and [Code components] ## Mozilla MOSS grant and OpenJS Foundation -[](https://www.mozilla.org/en-US/moss/)     [](https://openjsf.org/blog/2020/08/14/ajv-joins-openjs-foundation-as-an-incubation-project/) +[](https://www.mozilla.org/en-US/moss/)[](https://openjsf.org/blog/2020/08/14/ajv-joins-openjs-foundation-as-an-incubation-project/) Ajv has been awarded a grant from Mozilla’s [Open Source Support (MOSS) program](https://www.mozilla.org/en-US/moss/) in the “Foundational Technology” track! It will sponsor the development of Ajv support of [JSON Schema version 2019-09](https://tools.ietf.org/html/draft-handrews-json-schema-02) and of [JSON Type Definition (RFC8927)](https://datatracker.ietf.org/doc/rfc8927/). @@ -185,18 +202,18 @@ Performance of different validators by [json-schema-benchmark](https://github.co - meta-schema for JTD schemas - "union" keyword and user-defined keywords (can be used inside "metadata" member of the schema) - supports [browsers](#using-in-browser) and Node.js 0.10-14.x -- [asynchronous loading](./docs/validation.md#asynchronous-schema-compilation) of referenced schemas during compilation +- [asynchronous loading](./docs/guide/managing-schemas.md#asynchronous-schema-compilation) of referenced schemas during compilation - "All errors" validation mode with [option allErrors](./docs/api.md#options) - [error messages with parameters](./docs/api.md#validation-errors) describing error reasons to allow error message generation - i18n error messages support with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package -- [removing-additional-properties](./docs/validation.md#removing-additional-properties) -- [assigning defaults](./docs/validation.md#assigning-defaults) to missing properties and items -- [coercing data](./docs/validation.md#coercing-data-types) to the types specified in `type` keywords +- [removing-additional-properties](./docs/guide/modifying-data.md#removing-additional-properties) +- [assigning defaults](./docs/guide/modifying-data.md#assigning-defaults) to missing properties and items +- [coercing data](./docs/guide/modifying-data.md#coercing-data-types) to the types specified in `type` keywords - [user-defined keywords](#user-defined-keywords) - draft-06/07 keywords `const`, `contains`, `propertyNames` and `if/then/else` - draft-06 boolean schemas (`true`/`false` as a schema to always pass/fail). - additional extension keywords with [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package -- [\$data reference](./docs/validation.md#data-reference) to use values from the validated data as values for the schema keywords +- [\$data reference](./docs/guide/combining-schemas.md#data-reference) to use values from the validated data as values for the schema keywords - [asynchronous validation](./docs/api.md#asynchronous-validation) of user-defined formats and keywords ## Install @@ -225,215 +242,13 @@ const valid = validate(data) if (!valid) console.log(validate.errors) ``` -In TypeScript: - -```typescript -import Ajv, {JSONSchemaType, DefinedError} from "ajv" - -const ajv = new Ajv() - -type MyData = {foo: number} - -// Optional schema type annotation for schema to match MyData type. -// To use JSONSchemaType set `strictNullChecks: true` in tsconfig `compilerOptions`. -const schema: JSONSchemaType = { - type: "object", - properties: { - foo: {type: "number", minimum: 0}, - }, - required: ["foo"], - additionalProperties: false, -} - -// validate is a type guard for MyData - type is inferred from schema type -const validate = ajv.compile(schema) - -// or, if you did not use type annotation for the schema, -// type parameter can be used to make it type guard: -// const validate = ajv.compile(schema) - -const data: any = {foo: 1} - -if (validate(data)) { - // data is MyData here - console.log(data.foo) -} else { - // The type cast is needed to allow user-defined keywords and errors - // You can extend this type to include your error types as needed. - for (const err of validate.errors as DefinedError[]) { - switch (err.keyword) { - case "minimum": - // err type is narrowed here to have "minimum" error params properties - console.log(err.params.limit) - break - // ... - } - } -} -``` - -With JSON Type Definition schema: - -```javascript -const Ajv = require("ajv").default - -const ajv = new Ajv() // options can be passed, e.g. {allErrors: true} -const schema = { - properties: { - foo: {type: "float64"}, - }, -} -const validate = ajv.compile(schema) -const valid = validate({foo: 1}) // true -if (!valid) console.log(validate.errors) -// Unlike JSON Schema: -const valid1 = validate(1) // false, bot an object -const valid2 = validate({}) // false, foo is required -const valid3 = validate({foo: 1, bar: 2}) // false, bar is additional -``` - -See [this test](./spec/types/json-schema.spec.ts) for an advanced example, [API reference](./docs/api.md) and [Options](./docs/api.md#options) for more details. - -Ajv compiles schemas to functions and caches them in all cases (using schema itself as a key for Map) or another function passed via options), so that the next time the same schema is used (not necessarily the same object instance) it won't be compiled again. - -The best performance is achieved when using compiled functions returned by `compile` or `getSchema` methods (there is no additional function call). - -**Please note**: every time a validation function or `ajv.validate` are called `errors` property is overwritten. You need to copy `errors` array reference to another variable if you want to use it later (e.g., in the callback). See [Validation errors](./docs/api.md#validation-errors) - -## Using in browser - -See [Content Security Policy](./docs/security.md#content-security-policy) to decide the best approach how to use Ajv in the browser. - -Whether you use Ajv or compiled schemas, it is recommended that you bundle them together with your code. - -If you need to use Ajv in several bundles you can create a separate UMD bundles using `npm run bundle` script. - -Then you need to load Ajv with support of JSON Schema draft-07 in the browser: - -```html - - -``` - -To load the bundle that supports JSON Schema draft-2019-09: - -```html - - -``` - -To load the bundle that supports JSON Type Definition: - -```html - - -``` - -This bundle can be used with different module systems; it creates global `ajv` (or `ajv2019`) if no module system is found. - -The browser bundle is available on [cdnjs](https://cdnjs.com/libraries/ajv). - -**Please note**: some frameworks, e.g. Dojo, may redefine global require in a way that is not compatible with CommonJS module format. In this case Ajv bundle has to be loaded before the framework and then you can use global `ajv` (see issue [#234](https://github.com/ajv-validator/ajv/issues/234)). - -## Choosing schema language - -Both JSON Schema and JSON Type Definition are cross-platform specifications with implementations in multiple programming languages that help you define the shape and requirements to your JSON data. - -This section compares their pros/cons to help decide which specification fits your application better. - -### JSON Schema - -- Pros - - Wide specification adoption. - - Used as part of OpenAPI specification. - - Support of complex validation scenarios: - - untagged unions and boolean logic - - conditional schemas and dependencies - - restrictions on the number ranges and the size of strings, arrays and objects - - semantic validation with formats, patterns and content keywords - - distribute strict record definitions across multiple schemas (with unevaluatedProperties) - - Can be effectively used for validation of any JavaScript objects and configuration files. -- Cons - - Defines the collection of restrictions on the data, rather than the shape of the data. - - No standard support for tagged unions. - - Complex and error prone for the new users (Ajv has [strict mode](./docs/strict-mode) to compensate for it, but it is not cross-platform). - - Some parts of specification are difficult to implement, creating the risk of implementations divergence: - - reference resolution model - - unevaluatedProperties/unevaluatedItems - - dynamic recursive references - - Internet draft status (rather than RFC) - -See [JSON Schema](./docs/json-schema.md) for the list of defined keywords. - -### JSON Type Definition - -- Pros: - - Aligned with type systems of many languages - can be used to generate type definitions and efficient parsers and serializers to/from these types. - - Very simple, enforcing the best practices for cross-platform JSON API modelling. - - Simple to implement, ensuring consistency across implementations. - - Defines the shape of JSON data via strictly defined schema forms (rather than the collection of restrictions). - - Effective support for tagged unions. - - Designed to protect against user mistakes. - - Approved as [RFC8927](https://datatracker.ietf.org/doc/rfc8927/) -- Cons: - - Limited, compared with JSON Schema - no support for untagged unions\*, conditionals, references between different schema files\*\*, etc. - - No meta-schema in the specification\*. - - Brand new - limited industry adoption (as of January 2021). - -\* Ajv defines meta-schema for JTD schemas and non-standard keyword "union" that can be used inside "metadata" object. - -\*\* You can still combine schemas from multiple files in the application code. - -See [JSON Type Definition](./docs/json-type-definition.md) for the list of defined schema forms. - -## Using in ES5 environment - -You need to: - -- recompile Typescript to ES5 target - it is set to 2018 in the bundled compiled code. -- generate ES5 validation code: - -```javascript -const ajv = new Ajv({code: {es5: true}}) -``` - -See [Advanced options](https://github.com/ajv-validator/ajv/blob/master/docs/api.md#advanced-options). - -## Command line interface - -CLI is available as a separate npm package [ajv-cli](https://github.com/ajv-validator/ajv-cli). It supports: - -- compiling JSON Schemas to test their validity -- generating [standalone validation code](./docs/standalone.md) that exports validation function(s) to be used without Ajv -- migrating schemas to draft-07 and draft-2019-09 (using [json-schema-migrate](https://github.com/epoberezkin/json-schema-migrate)) -- validating data file(s) against JSON Schema -- testing expected validity of data against JSON Schema -- referenced schemas -- user-defined meta-schemas, validation keywords and formats -- files in JSON, JSON5, YAML, and JavaScript format -- all Ajv options -- reporting changes in data after validation in [JSON-patch](https://datatracker.ietf.org/doc/rfc6902/) format +See more examples in [Guide: getting started](./docs/guide/getting-started) ## Extending Ajv ### User defined keywords -See section in [data validation](./docs/validation.md#user-defined-keywords) and the [detailed guide](./docs/keywords.md). +See section in [data validation](./docs/guide/user-keywords.md) and the [detailed guide](./docs/keywords.md). ### Plugins @@ -486,7 +301,7 @@ If you have published a useful plugin please submit a PR to add it to the next s ## Changes history -See https://github.com/ajv-validator/ajv/releases +See [https://github.com/ajv-validator/ajv/releases](https://github.com/ajv-validator/ajv/releases) **Please note**: [Changes in version 7.0.0](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0) diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/index.js index 6695ba041c45d6..d2ff4643de6330 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/index.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/index.js @@ -26,6 +26,7 @@ exports.operators = { NOT: new code_1._Code("!"), OR: new code_1._Code("||"), AND: new code_1._Code("&&"), + ADD: new code_1._Code("+"), }; class Node { optimizeNodes() { @@ -79,6 +80,15 @@ class Assign extends Node { return addExprNames(names, this.rhs); } } +class AssignOp extends Assign { + constructor(lhs, op, rhs, sideEffects) { + super(lhs, rhs, sideEffects); + this.op = op; + } + render({ _n }) { + return `${this.lhs} ${this.op}= ${this.rhs};` + _n; + } +} class Label extends Node { constructor(label) { super(); @@ -418,6 +428,10 @@ class CodeGen { assign(lhs, rhs, sideEffects) { return this._leafNode(new Assign(lhs, rhs, sideEffects)); } + // `+=` code + add(lhs, rhs) { + return this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs)); + } // appends passed SafeExpr to code or executes Block code(c) { if (typeof c == "function") diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/index.js index 05a7a27df28242..1e3d4d967ebc43 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/index.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/index.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.resolveSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0; +exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0; const codegen_1 = require("./codegen"); const error_classes_1 = require("./error_classes"); const names_1 = require("./names"); @@ -57,6 +57,7 @@ function compileSchema(sch) { dataPathArr: [codegen_1.nil], dataLevel: 0, dataTypes: [], + definedProperties: new Set(), topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true ? { ref: sch.schema, code: codegen_1.stringify(sch.schema) } : { ref: sch.schema }), @@ -151,6 +152,7 @@ function getCompilingSchema(schEnv) { return sch; } } +exports.getCompilingSchema = getCompilingSchema; function sameSchemaEnv(s1, s2) { return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId; } diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/parse.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/parse.js new file mode 100644 index 00000000000000..f1427d66ddda12 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/parse.js @@ -0,0 +1,341 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const types_1 = require("./types"); +const __1 = require(".."); +const codegen_1 = require("../codegen"); +const error_classes_1 = require("../error_classes"); +const names_1 = require("../names"); +const code_1 = require("../../vocabularies/code"); +const ref_1 = require("../../vocabularies/jtd/ref"); +const type_1 = require("../../vocabularies/jtd/type"); +const parseJson_1 = require("../../runtime/parseJson"); +const util_1 = require("../util"); +const timestamp_1 = require("../timestamp"); +const genParse = { + elements: parseElements, + values: parseValues, + discriminator: parseDiscriminator, + properties: parseProperties, + optionalProperties: parseProperties, + enum: parseEnum, + type: parseType, + ref: parseRef, +}; +function compileParser(sch, definitions) { + const _sch = __1.getCompilingSchema.call(this, sch); + if (_sch) + return _sch; + const { es5, lines } = this.opts.code; + const { ownProperties } = this.opts; + const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); + const parseName = gen.scopeName("parse"); + const cxt = { + self: this, + gen, + schema: sch.schema, + schemaEnv: sch, + definitions, + data: names_1.default.data, + parseName, + char: gen.name("c"), + }; + let sourceCode; + try { + this._compilations.add(sch); + sch.parseName = parseName; + parserFunction(cxt); + gen.optimize(this.opts.code.optimize); + const parseFuncCode = gen.toString(); + sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${parseFuncCode}`; + const makeParse = new Function(`${names_1.default.scope}`, sourceCode); + const parse = makeParse(this.scope.get()); + this.scope.value(parseName, { ref: parse }); + sch.parse = parse; + } + catch (e) { + if (sourceCode) + this.logger.error("Error compiling parser, function code:", sourceCode); + delete sch.parse; + delete sch.parseName; + throw e; + } + finally { + this._compilations.delete(sch); + } + return sch; +} +exports.default = compileParser; +const undef = codegen_1._ `undefined`; +function parserFunction(cxt) { + const { gen, parseName, char } = cxt; + gen.func(parseName, codegen_1._ `${names_1.default.json}, ${names_1.default.jsonPos}, ${names_1.default.jsonPart}`, false, () => { + gen.let(names_1.default.data); + gen.let(char); + gen.assign(codegen_1._ `${parseName}.message`, undef); + gen.assign(codegen_1._ `${parseName}.position`, undef); + gen.assign(names_1.default.jsonPos, codegen_1._ `${names_1.default.jsonPos} || 0`); + gen.const(names_1.default.jsonLen, codegen_1._ `${names_1.default.json}.length`); + parseCode(cxt); + skipWhitespace(cxt); + gen.if(names_1.default.jsonPart, () => { + gen.assign(codegen_1._ `${parseName}.position`, names_1.default.jsonPos); + gen.return(names_1.default.data); + }); + gen.if(codegen_1._ `${names_1.default.jsonPos} === ${names_1.default.jsonLen}`, () => gen.return(names_1.default.data)); + jsonSyntaxError(cxt); + }); +} +function parseCode(cxt) { + let form; + for (const key of types_1.jtdForms) { + if (key in cxt.schema) { + form = key; + break; + } + } + if (form) + parseNullable(cxt, genParse[form]); + else + parseEmpty(cxt); +} +const parseBoolean = parseBooleanToken(true, parseBooleanToken(false, jsonSyntaxError)); +function parseNullable(cxt, parseForm) { + const { gen, schema, data } = cxt; + if (!schema.nullable) + return parseForm(cxt); + tryParseToken(cxt, "null", parseForm, () => gen.assign(data, null)); +} +function parseElements(cxt) { + const { gen, schema, data } = cxt; + parseToken(cxt, "["); + const ix = gen.let("i", 0); + gen.assign(data, codegen_1._ `[]`); + parseItems(cxt, "]", () => { + const el = gen.let("el"); + parseCode({ ...cxt, schema: schema.elements, data: el }); + gen.assign(codegen_1._ `${data}[${ix}++]`, el); + }); +} +function parseValues(cxt) { + const { gen, schema, data } = cxt; + parseToken(cxt, "{"); + gen.assign(data, codegen_1._ `{}`); + parseItems(cxt, "}", () => parseKeyValue(cxt, schema.values)); +} +function parseItems(cxt, endToken, block) { + tryParseItems(cxt, endToken, block); + parseToken(cxt, endToken); +} +function tryParseItems(cxt, endToken, block) { + const { gen } = cxt; + gen.for(codegen_1._ `;${names_1.default.jsonPos}<${names_1.default.jsonLen} && ${jsonSlice(1)}!==${endToken};`, () => { + block(); + tryParseToken(cxt, ",", () => gen.break(), hasItem); + }); + function hasItem() { + tryParseToken(cxt, endToken, () => { }, jsonSyntaxError); + } +} +function parseKeyValue(cxt, schema) { + const { gen } = cxt; + const key = gen.let("key"); + parseString({ ...cxt, data: key }); + parseToken(cxt, ":"); + parsePropertyValue(cxt, key, schema); +} +function parseDiscriminator(cxt) { + const { gen, data, schema } = cxt; + const { discriminator, mapping } = schema; + parseToken(cxt, "{"); + gen.assign(data, codegen_1._ `{}`); + const startPos = gen.const("pos", names_1.default.jsonPos); + const value = gen.let("value"); + const tag = gen.let("tag"); + tryParseItems(cxt, "}", () => { + const key = gen.let("key"); + parseString({ ...cxt, data: key }); + parseToken(cxt, ":"); + gen.if(codegen_1._ `${key} === ${discriminator}`, () => { + parseString({ ...cxt, data: tag }); + gen.assign(codegen_1._ `${data}[${key}]`, tag); + gen.break(); + }, () => parseEmpty({ ...cxt, data: value }) // can be discarded/skipped + ); + }); + gen.assign(names_1.default.jsonPos, startPos); + gen.if(codegen_1._ `${tag} === undefined`); + parsingError(cxt, codegen_1.str `discriminator tag not found`); + for (const tagValue in mapping) { + gen.elseIf(codegen_1._ `${tag} === ${tagValue}`); + parseSchemaProperties({ ...cxt, schema: mapping[tagValue] }, discriminator); + } + gen.else(); + parsingError(cxt, codegen_1.str `discriminator value not in schema`); + gen.endIf(); +} +function parseProperties(cxt) { + const { gen, data } = cxt; + parseToken(cxt, "{"); + gen.assign(data, codegen_1._ `{}`); + parseSchemaProperties(cxt); +} +function parseSchemaProperties(cxt, discriminator) { + const { gen, schema, data } = cxt; + const { properties, optionalProperties, additionalProperties } = schema; + parseItems(cxt, "}", () => { + const key = gen.let("key"); + parseString({ ...cxt, data: key }); + parseToken(cxt, ":"); + gen.if(false); + parseDefinedProperty(cxt, key, properties); + parseDefinedProperty(cxt, key, optionalProperties); + if (discriminator) { + gen.elseIf(codegen_1._ `${key} === ${discriminator}`); + const tag = gen.let("tag"); + parseString({ ...cxt, data: tag }); // can be discarded, it is already assigned + } + gen.else(); + if (additionalProperties) { + parseEmpty({ ...cxt, data: codegen_1._ `${data}[${key}]` }); + } + else { + parsingError(cxt, codegen_1.str `property ${key} not allowed`); + } + gen.endIf(); + }); + if (properties) { + const hasProp = code_1.hasPropFunc(gen); + const allProps = codegen_1.and(...Object.keys(properties).map((p) => codegen_1._ `${hasProp}.call(${data}, ${p})`)); + gen.if(codegen_1.not(allProps), () => parsingError(cxt, codegen_1.str `missing required properties`)); + } +} +function parseDefinedProperty(cxt, key, schemas = {}) { + const { gen } = cxt; + for (const prop in schemas) { + gen.elseIf(codegen_1._ `${key} === ${prop}`); + parsePropertyValue(cxt, key, schemas[prop]); + } +} +function parsePropertyValue(cxt, key, schema) { + parseCode({ ...cxt, schema, data: codegen_1._ `${cxt.data}[${key}]` }); +} +function parseType(cxt) { + const { gen, schema, data } = cxt; + switch (schema.type) { + case "boolean": + parseBoolean(cxt); + break; + case "string": + parseString(cxt); + break; + case "timestamp": { + // TODO parse timestamp? + parseString(cxt); + const vts = util_1.func(gen, timestamp_1.default); + gen.if(codegen_1._ `!${vts}(${data})`, () => parsingError(cxt, codegen_1.str `invalid timestamp`)); + break; + } + case "float32": + case "float64": + parseNumber(cxt); + break; + default: { + const [min, max, maxDigits] = type_1.intRange[schema.type]; + parseNumber(cxt, maxDigits); + gen.if(codegen_1._ `${data} < ${min} || ${data} > ${max}`, () => parsingError(cxt, codegen_1.str `integer out of range`)); + } + } +} +function parseString(cxt) { + parseToken(cxt, '"'); + parseWith(cxt, parseJson_1.parseJsonString); +} +function parseEnum(cxt) { + const { gen, data, schema } = cxt; + const enumSch = schema.enum; + parseToken(cxt, '"'); + // TODO loopEnum + gen.if(false); + for (const value of enumSch) { + const valueStr = JSON.stringify(value).slice(1); // remove starting quote + gen.elseIf(codegen_1._ `${jsonSlice(valueStr.length)} === ${valueStr}`); + gen.assign(data, codegen_1.str `${value}`); + gen.add(names_1.default.jsonPos, valueStr.length); + } + gen.else(); + jsonSyntaxError(cxt); + gen.endIf(); +} +function parseNumber(cxt, maxDigits) { + const { gen } = cxt; + skipWhitespace(cxt); + gen.if(codegen_1._ `"-0123456789".indexOf(${jsonSlice(1)}) < 0`, () => jsonSyntaxError(cxt), () => parseWith(cxt, parseJson_1.parseJsonNumber, maxDigits)); +} +function parseBooleanToken(bool, fail) { + return (cxt) => { + const { gen, data } = cxt; + tryParseToken(cxt, `${bool}`, () => fail(cxt), () => gen.assign(data, bool)); + }; +} +function parseRef(cxt) { + const { gen, self, definitions, schema, schemaEnv } = cxt; + const { ref } = schema; + const refSchema = definitions[ref]; + if (!refSchema) + throw new error_classes_1.MissingRefError("", ref, `No definition ${ref}`); + if (!ref_1.hasRef(refSchema)) + return parseCode({ ...cxt, schema: refSchema }); + const { root } = schemaEnv; + const sch = compileParser.call(self, new __1.SchemaEnv({ schema: refSchema, root }), definitions); + partialParse(cxt, getParser(gen, sch), true); +} +function getParser(gen, sch) { + return sch.parse + ? gen.scopeValue("parse", { ref: sch.parse }) + : codegen_1._ `${gen.scopeValue("wrapper", { ref: sch })}.parse`; +} +function parseEmpty(cxt) { + parseWith(cxt, parseJson_1.parseJson); +} +function parseWith(cxt, parseFunc, args) { + const f = cxt.gen.scopeValue("func", { + ref: parseFunc, + code: parseFunc.code, + }); + partialParse(cxt, f, args); +} +function partialParse(cxt, parseFunc, args) { + const { gen, data } = cxt; + gen.assign(data, codegen_1._ `${parseFunc}(${names_1.default.json}, ${names_1.default.jsonPos}${args ? codegen_1._ `, ${args}` : codegen_1.nil})`); + gen.assign(names_1.default.jsonPos, codegen_1._ `${parseFunc}.position`); + gen.if(codegen_1._ `${data} === undefined`, () => parsingError(cxt, codegen_1._ `${parseFunc}.message`)); +} +function parseToken(cxt, tok) { + tryParseToken(cxt, tok, jsonSyntaxError); +} +function tryParseToken(cxt, tok, fail, success) { + const { gen } = cxt; + const n = tok.length; + skipWhitespace(cxt); + gen.if(codegen_1._ `${jsonSlice(n)} === ${tok}`, () => { + gen.add(names_1.default.jsonPos, n); + success === null || success === void 0 ? void 0 : success(cxt); + }, () => fail(cxt)); +} +function skipWhitespace({ gen, char: c }) { + gen.code(codegen_1._ `while((${c}=${names_1.default.json}[${names_1.default.jsonPos}],${c}===" "||${c}==="\\n"||${c}==="\\r"||${c}==="\\t"))${names_1.default.jsonPos}++;`); +} +function jsonSlice(len) { + return len === 1 + ? codegen_1._ `${names_1.default.json}[${names_1.default.jsonPos}]` + : codegen_1._ `${names_1.default.json}.slice(${names_1.default.jsonPos}, ${names_1.default.jsonPos}+${len})`; +} +function jsonSyntaxError(cxt) { + parsingError(cxt, codegen_1._ `"unexpected token " + ${names_1.default.json}[${names_1.default.jsonPos}]`); +} +function parsingError({ gen, parseName }, msg) { + gen.assign(codegen_1._ `${parseName}.message`, msg); + gen.assign(codegen_1._ `${parseName}.position`, names_1.default.jsonPos); + gen.return(undef); +} +//# sourceMappingURL=parse.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js new file mode 100644 index 00000000000000..26148fef47c6f1 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js @@ -0,0 +1,223 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const types_1 = require("./types"); +const __1 = require(".."); +const codegen_1 = require("../codegen"); +const error_classes_1 = require("../error_classes"); +const names_1 = require("../names"); +const code_1 = require("../../vocabularies/code"); +const ref_1 = require("../../vocabularies/jtd/ref"); +const quote_1 = require("../../runtime/quote"); +const genSerialize = { + elements: serializeElements, + values: serializeValues, + discriminator: serializeDiscriminator, + properties: serializeProperties, + optionalProperties: serializeProperties, + enum: serializeString, + type: serializeType, + ref: serializeRef, +}; +function compileSerializer(sch, definitions) { + const _sch = __1.getCompilingSchema.call(this, sch); + if (_sch) + return _sch; + const { es5, lines } = this.opts.code; + const { ownProperties } = this.opts; + const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); + const serializeName = gen.scopeName("serialize"); + const cxt = { + self: this, + gen, + schema: sch.schema, + schemaEnv: sch, + definitions, + data: names_1.default.data, + }; + let sourceCode; + try { + this._compilations.add(sch); + sch.serializeName = serializeName; + gen.func(serializeName, names_1.default.data, false, () => { + gen.let(names_1.default.json, codegen_1.str ``); + serializeCode(cxt); + gen.return(names_1.default.json); + }); + gen.optimize(this.opts.code.optimize); + const serializeFuncCode = gen.toString(); + sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${serializeFuncCode}`; + const makeSerialize = new Function(`${names_1.default.scope}`, sourceCode); + const serialize = makeSerialize(this.scope.get()); + this.scope.value(serializeName, { ref: serialize }); + sch.serialize = serialize; + } + catch (e) { + if (sourceCode) + this.logger.error("Error compiling serializer, function code:", sourceCode); + delete sch.serialize; + delete sch.serializeName; + throw e; + } + finally { + this._compilations.delete(sch); + } + return sch; +} +exports.default = compileSerializer; +function serializeCode(cxt) { + let form; + for (const key of types_1.jtdForms) { + if (key in cxt.schema) { + form = key; + break; + } + } + serializeNullable(cxt, form ? genSerialize[form] : serializeEmpty); +} +function serializeNullable(cxt, serializeForm) { + const { gen, schema, data } = cxt; + if (!schema.nullable) + return serializeForm(cxt); + gen.if(codegen_1._ `${data} === undefined || ${data} === null`, () => gen.add(names_1.default.json, codegen_1._ `"null"`), () => serializeForm(cxt)); +} +function serializeElements(cxt) { + const { gen, schema, data } = cxt; + gen.add(names_1.default.json, codegen_1.str `[`); + const first = gen.let("first", true); + gen.forOf("el", data, (el) => { + addComma(cxt, first); + serializeCode({ ...cxt, schema: schema.elements, data: el }); + }); + gen.add(names_1.default.json, codegen_1.str `]`); +} +function serializeValues(cxt) { + const { gen, schema, data } = cxt; + gen.add(names_1.default.json, codegen_1.str `{`); + const first = gen.let("first", true); + gen.forIn("key", data, (key) => serializeKeyValue(cxt, key, schema.values, first)); + gen.add(names_1.default.json, codegen_1.str `}`); +} +function serializeKeyValue(cxt, key, schema, first) { + const { gen, data } = cxt; + addComma(cxt, first); + serializeString({ ...cxt, data: key }); + gen.add(names_1.default.json, codegen_1.str `:`); + const value = gen.const("value", codegen_1._ `${data}${codegen_1.getProperty(key)}`); + serializeCode({ ...cxt, schema, data: value }); +} +function serializeDiscriminator(cxt) { + const { gen, schema, data } = cxt; + const { discriminator } = schema; + gen.add(names_1.default.json, codegen_1.str `{${JSON.stringify(discriminator)}:`); + const tag = gen.const("tag", codegen_1._ `${data}${codegen_1.getProperty(discriminator)}`); + serializeString({ ...cxt, data: tag }); + gen.if(false); + for (const tagValue in schema.mapping) { + gen.elseIf(codegen_1._ `${tag} === ${tagValue}`); + const sch = schema.mapping[tagValue]; + serializeSchemaProperties({ ...cxt, schema: sch }, discriminator); + } + gen.endIf(); + gen.add(names_1.default.json, codegen_1.str `}`); +} +function serializeProperties(cxt) { + const { gen } = cxt; + gen.add(names_1.default.json, codegen_1.str `{`); + serializeSchemaProperties(cxt); + gen.add(names_1.default.json, codegen_1.str `}`); +} +function serializeSchemaProperties(cxt, discriminator) { + const { gen, schema, data } = cxt; + const { properties, optionalProperties } = schema; + const props = keys(properties); + const optProps = keys(optionalProperties); + const allProps = allProperties(props.concat(optProps)); + let first = !discriminator; + for (const key of props) { + serializeProperty(key, properties[key], keyValue(key)); + } + for (const key of optProps) { + const value = keyValue(key); + gen.if(codegen_1.and(codegen_1._ `${value} !== undefined`, code_1.isOwnProperty(gen, data, key)), () => serializeProperty(key, optionalProperties[key], value)); + } + if (schema.additionalProperties) { + gen.forIn("key", data, (key) => gen.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, gen.let("first", first)))); + } + function keys(ps) { + return ps ? Object.keys(ps) : []; + } + function allProperties(ps) { + if (discriminator) + ps.push(discriminator); + if (new Set(ps).size !== ps.length) { + throw new Error("JTD: properties/optionalProperties/disciminator overlap"); + } + return ps; + } + function keyValue(key) { + return gen.const("value", codegen_1._ `${data}${codegen_1.getProperty(key)}`); + } + function serializeProperty(key, propSchema, value) { + if (first) + first = false; + else + gen.add(names_1.default.json, codegen_1.str `,`); + gen.add(names_1.default.json, codegen_1.str `${JSON.stringify(key)}:`); + serializeCode({ ...cxt, schema: propSchema, data: value }); + } + function isAdditional(key, ps) { + return ps.length ? codegen_1.and(...ps.map((p) => codegen_1._ `${key} !== ${p}`)) : true; + } +} +function serializeType(cxt) { + const { gen, schema, data } = cxt; + switch (schema.type) { + case "boolean": + gen.add(names_1.default.json, codegen_1._ `${data} ? "true" : "false"`); + break; + case "string": + serializeString(cxt); + break; + case "timestamp": + gen.if(codegen_1._ `${data} instanceof Date`, () => gen.add(names_1.default.json, codegen_1._ `${data}.toISOString()`), () => serializeString(cxt)); + break; + default: + serializeNumber(cxt); + } +} +function serializeString({ gen, data }) { + gen.add(names_1.default.json, codegen_1._ `${quoteFunc(gen)}(${data})`); +} +function serializeNumber({ gen, data }) { + gen.add(names_1.default.json, codegen_1._ `"" + ${data}`); +} +function serializeRef(cxt) { + const { gen, self, data, definitions, schema, schemaEnv } = cxt; + const { ref } = schema; + const refSchema = definitions[ref]; + if (!refSchema) + throw new error_classes_1.MissingRefError("", ref, `No definition ${ref}`); + if (!ref_1.hasRef(refSchema)) + return serializeCode({ ...cxt, schema: refSchema }); + const { root } = schemaEnv; + const sch = compileSerializer.call(self, new __1.SchemaEnv({ schema: refSchema, root }), definitions); + gen.add(names_1.default.json, codegen_1._ `${getSerialize(gen, sch)}(${data})`); +} +function getSerialize(gen, sch) { + return sch.serialize + ? gen.scopeValue("serialize", { ref: sch.serialize }) + : codegen_1._ `${gen.scopeValue("wrapper", { ref: sch })}.serialize`; +} +function serializeEmpty({ gen, data }) { + gen.add(names_1.default.json, codegen_1._ `JSON.stringify(${data})`); +} +function addComma({ gen }, first) { + gen.if(first, () => gen.assign(first, false), () => gen.add(names_1.default.json, codegen_1.str `,`)); +} +function quoteFunc(gen) { + return gen.scopeValue("func", { + ref: quote_1.default, + code: codegen_1._ `require("ajv/dist/runtime/quote").default`, + }); +} +//# sourceMappingURL=serialize.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/types.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/types.js new file mode 100644 index 00000000000000..b9c60a90fdd7ff --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/types.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.jtdForms = void 0; +exports.jtdForms = [ + "elements", + "values", + "discriminator", + "properties", + "optionalProperties", + "enum", + "type", + "ref", +]; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/names.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/names.js index d40037194ae3d9..02e80b8e35d348 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/names.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/names.js @@ -18,6 +18,11 @@ const names = { // "globals" self: new codegen_1.Name("self"), scope: new codegen_1.Name("scope"), + // JTD serialize/parse name for JSON string and position + json: new codegen_1.Name("json"), + jsonPos: new codegen_1.Name("jsonPos"), + jsonLen: new codegen_1.Name("jsonLen"), + jsonPart: new codegen_1.Name("jsonPart"), }; exports.default = names; //# sourceMappingURL=names.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/subschema.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/subschema.js index 1d6de6358606b8..30044843893193 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/subschema.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/subschema.js @@ -75,6 +75,7 @@ function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, da subschema.data = _nextData; subschema.dataLevel = it.dataLevel + 1; subschema.dataTypes = []; + it.definedProperties = new Set(); subschema.parentData = it.data; subschema.dataNames = [...it.dataNames, _nextData]; } diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/timestamp.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/timestamp.js index fcb61fe51c793b..f280d4fdd5be86 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/timestamp.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/timestamp.js @@ -1,5 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("./codegen"); const DATE_TIME = /^(\d\d\d\d)-(\d\d)-(\d\d)(?:t|\s)(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i; const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; function validTimestamp(str) { @@ -26,4 +27,5 @@ function validTimestamp(str) { (hr - tzH === 23 && min - tzM === 59 && sec === 60))); } exports.default = validTimestamp; +validTimestamp.code = codegen_1._ `require("ajv/dist/compile/timestamp").default`; //# sourceMappingURL=timestamp.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/util.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/util.js index e0c90c7e1475ab..40ac8fa2037890 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/util.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/util.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0; +exports.func = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0; const codegen_1 = require("./codegen"); const validate_1 = require("./validate"); // TODO refactor to use Set @@ -138,4 +138,11 @@ function setEvaluated(gen, props, ps) { Object.keys(ps).forEach((p) => gen.assign(codegen_1._ `${props}${codegen_1.getProperty(p)}`, true)); } exports.setEvaluated = setEvaluated; +function func(gen, f) { + return gen.scopeValue("func", { + ref: f, + code: f.code, + }); +} +exports.func = func; //# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.js index 7a3ebde278aecc..6187dbbeeebb3f 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.js @@ -12,7 +12,8 @@ function shouldUseGroup(schema, group) { exports.shouldUseGroup = shouldUseGroup; function shouldUseRule(schema, rule) { var _a; - return (schema[rule.keyword] !== undefined || ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined))); + return (schema[rule.keyword] !== undefined || + ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined))); } exports.shouldUseRule = shouldUseRule; //# sourceMappingURL=applicability.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/core.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/core.js index 8f868c6771ddb0..d11577134fc51c 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/core.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/core.js @@ -21,6 +21,8 @@ const $dataRefSchema = require("./refs/data.json"); const META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"]; const EXT_SCOPE_NAMES = new Set([ "validate", + "serialize", + "parse", "wrapper", "root", "schema", diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/jtd.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/jtd.js index 6d7924b97ae931..32f2581b1f01e0 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/jtd.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/jtd.js @@ -14,6 +14,8 @@ Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { const core_1 = require("./core"); const jtd_1 = require("./vocabularies/jtd"); const jtd_schema_1 = require("./refs/jtd-schema"); +const serialize_1 = require("./compile/jtd/serialize"); +const parse_1 = require("./compile/jtd/parse"); // const META_SUPPORT_DATA = ["/properties"] const META_SCHEMA_ID = "JTD-meta-schema"; class Ajv extends core_1.default { @@ -39,6 +41,28 @@ class Ajv extends core_1.default { return (this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)); } + compileSerializer(schema) { + const sch = this._addSchema(schema); + return sch.serialize || this._compileSerializer(sch); + } + compileParser(schema) { + const sch = this._addSchema(schema); + return (sch.parse || this._compileParser(sch)); + } + _compileSerializer(sch) { + serialize_1.default.call(this, sch, sch.schema.definitions || {}); + /* istanbul ignore if */ + if (!sch.serialize) + throw new Error("ajv implementation error"); + return sch.serialize; + } + _compileParser(sch) { + parse_1.default.call(this, sch, sch.schema.definitions || {}); + /* istanbul ignore if */ + if (!sch.parse) + throw new Error("ajv implementation error"); + return sch.parse; + } } exports.default = Ajv; //# sourceMappingURL=jtd.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/parseJson.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/parseJson.js new file mode 100644 index 00000000000000..cd4b8c1c9127ea --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/parseJson.js @@ -0,0 +1,183 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseJsonString = exports.parseJsonNumber = exports.parseJson = void 0; +const codegen_1 = require("../compile/codegen"); +const rxParseJson = /position\s(\d+)$/; +function parseJson(s, pos) { + let endPos; + parseJson.message = undefined; + let matches; + if (pos) + s = s.slice(pos); + try { + parseJson.position = pos + s.length; + return JSON.parse(s); + } + catch (e) { + matches = rxParseJson.exec(e.message); + if (!matches) { + parseJson.message = "unexpected end"; + return undefined; + } + endPos = +matches[1]; + const c = s[endPos]; + s = s.slice(0, endPos); + parseJson.position = pos + endPos; + try { + return JSON.parse(s); + } + catch (e1) { + parseJson.message = `unexpected token ${c}`; + return undefined; + } + } +} +exports.parseJson = parseJson; +parseJson.message = undefined; +parseJson.position = 0; +parseJson.code = codegen_1._ `require("ajv/dist/runtime/parseJson").parseJson`; +function parseJsonNumber(s, pos, maxDigits) { + let numStr = ""; + let c; + parseJsonNumber.message = undefined; + if (s[pos] === "-") { + numStr += "-"; + pos++; + } + if (s[pos] === "0") { + numStr += "0"; + pos++; + } + else { + if (!parseDigits(maxDigits)) { + errorMessage(); + return undefined; + } + } + if (maxDigits) { + parseJsonNumber.position = pos; + return +numStr; + } + if (s[pos] === ".") { + numStr += "."; + pos++; + if (!parseDigits()) { + errorMessage(); + return undefined; + } + } + if (((c = s[pos]), c === "e" || c === "E")) { + numStr += "e"; + pos++; + if (((c = s[pos]), c === "+" || c === "-")) { + numStr += c; + pos++; + } + if (!parseDigits()) { + errorMessage(); + return undefined; + } + } + parseJsonNumber.position = pos; + return +numStr; + function parseDigits(maxLen) { + let digit = false; + while (((c = s[pos]), c >= "0" && c <= "9" && (maxLen === undefined || maxLen-- > 0))) { + digit = true; + numStr += c; + pos++; + } + return digit; + } + function errorMessage() { + parseJsonNumber.position = pos; + parseJsonNumber.message = pos < s.length ? `unexpected token ${s[pos]}` : "unexpected end"; + } +} +exports.parseJsonNumber = parseJsonNumber; +parseJsonNumber.message = undefined; +parseJsonNumber.position = 0; +parseJsonNumber.code = codegen_1._ `require("ajv/dist/runtime/parseJson").parseJsonNumber`; +const escapedChars = { + b: "\b", + f: "\f", + n: "\n", + r: "\r", + t: "\t", + '"': '"', + "/": "/", + "\\": "\\", +}; +const CODE_A = "a".charCodeAt(0); +const CODE_0 = "0".charCodeAt(0); +function parseJsonString(s, pos) { + let str = ""; + let c; + parseJsonString.message = undefined; + // eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition + while (true) { + c = s[pos++]; + if (c === '"') + break; + if (c === "\\") { + c = s[pos]; + if (c in escapedChars) { + str += escapedChars[c]; + pos++; + } + else if (c === "u") { + pos++; + let count = 4; + let code = 0; + while (count--) { + code <<= 4; + c = s[pos].toLowerCase(); + if (c >= "a" && c <= "f") { + code += c.charCodeAt(0) - CODE_A + 10; + } + else if (c >= "0" && c <= "9") { + code += c.charCodeAt(0) - CODE_0; + } + else if (c === undefined) { + errorMessage("unexpected end"); + return undefined; + } + else { + errorMessage(`unexpected token ${c}`); + return undefined; + } + pos++; + } + str += String.fromCharCode(code); + } + else { + errorMessage(`unexpected token ${c}`); + return undefined; + } + } + else if (c === undefined) { + errorMessage("unexpected end"); + return undefined; + } + else { + if (c.charCodeAt(0) >= 0x20) { + str += c; + } + else { + errorMessage(`unexpected token ${c}`); + return undefined; + } + } + } + parseJsonString.position = pos; + return str; + function errorMessage(msg) { + parseJsonString.position = pos; + parseJsonString.message = msg; + } +} +exports.parseJsonString = parseJsonString; +parseJsonString.message = undefined; +parseJsonString.position = 0; +parseJsonString.code = codegen_1._ `require("ajv/dist/runtime/parseJson").parseJsonString`; +//# sourceMappingURL=parseJson.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/quote.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/quote.js new file mode 100644 index 00000000000000..361280542bf95b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/quote.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// eslint-disable-next-line no-control-regex, no-misleading-character-class +const rxEscapable = /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; +const escaped = { + "\b": "\\b", + "\t": "\\t", + "\n": "\\n", + "\f": "\\f", + "\r": "\\r", + '"': '\\"', + "\\": "\\\\", +}; +function quote(s) { + rxEscapable.lastIndex = 0; + return ('"' + + (rxEscapable.test(s) + ? s.replace(rxEscapable, (a) => { + const c = escaped[a]; + return typeof c === "string" + ? c + : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4); + }) + : s) + + '"'); +} +exports.default = quote; +//# sourceMappingURL=quote.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/jtd-schema.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/jtd-schema.js new file mode 100644 index 00000000000000..11338aa8a8f306 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/jtd-schema.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=jtd-schema.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js index 998b9666926b7b..bd8264b44d0bd4 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js @@ -41,13 +41,8 @@ const def = { let definedProp; if (props.length > 8) { // TODO maybe an option instead of hard-coded 8? - const hasProp = gen.scopeValue("func", { - // eslint-disable-next-line @typescript-eslint/unbound-method - ref: Object.prototype.hasOwnProperty, - code: codegen_1._ `Object.prototype.hasOwnProperty`, - }); const propsSchema = util_1.schemaRefOrVal(it, parentSchema.properties, "properties"); - definedProp = codegen_1._ `${hasProp}.call(${propsSchema}, ${key})`; + definedProp = code_1.isOwnProperty(gen, propsSchema, key); } else if (props.length) { definedProp = codegen_1.or(...props.map((p) => codegen_1._ `${key} === ${p}`)); diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js index 9ec12ab16cf4d9..af1479f1e1315e 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js @@ -12,7 +12,7 @@ exports.error = { params: ({ params: { property, depsCount, deps, missingProperty } }) => codegen_1._ `{property: ${property}, missingProperty: ${missingProperty}, depsCount: ${depsCount}, - deps: ${deps}}`, + deps: ${deps}}`, // TODO change to reference }; const def = { keyword: "dependencies", @@ -45,7 +45,7 @@ function validatePropertyDeps(cxt, propertyDeps = cxt.schema) { const deps = propertyDeps[prop]; if (deps.length === 0) continue; - const hasProperty = code_1.propertyInData(data, prop, it.opts.ownProperties); + const hasProperty = code_1.propertyInData(gen, data, prop, it.opts.ownProperties); cxt.setParams({ property: prop, depsCount: deps.length, @@ -72,7 +72,7 @@ function validateSchemaDeps(cxt, schemaDeps = cxt.schema) { for (const prop in schemaDeps) { if (util_1.alwaysValidSchema(it, schemaDeps[prop])) continue; - gen.if(code_1.propertyInData(data, prop, it.opts.ownProperties), () => { + gen.if(code_1.propertyInData(gen, data, prop, it.opts.ownProperties), () => { const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid); cxt.mergeValidEvaluated(schCxt, valid); }, () => gen.var(valid, true) // TODO var diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.js index 12fab3ce281970..7d127ae72ab762 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.js @@ -14,6 +14,9 @@ const def = { additionalProperties_1.default.code(new context_1.default(it, additionalProperties_1.default, "additionalProperties")); } const allProps = code_1.allSchemaProperties(schema); + for (const prop of allProps) { + it.definedProperties.add(prop); + } if (it.opts.unevaluated && allProps.length && it.props !== true) { it.props = util_1.mergeEvaluated.props(gen, util_1.toHash(allProps), it.props); } @@ -26,12 +29,13 @@ const def = { applyPropertySchema(prop); } else { - gen.if(code_1.propertyInData(data, prop, it.opts.ownProperties)); + gen.if(code_1.propertyInData(gen, data, prop, it.opts.ownProperties)); applyPropertySchema(prop); if (!it.allErrors) gen.else().var(valid, true); gen.endIf(); } + cxt.it.definedProperties.add(prop); cxt.ok(valid); } function hasDefault(prop) { diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/code.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/code.js index a019e59b2115b7..9e8c5d92aab73b 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/code.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/code.js @@ -1,20 +1,20 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0; +exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0; const codegen_1 = require("../compile/codegen"); const util_1 = require("../compile/util"); const subschema_1 = require("../compile/subschema"); const names_1 = require("../compile/names"); function checkReportMissingProp(cxt, prop) { const { gen, data, it } = cxt; - gen.if(noPropertyInData(data, prop, it.opts.ownProperties), () => { + gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => { cxt.setParams({ missingProperty: codegen_1._ `${prop}` }, true); cxt.error(); }); } exports.checkReportMissingProp = checkReportMissingProp; -function checkMissingProp({ data, it: { opts } }, properties, missing) { - return codegen_1.or(...properties.map((prop) => codegen_1._ `${noPropertyInData(data, prop, opts.ownProperties)} && (${missing} = ${prop})`)); +function checkMissingProp({ gen, data, it: { opts } }, properties, missing) { + return codegen_1.or(...properties.map((prop) => codegen_1._ `${noPropertyInData(gen, data, prop, opts.ownProperties)} && (${missing} = ${prop})`)); } exports.checkMissingProp = checkMissingProp; function reportMissingProp(cxt, missing) { @@ -22,17 +22,26 @@ function reportMissingProp(cxt, missing) { cxt.error(); } exports.reportMissingProp = reportMissingProp; -function isOwnProperty(data, property) { - return codegen_1._ `Object.prototype.hasOwnProperty.call(${data}, ${property})`; +function hasPropFunc(gen) { + return gen.scopeValue("func", { + // eslint-disable-next-line @typescript-eslint/unbound-method + ref: Object.prototype.hasOwnProperty, + code: codegen_1._ `Object.prototype.hasOwnProperty`, + }); +} +exports.hasPropFunc = hasPropFunc; +function isOwnProperty(gen, data, property) { + return codegen_1._ `${hasPropFunc(gen)}.call(${data}, ${property})`; } -function propertyInData(data, property, ownProperties) { +exports.isOwnProperty = isOwnProperty; +function propertyInData(gen, data, property, ownProperties) { const cond = codegen_1._ `${data}${codegen_1.getProperty(property)} !== undefined`; - return ownProperties ? codegen_1._ `${cond} && ${isOwnProperty(data, property)}` : cond; + return ownProperties ? codegen_1._ `${cond} && ${isOwnProperty(gen, data, property)}` : cond; } exports.propertyInData = propertyInData; -function noPropertyInData(data, property, ownProperties) { +function noPropertyInData(gen, data, property, ownProperties) { const cond = codegen_1._ `${data}${codegen_1.getProperty(property)} === undefined`; - return ownProperties ? codegen_1._ `${cond} || !${isOwnProperty(data, property)}` : cond; + return ownProperties ? codegen_1._ `${cond} || !${isOwnProperty(gen, data, property)}` : cond; } exports.noPropertyInData = noPropertyInData; function allSchemaProperties(schemaMap) { diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js index c9a29a01c5fec2..654a35b3caf591 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js @@ -58,7 +58,7 @@ function validateProperties(cxt) { function validateProps(props, keyword, required) { const _valid = gen.var("valid"); for (const prop of props) { - gen.if(code_1.propertyInData(data, prop, it.opts.ownProperties), () => applyPropertySchema(prop, keyword, _valid), missingProperty); + gen.if(code_1.propertyInData(gen, data, prop, it.opts.ownProperties), () => applyPropertySchema(prop, keyword, _valid), missingProperty); cxt.ok(_valid); } function missingProperty() { @@ -102,12 +102,7 @@ function validateProperties(cxt) { if (props.length > 8) { // TODO maybe an option instead of hard-coded 8? const propsSchema = util_1.schemaRefOrVal(it, parentSchema[keyword], keyword); - const hasProp = gen.scopeValue("func", { - // eslint-disable-next-line @typescript-eslint/unbound-method - ref: Object.prototype.hasOwnProperty, - code: codegen_1._ `Object.prototype.hasOwnProperty`, - }); - additional = codegen_1._ `!${hasProp}.call(${propsSchema}, ${key})`; + additional = code_1.isOwnProperty(gen, propsSchema, key); } else if (props.length) { additional = codegen_1.and(...props.map((p) => codegen_1._ `${key} !== ${p}`)); diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.js index acfd31748dae6f..a3b341ab039044 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.js @@ -1,5 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.hasRef = void 0; const compile_1 = require("../../compile"); const codegen_1 = require("../../compile/codegen"); const error_classes_1 = require("../../compile/error_classes"); @@ -50,15 +51,16 @@ const def = { errSchemaPath: `/definitions/${ref}`, }, valid); } - function hasRef(schema) { - for (const key in schema) { - let sch; - if (key === "ref" || (typeof (sch = schema[key]) == "object" && hasRef(sch))) - return true; - } - return false; - } }, }; +function hasRef(schema) { + for (const key in schema) { + let sch; + if (key === "ref" || (typeof (sch = schema[key]) == "object" && hasRef(sch))) + return true; + } + return false; +} +exports.hasRef = hasRef; exports.default = def; //# sourceMappingURL=ref.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.js index 1eedbb86480e3c..96ff3a7e608069 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.js @@ -1,15 +1,17 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.intRange = void 0; const codegen_1 = require("../../compile/codegen"); const timestamp_1 = require("../../compile/timestamp"); +const util_1 = require("../../compile/util"); const metadata_1 = require("./metadata"); -const intRange = { - int8: [-128, 127], - uint8: [0, 255], - int16: [-32768, 32767], - uint16: [0, 65535], - int32: [-2147483648, 2147483647], - uint32: [0, 4294967295], +exports.intRange = { + int8: [-128, 127, 3], + uint8: [0, 255, 3], + int16: [-32768, 32767, 5], + uint16: [0, 65535, 5], + int32: [-2147483648, 2147483647, 10], + uint32: [0, 4294967295, 10], }; const def = { keyword: "type", @@ -24,10 +26,7 @@ const def = { cond = codegen_1._ `typeof ${data} == ${schema}`; break; case "timestamp": { - const vts = gen.scopeValue("func", { - ref: timestamp_1.default, - code: codegen_1._ `require("ajv/dist/compile/timestamp").default`, - }); + const vts = util_1.func(gen, timestamp_1.default); cond = codegen_1._ `${data} instanceof Date || (typeof ${data} == "string" && ${vts}(${data}))`; break; } @@ -36,7 +35,7 @@ const def = { cond = codegen_1._ `typeof ${data} == "number"`; break; default: { - const [min, max] = intRange[schema]; + const [min, max] = exports.intRange[schema]; cond = codegen_1._ `typeof ${data} == "number" && isFinite(${data}) && ${data} >= ${min} && ${data} <= ${max} && !(${data} % 1)`; } } diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js index 2d385229fbcd17..687783fd8abba9 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js @@ -2,6 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); const code_1 = require("../code"); const codegen_1 = require("../../compile/codegen"); +const validate_1 = require("../../compile/validate"); const error = { message: ({ params: { missingProperty } }) => codegen_1.str `should have required property '${missingProperty}'`, params: ({ params: { missingProperty } }) => codegen_1._ `{missingProperty: ${missingProperty}}`, @@ -22,6 +23,17 @@ const def = { allErrorsMode(); else exitOnErrorMode(); + if (opts.strictRequired) { + const props = cxt.parentSchema.properties; + const { definedProperties } = cxt.it; + for (const requiredKey of schema) { + if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === undefined && !definedProperties.has(requiredKey)) { + const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; + const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`; + validate_1.checkStrictMode(it, msg, it.opts.strictRequired); + } + } + } function allErrorsMode() { if (useLoop || $data) { cxt.block$data(codegen_1.nil, loopAllRequired); @@ -48,13 +60,13 @@ const def = { function loopAllRequired() { gen.forOf("prop", schemaCode, (prop) => { cxt.setParams({ missingProperty: prop }); - gen.if(code_1.noPropertyInData(data, prop, opts.ownProperties), () => cxt.error()); + gen.if(code_1.noPropertyInData(gen, data, prop, opts.ownProperties), () => cxt.error()); }); } function loopUntilMissing(missing, valid) { cxt.setParams({ missingProperty: missing }); gen.forOf(missing, schemaCode, () => { - gen.assign(valid, code_1.propertyInData(data, missing, opts.ownProperties)); + gen.assign(valid, code_1.propertyInData(gen, data, missing, opts.ownProperties)); gen.if(codegen_1.not(valid), () => { cxt.error(); gen.break(); diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json index 8ecc53dd8a97ec..2f1973e528c153 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json @@ -1,71 +1,23 @@ { - "name": "ajv", - "version": "7.1.1", - "description": "Another JSON Schema Validator", - "main": "dist/ajv.js", - "types": "dist/ajv.d.ts", - "files": [ - "lib/", - "docs/", - "dist/", - "scripts/", - ".tonic_example.js" - ], - "scripts": { - "eslint": "eslint \"lib/**/*.ts\" \"spec/**/*.*s\" scripts --ignore-pattern spec/JSON-Schema-Test-Suite", - "prettier:write": "prettier --write \"./**/*.{md,json,yaml,js,ts}\"", - "prettier:check": "prettier --list-different \"./**/*.{md,json,yaml,js,ts}\"", - "test-spec": "cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register \"spec/**/*.spec.{ts,js}\" -R dot", - "test-codegen": "nyc cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register 'spec/codegen.spec.ts' -R spec", - "test-debug": "npm run test-spec -- --inspect-brk", - "test-cov": "nyc npm run test-spec", - "bundle": "rm -rf bundle && node ./scripts/bundle.js ajv ajv7 ajv7 && node ./scripts/bundle.js 2019 ajv2019 ajv2019 && node ./scripts/bundle.js jtd ajvJTD ajvJTD", - "build": "rm -rf dist && tsc && cp -r lib/refs dist && rm dist/refs/json-schema-2019-09/index.ts && rm dist/refs/jtd-schema.ts", - "json-tests": "rm -rf spec/_json/*.js && node scripts/jsontests", - "test-karma": "karma start", - "test-browser": "rm -rf .browser && npm run bundle && scripts/prepare-tests && karma start", - "test-all": "npm run test-cov && if-node-version 12 npm run test-browser", - "test": "npm link && npm link ajv && npm run json-tests && npm run eslint && npm run test-cov", - "test-ci": "AJV_FULL_TEST=true npm test", - "prepublish": "npm run build" - }, - "nyc": { - "exclude": [ - "**/spec/**", - "node_modules" - ], - "reporter": [ - "lcov", - "text-summary" - ] - }, - "repository": { - "type": "git", - "url": "https://github.com/ajv-validator/ajv.git" + "author": { + "name": "Evgeny Poberezkin" }, - "keywords": [ - "JSON", - "schema", - "validator", - "validation", - "jsonschema", - "json-schema", - "json-schema-validator", - "json-schema-validation" - ], - "author": "Evgeny Poberezkin", - "license": "MIT", "bugs": { "url": "https://github.com/ajv-validator/ajv/issues" }, - "homepage": "https://github.com/ajv-validator/ajv", - "tonicExampleFilename": ".tonic_example.js", + "bundleDependencies": false, + "collective": { + "type": "opencollective", + "url": "https://opencollective.com/ajv" + }, "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2", "uri-js": "^4.2.2" }, + "deprecated": false, + "description": "Another JSON Schema Validator", "devDependencies": { "@ajv-validator/config": "^0.3.0", "@types/chai": "^4.2.12", @@ -74,6 +26,7 @@ "@types/require-from-string": "^1.2.0", "@typescript-eslint/eslint-plugin": "^3.8.0", "@typescript-eslint/parser": "^3.8.0", + "@vuepress/shared-utils": "^1.8.2", "ajv-formats": "^1.5.0", "browserify": "^17.0.0", "chai": "^4.0.1", @@ -95,23 +48,79 @@ "terser": "^5.2.1", "ts-node": "^9.0.0", "tsify": "^5.0.2", - "typescript": "^4.0.0" - }, - "collective": { - "type": "opencollective", - "url": "https://opencollective.com/ajv" + "typescript": "^4.2.0", + "vuepress": "^1.8.2" }, + "files": [ + "lib/", + "docs/", + "dist/", + "scripts/", + ".tonic_example.js" + ], "funding": { "type": "github", "url": "https://github.com/sponsors/epoberezkin" }, - "prettier": "@ajv-validator/config/prettierrc.json", + "homepage": "https://github.com/ajv-validator/ajv", "husky": { "hooks": { "pre-commit": "lint-staged && npm test" } }, + "keywords": [ + "JSON", + "schema", + "validator", + "validation", + "jsonschema", + "json-schema", + "json-schema-validator", + "json-schema-validation" + ], + "license": "MIT", "lint-staged": { - "*.{md,json,yaml,js,ts}": "prettier --write" - } -} + "*.{json,yaml,js,ts}": "prettier --write" + }, + "main": "dist/ajv.js", + "name": "ajv", + "nyc": { + "exclude": [ + "**/spec/**", + "node_modules" + ], + "reporter": [ + "lcov", + "text-summary" + ] + }, + "prettier": "@ajv-validator/config/prettierrc.json", + "repository": { + "type": "git", + "url": "git+https://github.com/ajv-validator/ajv.git" + }, + "scripts": { + "benchmark": "npm i && npm run build && npm link && cd ./benchmark && npm link ajv && npm i && node ./jtd", + "build": "rm -rf dist && tsc && cp -r lib/refs dist && rm dist/refs/json-schema-2019-09/index.ts && rm dist/refs/jtd-schema.ts", + "bundle": "rm -rf bundle && node ./scripts/bundle.js ajv ajv7 ajv7 && node ./scripts/bundle.js 2019 ajv2019 ajv2019 && node ./scripts/bundle.js jtd ajvJTD ajvJTD", + "docs:build": "vuepress build docs", + "docs:dev": "vuepress dev docs", + "eslint": "eslint \"lib/**/*.ts\" \"spec/**/*.*s\" scripts --ignore-pattern spec/JSON-Schema-Test-Suite", + "json-tests": "rm -rf spec/_json/*.js && node scripts/jsontests", + "prepublish": "npm run build", + "prettier:check": "prettier --list-different \"./**/*.{json,yaml,js,ts}\"", + "prettier:write": "prettier --write \"./**/*.{json,yaml,js,ts}\"", + "test": "npm link && npm link ajv && npm run json-tests && npm run eslint && npm run test-cov", + "test-all": "npm run test-cov && if-node-version 12 npm run test-browser", + "test-browser": "rm -rf .browser && npm run bundle && scripts/prepare-tests && karma start", + "test-ci": "AJV_FULL_TEST=true npm test", + "test-codegen": "nyc cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register 'spec/codegen.spec.ts' -R spec", + "test-cov": "nyc npm run test-spec", + "test-debug": "npm run test-spec -- --inspect-brk", + "test-karma": "karma start", + "test-spec": "cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register \"spec/**/*.spec.{ts,js}\" -R dot" + }, + "tonicExampleFilename": ".tonic_example.js", + "types": "dist/ajv.d.ts", + "version": "7.2.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/publish-bundles b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/publish-bundles index d91d01c034a813..311c21608d2bec 100755 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/publish-bundles +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/publish-bundles @@ -10,7 +10,7 @@ if [[ $GITHUB_REF == refs/tags/v* ]]; then git config --global user.name "$GIT_USER_NAME" git config --global user.email "$GIT_USER_EMAIL" - git clone https://${GH_TOKEN_PUBLIC}@github.com/ajv-validator/ajv-dist.git ../ajv-dist + git clone https://"${GH_TOKEN_PUBLIC}"@github.com/ajv-validator/ajv-dist.git ../ajv-dist rm -rf ../ajv-dist/dist mkdir ../ajv-dist/dist @@ -22,7 +22,7 @@ if [[ $GITHUB_REF == refs/tags/v* ]]; then sed -E "s/\"version\": \"([^\"]*)\"/\"version\": \"$VERSION\"/" package.json > new_package.json mv new_package.json package.json - if [[ `git status --porcelain` ]]; then + if [[ $(git status --porcelain) ]]; then echo "Changes detected. Updating master branch..." git add -A git commit -m "$VERSION: updated by ajv workflow https://github.com/ajv-validator/ajv/actions/runs/$GITHUB_RUN_ID" diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/publish-gh-pages b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/publish-gh-pages deleted file mode 100755 index 34e488a948aa94..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/publish-gh-pages +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -echo "About to publish $GITHUB_REF to gh-pages..." - -rm -rf ../gh-pages - -git config --global user.name "$GIT_USER_NAME" -git config --global user.email "$GIT_USER_EMAIL" -git clone -b gh-pages --single-branch https://${GH_TOKEN_PUBLIC}@github.com/ajv-validator/ajv.git ../gh-pages -SOURCE=../gh-pages/_source -mkdir -p $SOURCE -cp *.md $SOURCE -cp -R docs $SOURCE -cp LICENSE $SOURCE -cd ../gh-pages -node ./generate - -# remove logo from README -sed -E "s/]+ajv_logo[^>]+>//" index.md > new-index.md -mv new-index.md index.md - -if [[ `git status --porcelain` ]]; then - echo "Changes detected. Updating gh-pages branch..." - git add -A - git commit -m "updated by ajv workflow https://github.com/ajv-validator/ajv/actions/runs/$GITHUB_RUN_ID" - git push --quiet origin gh-pages > /dev/null 2>&1 -fi - -echo "Done" diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/publish-site b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/publish-site new file mode 100755 index 00000000000000..c09758432d5ba6 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/publish-site @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +set -ex + +echo "About to publish $GITHUB_REF to gh-pages..." +rm -rf ../gh-pages + +function copyReplace { + sed "s/](.\/docs\//](.\//g" $1 > $2 +} + +copyReplace README.md docs/README.md +copyReplace CODE_OF_CONDUCT.md docs/code_of_conduct.md +copyReplace CONTRIBUTING.md docs/contributing.md +copyReplace LICENSE docs/license.md + +npm run docs:build + +git config --global user.name "$GIT_USER_NAME" +git config --global user.email "$GIT_USER_EMAIL" +git clone -b gh-pages --single-branch https://"${GH_TOKEN_PUBLIC}"@github.com/ajv-validator/ajv.git ../gh-pages + +rsync -a ./docs/.vuepress/dist/ ../gh-pages/docs + +cd ../gh-pages + +if [[ $(git status --porcelain) ]]; then + echo "Changes detected. Updating gh-pages branch..." + git add -A + git commit -m "updated by ajv workflow https://github.com/ajv-validator/ajv/actions/runs/$GITHUB_RUN_ID" + git push --quiet origin gh-pages > /dev/null 2>&1 +fi + +echo "Done" diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/package.json b/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/package.json index e32dfbaeec58fb..98fee959b778b7 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/package.json +++ b/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/package.json @@ -1,35 +1,28 @@ { - "name": "json-schema-traverse", - "version": "1.0.0", - "description": "Traverse JSON Schema passing each schema object to callback", - "main": "index.js", - "types": "index.d.ts", - "scripts": { - "eslint": "eslint index.js spec", - "test-spec": "mocha spec -R spec", - "test": "npm run eslint && nyc npm run test-spec" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/epoberezkin/json-schema-traverse.git" + "author": { + "name": "Evgeny Poberezkin" }, - "keywords": [ - "JSON-Schema", - "traverse", - "iterate" - ], - "author": "Evgeny Poberezkin", - "license": "MIT", "bugs": { "url": "https://github.com/epoberezkin/json-schema-traverse/issues" }, - "homepage": "https://github.com/epoberezkin/json-schema-traverse#readme", + "bundleDependencies": false, + "deprecated": false, + "description": "Traverse JSON Schema passing each schema object to callback", "devDependencies": { "eslint": "^7.3.1", "mocha": "^8.0.1", "nyc": "^15.0.0", "pre-commit": "^1.2.2" }, + "homepage": "https://github.com/epoberezkin/json-schema-traverse#readme", + "keywords": [ + "JSON-Schema", + "traverse", + "iterate" + ], + "license": "MIT", + "main": "index.js", + "name": "json-schema-traverse", "nyc": { "exclude": [ "**/spec/**", @@ -39,5 +32,16 @@ "lcov", "text-summary" ] - } -} + }, + "repository": { + "type": "git", + "url": "git+https://github.com/epoberezkin/json-schema-traverse.git" + }, + "scripts": { + "eslint": "eslint index.js spec", + "test": "npm run eslint && nyc npm run test-spec", + "test-spec": "mocha spec -R spec" + }, + "types": "index.d.ts", + "version": "1.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/package.json b/tools/node_modules/eslint/node_modules/table/package.json index 85036e7f2e5bb9..892f772a2f312a 100644 --- a/tools/node_modules/eslint/node_modules/table/package.json +++ b/tools/node_modules/eslint/node_modules/table/package.json @@ -1,15 +1,20 @@ { "author": { - "email": "gajus@gajus.com", "name": "Gajus Kuizinas", + "email": "gajus@gajus.com", "url": "http://gajus.com" }, + "bugs": { + "url": "https://github.com/gajus/table/issues" + }, + "bundleDependencies": false, "dependencies": { "ajv": "^7.0.2", "lodash": "^4.17.20", "slice-ansi": "^4.0.0", "string-width": "^4.2.0" }, + "deprecated": false, "description": "Formats data into a string table.", "devDependencies": { "@babel/cli": "^7.12.10", @@ -41,6 +46,7 @@ "engines": { "node": ">=10.0.0" }, + "homepage": "https://github.com/gajus/table#readme", "husky": { "hooks": { "post-commit": "npm run create-readme && git add README.md && git commit -m 'docs: generate docs' --no-verify", @@ -72,7 +78,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/gajus/table" + "url": "git+https://github.com/gajus/table.git" }, "scripts": { "build": "rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && npm run create-validators && flow-copy-source src dist", @@ -82,4 +88,4 @@ "test": "mocha --require @babel/register" }, "version": "6.0.7" -} +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/text-table/package.json b/tools/node_modules/eslint/node_modules/text-table/package.json index b4d17a4ff81316..f5c43b5d934ee1 100644 --- a/tools/node_modules/eslint/node_modules/text-table/package.json +++ b/tools/node_modules/eslint/node_modules/text-table/package.json @@ -1,44 +1,50 @@ { - "name": "text-table", - "version": "0.2.0", - "description": "borderless text tables with alignment", - "main": "index.js", - "devDependencies": { - "tap": "~0.4.0", - "tape": "~1.0.2", - "cli-color": "~0.2.3" - }, - "scripts": { - "test": "tap test/*.js" - }, - "testling" : { - "files" : "test/*.js", - "browsers" : [ - "ie/6..latest", - "chrome/20..latest", - "firefox/10..latest", - "safari/latest", - "opera/11.0..latest", - "iphone/6", "ipad/6" - ] - }, - "repository": { - "type": "git", - "url": "git://github.com/substack/text-table.git" - }, - "homepage": "https://github.com/substack/text-table", - "keywords": [ - "text", - "table", - "align", - "ascii", - "rows", - "tabular" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "license": "MIT" -} + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/text-table/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "borderless text tables with alignment", + "devDependencies": { + "cli-color": "~0.2.3", + "tap": "~0.4.0", + "tape": "~1.0.2" + }, + "homepage": "https://github.com/substack/text-table", + "keywords": [ + "text", + "table", + "align", + "ascii", + "rows", + "tabular" + ], + "license": "MIT", + "main": "index.js", + "name": "text-table", + "repository": { + "type": "git", + "url": "git://github.com/substack/text-table.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "chrome/20..latest", + "firefox/10..latest", + "safari/latest", + "opera/11.0..latest", + "iphone/6", + "ipad/6" + ] + }, + "version": "0.2.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/type-check/package.json b/tools/node_modules/eslint/node_modules/type-check/package.json index 2a57ea0643dc58..a056438a760bad 100644 --- a/tools/node_modules/eslint/node_modules/type-check/package.json +++ b/tools/node_modules/eslint/node_modules/type-check/package.json @@ -1,8 +1,30 @@ { - "name": "type-check", - "version": "0.4.0", - "author": "George Zahariev ", + "author": { + "name": "George Zahariev", + "email": "z@georgezahariev.com" + }, + "bugs": { + "url": "https://github.com/gkz/type-check/issues" + }, + "bundleDependencies": false, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "deprecated": false, "description": "type-check allows you to check the types of JavaScript values at runtime with a Haskell like type syntax.", + "devDependencies": { + "browserify": "^16.5.1", + "livescript": "^1.6.0", + "mocha": "^7.1.1" + }, + "engines": { + "node": ">= 0.8.0" + }, + "files": [ + "lib", + "README.md", + "LICENSE" + ], "homepage": "https://github.com/gkz/type-check", "keywords": [ "type", @@ -10,17 +32,9 @@ "checking", "library" ], - "files": [ - "lib", - "README.md", - "LICENSE" - ], - "main": "./lib/", - "bugs": "https://github.com/gkz/type-check/issues", "license": "MIT", - "engines": { - "node": ">= 0.8.0" - }, + "main": "./lib/", + "name": "type-check", "repository": { "type": "git", "url": "git://github.com/gkz/type-check.git" @@ -28,12 +42,5 @@ "scripts": { "test": "make test" }, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "devDependencies": { - "livescript": "^1.6.0", - "mocha": "^7.1.1", - "browserify": "^16.5.1" - } -} + "version": "0.4.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/type-fest/package.json b/tools/node_modules/eslint/node_modules/type-fest/package.json index ea6621129dc660..0164025631ef29 100644 --- a/tools/node_modules/eslint/node_modules/type-fest/package.json +++ b/tools/node_modules/eslint/node_modules/type-fest/package.json @@ -1,51 +1,60 @@ { - "name": "type-fest", - "version": "0.8.1", - "description": "A collection of essential TypeScript types", - "license": "(MIT OR CC0-1.0)", - "repository": "sindresorhus/type-fest", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && tsd" - }, - "files": [ - "index.d.ts", - "source" - ], - "keywords": [ - "typescript", - "ts", - "types", - "utility", - "util", - "utilities", - "omit", - "merge", - "json" - ], - "devDependencies": { - "@sindresorhus/tsconfig": "^0.4.0", - "@typescript-eslint/eslint-plugin": "^2.2.0", - "@typescript-eslint/parser": "^2.2.0", - "eslint-config-xo-typescript": "^0.18.0", - "tsd": "^0.7.3", - "xo": "^0.24.0" - }, - "xo": { - "extends": "xo-typescript", - "extensions": [ - "ts" - ], - "rules": { - "import/no-unresolved": "off", - "@typescript-eslint/indent": "off" - } - } -} + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/type-fest/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A collection of essential TypeScript types", + "devDependencies": { + "@sindresorhus/tsconfig": "^0.4.0", + "@typescript-eslint/eslint-plugin": "^2.2.0", + "@typescript-eslint/parser": "^2.2.0", + "eslint-config-xo-typescript": "^0.18.0", + "tsd": "^0.7.3", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.d.ts", + "source" + ], + "homepage": "https://github.com/sindresorhus/type-fest#readme", + "keywords": [ + "typescript", + "ts", + "types", + "utility", + "util", + "utilities", + "omit", + "merge", + "json" + ], + "license": "(MIT OR CC0-1.0)", + "name": "type-fest", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/type-fest.git" + }, + "scripts": { + "test": "xo && tsd" + }, + "version": "0.8.1", + "xo": { + "extends": "xo-typescript", + "extensions": [ + "ts" + ], + "rules": { + "import/no-unresolved": "off", + "@typescript-eslint/indent": "off" + } + } +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/uri-js/package.json b/tools/node_modules/eslint/node_modules/uri-js/package.json index de95d91aa1a410..b97f667a234ea6 100755 --- a/tools/node_modules/eslint/node_modules/uri-js/package.json +++ b/tools/node_modules/eslint/node_modules/uri-js/package.json @@ -1,9 +1,30 @@ { - "name": "uri-js", - "version": "4.4.1", + "author": { + "name": "Gary Court", + "email": "gary.court@gmail.com" + }, + "bugs": { + "url": "https://github.com/garycourt/uri-js/issues" + }, + "bundleDependencies": false, + "dependencies": { + "punycode": "^2.1.0" + }, + "deprecated": false, "description": "An RFC 3986/3987 compliant, scheme extendable URI/IRI parsing/validating/resolving library for JavaScript.", - "main": "dist/es5/uri.all.js", - "types": "dist/es5/uri.all.d.ts", + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-plugin-external-helpers": "^6.22.0", + "babel-preset-latest": "^6.24.1", + "mocha": "^8.2.1", + "mocha-qunit-ui": "^0.1.3", + "rollup": "^0.41.6", + "rollup-plugin-babel": "^2.7.1", + "rollup-plugin-node-resolve": "^2.0.0", + "sorcery": "^0.10.0", + "typescript": "^2.8.1", + "uglify-js": "^2.8.14" + }, "directories": { "test": "tests" }, @@ -15,19 +36,7 @@ "CHANGELOG", "LICENSE" ], - "scripts": { - "build:esnext": "tsc", - "build:es5": "rollup -c && cp dist/esnext/uri.d.ts dist/es5/uri.all.d.ts && npm run build:es5:fix-sourcemap", - "build:es5:fix-sourcemap": "sorcery -i dist/es5/uri.all.js", - "build:es5:min": "uglifyjs dist/es5/uri.all.js --support-ie8 --output dist/es5/uri.all.min.js --in-source-map dist/es5/uri.all.js.map --source-map uri.all.min.js.map --comments --compress --mangle --pure-funcs merge subexp && mv uri.all.min.js.map dist/es5/ && cp dist/es5/uri.all.d.ts dist/es5/uri.all.min.d.ts", - "build": "npm run build:esnext && npm run build:es5 && npm run build:es5:min", - "clean": "rm -rf dist", - "test": "mocha -u mocha-qunit-ui dist/es5/uri.all.js tests/tests.js" - }, - "repository": { - "type": "git", - "url": "http://github.com/garycourt/uri-js" - }, + "homepage": "https://github.com/garycourt/uri-js", "keywords": [ "URI", "IRI", @@ -52,26 +61,22 @@ "RFC6455", "RFC6874" ], - "author": "Gary Court ", "license": "BSD-2-Clause", - "bugs": { - "url": "https://github.com/garycourt/uri-js/issues" + "main": "dist/es5/uri.all.js", + "name": "uri-js", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/garycourt/uri-js.git" }, - "homepage": "https://github.com/garycourt/uri-js", - "devDependencies": { - "babel-cli": "^6.26.0", - "babel-plugin-external-helpers": "^6.22.0", - "babel-preset-latest": "^6.24.1", - "mocha": "^8.2.1", - "mocha-qunit-ui": "^0.1.3", - "rollup": "^0.41.6", - "rollup-plugin-babel": "^2.7.1", - "rollup-plugin-node-resolve": "^2.0.0", - "sorcery": "^0.10.0", - "typescript": "^2.8.1", - "uglify-js": "^2.8.14" + "scripts": { + "build": "npm run build:esnext && npm run build:es5 && npm run build:es5:min", + "build:es5": "rollup -c && cp dist/esnext/uri.d.ts dist/es5/uri.all.d.ts && npm run build:es5:fix-sourcemap", + "build:es5:fix-sourcemap": "sorcery -i dist/es5/uri.all.js", + "build:es5:min": "uglifyjs dist/es5/uri.all.js --support-ie8 --output dist/es5/uri.all.min.js --in-source-map dist/es5/uri.all.js.map --source-map uri.all.min.js.map --comments --compress --mangle --pure-funcs merge subexp && mv uri.all.min.js.map dist/es5/ && cp dist/es5/uri.all.d.ts dist/es5/uri.all.min.d.ts", + "build:esnext": "tsc", + "clean": "rm -rf dist", + "test": "mocha -u mocha-qunit-ui dist/es5/uri.all.js tests/tests.js" }, - "dependencies": { - "punycode": "^2.1.0" - } -} + "types": "dist/es5/uri.all.d.ts", + "version": "4.4.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/v8-compile-cache/package.json b/tools/node_modules/eslint/node_modules/v8-compile-cache/package.json index cfc665f109976b..13108425be015f 100644 --- a/tools/node_modules/eslint/node_modules/v8-compile-cache/package.json +++ b/tools/node_modules/eslint/node_modules/v8-compile-cache/package.json @@ -1,25 +1,15 @@ { - "name": "v8-compile-cache", - "version": "2.2.0", - "description": "Require hook for automatic V8 compile cache persistence", - "main": "v8-compile-cache.js", - "scripts": { - "bench": "bench/run.sh", - "eslint": "eslint --max-warnings=0 .", - "tap": "tap test/*-test.js", - "test": "npm run tap", - "posttest": "npm run eslint" + "author": { + "name": "Andres Suarez", + "email": "zertosh@gmail.com" }, - "author": "Andres Suarez ", - "repository": { - "type": "git", - "url": "https://github.com/zertosh/v8-compile-cache.git" + "bugs": { + "url": "https://github.com/zertosh/v8-compile-cache/issues" }, - "files": [ - "v8-compile-cache.js" - ], - "license": "MIT", + "bundleDependencies": false, "dependencies": {}, + "deprecated": false, + "description": "Require hook for automatic V8 compile cache persistence", "devDependencies": { "babel-core": "6.26.3", "eslint": "^7.12.1", @@ -27,8 +17,27 @@ "rimraf": "^2.5.4", "rxjs": "6.6.3", "semver": "^5.3.0", - "tap": "^10.1.1", + "tap": "^9.0.0", "temp": "^0.8.3", "yarn": "1.22.10" - } -} + }, + "files": [ + "v8-compile-cache.js" + ], + "homepage": "https://github.com/zertosh/v8-compile-cache#readme", + "license": "MIT", + "main": "v8-compile-cache.js", + "name": "v8-compile-cache", + "repository": { + "type": "git", + "url": "git+https://github.com/zertosh/v8-compile-cache.git" + }, + "scripts": { + "bench": "bench/run.sh", + "eslint": "eslint --max-warnings=0 .", + "posttest": "npm run eslint", + "tap": "tap test/*-test.js", + "test": "npm run tap" + }, + "version": "2.3.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/v8-compile-cache/v8-compile-cache.js b/tools/node_modules/eslint/node_modules/v8-compile-cache/v8-compile-cache.js index b9c09288cb310b..f094da40f8a1d7 100644 --- a/tools/node_modules/eslint/node_modules/v8-compile-cache/v8-compile-cache.js +++ b/tools/node_modules/eslint/node_modules/v8-compile-cache/v8-compile-cache.js @@ -328,15 +328,15 @@ function getCacheDir() { return cacheDir; } -function getParentName() { - // `module.parent.filename` is undefined or null when: +function getMainName() { + // `require.main.filename` is undefined or null when: // * node -e 'require("v8-compile-cache")' // * node -r 'v8-compile-cache' // * Or, requiring from the REPL. - const parentName = module.parent && typeof module.parent.filename === 'string' - ? module.parent.filename + const mainName = require.main && typeof require.main.filename === 'string' + ? require.main.filename : process.cwd(); - return parentName; + return mainName; } //------------------------------------------------------------------------------ @@ -345,7 +345,7 @@ function getParentName() { if (!process.env.DISABLE_V8_COMPILE_CACHE && supportsCachedData()) { const cacheDir = getCacheDir(); - const prefix = getParentName(); + const prefix = getMainName(); const blobStore = new FileSystemBlobStore(cacheDir, prefix); const nativeCompileCache = new NativeCompileCache(); @@ -367,5 +367,5 @@ module.exports.__TEST__ = { slashEscape, supportsCachedData, getCacheDir, - getParentName, + getMainName, }; diff --git a/tools/node_modules/eslint/node_modules/which/package.json b/tools/node_modules/eslint/node_modules/which/package.json index 97ad7fbabc52b5..32eaa57575d680 100644 --- a/tools/node_modules/eslint/node_modules/which/package.json +++ b/tools/node_modules/eslint/node_modules/which/package.json @@ -1,43 +1,53 @@ { - "author": "Isaac Z. Schlueter (http://blog.izs.me)", - "name": "which", - "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", - "version": "2.0.2", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-which.git" + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" }, - "main": "which.js", "bin": { - "node-which": "./bin/node-which" + "node-which": "bin/node-which" }, - "license": "ISC", + "bugs": { + "url": "https://github.com/isaacs/node-which/issues" + }, + "bundleDependencies": false, "dependencies": { "isexe": "^2.0.0" }, + "deprecated": false, + "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", "devDependencies": { "mkdirp": "^0.5.0", "rimraf": "^2.6.2", "tap": "^14.6.9" }, - "scripts": { - "test": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "prepublish": "npm run changelog", - "prechangelog": "bash gen-changelog.sh", - "changelog": "git add CHANGELOG.md", - "postchangelog": "git commit -m 'update changelog - '${npm_package_version}", - "postpublish": "git push origin --follow-tags" + "engines": { + "node": ">= 8" }, "files": [ "which.js", "bin/node-which" ], + "homepage": "https://github.com/isaacs/node-which#readme", + "license": "ISC", + "main": "which.js", + "name": "which", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-which.git" + }, + "scripts": { + "changelog": "git add CHANGELOG.md", + "postchangelog": "git commit -m 'update changelog - '${npm_package_version}", + "postpublish": "git push origin --follow-tags", + "postversion": "npm publish", + "prechangelog": "bash gen-changelog.sh", + "prepublish": "npm run changelog", + "preversion": "npm test", + "test": "tap" + }, "tap": { "check-coverage": true }, - "engines": { - "node": ">= 8" - } -} + "version": "2.0.2" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/word-wrap/package.json b/tools/node_modules/eslint/node_modules/word-wrap/package.json index 6f8f633c475f82..b53b03260e2797 100644 --- a/tools/node_modules/eslint/node_modules/word-wrap/package.json +++ b/tools/node_modules/eslint/node_modules/word-wrap/package.json @@ -1,39 +1,65 @@ { - "name": "word-wrap", - "description": "Wrap words to a specified length.", - "version": "1.2.3", - "homepage": "https://github.com/jonschlinkert/word-wrap", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Danilo Sampaio (localhost:8080)", - "Fede Ramirez (https://2fd.github.io)", - "Joe Hildebrand (https://twitter.com/hildjj)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)", - "Todd Kennedy (https://tck.io)", - "Waldemar Reusch (https://github.com/lordvlad)", - "Wolfgang Faust (http://www.linestarve.com)", - "Zach Hale (http://zachhale.com)" - ], - "repository": "jonschlinkert/word-wrap", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, "bugs": { "url": "https://github.com/jonschlinkert/word-wrap/issues" }, - "license": "MIT", - "files": [ - "index.js", - "index.d.ts" + "bundleDependencies": false, + "contributors": [ + { + "name": "Danilo Sampaio", + "email": "danilo.sampaio@gmail.com", + "url": "localhost:8080" + }, + { + "name": "Fede Ramirez", + "email": "i@2fd.me", + "url": "https://2fd.github.io" + }, + { + "name": "Joe Hildebrand", + "email": "joe-github@cursive.net", + "url": "https://twitter.com/hildjj" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Todd Kennedy", + "url": "https://tck.io" + }, + { + "name": "Waldemar Reusch", + "url": "https://github.com/lordvlad" + }, + { + "name": "Wolfgang Faust", + "url": "http://www.linestarve.com" + }, + { + "name": "Zach Hale", + "email": "zachhale@gmail.com", + "url": "http://zachhale.com" + } ], - "main": "index.js", - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha" - }, + "deprecated": false, + "description": "Wrap words to a specified length.", "devDependencies": { "gulp-format-md": "^0.1.11", "mocha": "^3.2.0" }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/jonschlinkert/word-wrap", "keywords": [ "break", "carriage", @@ -48,6 +74,16 @@ "words", "wrap" ], + "license": "MIT", + "main": "index.js", + "name": "word-wrap", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/word-wrap.git" + }, + "scripts": { + "test": "mocha" + }, "typings": "index.d.ts", "verb": { "toc": false, @@ -73,5 +109,6 @@ "verb", "verb-generate-readme" ] - } -} + }, + "version": "1.2.3" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/wrappy/package.json b/tools/node_modules/eslint/node_modules/wrappy/package.json index 130752046714d6..e80b47520f24ec 100644 --- a/tools/node_modules/eslint/node_modules/wrappy/package.json +++ b/tools/node_modules/eslint/node_modules/wrappy/package.json @@ -1,29 +1,35 @@ { - "name": "wrappy", - "version": "1.0.2", - "description": "Callback wrapping utility", - "main": "wrappy.js", - "files": [ - "wrappy.js" - ], - "directories": { - "test": "test" + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/npm/wrappy/issues" }, + "bundleDependencies": false, "dependencies": {}, + "deprecated": false, + "description": "Callback wrapping utility", "devDependencies": { "tap": "^2.3.1" }, - "scripts": { - "test": "tap --coverage test/*.js" + "directories": { + "test": "test" }, + "files": [ + "wrappy.js" + ], + "homepage": "https://github.com/npm/wrappy", + "license": "ISC", + "main": "wrappy.js", + "name": "wrappy", "repository": { "type": "git", - "url": "https://github.com/npm/wrappy" + "url": "git+https://github.com/npm/wrappy.git" }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "bugs": { - "url": "https://github.com/npm/wrappy/issues" + "scripts": { + "test": "tap --coverage test/*.js" }, - "homepage": "https://github.com/npm/wrappy" -} + "version": "1.0.2" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/yallist/package.json b/tools/node_modules/eslint/node_modules/yallist/package.json index 8a083867d72e00..2d0ad3cb6e2f0c 100644 --- a/tools/node_modules/eslint/node_modules/yallist/package.json +++ b/tools/node_modules/eslint/node_modules/yallist/package.json @@ -1,8 +1,19 @@ { - "name": "yallist", - "version": "4.0.0", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/yallist/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, "description": "Yet Another Linked List", - "main": "yallist.js", + "devDependencies": { + "tap": "^12.1.0" + }, "directories": { "test": "test" }, @@ -10,20 +21,19 @@ "yallist.js", "iterator.js" ], - "dependencies": {}, - "devDependencies": { - "tap": "^12.1.0" - }, - "scripts": { - "test": "tap test/*.js --100", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --all; git push origin --tags" - }, + "homepage": "https://github.com/isaacs/yallist#readme", + "license": "ISC", + "main": "yallist.js", + "name": "yallist", "repository": { "type": "git", "url": "git+https://github.com/isaacs/yallist.git" }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC" -} + "scripts": { + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap test/*.js --100" + }, + "version": "4.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/package.json b/tools/node_modules/eslint/package.json index cdf5a4b180e1d7..e88d1b76c2f4fc 100644 --- a/tools/node_modules/eslint/package.json +++ b/tools/node_modules/eslint/package.json @@ -1,50 +1,15 @@ { - "name": "eslint", - "version": "7.21.0", - "author": "Nicholas C. Zakas ", - "description": "An AST-based pattern checker for JavaScript.", - "bin": { - "eslint": "./bin/eslint.js" - }, - "main": "./lib/api.js", - "scripts": { - "test": "node Makefile.js test", - "test:cli": "mocha", - "lint": "node Makefile.js lint", - "fix": "node Makefile.js lint -- fix", - "fuzz": "node Makefile.js fuzz", - "generate-release": "node Makefile.js generateRelease", - "generate-alpharelease": "node Makefile.js generatePrerelease -- alpha", - "generate-betarelease": "node Makefile.js generatePrerelease -- beta", - "generate-rcrelease": "node Makefile.js generatePrerelease -- rc", - "publish-release": "node Makefile.js publishRelease", - "docs": "node Makefile.js docs", - "gensite": "node Makefile.js gensite", - "webpack": "node Makefile.js webpack", - "perf": "node Makefile.js perf" + "author": { + "name": "Nicholas C. Zakas", + "email": "nicholas+npm@nczconsulting.com" }, - "gitHooks": { - "pre-commit": "lint-staged" + "bin": { + "eslint": "bin/eslint.js" }, - "lint-staged": { - "*.js": [ - "eslint --fix", - "git add" - ], - "*.md": "markdownlint" + "bugs": { + "url": "https://github.com/eslint/eslint/issues/" }, - "files": [ - "LICENSE", - "README.md", - "bin", - "conf", - "lib", - "messages" - ], - "repository": "eslint/eslint", - "funding": "https://opencollective.com/eslint", - "homepage": "https://eslint.org", - "bugs": "https://github.com/eslint/eslint/issues/", + "bundleDependencies": false, "dependencies": { "@babel/code-frame": "7.12.11", "@eslint/eslintrc": "^0.4.0", @@ -63,7 +28,7 @@ "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", "glob-parent": "^5.0.0", - "globals": "^12.1.0", + "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", @@ -71,7 +36,7 @@ "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.20", + "lodash": "^4.17.21", "minimatch": "^3.0.4", "natural-compare": "^1.4.0", "optionator": "^0.9.1", @@ -84,6 +49,8 @@ "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, + "deprecated": false, + "description": "An AST-based pattern checker for JavaScript.", "devDependencies": { "@babel/core": "^7.4.3", "@babel/preset-env": "^7.4.3", @@ -108,11 +75,11 @@ "fs-teardown": "^0.1.0", "glob": "^7.1.6", "jsdoc": "^3.5.5", - "karma": "^4.0.1", + "karma": "^6.1.1", "karma-chrome-launcher": "^3.1.0", - "karma-mocha": "^1.3.0", - "karma-mocha-reporter": "^2.2.3", - "karma-webpack": "^4.0.0-rc.6", + "karma-mocha": "^2.0.1", + "karma-mocha-reporter": "^2.2.5", + "karma-webpack": "^5.0.0", "lint-staged": "^10.1.2", "load-perf": "^0.2.0", "markdownlint": "^0.19.0", @@ -120,6 +87,7 @@ "memfs": "^3.0.1", "mocha": "^7.1.1", "mocha-junit-reporter": "^1.23.0", + "node-polyfill-webpack-plugin": "^1.0.3", "npm-license": "^0.3.3", "nyc": "^15.0.1", "proxyquire": "^2.0.1", @@ -129,10 +97,26 @@ "shelljs": "^0.8.2", "sinon": "^9.0.1", "temp": "^0.9.0", - "webpack": "^4.35.0", - "webpack-cli": "^3.3.5", + "webpack": "^5.23.0", + "webpack-cli": "^4.5.0", "yorkie": "^2.0.0" }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "files": [ + "LICENSE", + "README.md", + "bin", + "conf", + "lib", + "messages" + ], + "funding": "https://opencollective.com/eslint", + "gitHooks": { + "pre-commit": "lint-staged" + }, + "homepage": "https://eslint.org", "keywords": [ "ast", "lint", @@ -141,7 +125,34 @@ "espree" ], "license": "MIT", - "engines": { - "node": "^10.12.0 || >=12.0.0" - } -} + "lint-staged": { + "*.js": [ + "eslint --fix", + "git add" + ], + "*.md": "markdownlint" + }, + "main": "./lib/api.js", + "name": "eslint", + "repository": { + "type": "git", + "url": "git+https://github.com/eslint/eslint.git" + }, + "scripts": { + "docs": "node Makefile.js docs", + "fix": "node Makefile.js lint -- fix", + "fuzz": "node Makefile.js fuzz", + "generate-alpharelease": "node Makefile.js generatePrerelease -- alpha", + "generate-betarelease": "node Makefile.js generatePrerelease -- beta", + "generate-rcrelease": "node Makefile.js generatePrerelease -- rc", + "generate-release": "node Makefile.js generateRelease", + "gensite": "node Makefile.js gensite", + "lint": "node Makefile.js lint", + "perf": "node Makefile.js perf", + "publish-release": "node Makefile.js publishRelease", + "test": "node Makefile.js test", + "test:cli": "mocha", + "webpack": "node Makefile.js webpack" + }, + "version": "7.22.0" +} \ No newline at end of file From 836cb679457b869bcc20f94cc17837238083dfac Mon Sep 17 00:00:00 2001 From: James Addison Date: Tue, 9 Mar 2021 13:08:47 +0000 Subject: [PATCH 02/85] src: add .note.GNU-stack section This indicates to GNU binutils that it can unset the executable stack flag on the binary that it is building. PR-URL: https://github.com/nodejs/node/pull/37688 Refs: https://github.com/nodejs/node/issues/17933 Reviewed-By: Daniel Bevenius --- src/large_pages/node_text_start.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/large_pages/node_text_start.S b/src/large_pages/node_text_start.S index 1609b254f0495a..3227b62464932c 100644 --- a/src/large_pages/node_text_start.S +++ b/src/large_pages/node_text_start.S @@ -1,3 +1,6 @@ +#if defined(__ELF__) +.section .note.GNU-stack,"",@progbits +#endif .text .align 0x2000 .global __node_text_start From 4487483d9dd679f52857e9c23be67f88517a5f2a Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 10 Mar 2021 19:17:44 -0800 Subject: [PATCH 03/85] test: fix test-fs-utimes on non-Y2K38 file systems MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move Y2K38-specific parts of test-fs-utimes to test-fs-utimes-y2K38.js. On non-Windows, check for Y2K38 support and skip if it is unsupported. Fixes: https://github.com/nodejs/node/issues/36591 PR-URL: https://github.com/nodejs/node/pull/37707 Reviewed-By: Michaël Zasso Reviewed-By: Richard Lau --- test/parallel/test-fs-utimes-y2K38.js | 63 +++++++++++++++++++++++++++ test/parallel/test-fs-utimes.js | 31 ------------- 2 files changed, 63 insertions(+), 31 deletions(-) create mode 100644 test/parallel/test-fs-utimes-y2K38.js diff --git a/test/parallel/test-fs-utimes-y2K38.js b/test/parallel/test-fs-utimes-y2K38.js new file mode 100644 index 00000000000000..06c5060c65d2fc --- /dev/null +++ b/test/parallel/test-fs-utimes-y2K38.js @@ -0,0 +1,63 @@ +'use strict'; +const common = require('../common'); + +if (common.isIBMi) { + common.skip('fs.utimesSync() currently fails on IBM i with Y2K38 values'); +} + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +const assert = require('assert'); +const fs = require('fs'); + +// Check for Y2K38 support. For Windows and AIX, assume it's there. Windows +// doesn't have `touch` and `date -r` which are used in the check for support. +// AIX lacks `date -r`. +if (!common.isWindows && !common.isAIX) { + const testFilePath = `${tmpdir.path}/y2k38-test`; + const testFileDate = '204001020304'; + const { spawnSync } = require('child_process'); + const touchResult = spawnSync('touch', + ['-t', testFileDate, testFilePath], + { encoding: 'utf8' }); + if (touchResult.status !== 0) { + common.skip('File system appears to lack Y2K38 support (touch failed)'); + } + + const dateResult = spawnSync('date', + ['-r', testFilePath, '+%Y%m%d%H%M'], + { encoding: 'utf8' }); + + assert.strictEqual(dateResult.status, 0); + if (dateResult.stdout.trim() !== testFileDate) { + common.skip('File system appears to lack Y2k38 support (date failed)'); + } +} + +// Ref: https://github.com/nodejs/node/issues/13255 +const path = `${tmpdir.path}/test-utimes-precision`; +fs.writeFileSync(path, ''); + +const Y2K38_mtime = 2 ** 31; +fs.utimesSync(path, Y2K38_mtime, Y2K38_mtime); +const Y2K38_stats = fs.statSync(path); +assert.strictEqual(Y2K38_stats.mtime.getTime() / 1000, Y2K38_mtime); + +if (common.isWindows) { + // This value would get converted to (double)1713037251359.9998 + const truncate_mtime = 1713037251360; + fs.utimesSync(path, truncate_mtime / 1000, truncate_mtime / 1000); + const truncate_stats = fs.statSync(path); + assert.strictEqual(truncate_stats.mtime.getTime(), truncate_mtime); + + // test Y2K38 for windows + // This value if treaded as a `signed long` gets converted to -2135622133469. + // POSIX systems stores timestamps in {long t_sec, long t_usec}. + // NTFS stores times in nanoseconds in a single `uint64_t`, so when libuv + // calculates (long)`uv_timespec_t.tv_sec` we get 2's complement. + const overflow_mtime = 2159345162531; + fs.utimesSync(path, overflow_mtime / 1000, overflow_mtime / 1000); + const overflow_stats = fs.statSync(path); + assert.strictEqual(overflow_stats.mtime.getTime(), overflow_mtime); +} diff --git a/test/parallel/test-fs-utimes.js b/test/parallel/test-fs-utimes.js index b81c5b6bf62940..8f8286f8a3343f 100644 --- a/test/parallel/test-fs-utimes.js +++ b/test/parallel/test-fs-utimes.js @@ -156,37 +156,6 @@ function runTests(iter) { } } -// Ref: https://github.com/nodejs/node/issues/13255 -const path = `${tmpdir.path}/test-utimes-precision`; -fs.writeFileSync(path, ''); - -// Test Y2K38 for all platforms [except 'arm', 'OpenBSD', 'SunOS' and 'IBMi'] -if (!process.arch.includes('arm') && - !common.isOpenBSD && !common.isSunOS && !common.isIBMi) { - const Y2K38_mtime = 2 ** 31; - fs.utimesSync(path, Y2K38_mtime, Y2K38_mtime); - const Y2K38_stats = fs.statSync(path); - assert.strictEqual(Y2K38_stats.mtime.getTime() / 1000, Y2K38_mtime); -} - -if (common.isWindows) { - // This value would get converted to (double)1713037251359.9998 - const truncate_mtime = 1713037251360; - fs.utimesSync(path, truncate_mtime / 1000, truncate_mtime / 1000); - const truncate_stats = fs.statSync(path); - assert.strictEqual(truncate_stats.mtime.getTime(), truncate_mtime); - - // test Y2K38 for windows - // This value if treaded as a `signed long` gets converted to -2135622133469. - // POSIX systems stores timestamps in {long t_sec, long t_usec}. - // NTFS stores times in nanoseconds in a single `uint64_t`, so when libuv - // calculates (long)`uv_timespec_t.tv_sec` we get 2's complement. - const overflow_mtime = 2159345162531; - fs.utimesSync(path, overflow_mtime / 1000, overflow_mtime / 1000); - const overflow_stats = fs.statSync(path); - assert.strictEqual(overflow_stats.mtime.getTime(), overflow_mtime); -} - const expectTypeError = { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' From a8edf1aafe24f3f943f61061ab978db35ffb9c81 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 13 Mar 2021 11:50:52 -0800 Subject: [PATCH 04/85] test: add known_issues test for #13683 Add a known_issues test for a known Windows issue. Refs: https://github.com/nodejs/node/issues/13683 PR-URL: https://github.com/nodejs/node/pull/37744 Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau --- test/known_issues/known_issues.status | 16 ++++++++++++++++ .../test-path-posix-relative-on-windows.js | 10 ++++++++++ 2 files changed, 26 insertions(+) create mode 100644 test/known_issues/test-path-posix-relative-on-windows.js diff --git a/test/known_issues/known_issues.status b/test/known_issues/known_issues.status index e0f0a456089bf2..690e6e9840b77c 100644 --- a/test/known_issues/known_issues.status +++ b/test/known_issues/known_issues.status @@ -15,16 +15,32 @@ test-vm-timeout-escape-queuemicrotask: SKIP [$system==win32] [$system==linux] +# Windows-specific test +test-path-posix-relative-on-windows: SKIP [$system==macos] +# Windows-specific test +test-path-posix-relative-on-windows: SKIP [$system==solaris] +# Windows-specific test +test-path-posix-relative-on-windows: SKIP [$system==freebsd] +# Windows-specific test +test-path-posix-relative-on-windows: SKIP [$system==aix] +# Windows-specific test +test-path-posix-relative-on-windows: SKIP [$arch==arm] # The Raspberry Pis are too slow to run this test. # See https://github.com/nodejs/build/issues/2227#issuecomment-608334574 test-crypto-authenticated-stream: SKIP +# Windows-specific test +test-path-posix-relative-on-windows: SKIP + +[$system==ibmi] +# Windows-specific test +test-path-posix-relative-on-windows: SKIP diff --git a/test/known_issues/test-path-posix-relative-on-windows.js b/test/known_issues/test-path-posix-relative-on-windows.js new file mode 100644 index 00000000000000..bcaaca8b18a1ef --- /dev/null +++ b/test/known_issues/test-path-posix-relative-on-windows.js @@ -0,0 +1,10 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const path = require('path'); + +// Refs: https://github.com/nodejs/node/issues/13683 + +const relativePath = path.posix.relative('a/b/c', '../../x'); +assert.match(relativePath, /^(\.\.\/){3,5}x$/); From 2e82a97520b264c3b5417506f2462025615d63c8 Mon Sep 17 00:00:00 2001 From: Jiawen Geng Date: Tue, 16 Mar 2021 07:10:49 +0000 Subject: [PATCH 05/85] doc: add gyp maintain info PR-URL: https://github.com/nodejs/node/pull/37765 Reviewed-By: Ujjwal Sharma Reviewed-By: Richard Lau Reviewed-By: Mary Marchini Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott --- doc/api/n-api.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 376af133b357d7..cb741363c300ee 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -160,9 +160,9 @@ the native addon. #### node-gyp -[node-gyp][] is a build system based on Google's [GYP][] tool and comes -bundled with npm. GYP, and therefore node-gyp, requires that Python be -installed. +[node-gyp][] is a build system based on the [gyp-next][] fork of +Google's [GYP][] tool and comes bundled with npm. GYP, and therefore node-gyp, +requires that Python be installed. Historically, node-gyp has been the tool of choice for building native addons. It has widespread adoption and documentation. However, some @@ -6087,6 +6087,7 @@ the add-on's file name during loading. [context-aware addons]: addons.md#addons_context_aware_addons [docs]: https://github.com/nodejs/node-addon-api#api-documentation [global scope]: globals.md +[gyp-next]: https://github.com/nodejs/gyp-next [module scope]: modules.md#modules_the_module_scope [node-gyp]: https://github.com/nodejs/node-gyp [node-pre-gyp]: https://github.com/mapbox/node-pre-gyp From dc9cd43d8f9663f435b7e776723114e82e970200 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 17 Mar 2021 11:00:57 -0700 Subject: [PATCH 06/85] buffer: implement btoa and atob Signed-off-by: James M Snell PR-URL: https://github.com/nodejs/node/pull/37529 Fixes: https://github.com/nodejs/node/issues/3462 Reviewed-By: Anna Henningsen Reviewed-By: Matteo Collina --- doc/api/buffer.md | 38 ++++++++++++++++++++++++++++++++++++++ lib/buffer.js | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 764762c986fa09..f31b8b298b02eb 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -3277,6 +3277,44 @@ While, the `Buffer` object is available as a global, there are additional `Buffer`-related APIs that are available only via the `buffer` module accessed using `require('buffer')`. +### `buffer.atob(data)` + + +* `data` {any} The Base64-encoded input string. + +Decodes a string of Base64-encoded data into bytes, and encodes those bytes +into a string using Latin-1 (ISO-8859-1). + +The `data` may be any JavaScript-value that can be coerced into a string. + +**This function is only provided for compatibility with legacy web platform APIs +and should never be used in new code, because they use strings to represent +binary data and predate the introduction of typed arrays in JavaScript. +For code running using Node.js APIs, converting between base64-encoded strings +and binary data should be performed using `Buffer.from(str, 'base64')` and +`buf.toString('base64')`.** + +### `buffer.btoa(data)` + + +* `data` {any} An ASCII (Latin1) string. + +Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes +into a string using Base64. + +The `data` may be any JavaScript-value that can be coerced into a string. + +**This function is only provided for compatibility with legacy web platform APIs +and should never be used in new code, because they use strings to represent +binary data and predate the introduction of typed arrays in JavaScript. +For code running using Node.js APIs, converting between base64-encoded strings +and binary data should be performed using `Buffer.from(str, 'base64')` and +`buf.toString('base64')`.** + ### `buffer.INSPECT_MAX_BYTES` + +> Stability: 3 - Legacy. The feature is no longer recommended for use. While it +likely will not be removed, and is still covered by semantic-versioning +guarantees, use of the feature should be avoided. + Use caution when making use of Experimental features, particularly within modules. Users may not be aware that experimental features are being used. Bugs or behavior changes may surprise users when Experimental API From 185d4cd4aae9825db492e2f283383da12633da82 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 17 Mar 2021 12:40:58 -0700 Subject: [PATCH 22/85] doc: revoke deprecation of legacy url, change status to legacy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: James M Snell Fixes: https://github.com/nodejs/node/issues/25099 PR-URL: https://github.com/nodejs/node/pull/37784 Reviewed-By: Anna Henningsen Reviewed-By: Matteo Collina Reviewed-By: Vladimir de Turckheim Reviewed-By: Michaël Zasso Reviewed-By: Michael Dawson Reviewed-By: Beth Griggs --- doc/api/deprecations.md | 5 ++++- doc/api/url.md | 30 +++++++++++++++++++++++++----- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index ac0f99bf4fcf95..13f0d9eb40c5a0 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2169,12 +2169,15 @@ future release. ### DEP0116: Legacy URL API -Type: Documentation-only +Type: Deprecation revoked The [Legacy URL API][] is deprecated. This includes [`url.format()`][], [`url.parse()`][], [`url.resolve()`][], and the [legacy `urlObject`][]. Please diff --git a/doc/api/url.md b/doc/api/url.md index e78b15d09d28d1..f93cf741473794 100644 --- a/doc/api/url.md +++ b/doc/api/url.md @@ -1075,18 +1075,29 @@ console.log(urlToHttpOptions(myUrl)); ## Legacy URL API +> Stability: 3 - Legacy: Use the WHATWG URL API instead. + ### Legacy `urlObject` -> Stability: 0 - Deprecated: Use the WHATWG URL API instead. +> Stability: 3 - Legacy: Use the WHATWG URL API instead. The legacy `urlObject` (`require('url').Url`) is created and returned by the `url.parse()` function. @@ -1192,6 +1203,9 @@ forward-slash characters (`/`) are required following the colon in the -> Stability: 0 - Deprecated: Use the WHATWG URL API instead. +> Stability: 3 - Legacy: Use the WHATWG URL API instead. * `urlObject` {Object|string} A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing @@ -1285,6 +1299,9 @@ The formatting process operates as follows: -> Stability: 0 - Deprecated: Use the WHATWG URL API instead. +> Stability: 3 - Legacy: Use the WHATWG URL API instead. * `urlString` {string} The URL string to parse. * `parseQueryString` {boolean} If `true`, the `query` property will always @@ -1329,6 +1346,9 @@ incorrect handling of usernames and passwords have been identified. -> Stability: 0 - Deprecated: Use the WHATWG URL API instead. +> Stability: 3 - Legacy: Use the WHATWG URL API instead. * `from` {string} The Base URL being resolved against. * `to` {string} The HREF URL being resolved. From 6da0a0e85aca38897bb0a288a7b20e016f638f42 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Fri, 19 Mar 2021 10:54:53 -0700 Subject: [PATCH 23/85] doc: apply style for legacy status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: James M Snell PR-URL: https://github.com/nodejs/node/pull/37784 Reviewed-By: Anna Henningsen Reviewed-By: Matteo Collina Reviewed-By: Vladimir de Turckheim Reviewed-By: Michaël Zasso Reviewed-By: Michael Dawson Reviewed-By: Beth Griggs --- doc/api_assets/style.css | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/api_assets/style.css b/doc/api_assets/style.css index fb34bcf12a2195..189015268bcb72 100644 --- a/doc/api_assets/style.css +++ b/doc/api_assets/style.css @@ -4,6 +4,7 @@ --black1: #090c15; --black2: #2c3437; --black3: #0d111d; + --blue1: #00f; --white: #ffffff; --white-smoke: #f2f2f2; --grey-smoke: #e9edf0; @@ -263,6 +264,10 @@ ol.version-picker li:last-child a { background-color: var(--green2); } +.api_stability_3 { + background-color: var(--blue1); +} + .module_stability { vertical-align: middle; } @@ -372,7 +377,7 @@ dd + dt.pre { #apicontent { padding-top: 1rem; } - + #apicontent section { content-visibility: auto; contain-intrinsic-size: 1px 5000px; From b09d03268368394592799e9521e574e928dedf88 Mon Sep 17 00:00:00 2001 From: Derek Lewis Date: Fri, 12 Mar 2021 03:33:35 -0500 Subject: [PATCH 24/85] doc: move Derek Lewis back to collaborators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Conclude winter break and resume collaboratorship at start of spring. Refs: https://github.com/nodejs/node/pull/36514 PR-URL: https://github.com/nodejs/node/pull/37726 Reviewed-By: Michaël Zasso Reviewed-By: Antoine du Hamel Reviewed-By: Beth Griggs Reviewed-By: Richard Lau Reviewed-By: Gireesh Punathil Reviewed-By: Rich Trott Reviewed-By: Benjamin Gruenbaum Reviewed-By: Darshan Sen Reviewed-By: James M Snell Reviewed-By: Matteo Collina Reviewed-By: Michael Dawson Reviewed-By: Geoffrey Booth Reviewed-By: Colin Ihrig Reviewed-By: Сковорода Никита Андреевич Reviewed-By: Tobias Nießen --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6319043ca5e2e1..bc7383fcbf444c 100644 --- a/README.md +++ b/README.md @@ -285,6 +285,8 @@ For information about the governance of the Node.js project, see **Danielle Adams** <adamzdanielle@gmail.com> (she/her) * [davisjam](https://github.com/davisjam) - **Jamie Davis** <davisjam@vt.edu> (he/him) +* [DerekNonGeneric](https://github.com/DerekNonGeneric) - +**Derek Lewis** <DerekNonGeneric@inf.is> (he/him) * [devnexen](https://github.com/devnexen) - **David Carlier** <devnexen@gmail.com> * [devsnek](https://github.com/devsnek) - @@ -478,8 +480,6 @@ For information about the governance of the Node.js project, see **Claudio Rodriguez** <cjrodr@yahoo.com> * [DavidCai1993](https://github.com/DavidCai1993) - **David Cai** <davidcai1993@yahoo.com> (he/him) -* [DerekNonGeneric](https://github.com/DerekNonGeneric) - -**Derek Lewis** <DerekNonGeneric@inf.is> (he/him) * [digitalinfinity](https://github.com/digitalinfinity) - **Hitesh Kanwathirtha** <digitalinfinity@gmail.com> (he/him) * [eljefedelrodeodeljefe](https://github.com/eljefedelrodeodeljefe) - From b6be4724566ab7704321be6db97109b10e26dd5b Mon Sep 17 00:00:00 2001 From: Jiawen Geng Date: Thu, 18 Mar 2021 06:59:30 +0000 Subject: [PATCH 25/85] tools: update gitignore for CMake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/37793 Reviewed-By: Antoine du Hamel Reviewed-By: Colin Ihrig Reviewed-By: Michaël Zasso Reviewed-By: James M Snell --- .gitignore | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index c5ae6ea68d82fa..f2d8c226a698f1 100644 --- a/.gitignore +++ b/.gitignore @@ -139,6 +139,15 @@ tools/*/*.i.tmp # === Rules for Windows vcbuild.bat === /temp-vcbuild +# === Rules for CMake === +cmake-build-debug/ +CMakeCache.txt +CMakeFiles +CTestTestfile.cmake +cmake_install.cmake +install_manifest.txt +*.cbp + # === Global Rules === # Keep last to avoid being excluded *.pyc From 3376051a0e25e8126a31220fa2ad03a0082fbe2a Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 17 Mar 2021 23:44:34 +0100 Subject: [PATCH 26/85] doc: fix JS flavor selection PR-URL: https://github.com/nodejs/node/pull/37791 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott --- doc/api_assets/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api_assets/style.css b/doc/api_assets/style.css index 189015268bcb72..04299595ca80d6 100644 --- a/doc/api_assets/style.css +++ b/doc/api_assets/style.css @@ -782,7 +782,7 @@ kbd { .js-flavor-selector:checked { background-image: url(./js-flavor-esm.svg); } -.js-flavor-selector:not(:checked) ~ .esm, +.js-flavor-selector:not(:checked) ~ .mjs, .js-flavor-selector:checked ~ .cjs { display: none; } From e85f311cf2784522a88291e7f4e28953cd057616 Mon Sep 17 00:00:00 2001 From: Wassim Chegham Date: Thu, 18 Mar 2021 17:52:08 +0100 Subject: [PATCH 27/85] test: refactor code to use AbortSignal.abort() PR-URL: https://github.com/nodejs/node/pull/37798 Refs: https://github.com/whatwg/dom/pull/960 Reviewed-By: James M Snell Reviewed-By: Benjamin Gruenbaum Reviewed-By: Luigi Pinca Reviewed-By: Zijian Liu Reviewed-By: Zeyu Yang --- ...child-process-exec-abortcontroller-promisified.js | 4 +--- ...d-process-execFile-promisified-abortController.js | 4 +--- test/parallel/test-child-process-execfile.js | 4 +--- .../parallel/test-child-process-fork-abort-signal.js | 8 ++------ test/parallel/test-child-process-spawn-controller.js | 5 +---- test/parallel/test-dgram-close-signal.js | 4 +--- test/parallel/test-event-on-async-iterator.js | 10 ++++------ test/parallel/test-events-once.js | 10 ++++------ .../test-fs-promises-file-handle-readFile.js | 4 +--- test/parallel/test-fs-promises-readfile.js | 4 +--- test/parallel/test-fs-readfile.js | 4 +--- test/parallel/test-fs-watch-abort-signal.js | 4 +--- .../test-net-server-listen-options-signal.js | 5 ++--- test/parallel/test-stream-pipeline.js | 4 +--- test/parallel/test-stream-writable-destroy.js | 5 ++--- test/parallel/test-timers-promisified.js | 12 +++--------- 16 files changed, 27 insertions(+), 64 deletions(-) diff --git a/test/parallel/test-child-process-exec-abortcontroller-promisified.js b/test/parallel/test-child-process-exec-abortcontroller-promisified.js index ac77d39938d8b6..a19b797ba6671d 100644 --- a/test/parallel/test-child-process-exec-abortcontroller-promisified.js +++ b/test/parallel/test-child-process-exec-abortcontroller-promisified.js @@ -37,9 +37,7 @@ const waitCommand = common.isLinux ? } { - const ac = new AbortController(); - const { signal } = ac; - ac.abort(); + const signal = AbortSignal.abort(); // Abort in advance const promise = execPromisifed(waitCommand, { signal }); assert.rejects(promise, /AbortError/, 'pre aborted signal failed') diff --git a/test/parallel/test-child-process-execFile-promisified-abortController.js b/test/parallel/test-child-process-execFile-promisified-abortController.js index ccfcafc5d51e58..38c177eb33389c 100644 --- a/test/parallel/test-child-process-execFile-promisified-abortController.js +++ b/test/parallel/test-child-process-execFile-promisified-abortController.js @@ -29,9 +29,7 @@ const invalidArgTypeError = { { // Verify that the signal option works properly when already aborted - const ac = new AbortController(); - const { signal } = ac; - ac.abort(); + const signal = AbortSignal.abort(); assert.rejects( promisified(process.execPath, [echoFixture, 0], { signal }), diff --git a/test/parallel/test-child-process-execfile.js b/test/parallel/test-child-process-execfile.js index a8f0cabacc2860..40cb8cd3afab01 100644 --- a/test/parallel/test-child-process-execfile.js +++ b/test/parallel/test-child-process-execfile.js @@ -69,9 +69,7 @@ const execOpts = { encoding: 'utf8', shell: true }; { // Verify that does not spawn a child if already aborted - const ac = new AbortController(); - const { signal } = ac; - ac.abort(); + const signal = AbortSignal.abort(); const check = common.mustCall((err) => { assert.strictEqual(err.code, 'ABORT_ERR'); diff --git a/test/parallel/test-child-process-fork-abort-signal.js b/test/parallel/test-child-process-fork-abort-signal.js index 93a968366270cc..9982444c429552 100644 --- a/test/parallel/test-child-process-fork-abort-signal.js +++ b/test/parallel/test-child-process-fork-abort-signal.js @@ -23,9 +23,7 @@ const { fork } = require('child_process'); } { // Test passing an already aborted signal to a forked child_process - const ac = new AbortController(); - const { signal } = ac; - ac.abort(); + const signal = AbortSignal.abort(); const cp = fork(fixtures.path('child-process-stay-alive-forever.js'), { signal }); @@ -40,9 +38,7 @@ const { fork } = require('child_process'); { // Test passing a different kill signal - const ac = new AbortController(); - const { signal } = ac; - ac.abort(); + const signal = AbortSignal.abort(); const cp = fork(fixtures.path('child-process-stay-alive-forever.js'), { signal, killSignal: 'SIGKILL', diff --git a/test/parallel/test-child-process-spawn-controller.js b/test/parallel/test-child-process-spawn-controller.js index 36c4112cbe00da..5199c7a09557c9 100644 --- a/test/parallel/test-child-process-spawn-controller.js +++ b/test/parallel/test-child-process-spawn-controller.js @@ -29,10 +29,7 @@ const aliveScript = fixtures.path('child-process-stay-alive-forever.js'); { // Verify that passing an already-aborted signal works. - const controller = new AbortController(); - const { signal } = controller; - - controller.abort(); + const signal = AbortSignal.abort(); const cp = spawn(process.execPath, [aliveScript], { signal, diff --git a/test/parallel/test-dgram-close-signal.js b/test/parallel/test-dgram-close-signal.js index f1008b599dbd18..26de38b504dd4a 100644 --- a/test/parallel/test-dgram-close-signal.js +++ b/test/parallel/test-dgram-close-signal.js @@ -25,9 +25,7 @@ const dgram = require('dgram'); { // Test close with pre-aborted signal. - const controller = new AbortController(); - controller.abort(); - const { signal } = controller; + const signal = AbortSignal.abort(); const server = dgram.createSocket({ type: 'udp4', signal }); server.on('close', common.mustCall()); } diff --git a/test/parallel/test-event-on-async-iterator.js b/test/parallel/test-event-on-async-iterator.js index 276a6f62d37e33..9ad319136fa493 100644 --- a/test/parallel/test-event-on-async-iterator.js +++ b/test/parallel/test-event-on-async-iterator.js @@ -248,28 +248,26 @@ async function nodeEventTarget() { async function abortableOnBefore() { const ee = new EventEmitter(); - const ac = new AbortController(); - ac.abort(); + const abortedSignal = AbortSignal.abort(); [1, {}, null, false, 'hi'].forEach((signal) => { assert.throws(() => on(ee, 'foo', { signal }), { code: 'ERR_INVALID_ARG_TYPE' }); }); - assert.throws(() => on(ee, 'foo', { signal: ac.signal }), { + assert.throws(() => on(ee, 'foo', { signal: abortedSignal }), { name: 'AbortError' }); } async function eventTargetAbortableOnBefore() { const et = new EventTarget(); - const ac = new AbortController(); - ac.abort(); + const abortedSignal = AbortSignal.abort(); [1, {}, null, false, 'hi'].forEach((signal) => { assert.throws(() => on(et, 'foo', { signal }), { code: 'ERR_INVALID_ARG_TYPE' }); }); - assert.throws(() => on(et, 'foo', { signal: ac.signal }), { + assert.throws(() => on(et, 'foo', { signal: abortedSignal }), { name: 'AbortError' }); } diff --git a/test/parallel/test-events-once.js b/test/parallel/test-events-once.js index 14b8ea5815a61a..56042b1ecee4f9 100644 --- a/test/parallel/test-events-once.js +++ b/test/parallel/test-events-once.js @@ -133,9 +133,8 @@ async function prioritizesEventEmitter() { async function abortSignalBefore() { const ee = new EventEmitter(); - const ac = new AbortController(); ee.on('error', common.mustNotCall()); - ac.abort(); + const abortedSignal = AbortSignal.abort(); await Promise.all([1, {}, 'hi', null, false].map((signal) => { return rejects(once(ee, 'foo', { signal }), { @@ -143,7 +142,7 @@ async function abortSignalBefore() { }); })); - return rejects(once(ee, 'foo', { signal: ac.signal }), { + return rejects(once(ee, 'foo', { signal: abortedSignal }), { name: 'AbortError' }); } @@ -184,8 +183,7 @@ async function abortSignalRemoveListener() { async function eventTargetAbortSignalBefore() { const et = new EventTarget(); - const ac = new AbortController(); - ac.abort(); + const abortedSignal = AbortSignal.abort(); await Promise.all([1, {}, 'hi', null, false].map((signal) => { return rejects(once(et, 'foo', { signal }), { @@ -193,7 +191,7 @@ async function eventTargetAbortSignalBefore() { }); })); - return rejects(once(et, 'foo', { signal: ac.signal }), { + return rejects(once(et, 'foo', { signal: abortedSignal }), { name: 'AbortError' }); } diff --git a/test/parallel/test-fs-promises-file-handle-readFile.js b/test/parallel/test-fs-promises-file-handle-readFile.js index 66dc8f0fb0e0a1..fc28dd23328df7 100644 --- a/test/parallel/test-fs-promises-file-handle-readFile.js +++ b/test/parallel/test-fs-promises-file-handle-readFile.js @@ -58,9 +58,7 @@ async function doReadAndCancel() { const fileHandle = await open(filePathForHandle, 'w+'); const buffer = Buffer.from('Dogs running'.repeat(10000), 'utf8'); fs.writeFileSync(filePathForHandle, buffer); - const controller = new AbortController(); - const { signal } = controller; - controller.abort(); + const signal = AbortSignal.abort(); await assert.rejects(readFile(fileHandle, { signal }), { name: 'AbortError' }); diff --git a/test/parallel/test-fs-promises-readfile.js b/test/parallel/test-fs-promises-readfile.js index d1c79580b835b6..a7fc46e5a6544a 100644 --- a/test/parallel/test-fs-promises-readfile.js +++ b/test/parallel/test-fs-promises-readfile.js @@ -43,9 +43,7 @@ async function validateReadFileProc() { } function validateReadFileAbortLogicBefore() { - const controller = new AbortController(); - const signal = controller.signal; - controller.abort(); + const signal = AbortSignal.abort(); assert.rejects(readFile(fn, { signal }), { name: 'AbortError' }); diff --git a/test/parallel/test-fs-readfile.js b/test/parallel/test-fs-readfile.js index b7d798a5db8e9b..a081eec099890d 100644 --- a/test/parallel/test-fs-readfile.js +++ b/test/parallel/test-fs-readfile.js @@ -54,9 +54,7 @@ for (const e of fileInfo) { } { // Test cancellation, before - const controller = new AbortController(); - const signal = controller.signal; - controller.abort(); + const signal = AbortSignal.abort(); fs.readFile(fileInfo[0].name, { signal }, common.mustCall((err, buf) => { assert.strictEqual(err.name, 'AbortError'); })); diff --git a/test/parallel/test-fs-watch-abort-signal.js b/test/parallel/test-fs-watch-abort-signal.js index cbe9a1457dc9ae..33936d2d491f8b 100644 --- a/test/parallel/test-fs-watch-abort-signal.js +++ b/test/parallel/test-fs-watch-abort-signal.js @@ -24,9 +24,7 @@ const fixtures = require('../common/fixtures'); { // Signal aborted before creating the watcher const file = fixtures.path('empty.js'); - const ac = new AbortController(); - const { signal } = ac; - ac.abort(); + const signal = AbortSignal.abort(); const watcher = fs.watch(file, { signal }); watcher.once('close', common.mustCall()); } diff --git a/test/parallel/test-net-server-listen-options-signal.js b/test/parallel/test-net-server-listen-options-signal.js index 80efaf1700cd75..60e78fa00c5080 100644 --- a/test/parallel/test-net-server-listen-options-signal.js +++ b/test/parallel/test-net-server-listen-options-signal.js @@ -26,8 +26,7 @@ const net = require('net'); { // Test close with pre-aborted signal. const server = net.createServer(); - const controller = new AbortController(); - controller.abort(); + const signal = AbortSignal.abort(); server.on('close', common.mustCall()); - server.listen({ port: 0, signal: controller.signal }); + server.listen({ port: 0, signal }); } diff --git a/test/parallel/test-stream-pipeline.js b/test/parallel/test-stream-pipeline.js index 86f9006d83c430..7940d3a90d1828 100644 --- a/test/parallel/test-stream-pipeline.js +++ b/test/parallel/test-stream-pipeline.js @@ -521,9 +521,7 @@ const net = require('net'); // Check pre-aborted signal const pipelinePromise = promisify(pipeline); async function run() { - const ac = new AbortController(); - const { signal } = ac; - ac.abort(); + const signal = AbortSignal.abort(); async function* producer() { yield '5'; await Promise.resolve(); diff --git a/test/parallel/test-stream-writable-destroy.js b/test/parallel/test-stream-writable-destroy.js index 9859c59e446c95..7cd800b0938138 100644 --- a/test/parallel/test-stream-writable-destroy.js +++ b/test/parallel/test-stream-writable-destroy.js @@ -448,11 +448,10 @@ const assert = require('assert'); } { - const ac = new AbortController(); - ac.abort(); + const signal = AbortSignal.abort(); const write = new Writable({ - signal: ac.signal, + signal, write(chunk, enc, cb) { cb(); } }); diff --git a/test/parallel/test-timers-promisified.js b/test/parallel/test-timers-promisified.js index 04c3ff96149352..45da5036727061 100644 --- a/test/parallel/test-timers-promisified.js +++ b/test/parallel/test-timers-promisified.js @@ -98,9 +98,7 @@ process.on('multipleResolves', common.mustNotCall()); } { - const ac = new AbortController(); - const signal = ac.signal; - ac.abort(); // Abort in advance + const signal = AbortSignal.abort(); // Abort in advance assert.rejects(setPromiseTimeout(10, undefined, { signal }), /AbortError/) .then(common.mustCall()); } @@ -114,17 +112,13 @@ process.on('multipleResolves', common.mustNotCall()); } { - const ac = new AbortController(); - const signal = ac.signal; - ac.abort(); // Abort in advance + const signal = AbortSignal.abort(); // Abort in advance assert.rejects(setPromiseImmediate(10, { signal }), /AbortError/) .then(common.mustCall()); } { - const ac = new AbortController(); - const { signal } = ac; - ac.abort(); // Abort in advance + const signal = AbortSignal.abort(); // Abort in advance const iterable = setInterval(1, undefined, { signal }); const iterator = iterable[Symbol.asyncIterator](); From a5205819d83dcf7f422546072f0397a01f0fc3f0 Mon Sep 17 00:00:00 2001 From: simov Date: Mon, 8 Mar 2021 21:27:49 +0200 Subject: [PATCH 28/85] http: add http.ClientRequest.getRawHeaderNames() Fixes: https://github.com/nodejs/node/issues/37641 PR-URL: https://github.com/nodejs/node/pull/37660 Reviewed-By: Matteo Collina Reviewed-By: Benjamin Gruenbaum Reviewed-By: Rich Trott --- doc/api/deprecations.md | 1 + doc/api/http.md | 18 ++++++++++++++++++ lib/_http_outgoing.js | 19 +++++++++++++++++++ test/parallel/test-http-mutable-headers.js | 15 ++++++++++++++- 4 files changed, 52 insertions(+), 1 deletion(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 13f0d9eb40c5a0..0a539db586bb85 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1347,6 +1347,7 @@ The `http` module `OutgoingMessage.prototype._headers` and the public methods (e.g. `OutgoingMessage.prototype.getHeader()`, `OutgoingMessage.prototype.getHeaders()`, `OutgoingMessage.prototype.getHeaderNames()`, +`OutgoingMessage.prototype.getRawHeaderNames()`, `OutgoingMessage.prototype.hasHeader()`, `OutgoingMessage.prototype.removeHeader()`, `OutgoingMessage.prototype.setHeader()`) for working with outgoing headers. diff --git a/doc/api/http.md b/doc/api/http.md index e51ac128b84603..65fb0f47bf8023 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -763,6 +763,24 @@ const cookie = request.getHeader('Cookie'); // 'cookie' is of type string[] ``` +### `request.getRawHeaderNames()` + + +* Returns: {string[]} + +Returns an array containing the unique names of the current outgoing raw +headers. Header names are returned with their exact casing being set. + +```js +request.setHeader('Foo', 'bar'); +request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + +const headerNames = request.getRawHeaderNames(); +// headerNames === ['Foo', 'Set-Cookie'] +``` + ### `request.maxHeadersCount` * {number} **Default:** `2000` diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 37ef44f2f2eee2..b7f0a9d5e67a15 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -22,6 +22,7 @@ 'use strict'; const { + Array, ArrayIsArray, ArrayPrototypeForEach, ArrayPrototypeJoin, @@ -35,6 +36,7 @@ const { ObjectCreate, ObjectDefineProperty, ObjectKeys, + ObjectValues, ObjectPrototypeHasOwnProperty, ObjectSetPrototypeOf, RegExpPrototypeTest, @@ -602,6 +604,23 @@ OutgoingMessage.prototype.getHeaderNames = function getHeaderNames() { }; +// Returns an array of the names of the current outgoing raw headers. +OutgoingMessage.prototype.getRawHeaderNames = function getRawHeaderNames() { + const headersMap = this[kOutHeaders]; + if (headersMap === null) return []; + + const values = ObjectValues(headersMap); + const headers = Array(values.length); + // Retain for(;;) loop for performance reasons + // Refs: https://github.com/nodejs/node/pull/30958 + for (let i = 0, l = values.length; i < l; i++) { + headers[i] = values[i][0]; + } + + return headers; +}; + + // Returns a shallow copy of the current outgoing headers. OutgoingMessage.prototype.getHeaders = function getHeaders() { const headers = this[kOutHeaders]; diff --git a/test/parallel/test-http-mutable-headers.js b/test/parallel/test-http-mutable-headers.js index c9f63acf4433f4..755a4dd66159e8 100644 --- a/test/parallel/test-http-mutable-headers.js +++ b/test/parallel/test-http-mutable-headers.js @@ -108,6 +108,10 @@ const s = http.createServer(common.mustCall((req, res) => { ['x-test-header', 'x-test-header2', 'set-cookie', 'x-test-array-header']); + assert.deepStrictEqual(res.getRawHeaderNames(), + ['x-test-header', 'X-TEST-HEADER2', + 'set-cookie', 'x-test-array-header']); + assert.strictEqual(res.hasHeader('x-test-header2'), true); assert.strictEqual(res.hasHeader('X-TEST-HEADER2'), true); assert.strictEqual(res.hasHeader('X-Test-Header2'), true); @@ -171,7 +175,10 @@ function nextTest() { let bufferedResponse = ''; - http.get({ port: s.address().port }, common.mustCall((response) => { + const req = http.get({ + port: s.address().port, + headers: { 'X-foo': 'bar' } + }, common.mustCall((response) => { switch (test) { case 'headers': assert.strictEqual(response.statusCode, 201); @@ -214,4 +221,10 @@ function nextTest() { common.mustCall(nextTest)(); })); })); + + assert.deepStrictEqual(req.getHeaderNames(), + ['x-foo', 'host']); + + assert.deepStrictEqual(req.getRawHeaderNames(), + ['X-foo', 'Host']); } From 9f61cbd1fdc4d439071ffc60973cf07e2403d8b3 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Tue, 16 Mar 2021 03:44:04 +0800 Subject: [PATCH 29/85] test: account for OOM risks in heapsnapshot-near-heap-limit tests PR-URL: https://github.com/nodejs/node/pull/37761 Fixes: https://github.com/nodejs/node/issues/36961 Reviewed-By: Darshan Sen Reviewed-By: Rich Trott --- ...test-heapsnapshot-near-heap-limit-worker.js | 17 ++++++++++------- .../test-heapsnapshot-near-heap-limit.js | 18 ++++++++++++++---- .../test-heapsnapshot-near-heap-limit-big.js | 11 +++++------ 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/test/parallel/test-heapsnapshot-near-heap-limit-worker.js b/test/parallel/test-heapsnapshot-near-heap-limit-worker.js index edbe2f6c617505..48845bdad00a48 100644 --- a/test/parallel/test-heapsnapshot-near-heap-limit-worker.js +++ b/test/parallel/test-heapsnapshot-near-heap-limit-worker.js @@ -26,11 +26,14 @@ const env = { console.log(child.stdout.toString()); const stderr = child.stderr.toString(); console.log(stderr); - // There should be one snapshot taken and then after the - // snapshot heap limit callback is popped, the OOM callback - // becomes effective. - assert(stderr.includes('ERR_WORKER_OUT_OF_MEMORY')); - const list = fs.readdirSync(tmpdir.path) - .filter((file) => file.endsWith('.heapsnapshot')); - assert.strictEqual(list.length, 1); + const risky = /Not generating snapshots because it's too risky/.test(stderr); + if (!risky) { + // There should be one snapshot taken and then after the + // snapshot heap limit callback is popped, the OOM callback + // becomes effective. + assert(stderr.includes('ERR_WORKER_OUT_OF_MEMORY')); + const list = fs.readdirSync(tmpdir.path) + .filter((file) => file.endsWith('.heapsnapshot')); + assert.strictEqual(list.length, 1); + } } diff --git a/test/parallel/test-heapsnapshot-near-heap-limit.js b/test/parallel/test-heapsnapshot-near-heap-limit.js index 42b66871d429c2..92e06cb25e44e4 100644 --- a/test/parallel/test-heapsnapshot-near-heap-limit.js +++ b/test/parallel/test-heapsnapshot-near-heap-limit.js @@ -58,12 +58,17 @@ const env = { env, }); console.log(child.stdout.toString()); - console.log(child.stderr.toString()); + const stderr = child.stderr.toString(); + console.log(stderr); assert(common.nodeProcessAborted(child.status, child.signal), 'process should have aborted, but did not'); const list = fs.readdirSync(tmpdir.path) .filter((file) => file.endsWith('.heapsnapshot')); - assert.strictEqual(list.length, 1); + const risky = [...stderr.matchAll( + /Not generating snapshots because it's too risky/g)].length; + assert(list.length + risky > 0 && list.length <= 3, + `Generated ${list.length} snapshots ` + + `and ${risky} was too risky`); } { @@ -79,10 +84,15 @@ const env = { env, }); console.log(child.stdout.toString()); - console.log(child.stderr.toString()); + const stderr = child.stderr.toString(); + console.log(stderr); assert(common.nodeProcessAborted(child.status, child.signal), 'process should have aborted, but did not'); const list = fs.readdirSync(tmpdir.path) .filter((file) => file.endsWith('.heapsnapshot')); - assert(list.length > 0 && list.length <= 3); + const risky = [...stderr.matchAll( + /Not generating snapshots because it's too risky/g)].length; + assert(list.length + risky > 0 && list.length <= 3, + `Generated ${list.length} snapshots ` + + `and ${risky} was too risky`); } diff --git a/test/pummel/test-heapsnapshot-near-heap-limit-big.js b/test/pummel/test-heapsnapshot-near-heap-limit-big.js index f70d562c1d1ee4..3442ae068be06f 100644 --- a/test/pummel/test-heapsnapshot-near-heap-limit-big.js +++ b/test/pummel/test-heapsnapshot-near-heap-limit-big.js @@ -34,10 +34,9 @@ if (!common.enoughTestMem) 'process should have aborted, but did not'); const list = fs.readdirSync(tmpdir.path) .filter((file) => file.endsWith('.heapsnapshot')); - if (list.length === 0) { - assert(stderr.includes( - 'Not generating snapshots because it\'s too risky')); - } else { - assert(list.length > 0 && list.length <= 3); - } + const risky = [...stderr.matchAll( + /Not generating snapshots because it's too risky/g)].length; + assert(list.length + risky > 0 && list.length <= 3, + `Generated ${list.length} snapshots ` + + `and ${risky} was too risky`); } From e9c161ce129fa75e618fb74cfa3493591728d80d Mon Sep 17 00:00:00 2001 From: Nitzan Uziely Date: Fri, 12 Mar 2021 20:24:00 +0200 Subject: [PATCH 30/85] http: fix double AbortSignal registration Fix an issue where AbortSignals are registered twice PR-URL: https://github.com/nodejs/node/pull/37730 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Rich Trott --- lib/_http_client.js | 17 +++-- .../test-http-agent-abort-controller.js | 73 +++++++++++++++++++ .../test-http-client-abort-destroy.js | 52 ++++++++++++- test/parallel/test-http2-client-destroy.js | 15 ++-- test/parallel/test-https-abortcontroller.js | 3 +- 5 files changed, 143 insertions(+), 17 deletions(-) create mode 100644 test/parallel/test-http-agent-abort-controller.js diff --git a/lib/_http_client.js b/lib/_http_client.js index 70c8a26f3fc17f..57a36183405170 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -304,14 +304,20 @@ function ClientRequest(input, options, cb) { options.headers); } + let optsWithoutSignal = options; + if (optsWithoutSignal.signal) { + optsWithoutSignal = ObjectAssign({}, options); + delete optsWithoutSignal.signal; + } + // initiate connection if (this.agent) { - this.agent.addRequest(this, options); + this.agent.addRequest(this, optsWithoutSignal); } else { // No agent, default to Connection:close. this._last = true; this.shouldKeepAlive = false; - if (typeof options.createConnection === 'function') { + if (typeof optsWithoutSignal.createConnection === 'function') { const oncreate = once((err, socket) => { if (err) { process.nextTick(() => this.emit('error', err)); @@ -321,7 +327,8 @@ function ClientRequest(input, options, cb) { }); try { - const newSocket = options.createConnection(options, oncreate); + const newSocket = optsWithoutSignal.createConnection(optsWithoutSignal, + oncreate); if (newSocket) { oncreate(null, newSocket); } @@ -329,8 +336,8 @@ function ClientRequest(input, options, cb) { oncreate(err); } } else { - debug('CLIENT use net.createConnection', options); - this.onSocket(net.createConnection(options)); + debug('CLIENT use net.createConnection', optsWithoutSignal); + this.onSocket(net.createConnection(optsWithoutSignal)); } } } diff --git a/test/parallel/test-http-agent-abort-controller.js b/test/parallel/test-http-agent-abort-controller.js new file mode 100644 index 00000000000000..c5ece3ab353bf0 --- /dev/null +++ b/test/parallel/test-http-agent-abort-controller.js @@ -0,0 +1,73 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); +const Agent = http.Agent; +const { getEventListeners, once } = require('events'); +const agent = new Agent(); +const server = http.createServer(); + +server.listen(0, common.mustCall(async () => { + const port = server.address().port; + const host = 'localhost'; + const options = { + port: port, + host: host, + _agentKey: agent.getName({ port, host }) + }; + + async function postCreateConnection() { + const ac = new AbortController(); + const { signal } = ac; + const connection = agent.createConnection({ ...options, signal }); + assert.strictEqual(getEventListeners(signal, 'abort').length, 1); + ac.abort(); + const [err] = await once(connection, 'error'); + assert.strictEqual(err?.name, 'AbortError'); + } + + async function preCreateConnection() { + const ac = new AbortController(); + const { signal } = ac; + ac.abort(); + const connection = agent.createConnection({ ...options, signal }); + const [err] = await once(connection, 'error'); + assert.strictEqual(err?.name, 'AbortError'); + } + + async function agentAsParam() { + const ac = new AbortController(); + const { signal } = ac; + const request = http.get({ + port: server.address().port, + path: '/hello', + agent: agent, + signal, + }); + assert.strictEqual(getEventListeners(signal, 'abort').length, 1); + ac.abort(); + const [err] = await once(request, 'error'); + assert.strictEqual(err?.name, 'AbortError'); + } + + async function agentAsParamPreAbort() { + const ac = new AbortController(); + const { signal } = ac; + ac.abort(); + const request = http.get({ + port: server.address().port, + path: '/hello', + agent: agent, + signal, + }); + assert.strictEqual(getEventListeners(signal, 'abort').length, 0); + const [err] = await once(request, 'error'); + assert.strictEqual(err?.name, 'AbortError'); + } + + await postCreateConnection(); + await preCreateConnection(); + await agentAsParam(); + await agentAsParamPreAbort(); + server.close(); +})); diff --git a/test/parallel/test-http-client-abort-destroy.js b/test/parallel/test-http-client-abort-destroy.js index 7af63a1ef408c0..11b1390a839b68 100644 --- a/test/parallel/test-http-client-abort-destroy.js +++ b/test/parallel/test-http-client-abort-destroy.js @@ -2,6 +2,7 @@ const common = require('../common'); const http = require('http'); const assert = require('assert'); +const { getEventListeners } = require('events'); { // abort @@ -71,19 +72,20 @@ const assert = require('assert'); { - // Destroy with AbortSignal + // Destroy post-abort sync with AbortSignal const server = http.createServer(common.mustNotCall()); const controller = new AbortController(); - + const { signal } = controller; server.listen(0, common.mustCall(() => { - const options = { port: server.address().port, signal: controller.signal }; + const options = { port: server.address().port, signal }; const req = http.get(options, common.mustNotCall()); req.on('error', common.mustCall((err) => { assert.strictEqual(err.code, 'ABORT_ERR'); assert.strictEqual(err.name, 'AbortError'); server.close(); })); + assert.strictEqual(getEventListeners(signal, 'abort').length, 1); assert.strictEqual(req.aborted, false); assert.strictEqual(req.destroyed, false); controller.abort(); @@ -91,3 +93,47 @@ const assert = require('assert'); assert.strictEqual(req.destroyed, true); })); } + +{ + // Use post-abort async AbortSignal + const server = http.createServer(common.mustNotCall()); + const controller = new AbortController(); + const { signal } = controller; + server.listen(0, common.mustCall(() => { + const options = { port: server.address().port, signal }; + const req = http.get(options, common.mustNotCall()); + req.on('error', common.mustCall((err) => { + assert.strictEqual(err.code, 'ABORT_ERR'); + assert.strictEqual(err.name, 'AbortError'); + })); + + req.on('close', common.mustCall(() => { + assert.strictEqual(req.aborted, false); + assert.strictEqual(req.destroyed, true); + server.close(); + })); + + assert.strictEqual(getEventListeners(signal, 'abort').length, 1); + process.nextTick(() => controller.abort()); + })); +} + +{ + // Use pre-aborted AbortSignal + const server = http.createServer(common.mustNotCall()); + const controller = new AbortController(); + const { signal } = controller; + server.listen(0, common.mustCall(() => { + controller.abort(); + const options = { port: server.address().port, signal }; + const req = http.get(options, common.mustNotCall()); + assert.strictEqual(getEventListeners(signal, 'abort').length, 0); + req.on('error', common.mustCall((err) => { + assert.strictEqual(err.code, 'ABORT_ERR'); + assert.strictEqual(err.name, 'AbortError'); + server.close(); + })); + assert.strictEqual(req.aborted, false); + assert.strictEqual(req.destroyed, true); + })); +} diff --git a/test/parallel/test-http2-client-destroy.js b/test/parallel/test-http2-client-destroy.js index f257cf6f0006fa..52b0744cd2190d 100644 --- a/test/parallel/test-http2-client-destroy.js +++ b/test/parallel/test-http2-client-destroy.js @@ -8,9 +8,8 @@ if (!common.hasCrypto) const assert = require('assert'); const h2 = require('http2'); const { kSocket } = require('internal/http2/util'); -const { kEvents } = require('internal/event_target'); const Countdown = require('../common/countdown'); - +const { getEventListeners } = require('events'); { const server = h2.createServer(); server.listen(0, common.mustCall(() => { @@ -180,11 +179,11 @@ const Countdown = require('../common/countdown'); client.on('close', common.mustCall()); const { signal } = controller; - assert.strictEqual(signal[kEvents].get('abort'), undefined); + assert.strictEqual(getEventListeners(signal, 'abort').length, 0); client.on('error', common.mustCall(() => { // After underlying stream dies, signal listener detached - assert.strictEqual(signal[kEvents].get('abort'), undefined); + assert.strictEqual(getEventListeners(signal, 'abort').length, 0); })); const req = client.request({}, { signal }); @@ -198,7 +197,7 @@ const Countdown = require('../common/countdown'); assert.strictEqual(req.aborted, false); assert.strictEqual(req.destroyed, false); // Signal listener attached - assert.strictEqual(signal[kEvents].get('abort').size, 1); + assert.strictEqual(getEventListeners(signal, 'abort').length, 1); controller.abort(); @@ -219,16 +218,16 @@ const Countdown = require('../common/countdown'); const { signal } = controller; controller.abort(); - assert.strictEqual(signal[kEvents].get('abort'), undefined); + assert.strictEqual(getEventListeners(signal, 'abort').length, 0); client.on('error', common.mustCall(() => { // After underlying stream dies, signal listener detached - assert.strictEqual(signal[kEvents].get('abort'), undefined); + assert.strictEqual(getEventListeners(signal, 'abort').length, 0); })); const req = client.request({}, { signal }); // Signal already aborted, so no event listener attached. - assert.strictEqual(signal[kEvents].get('abort'), undefined); + assert.strictEqual(getEventListeners(signal, 'abort').length, 0); assert.strictEqual(req.aborted, false); // Destroyed on same tick as request made diff --git a/test/parallel/test-https-abortcontroller.js b/test/parallel/test-https-abortcontroller.js index 80821285acf95e..19aa9a6fca2bdf 100644 --- a/test/parallel/test-https-abortcontroller.js +++ b/test/parallel/test-https-abortcontroller.js @@ -7,7 +7,7 @@ if (!common.hasCrypto) const fixtures = require('../common/fixtures'); const https = require('https'); const assert = require('assert'); -const { once } = require('events'); +const { once, getEventListeners } = require('events'); const options = { key: fixtures.readKey('agent1-key.pem'), @@ -29,6 +29,7 @@ const options = { rejectUnauthorized: false, signal: ac.signal, }); + assert.strictEqual(getEventListeners(ac.signal, 'abort').length, 1); process.nextTick(() => ac.abort()); const [ err ] = await once(req, 'error'); assert.strictEqual(err.name, 'AbortError'); From 8f18133de078ac12ba9124e4f05f950fc3666efe Mon Sep 17 00:00:00 2001 From: marsonya Date: Thu, 11 Mar 2021 00:01:44 +0530 Subject: [PATCH 31/85] doc: use sentence case in issues.md headers PR-URL: https://github.com/nodejs/node/pull/37537 Reviewed-By: Luigi Pinca Reviewed-By: Darshan Sen Reviewed-By: James M Snell Reviewed-By: Antoine du Hamel Reviewed-By: Rich Trott --- doc/guides/contributing/issues.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/guides/contributing/issues.md b/doc/guides/contributing/issues.md index fdb30c6f71c43d..10aa28201d9e0b 100644 --- a/doc/guides/contributing/issues.md +++ b/doc/guides/contributing/issues.md @@ -1,11 +1,11 @@ # Issues -* [Asking for General Help](#asking-for-general-help) +* [Asking for general help](#asking-for-general-help) * [Discussing non-technical topics](#discussing-non-technical-topics) -* [Submitting a Bug Report](#submitting-a-bug-report) -* [Triaging a Bug Report](#triaging-a-bug-report) +* [Submitting a bug report](#submitting-a-bug-report) +* [Triaging a bug report](#triaging-a-bug-report) -## Asking for General Help +## Asking for general help Because the level of activity in the `nodejs/node` repository is so high, questions or requests for general help using Node.js should be directed at @@ -16,7 +16,7 @@ the [Node.js help repository][]. Discussion of non-technical topics (such as intellectual property and trademark) should be directed to the [Technical Steering Committee (TSC) repository][]. -## Submitting a Bug Report +## Submitting a bug report When opening a new issue in the `nodejs/node` issue tracker, users will be presented with a choice of issue templates. If you believe that you have @@ -37,7 +37,7 @@ Node.js changed that broke the module. See [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). -## Triaging a Bug Report +## Triaging a bug report Once an issue has been opened, it is common for there to be discussion around it. Some contributors may have differing opinions about the issue, From 11d45855cdeb71abe625f9053dbbb86e817309b2 Mon Sep 17 00:00:00 2001 From: Jiawen Geng Date: Thu, 18 Mar 2021 06:47:03 +0000 Subject: [PATCH 32/85] crypto: fix header name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/37792 Reviewed-By: Tobias Nießen Reviewed-By: Richard Lau Reviewed-By: Darshan Sen Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Rich Trott --- node.gyp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node.gyp b/node.gyp index 6691de8422e940..2d76366e330075 100644 --- a/node.gyp +++ b/node.gyp @@ -963,7 +963,7 @@ 'src/crypto/crypto_tls.h', 'src/crypto/crypto_clienthello.h', 'src/crypto/crypto_context.h', - 'src/crypto/crypto_ecdh.h', + 'src/crypto/crypto_ec.h', 'src/crypto/crypto_hkdf.h', 'src/crypto/crypto_pbkdf2.h', 'src/crypto/crypto_sig.h', From 71fde0727465f8a7728f6377049467e1fc5029d8 Mon Sep 17 00:00:00 2001 From: Qingyu Deng Date: Wed, 17 Mar 2021 20:25:07 +0800 Subject: [PATCH 33/85] doc: add Ayase-252 to triagers I believe that the best way to master a tech is practicing as much as possible. I think becoming a triager can provide many different perspective to approach Node. PR-URL: https://github.com/nodejs/node/pull/37781 Reviewed-By: Rich Trott Reviewed-By: Gireesh Punathil Reviewed-By: Beth Griggs Reviewed-By: Yongsheng Zhang Reviewed-By: Darshan Sen Reviewed-By: Pooja D P --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bc7383fcbf444c..ccc71e9014320d 100644 --- a/README.md +++ b/README.md @@ -593,6 +593,8 @@ maintaining the Node.js project. ### Triagers +* [Ayase-252](https://github.com/Ayase-252) - +**Qingyu Deng** <i@ayase-lab.com> * [marsonya](https://github.com/marsonya) - **Akhil Marsonya** <akhil.marsonya27@gmail.com> (he/him) * [PoojaDurgad](https://github.com/PoojaDurgad) - From f07428ae51116c4feac06a7416e424091a562158 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 18 Mar 2021 22:22:19 -0700 Subject: [PATCH 34/85] test: remove skip for fixed test-benchmark-fs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/37803 Reviewed-By: Michaël Zasso Reviewed-By: Antoine du Hamel Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- test/benchmark/benchmark.status | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/benchmark/benchmark.status b/test/benchmark/benchmark.status index e65d001234038a..6a966743aab26b 100644 --- a/test/benchmark/benchmark.status +++ b/test/benchmark/benchmark.status @@ -19,5 +19,3 @@ prefix benchmark [$system==aix] [$arch==arm] -# https://github.com/nodejs/node/issues/34266 -test-benchmark-fs: SKIP From 43c3b43ea3f0e535bdca0680ae246900aa5349da Mon Sep 17 00:00:00 2001 From: wwwzbwcom Date: Fri, 5 Mar 2021 19:55:00 +0800 Subject: [PATCH 35/85] stream: make Readable.from performance better PR-URL: https://github.com/nodejs/node/pull/37609 Reviewed-By: Robert Nagy Reviewed-By: Benjamin Gruenbaum Reviewed-By: Matteo Collina --- benchmark/streams/readable-from.js | 26 +++++++++++++++ lib/internal/streams/from.js | 51 +++++++++++++++++++----------- 2 files changed, 58 insertions(+), 19 deletions(-) create mode 100644 benchmark/streams/readable-from.js diff --git a/benchmark/streams/readable-from.js b/benchmark/streams/readable-from.js new file mode 100644 index 00000000000000..2dcf10ffef2732 --- /dev/null +++ b/benchmark/streams/readable-from.js @@ -0,0 +1,26 @@ +'use strict'; + +const common = require('../common'); +const Readable = require('stream').Readable; + +const bench = common.createBenchmark(main, { + n: [1e7], +}); + +async function main({ n }) { + const arr = []; + for (let i = 0; i < n; i++) { + arr.push(`${i}`); + } + + const s = new Readable.from(arr); + + bench.start(); + s.on('data', (data) => { + // eslint-disable-next-line no-unused-expressions + data; + }); + s.on('close', () => { + bench.end(n); + }); +} diff --git a/lib/internal/streams/from.js b/lib/internal/streams/from.js index 6798411fa4b038..906ddcf9af844b 100644 --- a/lib/internal/streams/from.js +++ b/lib/internal/streams/from.js @@ -3,7 +3,7 @@ const { PromisePrototypeThen, SymbolAsyncIterator, - SymbolIterator + SymbolIterator, } = primordials; const { Buffer } = require('buffer'); @@ -25,18 +25,22 @@ function from(Readable, iterable, opts) { }); } - if (iterable && iterable[SymbolAsyncIterator]) + let isAsync = false; + if (iterable && iterable[SymbolAsyncIterator]) { + isAsync = true; iterator = iterable[SymbolAsyncIterator](); - else if (iterable && iterable[SymbolIterator]) + } else if (iterable && iterable[SymbolIterator]) { + isAsync = false; iterator = iterable[SymbolIterator](); - else + } else { throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); + } const readable = new Readable({ objectMode: true, highWaterMark: 1, // TODO(ronag): What options should be allowed? - ...opts + ...opts, }); // Flag to protect against _read @@ -75,23 +79,32 @@ function from(Readable, iterable, opts) { } async function next() { - try { - const { value, done } = await iterator.next(); - if (done) { - readable.push(null); - } else { - const res = await value; - if (res === null) { - reading = false; - throw new ERR_STREAM_NULL_VALUES(); - } else if (readable.push(res)) { - next(); + for (;;) { + try { + const { value, done } = isAsync ? + await iterator.next() : + iterator.next(); + + if (done) { + readable.push(null); } else { - reading = false; + const res = (value && + typeof value.then === 'function') ? + await value : + value; + if (res === null) { + reading = false; + throw new ERR_STREAM_NULL_VALUES(); + } else if (readable.push(res)) { + continue; + } else { + reading = false; + } } + } catch (err) { + readable.destroy(err); } - } catch (err) { - readable.destroy(err); + break; } } return readable; From 9bc6fe7eb378fbacecb33efd2ad549f04f7b447e Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Fri, 19 Mar 2021 22:37:29 -0400 Subject: [PATCH 36/85] test: remove references to unsupported AIX versions The `filehandle.utimes()` and `fs.futimes()` APIs work on all versions of AIX that are supported by this version of Node.js. PR-URL: https://github.com/nodejs/node/pull/37826 Reviewed-By: Gireesh Punathil Reviewed-By: Rich Trott Reviewed-By: Stewart X Addison Reviewed-By: Colin Ihrig Reviewed-By: Ash Cripps --- doc/api/fs.md | 6 ------ test/parallel/test-trace-events-fs-sync.js | 7 ------- 2 files changed, 13 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index d87f73a15f593f..e01a33940f19bc 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -420,9 +420,6 @@ added: v10.0.0 Change the file system timestamps of the object referenced by the {FileHandle} then resolves the promise with no arguments upon success. -This function does not work on AIX versions before 7.1, it will reject the -promise with an error using code `UV_ENOSYS`. - #### `filehandle.write(buffer[, offset[, length[, position]]])` > Stability: 3 - Legacy. The feature is no longer recommended for use. While it -likely will not be removed, and is still covered by semantic-versioning -guarantees, use of the feature should be avoided. +> likely will not be removed, and is still covered by semantic-versioning +> guarantees, use of the feature should be avoided. Use caution when making use of Experimental features, particularly within modules. Users may not be aware that experimental features are being used. From cdfc1c86923332a6993e0d01455f19228646f987 Mon Sep 17 00:00:00 2001 From: Nitzan Uziely Date: Sat, 20 Mar 2021 01:02:18 +0200 Subject: [PATCH 39/85] child_process: cleanup AbortSignal duplication cleanup AbortSignal child_process code duplication PR-URL: https://github.com/nodejs/node/pull/37823 Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell --- lib/child_process.js | 65 +++++++++++--------------------------------- 1 file changed, 16 insertions(+), 49 deletions(-) diff --git a/lib/child_process.js b/lib/child_process.js index 18996f8a5643ce..da2f9628ce0808 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -605,23 +605,6 @@ function spawn(file, args, options) { const killSignal = sanitizeKillSignal(options.killSignal); const child = new ChildProcess(); - if (options.signal) { - const signal = options.signal; - if (signal.aborted) { - onAbortListener(); - } else { - signal.addEventListener('abort', onAbortListener, { once: true }); - child.once('exit', - () => signal.removeEventListener('abort', onAbortListener)); - } - - function onAbortListener() { - process.nextTick(() => { - abortChildProcess(child, killSignal); - }); - } - } - debug('spawn', options); child.spawn(options); @@ -645,6 +628,21 @@ function spawn(file, args, options) { }); } + if (options.signal) { + const signal = options.signal; + if (signal.aborted) { + process.nextTick(onAbortListener); + } else { + signal.addEventListener('abort', onAbortListener, { once: true }); + child.once('exit', + () => signal.removeEventListener('abort', onAbortListener)); + } + + function onAbortListener() { + abortChildProcess(child, killSignal); + } + } + return child; } @@ -778,37 +776,6 @@ function sanitizeKillSignal(killSignal) { } } -// This level of indirection is here because the other child_process methods -// call spawn internally but should use different cancellation logic. -function spawnWithSignal(file, args, options) { - // Remove signal from options to spawn - // to avoid double emitting of AbortError - const opts = options && typeof options === 'object' && ('signal' in options) ? - { ...options, signal: undefined } : - options; - - if (options?.signal) { - // Validate signal, if present - validateAbortSignal(options.signal, 'options.signal'); - } - const child = spawn(file, args, opts); - - if (options?.signal) { - const killSignal = sanitizeKillSignal(options.killSignal); - - function kill() { - abortChildProcess(child, killSignal); - } - if (options.signal.aborted) { - process.nextTick(kill); - } else { - options.signal.addEventListener('abort', kill, { once: true }); - const remove = () => options.signal.removeEventListener('abort', kill); - child.once('exit', remove); - } - } - return child; -} module.exports = { _forkChild, ChildProcess, @@ -817,6 +784,6 @@ module.exports = { execFileSync, execSync, fork, - spawn: spawnWithSignal, + spawn, spawnSync }; From 44490af948a0b1c3e76d575bd487a16d0cc9af92 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Fri, 19 Mar 2021 21:43:00 -0400 Subject: [PATCH 40/85] test: relax Y2K38 check in test-fs-utimes-y2K38 On some platforms `date` may not support the `-r` option. Optimistically allow the test to proceed in that case as the previous `touch` had succeeded -- we were just not able to easily validate the file date. PR-URL: https://github.com/nodejs/node/pull/37825 Refs: https://github.com/nodejs/node/pull/37707 Reviewed-By: Rich Trott Reviewed-By: James M Snell --- test/parallel/test-fs-utimes-y2K38.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/test/parallel/test-fs-utimes-y2K38.js b/test/parallel/test-fs-utimes-y2K38.js index 06c5060c65d2fc..9e42e90feb1fd6 100644 --- a/test/parallel/test-fs-utimes-y2K38.js +++ b/test/parallel/test-fs-utimes-y2K38.js @@ -1,20 +1,15 @@ 'use strict'; const common = require('../common'); -if (common.isIBMi) { - common.skip('fs.utimesSync() currently fails on IBM i with Y2K38 values'); -} - const tmpdir = require('../common/tmpdir'); tmpdir.refresh(); const assert = require('assert'); const fs = require('fs'); -// Check for Y2K38 support. For Windows and AIX, assume it's there. Windows +// Check for Y2K38 support. For Windows, assume it's there. Windows // doesn't have `touch` and `date -r` which are used in the check for support. -// AIX lacks `date -r`. -if (!common.isWindows && !common.isAIX) { +if (!common.isWindows) { const testFilePath = `${tmpdir.path}/y2k38-test`; const testFileDate = '204001020304'; const { spawnSync } = require('child_process'); @@ -25,13 +20,21 @@ if (!common.isWindows && !common.isAIX) { common.skip('File system appears to lack Y2K38 support (touch failed)'); } + // On some file systems that lack Y2K38 support, `touch` will succeed but + // the time will be incorrect. const dateResult = spawnSync('date', ['-r', testFilePath, '+%Y%m%d%H%M'], { encoding: 'utf8' }); - - assert.strictEqual(dateResult.status, 0); - if (dateResult.stdout.trim() !== testFileDate) { - common.skip('File system appears to lack Y2k38 support (date failed)'); + if (dateResult.status === 0) { + if (dateResult.stdout.trim() !== testFileDate) { + common.skip('File system appears to lack Y2k38 support (date failed)'); + } + } else { + // On some platforms `date` may not support the `-r` option. Usually + // this will result in a non-zero status and usage information printed. + // In this case optimistically proceed -- the earlier `touch` succeeded + // but validation that the file has the correct time is not easily possible. + assert.match(dateResult.stderr, /[Uu]sage:/); } } From 0f2e1429464c6640e55181b36deea7a1166bed9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sat, 20 Mar 2021 12:43:08 +0100 Subject: [PATCH 41/85] tools: make genv8constants.py Python3-compatible PR-URL: https://github.com/nodejs/node/pull/37835 Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: Antoine du Hamel Reviewed-By: James M Snell --- tools/genv8constants.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/genv8constants.py b/tools/genv8constants.py index f750ca4de7523f..01aa37cc715de0 100755 --- a/tools/genv8constants.py +++ b/tools/genv8constants.py @@ -73,6 +73,7 @@ def out_define(): out_reset() for line in pipe: + line = line.decode('utf-8') if curr_sym != None: # # This bit of code has nasty knowledge of the objdump text output From 9557dda2eb44482f693974032ba41f77fba548e9 Mon Sep 17 00:00:00 2001 From: Nitzan Uziely Date: Sat, 13 Mar 2021 16:44:48 +0200 Subject: [PATCH 42/85] stream: pipeline accept Buffer as a valid first argument change isStream to also check existence of on, so it wont mistake buffers as Streams. fixes: https://github.com/nodejs/node/issues/37731 PR-URL: https://github.com/nodejs/node/pull/37739 Fixes: https://github.com/nodejs/node/issues/37731 Reviewed-By: Luigi Pinca Reviewed-By: Matteo Collina Reviewed-By: Robert Nagy Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell --- lib/internal/streams/utils.js | 6 ++++-- test/parallel/test-stream-pipeline.js | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/internal/streams/utils.js b/lib/internal/streams/utils.js index 08c196802780b8..b6e744250799c6 100644 --- a/lib/internal/streams/utils.js +++ b/lib/internal/streams/utils.js @@ -6,11 +6,13 @@ const { } = primordials; function isReadable(obj) { - return !!(obj && typeof obj.pipe === 'function'); + return !!(obj && typeof obj.pipe === 'function' && + typeof obj.on === 'function'); } function isWritable(obj) { - return !!(obj && typeof obj.write === 'function'); + return !!(obj && typeof obj.write === 'function' && + typeof obj.on === 'function'); } function isStream(obj) { diff --git a/test/parallel/test-stream-pipeline.js b/test/parallel/test-stream-pipeline.js index 7940d3a90d1828..ed5a3d9a0b54f4 100644 --- a/test/parallel/test-stream-pipeline.js +++ b/test/parallel/test-stream-pipeline.js @@ -1371,3 +1371,19 @@ const net = require('net'); assert.strictEqual(res, '123'); })); } + +{ + const content = 'abc'; + pipeline(Buffer.from(content), PassThrough({ objectMode: true }), + common.mustSucceed(() => {})); + + let res = ''; + pipeline(Buffer.from(content), async function*(previous) { + for await (const val of previous) { + res += String.fromCharCode(val); + yield val; + } + }, common.mustSucceed(() => { + assert.strictEqual(res, content); + })); +} From c0a424f3e971287b4484dd24e4606a7a8ad74a75 Mon Sep 17 00:00:00 2001 From: Matthew Francis Brunetti Date: Sat, 20 Mar 2021 05:14:04 -0400 Subject: [PATCH 43/85] doc: clarify when child process 'spawn' event is *not* emitted Making this clarification in response to a comment on GitHub: https://github.com/nodejs/node/issues/35288#issuecomment-802811813 PR-URL: https://github.com/nodejs/node/pull/37833 Reviewed-By: Colin Ihrig Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell --- doc/api/child_process.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 77467cc6573064..aace7566e49764 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -1162,6 +1162,8 @@ added: v15.1.0 --> The `'spawn'` event is emitted once the child process has spawned successfully. +If the child process does not spawn successfully, the `'spawn'` event is not +emitted and the `'error'` event is emitted instead. If emitted, the `'spawn'` event comes before all other events and before any data is received via `stdout` or `stderr`. From 5d4c6107277e399abc593295a7f9315d4544ce4e Mon Sep 17 00:00:00 2001 From: himself65 Date: Mon, 22 Mar 2021 01:29:43 +0800 Subject: [PATCH 44/85] test: remove duplicated test for eventtarget PR-URL: https://github.com/nodejs/node/pull/37853 Reviewed-By: Antoine du Hamel Reviewed-By: Colin Ihrig Reviewed-By: Darshan Sen Reviewed-By: Benjamin Gruenbaum Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- test/parallel/test-eventtarget.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/test/parallel/test-eventtarget.js b/test/parallel/test-eventtarget.js index 63c166fc1be421..4eeea407b196af 100644 --- a/test/parallel/test-eventtarget.js +++ b/test/parallel/test-eventtarget.js @@ -254,13 +254,6 @@ let asyncTest = Promise.resolve(); {}, // No handleEvent function false ].forEach((i) => throws(() => target.addEventListener('foo', i), err(i))); - - [ - 'foo', - 1, - {}, // No handleEvent function - false - ].forEach((i) => throws(() => target.addEventListener('foo', i), err(i))); } { From 30bc2e43e47499a93447e73c6befd9d0521f3cc2 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Fri, 19 Mar 2021 14:43:18 -0700 Subject: [PATCH 45/85] doc: add examples for WHATWG URL objects Signed-off-by: James M Snell PR-URL: https://github.com/nodejs/node/pull/37822 Reviewed-By: Anna Henningsen Reviewed-By: Myles Borins Reviewed-By: Darshan Sen --- doc/api/url.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/doc/api/url.md b/doc/api/url.md index f93cf741473794..8ad7c5eed5019a 100644 --- a/doc/api/url.md +++ b/doc/api/url.md @@ -67,6 +67,31 @@ const myURL = url.parse('https://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash'); ``` +### Constructing a URL from component parts and getting the constructed string + +It is possible to construct a WHATWG URL from component parts using either the +property setters or a template literal string: + +```js +const myURL = new URL('https://example.org'); +myURL.pathname = '/a/b/c'; +myURL.search = '?d=e'; +myURL.hash = '#fgh'; +``` + +```js +const pathname = '/a/b/c'; +const search = '?d=e'; +const hash = '#fgh'; +const myURL = new URL(`https://example.org${pathname}${search}${hash}`); +``` + +To get the constructed URL string, use the `href` property accessor: + +```js +console.log(myURL.href); +``` + ## The WHATWG URL API ### Class: `URL` From d9ab1d56cef1438126036f55a7ff1d2e0138cce7 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 20 Mar 2021 09:47:24 -0700 Subject: [PATCH 46/85] test: fix flaky test-vm-timeout-escape-promise-module-2 Test is reliable in sequential and not in parallel, so move it there. Fixes: https://github.com/nodejs/node/issues/36627 PR-URL: https://github.com/nodejs/node/pull/37842 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Antoine du Hamel Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- .../test-vm-timeout-escape-promise-module-2.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/{parallel => sequential}/test-vm-timeout-escape-promise-module-2.js (100%) diff --git a/test/parallel/test-vm-timeout-escape-promise-module-2.js b/test/sequential/test-vm-timeout-escape-promise-module-2.js similarity index 100% rename from test/parallel/test-vm-timeout-escape-promise-module-2.js rename to test/sequential/test-vm-timeout-escape-promise-module-2.js From aa529b73b78dcb001b2b19b54514c82ddea6230b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Fri, 19 Mar 2021 22:35:44 +0100 Subject: [PATCH 47/85] test: fix ibmi skip message PR-URL: https://github.com/nodejs/node/pull/37821 Reviewed-By: Richard Lau Reviewed-By: Antoine du Hamel Reviewed-By: Anna Henningsen Reviewed-By: Beth Griggs Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott Reviewed-By: James M Snell --- test/async-hooks/test-fseventwrap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/async-hooks/test-fseventwrap.js b/test/async-hooks/test-fseventwrap.js index 60928562872549..12a439f8033cbc 100644 --- a/test/async-hooks/test-fseventwrap.js +++ b/test/async-hooks/test-fseventwrap.js @@ -11,7 +11,7 @@ if (!common.isMainThread) common.skip('Worker bootstrapping works differently -> different async IDs'); if (common.isIBMi) - common.skip('IBMi does not suppport fs.watch()'); + common.skip('IBMi does not support fs.watch()'); const hooks = initHooks(); From 3452618905eef45975ce457695c8f32be38ea4a1 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 19 Mar 2021 10:48:02 +0100 Subject: [PATCH 48/85] tty: validate file descriptor to avoid int32 overflow Fixes: https://github.com/nodejs/node/issues/37805 PR-URL: https://github.com/nodejs/node/pull/37809 Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater Reviewed-By: Luigi Pinca Reviewed-By: Darshan Sen --- lib/tty.js | 3 ++- test/pseudo-tty/test-tty-isatty.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/tty.js b/lib/tty.js index 106f8cc423ddf6..e61a5c3ac3f905 100644 --- a/lib/tty.js +++ b/lib/tty.js @@ -40,7 +40,8 @@ const { let readline; function isatty(fd) { - return NumberIsInteger(fd) && fd >= 0 && isTTY(fd); + return NumberIsInteger(fd) && fd >= 0 && fd <= 2147483647 && + isTTY(fd); } function ReadStream(fd, options) { diff --git a/test/pseudo-tty/test-tty-isatty.js b/test/pseudo-tty/test-tty-isatty.js index 3a7b2940311221..ad81a4c6eff92b 100644 --- a/test/pseudo-tty/test-tty-isatty.js +++ b/test/pseudo-tty/test-tty-isatty.js @@ -10,6 +10,7 @@ strictEqual(isatty(2), true, 'stderr reported to not be a tty, but it is'); strictEqual(isatty(-1), false, '-1 reported to be a tty, but it is not'); strictEqual(isatty(55555), false, '55555 reported to be a tty, but it is not'); +strictEqual(isatty(2 ** 31), false, '2^31 reported to be a tty, but it is not'); strictEqual(isatty(1.1), false, '1.1 reported to be a tty, but it is not'); strictEqual(isatty('1'), false, '\'1\' reported to be a tty, but it is not'); strictEqual(isatty({}), false, '{} reported to be a tty, but it is not'); From 79259389a198185ec8ef4d74fa38eb3adc99477c Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 19 Mar 2021 12:06:50 +0100 Subject: [PATCH 49/85] crypto: fix DiffieHellman argument validation Fixes: https://github.com/nodejs/node/issues/37808 PR-URL: https://github.com/nodejs/node/pull/37810 Reviewed-By: James M Snell Reviewed-By: Filip Skokan Reviewed-By: Darshan Sen Reviewed-By: Benjamin Gruenbaum --- lib/internal/crypto/diffiehellman.js | 14 +++++++++++--- test/parallel/test-crypto-dh.js | 6 ++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/internal/crypto/diffiehellman.js b/lib/internal/crypto/diffiehellman.js index 1132b090d36d16..e2106b211ba01b 100644 --- a/lib/internal/crypto/diffiehellman.js +++ b/lib/internal/crypto/diffiehellman.js @@ -118,12 +118,20 @@ function DiffieHellman(sizeOrKey, keyEncoding, generator, genEncoding) { if (typeof sizeOrKey !== 'number') sizeOrKey = toBuf(sizeOrKey, keyEncoding); - if (!generator) + if (!generator) { generator = DH_GENERATOR; - else if (typeof generator === 'number') + } else if (typeof generator === 'number') { validateInt32(generator, 'generator'); - else + } else if (generator !== true) { generator = toBuf(generator, genEncoding); + } else { + throw new ERR_INVALID_ARG_TYPE( + 'generator', + ['number', 'string', 'ArrayBuffer', 'Buffer', 'TypedArray', 'DataView'], + generator + ); + } + this[kHandle] = new _DiffieHellman(sizeOrKey, generator); ObjectDefineProperty(this, 'verifyError', { diff --git a/test/parallel/test-crypto-dh.js b/test/parallel/test-crypto-dh.js index d08d07de4f8063..92687b448c4ea1 100644 --- a/test/parallel/test-crypto-dh.js +++ b/test/parallel/test-crypto-dh.js @@ -489,3 +489,9 @@ assert.throws( 'crypto.getDiffieHellman(\'modp1\').setPublicKey(\'\') ' + 'failed to throw the expected error.' ); +assert.throws( + () => crypto.createDiffieHellman('', true), + { + code: 'ERR_INVALID_ARG_TYPE' + } +); From 86bf341a3509920b2ec8433b6b8c93177da744ac Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 22 Mar 2021 11:11:30 +0100 Subject: [PATCH 50/85] test: fix deprecation warning in test-doctool-html PR-URL: https://github.com/nodejs/node/pull/37858 Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Rich Trott --- test/doctool/test-doctool-html.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/doctool/test-doctool-html.js b/test/doctool/test-doctool-html.js index 3129dcc5d75e79..e3d0d4251dcc7d 100644 --- a/test/doctool/test-doctool-html.js +++ b/test/doctool/test-doctool-html.js @@ -44,7 +44,7 @@ function toHTML({ input, filename, nodeVersion, versions }) { .use(html.preprocessText, { nodeVersion }) .use(html.preprocessElements, { filename }) .use(html.buildToc, { filename, apilinks: {} }) - .use(remark2rehype, { allowDangerousHTML: true }) + .use(remark2rehype, { allowDangerousHtml: true }) .use(raw) .use(htmlStringify) .processSync(input); From dbc48044683aefe754d9e51edd8b33b1c0b82abb Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 20 Mar 2021 14:57:31 -0700 Subject: [PATCH 51/85] tools: simplify eslint comma-dangle configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove comma-dangle settings in benchmark/.eslintrc.yaml as they are the same as what is set in .eslintrc.js. PR-URL: https://github.com/nodejs/node/pull/37850 Reviewed-By: Michaël Zasso Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell --- benchmark/.eslintrc.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/benchmark/.eslintrc.yaml b/benchmark/.eslintrc.yaml index 8ce0f9f6e148c1..6871299adece7b 100644 --- a/benchmark/.eslintrc.yaml +++ b/benchmark/.eslintrc.yaml @@ -6,10 +6,4 @@ env: rules: no-var: error - comma-dangle: - - error - - arrays: 'always-multiline' - objects: 'only-multiline' - imports: 'only-multiline' - exports: 'only-multiline' prefer-arrow-callback: error From b5879efef1028e9a04641072198b62e301636fd5 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 20 Mar 2021 11:53:47 -0700 Subject: [PATCH 52/85] tools: improve macos-firewall.sh output The output of tools/macos-firewall.sh can cause people to think it didn't work. Update things slightly to make the output mildly more informative. Refs: https://github.com/nodejs/node/issues/37233#issuecomment-802201046 PR-URL: https://github.com/nodejs/node/pull/37846 Reviewed-By: Antoine du Hamel Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- tools/macos-firewall.sh | 45 ++++++++++++++++------------------------- 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/tools/macos-firewall.sh b/tools/macos-firewall.sh index 5a5ad52c285e71..b6050aaf3450bd 100755 --- a/tools/macos-firewall.sh +++ b/tools/macos-firewall.sh @@ -21,36 +21,25 @@ CCTEST_DEBUG="$OUTDIR/Debug/cctest" OPENSSL_CLI_RELEASE="$OUTDIR/Release/openssl-cli" OPENSSL_CLI_DEBUG="$OUTDIR/Debug/openssl-cli" +add_and_unblock () { + if [ -e "$1" ] + then + echo Processing "$1" + $SFW --remove "$1" >/dev/null + $SFW --add "$1" + $SFW --unblock "$1" + fi +} + if [ -f $SFW ]; then - # Duplicating these commands on purpose as the symbolic link node might be - # linked to either out/Debug/node or out/Release/node depending on the - # BUILDTYPE. - $SFW --remove "$NODE_DEBUG" - $SFW --remove "$NODE_DEBUG" - $SFW --remove "$NODE_RELEASE" - $SFW --remove "$NODE_RELEASE" - $SFW --remove "$NODE_LINK" - $SFW --remove "$CCTEST_DEBUG" - $SFW --remove "$CCTEST_RELEASE" - $SFW --remove "$OPENSSL_CLI_DEBUG" - $SFW --remove "$OPENSSL_CLI_RELEASE" - - $SFW --add "$NODE_DEBUG" - $SFW --add "$NODE_RELEASE" - $SFW --add "$NODE_LINK" - $SFW --add "$CCTEST_DEBUG" - $SFW --add "$CCTEST_RELEASE" - $SFW --add "$OPENSSL_CLI_DEBUG" - $SFW --add "$OPENSSL_CLI_RELEASE" - - $SFW --unblock "$NODE_DEBUG" - $SFW --unblock "$NODE_RELEASE" - $SFW --unblock "$NODE_LINK" - $SFW --unblock "$CCTEST_DEBUG" - $SFW --unblock "$CCTEST_RELEASE" - $SFW --unblock "$OPENSSL_CLI_DEBUG" - $SFW --unblock "$OPENSSL_CLI_RELEASE" + add_and_unblock "$NODE_DEBUG" + add_and_unblock "$NODE_RELEASE" + add_and_unblock "$NODE_LINK" + add_and_unblock "$CCTEST_DEBUG" + add_and_unblock "$CCTEST_RELEASE" + add_and_unblock "$OPENSSL_CLI_DEBUG" + add_and_unblock "$OPENSSL_CLI_RELEASE" else echo "SocketFirewall not found in location: $SFW" fi From d5b472b70dd12ccb7804c63aa1375f2db8805605 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Tue, 23 Mar 2021 14:58:11 -0400 Subject: [PATCH 53/85] deps: upgrade npm to 7.7.0 PR-URL: https://github.com/nodejs/node/pull/37879 Reviewed-By: Luigi Pinca Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig --- deps/npm/AUTHORS | 6 + deps/npm/CHANGELOG.md | 76 + deps/npm/CONTRIBUTING.md | 2 +- deps/npm/README.md | 1 + deps/npm/bin/npx-cli.js | 8 +- deps/npm/docs/content/commands/npm-adduser.md | 2 + deps/npm/docs/content/commands/npm-bin.md | 2 + deps/npm/docs/content/commands/npm-cache.md | 2 + .../docs/content/commands/npm-completion.md | 2 + deps/npm/docs/content/commands/npm-config.md | 2 + deps/npm/docs/content/commands/npm-dedupe.md | 5 +- .../docs/content/commands/npm-deprecate.md | 2 + deps/npm/docs/content/commands/npm-doctor.md | 2 + deps/npm/docs/content/commands/npm-edit.md | 2 + deps/npm/docs/content/commands/npm-exec.md | 87 + deps/npm/docs/content/commands/npm-explore.md | 2 + .../docs/content/commands/npm-find-dupes.md | 23 + .../docs/content/commands/npm-help-search.md | 2 + deps/npm/docs/content/commands/npm-help.md | 2 + deps/npm/docs/content/commands/npm-hook.md | 2 + deps/npm/docs/content/commands/npm-init.md | 2 +- deps/npm/docs/content/commands/npm-logout.md | 2 + deps/npm/docs/content/commands/npm-org.md | 2 + deps/npm/docs/content/commands/npm-owner.md | 2 + deps/npm/docs/content/commands/npm-ping.md | 2 + deps/npm/docs/content/commands/npm-prefix.md | 2 + deps/npm/docs/content/commands/npm-profile.md | 2 + .../docs/content/commands/npm-run-script.md | 85 + deps/npm/docs/content/commands/npm-search.md | 2 + .../docs/content/commands/npm-shrinkwrap.md | 2 + deps/npm/docs/content/commands/npm-star.md | 2 + deps/npm/docs/content/commands/npm-stars.md | 2 + deps/npm/docs/content/commands/npm-team.md | 2 + deps/npm/docs/content/commands/npm-token.md | 4 +- deps/npm/docs/content/commands/npm-unstar.md | 2 + deps/npm/docs/content/commands/npm-whoami.md | 2 + .../content/configuring-npm/package-json.md | 5 +- deps/npm/docs/content/using-npm/config.md | 1408 ++++++----- deps/npm/docs/content/using-npm/workspaces.md | 46 + .../npm/docs/output/commands/npm-adduser.html | 1 + deps/npm/docs/output/commands/npm-bin.html | 1 + deps/npm/docs/output/commands/npm-cache.html | 1 + .../docs/output/commands/npm-completion.html | 1 + deps/npm/docs/output/commands/npm-config.html | 1 + deps/npm/docs/output/commands/npm-dedupe.html | 5 +- .../docs/output/commands/npm-deprecate.html | 1 + deps/npm/docs/output/commands/npm-doctor.html | 1 + deps/npm/docs/output/commands/npm-edit.html | 1 + deps/npm/docs/output/commands/npm-exec.html | 69 +- .../npm/docs/output/commands/npm-explore.html | 1 + .../docs/output/commands/npm-find-dupes.html | 174 ++ .../docs/output/commands/npm-help-search.html | 1 + deps/npm/docs/output/commands/npm-help.html | 1 + deps/npm/docs/output/commands/npm-hook.html | 1 + deps/npm/docs/output/commands/npm-init.html | 2 +- deps/npm/docs/output/commands/npm-logout.html | 1 + deps/npm/docs/output/commands/npm-ls.html | 2 +- deps/npm/docs/output/commands/npm-org.html | 1 + deps/npm/docs/output/commands/npm-owner.html | 1 + deps/npm/docs/output/commands/npm-ping.html | 1 + deps/npm/docs/output/commands/npm-prefix.html | 1 + .../npm/docs/output/commands/npm-profile.html | 1 + .../docs/output/commands/npm-run-script.html | 66 +- deps/npm/docs/output/commands/npm-search.html | 1 + .../docs/output/commands/npm-shrinkwrap.html | 1 + deps/npm/docs/output/commands/npm-star.html | 1 + deps/npm/docs/output/commands/npm-stars.html | 1 + deps/npm/docs/output/commands/npm-team.html | 1 + deps/npm/docs/output/commands/npm-token.html | 1 + deps/npm/docs/output/commands/npm-unstar.html | 1 + deps/npm/docs/output/commands/npm-whoami.html | 1 + deps/npm/docs/output/commands/npm.html | 2 +- .../output/configuring-npm/package-json.html | 4 +- deps/npm/docs/output/using-npm/config.html | 1321 ++++++----- .../npm/docs/output/using-npm/workspaces.html | 32 +- deps/npm/lib/access.js | 6 +- deps/npm/lib/adduser.js | 12 +- deps/npm/lib/audit.js | 32 +- deps/npm/lib/base-command.js | 19 + deps/npm/lib/bin.js | 10 +- deps/npm/lib/birthday.js | 15 +- deps/npm/lib/bugs.js | 4 + deps/npm/lib/cache.js | 9 +- deps/npm/lib/ci.js | 10 +- deps/npm/lib/cli.js | 22 +- deps/npm/lib/completion.js | 18 +- deps/npm/lib/config.js | 23 +- deps/npm/lib/dedupe.js | 12 +- deps/npm/lib/deprecate.js | 4 + deps/npm/lib/diff.js | 10 +- deps/npm/lib/dist-tag.js | 6 +- deps/npm/lib/docs.js | 18 +- deps/npm/lib/doctor.js | 7 +- deps/npm/lib/edit.js | 4 + deps/npm/lib/exec.js | 110 +- deps/npm/lib/explain.js | 4 + deps/npm/lib/explore.js | 4 + deps/npm/lib/find-dupes.js | 5 + deps/npm/lib/fund.js | 44 +- deps/npm/lib/get.js | 5 + deps/npm/lib/help-search.js | 28 +- deps/npm/lib/help.js | 177 +- deps/npm/lib/hook.js | 4 + deps/npm/lib/init.js | 7 +- deps/npm/lib/install-ci-test.js | 4 + deps/npm/lib/install-test.js | 4 + deps/npm/lib/install.js | 20 +- deps/npm/lib/link.js | 13 +- deps/npm/lib/logout.js | 17 +- deps/npm/lib/ls.js | 27 +- deps/npm/lib/npm.js | 57 +- deps/npm/lib/org.js | 4 + deps/npm/lib/outdated.js | 37 +- deps/npm/lib/owner.js | 4 + deps/npm/lib/pack.js | 16 +- deps/npm/lib/ping.js | 19 +- deps/npm/lib/prefix.js | 5 + deps/npm/lib/profile.js | 54 +- deps/npm/lib/prune.js | 12 +- deps/npm/lib/publish.js | 24 +- deps/npm/lib/rebuild.js | 7 +- deps/npm/lib/repo.js | 5 + deps/npm/lib/restart.js | 5 + deps/npm/lib/root.js | 9 +- deps/npm/lib/run-script.js | 147 +- deps/npm/lib/search.js | 19 +- deps/npm/lib/set-script.js | 5 + deps/npm/lib/set.js | 4 + deps/npm/lib/shrinkwrap.js | 7 +- deps/npm/lib/star.js | 6 +- deps/npm/lib/stars.js | 5 + deps/npm/lib/start.js | 5 + deps/npm/lib/stop.js | 5 + deps/npm/lib/team.js | 4 + deps/npm/lib/test.js | 5 + deps/npm/lib/token.js | 4 + deps/npm/lib/uninstall.js | 14 +- deps/npm/lib/unpublish.js | 10 +- deps/npm/lib/unstar.js | 5 + deps/npm/lib/update.js | 16 +- deps/npm/lib/utils/config.js | 394 ---- deps/npm/lib/utils/config/definition.js | 185 ++ deps/npm/lib/utils/config/definitions.js | 2054 +++++++++++++++++ deps/npm/lib/utils/config/describe-all.js | 16 + deps/npm/lib/utils/config/flatten.js | 32 + deps/npm/lib/utils/config/index.js | 52 + deps/npm/lib/utils/did-you-mean.js | 35 +- deps/npm/lib/utils/flat-options.js | 254 -- deps/npm/lib/utils/lifecycle-cmd.js | 4 + deps/npm/lib/utils/npm-usage.js | 25 +- deps/npm/lib/utils/ping.js | 4 +- deps/npm/lib/utils/read-local-package.js | 7 +- deps/npm/lib/version.js | 8 +- deps/npm/lib/view.js | 36 +- deps/npm/lib/whoami.js | 19 +- deps/npm/lib/workspaces/get-workspaces.js | 33 + deps/npm/man/man1/npm-adduser.1 | 2 + deps/npm/man/man1/npm-bin.1 | 2 + deps/npm/man/man1/npm-cache.1 | 2 + deps/npm/man/man1/npm-completion.1 | 2 + deps/npm/man/man1/npm-config.1 | 2 + deps/npm/man/man1/npm-dedupe.1 | 6 +- deps/npm/man/man1/npm-deprecate.1 | 2 + deps/npm/man/man1/npm-doctor.1 | 2 + deps/npm/man/man1/npm-edit.1 | 2 + deps/npm/man/man1/npm-exec.1 | 109 + deps/npm/man/man1/npm-explore.1 | 2 + deps/npm/man/man1/npm-find-dupes.1 | 26 + deps/npm/man/man1/npm-help-search.1 | 2 + deps/npm/man/man1/npm-help.1 | 2 + deps/npm/man/man1/npm-hook.1 | 2 + deps/npm/man/man1/npm-init.1 | 2 +- deps/npm/man/man1/npm-logout.1 | 2 + deps/npm/man/man1/npm-ls.1 | 2 +- deps/npm/man/man1/npm-org.1 | 2 + deps/npm/man/man1/npm-owner.1 | 2 + deps/npm/man/man1/npm-ping.1 | 2 + deps/npm/man/man1/npm-prefix.1 | 2 + deps/npm/man/man1/npm-profile.1 | 2 + deps/npm/man/man1/npm-run-script.1 | 106 + deps/npm/man/man1/npm-search.1 | 2 + deps/npm/man/man1/npm-shrinkwrap.1 | 2 + deps/npm/man/man1/npm-star.1 | 2 + deps/npm/man/man1/npm-stars.1 | 2 + deps/npm/man/man1/npm-team.1 | 2 + deps/npm/man/man1/npm-token.1 | 2 + deps/npm/man/man1/npm-unstar.1 | 2 + deps/npm/man/man1/npm-whoami.1 | 2 + deps/npm/man/man1/npm.1 | 2 +- deps/npm/man/man5/package-json.5 | 5 +- deps/npm/man/man7/config.7 | 1591 +++++++------ deps/npm/man/man7/workspaces.7 | 54 + .../@npmcli/arborist/lib/add-rm-pkg-deps.js | 2 +- .../@npmcli/arborist/lib/arborist/reify.js | 2 +- .../@npmcli/arborist/package.json | 4 +- .../@npmcli/config/lib/get-user-agent.js | 13 - .../node_modules/@npmcli/config/lib/index.js | 115 +- .../@npmcli/config/lib/set-envs.js | 6 + .../node_modules/@npmcli/config/package.json | 2 +- .../@npmcli/run-script/lib/make-spawn-args.js | 20 +- .../@npmcli/run-script/package.json | 3 +- deps/npm/node_modules/cacache/CHANGELOG.md | 2 + deps/npm/node_modules/cacache/package.json | 4 +- .../node_modules/hosted-git-info/README.md | 4 +- .../hosted-git-info/git-host-info.js | 211 +- .../node_modules/hosted-git-info/git-host.js | 222 +- .../npm/node_modules/hosted-git-info/index.js | 299 ++- .../node_modules/hosted-git-info/package.json | 26 +- .../node_modules/libnpmversion/lib/index.js | 2 +- .../libnpmversion/lib/read-json.js | 7 + .../node_modules/libnpmversion/lib/version.js | 2 +- .../node_modules/libnpmversion/package.json | 4 +- .../normalize-package-data/README.md | 4 +- .../node_modules/hosted-git-info/CHANGELOG.md | 185 ++ .../node_modules/hosted-git-info/LICENSE | 13 + .../node_modules/hosted-git-info/README.md | 133 ++ .../hosted-git-info/git-host-info.js | 154 ++ .../node_modules/hosted-git-info/git-host.js | 110 + .../node_modules/hosted-git-info/index.js | 237 ++ .../node_modules/hosted-git-info/package.json | 52 + .../normalize-package-data/package.json | 13 +- .../node_modules/hosted-git-info/CHANGELOG.md | 185 ++ .../node_modules/hosted-git-info/LICENSE | 13 + .../node_modules/hosted-git-info/README.md | 133 ++ .../hosted-git-info/git-host-info.js | 154 ++ .../node_modules/hosted-git-info/git-host.js | 110 + .../node_modules/hosted-git-info/index.js | 237 ++ .../node_modules/hosted-git-info/package.json | 52 + .../node_modules/npm-package-arg/package.json | 8 +- .../npm-pick-manifest/CHANGELOG.md | 6 +- .../node_modules/npm-pick-manifest/index.js | 4 +- .../npm-pick-manifest/package.json | 19 +- .../pacote/lib/util/tar-create-options.js | 8 +- deps/npm/node_modules/pacote/package.json | 2 +- deps/npm/node_modules/puka/CHANGELOG.md | 31 - deps/npm/node_modules/puka/LICENSE.txt | 18 - deps/npm/node_modules/puka/README.md | 411 ---- deps/npm/node_modules/puka/index.js | 804 ------- deps/npm/node_modules/puka/package.json | 38 - deps/npm/node_modules/semver/package.json | 2 +- deps/npm/node_modules/semver/ranges/subset.js | 74 +- deps/npm/package.json | 28 +- .../test-lib-dist-tag.js-TAP.test.js | 10 + .../test-lib-publish.js-TAP.test.js | 7 +- ...lib-utils-config-definition.js-TAP.test.js | 264 +++ ...ib-utils-config-definitions.js-TAP.test.js | 156 ++ ...b-utils-config-describe-all.js-TAP.test.js | 1377 +++++++++++ ...test-lib-utils-config-index.js-TAP.test.js | 133 ++ .../test-lib-utils-config.js-TAP.test.js | 1110 --------- ...test-lib-utils-flat-options.js-TAP.test.js | 129 -- .../test-lib-utils-npm-usage.js-TAP.test.js | 284 ++- .../test-lib-utils-tar.js-TAP.test.js | 6 +- deps/npm/test/fixtures/mock-npm.js | 22 + deps/npm/test/lib/audit.js | 20 +- deps/npm/test/lib/bin.js | 19 +- deps/npm/test/lib/birthday.js | 19 +- deps/npm/test/lib/cache.js | 31 +- deps/npm/test/lib/ci.js | 36 +- deps/npm/test/lib/cli.js | 127 +- deps/npm/test/lib/completion.js | 13 +- deps/npm/test/lib/config.js | 59 +- deps/npm/test/lib/dedupe.js | 31 +- deps/npm/test/lib/diff.js | 190 +- deps/npm/test/lib/dist-tag.js | 48 +- deps/npm/test/lib/exec.js | 222 +- deps/npm/test/lib/fund.js | 108 +- deps/npm/test/lib/help-search.js | 71 +- deps/npm/test/lib/help.js | 88 +- deps/npm/test/lib/init.js | 48 +- deps/npm/test/lib/install.js | 35 +- deps/npm/test/lib/link.js | 15 +- deps/npm/test/lib/load-all-commands.js | 54 +- deps/npm/test/lib/logout.js | 72 +- deps/npm/test/lib/ls.js | 522 ++--- deps/npm/test/lib/npm.js | 104 +- deps/npm/test/lib/outdated.js | 72 +- deps/npm/test/lib/pack.js | 29 +- deps/npm/test/lib/ping.js | 39 +- deps/npm/test/lib/profile.js | 105 +- deps/npm/test/lib/publish.js | 241 +- deps/npm/test/lib/rebuild.js | 20 +- deps/npm/test/lib/run-script.js | 528 ++++- deps/npm/test/lib/search.js | 20 +- deps/npm/test/lib/set-script.js | 5 + deps/npm/test/lib/shrinkwrap.js | 32 +- deps/npm/test/lib/star.js | 24 +- deps/npm/test/lib/uninstall.js | 21 +- deps/npm/test/lib/unpublish.js | 43 +- deps/npm/test/lib/update.js | 20 +- deps/npm/test/lib/utils/config.js | 143 -- deps/npm/test/lib/utils/config/definition.js | 185 ++ deps/npm/test/lib/utils/config/definitions.js | 697 ++++++ .../npm/test/lib/utils/config/describe-all.js | 6 + deps/npm/test/lib/utils/config/flatten.js | 34 + deps/npm/test/lib/utils/config/index.js | 24 + deps/npm/test/lib/utils/did-you-mean.js | 42 +- deps/npm/test/lib/utils/flat-options.js | 359 --- deps/npm/test/lib/utils/lifecycle-cmd.js | 6 +- deps/npm/test/lib/utils/npm-usage.js | 63 +- deps/npm/test/lib/utils/read-local-package.js | 21 +- deps/npm/test/lib/utils/tar.js | 4 +- deps/npm/test/lib/version.js | 20 +- deps/npm/test/lib/view.js | 90 +- deps/npm/test/lib/whoami.js | 14 +- .../npm/test/lib/workspaces/get-workspaces.js | 199 ++ 305 files changed, 14585 insertions(+), 7996 deletions(-) create mode 100644 deps/npm/docs/content/commands/npm-find-dupes.md create mode 100644 deps/npm/docs/output/commands/npm-find-dupes.html delete mode 100644 deps/npm/lib/utils/config.js create mode 100644 deps/npm/lib/utils/config/definition.js create mode 100644 deps/npm/lib/utils/config/definitions.js create mode 100644 deps/npm/lib/utils/config/describe-all.js create mode 100644 deps/npm/lib/utils/config/flatten.js create mode 100644 deps/npm/lib/utils/config/index.js delete mode 100644 deps/npm/lib/utils/flat-options.js create mode 100644 deps/npm/lib/workspaces/get-workspaces.js create mode 100644 deps/npm/man/man1/npm-find-dupes.1 delete mode 100644 deps/npm/node_modules/@npmcli/config/lib/get-user-agent.js create mode 100644 deps/npm/node_modules/libnpmversion/lib/read-json.js create mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/CHANGELOG.md create mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/LICENSE create mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/README.md create mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/git-host-info.js create mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/git-host.js create mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/index.js create mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/package.json create mode 100644 deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/CHANGELOG.md create mode 100644 deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/LICENSE create mode 100644 deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/README.md create mode 100644 deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/git-host-info.js create mode 100644 deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/git-host.js create mode 100644 deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/index.js create mode 100644 deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/package.json delete mode 100644 deps/npm/node_modules/puka/CHANGELOG.md delete mode 100644 deps/npm/node_modules/puka/LICENSE.txt delete mode 100644 deps/npm/node_modules/puka/README.md delete mode 100644 deps/npm/node_modules/puka/index.js delete mode 100644 deps/npm/node_modules/puka/package.json create mode 100644 deps/npm/tap-snapshots/test-lib-utils-config-definition.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-utils-config-definitions.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-utils-config-describe-all.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-utils-config-index.js-TAP.test.js delete mode 100644 deps/npm/tap-snapshots/test-lib-utils-config.js-TAP.test.js delete mode 100644 deps/npm/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js create mode 100644 deps/npm/test/fixtures/mock-npm.js delete mode 100644 deps/npm/test/lib/utils/config.js create mode 100644 deps/npm/test/lib/utils/config/definition.js create mode 100644 deps/npm/test/lib/utils/config/definitions.js create mode 100644 deps/npm/test/lib/utils/config/describe-all.js create mode 100644 deps/npm/test/lib/utils/config/flatten.js create mode 100644 deps/npm/test/lib/utils/config/index.js delete mode 100644 deps/npm/test/lib/utils/flat-options.js create mode 100644 deps/npm/test/lib/workspaces/get-workspaces.js diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index 9e5ac7fcaff39c..9c67cf88ef2505 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -759,3 +759,9 @@ Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Bjørn Johansen Fraqe Edward Grech +Kenrick +Karthik Sundari +Jan Sepke <625043+jansepke@users.noreply.github.com> +Augusto Moura +Eric Chow +kbayrhammer diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index 0b20696a89b952..c11a44734ae8eb 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -1,3 +1,79 @@ +## v7.7.0 (2021-03-23) + +### FEATURES + +* [`33c4189f9`](https://github.com/npm/cli/commit/33c4189f939aebdfaf85ea419e6ea01d0977b79d) + [#2864](https://github.com/npm/cli/issues/2864) + add `npm run-script` workspaces support + ([@ruyadorno](https://github.com/ruyadorno)) +* [`e1b3b318f`](https://github.com/npm/cli/commit/e1b3b318f095a7e1a7cc4b131907de4955275d9d) + [#2886](https://github.com/npm/cli/issues/2886) + add `npm exec` workspaces support + ([@ruyadorno](https://github.com/ruyadorno)) +* [`41facf643`](https://github.com/npm/cli/commit/41facf6435ced4e416d74111d9c3ff00ee19ab7d) + [#2859](https://github.com/npm/cli/issues/2859) + expanded "Did you mean?" suggestions for missing cmds and scripts + ([@wraithgar](https://github.com/wraithgar)) + +### BUG FIXES + +* [`8cce4282f`](https://github.com/npm/cli/commit/8cce4282f7bef11aeeb73cffd532b477b241985e) + [#2865](https://github.com/npm/cli/issues/2865) + `npm publish`: handle case where multiple config list is present + ([@kenrick95](https://github.com/kenrick95)) +* [`6598bfe86`](https://github.com/npm/cli/commit/6598bfe8697439e827d84981f8504febca64a55a) + mark deprecated configs + ([@isaacs](https://github.com/isaacs)) +* [`8a38afe77`](https://github.com/npm/cli/commit/8a38afe779ce71a10178ed62b13709d06adf7a66) + [#2881](https://github.com/npm/cli/issues/2881) + docs(package-json): document default main behavior + ([@klausbayrhammer](https://github.com/klausbayrhammer)) +* [`93a061d73`](https://github.com/npm/cli/commit/93a061d737dc769663652368e8586e4202267b9e) + [#2917](https://github.com/npm/cli/issues/2917) + add action items to `npm run` error output + ([@wraithgar](https://github.com/wraithgar)) + +### DOCUMENTATION + +* [`ad65bd910`](https://github.com/npm/cli/commit/ad65bd9101aa8e8b94bc1e48df3ef93deca6d30c) + [#2860](https://github.com/npm/cli/issues/2860) + fix link in configuring-npm + ([@varmakarthik12](https://github.com/varmakarthik12)) +* [`b419bfb02`](https://github.com/npm/cli/commit/b419bfb0259596fb338d45b2eaeab25a7a0d1f1e) + [#2876](https://github.com/npm/cli/issues/2876) + fix test-coverage command in contributing guide + ([@chowkapow](https://github.com/chowkapow)) + +### DEPENDENCIES + +* [`7b5606b93`](https://github.com/npm/cli/commit/7b5606b931083e8a70f5ea094c2b46f0b7a38a18) + `@npmcli/arborist@2.2.9` + * [#254](https://github.com/npm/arborist/pull/254) Honor explicit + prefix when saving dependencies + ([@jameschensmith](https://github.com/jameschensmith)) + * [#255](https://github.com/npm/arborist/pull/255) Never save to + `bundleDependencies` when saving a `peer` or `peerOptional` + dependency. ([@isaacs](https://github.com/isaacs)) +* [`f76e7c21f`](https://github.com/npm/cli/commit/f76e7c21ffd87b08593d8c396a78ab9c5fa790bd) + `pacote@11.3.1` + * increases tarball compression level +* [`4928512bc`](https://github.com/npm/cli/commit/4928512bcefd8448ff5852978cfc7f903e3ae996) + `semver@7.3.5` + * fix handling prereleases/ANY ranges in subset +* [`1924eb457`](https://github.com/npm/cli/commit/1924eb457aea7c93dfaf4a911355a63d84d66eee) + `libnpmversion@1.0.12` + * fix removing undescored-prefixed package.json properties in `npm version` +* [`916623056`](https://github.com/npm/cli/commit/91662305643509eebd2f79ed7e3ff01562aa4968) + `@npmcli/run-script@1.8.4` + * fix expanding windows-style environment variables +* [`a8d0751e4`](https://github.com/npm/cli/commit/a8d0751e4b7c7d8b808c8a49f288fc7272f729b0) + `npm-pick-manifest@6.1.1` + * fix running packages with a single executable binary with `npm exec` +* [`af7eaac50`](https://github.com/npm/cli/commit/af7eaac5018ed821d72d43d08f1d7e49e7491453) + `hosted-git-info@4.0.1` +* [`f52c51db1`](https://github.com/npm/cli/commit/f52c51db13c39cfbaed18dbd13ba7302a4b6a0d9) + `@npmcli/config@2.0.0` + ## v7.6.3 (2021-03-11) ### DOCUMENTATION diff --git a/deps/npm/CONTRIBUTING.md b/deps/npm/CONTRIBUTING.md index 5198918f010dfa..4116f4e71d057c 100644 --- a/deps/npm/CONTRIBUTING.md +++ b/deps/npm/CONTRIBUTING.md @@ -38,7 +38,7 @@ We expect that every new feature or bug fix comes with corresponding tests that **You can find out what the current test coverage percentage is by running...** ```bash -$ npm run test-coverage +$ npm run check-coverage ``` ## Performance & Benchmarks diff --git a/deps/npm/README.md b/deps/npm/README.md index 8a649847ecaab6..01de9e8f694456 100644 --- a/deps/npm/README.md +++ b/deps/npm/README.md @@ -28,6 +28,7 @@ If you're looking to manage multiple versions of **`node`** &/or **`npm`**, cons * [**`n`**](https://github.com/tj/n) * [**`volta`**](https://github.com/volta-cli/volta) * [**`nodenv`**](https://github.com/nodenv/nodenv) +* [**`asdf-nodejs`**](https://github.com/asdf-vm/asdf-nodejs) ### Usage diff --git a/deps/npm/bin/npx-cli.js b/deps/npm/bin/npx-cli.js index f4a419972f7cf4..a495090c64c784 100755 --- a/deps/npm/bin/npx-cli.js +++ b/deps/npm/bin/npx-cli.js @@ -24,11 +24,11 @@ const removed = new Set([ ...removedOpts ]) -const { types, shorthands } = require('../lib/utils/config.js') -const npmSwitches = Object.entries(types) - .filter(([key, type]) => type === Boolean || +const { definitions, shorthands } = require('../lib/utils/config/index.js') +const npmSwitches = Object.entries(definitions) + .filter(([key, {type}]) => type === Boolean || (Array.isArray(type) && type.includes(Boolean))) - .map(([key, type]) => key) + .map(([key]) => key) // things that don't take a value const switches = new Set([ diff --git a/deps/npm/docs/content/commands/npm-adduser.md b/deps/npm/docs/content/commands/npm-adduser.md index 7960869ad33cce..d0ddd68c2529a4 100644 --- a/deps/npm/docs/content/commands/npm-adduser.md +++ b/deps/npm/docs/content/commands/npm-adduser.md @@ -12,6 +12,8 @@ npm adduser [--registry=url] [--scope=@orgname] [--always-auth] [--auth-type=leg aliases: login, add-user ``` +Note: This command is unaware of workspaces. + ### Description Create or verify a user named `` in the specified registry, and diff --git a/deps/npm/docs/content/commands/npm-bin.md b/deps/npm/docs/content/commands/npm-bin.md index 4303040e78dacc..c835784f675a05 100644 --- a/deps/npm/docs/content/commands/npm-bin.md +++ b/deps/npm/docs/content/commands/npm-bin.md @@ -10,6 +10,8 @@ description: Display npm bin folder npm bin [-g|--global] ``` +Note: This command is unaware of workspaces. + ### Description Print the folder where npm will install executables. diff --git a/deps/npm/docs/content/commands/npm-cache.md b/deps/npm/docs/content/commands/npm-cache.md index 13386f2c4a439c..bcc2989b7d3c3b 100644 --- a/deps/npm/docs/content/commands/npm-cache.md +++ b/deps/npm/docs/content/commands/npm-cache.md @@ -18,6 +18,8 @@ aliases: npm cache clear, npm cache rm npm cache verify ``` +Note: This command is unaware of workspaces. + ### Description Used to add, list, or clean the npm cache folder. diff --git a/deps/npm/docs/content/commands/npm-completion.md b/deps/npm/docs/content/commands/npm-completion.md index 53737c8033194b..9dbd960913f270 100644 --- a/deps/npm/docs/content/commands/npm-completion.md +++ b/deps/npm/docs/content/commands/npm-completion.md @@ -10,6 +10,8 @@ description: Tab Completion for npm source <(npm completion) ``` +Note: This command is unaware of workspaces. + ### Description Enables tab-completion in all npm commands. diff --git a/deps/npm/docs/content/commands/npm-config.md b/deps/npm/docs/content/commands/npm-config.md index 51caa5a61b6075..31629a6b7d7a21 100644 --- a/deps/npm/docs/content/commands/npm-config.md +++ b/deps/npm/docs/content/commands/npm-config.md @@ -18,6 +18,8 @@ npm get [ [ ...]] alias: c ``` +Note: This command is unaware of workspaces. + ### Description npm gets its config settings from the command line, environment diff --git a/deps/npm/docs/content/commands/npm-dedupe.md b/deps/npm/docs/content/commands/npm-dedupe.md index 9b14e99dd14f02..c6d26126d30775 100644 --- a/deps/npm/docs/content/commands/npm-dedupe.md +++ b/deps/npm/docs/content/commands/npm-dedupe.md @@ -1,7 +1,7 @@ --- title: npm-dedupe section: 1 -description: Reduce duplication +description: Reduce duplication in the package tree --- ### Synopsis @@ -10,7 +10,7 @@ description: Reduce duplication npm dedupe npm ddp -aliases: find-dupes, ddp +aliases: ddp ``` ### Description @@ -74,6 +74,7 @@ Using `npm find-dupes` will run the command in `--dry-run` mode. ### See Also +* [npm find-dupes](/cli-commands/find-dupes) * [npm ls](/cli-commands/ls) * [npm update](/cli-commands/update) * [npm install](/cli-commands/install) diff --git a/deps/npm/docs/content/commands/npm-deprecate.md b/deps/npm/docs/content/commands/npm-deprecate.md index 139441856bb068..06037976610558 100644 --- a/deps/npm/docs/content/commands/npm-deprecate.md +++ b/deps/npm/docs/content/commands/npm-deprecate.md @@ -10,6 +10,8 @@ description: Deprecate a version of a package npm deprecate [@] ``` +Note: This command is unaware of workspaces. + ### Description This command will update the npm registry entry for a package, providing a diff --git a/deps/npm/docs/content/commands/npm-doctor.md b/deps/npm/docs/content/commands/npm-doctor.md index 2aceee23903316..9416818a40aafb 100644 --- a/deps/npm/docs/content/commands/npm-doctor.md +++ b/deps/npm/docs/content/commands/npm-doctor.md @@ -10,6 +10,8 @@ description: Check your npm environment npm doctor ``` +Note: This command is unaware of workspaces. + ### Description `npm doctor` runs a set of checks to ensure that your npm installation has diff --git a/deps/npm/docs/content/commands/npm-edit.md b/deps/npm/docs/content/commands/npm-edit.md index 40fac0408529a2..20788aafb6d6a8 100644 --- a/deps/npm/docs/content/commands/npm-edit.md +++ b/deps/npm/docs/content/commands/npm-edit.md @@ -10,6 +10,8 @@ description: Edit an installed package npm edit ``` +Note: This command is unaware of workspaces. + ### Description Selects a dependency in the current project and opens the package folder in diff --git a/deps/npm/docs/content/commands/npm-exec.md b/deps/npm/docs/content/commands/npm-exec.md index cb3e51c8255d4b..88b98e3bce466a 100644 --- a/deps/npm/docs/content/commands/npm-exec.md +++ b/deps/npm/docs/content/commands/npm-exec.md @@ -11,6 +11,7 @@ npm exec -- [@] [args...] npm exec --package=[@] -- [args...] npm exec -c ' [args...]' npm exec --package=foo -c ' [args...]' +npm exec [-ws] [-w [@] [args...] npx -p [@] [args...] @@ -145,6 +146,68 @@ $ npm x -c 'eslint && say "hooray, lint passed"' $ npx -c 'eslint && say "hooray, lint passed"' ``` +### Workspaces support + +You may use the `workspace` or `workspaces` configs in order to run an +arbitrary command from an npm package (either one installed locally, or fetched +remotely) in the context of the specified workspaces. +If no positional argument or `--call` option is provided, it will open an +interactive subshell in the context of each of these configured workspaces one +at a time. + +Given a project with configured workspaces, e.g: + +``` +. ++-- package.json +`-- packages + +-- a + | `-- package.json + +-- b + | `-- package.json + `-- c + `-- package.json +``` + +Assuming the workspace configuration is properly set up at the root level +`package.json` file. e.g: + +``` +{ + "workspaces": [ "./packages/*" ] +} +``` + +You can execute an arbitrary command from a package in the context of each of +the configured workspaces when using the `workspaces` configuration options, +in this example we're using **eslint** to lint any js file found within each +workspace folder: + +``` +npm exec -ws -- eslint ./*.js +``` + +#### Filtering workspaces + +It's also possible to execute a command in a single workspace using the +`workspace` config along with a name or directory path: + +``` +npm exec --workspace=a -- eslint ./*.js +``` + +The `workspace` config can also be specified multiple times in order to run a +specific script in the context of multiple workspaces. When defining values for +the `workspace` config in the command line, it also possible to use `-w` as a +shorthand, e.g: + +``` +npm exec -w a -w b -- eslint ./*.js +``` + +This last command will run the `eslint` command in both `./packages/a` and +`./packages/b` folders. + ### Compatibility with Older npx Versions The `npx` binary was rewritten in npm v7.0.0, and the standalone `npx` @@ -195,6 +258,30 @@ requested from the server. To force full offline mode, use `offline`. Forces full offline mode. Any packages not locally cached will result in an error. +#### workspace + +* Alias: `-w` +* Type: Array +* Default: `[]` + +Enable running scripts in the context of workspaces while also filtering by +the provided names or paths provided. + +Valid values for the `workspace` config are either: +- Workspace names +- Path to a workspace directory +- Path to a parent workspace directory (will result to selecting all of the +children workspaces) + +#### workspaces + +* Alias: `-ws` +* Type: Boolean +* Default: `false` + +Run scripts in the context of all configured workspaces for the current +project. + ### See Also * [npm run-script](/commands/npm-run-script) diff --git a/deps/npm/docs/content/commands/npm-explore.md b/deps/npm/docs/content/commands/npm-explore.md index e467a755753b4f..7e2004b84c0414 100644 --- a/deps/npm/docs/content/commands/npm-explore.md +++ b/deps/npm/docs/content/commands/npm-explore.md @@ -10,6 +10,8 @@ description: Browse an installed package npm explore [ -- ] ``` +Note: This command is unaware of workspaces. + ### Description Spawn a subshell in the directory of the installed package specified. diff --git a/deps/npm/docs/content/commands/npm-find-dupes.md b/deps/npm/docs/content/commands/npm-find-dupes.md new file mode 100644 index 00000000000000..e098cf47f49915 --- /dev/null +++ b/deps/npm/docs/content/commands/npm-find-dupes.md @@ -0,0 +1,23 @@ +--- +title: npm-find-dupes +section: 1 +description: Find duplication in the package tree +--- + +### Synopsis + +```bash +npm find-dupes +``` + +### Description + +Runs `npm dedupe` in `--dry-run` mode, making npm only output the +duplications, without actually changing the package tree. + +### See Also + +* [npm dedupe](/cli-commands/dedupe) +* [npm ls](/cli-commands/ls) +* [npm update](/cli-commands/update) +* [npm install](/cli-commands/install) diff --git a/deps/npm/docs/content/commands/npm-help-search.md b/deps/npm/docs/content/commands/npm-help-search.md index e10638efa07d95..51c7b43fb54f11 100644 --- a/deps/npm/docs/content/commands/npm-help-search.md +++ b/deps/npm/docs/content/commands/npm-help-search.md @@ -10,6 +10,8 @@ description: Search npm help documentation npm help-search ``` +Note: This command is unaware of workspaces. + ### Description This command will search the npm markdown documentation files for the terms diff --git a/deps/npm/docs/content/commands/npm-help.md b/deps/npm/docs/content/commands/npm-help.md index 56e46645522baf..57c5efc8ed5eb9 100644 --- a/deps/npm/docs/content/commands/npm-help.md +++ b/deps/npm/docs/content/commands/npm-help.md @@ -10,6 +10,8 @@ description: Get help on npm npm help [] ``` +Note: This command is unaware of workspaces. + ### Description If supplied a topic, then show the appropriate documentation page. diff --git a/deps/npm/docs/content/commands/npm-hook.md b/deps/npm/docs/content/commands/npm-hook.md index 2ac548ada0c21f..6effc9b7d223ba 100644 --- a/deps/npm/docs/content/commands/npm-hook.md +++ b/deps/npm/docs/content/commands/npm-hook.md @@ -13,6 +13,8 @@ npm hook update [secret] npm hook rm ``` +Note: This command is unaware of workspaces. + ### Description Allows you to manage [npm diff --git a/deps/npm/docs/content/commands/npm-init.md b/deps/npm/docs/content/commands/npm-init.md index 8a40d90e8354d5..4b0b8c4c43e73e 100644 --- a/deps/npm/docs/content/commands/npm-init.md +++ b/deps/npm/docs/content/commands/npm-init.md @@ -1,7 +1,7 @@ --- title: npm-init section: 1 -description: create a package.json file +description: Create a package.json file --- ### Synopsis diff --git a/deps/npm/docs/content/commands/npm-logout.md b/deps/npm/docs/content/commands/npm-logout.md index 7fa858a99993d2..1172a3f0f560a7 100644 --- a/deps/npm/docs/content/commands/npm-logout.md +++ b/deps/npm/docs/content/commands/npm-logout.md @@ -10,6 +10,8 @@ description: Log out of the registry npm logout [--registry=] [--scope=<@scope>] ``` +Note: This command is unaware of workspaces. + ### Description When logged into a registry that supports token-based authentication, tell diff --git a/deps/npm/docs/content/commands/npm-org.md b/deps/npm/docs/content/commands/npm-org.md index 18047d109cc0b0..384f5b99fd42e3 100644 --- a/deps/npm/docs/content/commands/npm-org.md +++ b/deps/npm/docs/content/commands/npm-org.md @@ -12,6 +12,8 @@ npm org rm npm org ls [] ``` +Note: This command is unaware of workspaces. + ### Example Add a new developer to an org: diff --git a/deps/npm/docs/content/commands/npm-owner.md b/deps/npm/docs/content/commands/npm-owner.md index 69eba56afd97d5..b30bbc8dc68ef2 100644 --- a/deps/npm/docs/content/commands/npm-owner.md +++ b/deps/npm/docs/content/commands/npm-owner.md @@ -14,6 +14,8 @@ npm owner ls [<@scope>/] aliases: author ``` +Note: This command is unaware of workspaces. + ### Description Manage ownership of published packages. diff --git a/deps/npm/docs/content/commands/npm-ping.md b/deps/npm/docs/content/commands/npm-ping.md index 8de06aa1848361..f640bf060c7501 100644 --- a/deps/npm/docs/content/commands/npm-ping.md +++ b/deps/npm/docs/content/commands/npm-ping.md @@ -10,6 +10,8 @@ description: Ping npm registry npm ping [--registry ] ``` +Note: This command is unaware of workspaces. + ### Description Ping the configured or given npm registry and verify authentication. diff --git a/deps/npm/docs/content/commands/npm-prefix.md b/deps/npm/docs/content/commands/npm-prefix.md index 9c33bb18901ef4..4e3edf19023013 100644 --- a/deps/npm/docs/content/commands/npm-prefix.md +++ b/deps/npm/docs/content/commands/npm-prefix.md @@ -10,6 +10,8 @@ description: Display prefix npm prefix [-g] ``` +Note: This command is unaware of workspaces. + ### Description Print the local prefix to standard output. This is the closest parent directory diff --git a/deps/npm/docs/content/commands/npm-profile.md b/deps/npm/docs/content/commands/npm-profile.md index 88edf26d87c410..b4e2fdaee6cb11 100644 --- a/deps/npm/docs/content/commands/npm-profile.md +++ b/deps/npm/docs/content/commands/npm-profile.md @@ -14,6 +14,8 @@ npm profile enable-2fa [auth-and-writes|auth-only] npm profile disable-2fa ``` +Note: This command is unaware of workspaces. + ### Description Change your profile information on the registry. Note that this command diff --git a/deps/npm/docs/content/commands/npm-run-script.md b/deps/npm/docs/content/commands/npm-run-script.md index 8b89435e1a97be..076dfd7addcc35 100644 --- a/deps/npm/docs/content/commands/npm-run-script.md +++ b/deps/npm/docs/content/commands/npm-run-script.md @@ -8,6 +8,8 @@ description: Run arbitrary package scripts ```bash npm run-script [--if-present] [--silent] [-- ] +npm run-script [--workspace=] +npm run-script [--workspaces] aliases: run, rum, urn ``` @@ -78,6 +80,65 @@ If you try to run a script without having a `node_modules` directory and it fails, you will be given a warning to run `npm install`, just in case you've forgotten. +### Workspaces support + +You may use the `workspace` or `workspaces` configs in order to run an +arbitrary command from a package's `"scripts"` object in the context of the +specified workspaces. If no `"command"` is provided, it will list the available +scripts for each of these configured workspaces. + +Given a project with configured workspaces, e.g: + +``` +. ++-- package.json +`-- packages + +-- a + | `-- package.json + +-- b + | `-- package.json + `-- c + `-- package.json +``` + +Assuming the workspace configuration is properly set up at the root level +`package.json` file. e.g: + +``` +{ + "workspaces": [ "./packages/*" ] +} +``` + +And that each of the configured workspaces has a configured `test` script, +we can run tests in all of them using the `workspaces` config: + +``` +npm test --workspaces +``` + +#### Filtering workspaces + +It's also possible to run a script in a single workspace using the `workspace` +config along with a name or directory path: + +``` +npm test --workspace=a +``` + +The `workspace` config can also be specified multiple times in order to run a +specific script in the context of multiple workspaces. When defining values for +the `workspace` config in the command line, it also possible to use `-w` as a +shorthand, e.g: + +``` +npm test -w a -w b +``` + +This last command will run `test` in both `./packages/a` and `./packages/b` +packages. + + ### Configuration #### if-present @@ -111,6 +172,30 @@ to `/bin/sh` on Unix, defaults to `env.comspec` or `cmd.exe` on Windows. You can use the `--silent` flag to prevent showing `npm ERR!` output on error. +#### workspace + +* Alias: `-w` +* Type: Array +* Default: `[]` + +Enable running scripts in the context of workspaces while also filtering by +the provided names or paths provided. + +Valid values for the `workspace` config are either: +- Workspace names +- Path to a workspace directory +- Path to a parent workspace directory (will result to selecting all of the +children workspaces) + +#### workspaces + +* Alias: `-ws` +* Type: Boolean +* Default: `false` + +Run scripts in the context of all configured workspaces for the current +project. + ### See Also * [npm scripts](/using-npm/scripts) diff --git a/deps/npm/docs/content/commands/npm-search.md b/deps/npm/docs/content/commands/npm-search.md index 35178bcb0a580a..046c9334ff062d 100644 --- a/deps/npm/docs/content/commands/npm-search.md +++ b/deps/npm/docs/content/commands/npm-search.md @@ -12,6 +12,8 @@ npm search [-l|--long] [--json] [--parseable] [--no-description] [search terms . aliases: s, se, find ``` +Note: This command is unaware of workspaces. + ### Description Search the registry for packages matching the search terms. `npm search` diff --git a/deps/npm/docs/content/commands/npm-shrinkwrap.md b/deps/npm/docs/content/commands/npm-shrinkwrap.md index dce50b7843bc3e..6786229469d2ce 100644 --- a/deps/npm/docs/content/commands/npm-shrinkwrap.md +++ b/deps/npm/docs/content/commands/npm-shrinkwrap.md @@ -10,6 +10,8 @@ description: Lock down dependency versions for publication npm shrinkwrap ``` +Note: This command is unaware of workspaces. + ### Description This command repurposes `package-lock.json` into a publishable diff --git a/deps/npm/docs/content/commands/npm-star.md b/deps/npm/docs/content/commands/npm-star.md index aab6e107747fd9..e624b92480f918 100644 --- a/deps/npm/docs/content/commands/npm-star.md +++ b/deps/npm/docs/content/commands/npm-star.md @@ -10,6 +10,8 @@ description: Mark your favorite packages npm star [...] ``` +Note: This command is unaware of workspaces. + ### Description "Starring" a package means that you have some interest in it. It's diff --git a/deps/npm/docs/content/commands/npm-stars.md b/deps/npm/docs/content/commands/npm-stars.md index dab11bc669d1a7..80217ee044aa8b 100644 --- a/deps/npm/docs/content/commands/npm-stars.md +++ b/deps/npm/docs/content/commands/npm-stars.md @@ -9,6 +9,8 @@ description: View packages marked as favorites npm stars [] ``` +Note: This command is unaware of workspaces. + ### Description If you have starred a lot of neat things and want to find them again diff --git a/deps/npm/docs/content/commands/npm-team.md b/deps/npm/docs/content/commands/npm-team.md index 96aacd8ae95f22..04e1d7f9eb1a51 100644 --- a/deps/npm/docs/content/commands/npm-team.md +++ b/deps/npm/docs/content/commands/npm-team.md @@ -16,6 +16,8 @@ npm team rm npm team ls | ``` +Note: This command is unaware of workspaces. + ### Description Used to manage teams in organizations, and change team memberships. Does not diff --git a/deps/npm/docs/content/commands/npm-token.md b/deps/npm/docs/content/commands/npm-token.md index 652079453702e7..bafc7fc45c677a 100644 --- a/deps/npm/docs/content/commands/npm-token.md +++ b/deps/npm/docs/content/commands/npm-token.md @@ -9,7 +9,9 @@ description: Manage your authentication tokens npm token list [--json|--parseable] npm token create [--read-only] [--cidr=1.1.1.1/24,2.2.2.2/16] npm token revoke - ``` +``` + +Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-unstar.md b/deps/npm/docs/content/commands/npm-unstar.md index 5471d908004e16..bad1917593841f 100644 --- a/deps/npm/docs/content/commands/npm-unstar.md +++ b/deps/npm/docs/content/commands/npm-unstar.md @@ -10,6 +10,8 @@ description: Remove an item from your favorite packages npm unstar [...] ``` +Note: This command is unaware of workspaces. + ### Description "Unstarring" a package is the opposite of [`npm star`](/commands/npm-star), diff --git a/deps/npm/docs/content/commands/npm-whoami.md b/deps/npm/docs/content/commands/npm-whoami.md index 43b301c51707a4..892adeea3db7c8 100644 --- a/deps/npm/docs/content/commands/npm-whoami.md +++ b/deps/npm/docs/content/commands/npm-whoami.md @@ -10,6 +10,8 @@ description: Display npm username npm whoami [--registry ] ``` +Note: This command is unaware of workspaces. + ### Description Print the `username` config to standard output. diff --git a/deps/npm/docs/content/configuring-npm/package-json.md b/deps/npm/docs/content/configuring-npm/package-json.md index 4b3fd2ba934591..f3a186f436e029 100644 --- a/deps/npm/docs/content/configuring-npm/package-json.md +++ b/deps/npm/docs/content/configuring-npm/package-json.md @@ -325,6 +325,8 @@ This should be a module relative to the root of your package folder. For most modules, it makes the most sense to have a main script and often not much else. +If `main` is not set it defaults to `index.js` in the packages root folder. + ### browser If your module is meant to be used client-side the browser field should be @@ -562,8 +564,7 @@ tarball or git URL. **Please do not put test harnesses or transpilers or other "development" time tools in your `dependencies` object.** See `devDependencies`, below. -See [semver]([/using-npm/semver](https://github.com/npm/node-semver#versions)) -for more details about specifying version ranges. +See [semver](/using-npm/semver#versions) for more details about specifying version ranges. * `version` Must match `version` exactly * `>version` Must be greater than `version` diff --git a/deps/npm/docs/content/using-npm/config.md b/deps/npm/docs/content/using-npm/config.md index 1032adafbeb222..da69ad46325305 100644 --- a/deps/npm/docs/content/using-npm/config.md +++ b/deps/npm/docs/content/using-npm/config.md @@ -59,30 +59,48 @@ internal to npm, and are defaults if nothing else is specified. The following shorthands are parsed on the command-line: -* `-v`: `--version` -* `-h`, `-?`, `--help`, `-H`: `--usage` -* `-s`, `--silent`: `--loglevel silent` -* `-q`, `--quiet`: `--loglevel warn` -* `-d`: `--loglevel info` -* `-dd`, `--verbose`: `--loglevel verbose` -* `-ddd`: `--loglevel silly` + + +* `-a`: `--all` +* `--enjoy-by`: `--before` +* `-c`: `--call` +* `--desc`: `--description` +* `-f`: `--force` * `-g`: `--global` -* `-C`: `--prefix` +* `-d`: `--loglevel info` +* `-s`: `--loglevel silent` +* `--silent`: `--loglevel silent` +* `--ddd`: `--loglevel silly` +* `--dd`: `--loglevel verbose` +* `--verbose`: `--loglevel verbose` +* `-q`: `--loglevel warn` +* `--quiet`: `--loglevel warn` * `-l`: `--long` * `-m`: `--message` -* `-p`, `--porcelain`: `--parseable` -* `-reg`: `--registry` -* `-f`: `--force` -* `-desc`: `--description` +* `--local`: `--no-global` +* `-n`: `--no-yes` +* `--no`: `--no-yes` +* `-p`: `--parseable` +* `--porcelain`: `--parseable` +* `-C`: `--prefix` +* `--readonly`: `--read-only` +* `--reg`: `--registry` * `-S`: `--save` -* `-P`: `--save-prod` -* `-D`: `--save-dev` -* `-O`: `--save-optional` * `-B`: `--save-bundle` +* `-D`: `--save-dev` * `-E`: `--save-exact` +* `-O`: `--save-optional` +* `-P`: `--save-prod` +* `-?`: `--usage` +* `-h`: `--usage` +* `-H`: `--usage` +* `--help`: `--usage` +* `-v`: `--version` +* `-w`: `--workspace` +* `--ws`: `--workspaces` * `-y`: `--yes` -* `-n`: `--yes false` -* `ll` and `la` commands: `ls --long` + + If the specified configuration param resolves unambiguously to a known configuration parameter, then it is expanded to that configuration @@ -107,26 +125,39 @@ npm ls --global --parseable --long --loglevel info ### Config Settings -#### access + + +#### `_auth` + +* Default: null +* Type: null or String + +A basic-auth string to use when authenticating against the npm registry. + +Warning: This should generally not be set via a command-line option. It is +safer to use a registry-provided authentication bearer token stored in the +~/.npmrc file by running `npm login`. -* Default: `restricted` -* Type: Access +#### `access` -When publishing scoped packages, the access level defaults to `restricted`. If -you want your scoped package to be publicly viewable (and installable) set -`--access=public`. The only valid values for `access` are `public` and +* Default: 'restricted' for scoped packages, 'public' for unscoped packages +* Type: null, "restricted", or "public" + +When publishing scoped packages, the access level defaults to `restricted`. +If you want your scoped package to be publicly viewable (and installable) +set `--access=public`. The only valid values for `access` are `public` and `restricted`. Unscoped packages _always_ have an access level of `public`. -#### all +#### `all` -* Default: `false` +* Default: false * Type: Boolean When running `npm outdated` and `npm ls`, setting `--all` will show all outdated or installed packages, rather than only those directly depended upon by the current project. -#### allow-same-version +#### `allow-same-version` * Default: false * Type: Boolean @@ -134,78 +165,62 @@ upon by the current project. Prevents throwing an error when `npm version` is used to set the new version to the same value as the current version. -#### always-auth +#### `always-auth` * Default: false * Type: Boolean -Force npm to always require authentication when accessing the registry, -even for `GET` requests. - -#### also - -* Default: null -* Type: String - -When "dev" or "development" and running local `npm shrinkwrap`, -`npm outdated`, or `npm update`, is an alias for `--dev`. +Force npm to always require authentication when accessing the registry, even +for `GET` requests. -#### audit +#### `audit` * Default: true * Type: Boolean When "true" submit audit reports alongside `npm install` runs to the default -registry and all registries configured for scopes. See the documentation -for [`npm audit`](/commands/npm-audit) for details on what is submitted. - -#### audit-level - -* Default: `"low"` -* Type: `'low'`, `'moderate'`, `'high'`, `'critical'` - -The minimum level of vulnerability for `npm audit` to exit with -a non-zero exit code. +registry and all registries configured for scopes. See the documentation for +[`npm audit`](/commands/npm-audit) for details on what is submitted. -#### auth-type +#### `audit-level` -* Default: `'legacy'` -* Type: `'legacy'`, `'sso'`, `'saml'`, `'oauth'` +* Default: null +* Type: "low", "moderate", "high", "critical", "none", or null -What authentication strategy to use with `adduser`/`login`. +The minimum level of vulnerability for `npm audit` to exit with a non-zero +exit code. -#### before +#### `before` -* Alias: enjoy-by * Default: null -* Type: Date +* Type: null or Date -If passed to `npm install`, will rebuild the npm tree such that only versions -that were available **on or before** the `--before` time get installed. -If there's no versions available for the current set of direct dependencies, the -command will error. +If passed to `npm install`, will rebuild the npm tree such that only +versions that were available **on or before** the `--before` time get +installed. If there's no versions available for the current set of direct +dependencies, the command will error. If the requested version is a `dist-tag` and the given tag does not pass the -`--before` filter, the most recent version less than or equal to that tag will -be used. For example, `foo@latest` might install `foo@1.2` even though `latest` -is `2.0`. +`--before` filter, the most recent version less than or equal to that tag +will be used. For example, `foo@latest` might install `foo@1.2` even though +`latest` is `2.0`. -#### bin-links +#### `bin-links` -* Default: `true` +* 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. +Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems. -#### browser +#### `browser` * Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"` -* Type: String or Boolean +* Type: null, Boolean, or String The browser that is called by npm commands to open websites. @@ -214,87 +229,50 @@ terminal. Set to `true` to use default system URL opener. -#### ca +#### `ca` -* Default: The npm CA certificate -* Type: String, Array or null +* Default: null +* Type: null or String (can be set multiple times) The Certificate Authority signing certificate that is trusted for SSL -connections to the registry. Values should be in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with newlines -replaced by the string "\n". For example: +connections to the registry. Values should be in PEM format (Windows calls +it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string +"\n". For example: -```bash +```ini ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----" ``` -Set to `null` to only allow "known" registrars, or to a specific CA cert -to trust only that specific signing authority. +Set to `null` to only allow "known" registrars, or to a specific CA cert to +trust only that specific signing authority. Multiple CAs can be trusted by specifying an array of certificates: -```bash +```ini ca[]="..." ca[]="..." ``` See also the `strict-ssl` config. -#### cafile - -* Default: `null` -* Type: path - -A path to a file containing one or multiple Certificate Authority signing -certificates. Similar to the `ca` setting, but allows for multiple CA's, as -well as for the CA information to be stored in a file on disk. - -#### cache - -* Default: Windows: `%AppData%\npm-cache`, Posix: `~/.npm` -* Type: path - -The location of npm's cache directory. See [`npm cache`](/commands/npm-cache) - -#### cache-lock-stale - -* Default: 60000 (1 minute) -* Type: Number - -The number of ms before cache folder lockfiles are considered stale. - -#### cache-lock-retries - -* Default: 10 -* Type: Number +#### `cache` -Number of times to retry to acquire a lock on cache folder lockfiles. +* Default: Windows: `%LocalAppData%\npm-cache`, Posix: `~/.npm` +* Type: Path -#### cache-lock-wait +The location of npm's cache directory. See [`npm +cache`](/commands/npm-cache) -* Default: 10000 (10 seconds) -* Type: Number +#### `cafile` -Number of ms to wait for cache lock files to expire. - -#### cache-max - -* Default: Infinity -* Type: Number - -**DEPRECATED**: This option has been deprecated in favor of `--prefer-online`. - -`--cache-max=0` is an alias for `--prefer-online`. - -#### cache-min - -* Default: 10 -* Type: Number - -**DEPRECATED**: This option has been deprecated in favor of `--prefer-offline`. +* Default: null +* Type: Path -`--cache-min=9999 (or bigger)` is an alias for `--prefer-offline`. +A path to a file containing one or multiple Certificate Authority signing +certificates. Similar to the `ca` setting, but allows for multiple CA's, as +well as for the CA information to be stored in a file on disk. -#### call +#### `call` * Default: "" * Type: String @@ -306,154 +284,206 @@ custom command to be run along with the installed packages. npm exec --package yo --package generator-node --call "yo node" ``` -#### cert -* Default: `null` -* Type: String +#### `cert` + +* Default: null +* Type: null or String -A client certificate to pass when accessing the registry. Values should be in -PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string "\n". For example: +A client certificate to pass when accessing the registry. Values should be +in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with +newlines replaced by the string "\n". For example: -```bash +```ini cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----" ``` -It is _not_ the path to a certificate file (and there is no "certfile" option). +It is _not_ the path to a certificate file (and there is no "certfile" +option). -#### cidr +#### `ci-name` -* Default: `null` -* Type: String, Array, null +* Default: The name of the current CI system, or `null` when not on a known CI + platform. +* Type: null or String -This is a list of CIDR address to be used when configuring limited access tokens with the `npm token create` command. +The name of a continuous integration system. If not set explicitly, npm will +detect the current CI environment using the +[`@npmcli/ci-detect`](http://npm.im/@npmcli/ci-detect) module. -#### commit-hooks +#### `cidr` -* Default: `true` -* Type: Boolean +* Default: null +* Type: null or String (can be set multiple times) -Run git commit hooks when using the `npm version` command. +This is a list of CIDR address to be used when configuring limited access +tokens with the `npm token create` command. -#### color +#### `color` -* Default: true -* Type: Boolean or `"always"` +* Default: true unless the NO_COLOR environ is set to something other than '0' +* Type: "always" or Boolean -If false, never shows colors. If `"always"` then always shows colors. -If true, then only prints color codes for tty file descriptors. +If false, never shows colors. If `"always"` then always shows colors. If +true, then only prints color codes for tty file descriptors. -This option can also be changed using the environment: colors are -disabled when the environment variable `NO_COLOR` is set to any value. +#### `commit-hooks` -#### depth +* Default: true +* Type: Boolean -* Default: null +Run git commit hooks when using the `npm version` command. + +#### `depth` + +* Default: `Infinity` if `--all` is set, otherwise `1` * Type: null or Number The depth to go when recursing packages for `npm ls`. -To make this default to `Infinity` instead of `null`, set `--all`. +If not set, `npm ls` will show only the immediate dependencies of the root +project. If `--all` is set, then npm will show all dependencies by default. -#### description +#### `description` * Default: true * Type: Boolean Show the description in `npm search` -#### dev +#### `diff` + +* Default: +* Type: String (can be set multiple times) + +Define arguments to compare in `npm diff`. + +#### `diff-dst-prefix` + +* Default: "b/" +* Type: String + +Destination prefix to be used in `npm diff` output. + +#### `diff-ignore-all-space` * Default: false * Type: Boolean -\[Deprecated\] Install `dev-dependencies` along with packages. +Ignore whitespace when comparing lines in `npm diff`. -#### dry-run +#### `diff-name-only` * 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`. This is NOT currently honored by some network related -commands, eg `dist-tags`, `owner`, etc. +Prints only filenames when using `npm diff`. -#### diff +#### `diff-no-prefix` -* Default: null -* Type: String, Array, null +* Default: false +* Type: Boolean -Define arguments to compare in `npm diff`. +Do not show any source or destination prefix in `npm diff` output. + +Note: this causes `npm diff` to ignore the `--diff-src-prefix` and +`--diff-dst-prefix` configs. + +#### `diff-src-prefix` + +* Default: "a/" +* Type: String + +Source prefix to be used in `npm diff` output. -#### diff-name-only +#### `diff-text` * Default: false * Type: Boolean -Prints only filenames when using `npm diff`. +Treat all files as text in `npm diff`. -#### diff-unified +#### `diff-unified` -* Type: number -* Default: `3` +* Default: 3 +* Type: Number The number of lines of context to print in `npm diff`. -#### diff-ignore-all-space +#### `dry-run` -* Type: Boolean * Default: false +* Type: Boolean -Ignore whitespace when comparing lines in `npm diff. +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`. -#### diff-no-prefix +Note: This is NOT honored by other network related commands, eg `dist-tags`, +`owner`, etc. + +#### `editor` + +* Default: The EDITOR or VISUAL environment variables, or 'notepad.exe' on + Windows, or 'vim' on Unix systems +* Type: String + +The command to run for `npm edit` and `npm config edit`. + +#### `engine-strict` -* Type: Boolean * Default: false +* Type: Boolean -Do not show any source or destination prefix in `npm diff` output. +If set to true, then npm will stubbornly refuse to install (or even consider +installing) any package that claims to not be compatible with the current +Node.js version. -#### diff-src-prefix +This can be overridden by setting the `--force` flag. -* Type: String -* Default: `"a/"` +#### `fetch-retries` -Source prefix to be used in `npm diff` output. +* Default: 2 +* Type: Number -#### diff-dst-prefix +The "retries" config for the `retry` module to use when fetching packages +from the registry. -* Type: String -* Default: `"b/"` +npm will retry idempotent read requests to the registry in the case of +network failures or 5xx HTTP errors. -Destination prefix to be used in `npm diff` output. +#### `fetch-retry-factor` -#### diff-text +* Default: 10 +* Type: Number -* Alias: `-a` -* Type: Boolean -* Default: false +The "factor" config for the `retry` module to use when fetching packages. -Treat all files as text in `npm diff`. +#### `fetch-retry-maxtimeout` -#### editor +* Default: 60000 (1 minute) +* Type: Number -* Default: `EDITOR` environment variable if set, or `"vi"` on Posix, - or `"notepad"` on Windows. -* Type: path +The "maxTimeout" config for the `retry` module to use when fetching +packages. -The command to run for `npm edit` or `npm config edit`. +#### `fetch-retry-mintimeout` -#### engine-strict +* Default: 10000 (10 seconds) +* Type: Number -* Default: false -* Type: Boolean +The "minTimeout" config for the `retry` module to use when fetching +packages. + +#### `fetch-timeout` -If set to true, then npm will stubbornly refuse to install (or even -consider installing) any package that claims to not be compatible with -the current Node.js version. +* Default: 300000 (5 minutes) +* Type: Number + +The maximum amount of time to wait for HTTP requests to complete. -#### force +#### `force` * Default: false * Type: Boolean @@ -467,17 +497,16 @@ mistakes, unnecessary performance degradation, and malicious input. * Allow installing packages that have an `engines` declaration requiring a different version of npm. * Allow installing packages that have an `engines` declaration requiring a - different version of `node`, even if `--engines-strict` is enabled. + different version of `node`, even if `--engine-strict` is enabled. * Allow `npm audit fix` to install modules outside your stated dependency range (including SemVer-major changes). -* Allow a module to be installed as a direct dependency of itself. * Allow unpublishing all versions of a published package. * Allow conflicting peerDependencies to be installed in the root project. If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! -#### foreground-scripts +#### `foreground-scripts` * Default: false * Type: Boolean @@ -486,249 +515,217 @@ Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process. -Note that this will generally make installs run slower, and be much -noisier, but can be useful for debugging. +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. -#### format-package-lock +#### `format-package-lock` * Default: true * Type: Boolean -Format `package-lock.json` or `npm-shrinkwrap.json` as a human readable file. +Format `package-lock.json` or `npm-shrinkwrap.json` as a human readable +file. -#### fund +#### `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. +acknowledging the number of dependencies looking for funding. See [`npm +fund`](/commands/npm-fund) for details. -#### fetch-retries +#### `git` -* Default: 2 -* Type: Number - -The "retries" config for the `retry` module to use when fetching -packages from the registry. - -#### fetch-retry-factor - -* Default: 10 -* Type: Number - -The "factor" config for the `retry` module to use when fetching -packages. - -#### fetch-retry-mintimeout - -* Default: 10000 (10 seconds) -* Type: Number - -The "minTimeout" config for the `retry` module to use when fetching -packages. - -#### fetch-retry-maxtimeout - -* Default: 60000 (1 minute) -* Type: Number - -The "maxTimeout" config for the `retry` module to use when fetching -packages. - -#### fetch-timeout - -* Default: 300000 (5 minutes) -* Type: Number - -The maximum amount of time to wait for HTTP requests to complete. - -#### git - -* Default: `"git"` +* Default: "git" * Type: String -The command to use for git commands. If git is installed on the -computer, but is not in the `PATH`, then set this to the full path to -the git binary. +The command to use for git commands. If git is installed on the computer, +but is not in the `PATH`, then set this to the full path to the git binary. -#### git-tag-version +#### `git-tag-version` -* Default: `true` +* Default: true * Type: Boolean Tag the commit when using the `npm version` command. -#### global +#### `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 +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. +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` -#### globalconfig - -* Default: {prefix}/etc/npmrc -* Type: path - -The config file to read for global config options. - -#### global-style +#### `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 +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. +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. + +#### `globalconfig` + +* Default: The global --prefix setting plus 'etc/npmrc'. For example, + '/usr/local/etc/npmrc' +* Type: Path -#### heading +The config file to read for global config options. + +#### `heading` -* Default: `"npm"` +* Default: "npm" * Type: String The string that starts all the debugging log output. -#### https-proxy +#### `https-proxy` * Default: null -* Type: url +* Type: null or URL A proxy to use for outgoing https requests. If the `HTTPS_PROXY` or `https_proxy` or `HTTP_PROXY` or `http_proxy` environment variables are set, -proxy settings will be honored by the underlying `request` library. +proxy settings will be honored by the underlying `make-fetch-happen` +library. -#### if-present +#### `if-present` * Default: false * Type: Boolean -If true, npm will not exit with an error code when `run-script` is invoked for -a script that isn't defined in the `scripts` section of `package.json`. This -option can be used when it's desirable to optionally run a script when it's -present and fail if the script fails. This is useful, for example, when running -scripts that may only apply for some builds in an otherwise generic CI setup. +If true, npm will not exit with an error code when `run-script` is invoked +for a script that isn't defined in the `scripts` section of `package.json`. +This option can be used when it's desirable to optionally run a script when +it's present and fail if the script fails. This is useful, for example, when +running scripts that may only apply for some builds in an otherwise generic +CI setup. -#### ignore-prepublish +#### `ignore-scripts` * Default: false * Type: Boolean -If true, npm will not run `prepublish` scripts. +If true, npm does not run scripts specified in package.json files. -#### ignore-scripts +#### `include` -* Default: false -* Type: Boolean +* Default: +* Type: "prod", "dev", "optional", or "peer" (can be set multiple times) -If true, npm does not run scripts specified in package.json files. +Option that allows for defining which types of dependencies to install. -#### include +This is the inverse of `--omit=`. -* Default: `[prod|dev|optional|peer]` -* Type: Array +Dependency types specified in `--include` will not be omitted, regardless of +the order in which omit/include are specified on the command-line. -Option that allows for defining which types of dependencies to install. +#### `include-staged` -#### init-module +* Default: false +* Type: Boolean -* Alias: `init.module` -* Default: ~/.npm-init.js -* Type: path +Allow installing "staged" published packages, as defined by [npm RFC PR +#92](https://github.com/npm/rfcs/pull/92). -A module that will be loaded by the `npm init` command. See the -documentation for the -[init-package-json](https://github.com/npm/init-package-json) module -for more information, or [npm init](/commands/npm-init). +This is experimental, and not implemented by the npm public registry. -#### init-author-name +#### `init-author-email` -* Alias: `init.author.name` * Default: "" * Type: String -The value `npm init` should use by default for the package author's name. +The value `npm init` should use by default for the package author's email. -#### init-author-email +#### `init-author-name` -* Alias: `init.author.email` * Default: "" * Type: String -The value `npm init` should use by default for the package author's email. +The value `npm init` should use by default for the package author's name. -#### init-author-url +#### `init-author-url` -* Alias: `init.author.url` * Default: "" -* Type: String +* Type: "" or URL -The value `npm init` should use by default for the package author's homepage. +The value `npm init` should use by default for the package author's +homepage. -#### init-license +#### `init-license` -* Alias: `init.license` * Default: "ISC" * Type: String The value `npm init` should use by default for the package license. -#### init-version +#### `init-module` + +* Default: "~/.npm-init.js" +* Type: Path + +A module that will be loaded by the `npm init` command. See the +documentation for the +[init-package-json](https://github.com/npm/init-package-json) module for +more information, or [npm init](/commands/npm-init). + +#### `init-version` -* Alias: `init.version` * Default: "1.0.0" -* Type: semver +* Type: SemVer string -The value that `npm init` should use by default for the package -version number, if not already set in package.json. +The value that `npm init` should use by default for the package version +number, if not already set in package.json. -#### json +#### `json` * Default: false * Type: Boolean Whether or not to output JSON data, rather than the normal output. -This feature is currently experimental, and the output data structures for many -commands is either not implemented in JSON yet, or subject to change. Only the -output from `npm ls --json` and `npm search --json` are currently valid. +This feature is currently experimental, and the output data structures for +many commands is either not implemented in JSON yet, or subject to change. +Only the output from `npm ls --json` and `npm search --json` are currently +valid. -#### key +#### `key` -* Default: `null` -* Type: String +* Default: null +* Type: null or String -A client key to pass when accessing the registry. Values should be in PEM +A client key to pass when accessing the registry. Values should be in PEM format with newlines replaced by the string "\n". For example: -```json +```ini key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----" ``` It is _not_ the path to a key file (and there is no "keyfile" option). -#### legacy-bundling +#### `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 +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. -#### legacy-peer-deps +#### `legacy-peer-deps` * Default: false * Type: Boolean @@ -736,9 +733,8 @@ will be preferred. Causes npm to completely ignore `peerDependencies` when building a package tree, as in npm versions 3 through 6. -If a package cannot be installed because of overly strict -`peerDependencies` that collide, it provides a way to move forward -resolving the situation. +If a package cannot be installed because of overly strict `peerDependencies` +that collide, it provides a way to move forward resolving the situation. This differs from `--omit=peer`, in that `--omit=peer` will avoid unpacking `peerDependencies` on disk, but will still design a tree such that @@ -747,7 +743,7 @@ This differs from `--omit=peer`, in that `--omit=peer` will avoid unpacking Use of `legacy-peer-deps` is not recommended, as it will not enforce the `peerDependencies` contract that meta-dependencies may rely on. -#### link +#### `link` * Default: false * Type: Boolean @@ -755,57 +751,57 @@ Use of `legacy-peer-deps` is not recommended, as it will not enforce the If true, then local installs will link if there is a suitable globally installed package. -Note that this means that local installs can cause things to be -installed into the global space at the same time. The link is only done -if one of the two conditions are met: +Note that this means that local installs can cause things to be installed +into the global space at the same time. The link is only done if one of the +two conditions are met: * The package is not already installed globally, or -* the globally installed version is identical to the version that is - being installed locally. +* the globally installed version is identical to the version that is being + installed locally. -#### local-address +#### `local-address` -* Default: undefined +* Default: null * Type: IP Address -The IP address of the local interface to use when making connections -to the npm registry. Must be IPv4 in versions of Node prior to 0.12. +The IP address of the local interface to use when making connections to the +npm registry. Must be IPv4 in versions of Node prior to 0.12. -#### loglevel +#### `loglevel` * Default: "notice" -* Type: String -* Values: "silent", "error", "warn", "notice", "http", "timing", "info", - "verbose", "silly" +* Type: "silent", "error", "warn", "notice", "http", "timing", "info", + "verbose", or "silly" -What level of logs to report. On failure, *all* logs are written to +What level of logs to report. On failure, *all* logs are written to `npm-debug.log` in the current working directory. -Any logs of a higher level than the setting are shown. The default is "notice". +Any logs of a higher level than the setting are shown. The default is +"notice". -#### logs-max +#### `logs-max` * Default: 10 * Type: Number The maximum number of log files to store. -#### long +#### `long` * Default: false * Type: Boolean Show extended information in `npm ls` and `npm search`. -#### maxsockets +#### `maxsockets` -* Default: 50 +* Default: Infinity * Type: Number The maximum number of connections to use per origin (protocol/host/port -combination). Passed to the `http` `Agent` used to make the request. +combination). -#### message +#### `message` * Default: "%s" * Type: String @@ -814,73 +810,83 @@ Commit message which is used by `npm version` when creating version commit. Any "%s" in the message will be replaced with the version number. -#### node-options +#### `node-options` * Default: null -* Type: String +* Type: null or String Options to pass through to Node.js via the `NODE_OPTIONS` environment -variable. This does not impact how npm itself is executed but it does -impact how lifecycle scripts are called. +variable. This does not impact how npm itself is executed but it does impact +how lifecycle scripts are called. -#### node-version +#### `node-version` -* Default: process.version -* Type: semver or false +* Default: Node.js `process.version` value +* Type: SemVer string -The node version to use when checking a package's `engines` map. +The node version to use when checking a package's `engines` setting. -#### noproxy +#### `noproxy` -* Default: null -* Type: String or Array +* Default: The value of the NO_PROXY environment variable +* Type: String (can be set multiple times) -A comma-separated string or an array of domain extensions that a proxy should not be used for. +Domain extensions that should bypass any proxies. -#### offline +Also accepts a comma-delimited string. -* Default: false -* Type: Boolean +#### `npm-version` -Force offline mode: no network requests will be done during install. To allow -the CLI to fill in missing cache data, see `--prefer-offline`. +* Default: Output of `npm --version` +* Type: SemVer string -#### only +The npm version to use when checking a package's `engines` setting. -* Default: null -* Type: String +#### `offline` -When "dev" or "development" and running local `npm install` without any -arguments, only devDependencies (and their dependencies) are installed. +* Default: false +* Type: Boolean -When "dev" or "development" and running local `npm ls`, `npm outdated`, or -`npm update`, is an alias for `--dev`. +Force offline mode: no network requests will be done during install. To +allow the CLI to fill in missing cache data, see `--prefer-offline`. -When "prod" or "production" and running local `npm install` without any -arguments, only non-devDependencies (and their dependencies) are -installed. +#### `omit` -When "prod" or "production" and running local `npm ls`, `npm outdated`, or -`npm update`, is an alias for `--production`. +* Default: 'dev' if the NODE_ENV environment variable is set to 'production', + otherwise empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) -#### optional +Dependency types to omit from the installation tree on disk. -* Default: true -* Type: Boolean +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. -Attempt to install packages in the `optionalDependencies` object. Note -that if these packages fail to install, the overall installation -process is not aborted. +If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment +variable will be set to `'production'` for all lifecycle scripts. -#### otp +#### `otp` * Default: null -* Type: Number +* Type: null or String -This is a one-time password from a two-factor authenticator. It's needed +This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with `npm access`. -#### package-lock +If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one. + +#### `package` + +* Default: +* Type: String (can be set multiple times) + +The package to install for [`npm exec`](/commands/npm-exec) + +#### `package-lock` * Default: true * Type: Boolean @@ -889,75 +895,63 @@ If set to false, then ignore `package-lock.json` files when installing. This will also prevent _writing_ `package-lock.json` if `save` is true. When package package-locks are disabled, automatic pruning of extraneous -modules will also be disabled. To remove extraneous modules with +modules will also be disabled. To remove extraneous modules with package-locks disabled use `npm prune`. -This option is an alias for `--shrinkwrap`. - -#### package-lock-only +#### `package-lock-only` * Default: false * Type: Boolean -If set to true, it will update only the `package-lock.json`, -instead of checking `node_modules` and downloading dependencies. +If set to true, it will update only the `package-lock.json`, instead of +checking `node_modules` and downloading dependencies. -#### parseable +#### `parseable` * Default: false * Type: Boolean -Output parseable results from commands that write to -standard output. For `npm search`, this will be tab-separated table format. +Output parseable results from commands that write to standard output. For +`npm search`, this will be tab-separated table format. -#### prefer-offline +#### `prefer-offline` * Default: false * Type: Boolean If true, staleness checks for cached data will be bypassed, but missing data -will be requested from the server. To force full offline mode, use `--offline`. - -This option is effectively equivalent to `--cache-min=9999999`. +will be requested from the server. To force full offline mode, use +`--offline`. -#### prefer-online +#### `prefer-online` * Default: false * Type: Boolean -If true, staleness checks for cached data will be forced, making the CLI look -for updates immediately even for fresh package data. +If true, staleness checks for cached data will be forced, making the CLI +look for updates immediately even for fresh package data. -#### prefix +#### `prefix` -* Default: see [folders](/configuring-npm/folders) -* Type: path +* Default: In global mode, the folder where the node executable is installed. + In local mode, the nearest parent folder containing either a package.json + file or a node_modules folder. +* Type: Path -The location to install global items. If set on the command line, then -it forces non-global commands to run in the specified folder. +The location to install global items. If set on the command line, then it +forces non-global commands to run in the specified folder. -#### preid +#### `preid` * Default: "" * Type: String -The "prerelease identifier" to use as a prefix for the "prerelease" part of a -semver. Like the `rc` in `1.2.0-rc.8`. +The "prerelease identifier" to use as a prefix for the "prerelease" part of +a semver. Like the `rc` in `1.2.0-rc.8`. -#### production +#### `progress` -* Default: false -* Type: Boolean - -Set to true to run in "production" mode. - -1. devDependencies are not installed at the topmost level when running - local `npm install` without any arguments. -2. Set the NODE_ENV="production" for lifecycle scripts. - -#### progress - -* Default: true, unless TRAVIS or CI env vars set. +* Default: `true` unless running in a known CI system * Type: Boolean When set to `true`, npm will display a progress bar during time intensive @@ -965,56 +959,48 @@ operations, if `process.stderr` is a TTY. Set to `false` to suppress the progress bar. -#### proxy +#### `proxy` * Default: null -* Type: url +* Type: null, false, or URL A proxy to use for outgoing http requests. If the `HTTP_PROXY` or -`http_proxy` environment variables are set, proxy settings will be -honored by the underlying `request` library. +`http_proxy` environment variables are set, proxy settings will be honored +by the underlying `request` library. -#### read-only +#### `read-only` * Default: false * Type: Boolean -This is used to mark a token as unable to publish when configuring limited access tokens with the `npm token create` command. +This is used to mark a token as unable to publish when configuring limited +access tokens with the `npm token create` command. -#### rebuild-bundle +#### `rebuild-bundle` * Default: true * Type: Boolean Rebuild bundled dependencies after installation. -#### registry +#### `registry` -* Default: https://registry.npmjs.org/ -* Type: url +* Default: "https://registry.npmjs.org/" +* Type: URL -The base URL of the npm package registry. +The base URL of the npm registry. -#### rollback - -* Default: true -* Type: Boolean - -Remove failed installs. - -#### save +#### `save` * Default: true * Type: Boolean Save installed packages to a package.json file as dependencies. -When used with the `npm rm` command, it removes it from the `dependencies` -object. - -Only works if there is already a package.json file present. +When used with the `npm rm` command, removes the dependency from +package.json. -#### save-bundle +#### `save-bundle` * Default: false * Type: Boolean @@ -1023,120 +1009,94 @@ If a package would be saved at install time by the use of `--save`, `--save-dev`, or `--save-optional`, then also put it in the `bundleDependencies` list. -When used with the `npm rm` command, it removes it from the -bundledDependencies list. +Ignore if `--save-peer` is set, since peerDependencies cannot be bundled. -#### save-prod +#### `save-dev` * Default: false * Type: Boolean -Makes sure that a package will be saved into `dependencies` specifically. This -is useful if a package already exists in `devDependencies` or -`optionalDependencies`, but you want to move it to be a production dep. This is -also the default behavior if `--save` is true, and neither `--save-dev` or -`--save-optional` are true. +Save installed packages to a package.json file as `devDependencies`. -#### save-dev +#### `save-exact` * Default: false * Type: Boolean -Save installed packages to a package.json file as `devDependencies`. - -When used with the `npm rm` command, it removes it from the -`devDependencies` object. - -Only works if there is already a package.json file present. +Dependencies saved to package.json will be configured with an exact version +rather than using npm's default semver range operator. -#### save-exact +#### `save-optional` * Default: false * Type: Boolean -Dependencies saved to package.json using `--save`, `--save-dev` or -`--save-optional` will be configured with an exact version rather than -using npm's default semver range operator. +Save installed packages to a package.json file as `optionalDependencies`. -#### save-optional +#### `save-peer` * Default: false * Type: Boolean -Save installed packages to a package.json file as -optionalDependencies. +Save installed packages. to a package.json file as `peerDependencies` -When used with the `npm rm` command, it removes it from the -`devDependencies` object. +#### `save-prefix` -Only works if there is already a package.json file present. - -#### save-prefix - -* Default: '^' +* Default: "^" * Type: String Configure how versions of packages installed to a package.json file via `--save` or `--save-dev` get prefixed. -For example if a package has version `1.2.3`, by default its version is -set to `^1.2.3` which allows minor upgrades for that package, but after -`npm config set save-prefix='~'` it would be set to `~1.2.3` which only allows +For example if a package has version `1.2.3`, by default its version is set +to `^1.2.3` which allows minor upgrades for that package, but after `npm +config set save-prefix='~'` it would be set to `~1.2.3` which only allows patch upgrades. -#### scope - -* Default: the scope of the current project, if any, or "" -* Type: String +#### `save-prod` -Associate an operation with a scope for a scoped registry. Useful when logging -in to a private registry for the first time: -`npm login --scope=@organization --registry=registry.organization.com`, which -will cause `@organization` to be mapped to the registry for future installation -of packages specified according to the pattern `@organization/package`. - -#### script-shell +* Default: false +* Type: Boolean -* Default: `null` -* Type: path +Save installed packages into `dependencies` specifically. This is useful if +a package already exists in `devDependencies` or `optionalDependencies`, but +you want to move it to be a non-optional production dependency. -The shell to use for scripts run with the `npm run` command. +This is the default behavior if `--save` is true, and neither `--save-dev` +or `--save-optional` are true. -#### scripts-prepend-node-path +#### `scope` -* Default: "warn-only" -* Type: Boolean, `"auto"` or `"warn-only"` +* Default: the scope of the current project, if any, or "" +* Type: String -If set to `true`, add the directory in which the current `node` executable -resides to the `PATH` environment variable when running scripts, -even if that means that `npm` will invoke a different `node` executable than -the one which it is running. +Associate an operation with a scope for a scoped registry. -If set to `false`, never modify `PATH` with that. +Useful when logging in to a private registry for the first time: -If set to `"warn-only"`, never modify `PATH` but print a warning if `npm` thinks -that you may want to run it with `true`, e.g. because the `node` executable -in the `PATH` is not the one `npm` was invoked with. +```bash +npm login --scope=@mycorp --registry=https://registry.mycorp.com +``` -If set to `auto`, only add that directory to the `PATH` environment variable -if the `node` executable with which `npm` was invoked and the one that is found -first on the `PATH` are different. +This will cause `@mycorp` to be mapped to the registry for future +installation of packages specified according to the pattern +`@mycorp/package`. -#### searchexclude +#### `script-shell` -* Default: "" -* Type: String +* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows +* Type: null or String -Space-separated options that limit the results from search. +The shell to use for scripts run with the `npm run` command. -#### searchopts +#### `searchexclude` * Default: "" * Type: String -Space-separated options that are always passed to search. +Space-separated options that limit the results from search. -#### searchlimit +#### `searchlimit` * Default: 20 * Type: Number @@ -1144,33 +1104,30 @@ Space-separated options that are always passed to search. Number of items to limit search results to. Will not apply at all to legacy searches. -#### searchstaleness +#### `searchopts` + +* Default: "" +* Type: String + +Space-separated options that are always passed to search. + +#### `searchstaleness` -* Default: 900 (15 minutes) +* Default: 900 * Type: Number The age of the cache, in seconds, before another registry request is made if using legacy search endpoint. -#### shell +#### `shell` -* Default: SHELL environment variable, or "bash" on Posix, or "cmd" on +* Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on Windows -* Type: path +* Type: String The shell to run for the `npm explore` command. -#### shrinkwrap - -* Default: true -* Type: Boolean - -If set to false, then ignore `npm-shrinkwrap.json` files when installing. This -will also prevent _writing_ `npm-shrinkwrap.json` if `save` is true. - -This option is an alias for `--package-lock`. - -#### sign-git-commit +#### `sign-git-commit` * Default: false * Type: Boolean @@ -1178,36 +1135,21 @@ This option is an alias for `--package-lock`. If set to true, then the `npm version` command will commit the new package version using `-S` to add a signature. -Note that git requires you to have set up GPG keys in your git configs -for this to work properly. +Note that git requires you to have set up GPG keys in your git configs for +this to work properly. -#### sign-git-tag +#### `sign-git-tag` * Default: false * Type: Boolean -If set to true, then the `npm version` command will tag the version -using `-s` to add a signature. +If set to true, then the `npm version` command will tag the version using +`-s` to add a signature. -Note that git requires you to have set up GPG keys in your git configs -for this to work properly. - -#### sso-poll-frequency - -* Default: 500 -* Type: Number - -When used with SSO-enabled `auth-type`s, configures how regularly the registry -should be polled while the user is completing authentication. - -#### sso-type - -* Default: 'oauth' -* Type: 'oauth', 'saml', or null - -If `--auth-type=sso`, the type of SSO type to use. +Note that git requires you to have set up GPG keys in your git configs for +this to work properly. -#### strict-peer-deps +#### `strict-peer-deps` * Default: false * Type: Boolean @@ -1217,145 +1159,345 @@ 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` 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 the warning is -treated as a failure. +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. -#### strict-ssl +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. + +#### `strict-ssl` * Default: true * Type: Boolean -Whether or not to do SSL key validation when making requests to the -registry via https. +Whether or not to do SSL key validation when making requests to the registry +via https. See also the `ca` config. -#### tag +#### `tag` -* Default: latest +* Default: "latest" * Type: String -If you ask npm to install a package and don't tell it a specific version, then -it will install the specified tag. +If you ask npm to install a package and don't tell it a specific version, +then it will install the specified tag. -Also the tag that is added to the package@version specified by the `npm -tag` command, if no explicit tag is given. +Also the tag that is added to the package@version specified by the `npm tag` +command, if no explicit tag is given. -#### tag-version-prefix +#### `tag-version-prefix` -* Default: `"v"` +* Default: "v" * Type: String If set, alters the prefix used when tagging a new version when performing a -version increment using `npm-version`. To remove the prefix altogether, set it -to the empty string: `""`. +version increment using `npm-version`. To remove the prefix altogether, set +it to the empty string: `""`. -Because other tools may rely on the convention that npm version tags look like -`v1.0.0`, _only use this property if it is absolutely necessary_. In +Because other tools may rely on the convention that npm version tags look +like `v1.0.0`, _only use this property if it is absolutely necessary_. In particular, use care when overriding this setting for public packages. -#### timing +#### `timing` -* Default: `false` +* Default: false * Type: Boolean If true, writes an `npm-debug` log to `_logs` and timing information to -`_timing.json`, both in your cache. `_timing.json` is a newline delimited -list of JSON objects. You can quickly view it with this -[json](https://www.npmjs.com/package/json) command line: -`json -g < ~/.npm/_timing.json`. +`_timing.json`, both in your cache, even if the command completes +successfully. `_timing.json` is a newline delimited list of JSON objects. + +You can quickly view it with this [json](https://npm.im/json) command line: +`npm exec -- json -g < ~/.npm/_timing.json`. + +#### `umask` + +* Default: 0 +* Type: Octal numeric string in range 0000..0777 (0..511) -#### tmp +The "umask" value to use when setting the file creation mode on files and +folders. -* Default: TMPDIR environment variable, or "/tmp" -* Type: path +Folders and executables are given a mode which is `0o777` masked against +this value. Other files are given a mode which is `0o666` masked against +this value. -Where to store temporary files and folders. All temp files are deleted -on success, but left behind on failure for forensic purposes. +Note that the underlying system will _also_ apply its own umask value to +files and folders that are created, and npm does not circumvent this, but +rather adds the `--umask` config to it. -#### unicode +Thus, the effective default umask value on most POSIX systems is 0o22, +meaning that folders and executables are created with a mode of 0o755 and +other files are created with a mode of 0o644. -* Default: false on windows, true on mac/unix systems with a unicode locale +#### `unicode` + +* Default: false on windows, true on mac/unix systems with a unicode locale, + as defined by the LC_ALL, LC_CTYPE, or LANG environment variables. * Type: Boolean -When set to true, npm uses unicode characters in the tree output. When -false, it uses ascii characters to draw trees. +When set to true, npm uses unicode characters in the tree output. When +false, it uses ascii characters instead of unicode glyphs. -#### update-notifier +#### `update-notifier` * Default: true * Type: Boolean -Set to false to suppress the update notification when using an older -version of npm than the latest. +Set to false to suppress the update notification when using an older version +of npm than the latest. -#### usage +#### `usage` * Default: false * Type: Boolean -Set to show short usage output (like the -H output) -instead of complete help when doing [`npm help`](/commands/npm-help). - -#### userconfig - -* Default: ~/.npmrc -* Type: path +Show short usage output about the command specified. -The location of user-level configuration settings. +#### `user-agent` -#### umask +* Default: "npm/{npm-version} node/{node-version} {platform} {arch} {ci}" +* Type: String -* Default: 022 -* Type: Octal numeric string in range 0000..0777 (0..511) +Sets the User-Agent request header. The following fields are replaced with +their actual counterparts: -The "umask" value to use when setting the file creation mode on files -and folders. +* `{npm-version}` - The npm version in use +* `{node-version}` - The Node.js version in use +* `{platform}` - The value of `process.platform` +* `{arch}` - The value of `process.arch` +* `{ci}` - The value of the `ci-name` config, if set, prefixed with `ci/`, or + an empty string if `ci-name` is empty. -Folders and executables are given a mode which is `0777` masked against -this value. Other files are given a mode which is `0666` masked against -this value. Thus, the defaults are `0755` and `0644` respectively. +#### `userconfig` -#### user-agent +* Default: "~/.npmrc" +* Type: Path -* Default: node/{process.version} {process.platform} {process.arch} -* Type: String +The location of user-level configuration settings. -Sets a User-Agent to the request header +This may be overridden by the `npm_config_userconfig` environment variable +or the `--userconfig` command line option, but may _not_ be overridden by +settings in the `globalconfig` file. -#### version +#### `version` * Default: false -* Type: boolean +* Type: Boolean If true, output the npm version and exit successfully. Only relevant when specified explicitly on the command line. -#### versions +#### `versions` * Default: false -* Type: boolean +* Type: Boolean -If true, output the npm version as well as node's `process.versions` map, and -exit successfully. +If true, output the npm version as well as node's `process.versions` map and +the version in the current working directory's `package.json` file if one +exists, and exit successfully. Only relevant when specified explicitly on the command line. -#### viewer +#### `viewer` * Default: "man" on Posix, "browser" on Windows -* Type: path +* Type: String The program to use to view help content. Set to `"browser"` to view html help content in the default web browser. +#### `which` + +* Default: null +* Type: null or Number + +If there are multiple funding sources, which 1-indexed source URL to open. + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: - Workspace names - Path +to a workspace directory - Path to a parent workspace directory (will result +to selecting all of the nested workspaces) + +#### `workspaces` + +* Default: false +* Type: Boolean + +Enable running a command in the context of **all** the configured +workspaces. + +#### `yes` + +* Default: null +* Type: null or Boolean + +Automatically answer "yes" to any prompts that npm might print on the +command line. + +#### `also` + +* Default: null +* Type: null, "dev", or "development" +* DEPRECATED: Please use --include=dev instead. + +When set to `dev` or `development`, this is an alias for `--include=dev`. + +#### `auth-type` + +* Default: "legacy" +* Type: "legacy", "sso", "saml", or "oauth" +* DEPRECATED: This method of SSO/SAML/OAuth is deprecated and will be removed + in a future version of npm in favor of web-based login. + +What authentication strategy to use with `adduser`/`login`. + +#### `cache-max` + +* Default: Infinity +* Type: Number +* DEPRECATED: This option has been deprecated in favor of `--prefer-online` + +`--cache-max=0` is an alias for `--prefer-online` + +#### `cache-min` + +* Default: 0 +* Type: Number +* DEPRECATED: This option has been deprecated in favor of `--prefer-offline`. + +`--cache-min=9999 (or bigger)` is an alias for `--prefer-offline`. + +#### `init.author.email` + +* Default: "" +* Type: String +* DEPRECATED: Use `--init-author-email` instead. + +Alias for `--init-author-email` + +#### `init.author.name` + +* Default: "" +* Type: String +* DEPRECATED: Use `--init-author-name` instead. + +Alias for `--init-author-name` + +#### `init.author.url` + +* Default: "" +* Type: "" or URL +* DEPRECATED: Use `--init-author-url` instead. + +Alias for `--init-author-url` + +#### `init.license` + +* Default: "ISC" +* Type: String +* DEPRECATED: Use `--init-license` instead. + +Alias for `--init-license` + +#### `init.module` + +* Default: "~/.npm-init.js" +* Type: Path +* DEPRECATED: Use `--init-module` instead. + +Alias for `--init-module` + +#### `init.version` + +* Default: "1.0.0" +* Type: SemVer string +* DEPRECATED: Use `--init-version` instead. + +Alias for `--init-version` + +#### `only` + +* Default: null +* Type: null, "prod", or "production" +* DEPRECATED: Use `--omit=dev` to omit dev dependencies from the install. + +When set to `prod` or `production`, this is an alias for `--omit=dev`. + +#### `optional` + +* Default: null +* Type: null or Boolean +* DEPRECATED: Use `--omit=optional` to exclude optional dependencies, or + `--include=optional` to include them. + +Default value does install optional deps unless otherwise omitted. + +Alias for --include=optional or --omit=optional + +#### `production` + +* Default: false +* Type: Boolean +* DEPRECATED: Use `--omit=dev` instead. + +Alias for `--omit=dev` + +#### `shrinkwrap` + +* Default: true +* Type: Boolean +* DEPRECATED: Use the --package-lock setting instead. + +Alias for --package-lock + +#### `sso-poll-frequency` + +* Default: 500 +* Type: Number +* DEPRECATED: The --auth-type method of SSO/SAML/OAuth will be removed in a + future version of npm in favor of web-based login. + +When used with SSO-enabled `auth-type`s, configures how regularly the +registry should be polled while the user is completing authentication. + +#### `sso-type` + +* Default: "oauth" +* Type: null, "oauth", or "saml" +* DEPRECATED: The --auth-type method of SSO/SAML/OAuth will be removed in a + future version of npm in favor of web-based login. + +If `--auth-type=sso`, the type of SSO type to use. + +#### `tmp` + +* Default: The value returned by the Node.js `os.tmpdir()` method + +* Type: Path +* DEPRECATED: This setting is no longer used. npm stores temporary files in a + special location in the cache, and they are managed by + [`cacache`](http://npm.im/cacache). + +Historically, the location where temporary files were stored. No longer +relevant. + + + ### See also * [npm config](/commands/npm-config) diff --git a/deps/npm/docs/content/using-npm/workspaces.md b/deps/npm/docs/content/using-npm/workspaces.md index 2024627c758679..28fccd2200c322 100644 --- a/deps/npm/docs/content/using-npm/workspaces.md +++ b/deps/npm/docs/content/using-npm/workspaces.md @@ -88,8 +88,54 @@ This demonstrates how the nature of `node_modules` resolution allows for in such a way that is also easy to [publish](/commands/npm-publish) these nested workspaces to be consumed elsewhere. +### Running commands in the context of workspaces + +You man use the `workspace` configuration option to run commands in the context +of a configured workspace. + +Following is a quick example on how to use the `npm run` command in the context +of nested workspaces. For a project containing multiple workspaces, e.g: + +``` +. ++-- package.json +`-- packages + +-- a + | `-- package.json + `-- b + `-- package.json +``` + +By running a command using the `workspace` option, it's possible to run the +given command in the context of that specific workspace. e.g: + +``` +npm run test --workspace=a +``` + +This will run the `test` script defined within the +`./packages/a/package.json` file. + +Please note that you can also specify this argument multiple times in the +command-line in order to target multiple workspaces, e.g: + +``` +npm run test --workspace=a --workspace=b +``` + +It's also possible to use the `workspaces` (plural) configuration option to +enable the same behavior but running that command in the context of **all** +configured workspaces. e.g: + +``` +npm run test --workspaces +``` + +Will run the `test` script in both `./packages/a` and `./packages/b`. + ### See also * [npm install](/commands/npm-install) * [npm publish](/commands/npm-publish) +* [npm run-script](/commands/npm-run-script) diff --git a/deps/npm/docs/output/commands/npm-adduser.html b/deps/npm/docs/output/commands/npm-adduser.html index 95f0cdaa7112ec..a079dfed71e291 100644 --- a/deps/npm/docs/output/commands/npm-adduser.html +++ b/deps/npm/docs/output/commands/npm-adduser.html @@ -149,6 +149,7 @@

Table of contents

aliases: login, add-user +

Note: This command is unaware of workspaces.

Description

Create or verify a user named <username> in the specified registry, and save the credentials to the .npmrc file. If no registry is specified, diff --git a/deps/npm/docs/output/commands/npm-bin.html b/deps/npm/docs/output/commands/npm-bin.html index 703c9e9243b358..614552025945a3 100644 --- a/deps/npm/docs/output/commands/npm-bin.html +++ b/deps/npm/docs/output/commands/npm-bin.html @@ -147,6 +147,7 @@

Table of contents

Synopsis

npm bin [-g|--global]
 
+

Note: This command is unaware of workspaces.

Description

Print the folder where npm will install executables.

See Also

diff --git a/deps/npm/docs/output/commands/npm-cache.html b/deps/npm/docs/output/commands/npm-cache.html index 9dbf83b31a8ae2..22ca6f1999ba06 100644 --- a/deps/npm/docs/output/commands/npm-cache.html +++ b/deps/npm/docs/output/commands/npm-cache.html @@ -155,6 +155,7 @@

Table of contents

npm cache verify +

Note: This command is unaware of workspaces.

Description

Used to add, list, or clean the npm cache folder.

    diff --git a/deps/npm/docs/output/commands/npm-completion.html b/deps/npm/docs/output/commands/npm-completion.html index 4f7016e4ac9933..b99d52b420db9e 100644 --- a/deps/npm/docs/output/commands/npm-completion.html +++ b/deps/npm/docs/output/commands/npm-completion.html @@ -147,6 +147,7 @@

    Table of contents

    Synopsis

    source <(npm completion)
     
    +

    Note: This command is unaware of workspaces.

    Description

    Enables tab-completion in all npm commands.

    The synopsis above diff --git a/deps/npm/docs/output/commands/npm-config.html b/deps/npm/docs/output/commands/npm-config.html index 924562822781b1..55f6e5ffe640cd 100644 --- a/deps/npm/docs/output/commands/npm-config.html +++ b/deps/npm/docs/output/commands/npm-config.html @@ -155,6 +155,7 @@

    Table of contents

    alias: c +

    Note: This command is unaware of workspaces.

    Description

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

    diff --git a/deps/npm/docs/output/commands/npm-dedupe.html b/deps/npm/docs/output/commands/npm-dedupe.html index 8a0ec7e0f77feb..ccd9a03f4d828e 100644 --- a/deps/npm/docs/output/commands/npm-dedupe.html +++ b/deps/npm/docs/output/commands/npm-dedupe.html @@ -136,7 +136,7 @@

    npm-dedupe

    -Reduce duplication +Reduce duplication in the package tree
    @@ -148,7 +148,7 @@

    Table of contents

    npm dedupe
     npm ddp
     
    -aliases: find-dupes, ddp
    +aliases: ddp
     

    Description

    Searches the local package tree and attempts to simplify the overall @@ -193,6 +193,7 @@

    Description

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

    See Also

      +
    • npm find-dupes
    • npm ls
    • npm update
    • npm install
    • diff --git a/deps/npm/docs/output/commands/npm-deprecate.html b/deps/npm/docs/output/commands/npm-deprecate.html index 949be43d9be171..88299a80bcfdaf 100644 --- a/deps/npm/docs/output/commands/npm-deprecate.html +++ b/deps/npm/docs/output/commands/npm-deprecate.html @@ -147,6 +147,7 @@

      Table of contents

      Synopsis

      npm deprecate <pkg>[@<version range>] <message>
       
      +

      Note: This command is unaware of workspaces.

      Description

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

      diff --git a/deps/npm/docs/output/commands/npm-doctor.html b/deps/npm/docs/output/commands/npm-doctor.html index a9b2001543d7dc..9ae140575529ef 100644 --- a/deps/npm/docs/output/commands/npm-doctor.html +++ b/deps/npm/docs/output/commands/npm-doctor.html @@ -147,6 +147,7 @@

      Table of contents

      Synopsis

      npm doctor
       
      +

      Note: This command is unaware of workspaces.

      Description

      npm doctor runs a set of checks to ensure that your npm installation has what it needs to manage your JavaScript packages. npm is mostly a diff --git a/deps/npm/docs/output/commands/npm-edit.html b/deps/npm/docs/output/commands/npm-edit.html index 7ebb443a2f6bb4..8c4ee5ed1a762f 100644 --- a/deps/npm/docs/output/commands/npm-edit.html +++ b/deps/npm/docs/output/commands/npm-edit.html @@ -147,6 +147,7 @@

      Table of contents

      Synopsis

      npm edit <pkg>
       
      +

      Note: This command is unaware of workspaces.

      Description

      Selects a dependency in the current project and opens the package folder in the default editor (or whatever you’ve configured as the npm editor diff --git a/deps/npm/docs/output/commands/npm-exec.html b/deps/npm/docs/output/commands/npm-exec.html index 03059c52052a50..f8f882a2c54a48 100644 --- a/deps/npm/docs/output/commands/npm-exec.html +++ b/deps/npm/docs/output/commands/npm-exec.html @@ -141,7 +141,7 @@

      npm-exec

      Table of contents

      - +

      Synopsis

      @@ -149,6 +149,7 @@

      Table of contents

      npm exec --package=<pkg>[@<version>] -- <cmd> [args...] npm exec -c '<cmd> [args...]' npm exec --package=foo -c '<cmd> [args...]' +npm exec [-ws] [-w <workspace-name] [args...] npx <pkg>[@<specifier>] [args...] npx -p <pkg>[@<specifier>] <cmd> [args...] @@ -247,6 +248,49 @@

      Examples

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

      Workspaces support

      +

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

      +

      Given a project with configured workspaces, e.g:

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

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

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

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

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

      Filtering workspaces

      +

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

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

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

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

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

      Compatibility with Older npx Versions

      The npx binary was rewritten in npm v7.0.0, and the standalone npx package deprecated at that time. npx uses the npm exec @@ -287,6 +331,29 @@

      prefer-offline

      offline

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

      +

      workspace

      +
        +
      • Alias: -w
      • +
      • Type: Array
      • +
      • Default: []
      • +
      +

      Enable running scripts in the context of workspaces while also filtering by +the provided names or paths provided.

      +

      Valid values for the workspace config are either:

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

      workspaces

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

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

      See Also

      • npm run-script
      • diff --git a/deps/npm/docs/output/commands/npm-explore.html b/deps/npm/docs/output/commands/npm-explore.html index 0bb350502264f2..cd52ff96a68486 100644 --- a/deps/npm/docs/output/commands/npm-explore.html +++ b/deps/npm/docs/output/commands/npm-explore.html @@ -147,6 +147,7 @@

        Table of contents

        Synopsis

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

        Note: This command is unaware of workspaces.

        Description

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

        If a command is specified, then it is run in the subshell, which then diff --git a/deps/npm/docs/output/commands/npm-find-dupes.html b/deps/npm/docs/output/commands/npm-find-dupes.html new file mode 100644 index 00000000000000..32d8993b99cc4d --- /dev/null +++ b/deps/npm/docs/output/commands/npm-find-dupes.html @@ -0,0 +1,174 @@ + +npm-find-dupes + + + +

        + +
        +
        +

        npm-find-dupes

        +Find duplication in the package tree +
        + +
        +

        Table of contents

        + +
        + +

        Synopsis

        +
        npm find-dupes
        +
        +

        Description

        +

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

        +

        See Also

        + +
        + + +
        + + + + \ No newline at end of file diff --git a/deps/npm/docs/output/commands/npm-help-search.html b/deps/npm/docs/output/commands/npm-help-search.html index 00ebe9bf6ca919..77456ef5493294 100644 --- a/deps/npm/docs/output/commands/npm-help-search.html +++ b/deps/npm/docs/output/commands/npm-help-search.html @@ -147,6 +147,7 @@

        Table of contents

        Synopsis

        npm help-search <text>
         
        +

        Note: This command is unaware of workspaces.

        Description

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

        diff --git a/deps/npm/docs/output/commands/npm-help.html b/deps/npm/docs/output/commands/npm-help.html index e4f4226a5d23b2..0327d1788f12d8 100644 --- a/deps/npm/docs/output/commands/npm-help.html +++ b/deps/npm/docs/output/commands/npm-help.html @@ -147,6 +147,7 @@

        Table of contents

        Synopsis

        npm help <term> [<terms..>]
         
        +

        Note: This command is unaware of workspaces.

        Description

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

        If the topic does not exist, or if multiple terms are provided, then npm diff --git a/deps/npm/docs/output/commands/npm-hook.html b/deps/npm/docs/output/commands/npm-hook.html index dd7015df1b425d..2921e7e12c0361 100644 --- a/deps/npm/docs/output/commands/npm-hook.html +++ b/deps/npm/docs/output/commands/npm-hook.html @@ -150,6 +150,7 @@

        Table of contents

        npm hook update <id> <url> [secret] npm hook rm <id> +

        Note: This command is unaware of workspaces.

        Description

        Allows you to manage npm hooks, diff --git a/deps/npm/docs/output/commands/npm-init.html b/deps/npm/docs/output/commands/npm-init.html index 3abf8e967b4649..62dc20093b2e94 100644 --- a/deps/npm/docs/output/commands/npm-init.html +++ b/deps/npm/docs/output/commands/npm-init.html @@ -136,7 +136,7 @@

        npm-init

        -create a package.json file +Create a package.json file
        diff --git a/deps/npm/docs/output/commands/npm-logout.html b/deps/npm/docs/output/commands/npm-logout.html index 02de412c7310e0..4e19888ee84d25 100644 --- a/deps/npm/docs/output/commands/npm-logout.html +++ b/deps/npm/docs/output/commands/npm-logout.html @@ -147,6 +147,7 @@

        Table of contents

        Synopsis

        npm logout [--registry=<url>] [--scope=<@scope>]
         
        +

        Note: This command is unaware of workspaces.

        Description

        When logged into a registry that supports token-based authentication, tell the server to end this token’s session. This will invalidate the token diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index ae1e1a84c72a4f..454c5567442657 100644 --- a/deps/npm/docs/output/commands/npm-ls.html +++ b/deps/npm/docs/output/commands/npm-ls.html @@ -159,7 +159,7 @@

        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@7.6.3 /path/to/npm
        +
        npm@7.7.0 /path/to/npm
         └─┬ init-package-json@0.0.4
           └── promzard@0.1.5
         
        diff --git a/deps/npm/docs/output/commands/npm-org.html b/deps/npm/docs/output/commands/npm-org.html index d97f638b22d0b8..50c0995650557c 100644 --- a/deps/npm/docs/output/commands/npm-org.html +++ b/deps/npm/docs/output/commands/npm-org.html @@ -149,6 +149,7 @@

        Table of contents

        npm org rm <orgname> <username> npm org ls <orgname> [<username>]
        +

        Note: This command is unaware of workspaces.

        Example

        Add a new developer to an org:

        $ npm org set my-org @mx-smith
        diff --git a/deps/npm/docs/output/commands/npm-owner.html b/deps/npm/docs/output/commands/npm-owner.html
        index 77f072da40b2ee..ada60ea0951e25 100644
        --- a/deps/npm/docs/output/commands/npm-owner.html
        +++ b/deps/npm/docs/output/commands/npm-owner.html
        @@ -151,6 +151,7 @@ 

        Table of contents

        aliases: author
        +

        Note: This command is unaware of workspaces.

        Description

        Manage ownership of published packages.

          diff --git a/deps/npm/docs/output/commands/npm-ping.html b/deps/npm/docs/output/commands/npm-ping.html index e00fb30a01c351..ca124a18595da1 100644 --- a/deps/npm/docs/output/commands/npm-ping.html +++ b/deps/npm/docs/output/commands/npm-ping.html @@ -147,6 +147,7 @@

          Table of contents

          Synopsis

          npm ping [--registry <registry>]
           
          +

          Note: This command is unaware of workspaces.

          Description

          Ping the configured or given npm registry and verify authentication. If it works it will output something like:

          diff --git a/deps/npm/docs/output/commands/npm-prefix.html b/deps/npm/docs/output/commands/npm-prefix.html index a330dfd1c373cc..493a1f8950b59b 100644 --- a/deps/npm/docs/output/commands/npm-prefix.html +++ b/deps/npm/docs/output/commands/npm-prefix.html @@ -147,6 +147,7 @@

          Table of contents

          Synopsis

          npm prefix [-g]
           
          +

          Note: This command is unaware of workspaces.

          Description

          Print the local prefix to standard output. This is the closest parent directory to contain a package.json file or node_modules directory, unless -g is diff --git a/deps/npm/docs/output/commands/npm-profile.html b/deps/npm/docs/output/commands/npm-profile.html index 91013567a206e1..f103446479c10e 100644 --- a/deps/npm/docs/output/commands/npm-profile.html +++ b/deps/npm/docs/output/commands/npm-profile.html @@ -151,6 +151,7 @@

          Table of contents

          npm profile enable-2fa [auth-and-writes|auth-only] npm profile disable-2fa +

          Note: This command is unaware of workspaces.

          Description

          Change your profile information on the registry. Note that this command depends on the registry implementation, so third-party registries may not diff --git a/deps/npm/docs/output/commands/npm-run-script.html b/deps/npm/docs/output/commands/npm-run-script.html index a78a434760bc05..6fc343dfbaf5f9 100644 --- a/deps/npm/docs/output/commands/npm-run-script.html +++ b/deps/npm/docs/output/commands/npm-run-script.html @@ -141,11 +141,13 @@

          npm-run-script

          Table of contents

          - +

          Synopsis

          npm run-script <command> [--if-present] [--silent] [-- <args>]
          +npm run-script <command> [--workspace=<workspace-name>]
          +npm run-script <command> [--workspaces]
           
           aliases: run, rum, urn
           
          @@ -196,6 +198,45 @@

          Description

          If you try to run a script without having a node_modules directory and it fails, you will be given a warning to run npm install, just in case you’ve forgotten.

          +

          Workspaces support

          +

          You may use the workspace or workspaces configs in order to run an +arbitrary command from a package’s "scripts" object in the context of the +specified workspaces. If no "command" is provided, it will list the available +scripts for each of these configured workspaces.

          +

          Given a project with configured workspaces, e.g:

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

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

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

          And that each of the configured workspaces has a configured test script, +we can run tests in all of them using the workspaces config:

          +
          npm test --workspaces
          +
          +

          Filtering workspaces

          +

          It’s also possible to run a script in a single workspace using the workspace +config along with a name or directory path:

          +
          npm test --workspace=a
          +
          +

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

          +
          npm test -w a -w b
          +
          +

          This last command will run test in both ./packages/a and ./packages/b +packages.

          Configuration

          if-present

            @@ -224,6 +265,29 @@

            silent

          • Default: false

          You can use the --silent flag to prevent showing npm ERR! output on error.

          +

          workspace

          +
            +
          • Alias: -w
          • +
          • Type: Array
          • +
          • Default: []
          • +
          +

          Enable running scripts in the context of workspaces while also filtering by +the provided names or paths provided.

          +

          Valid values for the workspace config are either:

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

          workspaces

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

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

          See Also

          • npm scripts
          • diff --git a/deps/npm/docs/output/commands/npm-search.html b/deps/npm/docs/output/commands/npm-search.html index bd1522305035ec..974c163ae16e9d 100644 --- a/deps/npm/docs/output/commands/npm-search.html +++ b/deps/npm/docs/output/commands/npm-search.html @@ -149,6 +149,7 @@

            Table of contents

            aliases: s, se, find +

            Note: This command is unaware of workspaces.

            Description

            Search the registry for packages matching the search terms. npm search performs a linear, incremental, lexically-ordered search through package diff --git a/deps/npm/docs/output/commands/npm-shrinkwrap.html b/deps/npm/docs/output/commands/npm-shrinkwrap.html index 63057cbe952b17..e2c09e81762c8d 100644 --- a/deps/npm/docs/output/commands/npm-shrinkwrap.html +++ b/deps/npm/docs/output/commands/npm-shrinkwrap.html @@ -147,6 +147,7 @@

            Table of contents

            Synopsis

            npm shrinkwrap
             
            +

            Note: This command is unaware of workspaces.

            Description

            This command repurposes package-lock.json into a publishable npm-shrinkwrap.json or simply creates a new one. The file created and diff --git a/deps/npm/docs/output/commands/npm-star.html b/deps/npm/docs/output/commands/npm-star.html index 1f92bc2697d437..8589a50c026be7 100644 --- a/deps/npm/docs/output/commands/npm-star.html +++ b/deps/npm/docs/output/commands/npm-star.html @@ -147,6 +147,7 @@

            Table of contents

            Synopsis

            npm star [<pkg>...]
             
            +

            Note: This command is unaware of workspaces.

            Description

            “Starring” a package means that you have some interest in it. It’s a vaguely positive way to show that you care.

            diff --git a/deps/npm/docs/output/commands/npm-stars.html b/deps/npm/docs/output/commands/npm-stars.html index fb80fc0cdee12f..c4aa2a194c4ec5 100644 --- a/deps/npm/docs/output/commands/npm-stars.html +++ b/deps/npm/docs/output/commands/npm-stars.html @@ -147,6 +147,7 @@

            Table of contents

            Synopsis

            npm stars [<user>]
             
            +

            Note: This command is unaware of workspaces.

            Description

            If you have starred a lot of neat things and want to find them again quickly this command lets you do just that.

            diff --git a/deps/npm/docs/output/commands/npm-team.html b/deps/npm/docs/output/commands/npm-team.html index bf29f4a5eaf633..586fd52721efb7 100644 --- a/deps/npm/docs/output/commands/npm-team.html +++ b/deps/npm/docs/output/commands/npm-team.html @@ -153,6 +153,7 @@

            Table of contents

            npm team ls <scope>|<scope:team> +

            Note: This command is unaware of workspaces.

            Description

            Used to manage teams in organizations, and change team memberships. Does not handle permissions for packages.

            diff --git a/deps/npm/docs/output/commands/npm-token.html b/deps/npm/docs/output/commands/npm-token.html index de92432475e248..d913acdb54789c 100644 --- a/deps/npm/docs/output/commands/npm-token.html +++ b/deps/npm/docs/output/commands/npm-token.html @@ -149,6 +149,7 @@

            Table of contents

            npm token create [--read-only] [--cidr=1.1.1.1/24,2.2.2.2/16] npm token revoke <id|token> +

            Note: This command is unaware of workspaces.

            Description

            This lets you list, create and revoke authentication tokens.

              diff --git a/deps/npm/docs/output/commands/npm-unstar.html b/deps/npm/docs/output/commands/npm-unstar.html index 77c7cd3495c4b1..3da3d28cbba798 100644 --- a/deps/npm/docs/output/commands/npm-unstar.html +++ b/deps/npm/docs/output/commands/npm-unstar.html @@ -147,6 +147,7 @@

              Table of contents

              Synopsis

              npm unstar [<pkg>...]
               
              +

              Note: This command is unaware of workspaces.

              Description

              “Unstarring” a package is the opposite of npm star, it removes an item from your list of favorite packages.

              diff --git a/deps/npm/docs/output/commands/npm-whoami.html b/deps/npm/docs/output/commands/npm-whoami.html index e703e1665f996c..869e1351bcc6f7 100644 --- a/deps/npm/docs/output/commands/npm-whoami.html +++ b/deps/npm/docs/output/commands/npm-whoami.html @@ -147,6 +147,7 @@

              Table of contents

              Synopsis

              npm whoami [--registry <registry>]
               
              +

              Note: This command is unaware of workspaces.

              Description

              Print the username config to standard output.

              See Also

              diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html index c2d07cf5caf1f8..f55659d9ee82a1 100644 --- a/deps/npm/docs/output/commands/npm.html +++ b/deps/npm/docs/output/commands/npm.html @@ -148,7 +148,7 @@

              Table of contents

              npm <command> [args]
               

              Version

              -

              7.6.3

              +

              7.7.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 114c18d61ebb25..9c58ebf85f6a59 100644 --- a/deps/npm/docs/output/configuring-npm/package-json.html +++ b/deps/npm/docs/output/configuring-npm/package-json.html @@ -392,6 +392,7 @@

              main

              This should be a module relative to the root of your package folder.

              For most modules, it makes the most sense to have a main script and often not much else.

              +

              If main is not set it defaults to index.js in the packages root folder.

              browser

              If your module is meant to be used client-side the browser field should be used instead of the main field. This is helpful to hint users that it might @@ -565,8 +566,7 @@

              dependencies

              tarball or git URL.

              Please do not put test harnesses or transpilers or other “development” time tools in your dependencies object. See devDependencies, below.

              -

              See semver -for more details about specifying version ranges.

              +

              See semver for more details about specifying version ranges.

              • version Must match version exactly
              • >version Must be greater than version
              • diff --git a/deps/npm/docs/output/using-npm/config.html b/deps/npm/docs/output/using-npm/config.html index 9d6ba9b5a6c3c1..dc50eb72b71ca4 100644 --- a/deps/npm/docs/output/using-npm/config.html +++ b/deps/npm/docs/output/using-npm/config.html @@ -141,7 +141,7 @@

                config

                Table of contents

                - +

                Description

                @@ -185,32 +185,49 @@

                Default Configs

                internal to npm, and are defaults if nothing else is specified.

                Shorthands and Other CLI Niceties

                The following shorthands are parsed on the command-line:

                + +
                  -
                • -v: --version
                • -
                • -h, -?, --help, -H: --usage
                • -
                • -s, --silent: --loglevel silent
                • -
                • -q, --quiet: --loglevel warn
                • -
                • -d: --loglevel info
                • -
                • -dd, --verbose: --loglevel verbose
                • -
                • -ddd: --loglevel silly
                • +
                • -a: --all
                • +
                • --enjoy-by: --before
                • +
                • -c: --call
                • +
                • --desc: --description
                • +
                • -f: --force
                • -g: --global
                • -
                • -C: --prefix
                • +
                • -d: --loglevel info
                • +
                • -s: --loglevel silent
                • +
                • --silent: --loglevel silent
                • +
                • --ddd: --loglevel silly
                • +
                • --dd: --loglevel verbose
                • +
                • --verbose: --loglevel verbose
                • +
                • -q: --loglevel warn
                • +
                • --quiet: --loglevel warn
                • -l: --long
                • -m: --message
                • -
                • -p, --porcelain: --parseable
                • -
                • -reg: --registry
                • -
                • -f: --force
                • -
                • -desc: --description
                • +
                • --local: --no-global
                • +
                • -n: --no-yes
                • +
                • --no: --no-yes
                • +
                • -p: --parseable
                • +
                • --porcelain: --parseable
                • +
                • -C: --prefix
                • +
                • --readonly: --read-only
                • +
                • --reg: --registry
                • -S: --save
                • -
                • -P: --save-prod
                • -
                • -D: --save-dev
                • -
                • -O: --save-optional
                • -B: --save-bundle
                • +
                • -D: --save-dev
                • -E: --save-exact
                • +
                • -O: --save-optional
                • +
                • -P: --save-prod
                • +
                • -?: --usage
                • +
                • -h: --usage
                • +
                • -H: --usage
                • +
                • --help: --usage
                • +
                • -v: --version
                • +
                • -w: --workspace
                • +
                • --ws: --workspaces
                • -y: --yes
                • -
                • -n: --yes false
                • -
                • ll and la commands: ls --long
                +

                If the specified configuration param resolves unambiguously to a known configuration parameter, then it is expanded to that configuration parameter. For example:

                @@ -227,162 +244,128 @@

                Shorthands and Other CLI Niceties

                Config Settings

                -

                access

                + + +

                _auth

                  -
                • Default: restricted
                • -
                • Type: Access
                • +
                • Default: null
                • +
                • Type: null or String
                -

                When publishing scoped packages, the access level defaults to restricted. If -you want your scoped package to be publicly viewable (and installable) set ---access=public. The only valid values for access are public and +

                A basic-auth string to use when authenticating against the npm registry.

                +

                Warning: This should generally not be set via a command-line option. It is +safer to use a registry-provided authentication bearer token stored in the +~/.npmrc file by running npm login.

                +

                access

                +
                  +
                • Default: ‘restricted’ for scoped packages, ‘public’ for unscoped packages
                • +
                • Type: null, “restricted”, or “public”
                • +
                +

                When publishing scoped packages, the access level defaults to restricted. +If you want your scoped package to be publicly viewable (and installable) +set --access=public. The only valid values for access are public and restricted. Unscoped packages always have an access level of public.

                -

                all

                +

                all

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

                When running npm outdated and npm ls, setting --all will show all outdated or installed packages, rather than only those directly depended upon by the current project.

                -

                allow-same-version

                +

                allow-same-version

                • Default: false
                • Type: Boolean

                Prevents throwing an error when npm version is used to set the new version to the same value as the current version.

                -

                always-auth

                +

                always-auth

                • Default: false
                • Type: Boolean
                -

                Force npm to always require authentication when accessing the registry, -even for GET requests.

                -

                also

                -
                  -
                • Default: null
                • -
                • Type: String
                • -
                -

                When “dev” or “development” and running local npm shrinkwrap, -npm outdated, or npm update, is an alias for --dev.

                -

                audit

                +

                Force npm to always require authentication when accessing the registry, even +for GET requests.

                +

                audit

                • Default: true
                • Type: Boolean

                When “true” submit audit reports alongside npm install runs to the default -registry and all registries configured for scopes. See the documentation -for npm audit for details on what is submitted.

                -

                audit-level

                -
                  -
                • Default: "low"
                • -
                • Type: 'low', 'moderate', 'high', 'critical'
                • -
                -

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

                -

                auth-type

                +registry and all registries configured for scopes. See the documentation for +npm audit for details on what is submitted.

                +

                audit-level

                  -
                • Default: 'legacy'
                • -
                • Type: 'legacy', 'sso', 'saml', 'oauth'
                • +
                • Default: null
                • +
                • Type: “low”, “moderate”, “high”, “critical”, “none”, or null
                -

                What authentication strategy to use with adduser/login.

                -

                before

                +

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

                +

                before

                  -
                • Alias: enjoy-by
                • Default: null
                • -
                • Type: Date
                • +
                • Type: null or Date
                -

                If passed to npm install, will rebuild the npm tree such that only versions -that were available on or before the --before time get installed. -If there’s no versions available for the current set of direct dependencies, the -command will error.

                +

                If passed to npm install, will rebuild the npm tree such that only +versions that were available on or before the --before time get +installed. If there’s no versions available for the current set of direct +dependencies, the command will error.

                If the requested version is a dist-tag and the given tag does not pass the ---before filter, the most recent version less than or equal to that tag will -be used. For example, foo@latest might install foo@1.2 even though latest -is 2.0.

                - +--before filter, the most recent version less than or equal to that tag +will be used. For example, foo@latest might install foo@1.2 even though +latest is 2.0.

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

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

                -

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

                -

                browser

                +

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

                +

                browser

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

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

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

                Set to true to use default system URL opener.

                -

                ca

                +

                ca

                  -
                • Default: The npm CA certificate
                • -
                • Type: String, Array or null
                • +
                • Default: null
                • +
                • Type: null or String (can be set multiple times)

                The Certificate Authority signing certificate that is trusted for SSL -connections to the registry. Values should be in PEM format (Windows calls it “Base-64 encoded X.509 (.CER)”) with newlines -replaced by the string “\n”. For example:

                -
                ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
                +connections to the registry. Values should be in PEM format (Windows calls
                +it “Base-64 encoded X.509 (.CER)”) with newlines replaced by the string
                +“\n”. For example:

                +
                ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
                 
                -

                Set to null to only allow “known” registrars, or to a specific CA cert -to trust only that specific signing authority.

                +

                Set to null to only allow “known” registrars, or to a specific CA cert to +trust only that specific signing authority.

                Multiple CAs can be trusted by specifying an array of certificates:

                -
                ca[]="..."
                +
                ca[]="..."
                 ca[]="..."
                 

                See also the strict-ssl config.

                -

                cafile

                +

                cache

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

                The location of npm’s cache directory. See npm cache

                +

                cafile

                +
                  +
                • Default: null
                • +
                • Type: Path

                A path to a file containing one or multiple Certificate Authority signing certificates. Similar to the ca setting, but allows for multiple CA’s, as well as for the CA information to be stored in a file on disk.

                -

                cache

                -
                  -
                • Default: Windows: %AppData%\npm-cache, Posix: ~/.npm
                • -
                • Type: path
                • -
                -

                The location of npm’s cache directory. See npm cache

                -

                cache-lock-stale

                -
                  -
                • Default: 60000 (1 minute)
                • -
                • Type: Number
                • -
                -

                The number of ms before cache folder lockfiles are considered stale.

                -

                cache-lock-retries

                -
                  -
                • Default: 10
                • -
                • Type: Number
                • -
                -

                Number of times to retry to acquire a lock on cache folder lockfiles.

                -

                cache-lock-wait

                -
                  -
                • Default: 10000 (10 seconds)
                • -
                • Type: Number
                • -
                -

                Number of ms to wait for cache lock files to expire.

                -

                cache-max

                -
                  -
                • Default: Infinity
                • -
                • Type: Number
                • -
                -

                DEPRECATED: This option has been deprecated in favor of --prefer-online.

                -

                --cache-max=0 is an alias for --prefer-online.

                -

                cache-min

                -
                  -
                • Default: 10
                • -
                • Type: Number
                • -
                -

                DEPRECATED: This option has been deprecated in favor of --prefer-offline.

                -

                --cache-min=9999 (or bigger) is an alias for --prefer-offline.

                -

                call

                +

                call

                • Default: “”
                • Type: String
                • @@ -391,131 +374,174 @@

                  call

                  custom command to be run along with the installed packages.

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

                  cert

                  +

                  cert

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

                  A client certificate to pass when accessing the registry. Values should be in -PEM format (Windows calls it “Base-64 encoded X.509 (.CER)”) with newlines replaced by the string “\n”. For example:

                  -
                  cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
                  +

                  A client certificate to pass when accessing the registry. Values should be +in PEM format (Windows calls it “Base-64 encoded X.509 (.CER)”) with +newlines replaced by the string “\n”. For example:

                  +
                  cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
                   
                  -

                  It is not the path to a certificate file (and there is no “certfile” option).

                  -

                  cidr

                  +

                  It is not the path to a certificate file (and there is no “certfile” +option).

                  +

                  ci-name

                    -
                  • Default: null
                  • -
                  • Type: String, Array, null
                  • +
                  • Default: The name of the current CI system, or null when not on a known CI +platform.
                  • +
                  • Type: null or String
                  -

                  This is a list of CIDR address to be used when configuring limited access tokens with the npm token create command.

                  -

                  commit-hooks

                  +

                  The name of a continuous integration system. If not set explicitly, npm will +detect the current CI environment using the +@npmcli/ci-detect module.

                  +

                  cidr

                    -
                  • Default: true
                  • -
                  • Type: Boolean
                  • +
                  • Default: null
                  • +
                  • Type: null or String (can be set multiple times)
                  -

                  Run git commit hooks when using the npm version command.

                  -

                  color

                  +

                  This is a list of CIDR address to be used when configuring limited access +tokens with the npm token create command.

                  +

                  color

                  +
                    +
                  • Default: true unless the NO_COLOR environ is set to something other than ‘0’
                  • +
                  • Type: “always” or Boolean
                  • +
                  +

                  If false, never shows colors. If "always" then always shows colors. If +true, then only prints color codes for tty file descriptors.

                  +

                  commit-hooks

                  • Default: true
                  • -
                  • Type: Boolean or "always"
                  • +
                  • Type: Boolean
                  -

                  If false, never shows colors. If "always" then always shows colors. -If true, then only prints color codes for tty file descriptors.

                  -

                  This option can also be changed using the environment: colors are -disabled when the environment variable NO_COLOR is set to any value.

                  -

                  depth

                  +

                  Run git commit hooks when using the npm version command.

                  +

                  depth

                    -
                  • Default: null
                  • +
                  • Default: Infinity if --all is set, otherwise 1
                  • Type: null or Number

                  The depth to go when recursing packages for npm ls.

                  -

                  To make this default to Infinity instead of null, set --all.

                  -

                  description

                  +

                  If not set, npm ls will show only the immediate dependencies of the root +project. If --all is set, then npm will show all dependencies by default.

                  +

                  description

                  • Default: true
                  • Type: Boolean

                  Show the description in npm search

                  -

                  dev

                  +

                  diff

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

                  Define arguments to compare in npm diff.

                  +

                  diff-dst-prefix

                  +
                    +
                  • Default: “b/”
                  • +
                  • Type: String
                  • +
                  +

                  Destination prefix to be used in npm diff output.

                  +

                  diff-ignore-all-space

                  • Default: false
                  • Type: Boolean
                  -

                  [Deprecated] Install dev-dependencies along with packages.

                  -

                  dry-run

                  +

                  Ignore whitespace when comparing lines in npm diff.

                  +

                  diff-name-only

                  • 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. This is NOT currently honored by some network related -commands, eg dist-tags, owner, etc.

                  -

                  diff

                  +

                  Prints only filenames when using npm diff.

                  +

                  diff-no-prefix

                    -
                  • Default: null
                  • -
                  • Type: String, Array, null
                  • +
                  • Default: false
                  • +
                  • Type: Boolean
                  -

                  Define arguments to compare in npm diff.

                  -

                  diff-name-only

                  +

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

                  +

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

                  +

                  diff-src-prefix

                  +
                    +
                  • Default: “a/”
                  • +
                  • Type: String
                  • +
                  +

                  Source prefix to be used in npm diff output.

                  +

                  diff-text

                  • Default: false
                  • Type: Boolean
                  -

                  Prints only filenames when using npm diff.

                  -

                  diff-unified

                  +

                  Treat all files as text in npm diff.

                  +

                  diff-unified

                    -
                  • Type: number
                  • -
                  • Default: 3
                  • +
                  • Default: 3
                  • +
                  • Type: Number

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

                  -

                  diff-ignore-all-space

                  +

                  dry-run

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

                  Ignore whitespace when comparing lines in `npm diff.

                  -

                  diff-no-prefix

                  +

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

                  +

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

                  +

                  editor

                  +
                    +
                  • Default: The EDITOR or VISUAL environment variables, or ‘notepad.exe’ on +Windows, or ‘vim’ on Unix systems
                  • +
                  • Type: String
                  • +
                  +

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

                  +

                  engine-strict

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

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

                  -

                  diff-src-prefix

                  +

                  If set to true, then npm will stubbornly refuse to install (or even consider +installing) any package that claims to not be compatible with the current +Node.js version.

                  +

                  This can be overridden by setting the --force flag.

                  +

                  fetch-retries

                    -
                  • Type: String
                  • -
                  • Default: "a/"
                  • +
                  • Default: 2
                  • +
                  • Type: Number
                  -

                  Source prefix to be used in npm diff output.

                  -

                  diff-dst-prefix

                  +

                  The “retries” config for the retry module to use when fetching packages +from the registry.

                  +

                  npm will retry idempotent read requests to the registry in the case of +network failures or 5xx HTTP errors.

                  +

                  fetch-retry-factor

                    -
                  • Type: String
                  • -
                  • Default: "b/"
                  • +
                  • Default: 10
                  • +
                  • Type: Number
                  -

                  Destination prefix to be used in npm diff output.

                  -

                  diff-text

                  +

                  The “factor” config for the retry module to use when fetching packages.

                  +

                  fetch-retry-maxtimeout

                    -
                  • Alias: -a
                  • -
                  • Type: Boolean
                  • -
                  • Default: false
                  • +
                  • Default: 60000 (1 minute)
                  • +
                  • Type: Number
                  -

                  Treat all files as text in npm diff.

                  -

                  editor

                  +

                  The “maxTimeout” config for the retry module to use when fetching +packages.

                  +

                  fetch-retry-mintimeout

                    -
                  • Default: EDITOR environment variable if set, or "vi" on Posix, -or "notepad" on Windows.
                  • -
                  • Type: path
                  • +
                  • Default: 10000 (10 seconds)
                  • +
                  • Type: Number
                  -

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

                  -

                  engine-strict

                  +

                  The “minTimeout” config for the retry module to use when fetching +packages.

                  +

                  fetch-timeout

                    -
                  • Default: false
                  • -
                  • Type: Boolean
                  • +
                  • Default: 300000 (5 minutes)
                  • +
                  • Type: Number
                  -

                  If set to true, then npm will stubbornly refuse to install (or even -consider installing) any package that claims to not be compatible with -the current Node.js version.

                  -

                  force

                  +

                  The maximum amount of time to wait for HTTP requests to complete.

                  +

                  force

                  • Default: false
                  • Type: Boolean
                  • @@ -529,16 +555,15 @@

                    force

                  • Allow installing packages that have an engines declaration requiring a different version of npm.
                  • Allow installing packages that have an engines declaration requiring a -different version of node, even if --engines-strict is enabled.
                  • +different version of node, even if --engine-strict is enabled.
                  • Allow npm audit fix to install modules outside your stated dependency range (including SemVer-major changes).
                  • -
                  • Allow a module to be installed as a direct dependency of itself.
                  • Allow unpublishing all versions of a published package.
                  • Allow conflicting peerDependencies to be installed in the root project.

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

                  -

                  foreground-scripts

                  +

                  foreground-scripts

                  • Default: false
                  • Type: Boolean
                  • @@ -546,347 +571,322 @@

                    foreground-scripts

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

                    -

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

                    -

                    format-package-lock

                    +

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

                    +

                    format-package-lock

                    • Default: true
                    • Type: Boolean
                    -

                    Format package-lock.json or npm-shrinkwrap.json as a human readable file.

                    -

                    fund

                    +

                    Format package-lock.json or npm-shrinkwrap.json as a human readable +file.

                    +

                    fund

                    • Default: true
                    • Type: Boolean

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

                    -

                    fetch-retries

                    -
                      -
                    • Default: 2
                    • -
                    • Type: Number
                    • -
                    -

                    The “retries” config for the retry module to use when fetching -packages from the registry.

                    -

                    fetch-retry-factor

                    -
                      -
                    • Default: 10
                    • -
                    • Type: Number
                    • -
                    -

                    The “factor” config for the retry module to use when fetching -packages.

                    -

                    fetch-retry-mintimeout

                    -
                      -
                    • Default: 10000 (10 seconds)
                    • -
                    • Type: Number
                    • -
                    -

                    The “minTimeout” config for the retry module to use when fetching -packages.

                    -

                    fetch-retry-maxtimeout

                    -
                      -
                    • Default: 60000 (1 minute)
                    • -
                    • Type: Number
                    • -
                    -

                    The “maxTimeout” config for the retry module to use when fetching -packages.

                    -

                    fetch-timeout

                    +acknowledging the number of dependencies looking for funding. See npm fund for details.

                    +

                    git

                      -
                    • Default: 300000 (5 minutes)
                    • -
                    • Type: Number
                    • -
                    -

                    The maximum amount of time to wait for HTTP requests to complete.

                    -

                    git

                    -
                      -
                    • Default: "git"
                    • +
                    • Default: “git”
                    • Type: String
                    -

                    The command to use for git commands. If git is installed on the -computer, but is not in the PATH, then set this to the full path to -the git binary.

                    -

                    git-tag-version

                    +

                    The command to use for git commands. If git is installed on the computer, +but is not in the PATH, then set this to the full path to the git binary.

                    +

                    git-tag-version

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

                    Tag the commit when using the npm version command.

                    -

                    global

                    +

                    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 +

                    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.
                    • +
                    • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
                    • bin files are linked to {prefix}/bin
                    • man pages are linked to {prefix}/share/man
                    -

                    globalconfig

                    -
                      -
                    • Default: {prefix}/etc/npmrc
                    • -
                    • Type: path
                    • -
                    -

                    The config file to read for global config options.

                    -

                    global-style

                    +

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

                    -

                    heading

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

                    +

                    globalconfig

                      -
                    • Default: "npm"
                    • +
                    • Default: The global –prefix setting plus ‘etc/npmrc’. For example, +‘/usr/local/etc/npmrc’
                    • +
                    • Type: Path
                    • +
                    +

                    The config file to read for global config options.

                    +

                    heading

                    +
                      +
                    • Default: “npm”
                    • Type: String

                    The string that starts all the debugging log output.

                    -

                    https-proxy

                    +

                    https-proxy

                    • Default: null
                    • -
                    • Type: url
                    • +
                    • Type: null or URL

                    A proxy to use for outgoing https requests. If the HTTPS_PROXY or https_proxy or HTTP_PROXY or http_proxy environment variables are set, -proxy settings will be honored by the underlying request library.

                    -

                    if-present

                    -
                      -
                    • Default: false
                    • -
                    • Type: Boolean
                    • -
                    -

                    If true, npm will not exit with an error code when run-script is invoked for -a script that isn’t defined in the scripts section of package.json. This -option can be used when it’s desirable to optionally run a script when it’s -present and fail if the script fails. This is useful, for example, when running -scripts that may only apply for some builds in an otherwise generic CI setup.

                    -

                    ignore-prepublish

                    +proxy settings will be honored by the underlying make-fetch-happen +library.

                    +

                    if-present

                    • Default: false
                    • Type: Boolean
                    -

                    If true, npm will not run prepublish scripts.

                    -

                    ignore-scripts

                    +

                    If true, npm will not exit with an error code when run-script is invoked +for a script that isn’t defined in the scripts section of package.json. +This option can be used when it’s desirable to optionally run a script when +it’s present and fail if the script fails. This is useful, for example, when +running scripts that may only apply for some builds in an otherwise generic +CI setup.

                    +

                    ignore-scripts

                    • Default: false
                    • Type: Boolean

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

                    -

                    include

                    +

                    include

                      -
                    • Default: [prod|dev|optional|peer]
                    • -
                    • Type: Array
                    • +
                    • Default:
                    • +
                    • Type: “prod”, “dev”, “optional”, or “peer” (can be set multiple times)

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

                    -

                    init-module

                    +

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

                    +

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

                    +

                    include-staged

                      -
                    • Alias: init.module
                    • -
                    • Default: ~/.npm-init.js
                    • -
                    • Type: path
                    • +
                    • Default: false
                    • +
                    • Type: Boolean
                    -

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

                    -

                    init-author-name

                    +

                    Allow installing “staged” published packages, as defined by npm RFC PR +#92.

                    +

                    This is experimental, and not implemented by the npm public registry.

                    +

                    init-author-email

                      -
                    • Alias: init.author.name
                    • Default: “”
                    • Type: String
                    -

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

                    -

                    init-author-email

                    +

                    The value npm init should use by default for the package author’s email.

                    +

                    init-author-name

                      -
                    • Alias: init.author.email
                    • Default: “”
                    • Type: String
                    -

                    The value npm init should use by default for the package author’s email.

                    -

                    init-author-url

                    +

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

                    +

                    init-author-url

                      -
                    • Alias: init.author.url
                    • Default: “”
                    • -
                    • Type: String
                    • +
                    • Type: “” or URL
                    -

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

                    -

                    init-license

                    +

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

                    +

                    init-license

                      -
                    • Alias: init.license
                    • Default: “ISC”
                    • Type: String

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

                    -

                    init-version

                    +

                    init-module

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

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

                    +

                    init-version

                      -
                    • Alias: init.version
                    • Default: “1.0.0”
                    • -
                    • Type: semver
                    • +
                    • Type: SemVer string
                    -

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

                    -

                    json

                    +

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

                    +

                    json

                    • Default: false
                    • Type: Boolean

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

                    -

                    This feature is currently experimental, and the output data structures for many -commands is either not implemented in JSON yet, or subject to change. Only the -output from npm ls --json and npm search --json are currently valid.

                    -

                    key

                    +

                    This feature is currently experimental, and the output data structures for +many commands is either not implemented in JSON yet, or subject to change. +Only the output from npm ls --json and npm search --json are currently +valid.

                    +

                    key

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

                    A client key to pass when accessing the registry. Values should be in PEM +

                    A client key to pass when accessing the registry. Values should be in PEM format with newlines replaced by the string “\n”. For example:

                    -
                    key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----"
                    +
                    key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----"
                     

                    It is not the path to a key file (and there is no “keyfile” option).

                    -

                    legacy-bundling

                    +

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

                    -

                    legacy-peer-deps

                    +

                    legacy-peer-deps

                    • Default: false
                    • Type: Boolean

                    Causes npm to completely ignore peerDependencies when building a package tree, as in npm versions 3 through 6.

                    -

                    If a package cannot be installed because of overly strict -peerDependencies that collide, it provides a way to move forward -resolving the situation.

                    +

                    If a package cannot be installed because of overly strict peerDependencies +that collide, it provides a way to move forward resolving the situation.

                    This differs from --omit=peer, in that --omit=peer will avoid unpacking peerDependencies on disk, but will still design a tree such that peerDependencies could be unpacked in a correct place.

                    Use of legacy-peer-deps is not recommended, as it will not enforce the peerDependencies contract that meta-dependencies may rely on.

                    - +
                    • Default: false
                    • Type: Boolean

                    If true, then local installs will link if there is a suitable globally installed package.

                    -

                    Note that this means that local installs can cause things to be -installed into the global space at the same time. The link is only done -if one of the two conditions are met:

                    +

                    Note that this means that local installs can cause things to be installed +into the global space at the same time. The link is only done if one of the +two conditions are met:

                    • The package is not already installed globally, or
                    • -
                    • the globally installed version is identical to the version that is -being installed locally.
                    • +
                    • the globally installed version is identical to the version that is being +installed locally.
                    -

                    local-address

                    +

                    local-address

                      -
                    • Default: undefined
                    • +
                    • Default: null
                    • Type: IP Address
                    -

                    The IP address of the local interface to use when making connections -to the npm registry. Must be IPv4 in versions of Node prior to 0.12.

                    -

                    loglevel

                    +

                    The IP address of the local interface to use when making connections to the +npm registry. Must be IPv4 in versions of Node prior to 0.12.

                    +

                    loglevel

                    • Default: “notice”
                    • -
                    • Type: String
                    • -
                    • Values: “silent”, “error”, “warn”, “notice”, “http”, “timing”, “info”, -“verbose”, “silly”
                    • +
                    • Type: “silent”, “error”, “warn”, “notice”, “http”, “timing”, “info”, +“verbose”, or “silly”
                    -

                    What level of logs to report. On failure, all logs are written to +

                    What level of logs to report. On failure, all logs are written to npm-debug.log in the current working directory.

                    -

                    Any logs of a higher level than the setting are shown. The default is “notice”.

                    -

                    logs-max

                    +

                    Any logs of a higher level than the setting are shown. The default is +“notice”.

                    +

                    logs-max

                    • Default: 10
                    • Type: Number

                    The maximum number of log files to store.

                    -

                    long

                    +

                    long

                    • Default: false
                    • Type: Boolean

                    Show extended information in npm ls and npm search.

                    -

                    maxsockets

                    +

                    maxsockets

                      -
                    • Default: 50
                    • +
                    • Default: Infinity
                    • Type: Number

                    The maximum number of connections to use per origin (protocol/host/port -combination). Passed to the http Agent used to make the request.

                    -

                    message

                    +combination).

                    +

                    message

                    • Default: “%s”
                    • Type: String

                    Commit message which is used by npm version when creating version commit.

                    Any “%s” in the message will be replaced with the version number.

                    -

                    node-options

                    +

                    node-options

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

                    Options to pass through to Node.js via the NODE_OPTIONS environment -variable. This does not impact how npm itself is executed but it does -impact how lifecycle scripts are called.

                    -

                    node-version

                    +variable. This does not impact how npm itself is executed but it does impact +how lifecycle scripts are called.

                    +

                    node-version

                      -
                    • Default: process.version
                    • -
                    • Type: semver or false
                    • +
                    • Default: Node.js process.version value
                    • +
                    • Type: SemVer string
                    -

                    The node version to use when checking a package’s engines map.

                    -

                    noproxy

                    +

                    The node version to use when checking a package’s engines setting.

                    +

                    noproxy

                      -
                    • Default: null
                    • -
                    • Type: String or Array
                    • +
                    • Default: The value of the NO_PROXY environment variable
                    • +
                    • Type: String (can be set multiple times)
                    -

                    A comma-separated string or an array of domain extensions that a proxy should not be used for.

                    -

                    offline

                    +

                    Domain extensions that should bypass any proxies.

                    +

                    Also accepts a comma-delimited string.

                    +

                    npm-version

                      -
                    • Default: false
                    • -
                    • Type: Boolean
                    • +
                    • Default: Output of npm --version
                    • +
                    • Type: SemVer string
                    -

                    Force offline mode: no network requests will be done during install. To allow -the CLI to fill in missing cache data, see --prefer-offline.

                    -

                    only

                    +

                    The npm version to use when checking a package’s engines setting.

                    +

                    offline

                      -
                    • Default: null
                    • -
                    • Type: String
                    • +
                    • Default: false
                    • +
                    • Type: Boolean
                    -

                    When “dev” or “development” and running local npm install without any -arguments, only devDependencies (and their dependencies) are installed.

                    -

                    When “dev” or “development” and running local npm ls, npm outdated, or -npm update, is an alias for --dev.

                    -

                    When “prod” or “production” and running local npm install without any -arguments, only non-devDependencies (and their dependencies) are -installed.

                    -

                    When “prod” or “production” and running local npm ls, npm outdated, or -npm update, is an alias for --production.

                    -

                    optional

                    +

                    Force offline mode: no network requests will be done during install. To +allow the CLI to fill in missing cache data, see --prefer-offline.

                    +

                    omit

                      -
                    • Default: true
                    • -
                    • Type: Boolean
                    • +
                    • Default: ‘dev’ if the NODE_ENV environment variable is set to ‘production’, +otherwise empty.
                    • +
                    • Type: “dev”, “optional”, or “peer” (can be set multiple times)
                    -

                    Attempt to install packages in the optionalDependencies object. Note -that if these packages fail to install, the overall installation -process is not aborted.

                    -

                    otp

                    +

                    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.

                    +

                    otp

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

                    This is a one-time password from a two-factor authenticator. It’s needed +

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

                    -

                    package-lock

                    +

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

                    +

                    package

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

                    The package to install for npm exec

                    +

                    package-lock

                    • Default: true
                    • Type: Boolean
                    • @@ -894,113 +894,97 @@

                      package-lock

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

                      When package package-locks are disabled, automatic pruning of extraneous -modules will also be disabled. To remove extraneous modules with +modules will also be disabled. To remove extraneous modules with package-locks disabled use npm prune.

                      -

                      This option is an alias for --shrinkwrap.

                      -

                      package-lock-only

                      +

                      package-lock-only

                      • Default: false
                      • Type: Boolean
                      -

                      If set to true, it will update only the package-lock.json, -instead of checking node_modules and downloading dependencies.

                      -

                      parseable

                      +

                      If set to true, it will update only the package-lock.json, instead of +checking node_modules and downloading dependencies.

                      +

                      parseable

                      • Default: false
                      • Type: Boolean
                      -

                      Output parseable results from commands that write to -standard output. For npm search, this will be tab-separated table format.

                      -

                      prefer-offline

                      +

                      Output parseable results from commands that write to standard output. For +npm search, this will be tab-separated table format.

                      +

                      prefer-offline

                      • Default: false
                      • Type: Boolean

                      If true, staleness checks for cached data will be bypassed, but missing data -will be requested from the server. To force full offline mode, use --offline.

                      -

                      This option is effectively equivalent to --cache-min=9999999.

                      -

                      prefer-online

                      +will be requested from the server. To force full offline mode, use +--offline.

                      +

                      prefer-online

                      • Default: false
                      • Type: Boolean
                      -

                      If true, staleness checks for cached data will be forced, making the CLI look -for updates immediately even for fresh package data.

                      -

                      prefix

                      +

                      If true, staleness checks for cached data will be forced, making the CLI +look for updates immediately even for fresh package data.

                      +

                      prefix

                        -
                      • Default: see folders
                      • -
                      • Type: path
                      • +
                      • Default: In global mode, the folder where the node executable is installed. +In local mode, the nearest parent folder containing either a package.json +file or a node_modules folder.
                      • +
                      • Type: Path
                      -

                      The location to install global items. If set on the command line, then -it forces non-global commands to run in the specified folder.

                      -

                      preid

                      +

                      The location to install global items. If set on the command line, then it +forces non-global commands to run in the specified folder.

                      +

                      preid

                      • Default: “”
                      • Type: String
                      -

                      The “prerelease identifier” to use as a prefix for the “prerelease” part of a -semver. Like the rc in 1.2.0-rc.8.

                      -

                      production

                      -
                        -
                      • Default: false
                      • -
                      • Type: Boolean
                      • -
                      -

                      Set to true to run in “production” mode.

                      -
                        -
                      1. devDependencies are not installed at the topmost level when running -local npm install without any arguments.
                      2. -
                      3. Set the NODE_ENV=“production” for lifecycle scripts.
                      4. -
                      -

                      progress

                      +

                      The “prerelease identifier” to use as a prefix for the “prerelease” part of +a semver. Like the rc in 1.2.0-rc.8.

                      +

                      progress

                        -
                      • Default: true, unless TRAVIS or CI env vars set.
                      • +
                      • Default: true unless running in a known CI system
                      • Type: Boolean

                      When set to true, npm will display a progress bar during time intensive operations, if process.stderr is a TTY.

                      Set to false to suppress the progress bar.

                      -

                      proxy

                      +

                      proxy

                      • Default: null
                      • -
                      • Type: url
                      • +
                      • Type: null, false, or URL

                      A proxy to use for outgoing http requests. If the HTTP_PROXY or -http_proxy environment variables are set, proxy settings will be -honored by the underlying request library.

                      -

                      read-only

                      +http_proxy environment variables are set, proxy settings will be honored +by the underlying request library.

                      +

                      read-only

                      • Default: false
                      • Type: Boolean
                      -

                      This is used to mark a token as unable to publish when configuring limited access tokens with the npm token create command.

                      -

                      rebuild-bundle

                      +

                      This is used to mark a token as unable to publish when configuring limited +access tokens with the npm token create command.

                      +

                      rebuild-bundle

                      • Default: true
                      • Type: Boolean

                      Rebuild bundled dependencies after installation.

                      -

                      registry

                      - -

                      The base URL of the npm package registry.

                      -

                      rollback

                      +

                      registry

                      -

                      Remove failed installs.

                      -

                      save

                      +

                      The base URL of the npm registry.

                      +

                      save

                      • Default: true
                      • Type: Boolean

                      Save installed packages to a package.json file as dependencies.

                      -

                      When used with the npm rm command, it removes it from the dependencies -object.

                      -

                      Only works if there is already a package.json file present.

                      -

                      save-bundle

                      +

                      When used with the npm rm command, removes the dependency from +package.json.

                      +

                      save-bundle

                      • Default: false
                      • Type: Boolean
                      • @@ -1008,161 +992,122 @@

                        save-bundle

                        If a package would be saved at install time by the use of --save, --save-dev, or --save-optional, then also put it in the bundleDependencies list.

                        -

                        When used with the npm rm command, it removes it from the -bundledDependencies list.

                        -

                        save-prod

                        +

                        Ignore if --save-peer is set, since peerDependencies cannot be bundled.

                        +

                        save-dev

                        • Default: false
                        • Type: Boolean
                        -

                        Makes sure that a package will be saved into dependencies specifically. This -is useful if a package already exists in devDependencies or -optionalDependencies, but you want to move it to be a production dep. This is -also the default behavior if --save is true, and neither --save-dev or ---save-optional are true.

                        -

                        save-dev

                        +

                        Save installed packages to a package.json file as devDependencies.

                        +

                        save-exact

                        • Default: false
                        • Type: Boolean
                        -

                        Save installed packages to a package.json file as devDependencies.

                        -

                        When used with the npm rm command, it removes it from the -devDependencies object.

                        -

                        Only works if there is already a package.json file present.

                        -

                        save-exact

                        +

                        Dependencies saved to package.json will be configured with an exact version +rather than using npm’s default semver range operator.

                        +

                        save-optional

                        • Default: false
                        • Type: Boolean
                        -

                        Dependencies saved to package.json using --save, --save-dev or ---save-optional will be configured with an exact version rather than -using npm’s default semver range operator.

                        -

                        save-optional

                        +

                        Save installed packages to a package.json file as optionalDependencies.

                        +

                        save-peer

                        • Default: false
                        • Type: Boolean
                        -

                        Save installed packages to a package.json file as -optionalDependencies.

                        -

                        When used with the npm rm command, it removes it from the -devDependencies object.

                        -

                        Only works if there is already a package.json file present.

                        -

                        save-prefix

                        +

                        Save installed packages. to a package.json file as peerDependencies

                        +

                        save-prefix

                          -
                        • Default: ‘^’
                        • +
                        • Default: “^”
                        • Type: String

                        Configure how versions of packages installed to a package.json file via --save or --save-dev get prefixed.

                        -

                        For example if a package has version 1.2.3, by default its version is -set to ^1.2.3 which allows minor upgrades for that package, but after -npm config set save-prefix='~' it would be set to ~1.2.3 which only allows +

                        For example if a package has version 1.2.3, by default its version is set +to ^1.2.3 which allows minor upgrades for that package, but after npm config set save-prefix='~' it would be set to ~1.2.3 which only allows patch upgrades.

                        -

                        scope

                        +

                        save-prod

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

                        Save installed packages into dependencies specifically. This is useful if +a package already exists in devDependencies or optionalDependencies, but +you want to move it to be a non-optional production dependency.

                        +

                        This is the default behavior if --save is true, and neither --save-dev +or --save-optional are true.

                        +

                        scope

                        • Default: the scope of the current project, if any, or “”
                        • Type: String
                        -

                        Associate an operation with a scope for a scoped registry. Useful when logging -in to a private registry for the first time: -npm login --scope=@organization --registry=registry.organization.com, which -will cause @organization to be mapped to the registry for future installation -of packages specified according to the pattern @organization/package.

                        -

                        script-shell

                        +

                        Associate an operation with a scope for a scoped registry.

                        +

                        Useful when logging in to a private registry for the first time:

                        +
                        npm login --scope=@mycorp --registry=https://registry.mycorp.com
                        +
                        +

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

                        +

                        script-shell

                          -
                        • Default: null
                        • -
                        • Type: path
                        • +
                        • Default: ‘/bin/sh’ on POSIX systems, ‘cmd.exe’ on Windows
                        • +
                        • Type: null or String

                        The shell to use for scripts run with the npm run command.

                        -

                        scripts-prepend-node-path

                        -
                          -
                        • Default: “warn-only”
                        • -
                        • Type: Boolean, "auto" or "warn-only"
                        • -
                        -

                        If set to true, add the directory in which the current node executable -resides to the PATH environment variable when running scripts, -even if that means that npm will invoke a different node executable than -the one which it is running.

                        -

                        If set to false, never modify PATH with that.

                        -

                        If set to "warn-only", never modify PATH but print a warning if npm thinks -that you may want to run it with true, e.g. because the node executable -in the PATH is not the one npm was invoked with.

                        -

                        If set to auto, only add that directory to the PATH environment variable -if the node executable with which npm was invoked and the one that is found -first on the PATH are different.

                        -

                        searchexclude

                        +

                        searchexclude

                        • Default: “”
                        • Type: String

                        Space-separated options that limit the results from search.

                        -

                        searchopts

                        -
                          -
                        • Default: “”
                        • -
                        • Type: String
                        • -
                        -

                        Space-separated options that are always passed to search.

                        -

                        searchlimit

                        +

                        searchlimit

                        • Default: 20
                        • Type: Number

                        Number of items to limit search results to. Will not apply at all to legacy searches.

                        -

                        searchstaleness

                        +

                        searchopts

                        +
                          +
                        • Default: “”
                        • +
                        • Type: String
                        • +
                        +

                        Space-separated options that are always passed to search.

                        +

                        searchstaleness

                          -
                        • Default: 900 (15 minutes)
                        • +
                        • Default: 900
                        • Type: Number

                        The age of the cache, in seconds, before another registry request is made if using legacy search endpoint.

                        -

                        shell

                        +

                        shell

                          -
                        • Default: SHELL environment variable, or “bash” on Posix, or “cmd” on +
                        • Default: SHELL environment variable, or “bash” on Posix, or “cmd.exe” on Windows
                        • -
                        • Type: path
                        • +
                        • Type: String

                        The shell to run for the npm explore command.

                        -

                        shrinkwrap

                        -
                          -
                        • Default: true
                        • -
                        • Type: Boolean
                        • -
                        -

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

                        -

                        This option is an alias for --package-lock.

                        -

                        sign-git-commit

                        +

                        sign-git-commit

                        • Default: false
                        • Type: Boolean

                        If set to true, then the npm version command will commit the new package version using -S to add a signature.

                        -

                        Note that git requires you to have set up GPG keys in your git configs -for this to work properly.

                        -

                        sign-git-tag

                        +

                        Note that git requires you to have set up GPG keys in your git configs for +this to work properly.

                        +

                        sign-git-tag

                        • Default: false
                        • Type: Boolean
                        -

                        If set to true, then the npm version command will tag the version -using -s to add a signature.

                        -

                        Note that git requires you to have set up GPG keys in your git configs -for this to work properly.

                        -

                        sso-poll-frequency

                        -
                          -
                        • Default: 500
                        • -
                        • Type: Number
                        • -
                        -

                        When used with SSO-enabled auth-types, configures how regularly the registry -should be polled while the user is completing authentication.

                        -

                        sso-type

                        -
                          -
                        • Default: ‘oauth’
                        • -
                        • Type: ‘oauth’, ‘saml’, or null
                        • -
                        -

                        If --auth-type=sso, the type of SSO type to use.

                        -

                        strict-peer-deps

                        +

                        If set to true, then the npm version command will tag the version using +-s to add a signature.

                        +

                        Note that git requires you to have set up GPG keys in your git configs for +this to work properly.

                        +

                        strict-peer-deps

                        • Default: false
                        • Type: Boolean
                        • @@ -1171,122 +1116,296 @@

                          strict-peer-deps

                          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 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 the warning is -treated as a failure.

                          -

                          strict-ssl

                          +

                          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.

                          +

                          strict-ssl

                          • Default: true
                          • Type: Boolean
                          -

                          Whether or not to do SSL key validation when making requests to the -registry via https.

                          +

                          Whether or not to do SSL key validation when making requests to the registry +via https.

                          See also the ca config.

                          -

                          tag

                          +

                          tag

                            -
                          • Default: latest
                          • +
                          • Default: “latest”
                          • Type: String
                          -

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

                          -

                          Also the tag that is added to the package@version specified by the npm tag command, if no explicit tag is given.

                          -

                          tag-version-prefix

                          +

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

                          +

                          Also the tag that is added to the package@version specified by the npm tag +command, if no explicit tag is given.

                          +

                          tag-version-prefix

                            -
                          • Default: "v"
                          • +
                          • Default: “v”
                          • Type: String

                          If set, alters the prefix used when tagging a new version when performing a -version increment using npm-version. To remove the prefix altogether, set it -to the empty string: "".

                          -

                          Because other tools may rely on the convention that npm version tags look like -v1.0.0, only use this property if it is absolutely necessary. In +version increment using npm-version. To remove the prefix altogether, set +it to the empty string: "".

                          +

                          Because other tools may rely on the convention that npm version tags look +like v1.0.0, only use this property if it is absolutely necessary. In particular, use care when overriding this setting for public packages.

                          -

                          timing

                          +

                          timing

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

                          If true, writes an npm-debug log to _logs and timing information to -_timing.json, both in your cache. _timing.json is a newline delimited -list of JSON objects. You can quickly view it with this -json command line: -json -g < ~/.npm/_timing.json.

                          -

                          tmp

                          +_timing.json, both in your cache, even if the command completes +successfully. _timing.json is a newline delimited list of JSON objects.

                          +

                          You can quickly view it with this json command line: +npm exec -- json -g < ~/.npm/_timing.json.

                          +

                          umask

                            -
                          • Default: TMPDIR environment variable, or “/tmp”
                          • -
                          • Type: path
                          • +
                          • Default: 0
                          • +
                          • Type: Octal numeric string in range 0000..0777 (0..511)
                          -

                          Where to store temporary files and folders. All temp files are deleted -on success, but left behind on failure for forensic purposes.

                          -

                          unicode

                          -
                            -
                          • Default: false on windows, true on mac/unix systems with a unicode locale
                          • +

                            The “umask” value to use when setting the file creation mode on files and +folders.

                            +

                            Folders and executables are given a mode which is 0o777 masked against +this value. Other files are given a mode which is 0o666 masked against +this value.

                            +

                            Note that the underlying system will also apply its own umask value to +files and folders that are created, and npm does not circumvent this, but +rather adds the --umask config to it.

                            +

                            Thus, the effective default umask value on most POSIX systems is 0o22, +meaning that folders and executables are created with a mode of 0o755 and +other files are created with a mode of 0o644.

                            +

                            unicode

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

                            When set to true, npm uses unicode characters in the tree output. When -false, it uses ascii characters to draw trees.

                            -

                            update-notifier

                            +

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

                            +

                            update-notifier

                            • Default: true
                            • Type: Boolean
                            -

                            Set to false to suppress the update notification when using an older -version of npm than the latest.

                            -

                            usage

                            +

                            Set to false to suppress the update notification when using an older version +of npm than the latest.

                            +

                            usage

                            • Default: false
                            • Type: Boolean
                            -

                            Set to show short usage output (like the -H output) -instead of complete help when doing npm help.

                            -

                            userconfig

                            +

                            Show short usage output about the command specified.

                            +

                            user-agent

                              -
                            • Default: ~/.npmrc
                            • -
                            • Type: path
                            • +
                            • Default: “npm/{npm-version} node/{node-version} {platform} {arch} {ci}”
                            • +
                            • Type: String
                            -

                            The location of user-level configuration settings.

                            -

                            umask

                            +

                            Sets the User-Agent request header. The following fields are replaced with +their actual counterparts:

                              -
                            • Default: 022
                            • -
                            • Type: Octal numeric string in range 0000..0777 (0..511)
                            • +
                            • {npm-version} - The npm version in use
                            • +
                            • {node-version} - The Node.js version in use
                            • +
                            • {platform} - The value of process.platform
                            • +
                            • {arch} - The value of process.arch
                            • +
                            • {ci} - The value of the ci-name config, if set, prefixed with ci/, or +an empty string if ci-name is empty.
                            -

                            The “umask” value to use when setting the file creation mode on files -and folders.

                            -

                            Folders and executables are given a mode which is 0777 masked against -this value. Other files are given a mode which is 0666 masked against -this value. Thus, the defaults are 0755 and 0644 respectively.

                            -

                            user-agent

                            +

                            userconfig

                              -
                            • Default: node/{process.version} {process.platform} {process.arch}
                            • -
                            • Type: String
                            • +
                            • Default: “~/.npmrc”
                            • +
                            • Type: Path
                            -

                            Sets a User-Agent to the request header

                            -

                            version

                            +

                            The location of user-level configuration settings.

                            +

                            This may be overridden by the npm_config_userconfig environment variable +or the --userconfig command line option, but may not be overridden by +settings in the globalconfig file.

                            +

                            version

                            • Default: false
                            • -
                            • Type: boolean
                            • +
                            • Type: Boolean

                            If true, output the npm version and exit successfully.

                            Only relevant when specified explicitly on the command line.

                            -

                            versions

                            +

                            versions

                            • Default: false
                            • -
                            • Type: boolean
                            • +
                            • Type: Boolean
                            -

                            If true, output the npm version as well as node’s process.versions map, and -exit successfully.

                            +

                            If true, output the npm version as well as node’s process.versions map and +the version in the current working directory’s package.json file if one +exists, and exit successfully.

                            Only relevant when specified explicitly on the command line.

                            -

                            viewer

                            +

                            viewer

                            • Default: “man” on Posix, “browser” on Windows
                            • -
                            • Type: path
                            • +
                            • Type: String

                            The program to use to view help content.

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

                            +

                            which

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

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

                            +

                            workspace

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

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

                            +

                            Valid values for the workspace config are either: - Workspace names - Path +to a workspace directory - Path to a parent workspace directory (will result +to selecting all of the nested workspaces)

                            +

                            workspaces

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

                            Enable running a command in the context of all the configured +workspaces.

                            +

                            yes

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

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

                            +

                            also

                            +
                              +
                            • Default: null
                            • +
                            • Type: null, “dev”, or “development”
                            • +
                            • DEPRECATED: Please use –include=dev instead.
                            • +
                            +

                            When set to dev or development, this is an alias for --include=dev.

                            +

                            auth-type

                            +
                              +
                            • Default: “legacy”
                            • +
                            • Type: “legacy”, “sso”, “saml”, or “oauth”
                            • +
                            • DEPRECATED: This method of SSO/SAML/OAuth is deprecated and will be removed +in a future version of npm in favor of web-based login.
                            • +
                            +

                            What authentication strategy to use with adduser/login.

                            +

                            cache-max

                            +
                              +
                            • Default: Infinity
                            • +
                            • Type: Number
                            • +
                            • DEPRECATED: This option has been deprecated in favor of --prefer-online
                            • +
                            +

                            --cache-max=0 is an alias for --prefer-online

                            +

                            cache-min

                            +
                              +
                            • Default: 0
                            • +
                            • Type: Number
                            • +
                            • DEPRECATED: This option has been deprecated in favor of --prefer-offline.
                            • +
                            +

                            --cache-min=9999 (or bigger) is an alias for --prefer-offline.

                            +

                            init.author.email

                            +
                              +
                            • Default: “”
                            • +
                            • Type: String
                            • +
                            • DEPRECATED: Use --init-author-email instead.
                            • +
                            +

                            Alias for --init-author-email

                            +

                            init.author.name

                            +
                              +
                            • Default: “”
                            • +
                            • Type: String
                            • +
                            • DEPRECATED: Use --init-author-name instead.
                            • +
                            +

                            Alias for --init-author-name

                            +

                            init.author.url

                            +
                              +
                            • Default: “”
                            • +
                            • Type: “” or URL
                            • +
                            • DEPRECATED: Use --init-author-url instead.
                            • +
                            +

                            Alias for --init-author-url

                            +

                            init.license

                            +
                              +
                            • Default: “ISC”
                            • +
                            • Type: String
                            • +
                            • DEPRECATED: Use --init-license instead.
                            • +
                            +

                            Alias for --init-license

                            +

                            init.module

                            +
                              +
                            • Default: “~/.npm-init.js”
                            • +
                            • Type: Path
                            • +
                            • DEPRECATED: Use --init-module instead.
                            • +
                            +

                            Alias for --init-module

                            +

                            init.version

                            +
                              +
                            • Default: “1.0.0”
                            • +
                            • Type: SemVer string
                            • +
                            • DEPRECATED: Use --init-version instead.
                            • +
                            +

                            Alias for --init-version

                            +

                            only

                            +
                              +
                            • Default: null
                            • +
                            • Type: null, “prod”, or “production”
                            • +
                            • DEPRECATED: Use --omit=dev to omit dev dependencies from the install.
                            • +
                            +

                            When set to prod or production, this is an alias for --omit=dev.

                            +

                            optional

                            +
                              +
                            • Default: null
                            • +
                            • Type: null or Boolean
                            • +
                            • DEPRECATED: Use --omit=optional to exclude optional dependencies, or +--include=optional to include them.
                            • +
                            +

                            Default value does install optional deps unless otherwise omitted.

                            +

                            Alias for –include=optional or –omit=optional

                            +

                            production

                            +
                              +
                            • Default: false
                            • +
                            • Type: Boolean
                            • +
                            • DEPRECATED: Use --omit=dev instead.
                            • +
                            +

                            Alias for --omit=dev

                            +

                            shrinkwrap

                            +
                              +
                            • Default: true
                            • +
                            • Type: Boolean
                            • +
                            • DEPRECATED: Use the –package-lock setting instead.
                            • +
                            +

                            Alias for –package-lock

                            +

                            sso-poll-frequency

                            +
                              +
                            • Default: 500
                            • +
                            • Type: Number
                            • +
                            • DEPRECATED: The –auth-type method of SSO/SAML/OAuth will be removed in a +future version of npm in favor of web-based login.
                            • +
                            +

                            When used with SSO-enabled auth-types, configures how regularly the +registry should be polled while the user is completing authentication.

                            +

                            sso-type

                            +
                              +
                            • Default: “oauth”
                            • +
                            • Type: null, “oauth”, or “saml”
                            • +
                            • DEPRECATED: The –auth-type method of SSO/SAML/OAuth will be removed in a +future version of npm in favor of web-based login.
                            • +
                            +

                            If --auth-type=sso, the type of SSO type to use.

                            +

                            tmp

                            +
                              +
                            • Default: The value returned by the Node.js os.tmpdir() method +https://nodejs.org/api/os.html#os_os_tmpdir
                            • +
                            • Type: Path
                            • +
                            • DEPRECATED: This setting is no longer used. npm stores temporary files in a +special location in the cache, and they are managed by +cacache.
                            • +
                            +

                            Historically, the location where temporary files were stored. No longer +relevant.

                            +

                            See also

                            • npm config
                            • diff --git a/deps/npm/docs/output/using-npm/workspaces.html b/deps/npm/docs/output/using-npm/workspaces.html index ffec6467c4a515..0fb1391c7970c7 100644 --- a/deps/npm/docs/output/using-npm/workspaces.html +++ b/deps/npm/docs/output/using-npm/workspaces.html @@ -141,7 +141,7 @@

                              workspaces

                              Table of contents

                              - +

                              Description

                              @@ -206,10 +206,40 @@

                              Using workspaces

                              workspaces to enable a portable workflow for requiring each workspace in such a way that is also easy to publish these nested workspaces to be consumed elsewhere.

                              +

                              Running commands in the context of workspaces

                              +

                              You man use the workspace configuration option to run commands in the context +of a configured workspace.

                              +

                              Following is a quick example on how to use the npm run command in the context +of nested workspaces. For a project containing multiple workspaces, e.g:

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

                              By running a command using the workspace option, it’s possible to run the +given command in the context of that specific workspace. e.g:

                              +
                              npm run test --workspace=a
                              +
                              +

                              This will run the test script defined within the +./packages/a/package.json file.

                              +

                              Please note that you can also specify this argument multiple times in the +command-line in order to target multiple workspaces, e.g:

                              +
                              npm run test --workspace=a --workspace=b
                              +
                              +

                              It’s also possible to use the workspaces (plural) configuration option to +enable the same behavior but running that command in the context of all +configured workspaces. e.g:

                              +
                              npm run test --workspaces
                              +
                              +

                              Will run the test script in both ./packages/a and ./packages/b.

                              See also

                              diff --git a/deps/npm/lib/access.js b/deps/npm/lib/access.js index 0df36beeac15f3..3df611e5640c7a 100644 --- a/deps/npm/lib/access.js +++ b/deps/npm/lib/access.js @@ -20,6 +20,10 @@ const subcommands = [ ] class Access extends BaseCommand { + static get description () { + return 'Set access level on published packages' + } + static get name () { return 'access' } @@ -75,7 +79,7 @@ class Access extends BaseCommand { if (!subcommands.includes(cmd) || !this[cmd]) throw this.usageError(`${cmd} is not a recognized subcommand.`) - return this[cmd](args, { ...this.npm.flatOptions }) + return this[cmd](args, this.npm.flatOptions) } public ([pkg], opts) { diff --git a/deps/npm/lib/adduser.js b/deps/npm/lib/adduser.js index da318a1f3feb85..f35b9829fe946e 100644 --- a/deps/npm/lib/adduser.js +++ b/deps/npm/lib/adduser.js @@ -9,12 +9,20 @@ const authTypes = { } class AddUser extends BaseCommand { + static get description () { + return 'Add a registry user account' + } + static get name () { return 'adduser' } - static get usage () { - return ['[--registry=url] [--scope=@orgname] [--always-auth]'] + static get params () { + return [ + 'registry', + 'scope', + 'always-auth', + ] } exec (args, cb) { diff --git a/deps/npm/lib/audit.js b/deps/npm/lib/audit.js index 6e64987b612ae5..f990e1fa5efaa9 100644 --- a/deps/npm/lib/audit.js +++ b/deps/npm/lib/audit.js @@ -5,19 +5,32 @@ const auditError = require('./utils/audit-error.js') const BaseCommand = require('./base-command.js') class Audit extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Run a security audit' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'audit' } /* istanbul ignore next - see test/lib/load-all-commands.js */ - static get usage () { + static get params () { return [ - '[--json] [--production]', - 'fix [--force|--package-lock-only|--dry-run|--production|--only=(dev|prod)]', + 'dry-run', + 'force', + 'json', + 'package-lock-only', + 'production', ] } + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get usage () { + return ['[fix]'] + } + async completion (opts) { const argv = opts.conf.argv.remain @@ -37,11 +50,14 @@ class Audit extends BaseCommand { } async audit (args) { - const arb = new Arborist({ + const reporter = this.npm.config.get('json') ? 'json' : 'detail' + const opts = { ...this.npm.flatOptions, audit: true, path: this.npm.prefix, - }) + reporter, + } + const arb = new Arborist(opts) const fix = args[0] === 'fix' await arb.audit({ fix }) if (fix) @@ -49,11 +65,7 @@ class Audit extends BaseCommand { else { // will throw if there's an error, because this is an audit command auditError(this.npm, arb.auditReport) - const reporter = this.npm.flatOptions.json ? 'json' : 'detail' - const result = auditReport(arb.auditReport, { - ...this.npm.flatOptions, - reporter, - }) + const result = auditReport(arb.auditReport, opts) process.exitCode = process.exitCode || result.exitCode this.npm.output(result.report) } diff --git a/deps/npm/lib/base-command.js b/deps/npm/lib/base-command.js index 8e48caa2ef4c72..7a9e4b8ee377eb 100644 --- a/deps/npm/lib/base-command.js +++ b/deps/npm/lib/base-command.js @@ -1,11 +1,20 @@ // Base class for npm.commands[cmd] const usageUtil = require('./utils/usage.js') +const ConfigDefinitions = require('./utils/config/definitions.js') class BaseCommand { constructor (npm) { this.npm = npm } + get name () { + return this.constructor.name + } + + get description () { + return this.constructor.description + } + get usage () { let usage = `npm ${this.constructor.name}\n\n` if (this.constructor.description) @@ -17,6 +26,9 @@ class BaseCommand { else usage = `${usage}${this.constructor.usage.map(u => `npm ${this.constructor.name} ${u}`).join('\n')}` + if (this.constructor.params) + usage = `${usage}\n\nOptions:\n[${this.constructor.params.map(p => ConfigDefinitions[p].usage).join('] [')}]` + // Mostly this just appends aliases, this could be more clear usage = usageUtil(this.constructor.name, usage) usage = `${usage}\n\nRun "npm help ${this.constructor.name}" for more info` @@ -34,5 +46,12 @@ class BaseCommand { code: 'EUSAGE', }) } + + execWorkspaces (args, filters, cb) { + throw Object.assign( + new Error('This command does not support workspaces.'), + { code: 'ENOWORKSPACES' } + ) + } } module.exports = BaseCommand diff --git a/deps/npm/lib/bin.js b/deps/npm/lib/bin.js index 1450fb539bffaf..20e13f160f2761 100644 --- a/deps/npm/lib/bin.js +++ b/deps/npm/lib/bin.js @@ -2,12 +2,16 @@ const envPath = require('./utils/path.js') const BaseCommand = require('./base-command.js') class Bin extends BaseCommand { + static get description () { + return 'Display npm bin folder' + } + static get name () { return 'bin' } - static get usage () { - return ['[-g]'] + static get params () { + return ['global'] } exec (args, cb) { @@ -17,7 +21,7 @@ class Bin extends BaseCommand { async bin (args) { const b = this.npm.bin this.npm.output(b) - if (this.npm.flatOptions.global && !envPath.includes(b)) + if (this.npm.config.get('global') && !envPath.includes(b)) console.error('(not in PATH env variable)') } } diff --git a/deps/npm/lib/birthday.js b/deps/npm/lib/birthday.js index 5ea855512f9f69..92b1dd1c2e5fe8 100644 --- a/deps/npm/lib/birthday.js +++ b/deps/npm/lib/birthday.js @@ -1,16 +1,9 @@ -class Birthday { - constructor (npm) { - this.npm = npm - Object.defineProperty(this.npm, 'flatOptions', { - value: { - ...npm.flatOptions, - package: ['@npmcli/npm-birthday'], - yes: true, - }, - }) - } +const BaseCommand = require('./base-command.js') +class Birthday extends BaseCommand { exec (args, cb) { + this.npm.config.set('package', ['@npmcli/npm-birthday']) + this.npm.config.set('yes', true) return this.npm.commands.exec(['npm-birthday'], cb) } } diff --git a/deps/npm/lib/bugs.js b/deps/npm/lib/bugs.js index 1814dd7bc461e1..a0cef4c5ec4faf 100644 --- a/deps/npm/lib/bugs.js +++ b/deps/npm/lib/bugs.js @@ -5,6 +5,10 @@ const hostedFromMani = require('./utils/hosted-git-info-from-manifest.js') const BaseCommand = require('./base-command.js') class Bugs extends BaseCommand { + static get description () { + return 'Report bugs for a package in a web browser' + } + static get name () { return 'bugs' } diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js index 80a5c68ebc0e99..43902f43bbee19 100644 --- a/deps/npm/lib/cache.js +++ b/deps/npm/lib/cache.js @@ -7,6 +7,10 @@ const rimraf = promisify(require('rimraf')) const BaseCommand = require('./base-command.js') class Cache extends BaseCommand { + static get description () { + return 'Manipulates packages cache' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'cache' @@ -63,7 +67,7 @@ class Cache extends BaseCommand { throw new Error('npm cache clear does not accept arguments') const cachePath = path.join(this.npm.cache, '_cacache') - if (!this.npm.flatOptions.force) { + if (!this.npm.config.get('force')) { throw new Error(`As of npm@5, the npm cache self-heals from corruption issues by treating integrity mismatches as cache misses. As a result, data extracted from the cache is guaranteed to be valid. If you @@ -100,7 +104,6 @@ with --force.`) throw Object.assign(new Error(usage), { code: 'EUSAGE' }) log.silly('cache add', 'spec', spec) - const opts = { ...this.npm.flatOptions } // we ask pacote for the thing, and then just throw the data // away so that it tee-pipes it into the cache like it does @@ -108,7 +111,7 @@ with --force.`) await pacote.tarball.stream(spec, stream => { stream.resume() return stream.promise() - }, opts) + }, this.npm.flatOptions) } async verify () { diff --git a/deps/npm/lib/ci.js b/deps/npm/lib/ci.js index 3ea19937616e65..b73b3a85911148 100644 --- a/deps/npm/lib/ci.js +++ b/deps/npm/lib/ci.js @@ -20,6 +20,11 @@ const removeNodeModules = async where => { const BaseCommand = require('./base-command.js') class CI extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Install a project with a clean slate' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'ci' @@ -30,14 +35,13 @@ class CI extends BaseCommand { } async ci () { - if (this.npm.flatOptions.global) { + if (this.npm.config.get('global')) { const err = new Error('`npm ci` does not work for global packages') err.code = 'ECIGLOBAL' throw err } const where = this.npm.prefix - const { scriptShell, ignoreScripts } = this.npm.flatOptions const arb = new Arborist({ ...this.npm.flatOptions, path: where }) await Promise.all([ @@ -54,6 +58,7 @@ class CI extends BaseCommand { // npm ci should never modify the lockfile or package.json await arb.reify({ ...this.npm.flatOptions, save: false }) + const ignoreScripts = this.npm.config.get('ignore-scripts') // run the same set of scripts that `npm install` runs. if (!ignoreScripts) { const scripts = [ @@ -65,6 +70,7 @@ class CI extends BaseCommand { 'prepare', 'postprepare', ] + const scriptShell = this.npm.config.get('script-shell') || undefined for (const event of scripts) { await runScript({ path: where, diff --git a/deps/npm/lib/cli.js b/deps/npm/lib/cli.js index 910b674eaa790f..46859f150e3b9d 100644 --- a/deps/npm/lib/cli.js +++ b/deps/npm/lib/cli.js @@ -40,11 +40,14 @@ module.exports = (process) => { npm.load(async er => { if (er) return errorHandler(er) + + // npm --version=cli if (npm.config.get('version', 'cli')) { - console.log(npm.version) + npm.output(npm.version) return errorHandler.exit(0) } + // npm --versions=cli if (npm.config.get('versions', 'cli')) { npm.argv = ['version'] npm.config.set('usage', false, 'cli') @@ -57,9 +60,20 @@ module.exports = (process) => { if (impl) impl(npm.argv, errorHandler) else { - npm.config.set('usage', false) - npm.argv.unshift(cmd) - npm.commands.help(npm.argv, errorHandler) + try { + // I don't know why this is needed but we get a cb() not called if we + // omit it + npm.log.level = 'silent' + if (cmd) { + const didYouMean = require('./utils/did-you-mean.js') + const suggestions = await didYouMean(npm, npm.localPrefix, cmd) + npm.output(`Unknown command: "${cmd}"${suggestions}\n\nTo see a list of supported npm commands, run:\n npm help`) + } else + npm.output(npm.usage) + process.exitCode = 1 + } catch (err) { + errorHandler(err) + } } }) } diff --git a/deps/npm/lib/completion.js b/deps/npm/lib/completion.js index 3ee68cdacaf95e..fa3b5f2dd36ccc 100644 --- a/deps/npm/lib/completion.js +++ b/deps/npm/lib/completion.js @@ -29,13 +29,13 @@ // as an array. // -const { types, shorthands } = require('./utils/config.js') +const { definitions, shorthands } = require('./utils/config/index.js') const deref = require('./utils/deref-command.js') const { aliases, cmdList, plumbing } = require('./utils/cmd-list.js') const aliasNames = Object.keys(aliases) const fullList = cmdList.concat(aliasNames).filter(c => !plumbing.includes(c)) const nopt = require('nopt') -const configNames = Object.keys(types) +const configNames = Object.keys(definitions) const shorthandNames = Object.keys(shorthands) const allConfs = configNames.concat(shorthandNames) const isWindowsShell = require('./utils/is-windows-shell.js') @@ -46,13 +46,13 @@ const BaseCommand = require('./base-command.js') class Completion extends BaseCommand { /* istanbul ignore next - see test/lib/load-all-commands.js */ - static get name () { - return 'completion' + static get description () { + return 'Tab Completion for npm' } /* istanbul ignore next - see test/lib/load-all-commands.js */ - static get description () { - return 'npm command completion script. save to ~/.bashrc or ~/.zshrc' + static get name () { + return 'completion' } // completion for the completion command @@ -147,6 +147,10 @@ class Completion extends BaseCommand { // take a little shortcut and use npm's arg parsing logic. // don't have to worry about the last arg being implicitly // boolean'ed, since the last block will catch that. + const types = Object.entries(definitions).reduce((types, [key, def]) => { + types[key] = def.type + return types + }, {}) const parsed = opts.conf = nopt(types, shorthands, partialWords.slice(0, -1), 0) // check if there's a command already. @@ -256,7 +260,7 @@ const isFlag = word => { const split = word.match(/^(-*)((?:no-)+)?(.*)$/) const no = split[2] const conf = split[3] - const type = types[conf] + const {type} = definitions[conf] return no || type === Boolean || (Array.isArray(type) && type.includes(Boolean)) || diff --git a/deps/npm/lib/config.js b/deps/npm/lib/config.js index c29253e430a33a..d5ef6ec50a5e60 100644 --- a/deps/npm/lib/config.js +++ b/deps/npm/lib/config.js @@ -1,4 +1,5 @@ -const { defaults, types } = require('./utils/config.js') +// don't expand so that we only assemble the set of defaults when needed +const configDefs = require('./utils/config/index.js') const mkdirp = require('mkdirp-infer-owner') const { dirname } = require('path') @@ -29,6 +30,10 @@ const publicVar = k => !/^(\/\/[^:]+:)?_/.test(k) const BaseCommand = require('./base-command.js') class Config extends BaseCommand { + static get description () { + return 'Manage the npm configuration files' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'config' @@ -70,7 +75,7 @@ class Config extends BaseCommand { case 'get': case 'delete': case 'rm': - return Object.keys(types) + return Object.keys(configDefs.definitions) case 'edit': case 'list': case 'ls': @@ -100,7 +105,7 @@ class Config extends BaseCommand { break case 'list': case 'ls': - await (this.npm.flatOptions.json ? this.listJson() : this.list()) + await (this.npm.config.get('json') ? this.listJson() : this.list()) break case 'edit': await this.edit() @@ -117,7 +122,7 @@ class Config extends BaseCommand { if (!args.length) throw this.usageError() - const where = this.npm.flatOptions.global ? 'global' : 'user' + const where = this.npm.config.get('global') ? 'global' : 'user' for (const [key, val] of Object.entries(keyValues(args))) { this.npm.log.info('config', 'set %j %j', key, val) this.npm.config.set(key, val || '', where) @@ -147,14 +152,15 @@ class Config extends BaseCommand { if (!keys.length) throw this.usageError() - const where = this.npm.flatOptions.global ? 'global' : 'user' + const where = this.npm.config.get('global') ? 'global' : 'user' for (const key of keys) this.npm.config.delete(key, where) await this.npm.config.save(where) } async edit () { - const { editor: e, global } = this.npm.flatOptions + const global = this.npm.config.get('global') + const e = this.npm.config.get('editor') const where = global ? 'global' : 'user' const file = this.npm.config.data.get(where).source @@ -165,7 +171,8 @@ class Config extends BaseCommand { const data = ( await readFile(file, 'utf8').catch(() => '') ).replace(/\r\n/g, '\n') - const defData = Object.entries(defaults).reduce((str, [key, val]) => { + const entries = Object.entries(configDefs.defaults) + const defData = entries.reduce((str, [key, val]) => { const obj = { [key]: val } const i = ini.stringify(obj) .replace(/\r\n/g, '\n') // normalizes output from ini.stringify @@ -210,7 +217,7 @@ ${defData} async list () { const msg = [] - const { long } = this.npm.flatOptions + const long = this.npm.config.get('long') for (const [where, { data, source }] of this.npm.config.data.entries()) { if (where === 'default' && !long) continue diff --git a/deps/npm/lib/dedupe.js b/deps/npm/lib/dedupe.js index 50a56211fc8479..b80a777fcc2f75 100644 --- a/deps/npm/lib/dedupe.js +++ b/deps/npm/lib/dedupe.js @@ -5,6 +5,11 @@ const reifyFinish = require('./utils/reify-finish.js') const BaseCommand = require('./base-command.js') class Dedupe extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Reduce duplication in the package tree' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'dedupe' @@ -23,12 +28,13 @@ class Dedupe extends BaseCommand { const dryRun = this.npm.config.get('dry-run') const where = this.npm.prefix - const arb = new Arborist({ + const opts = { ...this.npm.flatOptions, path: where, dryRun, - }) - await arb.dedupe(this.npm.flatOptions) + } + const arb = new Arborist(opts) + await arb.dedupe(opts) await reifyFinish(this.npm, arb) } } diff --git a/deps/npm/lib/deprecate.js b/deps/npm/lib/deprecate.js index a0c67f805d2f92..c640bcfe09538a 100644 --- a/deps/npm/lib/deprecate.js +++ b/deps/npm/lib/deprecate.js @@ -7,6 +7,10 @@ const libaccess = require('libnpmaccess') const BaseCommand = require('./base-command.js') class Deprecate extends BaseCommand { + static get description () { + return 'Deprecate a version of a package' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'deprecate' diff --git a/deps/npm/lib/diff.js b/deps/npm/lib/diff.js index 0e322ec6438494..c5e4b403efdfa0 100644 --- a/deps/npm/lib/diff.js +++ b/deps/npm/lib/diff.js @@ -12,6 +12,10 @@ const readLocalPkg = require('./utils/read-local-package.js') const BaseCommand = require('./base-command.js') class Diff extends BaseCommand { + static get description () { + return 'The registry diff command' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'diff' @@ -30,7 +34,7 @@ class Diff extends BaseCommand { get where () { const globalTop = resolve(this.npm.globalDir, '..') - const { global } = this.npm.flatOptions + const global = this.npm.config.get('global') return global ? globalTop : this.npm.prefix } @@ -39,7 +43,7 @@ class Diff extends BaseCommand { } async diff (args) { - const specs = this.npm.flatOptions.diff.filter(d => d) + const specs = this.npm.config.get('diff').filter(d => d) if (specs.length > 2) { throw new TypeError( 'Can\'t use more than two --diff arguments.\n\n' + @@ -91,7 +95,7 @@ class Diff extends BaseCommand { } return [ - `${pkgName}@${this.npm.flatOptions.defaultTag}`, + `${pkgName}@${this.npm.config.get('tag')}`, `file:${this.npm.prefix}`, ] } diff --git a/deps/npm/lib/dist-tag.js b/deps/npm/lib/dist-tag.js index cdc95ac6f0cd7a..13ec37fd8cb1d4 100644 --- a/deps/npm/lib/dist-tag.js +++ b/deps/npm/lib/dist-tag.js @@ -8,6 +8,10 @@ const readLocalPkgName = require('./utils/read-local-package.js') const BaseCommand = require('./base-command.js') class DistTag extends BaseCommand { + static get description () { + return 'Modify package distribution tags' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'dist-tag' @@ -61,7 +65,7 @@ class DistTag extends BaseCommand { async add (spec, tag, opts) { spec = npa(spec || '') const version = spec.rawSpec - const defaultTag = tag || opts.defaultTag + const defaultTag = tag || this.npm.config.get('tag') log.verbose('dist-tag add', defaultTag, 'to', spec.name + '@' + version) diff --git a/deps/npm/lib/docs.js b/deps/npm/lib/docs.js index 2dad7a26db4e74..089d77eb046d93 100644 --- a/deps/npm/lib/docs.js +++ b/deps/npm/lib/docs.js @@ -1,17 +1,23 @@ const log = require('npmlog') const pacote = require('pacote') const openUrl = require('./utils/open-url.js') -const usageUtil = require('./utils/usage.js') const hostedFromMani = require('./utils/hosted-git-info-from-manifest.js') -class Docs { - constructor (npm) { - this.npm = npm +const BaseCommand = require('./base-command.js') +class Docs extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Open documentation for a package in a web browser' + } + + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get name () { + return 'docs' } /* istanbul ignore next - see test/lib/load-all-commands.js */ - get usage () { - return usageUtil('docs', 'npm docs [ [ ...]]') + static get usage () { + return ['[ [ ...]]'] } exec (args, cb) { diff --git a/deps/npm/lib/doctor.js b/deps/npm/lib/doctor.js index fbe44714140aad..99beb25279cbc3 100644 --- a/deps/npm/lib/doctor.js +++ b/deps/npm/lib/doctor.js @@ -11,7 +11,7 @@ const { promisify } = require('util') const ansiTrim = require('./utils/ansi-trim.js') const isWindows = require('./utils/is-windows.js') const ping = require('./utils/ping.js') -const { defaults: { registry: defaultRegistry } } = require('./utils/config.js') +const { registry: { default: defaultRegistry } } = require('./utils/config/definitions.js') const lstat = promisify(fs.lstat) const readdir = promisify(fs.readdir) const access = promisify(fs.access) @@ -32,6 +32,11 @@ const maskLabel = mask => { const BaseCommand = require('./base-command.js') class Doctor extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Check your npm environment' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'doctor' diff --git a/deps/npm/lib/edit.js b/deps/npm/lib/edit.js index 1dbe8e4c103ad5..79d41462eb47f4 100644 --- a/deps/npm/lib/edit.js +++ b/deps/npm/lib/edit.js @@ -9,6 +9,10 @@ const completion = require('./utils/completion/installed-shallow.js') const BaseCommand = require('./base-command.js') class Edit extends BaseCommand { + static get description () { + return 'Edit an installed package' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'edit' diff --git a/deps/npm/lib/exec.js b/deps/npm/lib/exec.js index b2443b17accd2f..0a61de7c1200cd 100644 --- a/deps/npm/lib/exec.js +++ b/deps/npm/lib/exec.js @@ -1,5 +1,6 @@ const { promisify } = require('util') const read = promisify(require('read')) +const chalk = require('chalk') const mkdirp = require('mkdirp-infer-owner') const readPackageJson = require('read-package-json-fast') const Arborist = require('@npmcli/arborist') @@ -12,6 +13,7 @@ const npa = require('npm-package-arg') const fileExists = require('./utils/file-exists.js') const PATH = require('./utils/path.js') const BaseCommand = require('./base-command.js') +const getWorkspaces = require('./workspaces/get-workspaces.js') // it's like this: // @@ -24,7 +26,7 @@ const BaseCommand = require('./base-command.js') // // npm x -p pkg@version -- foo --registry=/dev/null // -// const pkg = npm.flatOptions.package || getPackageFrom(args[0]) +// const pkg = npm.config.get('package') || getPackageFrom(args[0]) // const cmd = getCommand(pkg, args[0]) // --> npm x -c 'cmd ...args.slice(1)' // @@ -38,15 +40,22 @@ const BaseCommand = require('./base-command.js') // runScript({ pkg, event: 'npx', ... }) // process.env.npm_lifecycle_event = 'npx' +const nocolor = { + reset: s => s, + bold: s => s, + dim: s => s, + green: s => s, +} + class Exec extends BaseCommand { /* istanbul ignore next - see test/lib/load-all-commands.js */ - static get name () { - return 'exec' + static get description () { + return 'Run a command from a local or remote npm package' } /* istanbul ignore next - see test/lib/load-all-commands.js */ - static get description () { - return 'Run a command from a local or remote npm package.' + static get name () { + return 'exec' } /* istanbul ignore next - see test/lib/load-all-commands.js */ @@ -60,17 +69,27 @@ class Exec extends BaseCommand { } exec (args, cb) { - this._exec(args).then(() => cb()).catch(cb) + const path = this.npm.localPrefix + const runPath = process.cwd() + this._exec(args, { path, runPath }).then(() => cb()).catch(cb) + } + + execWorkspaces (args, filters, cb) { + this._execWorkspaces(args, filters).then(() => cb()).catch(cb) } // When commands go async and we can dump the boilerplate exec methods this // can be named correctly - async _exec (args) { - const { package: packages, call, shell } = this.npm.flatOptions + async _exec (_args, { locationMsg, path, runPath }) { + const call = this.npm.config.get('call') + const shell = this.npm.config.get('shell') + // dereferenced because we manipulate it later + const packages = [...this.npm.config.get('package')] - if (call && args.length) + if (call && _args.length) throw this.usage + const args = [..._args] const pathArr = [...PATH] // nothing to maybe install, skip the arborist dance @@ -78,8 +97,11 @@ class Exec extends BaseCommand { return await this.run({ args, call, + locationMsg, shell, + path, pathArr, + runPath, }) } @@ -102,7 +124,10 @@ class Exec extends BaseCommand { return await this.run({ args, call, + locationMsg, + path, pathArr, + runPath, shell, }) } @@ -117,11 +142,11 @@ class Exec extends BaseCommand { // node_modules/${name}/package.json, and only pacote fetch if // that fails. const manis = await Promise.all(packages.map(async p => { - const spec = npa(p, this.npm.localPrefix) + const spec = npa(p, path) if (spec.type === 'tag' && spec.rawSpec === '') { // fall through to the pacote.manifest() approach try { - const pj = resolve(this.npm.localPrefix, 'node_modules', spec.name) + const pj = resolve(path, 'node_modules', spec.name) return await readPackageJson(pj) } catch (er) {} } @@ -140,7 +165,7 @@ class Exec extends BaseCommand { // figure out whether we need to install stuff, or if local is fine const localArb = new Arborist({ ...this.npm.flatOptions, - path: this.npm.localPrefix, + path, }) const tree = await localArb.loadActual() @@ -165,10 +190,10 @@ class Exec extends BaseCommand { // no need to install if already present if (add.length) { - if (!this.npm.flatOptions.yes) { + if (!this.npm.config.get('yes')) { // set -n to always say no - if (this.npm.flatOptions.yes === false) - throw 'canceled' + if (this.npm.config.get('yes') === false) + throw new Error('canceled') if (!process.stdin.isTTY || ciDetect()) { this.npm.log.warn('exec', `The following package${ @@ -184,7 +209,7 @@ class Exec extends BaseCommand { }Ok to proceed? ` const confirm = await read({ prompt, default: 'y' }) if (confirm.trim().toLowerCase().charAt(0) !== 'y') - throw 'canceled' + throw new Error('canceled') } } await arb.reify({ ...this.npm.flatOptions, add }) @@ -192,16 +217,24 @@ class Exec extends BaseCommand { pathArr.unshift(resolve(installDir, 'node_modules/.bin')) } - return await this.run({ args, call, pathArr, shell }) + return await this.run({ + args, + call, + locationMsg, + path, + pathArr, + runPath, + shell, + }) } - async run ({ args, call, pathArr, shell }) { + async run ({ args, call, locationMsg, path, pathArr, runPath, shell }) { // turn list of args into command string const script = call || args.shift() || shell // do the fakey runScript dance // still should work if no package.json in cwd - const realPkg = await readPackageJson(`${this.npm.localPrefix}/package.json`) + const realPkg = await readPackageJson(`${path}/package.json`) .catch(() => ({})) const pkg = { ...realPkg, @@ -217,7 +250,19 @@ class Exec extends BaseCommand { if (process.stdin.isTTY) { if (ciDetect()) return this.npm.log.warn('exec', 'Interactive mode disabled in CI environment') - this.npm.output(`\nEntering npm script environment\nType 'exit' or ^D when finished\n`) + + const color = this.npm.config.get('color') + const colorize = color ? chalk : nocolor + + locationMsg = locationMsg || ` at location:\n${colorize.dim(runPath)}` + + this.npm.output(`${ + colorize.reset('\nEntering npm script environment') + }${ + colorize.reset(locationMsg) + }${ + colorize.bold('\nType \'exit\' or ^D when finished\n') + }`) } } return await runScript({ @@ -225,7 +270,7 @@ class Exec extends BaseCommand { pkg, banner: false, // we always run in cwd, not --prefix - path: process.cwd(), + path: runPath, stdioString: true, event: 'npx', args, @@ -285,5 +330,28 @@ class Exec extends BaseCommand { .digest('hex') .slice(0, 16) } + + async workspaces (filters) { + return getWorkspaces(filters, { path: this.npm.localPrefix }) + } + + async _execWorkspaces (args, filters) { + const workspaces = await this.workspaces(filters) + const getLocationMsg = async path => { + const color = this.npm.config.get('color') + const colorize = color ? chalk : nocolor + const { _id } = await readPackageJson(`${path}/package.json`) + return ` in workspace ${colorize.green(_id)} at location:\n${colorize.dim(path)}` + } + + for (const workspacePath of workspaces.values()) { + const locationMsg = await getLocationMsg(workspacePath) + await this._exec(args, { + locationMsg, + path: workspacePath, + runPath: workspacePath, + }) + } + } } module.exports = Exec diff --git a/deps/npm/lib/explain.js b/deps/npm/lib/explain.js index 6af7611867786d..4c2908df68918d 100644 --- a/deps/npm/lib/explain.js +++ b/deps/npm/lib/explain.js @@ -8,6 +8,10 @@ const validName = require('validate-npm-package-name') const BaseCommand = require('./base-command.js') class Explain extends BaseCommand { + static get description () { + return 'Explain installed packages' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'explain' diff --git a/deps/npm/lib/explore.js b/deps/npm/lib/explore.js index 34f6d10793c7ea..5f9820c2162b6e 100644 --- a/deps/npm/lib/explore.js +++ b/deps/npm/lib/explore.js @@ -8,6 +8,10 @@ const completion = require('./utils/completion/installed-shallow.js') const BaseCommand = require('./base-command.js') class Explore extends BaseCommand { + static get description () { + return 'Browse an installed package' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'explore' diff --git a/deps/npm/lib/find-dupes.js b/deps/npm/lib/find-dupes.js index ecb945f47bb41d..8037876f5bbb68 100644 --- a/deps/npm/lib/find-dupes.js +++ b/deps/npm/lib/find-dupes.js @@ -2,6 +2,11 @@ const BaseCommand = require('./base-command.js') class FindDupes extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Find duplication in the package tree' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'find-dupes' diff --git a/deps/npm/lib/fund.js b/deps/npm/lib/fund.js index a723c62d2c3c51..25d3462f638693 100644 --- a/deps/npm/lib/fund.js +++ b/deps/npm/lib/fund.js @@ -22,14 +22,29 @@ const getPrintableName = ({ name, version }) => { const BaseCommand = require('./base-command.js') class Fund extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Retrieve funding information' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'fund' } + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get params () { + return [ + 'json', + 'browser', + 'unicode', + 'which', + ] + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get usage () { - return ['[--json] [--browser] [--unicode] [[<@scope>/] [--which=]'] + return ['[[<@scope>/]]'] } /* istanbul ignore next - see test/lib/load-all-commands.js */ @@ -42,14 +57,13 @@ class Fund extends BaseCommand { } async fund (args) { - const opts = this.npm.flatOptions const spec = args[0] - const numberArg = opts.which + const numberArg = this.npm.config.get('which') const fundingSourceNumber = numberArg && parseInt(numberArg, 10) const badFundingSourceNumber = - numberArg !== undefined && + numberArg !== null && (String(fundingSourceNumber) !== numberArg || fundingSourceNumber < 1) if (badFundingSourceNumber) { @@ -58,14 +72,14 @@ class Fund extends BaseCommand { throw err } - if (opts.global) { + if (this.npm.config.get('global')) { const err = new Error('`npm fund` does not support global packages') err.code = 'EFUNDGLOBAL' throw err } const where = this.npm.prefix - const arb = new Arborist({ ...opts, path: where }) + const arb = new Arborist({ ...this.npm.flatOptions, path: where }) const tree = await arb.loadActual() if (spec) { @@ -78,23 +92,19 @@ class Fund extends BaseCommand { return } - const print = opts.json - ? this.printJSON - : this.printHuman - - this.npm.output( - print( - getFundingInfo(tree), - opts - ) - ) + if (this.npm.config.get('json')) + this.npm.output(this.printJSON(getFundingInfo(tree))) + else + this.npm.output(this.printHuman(getFundingInfo(tree))) } printJSON (fundingInfo) { return JSON.stringify(fundingInfo, null, 2) } - printHuman (fundingInfo, { color, unicode }) { + printHuman (fundingInfo) { + const color = !!this.npm.color + const unicode = this.npm.config.get('unicode') const seenUrls = new Map() const tree = obj => diff --git a/deps/npm/lib/get.js b/deps/npm/lib/get.js index a5d58accc83070..8cfb259a81323b 100644 --- a/deps/npm/lib/get.js +++ b/deps/npm/lib/get.js @@ -1,6 +1,11 @@ const BaseCommand = require('./base-command.js') class Get extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Get a value from the npm configuration' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'get' diff --git a/deps/npm/lib/help-search.js b/deps/npm/lib/help-search.js index 4e727c3e72954a..c1ceae4414c2fb 100644 --- a/deps/npm/lib/help-search.js +++ b/deps/npm/lib/help-search.js @@ -1,15 +1,16 @@ const fs = require('fs') const path = require('path') const color = require('ansicolors') -const npmUsage = require('./utils/npm-usage.js') const { promisify } = require('util') const glob = promisify(require('glob')) const readFile = promisify(fs.readFile) -const didYouMean = require('./utils/did-you-mean.js') -const { cmdList } = require('./utils/cmd-list.js') const BaseCommand = require('./base-command.js') class HelpSearch extends BaseCommand { + static get description () { + return 'Search npm help documentation' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'help-search' @@ -26,28 +27,17 @@ class HelpSearch extends BaseCommand { async helpSearch (args) { if (!args.length) - throw this.usage + return this.npm.output(this.usage) const docPath = path.resolve(__dirname, '..', 'docs/content') - const files = await glob(`${docPath}/*/*.md`) const data = await this.readFiles(files) const results = await this.searchFiles(args, data, files) - // if only one result, then just show that help section. - if (results.length === 1) { - return this.npm.commands.help([path.basename(results[0].file, '.md')], er => { - if (er) - throw er - }) - } - const formatted = this.formatResults(args, results) if (!formatted.trim()) - npmUsage(this.npm, false) - else { + this.npm.output(`No matches in help for: ${args.join(' ')}\n`) + else this.npm.output(formatted) - this.npm.output(didYouMean(args[0], cmdList)) - } } async readFiles (files) { @@ -166,7 +156,7 @@ class HelpSearch extends BaseCommand { out.push(' '.repeat((Math.max(1, cols - out.join(' ').length - r.length - 1)))) out.push(r) - if (!this.npm.flatOptions.long) + if (!this.npm.config.get('long')) return out.join('') out.unshift('\n\n') @@ -198,7 +188,7 @@ class HelpSearch extends BaseCommand { return out.join('') }).join('\n') - const finalOut = results.length && !this.npm.flatOptions.long + const finalOut = results.length && !this.npm.config.get('long') ? 'Top hits for ' + (args.map(JSON.stringify).join(' ')) + '\n' + '—'.repeat(cols - 1) + '\n' + out + '\n' + diff --git a/deps/npm/lib/help.js b/deps/npm/lib/help.js index 93abf878ba26fa..b9ff1c95760c6a 100644 --- a/deps/npm/lib/help.js +++ b/deps/npm/lib/help.js @@ -1,13 +1,22 @@ -const npmUsage = require('./utils/npm-usage.js') const { spawn } = require('child_process') const path = require('path') -const log = require('npmlog') const openUrl = require('./utils/open-url.js') -const glob = require('glob') +const { promisify } = require('util') +const glob = promisify(require('glob')) const BaseCommand = require('./base-command.js') +// Strips out the number from foo.7 or foo.7. or foo.7.tgz +// We don't currently compress our man pages but if we ever did this would +// seemlessly continue supporting it +const manNumberRegex = /\.(\d+)(\..*)?$/ + class Help extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Get help on npm' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'help' @@ -22,13 +31,7 @@ class Help extends BaseCommand { if (opts.conf.argv.remain.length > 2) return [] const g = path.resolve(__dirname, '../man/man[0-9]/*.[0-9]') - const files = await new Promise((resolve, reject) => { - glob(g, function (er, files) { - if (er) - return reject(er) - resolve(files) - }) - }) + const files = await glob(g) return Object.keys(files.reduce(function (acc, file) { file = path.basename(file).replace(/\.[0-9]+$/, '') @@ -43,81 +46,45 @@ class Help extends BaseCommand { } async help (args) { - const argv = this.npm.config.parsedArgv.cooked + // By default we search all of our man subdirectories, but if the user has + // asked for a specific one we limit the search to just there + let manSearch = 'man*' + if (/^\d+$/.test(args[0])) + manSearch = `man${args.shift()}` - let argnum = 0 - if (args.length === 2 && ~~args[0]) - argnum = ~~args.shift() + if (!args.length) + return this.npm.output(this.npm.usage) // npm help foo bar baz: search topics - if (args.length > 1 && args[0]) + if (args.length > 1) return this.helpSearch(args) - const affordances = { - 'find-dupes': 'dedupe', - } - let section = affordances[args[0]] || this.npm.deref(args[0]) || args[0] - - // npm help : show basic usage - if (!section) { - npmUsage(this.npm, argv[0] === 'help') - return - } - - // npm -h: show command usage - if (this.npm.config.get('usage') && - this.npm.commands[section] && - this.npm.commands[section].usage) { - this.npm.config.set('loglevel', 'silent') - log.level = 'silent' - this.npm.output(this.npm.commands[section].usage) - return - } + let section = this.npm.deref(args[0]) || args[0] - let pref = [1, 5, 7] - if (argnum) - pref = [argnum].concat(pref.filter(n => n !== argnum)) + // support `npm help package.json` + section = section.replace('.json', '-json') - // npm help
                              : Try to find the path const manroot = path.resolve(__dirname, '..', 'man') + // find either section.n or npm-section.n + const f = `${manroot}/${manSearch}/?(npm-)${section}.[0-9]*` + let mans = await glob(f) + mans = mans.sort((a, b) => { + // Because of the glob we know the manNumberRegex will pass + const aManNumber = a.match(manNumberRegex)[1] + const bManNumber = b.match(manNumberRegex)[1] - // legacy - if (section === 'global') - section = 'folders' - else if (section.match(/.*json/)) - section = section.replace('.json', '-json') - - // find either /section.n or /npm-section.n - // The glob is used in the glob. The regexp is used much - // further down. Globs and regexps are different - const compextglob = '.+(gz|bz2|lzma|[FYzZ]|xz)' - const compextre = '\\.(gz|bz2|lzma|[FYzZ]|xz)$' - const f = '+(npm-' + section + '|' + section + ').[0-9]?(' + compextglob + ')' - return new Promise((resolve, reject) => { - glob(manroot + '/*/' + f, async (er, mans) => { - if (er) - return reject(er) - - if (!mans.length) { - this.helpSearch(args).then(resolve).catch(reject) - return - } - - mans = mans.map((man) => { - const ext = path.extname(man) - if (man.match(new RegExp(compextre))) - man = path.basename(man, ext) - - return man - }) - - this.viewMan(this.pickMan(mans, pref), (err) => { - if (err) - return reject(err) - return resolve() - }) - }) + // man number sort first so that 1 aka commands are preferred + if (aManNumber !== bManNumber) + return aManNumber - bManNumber + + return a.localeCompare(b) }) + const man = mans[0] + + if (man) + await this.viewMan(man) + else + return this.helpSearch(args) } helpSearch (args) { @@ -133,32 +100,11 @@ class Help extends BaseCommand { }) } - pickMan (mans, pref_) { - const nre = /([0-9]+)$/ - const pref = {} - pref_.forEach((sect, i) => pref[sect] = i) - mans = mans.sort((a, b) => { - const an = a.match(nre)[1] - const bn = b.match(nre)[1] - return an === bn ? (a > b ? -1 : 1) - : pref[an] < pref[bn] ? -1 - : 1 - }) - return mans[0] - } - - viewMan (man, cb) { - const nre = /([0-9]+)$/ - const num = man.match(nre)[1] - const section = path.basename(man, '.' + num) - - // at this point, we know that the specified man page exists - const manpath = path.join(__dirname, '..', 'man') + async viewMan (man) { const env = {} Object.keys(process.env).forEach(function (i) { env[i] = process.env[i] }) - env.MANPATH = manpath const viewer = this.npm.config.get('viewer') const opts = { @@ -175,48 +121,39 @@ class Help extends BaseCommand { break case 'browser': - bin = false - try { - const url = this.htmlMan(man) - openUrl(this.npm, url, 'help available at the following URL').then( - () => cb() - ).catch(cb) - } catch (err) { - cb(err) - } - break + await openUrl(this.npm, this.htmlMan(man), 'help available at the following URL') + return default: - args.push(num, section) + args.push(man) break } - if (bin) { - const proc = spawn(bin, args, opts) + const proc = spawn(bin, args, opts) + return new Promise((resolve, reject) => { proc.on('exit', (code) => { if (code) - return cb(new Error(`help process exited with code: ${code}`)) + return reject(new Error(`help process exited with code: ${code}`)) - return cb() + return resolve() }) - } + }) } + // Returns the path to the html version of the man page htmlMan (man) { - let sect = +man.match(/([0-9]+)$/)[1] - const f = path.basename(man).replace(/[.]([0-9]+)$/, '') + let sect = man.match(manNumberRegex)[1] + const f = path.basename(man).replace(manNumberRegex, '') switch (sect) { - case 1: + case '1': sect = 'commands' break - case 5: + case '5': sect = 'configuring-npm' break - case 7: + case '7': sect = 'using-npm' break - default: - throw new Error('invalid man section: ' + sect) } return 'file://' + path.resolve(__dirname, '..', 'docs', 'output', sect, f + '.html') } diff --git a/deps/npm/lib/hook.js b/deps/npm/lib/hook.js index 6cda3504f43d72..64b1201cbd0deb 100644 --- a/deps/npm/lib/hook.js +++ b/deps/npm/lib/hook.js @@ -5,6 +5,10 @@ const Table = require('cli-table3') const BaseCommand = require('./base-command.js') class Hook extends BaseCommand { + static get description () { + return 'Manage registry hooks' + } + static get name () { return 'hook' } diff --git a/deps/npm/lib/init.js b/deps/npm/lib/init.js index 42b02dfdc6a77d..81c6733885a68e 100644 --- a/deps/npm/lib/init.js +++ b/deps/npm/lib/init.js @@ -4,6 +4,11 @@ const npa = require('npm-package-arg') const BaseCommand = require('./base-command.js') class Init extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Create a package.json file' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'init' @@ -59,7 +64,7 @@ class Init extends BaseCommand { this.npm.log.pause() this.npm.log.disableProgress() const initFile = this.npm.config.get('init-module') - if (!this.npm.flatOptions.yes && !this.npm.flatOptions.force) { + if (!this.npm.config.get('yes') && !this.npm.config.get('force')) { this.npm.output([ 'This utility will walk you through creating a package.json file.', 'It only covers the most common items, and tries to guess sensible defaults.', diff --git a/deps/npm/lib/install-ci-test.js b/deps/npm/lib/install-ci-test.js index c52b5c9e8073f5..871f24b2f32d6a 100644 --- a/deps/npm/lib/install-ci-test.js +++ b/deps/npm/lib/install-ci-test.js @@ -4,6 +4,10 @@ const CI = require('./ci.js') class InstallCITest extends CI { + static get description () { + return 'Install a project with a clean slate and run tests' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'install-ci-test' diff --git a/deps/npm/lib/install-test.js b/deps/npm/lib/install-test.js index 76c6f367dd3c81..d5664119df5ce2 100644 --- a/deps/npm/lib/install-test.js +++ b/deps/npm/lib/install-test.js @@ -4,6 +4,10 @@ const Install = require('./install.js') class InstallTest extends Install { + static get description () { + return 'Install package(s) and run tests' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'install-test' diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js index 8df63a219ef741..54ea6d82510512 100644 --- a/deps/npm/lib/install.js +++ b/deps/npm/lib/install.js @@ -11,11 +11,24 @@ const runScript = require('@npmcli/run-script') const BaseCommand = require('./base-command.js') class Install extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Install a package' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'install' } + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get params () { + return [ + 'save', + 'save-exact', + ] + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get usage () { return [ @@ -28,7 +41,7 @@ class Install extends BaseCommand { '', '', '', - '/ [--save-prod|--save-dev|--save-optional|--save-peer] [--save-exact] [--no-save]', + '/', ] } @@ -98,7 +111,8 @@ class Install extends BaseCommand { async install (args) { // the /path/to/node_modules/.. const globalTop = resolve(this.npm.globalDir, '..') - const { ignoreScripts, global: isGlobalInstall } = this.npm.flatOptions + const ignoreScripts = this.npm.config.get('ignore-scripts') + const isGlobalInstall = this.npm.config.get('global') const where = isGlobalInstall ? globalTop : this.npm.prefix // don't try to install the prefix into itself @@ -122,7 +136,7 @@ class Install extends BaseCommand { add: args, }) if (!args.length && !isGlobalInstall && !ignoreScripts) { - const { scriptShell } = this.npm.flatOptions + const scriptShell = this.npm.config.get('script-shell') || undefined const scripts = [ 'preinstall', 'install', diff --git a/deps/npm/lib/link.js b/deps/npm/lib/link.js index 66f83d9f5b0a77..fe9cfd3a6b254a 100644 --- a/deps/npm/lib/link.js +++ b/deps/npm/lib/link.js @@ -12,6 +12,11 @@ const reifyFinish = require('./utils/reify-finish.js') const BaseCommand = require('./base-command.js') class Link extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Symlink a package folder' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'link' @@ -96,7 +101,13 @@ class Link extends BaseCommand { // npm link should not save=true by default unless you're // using any of --save-dev or other types const save = - Boolean(this.npm.config.find('save') !== 'default' || this.npm.flatOptions.saveType) + Boolean( + this.npm.config.find('save') !== 'default' || + this.npm.config.get('save-optional') || + this.npm.config.get('save-peer') || + this.npm.config.get('save-dev') || + this.npm.config.get('save-prod') + ) // create a new arborist instance for the local prefix and // reify all the pending names as symlinks there diff --git a/deps/npm/lib/logout.js b/deps/npm/lib/logout.js index b3f64f671d3266..adc19a923af9ab 100644 --- a/deps/npm/lib/logout.js +++ b/deps/npm/lib/logout.js @@ -4,14 +4,22 @@ const npmFetch = require('npm-registry-fetch') const BaseCommand = require('./base-command.js') class Logout extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Log out of the registry' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'logout' } /* istanbul ignore next - see test/lib/load-all-commands.js */ - static get usage () { - return ['[--registry=] [--scope=<@scope>]'] + static get params () { + return [ + 'registry', + 'scope', + ] } exec (args, cb) { @@ -19,9 +27,10 @@ class Logout extends BaseCommand { } async logout (args) { - const { registry, scope } = this.npm.flatOptions + const registry = this.npm.config.get('registry') + const scope = this.npm.config.get('scope') const regRef = scope ? `${scope}:registry` : 'registry' - const reg = this.npm.flatOptions[regRef] || registry + const reg = this.npm.config.get(regRef) || registry const auth = getAuth(reg, this.npm.flatOptions) diff --git a/deps/npm/lib/ls.js b/deps/npm/lib/ls.js index 9ff2761c2f9285..65b3ddfe7611b7 100644 --- a/deps/npm/lib/ls.js +++ b/deps/npm/lib/ls.js @@ -23,6 +23,11 @@ const _type = Symbol('type') const BaseCommand = require('./base-command.js') class LS extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'List installed packages' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'ls' @@ -43,24 +48,22 @@ class LS extends BaseCommand { } async ls (args) { - const { - all, - color, - depth, - json, - long, - global, - parseable, - prefix, - unicode, - } = this.npm.flatOptions - const path = global ? resolve(this.npm.globalDir, '..') : prefix + const all = this.npm.config.get('all') + const color = !!this.npm.color + const depth = this.npm.config.get('depth') const dev = this.npm.config.get('dev') const development = this.npm.config.get('development') + const global = this.npm.config.get('global') + const json = this.npm.config.get('json') const link = this.npm.config.get('link') + const long = this.npm.config.get('long') const only = this.npm.config.get('only') + const parseable = this.npm.config.get('parseable') const prod = this.npm.config.get('prod') const production = this.npm.config.get('production') + const unicode = this.npm.config.get('unicode') + + const path = global ? resolve(this.npm.globalDir, '..') : this.npm.prefix const arb = new Arborist({ global, diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js index 0534e630606e45..42541a90ffb793 100644 --- a/deps/npm/lib/npm.js +++ b/deps/npm/lib/npm.js @@ -36,24 +36,19 @@ const proxyCmds = new Proxy({}, { }, }) -const { types, defaults, shorthands } = require('./utils/config.js') +const { definitions, flatten, shorthands } = require('./utils/config/index.js') const { shellouts } = require('./utils/cmd-list.js') +const usage = require('./utils/npm-usage.js') let warnedNonDashArg = false const _runCmd = Symbol('_runCmd') const _load = Symbol('_load') -const _flatOptions = Symbol('_flatOptions') const _tmpFolder = Symbol('_tmpFolder') const _title = Symbol('_title') const npm = module.exports = new class extends EventEmitter { constructor () { super() require('./utils/perf.js') - this.modes = { - exec: 0o755, - file: 0o644, - umask: 0o22, - } this.started = Date.now() this.command = null this.commands = proxyCmds @@ -62,8 +57,8 @@ const npm = module.exports = new class extends EventEmitter { this.version = require('../package.json').version this.config = new Config({ npmPath: dirname(__dirname), - types, - defaults, + definitions, + flatten, shorthands, }) this[_title] = process.title @@ -105,9 +100,18 @@ const npm = module.exports = new class extends EventEmitter { }) } + const workspacesEnabled = this.config.get('workspaces') + const workspacesFilters = this.config.get('workspace') + const filterByWorkspaces = workspacesEnabled || workspacesFilters.length > 0 + if (this.config.get('usage')) { - console.log(impl.usage) + this.output(impl.usage) cb() + } else if (filterByWorkspaces) { + impl.execWorkspaces(args, this.config.get('workspace'), er => { + process.emit('timeEnd', `command:${cmd}`) + cb(er) + }) } else { impl.exec(args, er => { process.emit('timeEnd', `command:${cmd}`) @@ -140,9 +144,6 @@ const npm = module.exports = new class extends EventEmitter { if (!er && this.config.get('force')) this.log.warn('using --force', 'Recommended protections disabled.') - if (!er && !this[_flatOptions]) - this[_flatOptions] = require('./utils/flat-options.js')(this) - process.emit('timeEnd', 'npm:load') this.emit('load', er) }) @@ -162,14 +163,19 @@ const npm = module.exports = new class extends EventEmitter { } async [_load] () { + process.emit('time', 'npm:load:whichnode') const node = await which(process.argv[0]).catch(er => null) + process.emit('timeEnd', 'npm:load:whichnode') if (node && node.toUpperCase() !== process.execPath.toUpperCase()) { log.verbose('node symlink', node) process.execPath = node this.config.execPath = node } + process.emit('time', 'npm:load:configload') await this.config.load() + process.emit('timeEnd', 'npm:load:configload') + this.argv = this.config.parsedArgv.remain // note: this MUST be shorter than the actual argv length, because it // uses the same memory, so node will truncate it if it's too long. @@ -177,33 +183,40 @@ const npm = module.exports = new class extends EventEmitter { // don't show that. (Regrettable historical choice to put it there.) // Any other secrets are configs only, so showing only the positional // args keeps those from being leaked. + process.emit('time', 'npm:load:setTitle') const tokrev = deref(this.argv[0]) === 'token' && this.argv[1] === 'revoke' this.title = tokrev ? 'npm token revoke' + (this.argv[2] ? ' ***' : '') : ['npm', ...this.argv].join(' ') + process.emit('timeEnd', 'npm:load:setTitle') + process.emit('time', 'npm:load:setupLog') this.color = setupLog(this.config) + process.emit('timeEnd', 'npm:load:setupLog') process.env.COLOR = this.color ? '1' : '0' + process.emit('time', 'npm:load:cleanupLog') cleanUpLogFiles(this.cache, this.config.get('logs-max'), log.warn) + process.emit('timeEnd', 'npm:load:cleanupLog') log.resume() - const umask = this.config.get('umask') - this.modes = { - exec: 0o777 & (~umask), - file: 0o666 & (~umask), - umask, - } + process.emit('time', 'npm:load:configScope') const configScope = this.config.get('scope') if (configScope && !/^@/.test(configScope)) this.config.set('scope', `@${configScope}`, this.config.find('scope')) + process.emit('timeEnd', 'npm:load:configScope') + process.emit('time', 'npm:load:projectScope') this.projectScope = this.config.get('scope') || getProjectScope(this.prefix) + process.emit('timeEnd', 'npm:load:projectScope') } get flatOptions () { - return this[_flatOptions] + const { flat } = this.config + if (this.command) + flat.npmCommand = this.command + return flat } get lockfileVersion () { @@ -274,6 +287,10 @@ const npm = module.exports = new class extends EventEmitter { this[k] = r } + get usage () { + return usage(this) + } + // XXX add logging to see if we actually use this get tmp () { if (!this[_tmpFolder]) { diff --git a/deps/npm/lib/org.js b/deps/npm/lib/org.js index b9f84b060f8a83..ddd2b03daee185 100644 --- a/deps/npm/lib/org.js +++ b/deps/npm/lib/org.js @@ -4,6 +4,10 @@ const Table = require('cli-table3') const BaseCommand = require('./base-command.js') class Org extends BaseCommand { + static get description () { + return 'Manage orgs' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'org' diff --git a/deps/npm/lib/outdated.js b/deps/npm/lib/outdated.js index 7225577ea42d47..9b656d2aeede47 100644 --- a/deps/npm/lib/outdated.js +++ b/deps/npm/lib/outdated.js @@ -13,6 +13,11 @@ const ansiTrim = require('./utils/ansi-trim.js') const BaseCommand = require('./base-command.js') class Outdated extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Check for outdated packages' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'outdated' @@ -28,15 +33,13 @@ class Outdated extends BaseCommand { } async outdated (args) { - this.opts = this.npm.flatOptions - const global = path.resolve(this.npm.globalDir, '..') - const where = this.opts.global + const where = this.npm.config.get('global') ? global : this.npm.prefix const arb = new Arborist({ - ...this.opts, + ...this.npm.flatOptions, path: where, }) @@ -51,7 +54,7 @@ class Outdated extends BaseCommand { this.getEdges(nodes, 'edgesIn') } } else { - if (this.opts.all) { + if (this.npm.config.get('all')) { // all deps in tree const nodes = this.tree.inventory.values() this.getEdges(nodes, 'edgesOut') @@ -68,13 +71,13 @@ class Outdated extends BaseCommand { const outdated = this.list.sort((a, b) => a.name.localeCompare(b.name)) // return if no outdated packages - if (outdated.length === 0 && !this.opts.json) + if (outdated.length === 0 && !this.npm.config.get('json')) return // display results - if (this.opts.json) + if (this.npm.config.get('json')) this.npm.output(this.makeJSON(outdated)) - else if (this.opts.parseable) + else if (this.npm.config.get('parseable')) this.npm.output(this.makeParseable(outdated)) else { const outList = outdated.map(x => this.makePretty(x)) @@ -86,11 +89,11 @@ class Outdated extends BaseCommand { 'Depended by', ] - if (this.opts.long) + if (this.npm.config.get('long')) outHead.push('Package Type', 'Homepage') const outTable = [outHead].concat(outList) - if (this.opts.color) + if (this.npm.color) outTable[0] = outTable[0].map(heading => styles.underline(heading)) const tableOpts = { @@ -117,7 +120,7 @@ class Outdated extends BaseCommand { } getEdgesOut (node) { - if (this.opts.global) { + if (this.npm.config.get('global')) { for (const child of node.children.values()) this.edges.add(child) } else { @@ -129,7 +132,7 @@ class Outdated extends BaseCommand { async getPackument (spec) { const packument = await pacote.packument(spec, { ...this.npm.flatOptions, - fullMetadata: this.npm.flatOptions.long, + fullMetadata: this.npm.config.get('long'), preferOnline: true, }) return packument @@ -146,7 +149,7 @@ class Outdated extends BaseCommand { : edge.dev ? 'devDependencies' : 'dependencies' - for (const omitType of this.opts.omit || []) { + for (const omitType of this.npm.config.get('omit') || []) { if (node[omitType]) return } @@ -213,12 +216,12 @@ class Outdated extends BaseCommand { const columns = [name, current, wanted, latest, location, dependent] - if (this.opts.long) { + if (this.npm.config.get('long')) { columns[6] = type columns[7] = homepage } - if (this.opts.color) { + if (this.npm.color) { columns[0] = color[current === wanted ? 'yellow' : 'red'](columns[0]) // current columns[2] = color.green(columns[2]) // wanted columns[3] = color.magenta(columns[3]) // latest @@ -248,7 +251,7 @@ class Outdated extends BaseCommand { name + '@' + latest, dependent, ] - if (this.opts.long) + if (this.npm.config.get('long')) out.push(type, homepage) return out.join(':') @@ -275,7 +278,7 @@ class Outdated extends BaseCommand { dependent, location: path, } - if (this.opts.long) { + if (this.npm.config.get('long')) { out[name].type = type out[name].homepage = homepage } diff --git a/deps/npm/lib/owner.js b/deps/npm/lib/owner.js index b62f125ac3bb68..e537d82d01d8db 100644 --- a/deps/npm/lib/owner.js +++ b/deps/npm/lib/owner.js @@ -8,6 +8,10 @@ const readLocalPkg = require('./utils/read-local-package.js') const BaseCommand = require('./base-command.js') class Owner extends BaseCommand { + static get description () { + return 'Manage package owners' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'owner' diff --git a/deps/npm/lib/pack.js b/deps/npm/lib/pack.js index 326fcc0cd1441f..92a2fbd7ac33ce 100644 --- a/deps/npm/lib/pack.js +++ b/deps/npm/lib/pack.js @@ -11,14 +11,24 @@ const writeFile = util.promisify(require('fs').writeFile) const BaseCommand = require('./base-command.js') class Pack extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Create a tarball from a package' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'pack' } + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get params () { + return ['dry-run'] + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get usage () { - return ['[[<@scope>/]...] [--dry-run]'] + return ['[[<@scope>/]...]'] } exec (args, cb) { @@ -29,12 +39,12 @@ class Pack extends BaseCommand { if (args.length === 0) args = ['.'] - const { unicode } = this.npm.flatOptions + const unicode = this.npm.config.get('unicode') // clone the opts because pacote mutates it with resolved/integrity const tarballs = await Promise.all(args.map(async (arg) => { const spec = npa(arg) - const { dryRun } = this.npm.flatOptions + const dryRun = this.npm.config.get('dry-run') const manifest = await pacote.manifest(spec, this.npm.flatOptions) const filename = `${manifest.name}-${manifest.version}.tgz` .replace(/^@/, '').replace(/\//, '-') diff --git a/deps/npm/lib/ping.js b/deps/npm/lib/ping.js index e60b1f1debd80c..30379377482ec1 100644 --- a/deps/npm/lib/ping.js +++ b/deps/npm/lib/ping.js @@ -4,13 +4,18 @@ const BaseCommand = require('./base-command.js') class Ping extends BaseCommand { /* istanbul ignore next - see test/lib/load-all-commands.js */ - static get name () { - return 'ping' + static get description () { + return 'Ping npm registry' } /* istanbul ignore next - see test/lib/load-all-commands.js */ - static get description () { - return 'ping registry' + static get params () { + return ['registry'] + } + + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get name () { + return 'ping' } exec (args, cb) { @@ -18,14 +23,14 @@ class Ping extends BaseCommand { } async ping (args) { - log.notice('PING', this.npm.flatOptions.registry) + log.notice('PING', this.npm.config.get('registry')) const start = Date.now() const details = await pingUtil(this.npm.flatOptions) const time = Date.now() - start log.notice('PONG', `${time / 1000}ms`) - if (this.npm.flatOptions.json) { + if (this.npm.config.get('json')) { this.npm.output(JSON.stringify({ - registry: this.npm.flatOptions.registry, + registry: this.npm.config.get('registry'), time, details, }, null, 2)) diff --git a/deps/npm/lib/prefix.js b/deps/npm/lib/prefix.js index 5ade87f6429f63..1298a3c5ba54bd 100644 --- a/deps/npm/lib/prefix.js +++ b/deps/npm/lib/prefix.js @@ -1,6 +1,11 @@ const BaseCommand = require('./base-command.js') class Prefix extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Display prefix' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'prefix' diff --git a/deps/npm/lib/profile.js b/deps/npm/lib/profile.js index 1c0df498885406..9789146fdee169 100644 --- a/deps/npm/lib/profile.js +++ b/deps/npm/lib/profile.js @@ -38,6 +38,10 @@ const writableProfileKeys = [ const BaseCommand = require('./base-command.js') class Profile extends BaseCommand { + static get description () { + return 'Change settings on your registry profile' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'profile' @@ -108,14 +112,14 @@ class Profile extends BaseCommand { async get (args) { const tfa = 'two-factor auth' - const conf = { ...this.npm.flatOptions } - - const info = await pulseTillDone.withPromise(npmProfile.get(conf)) + const info = await pulseTillDone.withPromise( + npmProfile.get(this.npm.flatOptions) + ) if (!info.cidr_whitelist) delete info.cidr_whitelist - if (conf.json) { + if (this.npm.config.get('json')) { this.npm.output(JSON.stringify(info, null, 2)) return } @@ -147,7 +151,7 @@ class Profile extends BaseCommand { .join('\t') this.npm.output(values) } else { - if (conf.parseable) { + if (this.npm.config.get('parseable')) { for (const key of Object.keys(info)) { if (key === 'tfa') this.npm.output(`${key}\t${cleaned[tfa]}`) @@ -165,7 +169,7 @@ class Profile extends BaseCommand { } async set (args) { - const conf = { ...this.npm.flatOptions } + const conf = this.npm.flatOptions const prop = (args[0] || '').toLowerCase().trim() let value = args.length > 1 ? args.slice(1).join(' ') : null @@ -214,9 +218,9 @@ class Profile extends BaseCommand { const result = await otplease(conf, conf => npmProfile.set(newUser, conf)) - if (conf.json) + if (this.npm.config.get('json')) this.npm.output(JSON.stringify({ [prop]: result[prop] }, null, 2)) - else if (conf.parseable) + else if (this.npm.config.get('parseable')) this.npm.output(prop + '\t' + result[prop]) else if (result[prop] != null) this.npm.output('Set', prop, 'to', result[prop]) @@ -239,11 +243,10 @@ class Profile extends BaseCommand { ) } - const conf = { ...this.npm.flatOptions } - if (conf.json || conf.parseable) { + if (this.npm.config.get('json') || this.npm.config.get('parseable')) { throw new Error( 'Enabling two-factor authentication is an interactive operation and ' + - (conf.json ? 'JSON' : 'parseable') + ' output mode is not available' + (this.npm.config.get('json') ? 'JSON' : 'parseable') + ' output mode is not available' ) } @@ -255,7 +258,7 @@ class Profile extends BaseCommand { // if they're using legacy auth currently then we have to // update them to a bearer token before continuing. - const creds = this.npm.config.getCredentialsByURI(conf.registry) + const creds = this.npm.config.getCredentialsByURI(this.npm.config.get('registry')) const auth = {} if (creds.token) @@ -267,32 +270,29 @@ class Profile extends BaseCommand { auth.basic = { username: basic[0], password: basic[1] } } - if (conf.otp) - auth.otp = conf.otp - if (!auth.basic && !auth.token) { throw new Error( 'You need to be logged in to registry ' + - `${conf.registry} in order to enable 2fa` + `${this.npm.config.get('registry')} in order to enable 2fa` ) } if (auth.basic) { log.info('profile', 'Updating authentication to bearer token') const result = await npmProfile.createToken( - auth.basic.password, false, [], conf + auth.basic.password, false, [], this.npm.flatOptions ) if (!result.token) { throw new Error( - `Your registry ${conf.registry} does not seem to ` + + `Your registry ${this.npm.config.get('registry')} does not seem to ` + 'support bearer tokens. Bearer tokens are required for ' + 'two-factor authentication' ) } this.npm.config.setCredentialsByURI( - conf.registry, + this.npm.config.get('registry'), { token: result.token } ) await this.npm.config.save('user') @@ -303,21 +303,21 @@ class Profile extends BaseCommand { info.tfa.password = password log.info('profile', 'Determine if tfa is pending') - const userInfo = await pulseTillDone.withPromise(npmProfile.get(conf)) + const userInfo = await pulseTillDone.withPromise( + npmProfile.get(this.npm.flatOptions) + ) + const conf = { ...this.npm.flatOptions } if (userInfo && userInfo.tfa && userInfo.tfa.pending) { log.info('profile', 'Resetting two-factor authentication') await pulseTillDone.withPromise( npmProfile.set({ tfa: { password, mode: 'disable' } }, conf) ) } else if (userInfo && userInfo.tfa) { - if (conf.otp) - conf.otp = conf.otp - else { - const otp = await readUserInfo.otp( + if (!conf.otp) { + conf.otp = await readUserInfo.otp( 'Enter one-time password from your authenticator app: ' ) - conf.otp = otp } } @@ -390,9 +390,9 @@ class Profile extends BaseCommand { tfa: { password: password, mode: 'disable' }, }, conf)) - if (conf.json) + if (this.npm.config.get('json')) this.npm.output(JSON.stringify({ tfa: false }, null, 2)) - else if (conf.parseable) + else if (this.npm.config.get('parseable')) this.npm.output('tfa\tfalse') else this.npm.output('Two factor authentication disabled.') diff --git a/deps/npm/lib/prune.js b/deps/npm/lib/prune.js index c2cddb1a22b335..1da86a3e821878 100644 --- a/deps/npm/lib/prune.js +++ b/deps/npm/lib/prune.js @@ -4,14 +4,24 @@ const reifyFinish = require('./utils/reify-finish.js') const BaseCommand = require('./base-command.js') class Prune extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Remove extraneous packages' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'prune' } + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get params () { + return ['production'] + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get usage () { - return ['[[<@scope>/]...] [--production]'] + return ['[[<@scope>/]...]'] } exec (args, cb) { diff --git a/deps/npm/lib/publish.js b/deps/npm/lib/publish.js index f8e0eafe118864..b121cb3d36773a 100644 --- a/deps/npm/lib/publish.js +++ b/deps/npm/lib/publish.js @@ -8,7 +8,7 @@ const pacote = require('pacote') const npa = require('npm-package-arg') const npmFetch = require('npm-registry-fetch') -const { flatten } = require('./utils/flat-options.js') +const flatten = require('./utils/config/flatten.js') const otplease = require('./utils/otplease.js') const { getContents, logTar } = require('./utils/tar.js') @@ -19,15 +19,24 @@ const readJson = util.promisify(require('read-package-json')) const BaseCommand = require('./base-command.js') class Publish extends BaseCommand { + static get description () { + return 'Publish a package' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'publish' } + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get params () { + return ['tag', 'access', 'dry-run'] + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get usage () { return [ - '[] [--tag ] [--access ] [--dry-run]', + '[]', ] } @@ -43,12 +52,16 @@ class Publish extends BaseCommand { log.verbose('publish', args) - const opts = { ...this.npm.flatOptions } - const { unicode, dryRun, json, defaultTag } = opts + const unicode = this.npm.config.get('unicode') + const dryRun = this.npm.config.get('dry-run') + const json = this.npm.config.get('json') + const defaultTag = this.npm.config.get('tag') if (semver.validRange(defaultTag)) throw new Error('Tag name must not be a valid SemVer range: ' + defaultTag.trim()) + const opts = { ...this.npm.flatOptions } + // you can publish name@version, ./foo.tgz, etc. // even though the default is the 'file:.' cwd. const spec = npa(args[0]) @@ -137,7 +150,8 @@ class Publish extends BaseCommand { publishConfigToOpts (publishConfig) { // create a new object that inherits from the config stack // then squash the css-case into camelCase opts, like we do - return flatten({...this.npm.config.list[0], ...publishConfig}) + // this is Object.assign()'ed onto the base npm.flatOptions + return flatten(publishConfig, {}) } } module.exports = Publish diff --git a/deps/npm/lib/rebuild.js b/deps/npm/lib/rebuild.js index 74f5ae5f6eba59..5910ab3d172dcd 100644 --- a/deps/npm/lib/rebuild.js +++ b/deps/npm/lib/rebuild.js @@ -6,6 +6,11 @@ const completion = require('./utils/completion/installed-deep.js') const BaseCommand = require('./base-command.js') class Rebuild extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Rebuild a package' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'rebuild' @@ -27,7 +32,7 @@ class Rebuild extends BaseCommand { async rebuild (args) { const globalTop = resolve(this.npm.globalDir, '..') - const where = this.npm.flatOptions.global ? globalTop : this.npm.prefix + const where = this.npm.config.get('global') ? globalTop : this.npm.prefix const arb = new Arborist({ ...this.npm.flatOptions, path: where, diff --git a/deps/npm/lib/repo.js b/deps/npm/lib/repo.js index aa07e07a819f74..5ab136abd73d8e 100644 --- a/deps/npm/lib/repo.js +++ b/deps/npm/lib/repo.js @@ -7,6 +7,11 @@ const openUrl = require('./utils/open-url.js') const BaseCommand = require('./base-command.js') class Repo extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Open package repository page in the browser' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'repo' diff --git a/deps/npm/lib/restart.js b/deps/npm/lib/restart.js index 1f3eb5af94f825..840eb20673b1ff 100644 --- a/deps/npm/lib/restart.js +++ b/deps/npm/lib/restart.js @@ -2,6 +2,11 @@ const LifecycleCmd = require('./utils/lifecycle-cmd.js') // This ends up calling run-script(['restart', ...args]) class Restart extends LifecycleCmd { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Restart a package' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'restart' diff --git a/deps/npm/lib/root.js b/deps/npm/lib/root.js index 1fe82c6fad773a..635a68e2563184 100644 --- a/deps/npm/lib/root.js +++ b/deps/npm/lib/root.js @@ -1,13 +1,18 @@ const BaseCommand = require('./base-command.js') class Root extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Display npm root' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'root' } /* istanbul ignore next - see test/lib/load-all-commands.js */ - static get usage () { - return ['[-g]'] + static get params () { + return ['global'] } exec (args, cb) { diff --git a/deps/npm/lib/run-script.js b/deps/npm/lib/run-script.js index 3ea85b79ffd18f..054f0ae4a551f4 100644 --- a/deps/npm/lib/run-script.js +++ b/deps/npm/lib/run-script.js @@ -1,10 +1,12 @@ +const { resolve } = require('path') +const chalk = require('chalk') const runScript = require('@npmcli/run-script') const { isServerPackage } = runScript -const readJson = require('read-package-json-fast') -const { resolve } = require('path') +const rpj = require('read-package-json-fast') const log = require('npmlog') const didYouMean = require('./utils/did-you-mean.js') const isWindowsShell = require('./utils/is-windows-shell.js') +const getWorkspaces = require('./workspaces/get-workspaces.js') const cmdList = [ 'publish', @@ -17,8 +19,21 @@ const cmdList = [ 'version', ].reduce((l, p) => l.concat(['pre' + p, p, 'post' + p]), []) +const nocolor = { + reset: s => s, + bold: s => s, + dim: s => s, + blue: s => s, + green: s => s, +} + const BaseCommand = require('./base-command.js') class RunScript extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Run arbitrary package scripts' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'run-script' @@ -34,7 +49,7 @@ class RunScript extends BaseCommand { if (argv.length === 2) { // find the script name const json = resolve(this.npm.localPrefix, 'package.json') - const { scripts = {} } = await readJson(json).catch(er => ({})) + const { scripts = {} } = await rpj(json).catch(er => ({})) return Object.keys(scripts) } } @@ -46,12 +61,19 @@ class RunScript extends BaseCommand { this.list(args).then(() => cb()).catch(cb) } - async run (args) { - const path = this.npm.localPrefix - const event = args.shift() - const { scriptShell } = this.npm.flatOptions + execWorkspaces (args, filters, cb) { + if (args.length) + this.runWorkspaces(args, filters).then(() => cb()).catch(cb) + else + this.listWorkspaces(args, filters).then(() => cb()).catch(cb) + } + + async run ([event, ...args], { path = this.npm.localPrefix, pkg } = {}) { + // this || undefined is because runScript will be unhappy with the default + // null value + const scriptShell = this.npm.config.get('script-shell') || undefined - const pkg = await readJson(`${path}/package.json`) + pkg = pkg || (await rpj(`${path}/package.json`)) const { scripts = {} } = pkg if (event === 'restart' && !scripts.restart) @@ -68,14 +90,13 @@ class RunScript extends BaseCommand { if (this.npm.config.get('if-present')) return - const suggestions = didYouMean(event, Object.keys(scripts)) - throw new Error(`missing script: ${event}${ - suggestions ? `\n${suggestions}` : ''}`) + const suggestions = await didYouMean(this.npm, path, event) + throw new Error(`Missing script: "${event}"${suggestions}\n\nTo see a list of scripts, run:\n npm run`) } // positional args only added to the main event, not pre/post const events = [[event, args]] - if (!this.npm.flatOptions.ignoreScripts) { + if (!this.npm.config.get('ignore-scripts')) { if (scripts[`pre${event}`]) events.unshift([`pre${event}`, []]) @@ -102,9 +123,11 @@ class RunScript extends BaseCommand { } } - async list () { - const path = this.npm.localPrefix - const { scripts, name } = await readJson(`${path}/package.json`) + async list (args, path) { + path = path || this.npm.localPrefix + const { scripts, name, _id } = await rpj(`${path}/package.json`) + const pkgid = _id || name + const color = !!this.npm.color if (!scripts) return [] @@ -113,12 +136,12 @@ class RunScript extends BaseCommand { if (log.level === 'silent') return allScripts - if (this.npm.flatOptions.json) { + if (this.npm.config.get('json')) { this.npm.output(JSON.stringify(scripts, null, 2)) return allScripts } - if (this.npm.flatOptions.parseable) { + if (this.npm.config.get('parseable')) { for (const [script, cmd] of Object.entries(scripts)) this.npm.output(`${script}:${cmd}`) @@ -133,22 +156,96 @@ class RunScript extends BaseCommand { const list = cmdList.includes(script) ? cmds : runScripts list.push(script) } + const colorize = color ? chalk : nocolor - if (cmds.length) - this.npm.output(`Lifecycle scripts included in ${name}:`) + if (cmds.length) { + this.npm.output(`${ + colorize.reset(colorize.bold('Lifecycle scripts'))} included in ${ + colorize.green(pkgid)}:`) + } for (const script of cmds) - this.npm.output(prefix + script + indent + scripts[script]) + this.npm.output(prefix + script + indent + colorize.dim(scripts[script])) - if (!cmds.length && runScripts.length) - this.npm.output(`Scripts available in ${name} via \`npm run-script\`:`) - else if (runScripts.length) - this.npm.output('\navailable via `npm run-script`:') + if (!cmds.length && runScripts.length) { + this.npm.output(`${ + colorize.bold('Scripts') + } available in ${colorize.green(pkgid)} via \`${ + colorize.blue('npm run-script')}\`:`) + } else if (runScripts.length) + this.npm.output(`\navailable via \`${colorize.blue('npm run-script')}\`:`) for (const script of runScripts) - this.npm.output(prefix + script + indent + scripts[script]) + this.npm.output(prefix + script + indent + colorize.dim(scripts[script])) + this.npm.output('') return allScripts } + + async workspaces (filters) { + return getWorkspaces(filters, { path: this.npm.localPrefix }) + } + + async runWorkspaces (args, filters) { + const res = [] + const workspaces = await this.workspaces(filters) + + for (const workspacePath of workspaces.values()) { + const pkg = await rpj(`${workspacePath}/package.json`) + const runResult = await this.run(args, { + path: workspacePath, + pkg, + }).catch(err => { + log.error(`Lifecycle script \`${args[0]}\` failed with error:`) + log.error(err) + log.error(` in workspace: ${pkg._id || pkg.name}`) + log.error(` at location: ${workspacePath}`) + + const scriptMissing = err.message.startsWith('Missing script') + + // avoids exiting with error code in case there's scripts missing + // in some workspaces since other scripts might have succeeded + if (!scriptMissing) + process.exitCode = 1 + + return scriptMissing + }) + res.push(runResult) + } + + // in case **all** tests are missing, then it should exit with error code + if (res.every(Boolean)) + throw new Error(`Missing script: ${args[0]}`) + } + + async listWorkspaces (args, filters) { + const workspaces = await this.workspaces(filters) + + if (log.level === 'silent') + return + + if (this.npm.config.get('json')) { + const res = {} + for (const workspacePath of workspaces.values()) { + const { scripts, name } = await rpj(`${workspacePath}/package.json`) + res[name] = { ...scripts } + } + this.npm.output(JSON.stringify(res, null, 2)) + return + } + + if (this.npm.config.get('parseable')) { + for (const workspacePath of workspaces.values()) { + const { scripts, name } = await rpj(`${workspacePath}/package.json`) + for (const [script, cmd] of Object.entries(scripts || {})) + this.npm.output(`${name}:${script}:${cmd}`) + } + return + } + + for (const workspacePath of workspaces.values()) + await this.list(args, workspacePath) + } } + module.exports = RunScript diff --git a/deps/npm/lib/search.js b/deps/npm/lib/search.js index c24000156f67a7..bdd374ab6edf77 100644 --- a/deps/npm/lib/search.js +++ b/deps/npm/lib/search.js @@ -26,14 +26,29 @@ function prepareExcludes (searchexclude) { const BaseCommand = require('./base-command.js') class Search extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Search for pacakges' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'search' } + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get params () { + return [ + 'long', + 'json', + 'parseable', + 'description', + ] + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get usage () { - return ['[-l|--long] [--json] [--parseable] [--no-description] [search terms ...]'] + return ['[search terms ...]'] } exec (args, cb) { @@ -84,7 +99,7 @@ class Search extends BaseCommand { }) await p.promise() - if (!anyOutput && !opts.json && !opts.parseable) + if (!anyOutput && !this.npm.config.get('json') && !this.npm.config.get('parseable')) this.npm.output('No matches found for ' + (args.map(JSON.stringify).join(' '))) log.silly('search', 'search completed') diff --git a/deps/npm/lib/set-script.js b/deps/npm/lib/set-script.js index 6241981323c4af..df101a0acb7090 100644 --- a/deps/npm/lib/set-script.js +++ b/deps/npm/lib/set-script.js @@ -5,6 +5,11 @@ const rpj = require('read-package-json-fast') const BaseCommand = require('./base-command.js') class SetScript extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Set tasks in the scripts section of package.json' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'set-script' diff --git a/deps/npm/lib/set.js b/deps/npm/lib/set.js index 787a8012c0b6a2..74a002cd638be2 100644 --- a/deps/npm/lib/set.js +++ b/deps/npm/lib/set.js @@ -1,6 +1,10 @@ const BaseCommand = require('./base-command.js') class Set extends BaseCommand { + static get description () { + return 'Set a value in the npm configuration' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'set' diff --git a/deps/npm/lib/shrinkwrap.js b/deps/npm/lib/shrinkwrap.js index b52cf41957b2d7..5d4a1ada982a49 100644 --- a/deps/npm/lib/shrinkwrap.js +++ b/deps/npm/lib/shrinkwrap.js @@ -7,6 +7,11 @@ const log = require('npmlog') const BaseCommand = require('./base-command.js') class Shrinkwrap extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Lock down dependency versions for publication' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'shrinkwrap' @@ -24,7 +29,7 @@ class Shrinkwrap extends BaseCommand { // // loadVirtual, fall back to loadActual // rename shrinkwrap file type, and tree.meta.save() - if (this.npm.flatOptions.global) { + if (this.npm.config.get('global')) { const er = new Error('`npm shrinkwrap` does not work for global packages') er.code = 'ESHRINKWRAPGLOBAL' throw er diff --git a/deps/npm/lib/star.js b/deps/npm/lib/star.js index 27a3041906a401..4c5cf4900c5198 100644 --- a/deps/npm/lib/star.js +++ b/deps/npm/lib/star.js @@ -6,6 +6,10 @@ const getIdentity = require('./utils/get-identity') const BaseCommand = require('./base-command.js') class Star extends BaseCommand { + static get description () { + return 'Mark your favorite packages' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'star' @@ -26,7 +30,7 @@ class Star extends BaseCommand { // if we're unstarring, then show an empty star image // otherwise, show the full star image - const { unicode } = this.npm.flatOptions + const unicode = this.npm.config.get('unicode') const unstar = this.npm.config.get('star.unstar') const full = unicode ? '\u2605 ' : '(*)' const empty = unicode ? '\u2606 ' : '( )' diff --git a/deps/npm/lib/stars.js b/deps/npm/lib/stars.js index 758a3130d423c0..db93d7b19610a5 100644 --- a/deps/npm/lib/stars.js +++ b/deps/npm/lib/stars.js @@ -5,6 +5,11 @@ const getIdentity = require('./utils/get-identity.js') const BaseCommand = require('./base-command.js') class Stars extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'View packages marked as favorites' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'stars' diff --git a/deps/npm/lib/start.js b/deps/npm/lib/start.js index 8987bc2931eb55..099b6e61b31fcd 100644 --- a/deps/npm/lib/start.js +++ b/deps/npm/lib/start.js @@ -2,6 +2,11 @@ const LifecycleCmd = require('./utils/lifecycle-cmd.js') // This ends up calling run-script(['start', ...args]) class Start extends LifecycleCmd { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Start a package' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'start' diff --git a/deps/npm/lib/stop.js b/deps/npm/lib/stop.js index a3857ab1360be2..766d9c01815cd4 100644 --- a/deps/npm/lib/stop.js +++ b/deps/npm/lib/stop.js @@ -2,6 +2,11 @@ const LifecycleCmd = require('./utils/lifecycle-cmd.js') // This ends up calling run-script(['stop', ...args]) class Stop extends LifecycleCmd { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Stop a package' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'stop' diff --git a/deps/npm/lib/team.js b/deps/npm/lib/team.js index f84660af4d19a6..5298bb3b2563e2 100644 --- a/deps/npm/lib/team.js +++ b/deps/npm/lib/team.js @@ -5,6 +5,10 @@ const otplease = require('./utils/otplease.js') const BaseCommand = require('./base-command.js') class Team extends BaseCommand { + static get description () { + return 'Manage organization teams and team memberships' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'team' diff --git a/deps/npm/lib/test.js b/deps/npm/lib/test.js index 991d1c873cbfbb..2be2b54af719e9 100644 --- a/deps/npm/lib/test.js +++ b/deps/npm/lib/test.js @@ -2,6 +2,11 @@ const LifecycleCmd = require('./utils/lifecycle-cmd.js') // This ends up calling run-script(['test', ...args]) class Test extends LifecycleCmd { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Test a package' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'test' diff --git a/deps/npm/lib/token.js b/deps/npm/lib/token.js index 3d7952ccfc292f..a80988531eebf8 100644 --- a/deps/npm/lib/token.js +++ b/deps/npm/lib/token.js @@ -10,6 +10,10 @@ const readUserInfo = require('./utils/read-user-info.js') const BaseCommand = require('./base-command.js') class Token extends BaseCommand { + static get description () { + return 'Manage your authentication tokens' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'token' diff --git a/deps/npm/lib/uninstall.js b/deps/npm/lib/uninstall.js index ee0f338e9fc0a8..11e65533a8e98d 100644 --- a/deps/npm/lib/uninstall.js +++ b/deps/npm/lib/uninstall.js @@ -7,14 +7,23 @@ const completion = require('./utils/completion/installed-shallow.js') const BaseCommand = require('./base-command.js') class Uninstall extends BaseCommand { + static get description () { + return 'Remove a package' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'uninstall' } + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get params () { + return ['save'] + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get usage () { - return ['[<@scope>/][@]... [-S|--save|--no-save]'] + return ['[<@scope>/]...'] } /* istanbul ignore next - see test/lib/load-all-commands.js */ @@ -28,7 +37,8 @@ class Uninstall extends BaseCommand { async uninstall (args) { // the /path/to/node_modules/.. - const { global, prefix } = this.npm.flatOptions + const global = this.npm.config.get('global') + const prefix = this.npm.config.get('prefix') const path = global ? resolve(this.npm.globalDir, '..') : prefix if (!args.length) { diff --git a/deps/npm/lib/unpublish.js b/deps/npm/lib/unpublish.js index 68a9a0ae64ee55..d49bb7ba4e3591 100644 --- a/deps/npm/lib/unpublish.js +++ b/deps/npm/lib/unpublish.js @@ -12,6 +12,10 @@ const getIdentity = require('./utils/get-identity.js') const BaseCommand = require('./base-command.js') class Unpublish extends BaseCommand { + static get description () { + return 'Remove a package from the registry' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'unpublish' @@ -63,8 +67,9 @@ class Unpublish extends BaseCommand { throw new Error(this.usage) const spec = args.length && npa(args[0]) - const opts = this.npm.flatOptions - const { force, silent, loglevel } = opts + const force = this.npm.config.get('force') + const silent = this.npm.config.get('silent') + const loglevel = this.npm.config.get('loglevel') let pkgName let pkgVersion @@ -79,6 +84,7 @@ class Unpublish extends BaseCommand { ) } + const opts = this.npm.flatOptions if (!spec || path.resolve(spec.name) === this.npm.localPrefix) { // if there's a package.json in the current folder, then // read the package name and version out of that. diff --git a/deps/npm/lib/unstar.js b/deps/npm/lib/unstar.js index 5786cfce60f73a..bc32ba617b46ab 100644 --- a/deps/npm/lib/unstar.js +++ b/deps/npm/lib/unstar.js @@ -1,6 +1,11 @@ const Star = require('./star.js') class Unstar extends Star { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Remove an item from your favorite packages' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'unstar' diff --git a/deps/npm/lib/update.js b/deps/npm/lib/update.js index 87540b96e07e54..6a87dd9ecddcfb 100644 --- a/deps/npm/lib/update.js +++ b/deps/npm/lib/update.js @@ -8,14 +8,24 @@ const completion = require('./utils/completion/installed-deep.js') const BaseCommand = require('./base-command.js') class Update extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'Update packages' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'update' } + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get params () { + return ['global'] + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get usage () { - return ['[-g] [...]'] + return ['[...]'] } /* istanbul ignore next - see test/lib/load-all-commands.js */ @@ -30,11 +40,11 @@ class Update extends BaseCommand { async update (args) { const update = args.length === 0 ? true : args const global = path.resolve(this.npm.globalDir, '..') - const where = this.npm.flatOptions.global + const where = this.npm.config.get('global') ? global : this.npm.prefix - if (this.npm.flatOptions.depth) { + if (this.npm.config.get('depth')) { log.warn('update', 'The --depth option no longer has any effect. See RFC0019.\n' + 'https://github.com/npm/rfcs/blob/latest/implemented/0019-remove-update-depth-option.md') } diff --git a/deps/npm/lib/utils/config.js b/deps/npm/lib/utils/config.js deleted file mode 100644 index 3ca9766132f02f..00000000000000 --- a/deps/npm/lib/utils/config.js +++ /dev/null @@ -1,394 +0,0 @@ -// defaults, types, and shorthands - -const { - typeDefs: { - semver: { type: semver }, - Umask: { type: Umask }, - url: { type: url }, - path: { type: path }, - }, -} = require('@npmcli/config') - -const { version: npmVersion } = require('../../package.json') - -const ciDetect = require('@npmcli/ci-detect') -const ciName = ciDetect() - -const isWindows = require('./is-windows.js') - -const editor = process.env.EDITOR || - process.env.VISUAL || - (isWindows ? 'notepad.exe' : 'vi') - -const shell = isWindows ? process.env.ComSpec || 'cmd' - : process.env.SHELL || 'sh' - -const { tmpdir, networkInterfaces } = require('os') -const getLocalAddresses = () => { - try { - return Object.values(networkInterfaces()).map( - int => int.map(({ address }) => address) - ).reduce((set, addrs) => set.concat(addrs), [undefined]) - } catch (e) { - return [undefined] - } -} - -const unicode = /UTF-?8$/i.test( - process.env.LC_ALL || process.env.LC_CTYPE || process.env.LANG -) - -// use LOCALAPPDATA on Windows, if set -// https://github.com/npm/cli/pull/899 -const cacheRoot = (isWindows && process.env.LOCALAPPDATA) || '~' -const cacheExtra = isWindows ? 'npm-cache' : '.npm' -const cache = `${cacheRoot}/${cacheExtra}` - -const defaults = { - access: null, - all: false, - 'allow-same-version': false, - also: null, - 'always-auth': false, - audit: true, - 'audit-level': null, - _auth: null, - 'auth-type': 'legacy', - before: null, - 'bin-links': true, - browser: null, - ca: null, - cache, - 'cache-lock-retries': 10, - 'cache-lock-stale': 60000, - 'cache-lock-wait': 10000, - 'cache-max': Infinity, - 'cache-min': 10, - cafile: null, - call: '', - cert: null, - 'ci-name': ciName || null, - cidr: null, - color: process.env.NO_COLOR == null, - 'commit-hooks': true, - depth: null, - description: true, - dev: false, - diff: [], - 'diff-unified': null, - 'diff-ignore-all-space': false, - 'diff-name-only': false, - 'diff-no-prefix': false, - 'diff-src-prefix': '', - 'diff-dst-prefix': '', - 'diff-text': false, - 'dry-run': false, - editor, - 'engine-strict': false, - 'fetch-retries': 2, - 'fetch-retry-factor': 10, - 'fetch-retry-maxtimeout': 60000, - 'fetch-retry-mintimeout': 10000, - 'fetch-timeout': 5 * 60 * 1000, - force: false, - 'foreground-script': false, - 'format-package-lock': true, - fund: true, - git: 'git', - 'git-tag-version': true, - global: false, - 'global-style': false, - // `globalconfig` has its default defined outside of this module - heading: 'npm', - 'https-proxy': null, - 'if-present': false, - 'ignore-prepublish': false, - 'ignore-scripts': false, - include: [], - 'include-staged': false, - 'init-author-email': '', - 'init-author-name': '', - 'init-author-url': '', - 'init-license': 'ISC', - 'init-module': '~/.npm-init.js', - 'init-version': '1.0.0', - 'init.author.email': '', - 'init.author.name': '', - 'init.author.url': '', - 'init.license': 'ISC', - 'init.module': '~/.npm-init.js', - 'init.version': '1.0.0', - json: false, - key: null, - 'legacy-bundling': false, - 'legacy-peer-deps': false, - link: false, - 'local-address': undefined, - loglevel: 'notice', - 'logs-max': 10, - long: false, - maxsockets: 50, - message: '%s', - 'node-options': null, - 'node-version': process.version, - noproxy: null, - 'npm-version': npmVersion, - offline: false, - omit: [], - only: null, - optional: true, - otp: null, - package: [], - 'package-lock': true, - 'package-lock-only': false, - parseable: false, - 'prefer-offline': false, - 'prefer-online': false, - // `prefix` has its default defined outside of this module - preid: '', - production: process.env.NODE_ENV === 'production', - progress: !ciName, - proxy: null, - 'read-only': false, - 'rebuild-bundle': true, - registry: 'https://registry.npmjs.org/', - rollback: true, - save: true, - 'save-bundle': false, - 'save-dev': false, - 'save-exact': false, - 'save-optional': false, - 'save-prefix': '^', - 'save-prod': false, - scope: '', - 'script-shell': null, - 'scripts-prepend-node-path': 'warn-only', - searchexclude: null, - searchlimit: 20, - searchopts: '', - searchstaleness: 15 * 60, - shell, - shrinkwrap: true, - 'sign-git-commit': false, - 'sign-git-tag': false, - 'sso-poll-frequency': 500, - 'sso-type': 'oauth', - 'strict-peer-deps': false, - 'strict-ssl': true, - tag: 'latest', - 'tag-version-prefix': 'v', - timing: false, - tmp: tmpdir(), - umask: 0, - unicode, - 'update-notifier': true, - usage: false, - 'user-agent': 'npm/{npm-version} ' + - 'node/{node-version} ' + - '{platform} ' + - '{arch} ' + - '{ci}', - userconfig: '~/.npmrc', - version: false, - versions: false, - viewer: isWindows ? 'browser' : 'man', -} - -const types = { - access: [null, 'restricted', 'public'], - all: Boolean, - 'allow-same-version': Boolean, - also: [null, 'dev', 'development'], - _auth: [null, String], - 'always-auth': Boolean, - audit: Boolean, - 'audit-level': ['low', 'moderate', 'high', 'critical', 'none', null], - 'auth-type': ['legacy', 'sso', 'saml', 'oauth'], - before: [null, Date], - 'bin-links': Boolean, - browser: [null, Boolean, String], - ca: [null, String, Array], - cache: path, - 'cache-lock-retries': Number, - 'cache-lock-stale': Number, - 'cache-lock-wait': Number, - 'cache-max': Number, - 'cache-min': Number, - cafile: path, - call: String, - cert: [null, String], - 'ci-name': [null, String], - cidr: [null, String, Array], - color: ['always', Boolean], - 'commit-hooks': Boolean, - depth: [null, Number], - description: Boolean, - dev: Boolean, - diff: [String, Array], - 'diff-unified': [null, Number], - 'diff-ignore-all-space': Boolean, - 'diff-name-only': Boolean, - 'diff-no-prefix': Boolean, - 'diff-src-prefix': String, - 'diff-dst-prefix': String, - 'diff-text': Boolean, - 'dry-run': Boolean, - editor: String, - 'engine-strict': Boolean, - 'fetch-retries': Number, - 'fetch-retry-factor': Number, - 'fetch-retry-maxtimeout': Number, - 'fetch-retry-mintimeout': Number, - 'fetch-timeout': Number, - force: Boolean, - 'foreground-script': Boolean, - 'format-package-lock': Boolean, - fund: Boolean, - git: String, - 'git-tag-version': Boolean, - global: Boolean, - 'global-style': Boolean, - globalconfig: path, - heading: String, - 'https-proxy': [null, url], - 'if-present': Boolean, - 'ignore-prepublish': Boolean, - 'ignore-scripts': Boolean, - include: [Array, 'prod', 'dev', 'optional', 'peer'], - 'include-staged': Boolean, - 'init-author-email': String, - 'init-author-name': String, - 'init-author-url': ['', url], - 'init-license': String, - 'init-module': path, - 'init-version': semver, - 'init.author.email': String, - 'init.author.name': String, - 'init.author.url': ['', url], - 'init.license': String, - 'init.module': path, - 'init.version': semver, - json: Boolean, - key: [null, String], - 'legacy-bundling': Boolean, - 'legacy-peer-deps': Boolean, - link: Boolean, - 'local-address': getLocalAddresses(), - loglevel: [ - 'silent', - 'error', - 'warn', - 'notice', - 'http', - 'timing', - 'info', - 'verbose', - 'silly', - ], - 'logs-max': Number, - long: Boolean, - maxsockets: Number, - message: String, - 'node-options': [null, String], - 'node-version': [null, semver], - noproxy: [null, String, Array], - 'npm-version': semver, - offline: Boolean, - omit: [Array, 'dev', 'optional', 'peer'], - only: [null, 'dev', 'development', 'prod', 'production'], - optional: Boolean, - otp: [null, String], - package: [String, Array], - 'package-lock': Boolean, - 'package-lock-only': Boolean, - parseable: Boolean, - 'prefer-offline': Boolean, - 'prefer-online': Boolean, - prefix: path, - preid: String, - production: Boolean, - progress: Boolean, - proxy: [null, false, url], // allow proxy to be disabled explicitly - 'read-only': Boolean, - 'rebuild-bundle': Boolean, - registry: [null, url], - rollback: Boolean, - save: Boolean, - 'save-bundle': Boolean, - 'save-dev': Boolean, - 'save-exact': Boolean, - 'save-optional': Boolean, - 'save-prefix': String, - 'save-prod': Boolean, - scope: String, - 'script-shell': [null, String], - 'scripts-prepend-node-path': [Boolean, 'auto', 'warn-only'], - searchexclude: [null, String], - searchlimit: Number, - searchopts: String, - searchstaleness: Number, - shell: String, - shrinkwrap: Boolean, - 'sign-git-commit': Boolean, - 'sign-git-tag': Boolean, - 'sso-poll-frequency': Number, - 'sso-type': [null, 'oauth', 'saml'], - 'strict-peer-deps': Boolean, - 'strict-ssl': Boolean, - tag: String, - 'tag-version-prefix': String, - timing: Boolean, - tmp: path, - umask: Umask, - unicode: Boolean, - 'update-notifier': Boolean, - usage: Boolean, - 'user-agent': String, - userconfig: path, - version: Boolean, - versions: Boolean, - viewer: String, -} - -const shorthands = { - '?': ['--usage'], - a: ['--all'], - B: ['--save-bundle'], - C: ['--prefix'], - c: ['--call'], - D: ['--save-dev'], - d: ['--loglevel', 'info'], - dd: ['--loglevel', 'verbose'], - ddd: ['--loglevel', 'silly'], - desc: ['--description'], - E: ['--save-exact'], - 'enjoy-by': ['--before'], - f: ['--force'], - g: ['--global'], - H: ['--usage'], - h: ['--usage'], - help: ['--usage'], - l: ['--long'], - local: ['--no-global'], - m: ['--message'], - n: ['--no-yes'], - 'no-desc': ['--no-description'], - 'no-reg': ['--no-registry'], - noreg: ['--no-registry'], - O: ['--save-optional'], - P: ['--save-prod'], - p: ['--parseable'], - porcelain: ['--parseable'], - q: ['--loglevel', 'warn'], - quiet: ['--loglevel', 'warn'], - readonly: ['--read-only'], - reg: ['--registry'], - S: ['--save'], - s: ['--loglevel', 'silent'], - silent: ['--loglevel', 'silent'], - v: ['--version'], - verbose: ['--loglevel', 'verbose'], - y: ['--yes'], -} - -module.exports = { defaults, types, shorthands } diff --git a/deps/npm/lib/utils/config/definition.js b/deps/npm/lib/utils/config/definition.js new file mode 100644 index 00000000000000..cb4eb78210c6ec --- /dev/null +++ b/deps/npm/lib/utils/config/definition.js @@ -0,0 +1,185 @@ +// class that describes a config key we know about +// this keeps us from defining a config key and not +// providing a default, description, etc. +// +// TODO: some kind of categorization system, so we can +// say "these are for registry access", "these are for +// version resolution" etc. + +const required = [ + 'type', + 'description', + 'default', + 'key', +] + +const allowed = [ + 'default', + 'defaultDescription', + 'deprecated', + 'description', + 'flatten', + 'hint', + 'key', + 'short', + 'type', + 'typeDescription', + 'usage', +] + +const { + typeDefs: { + semver: { type: semver }, + Umask: { type: Umask }, + url: { type: url }, + path: { type: path }, + }, +} = require('@npmcli/config') + +class Definition { + constructor (key, def) { + this.key = key + Object.assign(this, def) + this.validate() + if (!this.defaultDescription) + this.defaultDescription = describeValue(this.default) + if (!this.typeDescription) + this.typeDescription = describeType(this.type) + if (!this.hint) + this.hint = `<${this.key}>` + if (!this.usage) + this.usage = describeUsage(this) + } + + validate () { + for (const req of required) { + if (!Object.prototype.hasOwnProperty.call(this, req)) + throw new Error(`config lacks ${req}: ${this.key}`) + } + if (!this.key) + throw new Error(`config lacks key: ${this.key}`) + for (const field of Object.keys(this)) { + if (!allowed.includes(field)) + throw new Error(`config defines unknown field ${field}: ${this.key}`) + } + } + + // a textual description of this config, suitable for help output + describe () { + const description = unindent(this.description) + const deprecated = !this.deprecated ? '' + : `* DEPRECATED: ${unindent(this.deprecated)}\n` + return wrapAll(`#### \`${this.key}\` + +* Default: ${unindent(this.defaultDescription)} +* Type: ${unindent(this.typeDescription)} +${deprecated} +${description} +`) + } +} + +// Usage for a single param, abstracted because we have arrays of types in +// config definition +const paramUsage = (type, def) => { + let key = `--${def.key}` + if (def.short && typeof def.short === 'string') + key = `-${def.short}|${key}` + if (type === Boolean) + return `${key}` + else + return `${key} ${def.hint}` +} + +const describeUsage = (def) => { + if (Array.isArray(def.type)) { + if (!def.type.some(d => d !== null && typeof d !== 'string')) + return `--${def.key} <${def.type.filter(d => d).join('|')}>` + else + return def.type.filter(d => d).map((t) => paramUsage(t, def)).join('|') + } + return paramUsage(def.type, def) +} + +const describeType = type => { + if (Array.isArray(type)) { + const descriptions = type + .filter(t => t !== Array) + .map(t => describeType(t)) + + // [a] => "a" + // [a, b] => "a or b" + // [a, b, c] => "a, b, or c" + // [a, Array] => "a (can be set multiple times)" + // [a, Array, b] => "a or b (can be set multiple times)" + const last = descriptions.length > 1 ? [descriptions.pop()] : [] + const oxford = descriptions.length > 1 ? ', or ' : ' or ' + const words = [descriptions.join(', ')].concat(last).join(oxford) + const multiple = type.includes(Array) ? ' (can be set multiple times)' + : '' + return `${words}${multiple}` + } + + // Note: these are not quite the same as the description printed + // when validation fails. In that case, we want to give the user + // a bit more information to help them figure out what's wrong. + switch (type) { + case String: + return 'String' + case Number: + return 'Number' + case Umask: + return 'Octal numeric string in range 0000..0777 (0..511)' + case Boolean: + return 'Boolean' + case Date: + return 'Date' + case path: + return 'Path' + case semver: + return 'SemVer string' + case url: + return 'URL' + default: + return describeValue(type) + } +} + +// if it's a string, quote it. otherwise, just cast to string. +const describeValue = val => + typeof val === 'string' ? JSON.stringify(val) : String(val) + +const unindent = s => { + // get the first \n followed by a bunch of spaces, and pluck off + // that many spaces from the start of every line. + const match = s.match(/\n +/) + return !match ? s.trim() : s.split(match[0]).join('\n').trim() +} + +const wrap = (s) => { + const cols = Math.min(Math.max(20, process.stdout.columns) || 80, 80) - 5 + return unindent(s).split(/[ \n]+/).reduce((left, right) => { + const last = left.split('\n').pop() + const join = last.length && last.length + right.length > cols ? '\n' : ' ' + return left + join + right + }) +} + +const wrapAll = s => { + let inCodeBlock = false + return s.split('\n\n').map(block => { + if (inCodeBlock || block.startsWith('```')) { + inCodeBlock = !block.endsWith('```') + return block + } + + if (block.charAt(0) === '*') { + return '* ' + block.substr(1).trim().split('\n* ').map(li => { + return wrap(li).replace(/\n/g, '\n ') + }).join('\n* ') + } else + return wrap(block) + }).join('\n\n') +} + +module.exports = Definition diff --git a/deps/npm/lib/utils/config/definitions.js b/deps/npm/lib/utils/config/definitions.js new file mode 100644 index 00000000000000..a6ecbcd0c40a59 --- /dev/null +++ b/deps/npm/lib/utils/config/definitions.js @@ -0,0 +1,2054 @@ +const definitions = {} +module.exports = definitions + +const Definition = require('./definition.js') + +const { version: npmVersion } = require('../../../package.json') +const ciDetect = require('@npmcli/ci-detect') +const ciName = ciDetect() +const querystring = require('querystring') +const isWindows = require('../is-windows.js') +const { join } = require('path') + +// used by cafile flattening to flatOptions.ca +const fs = require('fs') +const maybeReadFile = file => { + try { + return fs.readFileSync(file, 'utf8') + } catch (er) { + if (er.code !== 'ENOENT') + throw er + return null + } +} + +const editor = process.env.EDITOR || + process.env.VISUAL || + (isWindows ? 'notepad.exe' : 'vi') + +const shell = isWindows ? process.env.ComSpec || 'cmd' + : process.env.SHELL || 'sh' + +const { tmpdir, networkInterfaces } = require('os') +const getLocalAddresses = () => { + try { + return Object.values(networkInterfaces()).map( + int => int.map(({ address }) => address) + ).reduce((set, addrs) => set.concat(addrs), [null]) + } catch (e) { + return [null] + } +} + +const unicode = /UTF-?8$/i.test( + process.env.LC_ALL || + process.env.LC_CTYPE || + process.env.LANG +) + +// use LOCALAPPDATA on Windows, if set +// https://github.com/npm/cli/pull/899 +const cacheRoot = (isWindows && process.env.LOCALAPPDATA) || '~' +const cacheExtra = isWindows ? 'npm-cache' : '.npm' +const cache = `${cacheRoot}/${cacheExtra}` + +const Config = require('@npmcli/config') + +// TODO: refactor these type definitions so that they are less +// weird to pull out of the config module. +// TODO: use better type definition/validation API, nopt's is so weird. +const { + typeDefs: { + semver: { type: semver }, + Umask: { type: Umask }, + url: { type: url }, + path: { type: path }, + }, +} = Config + +const define = (key, def) => { + /* istanbul ignore if - this should never happen, prevents mistakes below */ + if (definitions[key]) + throw new Error(`defining key more than once: ${key}`) + definitions[key] = new Definition(key, def) +} + +// basic flattening function, just copy it over camelCase +const flatten = (key, obj, flatOptions) => { + const camel = key.replace(/-([a-z])/g, (_0, _1) => _1.toUpperCase()) + flatOptions[camel] = obj[key] +} + +// TODO: +// Instead of having each definition provide a flatten method, +// provide the (?list of?) flat option field(s?) that it impacts. +// When that config is set, we mark the relevant flatOption fields +// dirty. Then, a getter for that field defines how we actually +// set it. +// +// So, `save-dev`, `save-optional`, `save-prod`, et al would indicate +// that they affect the `saveType` flat option. Then the config.flat +// object has a `get saveType () { ... }` that looks at the "real" +// config settings from files etc and returns the appropriate value. +// +// Getters will also (maybe?) give us a hook to audit flat option +// usage, so we can document and group these more appropriately. +// +// This will be a problem with cases where we currently do: +// const opts = { ...npm.flatOptions, foo: 'bar' }, but we can maybe +// instead do `npm.config.set('foo', 'bar')` prior to passing the +// config object down where it needs to go. +// +// This way, when we go hunting for "where does saveType come from anyway!?" +// while fixing some Arborist bug, we won't have to hunt through too +// many places. + +// Define all config keys we know about + +define('_auth', { + default: null, + type: [null, String], + description: ` + A basic-auth string to use when authenticating against the npm registry. + + Warning: This should generally not be set via a command-line option. It + is safer to use a registry-provided authentication bearer token stored in + the ~/.npmrc file by running \`npm login\`. + `, +}) + +define('access', { + default: null, + defaultDescription: ` + 'restricted' for scoped packages, 'public' for unscoped packages + `, + type: [null, 'restricted', 'public'], + description: ` + When publishing scoped packages, the access level defaults to + \`restricted\`. If you want your scoped package to be publicly viewable + (and installable) set \`--access=public\`. The only valid values for + \`access\` are \`public\` and \`restricted\`. Unscoped packages _always_ + have an access level of \`public\`. + `, + flatten, +}) + +define('all', { + default: false, + type: Boolean, + short: 'a', + description: ` + When running \`npm outdated\` and \`npm ls\`, setting \`--all\` will show + all outdated or installed packages, rather than only those directly + depended upon by the current project. + `, + flatten, +}) + +define('allow-same-version', { + default: false, + type: Boolean, + description: ` + Prevents throwing an error when \`npm version\` is used to set the new + version to the same value as the current version. + `, + flatten, +}) + +define('also', { + default: null, + type: [null, 'dev', 'development'], + description: ` + When set to \`dev\` or \`development\`, this is an alias for + \`--include=dev\`. + `, + deprecated: 'Please use --include=dev instead.', + flatten (key, obj, flatOptions) { + if (!/^dev(elopment)?$/.test(obj.also)) + return + + // add to include, and call the omit flattener + obj.include = obj.include || [] + obj.include.push('dev') + definitions.omit.flatten('omit', obj, flatOptions) + }, +}) + +define('always-auth', { + default: false, + type: Boolean, + description: ` + Force npm to always require authentication when accessing the registry, + even for \`GET\` requests. + `, + flatten, +}) + +define('audit', { + default: true, + type: Boolean, + description: ` + When "true" submit audit reports alongside \`npm install\` runs to the + default registry and all registries configured for scopes. See the + documentation for [\`npm audit\`](/commands/npm-audit) for details on + what is submitted. + `, + flatten, +}) + +define('audit-level', { + default: null, + type: ['low', 'moderate', 'high', 'critical', 'none', null], + description: ` + The minimum level of vulnerability for \`npm audit\` to exit with + a non-zero exit code. + `, + flatten, +}) + +define('auth-type', { + default: 'legacy', + type: ['legacy', 'sso', 'saml', 'oauth'], + deprecated: ` + This method of SSO/SAML/OAuth is deprecated and will be removed in + a future version of npm in favor of web-based login. + `, + description: ` + What authentication strategy to use with \`adduser\`/\`login\`. + `, + flatten, +}) + +define('before', { + default: null, + type: [null, Date], + description: ` + If passed to \`npm install\`, will rebuild the npm tree such that only + versions that were available **on or before** the \`--before\` time get + installed. If there's no versions available for the current set of + direct dependencies, the command will error. + + If the requested version is a \`dist-tag\` and the given tag does not + pass the \`--before\` filter, the most recent version less than or equal + to that tag will be used. For example, \`foo@latest\` might install + \`foo@1.2\` even though \`latest\` is \`2.0\`. + `, + flatten, +}) + +define('bin-links', { + default: true, + type: Boolean, + description: ` + Tells npm to create symlinks (or \`.cmd\` shims on Windows) for package + executables. + + Set to false to have it not do this. This can be used to work around the + fact that some file systems don't support symlinks, even on ostensibly + Unix systems. + `, + flatten, +}) + +define('browser', { + default: null, + defaultDescription: ` + OS X: \`"open"\`, Windows: \`"start"\`, Others: \`"xdg-open"\` + `, + type: [null, Boolean, String], + description: ` + The browser that is called by npm commands to open websites. + + Set to \`false\` to suppress browser behavior and instead print urls to + terminal. + + Set to \`true\` to use default system URL opener. + `, + flatten, +}) + +define('ca', { + default: null, + type: [null, String, Array], + description: ` + The Certificate Authority signing certificate that is trusted for SSL + connections to the registry. Values should be in PEM format (Windows + calls it "Base-64 encoded X.509 (.CER)") with newlines replaced by the + string "\\n". For example: + + \`\`\`ini + ca="-----BEGIN CERTIFICATE-----\\nXXXX\\nXXXX\\n-----END CERTIFICATE-----" + \`\`\` + + Set to \`null\` to only allow "known" registrars, or to a specific CA + cert to trust only that specific signing authority. + + Multiple CAs can be trusted by specifying an array of certificates: + + \`\`\`ini + ca[]="..." + ca[]="..." + \`\`\` + + See also the \`strict-ssl\` config. + `, + flatten, +}) + +define('cache', { + default: cache, + defaultDescription: ` + Windows: \`%LocalAppData%\\npm-cache\`, Posix: \`~/.npm\` + `, + type: path, + description: ` + The location of npm's cache directory. See [\`npm + cache\`](/commands/npm-cache) + `, + flatten (key, obj, flatOptions) { + flatOptions.cache = join(obj.cache, '_cacache') + }, +}) + +define('cache-max', { + default: Infinity, + type: Number, + description: ` + \`--cache-max=0\` is an alias for \`--prefer-online\` + `, + deprecated: ` + This option has been deprecated in favor of \`--prefer-online\` + `, + flatten (key, obj, flatOptions) { + if (obj[key] <= 0) + flatOptions.preferOnline = true + }, +}) + +define('cache-min', { + default: 0, + type: Number, + description: ` + \`--cache-min=9999 (or bigger)\` is an alias for \`--prefer-offline\`. + `, + deprecated: ` + This option has been deprecated in favor of \`--prefer-offline\`. + `, + flatten (key, obj, flatOptions) { + if (obj[key] >= 9999) + flatOptions.preferOffline = true + }, +}) + +define('cafile', { + default: null, + type: path, + description: ` + A path to a file containing one or multiple Certificate Authority signing + certificates. Similar to the \`ca\` setting, but allows for multiple + CA's, as well as for the CA information to be stored in a file on disk. + `, + flatten (key, obj, flatOptions) { + // always set to null in defaults + if (!obj.cafile) + return + + const raw = maybeReadFile(obj.cafile) + if (!raw) + return + + const delim = '-----END CERTIFICATE-----' + flatOptions.ca = raw.replace(/\r\n/g, '\n').split(delim) + .filter(section => section.trim()) + .map(section => section.trimLeft() + delim) + }, +}) + +define('call', { + default: '', + type: String, + short: 'c', + description: ` + Optional companion option for \`npm exec\`, \`npx\` that allows for + specifying a custom command to be run along with the installed packages. + + \`\`\`bash + npm exec --package yo --package generator-node --call "yo node" + \`\`\` + `, + flatten, +}) + +define('cert', { + default: null, + type: [null, String], + description: ` + A client certificate to pass when accessing the registry. Values should + be in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with + newlines replaced by the string "\\n". For example: + + \`\`\`ini + cert="-----BEGIN CERTIFICATE-----\\nXXXX\\nXXXX\\n-----END CERTIFICATE-----" + \`\`\` + + It is _not_ the path to a certificate file (and there is no "certfile" + option). + `, + flatten, +}) + +define('ci-name', { + default: ciName || null, + defaultDescription: ` + The name of the current CI system, or \`null\` when not on a known CI + platform. + `, + type: [null, String], + description: ` + The name of a continuous integration system. If not set explicitly, npm + will detect the current CI environment using the + [\`@npmcli/ci-detect\`](http://npm.im/@npmcli/ci-detect) module. + `, + flatten, +}) + +define('cidr', { + default: null, + type: [null, String, Array], + description: ` + This is a list of CIDR address to be used when configuring limited access + tokens with the \`npm token create\` command. + `, + flatten, +}) + +define('color', { + default: !process.env.NO_COLOR || process.env.NO_COLOR === '0', + defaultDescription: ` + true unless the NO_COLOR environ is set to something other than '0' + `, + type: ['always', Boolean], + description: ` + If false, never shows colors. If \`"always"\` then always shows colors. + If true, then only prints color codes for tty file descriptors. + `, + flatten (key, obj, flatOptions) { + flatOptions.color = !obj.color ? false + : obj.color === 'always' ? true + : process.stdout.isTTY + }, +}) + +define('commit-hooks', { + default: true, + type: Boolean, + description: ` + Run git commit hooks when using the \`npm version\` command. + `, + flatten, +}) + +define('depth', { + default: null, + defaultDescription: ` + \`Infinity\` if \`--all\` is set, otherwise \`1\` + `, + type: [null, Number], + description: ` + The depth to go when recursing packages for \`npm ls\`. + + If not set, \`npm ls\` will show only the immediate dependencies of the + root project. If \`--all\` is set, then npm will show all dependencies + by default. + `, + flatten, +}) + +define('description', { + default: true, + type: Boolean, + usage: '--no-description', + description: ` + Show the description in \`npm search\` + `, + flatten (key, obj, flatOptions) { + flatOptions.search = flatOptions.search || { limit: 20 } + flatOptions.search[key] = obj[key] + }, +}) + +define('diff', { + default: [], + type: [String, Array], + description: ` + Define arguments to compare in \`npm diff\`. + `, + flatten, +}) + +define('diff-ignore-all-space', { + default: false, + type: Boolean, + description: ` + Ignore whitespace when comparing lines in \`npm diff\`. + `, + flatten, +}) + +define('diff-name-only', { + default: false, + type: Boolean, + description: ` + Prints only filenames when using \`npm diff\`. + `, + flatten, +}) + +define('diff-no-prefix', { + default: false, + type: Boolean, + description: ` + Do not show any source or destination prefix in \`npm diff\` output. + + Note: this causes \`npm diff\` to ignore the \`--diff-src-prefix\` and + \`--diff-dst-prefix\` configs. + `, + flatten, +}) + +define('diff-dst-prefix', { + default: 'b/', + type: String, + description: ` + Destination prefix to be used in \`npm diff\` output. + `, + flatten, +}) + +define('diff-src-prefix', { + default: 'a/', + type: String, + description: ` + Source prefix to be used in \`npm diff\` output. + `, + flatten, +}) + +define('diff-text', { + default: false, + type: Boolean, + description: ` + Treat all files as text in \`npm diff\`. + `, + flatten, +}) + +define('diff-unified', { + default: 3, + type: Number, + description: ` + The number of lines of context to print in \`npm diff\`. + `, + flatten, +}) + +define('dry-run', { + default: false, + type: Boolean, + description: ` + Indicates that you don't want npm to make any changes and that it should + only report what it would have done. This can be passed into any of the + commands that modify your local installation, eg, \`install\`, + \`update\`, \`dedupe\`, \`uninstall\`, as well as \`pack\` and + \`publish\`. + + Note: This is NOT honored by other network related commands, eg + \`dist-tags\`, \`owner\`, etc. + `, + flatten, +}) + +define('editor', { + default: editor, + defaultDescription: ` + The EDITOR or VISUAL environment variables, or 'notepad.exe' on Windows, + or 'vim' on Unix systems + `, + type: String, + description: ` + The command to run for \`npm edit\` and \`npm config edit\`. + `, + flatten, +}) + +define('engine-strict', { + default: false, + type: Boolean, + description: ` + If set to true, then npm will stubbornly refuse to install (or even + consider installing) any package that claims to not be compatible with + the current Node.js version. + + This can be overridden by setting the \`--force\` flag. + `, + flatten, +}) + +define('fetch-retries', { + default: 2, + type: Number, + description: ` + The "retries" config for the \`retry\` module to use when fetching + packages from the registry. + + npm will retry idempotent read requests to the registry in the case + of network failures or 5xx HTTP errors. + `, + flatten (key, obj, flatOptions) { + flatOptions.retry = flatOptions.retry || {} + flatOptions.retry.retries = obj[key] + }, +}) + +define('fetch-retry-factor', { + default: 10, + type: Number, + description: ` + The "factor" config for the \`retry\` module to use when fetching + packages. + `, + flatten (key, obj, flatOptions) { + flatOptions.retry = flatOptions.retry || {} + flatOptions.retry.factor = obj[key] + }, +}) + +define('fetch-retry-maxtimeout', { + default: 60000, + defaultDescription: '60000 (1 minute)', + type: Number, + description: ` + The "maxTimeout" config for the \`retry\` module to use when fetching + packages. + `, + flatten (key, obj, flatOptions) { + flatOptions.retry = flatOptions.retry || {} + flatOptions.retry.maxTimeout = obj[key] + }, +}) + +define('fetch-retry-mintimeout', { + default: 10000, + defaultDescription: '10000 (10 seconds)', + type: Number, + description: ` + The "minTimeout" config for the \`retry\` module to use when fetching + packages. + `, + flatten (key, obj, flatOptions) { + flatOptions.retry = flatOptions.retry || {} + flatOptions.retry.minTimeout = obj[key] + }, +}) + +define('fetch-timeout', { + default: 5 * 60 * 1000, + defaultDescription: `${5 * 60 * 1000} (5 minutes)`, + type: Number, + description: ` + The maximum amount of time to wait for HTTP requests to complete. + `, + flatten (key, obj, flatOptions) { + flatOptions.timeout = obj[key] + }, +}) + +define('force', { + default: false, + type: Boolean, + short: 'f', + description: ` + Removes various protections against unfortunate side effects, common + mistakes, unnecessary performance degradation, and malicious input. + + * Allow clobbering non-npm files in global installs. + * Allow the \`npm version\` command to work on an unclean git repository. + * Allow deleting the cache folder with \`npm cache clean\`. + * Allow installing packages that have an \`engines\` declaration + requiring a different version of npm. + * Allow installing packages that have an \`engines\` declaration + requiring a different version of \`node\`, even if \`--engine-strict\` + is enabled. + * Allow \`npm audit fix\` to install modules outside your stated + dependency range (including SemVer-major changes). + * Allow unpublishing all versions of a published package. + * Allow conflicting peerDependencies to be installed in the root project. + + If you don't have a clear idea of what you want to do, it is strongly + recommended that you do not use this option! + `, + flatten, +}) + +define('foreground-scripts', { + default: false, + type: Boolean, + description: ` + Run all build scripts (ie, \`preinstall\`, \`install\`, and + \`postinstall\`) scripts for installed packages in the foreground + process, sharing standard input, output, and error with the main npm + process. + + Note that this will generally make installs run slower, and be much + noisier, but can be useful for debugging. + `, + flatten, +}) + +define('format-package-lock', { + default: true, + type: Boolean, + description: ` + Format \`package-lock.json\` or \`npm-shrinkwrap.json\` as a human + readable file. + `, + flatten, +}) + +define('fund', { + default: true, + type: Boolean, + description: ` + When "true" displays the message at the end of each \`npm install\` + acknowledging the number of dependencies looking for funding. + See [\`npm fund\`](/commands/npm-fund) for details. + `, + flatten, +}) + +define('git', { + default: 'git', + type: String, + description: ` + The command to use for git commands. If git is installed on the + computer, but is not in the \`PATH\`, then set this to the full path to + the git binary. + `, + flatten, +}) + +define('git-tag-version', { + default: true, + type: Boolean, + description: ` + Tag the commit when using the \`npm version\` command. + `, + flatten, +}) + +define('global', { + default: false, + type: Boolean, + short: 'g', + description: ` + Operates in "global" mode, so that packages are installed into the + \`prefix\` folder instead of the current working directory. See + [folders](/configuring-npm/folders) for more on the differences in + behavior. + + * packages are installed into the \`{prefix}/lib/node_modules\` folder, + instead of the current working directory. + * bin files are linked to \`{prefix}/bin\` + * man pages are linked to \`{prefix}/share/man\` + `, + flatten, +}) + +define('global-style', { + default: false, + type: Boolean, + description: ` + 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. + `, + flatten, +}) + +// the globalconfig has its default defined outside of this module +define('globalconfig', { + type: path, + default: '', + defaultDescription: ` + The global --prefix setting plus 'etc/npmrc'. For example, + '/usr/local/etc/npmrc' + `, + description: ` + The config file to read for global config options. + `, + flatten, +}) + +define('heading', { + default: 'npm', + type: String, + description: ` + The string that starts all the debugging log output. + `, + flatten, +}) + +define('https-proxy', { + default: null, + type: [null, url], + description: ` + A proxy to use for outgoing https requests. If the \`HTTPS_PROXY\` or + \`https_proxy\` or \`HTTP_PROXY\` or \`http_proxy\` environment variables + are set, proxy settings will be honored by the underlying + \`make-fetch-happen\` library. + `, + flatten, +}) + +define('if-present', { + default: false, + type: Boolean, + description: ` + If true, npm will not exit with an error code when \`run-script\` is + invoked for a script that isn't defined in the \`scripts\` section of + \`package.json\`. This option can be used when it's desirable to + optionally run a script when it's present and fail if the script fails. + This is useful, for example, when running scripts that may only apply for + some builds in an otherwise generic CI setup. + `, + flatten, +}) + +define('ignore-scripts', { + default: false, + type: Boolean, + description: ` + If true, npm does not run scripts specified in package.json files. + `, + flatten, +}) + +define('include', { + default: [], + type: [Array, 'prod', 'dev', 'optional', 'peer'], + description: ` + Option that allows for defining which types of dependencies to install. + + This is the inverse of \`--omit=\`. + + Dependency types specified in \`--include\` will not be omitted, + regardless of the order in which omit/include are specified on the + command-line. + `, + flatten (key, obj, flatOptions) { + // just call the omit flattener, it reads from obj.include + definitions.omit.flatten('omit', obj, flatOptions) + }, +}) + +define('include-staged', { + default: false, + type: Boolean, + description: ` + Allow installing "staged" published packages, as defined by [npm RFC PR + #92](https://github.com/npm/rfcs/pull/92). + + This is experimental, and not implemented by the npm public registry. + `, + flatten, +}) + +define('init-author-email', { + default: '', + type: String, + description: ` + The value \`npm init\` should use by default for the package author's + email. + `, +}) + +define('init-author-name', { + default: '', + type: String, + description: ` + The value \`npm init\` should use by default for the package author's name. + `, +}) + +define('init-author-url', { + default: '', + type: ['', url], + description: ` + The value \`npm init\` should use by default for the package author's homepage. + `, +}) + +define('init-license', { + default: 'ISC', + type: String, + description: ` + The value \`npm init\` should use by default for the package license. + `, +}) + +define('init-module', { + default: '~/.npm-init.js', + type: path, + description: ` + A module that will be loaded by the \`npm init\` command. See the + documentation for the + [init-package-json](https://github.com/npm/init-package-json) module for + more information, or [npm init](/commands/npm-init). + `, +}) + +define('init-version', { + default: '1.0.0', + type: semver, + description: ` + The value that \`npm init\` should use by default for the package + version number, if not already set in package.json. + `, +}) + +// these "aliases" are historically supported in .npmrc files, unfortunately +// They should be removed in a future npm version. +define('init.author.email', { + default: '', + type: String, + deprecated: ` + Use \`--init-author-email\` instead.`, + description: ` + Alias for \`--init-author-email\` + `, +}) + +define('init.author.name', { + default: '', + type: String, + deprecated: ` + Use \`--init-author-name\` instead. + `, + description: ` + Alias for \`--init-author-name\` + `, +}) + +define('init.author.url', { + default: '', + type: ['', url], + deprecated: ` + Use \`--init-author-url\` instead. + `, + description: ` + Alias for \`--init-author-url\` + `, +}) + +define('init.license', { + default: 'ISC', + type: String, + deprecated: ` + Use \`--init-license\` instead. + `, + description: ` + Alias for \`--init-license\` + `, +}) + +define('init.module', { + default: '~/.npm-init.js', + type: path, + deprecated: ` + Use \`--init-module\` instead. + `, + description: ` + Alias for \`--init-module\` + `, +}) + +define('init.version', { + default: '1.0.0', + type: semver, + deprecated: ` + Use \`--init-version\` instead. + `, + description: ` + Alias for \`--init-version\` + `, +}) + +define('json', { + default: false, + type: Boolean, + description: ` + Whether or not to output JSON data, rather than the normal output. + + This feature is currently experimental, and the output data structures + for many commands is either not implemented in JSON yet, or subject to + change. Only the output from \`npm ls --json\` and \`npm search --json\` + are currently valid. + `, + flatten, +}) + +define('key', { + default: null, + type: [null, String], + description: ` + A client key to pass when accessing the registry. Values should be in + PEM format with newlines replaced by the string "\\n". For example: + + \`\`\`ini + key="-----BEGIN PRIVATE KEY-----\\nXXXX\\nXXXX\\n-----END PRIVATE KEY-----" + \`\`\` + + It is _not_ the path to a key file (and there is no "keyfile" option). + `, + flatten, +}) + +define('legacy-bundling', { + default: false, + type: Boolean, + description: ` + 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. + `, + flatten, +}) + +define('legacy-peer-deps', { + default: false, + type: Boolean, + description: ` + Causes npm to completely ignore \`peerDependencies\` when building a + package tree, as in npm versions 3 through 6. + + If a package cannot be installed because of overly strict + \`peerDependencies\` that collide, it provides a way to move forward + resolving the situation. + + This differs from \`--omit=peer\`, in that \`--omit=peer\` will avoid + unpacking \`peerDependencies\` on disk, but will still design a tree such + that \`peerDependencies\` _could_ be unpacked in a correct place. + + Use of \`legacy-peer-deps\` is not recommended, as it will not enforce + the \`peerDependencies\` contract that meta-dependencies may rely on. + `, + flatten, +}) + +define('link', { + default: false, + type: Boolean, + description: ` + If true, then local installs will link if there is a suitable globally + installed package. + + Note that this means that local installs can cause things to be installed + into the global space at the same time. The link is only done if one of + the two conditions are met: + + * The package is not already installed globally, or + * the globally installed version is identical to the version that is + being installed locally. + `, +}) + +define('local-address', { + default: null, + type: getLocalAddresses(), + typeDescription: 'IP Address', + description: ` + The IP address of the local interface to use when making connections to + the npm registry. Must be IPv4 in versions of Node prior to 0.12. + `, + flatten, +}) + +define('loglevel', { + default: 'notice', + type: [ + 'silent', + 'error', + 'warn', + 'notice', + 'http', + 'timing', + 'info', + 'verbose', + 'silly', + ], + description: ` + What level of logs to report. On failure, *all* logs are written to + \`npm-debug.log\` in the current working directory. + + Any logs of a higher level than the setting are shown. The default is + "notice". + `, +}) + +define('logs-max', { + default: 10, + type: Number, + description: ` + The maximum number of log files to store. + `, +}) + +define('long', { + default: false, + type: Boolean, + short: 'l', + description: ` + Show extended information in \`npm ls\` and \`npm search\`. + `, +}) + +define('maxsockets', { + default: Infinity, + type: Number, + description: ` + The maximum number of connections to use per origin (protocol/host/port + combination). + `, + flatten (key, obj, flatOptions) { + flatOptions.maxSockets = obj[key] + }, +}) + +define('message', { + default: '%s', + type: String, + short: 'm', + description: ` + Commit message which is used by \`npm version\` when creating version commit. + + Any "%s" in the message will be replaced with the version number. + `, + flatten, +}) + +define('node-options', { + default: null, + type: [null, String], + description: ` + Options to pass through to Node.js via the \`NODE_OPTIONS\` environment + variable. This does not impact how npm itself is executed but it does + impact how lifecycle scripts are called. + `, +}) + +define('node-version', { + default: process.version, + defaultDescription: 'Node.js `process.version` value', + type: semver, + description: ` + The node version to use when checking a package's \`engines\` setting. + `, + flatten, +}) + +define('noproxy', { + default: '', + defaultDescription: ` + The value of the NO_PROXY environment variable + `, + type: [String, Array], + description: ` + Domain extensions that should bypass any proxies. + + Also accepts a comma-delimited string. + `, + flatten (key, obj, flatOptions) { + flatOptions.noProxy = obj[key].join(',') + }, +}) + +define('npm-version', { + default: npmVersion, + defaultDescription: 'Output of `npm --version`', + type: semver, + description: ` + The npm version to use when checking a package's \`engines\` setting. + `, + flatten, +}) + +define('offline', { + default: false, + type: Boolean, + description: ` + Force offline mode: no network requests will be done during install. To allow + the CLI to fill in missing cache data, see \`--prefer-offline\`. + `, + flatten, +}) + +define('omit', { + default: process.env.NODE_ENV === 'production' ? ['dev'] : [], + defaultDescription: ` + 'dev' if the NODE_ENV environment variable is set to 'production', + otherwise empty. + `, + type: [Array, 'dev', 'optional', 'peer'], + description: ` + Dependency types to omit from the installation tree on disk. + + Note that these dependencies _are_ still resolved and added to the + \`package-lock.json\` or \`npm-shrinkwrap.json\` file. They are just + not physically installed on disk. + + If a package type appears in both the \`--include\` and \`--omit\` + lists, then it will be included. + + If the resulting omit list includes \`'dev'\`, then the \`NODE_ENV\` + environment variable will be set to \`'production'\` for all lifecycle + scripts. + `, + flatten (key, obj, flatOptions) { + const include = obj.include || [] + const omit = flatOptions.omit || [] + flatOptions.omit = omit.concat(obj[key]) + .filter(type => type && !include.includes(type)) + }, +}) + +define('only', { + default: null, + type: [null, 'prod', 'production'], + deprecated: ` + Use \`--omit=dev\` to omit dev dependencies from the install. + `, + description: ` + When set to \`prod\` or \`production\`, this is an alias for + \`--omit=dev\`. + `, + flatten (key, obj, flatOptions) { + const value = obj[key] + if (!/^prod(uction)?$/.test(value)) + return + + obj.omit = obj.omit || [] + obj.omit.push('dev') + definitions.omit.flatten('omit', obj, flatOptions) + }, +}) + +define('optional', { + default: null, + type: [null, Boolean], + deprecated: ` + Use \`--omit=optional\` to exclude optional dependencies, or + \`--include=optional\` to include them. + + Default value does install optional deps unless otherwise omitted. + `, + description: ` + Alias for --include=optional or --omit=optional + `, + flatten (key, obj, flatOptions) { + const value = obj[key] + if (value === null) + return + else if (value === true) { + obj.include = obj.include || [] + obj.include.push('optional') + } else { + obj.omit = obj.omit || [] + obj.omit.push('optional') + } + definitions.omit.flatten('omit', obj, flatOptions) + }, +}) + +define('otp', { + default: null, + type: [null, String], + description: ` + This is a one-time password from a two-factor authenticator. It's needed + when publishing or changing package permissions with \`npm access\`. + + If not set, and a registry response fails with a challenge for a one-time + password, npm will prompt on the command line for one. + `, + flatten, +}) + +define('package', { + default: [], + hint: '[@]', + type: [String, Array], + description: ` + The package to install for [\`npm exec\`](/commands/npm-exec) + `, + flatten, +}) + +define('package-lock', { + default: true, + type: Boolean, + description: ` + If set to false, then ignore \`package-lock.json\` files when installing. + This will also prevent _writing_ \`package-lock.json\` if \`save\` is + true. + + When package package-locks are disabled, automatic pruning of extraneous + modules will also be disabled. To remove extraneous modules with + package-locks disabled use \`npm prune\`. + `, + flatten, +}) + +define('package-lock-only', { + default: false, + type: Boolean, + description: ` + If set to true, it will update only the \`package-lock.json\`, instead of + checking \`node_modules\` and downloading dependencies. + `, + flatten, +}) + +define('parseable', { + default: false, + type: Boolean, + short: 'p', + description: ` + Output parseable results from commands that write to standard output. For + \`npm search\`, this will be tab-separated table format. + `, + flatten, +}) + +define('prefer-offline', { + default: false, + type: Boolean, + description: ` + If true, staleness checks for cached data will be bypassed, but missing + data will be requested from the server. To force full offline mode, use + \`--offline\`. + `, + flatten, +}) + +define('prefer-online', { + default: false, + type: Boolean, + description: ` + If true, staleness checks for cached data will be forced, making the CLI + look for updates immediately even for fresh package data. + `, + flatten, +}) + +// `prefix` has its default defined outside of this module +define('prefix', { + type: path, + short: 'C', + default: '', + defaultDescription: ` + In global mode, the folder where the node executable is installed. In + local mode, the nearest parent folder containing either a package.json + file or a node_modules folder. + `, + description: ` + The location to install global items. If set on the command line, then + it forces non-global commands to run in the specified folder. + `, +}) + +define('preid', { + default: '', + type: String, + description: ` + The "prerelease identifier" to use as a prefix for the "prerelease" part + of a semver. Like the \`rc\` in \`1.2.0-rc.8\`. + `, + flatten, +}) + +define('production', { + default: false, + type: Boolean, + deprecated: 'Use `--omit=dev` instead.', + description: 'Alias for `--omit=dev`', + flatten (key, obj, flatOptions) { + const value = obj[key] + if (!value) + return + + obj.omit = obj.omit || [] + obj.omit.push('dev') + definitions.omit.flatten('omit', obj, flatOptions) + }, +}) + +define('progress', { + default: !ciName, + defaultDescription: ` + \`true\` unless running in a known CI system + `, + type: Boolean, + description: ` + When set to \`true\`, npm will display a progress bar during time + intensive operations, if \`process.stderr\` is a TTY. + + Set to \`false\` to suppress the progress bar. + `, +}) + +define('proxy', { + default: null, + type: [null, false, url], // allow proxy to be disabled explicitly + description: ` + A proxy to use for outgoing http requests. If the \`HTTP_PROXY\` or + \`http_proxy\` environment variables are set, proxy settings will be + honored by the underlying \`request\` library. + `, + flatten, +}) + +define('read-only', { + default: false, + type: Boolean, + description: ` + This is used to mark a token as unable to publish when configuring + limited access tokens with the \`npm token create\` command. + `, + flatten, +}) + +define('rebuild-bundle', { + default: true, + type: Boolean, + description: ` + Rebuild bundled dependencies after installation. + `, + flatten, +}) + +define('registry', { + default: 'https://registry.npmjs.org/', + type: url, + description: ` + The base URL of the npm registry. + `, + flatten, +}) + +define('save', { + default: true, + usage: '-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer', + type: Boolean, + short: 'S', + description: ` + Save installed packages to a package.json file as dependencies. + + When used with the \`npm rm\` command, removes the dependency from + package.json. + `, + flatten, +}) + +define('save-bundle', { + default: false, + type: Boolean, + short: 'B', + description: ` + If a package would be saved at install time by the use of \`--save\`, + \`--save-dev\`, or \`--save-optional\`, then also put it in the + \`bundleDependencies\` list. + + Ignore if \`--save-peer\` is set, since peerDependencies cannot be bundled. + `, + flatten (key, obj, flatOptions) { + // XXX update arborist to just ignore it if resulting saveType is peer + // otherwise this won't have the expected effect: + // + // npm config set save-peer true + // npm i foo --save-bundle --save-prod <-- should bundle + flatOptions.saveBundle = obj['save-bundle'] && !obj['save-peer'] + }, +}) + +// XXX: We should really deprecate all these `--save-blah` switches +// in favor of a single `--save-type` option. The unfortunate shortcut +// we took for `--save-peer --save-optional` being `--save-type=peerOptional` +// makes this tricky, and likely a breaking change. + +define('save-dev', { + default: false, + type: Boolean, + short: 'D', + description: ` + Save installed packages to a package.json file as \`devDependencies\`. + `, + flatten (key, obj, flatOptions) { + if (!obj[key]) { + if (flatOptions.saveType === 'dev') + delete flatOptions.saveType + return + } + + flatOptions.saveType = 'dev' + }, +}) + +define('save-exact', { + default: false, + type: Boolean, + short: 'E', + description: ` + Dependencies saved to package.json will be configured with an exact + version rather than using npm's default semver range operator. + `, + flatten, +}) + +define('save-optional', { + default: false, + type: Boolean, + short: 'O', + description: ` + Save installed packages to a package.json file as + \`optionalDependencies\`. + `, + flatten (key, obj, flatOptions) { + if (!obj[key]) { + if (flatOptions.saveType === 'optional') + delete flatOptions.saveType + else if (flatOptions.saveType === 'peerOptional') + flatOptions.saveType = 'peer' + return + } + + if (flatOptions.saveType === 'peerOptional') + return + + if (flatOptions.saveType === 'peer') + flatOptions.saveType = 'peerOptional' + else + flatOptions.saveType = 'optional' + }, +}) + +define('save-peer', { + default: false, + type: Boolean, + description: ` + Save installed packages. to a package.json file as \`peerDependencies\` + `, + flatten (key, obj, flatOptions) { + if (!obj[key]) { + if (flatOptions.saveType === 'peer') + delete flatOptions.saveType + else if (flatOptions.saveType === 'peerOptional') + flatOptions.saveType = 'optional' + return + } + + if (flatOptions.saveType === 'peerOptional') + return + + if (flatOptions.saveType === 'optional') + flatOptions.saveType = 'peerOptional' + else + flatOptions.saveType = 'peer' + }, +}) + +define('save-prefix', { + default: '^', + type: String, + description: ` + Configure how versions of packages installed to a package.json file via + \`--save\` or \`--save-dev\` get prefixed. + + For example if a package has version \`1.2.3\`, by default its version is + set to \`^1.2.3\` which allows minor upgrades for that package, but after + \`npm config set save-prefix='~'\` it would be set to \`~1.2.3\` which + only allows patch upgrades. + `, + flatten, +}) + +define('save-prod', { + default: false, + type: Boolean, + short: 'P', + description: ` + Save installed packages into \`dependencies\` specifically. This is + useful if a package already exists in \`devDependencies\` or + \`optionalDependencies\`, but you want to move it to be a non-optional + production dependency. + + This is the default behavior if \`--save\` is true, and neither + \`--save-dev\` or \`--save-optional\` are true. + `, + flatten (key, obj, flatOptions) { + if (!obj[key]) { + if (flatOptions.saveType === 'prod') + delete flatOptions.saveType + return + } + + flatOptions.saveType = 'prod' + }, +}) + +define('scope', { + default: '', + defaultDescription: ` + the scope of the current project, if any, or "" + `, + type: String, + hint: '<@scope>', + description: ` + Associate an operation with a scope for a scoped registry. + + Useful when logging in to a private registry for the first time: + + \`\`\`bash + npm login --scope=@mycorp --registry=https://registry.mycorp.com + \`\`\` + + This will cause \`@mycorp\` to be mapped to the registry for future + installation of packages specified according to the pattern + \`@mycorp/package\`. + `, + flatten (key, obj, flatOptions) { + const value = obj[key] + flatOptions.projectScope = value && !/^@/.test(value) ? `@${value}` : value + }, +}) + +define('script-shell', { + default: null, + defaultDescription: ` + '/bin/sh' on POSIX systems, 'cmd.exe' on Windows + `, + type: [null, String], + description: ` + The shell to use for scripts run with the \`npm run\` command. + `, + flatten (key, obj, flatOptions) { + flatOptions.scriptShell = obj[key] || undefined + }, +}) + +define('searchexclude', { + default: '', + type: String, + description: ` + Space-separated options that limit the results from search. + `, + flatten (key, obj, flatOptions) { + flatOptions.search = flatOptions.search || { limit: 20 } + flatOptions.search.exclude = obj[key] + }, +}) + +define('searchlimit', { + default: 20, + type: Number, + description: ` + Number of items to limit search results to. Will not apply at all to + legacy searches. + `, + flatten (key, obj, flatOptions) { + flatOptions.search = flatOptions.search || {} + flatOptions.search.limit = obj[key] + }, +}) + +define('searchopts', { + default: '', + type: String, + description: ` + Space-separated options that are always passed to search. + `, + flatten (key, obj, flatOptions) { + flatOptions.search = flatOptions.search || { limit: 20 } + flatOptions.search.opts = querystring.parse(obj[key]) + }, +}) + +define('searchstaleness', { + default: 15 * 60, + type: Number, + description: ` + The age of the cache, in seconds, before another registry request is made + if using legacy search endpoint. + `, + flatten (key, obj, flatOptions) { + flatOptions.search = flatOptions.search || { limit: 20 } + flatOptions.search.staleness = obj[key] + }, +}) + +define('shell', { + default: shell, + defaultDescription: ` + SHELL environment variable, or "bash" on Posix, or "cmd.exe" on Windows + `, + type: String, + description: ` + The shell to run for the \`npm explore\` command. + `, + flatten, +}) + +define('shrinkwrap', { + default: true, + type: Boolean, + deprecated: ` + Use the --package-lock setting instead. + `, + description: ` + Alias for --package-lock + `, + flatten (key, obj, flatOptions) { + obj['package-lock'] = obj.shrinkwrap + definitions['package-lock'].flatten('package-lock', obj, flatOptions) + }, +}) + +define('sign-git-commit', { + default: false, + type: Boolean, + description: ` + If set to true, then the \`npm version\` command will commit the new + package version using \`-S\` to add a signature. + + Note that git requires you to have set up GPG keys in your git configs + for this to work properly. + `, + flatten, +}) + +define('sign-git-tag', { + default: false, + type: Boolean, + description: ` + If set to true, then the \`npm version\` command will tag the version + using \`-s\` to add a signature. + + Note that git requires you to have set up GPG keys in your git configs + for this to work properly. + `, + flatten, +}) + +define('sso-poll-frequency', { + default: 500, + type: Number, + deprecated: ` + The --auth-type method of SSO/SAML/OAuth will be removed in a future + version of npm in favor of web-based login. + `, + description: ` + When used with SSO-enabled \`auth-type\`s, configures how regularly the + registry should be polled while the user is completing authentication. + `, + flatten, +}) + +define('sso-type', { + default: 'oauth', + type: [null, 'oauth', 'saml'], + deprecated: ` + The --auth-type method of SSO/SAML/OAuth will be removed in a future + version of npm in favor of web-based login. + `, + description: ` + If \`--auth-type=sso\`, the type of SSO type to use. + `, + flatten, +}) + +define('strict-peer-deps', { + default: false, + type: Boolean, + description: ` + If set to \`true\`, and \`--legacy-peer-deps\` is not set, then _any_ + conflicting \`peerDependencies\` will be treated as an install failure, + even if npm could reasonably guess the appropriate resolution based on + non-peer dependency relationships. + + By default, conflicting \`peerDependencies\` deep in the dependency graph + will be resolved using the nearest non-peer dependency specification, + even if doing so will result in some packages receiving a peer dependency + outside the range set in their package's \`peerDependencies\` object. + + When such 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. + `, + flatten, +}) + +define('strict-ssl', { + default: true, + type: Boolean, + description: ` + Whether or not to do SSL key validation when making requests to the + registry via https. + + See also the \`ca\` config. + `, + flatten (key, obj, flatOptions) { + flatOptions.strictSSL = obj[key] + }, +}) + +define('tag', { + default: 'latest', + type: String, + description: ` + If you ask npm to install a package and don't tell it a specific version, + then it will install the specified tag. + + Also the tag that is added to the package@version specified by the \`npm + tag\` command, if no explicit tag is given. + `, + flatten (key, obj, flatOptions) { + flatOptions.defaultTag = obj[key] + }, +}) + +define('tag-version-prefix', { + default: 'v', + type: String, + description: ` + If set, alters the prefix used when tagging a new version when performing + a version increment using \`npm-version\`. To remove the prefix + altogether, set it to the empty string: \`""\`. + + Because other tools may rely on the convention that npm version tags look + like \`v1.0.0\`, _only use this property if it is absolutely necessary_. + In particular, use care when overriding this setting for public packages. + `, + flatten, +}) + +define('timing', { + default: false, + type: Boolean, + description: ` + If true, writes an \`npm-debug\` log to \`_logs\` and timing information + to \`_timing.json\`, both in your cache, even if the command completes + successfully. \`_timing.json\` is a newline delimited list of JSON + objects. + + You can quickly view it with this [json](https://npm.im/json) command + line: \`npm exec -- json -g < ~/.npm/_timing.json\`. + `, +}) + +define('tmp', { + default: tmpdir(), + defaultDescription: ` + The value returned by the Node.js \`os.tmpdir()\` method + + `, + type: path, + deprecated: ` + This setting is no longer used. npm stores temporary files in a special + location in the cache, and they are managed by + [\`cacache\`](http://npm.im/cacache). + `, + description: ` + Historically, the location where temporary files were stored. No longer + relevant. + `, +}) + +define('umask', { + default: 0, + type: Umask, + description: ` + The "umask" value to use when setting the file creation mode on files and + folders. + + Folders and executables are given a mode which is \`0o777\` masked + against this value. Other files are given a mode which is \`0o666\` + masked against this value. + + Note that the underlying system will _also_ apply its own umask value to + files and folders that are created, and npm does not circumvent this, but + rather adds the \`--umask\` config to it. + + Thus, the effective default umask value on most POSIX systems is 0o22, + meaning that folders and executables are created with a mode of 0o755 and + other files are created with a mode of 0o644. + `, + flatten, +}) + +define('unicode', { + default: unicode, + defaultDescription: ` + false on windows, true on mac/unix systems with a unicode locale, as + defined by the LC_ALL, LC_CTYPE, or LANG environment variables. + `, + type: Boolean, + description: ` + When set to true, npm uses unicode characters in the tree output. When + false, it uses ascii characters instead of unicode glyphs. + `, +}) + +define('update-notifier', { + default: true, + type: Boolean, + description: ` + Set to false to suppress the update notification when using an older + version of npm than the latest. + `, +}) + +define('usage', { + default: false, + type: Boolean, + short: ['?', 'H', 'h'], + description: ` + Show short usage output about the command specified. + `, +}) + +define('user-agent', { + default: 'npm/{npm-version} ' + + 'node/{node-version} ' + + '{platform} ' + + '{arch} ' + + '{ci}', + type: String, + description: ` + Sets the User-Agent request header. The following fields are replaced + with their actual counterparts: + + * \`{npm-version}\` - The npm version in use + * \`{node-version}\` - The Node.js version in use + * \`{platform}\` - The value of \`process.platform\` + * \`{arch}\` - The value of \`process.arch\` + * \`{ci}\` - The value of the \`ci-name\` config, if set, prefixed with + \`ci/\`, or an empty string if \`ci-name\` is empty. + `, + flatten (key, obj, flatOptions) { + const value = obj[key] + const ciName = obj['ci-name'] + flatOptions.userAgent = + value.replace(/\{node-version\}/gi, obj['node-version']) + .replace(/\{npm-version\}/gi, obj['npm-version']) + .replace(/\{platform\}/gi, process.platform) + .replace(/\{arch\}/gi, process.arch) + .replace(/\{ci\}/gi, ciName ? `ci/${ciName}` : '') + .trim() + }, +}) + +define('userconfig', { + default: '~/.npmrc', + type: path, + description: ` + The location of user-level configuration settings. + + This may be overridden by the \`npm_config_userconfig\` environment + variable or the \`--userconfig\` command line option, but may _not_ + be overridden by settings in the \`globalconfig\` file. + `, +}) + +define('version', { + default: false, + type: Boolean, + short: 'v', + description: ` + If true, output the npm version and exit successfully. + + Only relevant when specified explicitly on the command line. + `, +}) + +define('versions', { + default: false, + type: Boolean, + description: ` + If true, output the npm version as well as node's \`process.versions\` + map and the version in the current working directory's \`package.json\` + file if one exists, and exit successfully. + + Only relevant when specified explicitly on the command line. + `, +}) + +define('viewer', { + default: isWindows ? 'browser' : 'man', + defaultDescription: ` + "man" on Posix, "browser" on Windows + `, + type: String, + description: ` + The program to use to view help content. + + Set to \`"browser"\` to view html help content in the default web browser. + `, +}) + +define('which', { + default: null, + hint: '', + type: [null, Number], + description: ` + If there are multiple funding sources, which 1-indexed source URL to open. + `, +}) + +define('workspace', { + default: [], + type: [String, Array], + short: 'w', + description: ` + Enable running a command in the context of the configured workspaces of the + current project while filtering by running only the workspaces defined by + this configuration option. + + Valid values for the \`workspace\` config are either: + - Workspace names + - Path to a workspace directory + - Path to a parent workspace directory (will result to selecting all of the + nested workspaces) + `, +}) + +define('workspaces', { + default: false, + type: Boolean, + short: 'ws', + description: ` + Enable running a command in the context of **all** the configured + workspaces. + `, +}) + +define('yes', { + default: null, + type: [null, Boolean], + short: 'y', + description: ` + Automatically answer "yes" to any prompts that npm might print on + the command line. + `, +}) diff --git a/deps/npm/lib/utils/config/describe-all.js b/deps/npm/lib/utils/config/describe-all.js new file mode 100644 index 00000000000000..ab3f3a63ea751c --- /dev/null +++ b/deps/npm/lib/utils/config/describe-all.js @@ -0,0 +1,16 @@ +const definitions = require('./definitions.js') +const describeAll = () => { + // sort not-deprecated ones to the top + /* istanbul ignore next - typically already sorted in the definitions file, + * but this is here so that our help doc will stay consistent if we decide + * to move them around. */ + const sort = ([keya, {deprecated: depa}], [keyb, {deprecated: depb}]) => { + return depa && !depb ? 1 + : !depa && depb ? -1 + : keya.localeCompare(keyb) + } + return Object.entries(definitions).sort(sort) + .map(([key, def]) => def.describe()) + .join('\n\n') +} +module.exports = describeAll diff --git a/deps/npm/lib/utils/config/flatten.js b/deps/npm/lib/utils/config/flatten.js new file mode 100644 index 00000000000000..f6d6124bddf7aa --- /dev/null +++ b/deps/npm/lib/utils/config/flatten.js @@ -0,0 +1,32 @@ +// use the defined flattening function, and copy over any scoped +// registries and registry-specific "nerfdart" configs verbatim +// +// TODO: make these getters so that we only have to make dirty +// the thing that changed, and then flatten the fields that +// could have changed when a config.set is called. +// +// TODO: move nerfdart auth stuff into a nested object that +// is only passed along to paths that end up calling npm-registry-fetch. +const definitions = require('./definitions.js') +const flatten = (obj, flat = {}) => { + for (const [key, val] of Object.entries(obj)) { + const def = definitions[key] + if (def && def.flatten) + def.flatten(key, obj, flat) + else if (/@.*:registry$/i.test(key) || /^\/\//.test(key)) + flat[key] = val + } + + // XXX make this the bin/npm-cli.js file explicitly instead + // otherwise using npm programmatically is a bit of a pain. + flat.npmBin = require.main ? require.main.filename + : /* istanbul ignore next - not configurable property */ undefined + flat.nodeBin = process.env.NODE || process.execPath + + // XXX should this be sha512? is it even relevant? + flat.hashAlgorithm = 'sha1' + + return flat +} + +module.exports = flatten diff --git a/deps/npm/lib/utils/config/index.js b/deps/npm/lib/utils/config/index.js new file mode 100644 index 00000000000000..a24f5865242bfa --- /dev/null +++ b/deps/npm/lib/utils/config/index.js @@ -0,0 +1,52 @@ +const flatten = require('./flatten.js') +const definitions = require('./definitions.js') +const describeAll = require('./describe-all.js') + +// aliases where they get expanded into a completely different thing +// these are NOT supported in the environment or npmrc files, only +// expanded on the CLI. +// TODO: when we switch off of nopt, use an arg parser that supports +// more reasonable aliasing and short opts right in the definitions set. +const shorthands = { + 'enjoy-by': ['--before'], + d: ['--loglevel', 'info'], + dd: ['--loglevel', 'verbose'], + ddd: ['--loglevel', 'silly'], + quiet: ['--loglevel', 'warn'], + q: ['--loglevel', 'warn'], + s: ['--loglevel', 'silent'], + silent: ['--loglevel', 'silent'], + verbose: ['--loglevel', 'verbose'], + desc: ['--description'], + help: ['--usage'], + local: ['--no-global'], + n: ['--no-yes'], + no: ['--no-yes'], + porcelain: ['--parseable'], + readonly: ['--read-only'], + reg: ['--registry'], +} + +for (const [key, {short}] of Object.entries(definitions)) { + if (!short) + continue + // can be either an array or string + for (const s of [].concat(short)) + shorthands[s] = [`--${key}`] +} + +module.exports = { + get defaults () { + // NB: 'default' is a reserved word + return Object.entries(definitions).map(([key, { default: def }]) => { + return [key, def] + }).reduce((defaults, [key, def]) => { + defaults[key] = def + return defaults + }, {}) + }, + definitions, + flatten, + shorthands, + describeAll, +} diff --git a/deps/npm/lib/utils/did-you-mean.js b/deps/npm/lib/utils/did-you-mean.js index c2bdf159dd1185..98133196e3c567 100644 --- a/deps/npm/lib/utils/did-you-mean.js +++ b/deps/npm/lib/utils/did-you-mean.js @@ -1,12 +1,33 @@ const leven = require('leven') +const readJson = require('read-package-json-fast') +const { cmdList } = require('./cmd-list.js') -const didYouMean = (scmd, commands) => { - const best = commands +const didYouMean = async (npm, path, scmd) => { + const bestCmd = cmdList + .filter(cmd => leven(scmd, cmd) < scmd.length * 0.4 && scmd !== cmd) + .map(str => ` npm ${str} # ${npm.commands[str].description}`) + + const pkg = await readJson(`${path}/package.json`) + const { scripts } = pkg + // We would already be suggesting this in `npm x` so omit them here + const runScripts = ['stop', 'start', 'test', 'restart'] + const bestRun = Object.keys(scripts || {}) + .filter(cmd => leven(scmd, cmd) < scmd.length * 0.4 && + !runScripts.includes(cmd)) + .map(str => ` npm run ${str} # run the "${str}" package script`) + + const { bin } = pkg + const bestBin = Object.keys(bin || {}) .filter(cmd => leven(scmd, cmd) < scmd.length * 0.4) - .map(str => ` ${str}`) - return best.length === 0 ? '' - : best.length === 1 ? `\nDid you mean this?\n${best[0]}` - : `\nDid you mean one of these?\n${best.slice(0, 3).join('\n')}` -} + .map(str => ` npm exec ${str} # run the "${str}" command from either this or a remote npm package`) + const best = [...bestCmd, ...bestRun, ...bestBin] + + if (best.length === 0) + return '' + + const suggestion = best.length === 1 ? `\n\nDid you mean this?\n${best[0]}` + : `\n\nDid you mean one of these?\n${best.slice(0, 3).join('\n')}` + return suggestion +} module.exports = didYouMean diff --git a/deps/npm/lib/utils/flat-options.js b/deps/npm/lib/utils/flat-options.js deleted file mode 100644 index c082e4137ab217..00000000000000 --- a/deps/npm/lib/utils/flat-options.js +++ /dev/null @@ -1,254 +0,0 @@ -// return a flattened config object with canonical names suitable for -// passing to dependencies like arborist, pacote, npm-registry-fetch, etc. - -const log = require('npmlog') -const crypto = require('crypto') -const querystring = require('querystring') -const npmSession = crypto.randomBytes(8).toString('hex') -log.verbose('npm-session', npmSession) -const { join } = require('path') - -const buildOmitList = obj => { - const include = obj.include || [] - const omit = new Set((obj.omit || []) - .filter(type => !include.includes(type))) - const only = obj.only - - if (/^prod(uction)?$/.test(only) || obj.production) - omit.add('dev') - - if (/dev/.test(obj.also)) - omit.delete('dev') - - if (obj.dev) - omit.delete('dev') - - if (obj.optional === false) - omit.add('optional') - - obj.omit = [...omit] - - // it would perhaps make more sense to put this in @npmcli/config, but - // since we can set dev to be omitted in multiple various legacy ways, - // it's better to set it here once it's all resolved. - if (obj.omit.includes('dev')) - process.env.NODE_ENV = 'production' - - return [...omit] -} - -// turn an object with npm-config style keys into an options object -// with camelCase values. This doesn't account for the stuff that is -// not pulled from the config keys, that's all handled only for the -// main function which acts on the npm object itself. Used by the -// flatOptions generator, and by the publishConfig handling logic. -const flatten = obj => ({ - includeStaged: obj['include-staged'], - preferDedupe: obj['prefer-dedupe'], - ignoreScripts: obj['ignore-scripts'], - nodeVersion: obj['node-version'], - cache: join(obj.cache, '_cacache'), - global: obj.global, - - registry: obj.registry, - scope: obj.scope, - access: obj.access, - alwaysAuth: obj['always-auth'], - audit: obj.audit, - auditLevel: obj['audit-level'], - _auth: obj._auth, - authType: obj['auth-type'], - ssoType: obj['sso-type'], - ssoPollFrequency: obj['sso-poll-frequency'], - before: obj.before, - browser: obj.browser, - ca: obj.ca, - cafile: obj.cafile, - cert: obj.cert, - key: obj.key, - - // token creation options - cidr: obj.cidr, - readOnly: obj['read-only'], - - // npm version options - preid: obj.preid, - tagVersionPrefix: obj['tag-version-prefix'], - allowSameVersion: obj['allow-same-version'], - - // npm version git options - message: obj.message, - commitHooks: obj['commit-hooks'], - gitTagVersion: obj['git-tag-version'], - signGitCommit: obj['sign-git-commit'], - signGitTag: obj['sign-git-tag'], - - // only used for npm ls in v7, not update - depth: obj.depth, - all: obj.all, - - // Output configs - unicode: obj.unicode, - json: obj.json, - long: obj.long, - parseable: obj.parseable, - - // options for npm search - search: { - description: obj.description, - exclude: obj.searchexclude, - limit: obj.searchlimit || 20, - opts: querystring.parse(obj.searchopts), - staleness: obj.searchstaleness, - }, - - diff: obj.diff, - diffUnified: obj['diff-unified'], - diffIgnoreAllSpace: obj['diff-ignore-all-space'], - diffNameOnly: obj['diff-name-only'], - diffNoPrefix: obj['diff-no-prefix'], - diffSrcPrefix: obj['diff-src-prefix'], - diffDstPrefix: obj['diff-dst-prefix'], - diffText: obj['diff-text'], - - dryRun: obj['dry-run'], - engineStrict: obj['engine-strict'], - - retry: { - retries: obj['fetch-retries'], - factor: obj['fetch-retry-factor'], - maxTimeout: obj['fetch-retry-maxtimeout'], - minTimeout: obj['fetch-retry-mintimeout'], - }, - - timeout: obj['fetch-timeout'], - - force: obj.force, - - formatPackageLock: obj['format-package-lock'], - fund: obj.fund, - - // binary locators - git: obj.git, - viewer: obj.viewer, - editor: obj.editor, - - // configs that affect how we build trees - binLinks: obj['bin-links'], - rebuildBundle: obj['rebuild-bundle'], - // --no-shrinkwrap is the same as --no-package-lock - packageLock: !(obj['package-lock'] === false || - obj.shrinkwrap === false), - packageLockOnly: obj['package-lock-only'], - globalStyle: obj['global-style'], - legacyBundling: obj['legacy-bundling'], - foregroundScripts: !!obj['foreground-scripts'], - scriptShell: obj['script-shell'] || undefined, - shell: obj.shell, - omit: buildOmitList(obj), - legacyPeerDeps: obj['legacy-peer-deps'], - strictPeerDeps: obj['strict-peer-deps'], - - // npx stuff - call: obj.call, - package: obj.package, - - // used to build up the appropriate {add:{...}} options to Arborist.reify - save: obj.save, - saveBundle: obj['save-bundle'] && !obj['save-peer'], - saveType: obj['save-optional'] && obj['save-peer'] - ? 'peerOptional' - : obj['save-optional'] ? 'optional' - : obj['save-dev'] ? 'dev' - : obj['save-peer'] ? 'peer' - : obj['save-prod'] ? 'prod' - : null, - savePrefix: obj['save-exact'] ? '' - : obj['save-prefix'], - - // configs for npm-registry-fetch - otp: obj.otp, - offline: obj.offline, - preferOffline: getPreferOffline(obj), - preferOnline: getPreferOnline(obj), - strictSSL: obj['strict-ssl'], - defaultTag: obj.tag, - userAgent: obj['user-agent'], - - // yes, it's fine, just do it, jeez, stop asking - yes: obj.yes, - - ...getScopesAndAuths(obj), - - // npm fund exclusive option to select an item from a funding list - which: obj.which, - - // socks proxy can be configured in https-proxy or proxy field - // note that the various (HTTPS_|HTTP_|]PROXY environs will be - // respected if this is not set. - proxy: obj['https-proxy'] || obj.proxy, - noProxy: obj.noproxy, -}) - -const flatOptions = npm => npm.flatOptions || Object.freeze({ - // flatten the config object - ...flatten(npm.config.list[0]), - - // Note that many of these do not come from configs or cli flags - // per se, though they may be implied or defined by them. - log, - npmSession, - dmode: npm.modes.exec, - fmode: npm.modes.file, - umask: npm.modes.umask, - hashAlgorithm: 'sha1', // XXX should this be sha512? - color: !!npm.color, - projectScope: npm.projectScope, - npmVersion: npm.version, - - // npm.command is not set until AFTER flatOptions are defined - // so we need to make this a getter. - get npmCommand () { - return npm.command - }, - - tmp: npm.tmp, - prefix: npm.prefix, - globalPrefix: npm.globalPrefix, - localPrefix: npm.localPrefix, - npmBin: require.main && require.main.filename, - nodeBin: process.env.NODE || process.execPath, - get tag () { - return npm.config.get('tag') - }, -}) - -const getPreferOnline = obj => { - const po = obj['prefer-online'] - if (po !== undefined) - return po - - return obj['cache-max'] <= 0 -} - -const getPreferOffline = obj => { - const po = obj['prefer-offline'] - if (po !== undefined) - return po - - return obj['cache-min'] >= 9999 -} - -// pull out all the @scope: and //host:key config fields -// these are used by npm-registry-fetch for authing against registries -const getScopesAndAuths = obj => { - const scopesAndAuths = {} - // pull out all the @scope:... configs into a flat object. - for (const key in obj) { - if (/@.*:registry$/i.test(key) || /^\/\//.test(key)) - scopesAndAuths[key] = obj[key] - } - return scopesAndAuths -} - -module.exports = Object.assign(flatOptions, { flatten }) diff --git a/deps/npm/lib/utils/lifecycle-cmd.js b/deps/npm/lib/utils/lifecycle-cmd.js index 1917bef3678551..2c5b89dfcdd048 100644 --- a/deps/npm/lib/utils/lifecycle-cmd.js +++ b/deps/npm/lib/utils/lifecycle-cmd.js @@ -10,5 +10,9 @@ class LifecycleCmd extends BaseCommand { exec (args, cb) { this.npm.commands['run-script']([this.constructor.name, ...args], cb) } + + execWorkspaces (args, filters, cb) { + this.npm.commands['run-script']([this.constructor.name, ...args], cb) + } } module.exports = LifecycleCmd diff --git a/deps/npm/lib/utils/npm-usage.js b/deps/npm/lib/utils/npm-usage.js index b77bca7bec1a86..bc397cb4d95e66 100644 --- a/deps/npm/lib/utils/npm-usage.js +++ b/deps/npm/lib/utils/npm-usage.js @@ -1,14 +1,12 @@ -const didYouMean = require('./did-you-mean.js') const { dirname } = require('path') const { cmdList } = require('./cmd-list') -module.exports = (npm, valid = true) => { - npm.config.set('loglevel', 'silent') +module.exports = (npm) => { const usesBrowser = npm.config.get('viewer') === 'browser' ? ' (in a browser)' : '' - npm.log.level = 'silent' - npm.output(` -Usage: npm + return `npm + +Usage: npm install install all the dependencies in your project npm install add the dependency to your project @@ -20,7 +18,7 @@ npm help search for help on ${usesBrowser} npm help npm more involved overview${usesBrowser} All commands: -${npm.config.get('long') ? usages(npm) : ('\n ' + wrap(cmdList))} +${allCommands(npm)} Specify configs in the ini-formatted file: ${npm.config.get('userconfig')} @@ -29,14 +27,13 @@ or on the command line via: npm --key=value More configuration info: npm help config Configuration fields: npm help 7 config -npm@${npm.version} ${dirname(dirname(__dirname))} -`) - - if (npm.argv.length >= 1) - npm.output(didYouMean(npm.argv[0], cmdList)) +npm@${npm.version} ${dirname(dirname(__dirname))}` +} - if (!valid) - process.exitCode = 1 +const allCommands = (npm) => { + if (npm.config.get('long')) + return usages(npm) + return ('\n ' + wrap(cmdList)) } const wrap = (arr) => { diff --git a/deps/npm/lib/utils/ping.js b/deps/npm/lib/utils/ping.js index f5f7fcc6a62586..00956d0c1630ce 100644 --- a/deps/npm/lib/utils/ping.js +++ b/deps/npm/lib/utils/ping.js @@ -1,7 +1,7 @@ // ping the npm registry // used by the ping and doctor commands const fetch = require('npm-registry-fetch') -module.exports = async (opts) => { - const res = await fetch('/-/ping?write=true', opts) +module.exports = async (flatOptions) => { + const res = await fetch('/-/ping?write=true', flatOptions) return res.json().catch(() => ({})) } diff --git a/deps/npm/lib/utils/read-local-package.js b/deps/npm/lib/utils/read-local-package.js index c31bca994704ce..21506ca180a0f3 100644 --- a/deps/npm/lib/utils/read-local-package.js +++ b/deps/npm/lib/utils/read-local-package.js @@ -1,11 +1,12 @@ const { resolve } = require('path') const readJson = require('read-package-json-fast') async function readLocalPackageName (npm) { - if (npm.flatOptions.global) + if (npm.config.get('global')) return - const filepath = resolve(npm.flatOptions.prefix, 'package.json') - return (await readJson(filepath)).name + const filepath = resolve(npm.prefix, 'package.json') + const json = await readJson(filepath) + return json.name } module.exports = readLocalPackageName diff --git a/deps/npm/lib/version.js b/deps/npm/lib/version.js index 2eda9d11b737c4..18b7d7d6c5d840 100644 --- a/deps/npm/lib/version.js +++ b/deps/npm/lib/version.js @@ -2,6 +2,10 @@ const libversion = require('libnpmversion') const BaseCommand = require('./base-command.js') class Version extends BaseCommand { + static get description () { + return 'Bump a package version' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'version' @@ -45,7 +49,7 @@ class Version extends BaseCommand { } async change (args) { - const prefix = this.npm.flatOptions.tagVersionPrefix + const prefix = this.npm.config.get('tag-version-prefix') const version = await libversion(args[0], { ...this.npm.flatOptions, path: this.npm.prefix, @@ -71,7 +75,7 @@ class Version extends BaseCommand { for (const [key, version] of Object.entries(process.versions)) results[key] = version - if (this.npm.flatOptions.json) + if (this.npm.config.get('json')) this.npm.output(JSON.stringify(results, null, 2)) else this.npm.output(results) diff --git a/deps/npm/lib/view.js b/deps/npm/lib/view.js index 0a6688fc2b13d2..e0df1e231f9d8f 100644 --- a/deps/npm/lib/view.js +++ b/deps/npm/lib/view.js @@ -19,6 +19,11 @@ const readJson = async file => jsonParse(await readFile(file, 'utf8')) const BaseCommand = require('./base-command.js') class View extends BaseCommand { + /* istanbul ignore next - see test/lib/load-all-commands.js */ + static get description () { + return 'View registry info' + } + /* istanbul ignore next - see test/lib/load-all-commands.js */ static get name () { return 'view' @@ -41,9 +46,9 @@ class View extends BaseCommand { fullMetadata: true, preferOnline: true, } - const { defaultTag } = config const spec = npa(opts.conf.argv.remain[2]) const pckmnt = await packument(spec, config) + const defaultTag = this.npm.config.get('tag') const dv = pckmnt.versions[pckmnt['dist-tags'][defaultTag]] pckmnt.versions = Object.keys(pckmnt.versions).sort(semver.compareLoose) @@ -99,7 +104,7 @@ class View extends BaseCommand { const name = nv.name const local = (name === '.' || !name) - if (opts.global && local) + if (this.npm.config.get('global') && local) throw new Error('Cannot use view command in global mode.') if (local) { @@ -114,7 +119,7 @@ class View extends BaseCommand { } // get the data about this package - let version = nv.rawSpec || this.npm.flatOptions.defaultTag + let version = nv.rawSpec || this.npm.config.get('tag') const pckmnt = await packument(nv, opts) @@ -159,42 +164,43 @@ class View extends BaseCommand { } if ( - !opts.json && + !this.npm.config.get('json') && args.length === 1 && args[0] === '' ) { // general view pckmnt.version = version await Promise.all( - results.map((v) => this.prettyView(pckmnt, v[Object.keys(v)[0]][''], opts)) + results.map((v) => this.prettyView(pckmnt, v[Object.keys(v)[0]][''])) ) return retval } else { // view by field name - await this.printData(retval, pckmnt._id, opts) + await this.printData(retval, pckmnt._id) return retval } } - async printData (data, name, opts) { + async printData (data, name) { const versions = Object.keys(data) let msg = '' let msgJson = [] const includeVersions = versions.length > 1 let includeFields + const json = this.npm.config.get('json') versions.forEach((v) => { const fields = Object.keys(data[v]) includeFields = includeFields || (fields.length > 1) - if (opts.json) + if (json) msgJson.push({}) fields.forEach((f) => { let d = cleanup(data[v][f]) - if (fields.length === 1 && opts.json) + if (fields.length === 1 && json) msgJson[msgJson.length - 1][f] = d if (includeVersions || includeFields || typeof d !== 'string') { - if (opts.json) + if (json) msgJson[msgJson.length - 1][f] = d else { d = inspect(d, { @@ -204,10 +210,10 @@ class View extends BaseCommand { maxArrayLength: null, }) } - } else if (typeof d === 'string' && opts.json) + } else if (typeof d === 'string' && json) d = JSON.stringify(d) - if (!opts.json) { + if (!json) { if (f && includeFields) f += ' = ' msg += (includeVersions ? name + '@' + v + ' ' : '') + @@ -216,7 +222,7 @@ class View extends BaseCommand { }) }) - if (opts.json) { + if (json) { if (msgJson.length && Object.keys(msgJson[0]).length === 1) { const k = Object.keys(msgJson[0])[0] msgJson = msgJson.map(m => m[k]) @@ -236,9 +242,9 @@ class View extends BaseCommand { console.log(msg.trim()) } - async prettyView (packument, manifest, opts) { + async prettyView (packument, manifest) { // More modern, pretty printing of default view - const unicode = opts.unicode + const unicode = this.npm.config.get('unicode') const tags = [] Object.keys(packument['dist-tags']).forEach((t) => { diff --git a/deps/npm/lib/whoami.js b/deps/npm/lib/whoami.js index 2322c5fd80e5da..82c4520d9e8830 100644 --- a/deps/npm/lib/whoami.js +++ b/deps/npm/lib/whoami.js @@ -3,18 +3,18 @@ const getIdentity = require('./utils/get-identity.js') const BaseCommand = require('./base-command.js') class Whoami extends BaseCommand { /* istanbul ignore next - see test/lib/load-all-commands.js */ - static get name () { - return 'whoami' + static get description () { + return 'Display npm username' } /* istanbul ignore next - see test/lib/load-all-commands.js */ - static get description () { - return 'prints username according to given registry' + static get name () { + return 'whoami' } /* istanbul ignore next - see test/lib/load-all-commands.js */ - static get usage () { - return ['[--registry ]'] + static get params () { + return ['registry'] } exec (args, cb) { @@ -22,9 +22,10 @@ class Whoami extends BaseCommand { } async whoami (args) { - const opts = this.npm.flatOptions - const username = await getIdentity(this.npm, opts) - this.npm.output(opts.json ? JSON.stringify(username) : username) + const username = await getIdentity(this.npm, this.npm.flatOptions) + this.npm.output( + this.npm.config.get('json') ? JSON.stringify(username) : username + ) } } module.exports = Whoami diff --git a/deps/npm/lib/workspaces/get-workspaces.js b/deps/npm/lib/workspaces/get-workspaces.js new file mode 100644 index 00000000000000..64812d5403576c --- /dev/null +++ b/deps/npm/lib/workspaces/get-workspaces.js @@ -0,0 +1,33 @@ +const { resolve } = require('path') +const mapWorkspaces = require('@npmcli/map-workspaces') +const minimatch = require('minimatch') +const rpj = require('read-package-json-fast') + +const getWorkspaces = async (filters, { path }) => { + const pkg = await rpj(resolve(path, 'package.json')) + const workspaces = await mapWorkspaces({ cwd: path, pkg }) + const res = filters.length ? new Map() : workspaces + + for (const filterArg of filters) { + for (const [workspaceName, workspacePath] of workspaces.entries()) { + if (filterArg === workspaceName + || resolve(path, filterArg) === workspacePath + || minimatch(workspacePath, `${resolve(path, filterArg)}/*`)) + res.set(workspaceName, workspacePath) + } + } + + if (!res.size) { + let msg = '!' + if (filters.length) { + msg = `:\n ${filters.reduce( + (res, filterArg) => `${res} --workspace=${filterArg}`, '')}` + } + + throw new Error(`No workspaces found${msg}`) + } + + return res +} + +module.exports = getWorkspaces diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index f690c1f53ddbe7..0701a16aeb50fe 100644 --- a/deps/npm/man/man1/npm-adduser.1 +++ b/deps/npm/man/man1/npm-adduser.1 @@ -10,6 +10,8 @@ npm adduser [\-\-registry=url] [\-\-scope=@orgname] [\-\-always\-auth] [\-\-auth aliases: login, add\-user .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P Create or verify a user named \fB\fP in the specified registry, and diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1 index cf1692e8943f12..d8dfc0542c3dad 100644 --- a/deps/npm/man/man1/npm-bin.1 +++ b/deps/npm/man/man1/npm-bin.1 @@ -8,6 +8,8 @@ npm bin [\-g|\-\-global] .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P Print the folder where npm will install executables\. diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1 index 4f0b0f19fc97fe..852c24a13d1d9c 100644 --- a/deps/npm/man/man1/npm-cache.1 +++ b/deps/npm/man/man1/npm-cache.1 @@ -16,6 +16,8 @@ aliases: npm cache clear, npm cache rm npm cache verify .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P Used to add, list, or clean the npm cache folder\. diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1 index bc206f52421c5b..5be583ea6813e1 100644 --- a/deps/npm/man/man1/npm-completion.1 +++ b/deps/npm/man/man1/npm-completion.1 @@ -8,6 +8,8 @@ source <(npm completion) .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P Enables tab\-completion in all npm commands\. diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1 index 3e29c71f507275..f47947aff1d9e9 100644 --- a/deps/npm/man/man1/npm-config.1 +++ b/deps/npm/man/man1/npm-config.1 @@ -16,6 +16,8 @@ npm get [ [ \.\.\.]] alias: c .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P npm gets its config settings from the command line, environment diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1 index 70267ff45ec6c0..915b7b110cfedf 100644 --- a/deps/npm/man/man1/npm-dedupe.1 +++ b/deps/npm/man/man1/npm-dedupe.1 @@ -1,6 +1,6 @@ .TH "NPM\-DEDUPE" "1" "March 2021" "" "" .SH "NAME" -\fBnpm-dedupe\fR \- Reduce duplication +\fBnpm-dedupe\fR \- Reduce duplication in the package tree .SS Synopsis .P .RS 2 @@ -8,7 +8,7 @@ npm dedupe npm ddp -aliases: find\-dupes, ddp +aliases: ddp .fi .RE .SS Description @@ -78,6 +78,8 @@ Using \fBnpm find\-dupes\fP will run the command in \fB\-\-dry\-run\fP mode\. .SS See Also .RS 0 .IP \(bu 2 +npm find\-dupes \fI/cli\-commands/find\-dupes\fR +.IP \(bu 2 npm ls \fI/cli\-commands/ls\fR .IP \(bu 2 npm update \fI/cli\-commands/update\fR diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index fa95af0a856c80..3d8876662f1986 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -8,6 +8,8 @@ npm deprecate [@] .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P This command will update the npm registry entry for a package, providing a diff --git a/deps/npm/man/man1/npm-doctor.1 b/deps/npm/man/man1/npm-doctor.1 index c45944c2b3e841..c317f03fae1246 100644 --- a/deps/npm/man/man1/npm-doctor.1 +++ b/deps/npm/man/man1/npm-doctor.1 @@ -8,6 +8,8 @@ npm doctor .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P \fBnpm doctor\fP runs a set of checks to ensure that your npm installation has diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1 index 3c8d1ecd105812..d0461afc8f1c97 100644 --- a/deps/npm/man/man1/npm-edit.1 +++ b/deps/npm/man/man1/npm-edit.1 @@ -8,6 +8,8 @@ npm edit .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P Selects a dependency in the current project and opens the package folder in diff --git a/deps/npm/man/man1/npm-exec.1 b/deps/npm/man/man1/npm-exec.1 index 9b21bfe438f42b..a9d9708c70035e 100644 --- a/deps/npm/man/man1/npm-exec.1 +++ b/deps/npm/man/man1/npm-exec.1 @@ -9,6 +9,7 @@ npm exec \-\- [@] [args\.\.\.] npm exec \-\-package=[@] \-\- [args\.\.\.] npm exec \-c ' [args\.\.\.]' npm exec \-\-package=foo \-c ' [args\.\.\.]' +npm exec [\-ws] [\-w [@] [args\.\.\.] npx \-p [@] [args\.\.\.] @@ -161,6 +162,76 @@ $ npm x \-c 'eslint && say "hooray, lint passed"' $ npx \-c 'eslint && say "hooray, lint passed"' .fi .RE +.SS Workspaces support +.P +You may use the \fBworkspace\fP or \fBworkspaces\fP configs in order to run an +arbitrary command from an npm package (either one installed locally, or fetched +remotely) in the context of the specified workspaces\. +If no positional argument or \fB\-\-call\fP option is provided, it will open an +interactive subshell in the context of each of these configured workspaces one +at a time\. +.P +Given a project with configured workspaces, e\.g: +.P +.RS 2 +.nf +\|\. ++\-\- package\.json +`\-\- packages + +\-\- a + | `\-\- package\.json + +\-\- b + | `\-\- package\.json + `\-\- c + `\-\- package\.json +.fi +.RE +.P +Assuming the workspace configuration is properly set up at the root level +\fBpackage\.json\fP file\. e\.g: +.P +.RS 2 +.nf +{ + "workspaces": [ "\./packages/*" ] +} +.fi +.RE +.P +You can execute an arbitrary command from a package in the context of each of +the configured workspaces when using the \fBworkspaces\fP configuration options, +in this example we're using \fBeslint\fR to lint any js file found within each +workspace folder: +.P +.RS 2 +.nf +npm exec \-ws \-\- eslint \./*\.js +.fi +.RE +.SS Filtering workspaces +.P +It's also possible to execute a command in a single workspace using the +\fBworkspace\fP config along with a name or directory path: +.P +.RS 2 +.nf +npm exec \-\-workspace=a \-\- eslint \./*\.js +.fi +.RE +.P +The \fBworkspace\fP config can also be specified multiple times in order to run a +specific script in the context of multiple workspaces\. When defining values for +the \fBworkspace\fP config in the command line, it also possible to use \fB\-w\fP as a +shorthand, e\.g: +.P +.RS 2 +.nf +npm exec \-w a \-w b \-\- eslint \./*\.js +.fi +.RE +.P +This last command will run the \fBeslint\fP command in both \fB\|\./packages/a\fP and +\fB\|\./packages/b\fP folders\. .SS Compatibility with Older npx Versions .P The \fBnpx\fP binary was rewritten in npm v7\.0\.0, and the standalone \fBnpx\fP @@ -218,6 +289,44 @@ requested from the server\. To force full offline mode, use \fBoffline\fP\|\. .P Forces full offline mode\. Any packages not locally cached will result in an error\. +.SS workspace +.RS 0 +.IP \(bu 2 +Alias: \fB\-w\fP +.IP \(bu 2 +Type: Array +.IP \(bu 2 +Default: \fB[]\fP + +.RE +.P +Enable running scripts in the context of workspaces while also filtering by +the provided names or paths provided\. +.P +Valid values for the \fBworkspace\fP config are either: +.RS 0 +.IP \(bu 2 +Workspace names +.IP \(bu 2 +Path to a workspace directory +.IP \(bu 2 +Path to a parent workspace directory (will result to selecting all of the +children workspaces) + +.RE +.SS workspaces +.RS 0 +.IP \(bu 2 +Alias: \fB\-ws\fP +.IP \(bu 2 +Type: Boolean +.IP \(bu 2 +Default: \fBfalse\fP + +.RE +.P +Run scripts in the context of all configured workspaces for the current +project\. .SS See Also .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index 6b04f3be338741..3a0711e00c50af 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -8,6 +8,8 @@ npm explore [ \-\- ] .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P Spawn a subshell in the directory of the installed package specified\. diff --git a/deps/npm/man/man1/npm-find-dupes.1 b/deps/npm/man/man1/npm-find-dupes.1 new file mode 100644 index 00000000000000..6ecb4b90d58dbf --- /dev/null +++ b/deps/npm/man/man1/npm-find-dupes.1 @@ -0,0 +1,26 @@ +.TH "NPM\-FIND\-DUPES" "1" "March 2021" "" "" +.SH "NAME" +\fBnpm-find-dupes\fR \- Find duplication in the package tree +.SS Synopsis +.P +.RS 2 +.nf +npm find\-dupes +.fi +.RE +.SS Description +.P +Runs \fBnpm dedupe\fP in \fB\-\-dry\-run\fP mode, making npm only output the +duplications, without actually changing the package tree\. +.SS See Also +.RS 0 +.IP \(bu 2 +npm dedupe \fI/cli\-commands/dedupe\fR +.IP \(bu 2 +npm ls \fI/cli\-commands/ls\fR +.IP \(bu 2 +npm update \fI/cli\-commands/update\fR +.IP \(bu 2 +npm install \fI/cli\-commands/install\fR + +.RE diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1 index e0dc5419d3e86d..1a33f080d6f871 100644 --- a/deps/npm/man/man1/npm-help-search.1 +++ b/deps/npm/man/man1/npm-help-search.1 @@ -8,6 +8,8 @@ npm help\-search .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P This command will search the npm markdown documentation files for the terms diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1 index 6e0ad91a6618bd..f6ca3a84a2ac7a 100644 --- a/deps/npm/man/man1/npm-help.1 +++ b/deps/npm/man/man1/npm-help.1 @@ -8,6 +8,8 @@ npm help [] .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P If supplied a topic, then show the appropriate documentation page\. diff --git a/deps/npm/man/man1/npm-hook.1 b/deps/npm/man/man1/npm-hook.1 index f92de181308fb5..f4f2b3976211b5 100644 --- a/deps/npm/man/man1/npm-hook.1 +++ b/deps/npm/man/man1/npm-hook.1 @@ -11,6 +11,8 @@ npm hook update [secret] npm hook rm .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P Allows you to manage npm diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index 05aa13f0139013..b67899ce80fdfc 100644 --- a/deps/npm/man/man1/npm-init.1 +++ b/deps/npm/man/man1/npm-init.1 @@ -1,6 +1,6 @@ .TH "NPM\-INIT" "1" "March 2021" "" "" .SH "NAME" -\fBnpm-init\fR \- create a package\.json file +\fBnpm-init\fR \- Create a package\.json file .SS Synopsis .P .RS 2 diff --git a/deps/npm/man/man1/npm-logout.1 b/deps/npm/man/man1/npm-logout.1 index 777467cbe28f09..a917137bcbfa91 100644 --- a/deps/npm/man/man1/npm-logout.1 +++ b/deps/npm/man/man1/npm-logout.1 @@ -8,6 +8,8 @@ npm logout [\-\-registry=] [\-\-scope=<@scope>] .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P When logged into a registry that supports token\-based authentication, tell diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index c427b6b780fffd..84bd11f2d86ac8 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show: .P .RS 2 .nf -npm@7\.6\.3 /path/to/npm +npm@7\.7\.0 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 .fi diff --git a/deps/npm/man/man1/npm-org.1 b/deps/npm/man/man1/npm-org.1 index 27f3fab580f34d..cb65355572262c 100644 --- a/deps/npm/man/man1/npm-org.1 +++ b/deps/npm/man/man1/npm-org.1 @@ -10,6 +10,8 @@ npm org rm npm org ls [] .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Example .P Add a new developer to an org: diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1 index bd0758d701f0bc..cbd61fd92597a0 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -12,6 +12,8 @@ npm owner ls [<@scope>/] aliases: author .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P Manage ownership of published packages\. diff --git a/deps/npm/man/man1/npm-ping.1 b/deps/npm/man/man1/npm-ping.1 index 9357497758146d..fa9a2f1ff5abb8 100644 --- a/deps/npm/man/man1/npm-ping.1 +++ b/deps/npm/man/man1/npm-ping.1 @@ -8,6 +8,8 @@ npm ping [\-\-registry ] .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P Ping the configured or given npm registry and verify authentication\. diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1 index 85178a2c06f30f..c0685305cafe5c 100644 --- a/deps/npm/man/man1/npm-prefix.1 +++ b/deps/npm/man/man1/npm-prefix.1 @@ -8,6 +8,8 @@ npm prefix [\-g] .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P Print the local prefix to standard output\. This is the closest parent directory diff --git a/deps/npm/man/man1/npm-profile.1 b/deps/npm/man/man1/npm-profile.1 index 470b8eaf71ec33..f17ad465630b1d 100644 --- a/deps/npm/man/man1/npm-profile.1 +++ b/deps/npm/man/man1/npm-profile.1 @@ -12,6 +12,8 @@ npm profile enable\-2fa [auth\-and\-writes|auth\-only] npm profile disable\-2fa .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P Change your profile information on the registry\. Note that this command diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index e19a4c08ab62f4..b399e5d9d133fe 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -6,6 +6,8 @@ .RS 2 .nf npm run\-script [\-\-if\-present] [\-\-silent] [\-\- ] +npm run\-script [\-\-workspace=] +npm run\-script [\-\-workspaces] aliases: run, rum, urn .fi @@ -81,6 +83,72 @@ found in the \fBPATH\fP\|\. If you try to run a script without having a \fBnode_modules\fP directory and it fails, you will be given a warning to run \fBnpm install\fP, just in case you've forgotten\. +.SS Workspaces support +.P +You may use the \fBworkspace\fP or \fBworkspaces\fP configs in order to run an +arbitrary command from a package's \fB"scripts"\fP object in the context of the +specified workspaces\. If no \fB"command"\fP is provided, it will list the available +scripts for each of these configured workspaces\. +.P +Given a project with configured workspaces, e\.g: +.P +.RS 2 +.nf +\|\. ++\-\- package\.json +`\-\- packages + +\-\- a + | `\-\- package\.json + +\-\- b + | `\-\- package\.json + `\-\- c + `\-\- package\.json +.fi +.RE +.P +Assuming the workspace configuration is properly set up at the root level +\fBpackage\.json\fP file\. e\.g: +.P +.RS 2 +.nf +{ + "workspaces": [ "\./packages/*" ] +} +.fi +.RE +.P +And that each of the configured workspaces has a configured \fBtest\fP script, +we can run tests in all of them using the \fBworkspaces\fP config: +.P +.RS 2 +.nf +npm test \-\-workspaces +.fi +.RE +.SS Filtering workspaces +.P +It's also possible to run a script in a single workspace using the \fBworkspace\fP +config along with a name or directory path: +.P +.RS 2 +.nf +npm test \-\-workspace=a +.fi +.RE +.P +The \fBworkspace\fP config can also be specified multiple times in order to run a +specific script in the context of multiple workspaces\. When defining values for +the \fBworkspace\fP config in the command line, it also possible to use \fB\-w\fP as a +shorthand, e\.g: +.P +.RS 2 +.nf +npm test \-w a \-w b +.fi +.RE +.P +This last command will run \fBtest\fP in both \fB\|\./packages/a\fP and \fB\|\./packages/b\fP +packages\. .SS Configuration .SS if\-present .RS 0 @@ -125,6 +193,44 @@ Default: false .RE .P You can use the \fB\-\-silent\fP flag to prevent showing \fBnpm ERR!\fP output on error\. +.SS workspace +.RS 0 +.IP \(bu 2 +Alias: \fB\-w\fP +.IP \(bu 2 +Type: Array +.IP \(bu 2 +Default: \fB[]\fP + +.RE +.P +Enable running scripts in the context of workspaces while also filtering by +the provided names or paths provided\. +.P +Valid values for the \fBworkspace\fP config are either: +.RS 0 +.IP \(bu 2 +Workspace names +.IP \(bu 2 +Path to a workspace directory +.IP \(bu 2 +Path to a parent workspace directory (will result to selecting all of the +children workspaces) + +.RE +.SS workspaces +.RS 0 +.IP \(bu 2 +Alias: \fB\-ws\fP +.IP \(bu 2 +Type: Boolean +.IP \(bu 2 +Default: \fBfalse\fP + +.RE +.P +Run scripts in the context of all configured workspaces for the current +project\. .SS See Also .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index 3dd493edb3c974..8253e86dca6479 100644 --- a/deps/npm/man/man1/npm-search.1 +++ b/deps/npm/man/man1/npm-search.1 @@ -10,6 +10,8 @@ npm search [\-l|\-\-long] [\-\-json] [\-\-parseable] [\-\-no\-description] [sear aliases: s, se, find .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P Search the registry for packages matching the search terms\. \fBnpm search\fP diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1 index 75b4d3e2f7fe87..7800d2f53e4a0b 100644 --- a/deps/npm/man/man1/npm-shrinkwrap.1 +++ b/deps/npm/man/man1/npm-shrinkwrap.1 @@ -8,6 +8,8 @@ npm shrinkwrap .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P This command repurposes \fBpackage\-lock\.json\fP into a publishable diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index 8fdb41e9d5a068..5bd9d6a250135c 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -8,6 +8,8 @@ npm star [\.\.\.] .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P "Starring" a package means that you have some interest in it\. It's diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1 index 4d0d3d5fccc0f7..8e5f7b3b78a6c9 100644 --- a/deps/npm/man/man1/npm-stars.1 +++ b/deps/npm/man/man1/npm-stars.1 @@ -8,6 +8,8 @@ npm stars [] .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P If you have starred a lot of neat things and want to find them again diff --git a/deps/npm/man/man1/npm-team.1 b/deps/npm/man/man1/npm-team.1 index 3331bb1b41c281..82f5ab3be787b7 100644 --- a/deps/npm/man/man1/npm-team.1 +++ b/deps/npm/man/man1/npm-team.1 @@ -14,6 +14,8 @@ npm team rm npm team ls | .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P Used to manage teams in organizations, and change team memberships\. Does not diff --git a/deps/npm/man/man1/npm-token.1 b/deps/npm/man/man1/npm-token.1 index 1da8ce9f7199b9..f98f37e6eb018a 100644 --- a/deps/npm/man/man1/npm-token.1 +++ b/deps/npm/man/man1/npm-token.1 @@ -10,6 +10,8 @@ npm token revoke .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P This lets you list, create and revoke authentication tokens\. diff --git a/deps/npm/man/man1/npm-unstar.1 b/deps/npm/man/man1/npm-unstar.1 index a08ab4c5af1754..b3b7c698b3f5c4 100644 --- a/deps/npm/man/man1/npm-unstar.1 +++ b/deps/npm/man/man1/npm-unstar.1 @@ -8,6 +8,8 @@ npm unstar [\.\.\.] .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P "Unstarring" a package is the opposite of npm help \fBstar\fP, diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1 index 6ade4045c0ff90..3df11cb69d6efd 100644 --- a/deps/npm/man/man1/npm-whoami.1 +++ b/deps/npm/man/man1/npm-whoami.1 @@ -8,6 +8,8 @@ npm whoami [\-\-registry ] .fi .RE +.P +Note: This command is unaware of workspaces\. .SS Description .P Print the \fBusername\fP config to standard output\. diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index c85c4759dc9c82..9b3b58ce87676d 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -10,7 +10,7 @@ npm [args] .RE .SS Version .P -7\.6\.3 +7\.7\.0 .SS Description .P npm is the package manager for the Node JavaScript platform\. It puts diff --git a/deps/npm/man/man5/package-json.5 b/deps/npm/man/man5/package-json.5 index a244fa7e4dfb69..859c3de2d5197e 100644 --- a/deps/npm/man/man5/package-json.5 +++ b/deps/npm/man/man5/package-json.5 @@ -373,6 +373,8 @@ This should be a module relative to the root of your package folder\. .P For most modules, it makes the most sense to have a main script and often not much else\. +.P +If \fBmain\fP is not set it defaults to \fBindex\.js\fP in the packages root folder\. .SS browser .P If your module is meant to be used client\-side the browser field should be @@ -620,8 +622,7 @@ tarball or git URL\. \fBPlease do not put test harnesses or transpilers or other "development" time tools in your \fBdependencies\fP object\.\fR See \fBdevDependencies\fP, below\. .P -See semver \fI[/using\-npm/semver](https://github\.com/npm/node\-semver#versions)\fR -for more details about specifying version ranges\. +See npm help semver for more details about specifying version ranges\. .RS 0 .IP \(bu 2 \fBversion\fP Must match \fBversion\fP exactly diff --git a/deps/npm/man/man7/config.7 b/deps/npm/man/man7/config.7 index 6e826d0787ae17..a5f3095bcbd9e2 100644 --- a/deps/npm/man/man7/config.7 +++ b/deps/npm/man/man7/config.7 @@ -56,57 +56,89 @@ internal to npm, and are defaults if nothing else is specified\. .SS Shorthands and Other CLI Niceties .P The following shorthands are parsed on the command\-line: + + .RS 0 .IP \(bu 2 -\fB\-v\fP: \fB\-\-version\fP +\fB\-a\fP: \fB\-\-all\fP +.IP \(bu 2 +\fB\-\-enjoy\-by\fP: \fB\-\-before\fP .IP \(bu 2 -\fB\-h\fP, \fB\-?\fP, \fB\-\-help\fP, \fB\-H\fP: \fB\-\-usage\fP +\fB\-c\fP: \fB\-\-call\fP .IP \(bu 2 -\fB\-s\fP, \fB\-\-silent\fP: \fB\-\-loglevel silent\fP +\fB\-\-desc\fP: \fB\-\-description\fP +.IP \(bu 2 +\fB\-f\fP: \fB\-\-force\fP .IP \(bu 2 -\fB\-q\fP, \fB\-\-quiet\fP: \fB\-\-loglevel warn\fP +\fB\-g\fP: \fB\-\-global\fP .IP \(bu 2 \fB\-d\fP: \fB\-\-loglevel info\fP .IP \(bu 2 -\fB\-dd\fP, \fB\-\-verbose\fP: \fB\-\-loglevel verbose\fP +\fB\-s\fP: \fB\-\-loglevel silent\fP .IP \(bu 2 -\fB\-ddd\fP: \fB\-\-loglevel silly\fP +\fB\-\-silent\fP: \fB\-\-loglevel silent\fP .IP \(bu 2 -\fB\-g\fP: \fB\-\-global\fP +\fB\-\-ddd\fP: \fB\-\-loglevel silly\fP .IP \(bu 2 -\fB\-C\fP: \fB\-\-prefix\fP +\fB\-\-dd\fP: \fB\-\-loglevel verbose\fP +.IP \(bu 2 +\fB\-\-verbose\fP: \fB\-\-loglevel verbose\fP +.IP \(bu 2 +\fB\-q\fP: \fB\-\-loglevel warn\fP +.IP \(bu 2 +\fB\-\-quiet\fP: \fB\-\-loglevel warn\fP .IP \(bu 2 \fB\-l\fP: \fB\-\-long\fP .IP \(bu 2 \fB\-m\fP: \fB\-\-message\fP .IP \(bu 2 -\fB\-p\fP, \fB\-\-porcelain\fP: \fB\-\-parseable\fP +\fB\-\-local\fP: \fB\-\-no\-global\fP .IP \(bu 2 -\fB\-reg\fP: \fB\-\-registry\fP +\fB\-n\fP: \fB\-\-no\-yes\fP .IP \(bu 2 -\fB\-f\fP: \fB\-\-force\fP +\fB\-\-no\fP: \fB\-\-no\-yes\fP +.IP \(bu 2 +\fB\-p\fP: \fB\-\-parseable\fP +.IP \(bu 2 +\fB\-\-porcelain\fP: \fB\-\-parseable\fP +.IP \(bu 2 +\fB\-C\fP: \fB\-\-prefix\fP +.IP \(bu 2 +\fB\-\-readonly\fP: \fB\-\-read\-only\fP .IP \(bu 2 -\fB\-desc\fP: \fB\-\-description\fP +\fB\-\-reg\fP: \fB\-\-registry\fP .IP \(bu 2 \fB\-S\fP: \fB\-\-save\fP .IP \(bu 2 -\fB\-P\fP: \fB\-\-save\-prod\fP +\fB\-B\fP: \fB\-\-save\-bundle\fP .IP \(bu 2 \fB\-D\fP: \fB\-\-save\-dev\fP .IP \(bu 2 +\fB\-E\fP: \fB\-\-save\-exact\fP +.IP \(bu 2 \fB\-O\fP: \fB\-\-save\-optional\fP .IP \(bu 2 -\fB\-B\fP: \fB\-\-save\-bundle\fP +\fB\-P\fP: \fB\-\-save\-prod\fP .IP \(bu 2 -\fB\-E\fP: \fB\-\-save\-exact\fP +\fB\-?\fP: \fB\-\-usage\fP .IP \(bu 2 -\fB\-y\fP: \fB\-\-yes\fP +\fB\-h\fP: \fB\-\-usage\fP .IP \(bu 2 -\fB\-n\fP: \fB\-\-yes false\fP +\fB\-H\fP: \fB\-\-usage\fP .IP \(bu 2 -\fBll\fP and \fBla\fP commands: \fBls \-\-long\fP +\fB\-\-help\fP: \fB\-\-usage\fP +.IP \(bu 2 +\fB\-v\fP: \fB\-\-version\fP +.IP \(bu 2 +\fB\-w\fP: \fB\-\-workspace\fP +.IP \(bu 2 +\fB\-\-ws\fP: \fB\-\-workspaces\fP +.IP \(bu 2 +\fB\-y\fP: \fB\-\-yes\fP .RE + + .P If the specified configuration param resolves unambiguously to a known configuration parameter, then it is expanded to that configuration @@ -133,23 +165,39 @@ npm ls \-\-global \-\-parseable \-\-long \-\-loglevel info .fi .RE .SS Config Settings -.SS access + + +.SS \fB_auth\fP +.RS 0 +.IP \(bu 2 +Default: null +.IP \(bu 2 +Type: null or String + +.RE +.P +A basic\-auth string to use when authenticating against the npm registry\. +.P +Warning: This should generally not be set via a command\-line option\. It is +safer to use a registry\-provided authentication bearer token stored in the +~/\.npmrc file by running \fBnpm login\fP\|\. +.SS \fBaccess\fP .RS 0 .IP \(bu 2 -Default: \fBrestricted\fP +Default: 'restricted' for scoped packages, 'public' for unscoped packages .IP \(bu 2 -Type: Access +Type: null, "restricted", or "public" .RE .P -When publishing scoped packages, the access level defaults to \fBrestricted\fP\|\. If -you want your scoped package to be publicly viewable (and installable) set -\fB\-\-access=public\fP\|\. The only valid values for \fBaccess\fP are \fBpublic\fP and +When publishing scoped packages, the access level defaults to \fBrestricted\fP\|\. +If you want your scoped package to be publicly viewable (and installable) +set \fB\-\-access=public\fP\|\. The only valid values for \fBaccess\fP are \fBpublic\fP and \fBrestricted\fP\|\. Unscoped packages \fIalways\fR have an access level of \fBpublic\fP\|\. -.SS all +.SS \fBall\fP .RS 0 .IP \(bu 2 -Default: \fBfalse\fP +Default: false .IP \(bu 2 Type: Boolean @@ -158,7 +206,7 @@ Type: Boolean When running \fBnpm outdated\fP and \fBnpm ls\fP, setting \fB\-\-all\fP will show all outdated or installed packages, rather than only those directly depended upon by the current project\. -.SS allow\-same\-version +.SS \fBallow\-same\-version\fP .RS 0 .IP \(bu 2 Default: false @@ -169,7 +217,7 @@ Type: Boolean .P Prevents throwing an error when \fBnpm version\fP is used to set the new version to the same value as the current version\. -.SS always\-auth +.SS \fBalways\-auth\fP .RS 0 .IP \(bu 2 Default: false @@ -178,20 +226,9 @@ Type: Boolean .RE .P -Force npm to always require authentication when accessing the registry, -even for \fBGET\fP requests\. -.SS also -.RS 0 -.IP \(bu 2 -Default: null -.IP \(bu 2 -Type: String - -.RE -.P -When "dev" or "development" and running local \fBnpm shrinkwrap\fP, -\fBnpm outdated\fP, or \fBnpm update\fP, is an alias for \fB\-\-dev\fP\|\. -.SS audit +Force npm to always require authentication when accessing the registry, even +for \fBGET\fP requests\. +.SS \fBaudit\fP .RS 0 .IP \(bu 2 Default: true @@ -201,53 +238,41 @@ Type: Boolean .RE .P When "true" submit audit reports alongside \fBnpm install\fP runs to the default -registry and all registries configured for scopes\. See the documentation -for npm help \fBaudit\fP for details on what is submitted\. -.SS audit\-level +registry and all registries configured for scopes\. See the documentation for +npm help \fBaudit\fP for details on what is submitted\. +.SS \fBaudit\-level\fP .RS 0 .IP \(bu 2 -Default: \fB"low"\fP -.IP \(bu 2 -Type: \fB\|'low'\fP, \fB\|'moderate'\fP, \fB\|'high'\fP, \fB\|'critical'\fP - -.RE -.P -The minimum level of vulnerability for \fBnpm audit\fP to exit with -a non\-zero exit code\. -.SS auth\-type -.RS 0 -.IP \(bu 2 -Default: \fB\|'legacy'\fP +Default: null .IP \(bu 2 -Type: \fB\|'legacy'\fP, \fB\|'sso'\fP, \fB\|'saml'\fP, \fB\|'oauth'\fP +Type: "low", "moderate", "high", "critical", "none", or null .RE .P -What authentication strategy to use with \fBadduser\fP/\fBlogin\fP\|\. -.SS before +The minimum level of vulnerability for \fBnpm audit\fP to exit with a non\-zero +exit code\. +.SS \fBbefore\fP .RS 0 .IP \(bu 2 -Alias: enjoy\-by -.IP \(bu 2 Default: null .IP \(bu 2 -Type: Date +Type: null or Date .RE .P -If passed to \fBnpm install\fP, will rebuild the npm tree such that only versions -that were available \fBon or before\fR the \fB\-\-before\fP time get installed\. -If there's no versions available for the current set of direct dependencies, the -command will error\. +If passed to \fBnpm install\fP, will rebuild the npm tree such that only +versions that were available \fBon or before\fR the \fB\-\-before\fP time get +installed\. If there's no versions available for the current set of direct +dependencies, the command will error\. .P If the requested version is a \fBdist\-tag\fP and the given tag does not pass the -\fB\-\-before\fP filter, the most recent version less than or equal to that tag will -be used\. For example, \fBfoo@latest\fP might install \fBfoo@1\.2\fP even though \fBlatest\fP -is \fB2\.0\fP\|\. -.SS bin\-links +\fB\-\-before\fP filter, the most recent version less than or equal to that tag +will be used\. For example, \fBfoo@latest\fP might install \fBfoo@1\.2\fP even though +\fBlatest\fP is \fB2\.0\fP\|\. +.SS \fBbin\-links\fP .RS 0 .IP \(bu 2 -Default: \fBtrue\fP +Default: true .IP \(bu 2 Type: Boolean @@ -256,15 +281,15 @@ Type: Boolean Tells npm to create symlinks (or \fB\|\.cmd\fP shims on Windows) for package executables\. .P -Set to false to have it not do this\. This can be used to work around -the fact that some file systems don't support symlinks, even on -ostensibly Unix systems\. -.SS browser +Set to false to have it not do this\. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems\. +.SS \fBbrowser\fP .RS 0 .IP \(bu 2 Default: OS X: \fB"open"\fP, Windows: \fB"start"\fP, Others: \fB"xdg\-open"\fP .IP \(bu 2 -Type: String or Boolean +Type: null, Boolean, or String .RE .P @@ -274,18 +299,19 @@ Set to \fBfalse\fP to suppress browser behavior and instead print urls to terminal\. .P Set to \fBtrue\fP to use default system URL opener\. -.SS ca +.SS \fBca\fP .RS 0 .IP \(bu 2 -Default: The npm CA certificate +Default: null .IP \(bu 2 -Type: String, Array or null +Type: null or String (can be set multiple times) .RE .P The Certificate Authority signing certificate that is trusted for SSL -connections to the registry\. Values should be in PEM format (Windows calls it "Base\-64 encoded X\.509 (\.CER)") with newlines -replaced by the string "\\n"\. For example: +connections to the registry\. Values should be in PEM format (Windows calls +it "Base\-64 encoded X\.509 (\.CER)") with newlines replaced by the string +"\\n"\. For example: .P .RS 2 .nf @@ -293,8 +319,8 @@ ca="\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-\\nXXXX\\nXXXX\\n\-\-\-\-\-END CERTIFIC .fi .RE .P -Set to \fBnull\fP to only allow "known" registrars, or to a specific CA cert -to trust only that specific signing authority\. +Set to \fBnull\fP to only allow "known" registrars, or to a specific CA cert to +trust only that specific signing authority\. .P Multiple CAs can be trusted by specifying an array of certificates: .P @@ -306,175 +332,166 @@ ca[]="\.\.\." .RE .P See also the \fBstrict\-ssl\fP config\. -.SS cafile +.SS \fBcache\fP .RS 0 .IP \(bu 2 -Default: \fBnull\fP +Default: Windows: \fB%LocalAppData%\\npm\-cache\fP, Posix: \fB~/\.npm\fP .IP \(bu 2 -Type: path +Type: Path .RE .P -A path to a file containing one or multiple Certificate Authority signing -certificates\. Similar to the \fBca\fP setting, but allows for multiple CA's, as -well as for the CA information to be stored in a file on disk\. -.SS cache +The location of npm's cache directory\. See npm help \fBnpm +cache\fP +.SS \fBcafile\fP .RS 0 .IP \(bu 2 -Default: Windows: \fB%AppData%\\npm\-cache\fP, Posix: \fB~/\.npm\fP +Default: null .IP \(bu 2 -Type: path +Type: Path .RE .P -The location of npm's cache directory\. See npm help \fBcache\fP -.SS cache\-lock\-stale +A path to a file containing one or multiple Certificate Authority signing +certificates\. Similar to the \fBca\fP setting, but allows for multiple CA's, as +well as for the CA information to be stored in a file on disk\. +.SS \fBcall\fP .RS 0 .IP \(bu 2 -Default: 60000 (1 minute) +Default: "" .IP \(bu 2 -Type: Number +Type: String .RE .P -The number of ms before cache folder lockfiles are considered stale\. -.SS cache\-lock\-retries +Optional companion option for \fBnpm exec\fP, \fBnpx\fP that allows for specifying a +custom command to be run along with the installed packages\. +.P +.RS 2 +.nf +npm exec \-\-package yo \-\-package generator\-node \-\-call "yo node" +.fi +.RE +.SS \fBcert\fP .RS 0 .IP \(bu 2 -Default: 10 +Default: null .IP \(bu 2 -Type: Number +Type: null or String .RE .P -Number of times to retry to acquire a lock on cache folder lockfiles\. -.SS cache\-lock\-wait -.RS 0 -.IP \(bu 2 -Default: 10000 (10 seconds) -.IP \(bu 2 -Type: Number - +A client certificate to pass when accessing the registry\. Values should be +in PEM format (Windows calls it "Base\-64 encoded X\.509 (\.CER)") with +newlines replaced by the string "\\n"\. For example: +.P +.RS 2 +.nf +cert="\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-\\nXXXX\\nXXXX\\n\-\-\-\-\-END CERTIFICATE\-\-\-\-\-" +.fi .RE .P -Number of ms to wait for cache lock files to expire\. -.SS cache\-max +It is \fInot\fR the path to a certificate file (and there is no "certfile" +option)\. +.SS \fBci\-name\fP .RS 0 .IP \(bu 2 -Default: Infinity +Default: The name of the current CI system, or \fBnull\fP when not on a known CI +platform\. .IP \(bu 2 -Type: Number +Type: null or String .RE .P -\fBDEPRECATED\fR: This option has been deprecated in favor of \fB\-\-prefer\-online\fP\|\. -.P -\fB\-\-cache\-max=0\fP is an alias for \fB\-\-prefer\-online\fP\|\. -.SS cache\-min +The name of a continuous integration system\. If not set explicitly, npm will +detect the current CI environment using the +\fB@npmcli/ci\-detect\fP \fIhttp://npm\.im/@npmcli/ci\-detect\fR module\. +.SS \fBcidr\fP .RS 0 .IP \(bu 2 -Default: 10 +Default: null .IP \(bu 2 -Type: Number +Type: null or String (can be set multiple times) .RE .P -\fBDEPRECATED\fR: This option has been deprecated in favor of \fB\-\-prefer\-offline\fP\|\. -.P -\fB\-\-cache\-min=9999 (or bigger)\fP is an alias for \fB\-\-prefer\-offline\fP\|\. -.SS call +This is a list of CIDR address to be used when configuring limited access +tokens with the \fBnpm token create\fP command\. +.SS \fBcolor\fP .RS 0 .IP \(bu 2 -Default: "" +Default: true unless the NO_COLOR environ is set to something other than '0' .IP \(bu 2 -Type: String +Type: "always" or Boolean .RE .P -Optional companion option for \fBnpm exec\fP, \fBnpx\fP that allows for specifying a -custom command to be run along with the installed packages\. -.P -.RS 2 -.nf -npm exec \-\-package yo \-\-package generator\-node \-\-call "yo node" -.fi -.RE -.SS cert +If false, never shows colors\. If \fB"always"\fP then always shows colors\. If +true, then only prints color codes for tty file descriptors\. +.SS \fBcommit\-hooks\fP .RS 0 .IP \(bu 2 -Default: \fBnull\fP +Default: true .IP \(bu 2 -Type: String +Type: Boolean .RE .P -A client certificate to pass when accessing the registry\. Values should be in -PEM format (Windows calls it "Base\-64 encoded X\.509 (\.CER)") with newlines replaced by the string "\\n"\. For example: -.P -.RS 2 -.nf -cert="\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-\\nXXXX\\nXXXX\\n\-\-\-\-\-END CERTIFICATE\-\-\-\-\-" -.fi -.RE -.P -It is \fInot\fR the path to a certificate file (and there is no "certfile" option)\. -.SS cidr +Run git commit hooks when using the \fBnpm version\fP command\. +.SS \fBdepth\fP .RS 0 .IP \(bu 2 -Default: \fBnull\fP +Default: \fBInfinity\fP if \fB\-\-all\fP is set, otherwise \fB1\fP .IP \(bu 2 -Type: String, Array, null +Type: null or Number .RE .P -This is a list of CIDR address to be used when configuring limited access tokens with the \fBnpm token create\fP command\. -.SS commit\-hooks +The depth to go when recursing packages for \fBnpm ls\fP\|\. +.P +If not set, \fBnpm ls\fP will show only the immediate dependencies of the root +project\. If \fB\-\-all\fP is set, then npm will show all dependencies by default\. +.SS \fBdescription\fP .RS 0 .IP \(bu 2 -Default: \fBtrue\fP +Default: true .IP \(bu 2 Type: Boolean .RE .P -Run git commit hooks when using the \fBnpm version\fP command\. -.SS color +Show the description in \fBnpm search\fP +.SS \fBdiff\fP .RS 0 .IP \(bu 2 -Default: true +Default: .IP \(bu 2 -Type: Boolean or \fB"always"\fP +Type: String (can be set multiple times) .RE .P -If false, never shows colors\. If \fB"always"\fP then always shows colors\. -If true, then only prints color codes for tty file descriptors\. -.P -This option can also be changed using the environment: colors are -disabled when the environment variable \fBNO_COLOR\fP is set to any value\. -.SS depth +Define arguments to compare in \fBnpm diff\fP\|\. +.SS \fBdiff\-dst\-prefix\fP .RS 0 .IP \(bu 2 -Default: null +Default: "b/" .IP \(bu 2 -Type: null or Number +Type: String .RE .P -The depth to go when recursing packages for \fBnpm ls\fP\|\. -.P -To make this default to \fBInfinity\fP instead of \fBnull\fP, set \fB\-\-all\fP\|\. -.SS description +Destination prefix to be used in \fBnpm diff\fP output\. +.SS \fBdiff\-ignore\-all\-space\fP .RS 0 .IP \(bu 2 -Default: true +Default: false .IP \(bu 2 Type: Boolean .RE .P -Show the description in \fBnpm search\fP -.SS dev +Ignore whitespace when comparing lines in \fBnpm diff\fP\|\. +.SS \fBdiff\-name\-only\fP .RS 0 .IP \(bu 2 Default: false @@ -483,8 +500,8 @@ Type: Boolean .RE .P -[Deprecated] Install \fBdev\-dependencies\fP along with packages\. -.SS dry\-run +Prints only filenames when using \fBnpm diff\fP\|\. +.SS \fBdiff\-no\-prefix\fP .RS 0 .IP \(bu 2 Default: false @@ -493,22 +510,21 @@ Type: Boolean .RE .P -Indicates that you don't want npm to make any changes and that it should -only report what it would have done\. This can be passed into any of the -commands that modify your local installation, eg, \fBinstall\fP, \fBupdate\fP, -\fBdedupe\fP, \fBuninstall\fP\|\. This is NOT currently honored by some network related -commands, eg \fBdist\-tags\fP, \fBowner\fP, etc\. -.SS diff +Do not show any source or destination prefix in \fBnpm diff\fP output\. +.P +Note: this causes \fBnpm diff\fP to ignore the \fB\-\-diff\-src\-prefix\fP and +\fB\-\-diff\-dst\-prefix\fP configs\. +.SS \fBdiff\-src\-prefix\fP .RS 0 .IP \(bu 2 -Default: null +Default: "a/" .IP \(bu 2 -Type: String, Array, null +Type: String .RE .P -Define arguments to compare in \fBnpm diff\fP\|\. -.SS diff\-name\-only +Source prefix to be used in \fBnpm diff\fP output\. +.SS \fBdiff\-text\fP .RS 0 .IP \(bu 2 Default: false @@ -517,93 +533,115 @@ Type: Boolean .RE .P -Prints only filenames when using \fBnpm diff\fP\|\. -.SS diff\-unified +Treat all files as text in \fBnpm diff\fP\|\. +.SS \fBdiff\-unified\fP .RS 0 .IP \(bu 2 -Type: number +Default: 3 .IP \(bu 2 -Default: \fB3\fP +Type: Number .RE .P The number of lines of context to print in \fBnpm diff\fP\|\. -.SS diff\-ignore\-all\-space +.SS \fBdry\-run\fP .RS 0 .IP \(bu 2 -Type: Boolean -.IP \(bu 2 Default: false +.IP \(bu 2 +Type: Boolean .RE .P -Ignore whitespace when comparing lines in `npm diff\. -.SS diff\-no\-prefix +Indicates that you don't want npm to make any changes and that it should +only report what it would have done\. This can be passed into any of the +commands that modify your local installation, eg, \fBinstall\fP, \fBupdate\fP, +\fBdedupe\fP, \fBuninstall\fP, as well as \fBpack\fP and \fBpublish\fP\|\. +.P +Note: This is NOT honored by other network related commands, eg \fBdist\-tags\fP, +\fBowner\fP, etc\. +.SS \fBeditor\fP .RS 0 .IP \(bu 2 -Type: Boolean +Default: The EDITOR or VISUAL environment variables, or 'notepad\.exe' on +Windows, or 'vim' on Unix systems .IP \(bu 2 -Default: false +Type: String .RE .P -Do not show any source or destination prefix in \fBnpm diff\fP output\. -.SS diff\-src\-prefix +The command to run for \fBnpm edit\fP and \fBnpm config edit\fP\|\. +.SS \fBengine\-strict\fP .RS 0 .IP \(bu 2 -Type: String +Default: false .IP \(bu 2 -Default: \fB"a/"\fP +Type: Boolean .RE .P -Source prefix to be used in \fBnpm diff\fP output\. -.SS diff\-dst\-prefix +If set to true, then npm will stubbornly refuse to install (or even consider +installing) any package that claims to not be compatible with the current +Node\.js version\. +.P +This can be overridden by setting the \fB\-\-force\fP flag\. +.SS \fBfetch\-retries\fP .RS 0 .IP \(bu 2 -Type: String +Default: 2 .IP \(bu 2 -Default: \fB"b/"\fP +Type: Number .RE .P -Destination prefix to be used in \fBnpm diff\fP output\. -.SS diff\-text +The "retries" config for the \fBretry\fP module to use when fetching packages +from the registry\. +.P +npm will retry idempotent read requests to the registry in the case of +network failures or 5xx HTTP errors\. +.SS \fBfetch\-retry\-factor\fP .RS 0 .IP \(bu 2 -Alias: \fB\-a\fP +Default: 10 .IP \(bu 2 -Type: Boolean +Type: Number + +.RE +.P +The "factor" config for the \fBretry\fP module to use when fetching packages\. +.SS \fBfetch\-retry\-maxtimeout\fP +.RS 0 .IP \(bu 2 -Default: false +Default: 60000 (1 minute) +.IP \(bu 2 +Type: Number .RE .P -Treat all files as text in \fBnpm diff\fP\|\. -.SS editor +The "maxTimeout" config for the \fBretry\fP module to use when fetching +packages\. +.SS \fBfetch\-retry\-mintimeout\fP .RS 0 .IP \(bu 2 -Default: \fBEDITOR\fP environment variable if set, or \fB"vi"\fP on Posix, -or \fB"notepad"\fP on Windows\. +Default: 10000 (10 seconds) .IP \(bu 2 -Type: path +Type: Number .RE .P -The command to run for \fBnpm edit\fP or \fBnpm config edit\fP\|\. -.SS engine\-strict +The "minTimeout" config for the \fBretry\fP module to use when fetching +packages\. +.SS \fBfetch\-timeout\fP .RS 0 .IP \(bu 2 -Default: false +Default: 300000 (5 minutes) .IP \(bu 2 -Type: Boolean +Type: Number .RE .P -If set to true, then npm will stubbornly refuse to install (or even -consider installing) any package that claims to not be compatible with -the current Node\.js version\. -.SS force +The maximum amount of time to wait for HTTP requests to complete\. +.SS \fBforce\fP .RS 0 .IP \(bu 2 Default: false @@ -626,13 +664,11 @@ Allow installing packages that have an \fBengines\fP declaration requiring a different version of npm\. .IP \(bu 2 Allow installing packages that have an \fBengines\fP declaration requiring a -different version of \fBnode\fP, even if \fB\-\-engines\-strict\fP is enabled\. +different version of \fBnode\fP, even if \fB\-\-engine\-strict\fP is enabled\. .IP \(bu 2 Allow \fBnpm audit fix\fP to install modules outside your stated dependency range (including SemVer\-major changes)\. .IP \(bu 2 -Allow a module to be installed as a direct dependency of itself\. -.IP \(bu 2 Allow unpublishing all versions of a published package\. .IP \(bu 2 Allow conflicting peerDependencies to be installed in the root project\. @@ -641,7 +677,7 @@ Allow conflicting peerDependencies to be installed in the root project\. .P If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! -.SS foreground\-scripts +.SS \fBforeground\-scripts\fP .RS 0 .IP \(bu 2 Default: false @@ -654,9 +690,9 @@ Run all build scripts (ie, \fBpreinstall\fP, \fBinstall\fP, and \fBpostinstall\f scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process\. .P -Note that this will generally make installs run slower, and be much -noisier, but can be useful for debugging\. -.SS format\-package\-lock +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging\. +.SS \fBformat\-package\-lock\fP .RS 0 .IP \(bu 2 Default: true @@ -665,8 +701,9 @@ Type: Boolean .RE .P -Format \fBpackage\-lock\.json\fP or \fBnpm\-shrinkwrap\.json\fP as a human readable file\. -.SS fund +Format \fBpackage\-lock\.json\fP or \fBnpm\-shrinkwrap\.json\fP as a human readable +file\. +.SS \fBfund\fP .RS 0 .IP \(bu 2 Default: true @@ -676,85 +713,30 @@ Type: Boolean .RE .P When "true" displays the message at the end of each \fBnpm install\fP -acknowledging the number of dependencies looking for funding\. -See npm help \fBfund\fP for details\. -.SS fetch\-retries -.RS 0 -.IP \(bu 2 -Default: 2 -.IP \(bu 2 -Type: Number - -.RE -.P -The "retries" config for the \fBretry\fP module to use when fetching -packages from the registry\. -.SS fetch\-retry\-factor -.RS 0 -.IP \(bu 2 -Default: 10 -.IP \(bu 2 -Type: Number - -.RE -.P -The "factor" config for the \fBretry\fP module to use when fetching -packages\. -.SS fetch\-retry\-mintimeout -.RS 0 -.IP \(bu 2 -Default: 10000 (10 seconds) -.IP \(bu 2 -Type: Number - -.RE -.P -The "minTimeout" config for the \fBretry\fP module to use when fetching -packages\. -.SS fetch\-retry\-maxtimeout -.RS 0 -.IP \(bu 2 -Default: 60000 (1 minute) -.IP \(bu 2 -Type: Number - -.RE -.P -The "maxTimeout" config for the \fBretry\fP module to use when fetching -packages\. -.SS fetch\-timeout -.RS 0 -.IP \(bu 2 -Default: 300000 (5 minutes) -.IP \(bu 2 -Type: Number - -.RE -.P -The maximum amount of time to wait for HTTP requests to complete\. -.SS git +acknowledging the number of dependencies looking for funding\. See npm help \fBnpm +fund\fP for details\. +.SS \fBgit\fP .RS 0 .IP \(bu 2 -Default: \fB"git"\fP +Default: "git" .IP \(bu 2 Type: String .RE .P -The command to use for git commands\. If git is installed on the -computer, but is not in the \fBPATH\fP, then set this to the full path to -the git binary\. -.SS git\-tag\-version +The command to use for git commands\. If git is installed on the computer, +but is not in the \fBPATH\fP, then set this to the full path to the git binary\. +.SS \fBgit\-tag\-version\fP .RS 0 .IP \(bu 2 -Default: \fBtrue\fP +Default: true .IP \(bu 2 Type: Boolean .RE .P Tag the commit when using the \fBnpm version\fP command\. -.SS global +.SS \fBglobal\fP .RS 0 .IP \(bu 2 Default: false @@ -763,67 +745,69 @@ Type: Boolean .RE .P -Operates in "global" mode, so that packages are installed into the -\fBprefix\fP folder instead of the current working directory\. See +Operates in "global" mode, so that packages are installed into the \fBprefix\fP +folder instead of the current working directory\. See npm help folders for more on the differences in behavior\. .RS 0 .IP \(bu 2 -packages are installed into the \fB{prefix}/lib/node_modules\fP folder, instead of the -current working directory\. +packages are installed into the \fB{prefix}/lib/node_modules\fP folder, instead +of the current working directory\. .IP \(bu 2 bin files are linked to \fB{prefix}/bin\fP .IP \(bu 2 man pages are linked to \fB{prefix}/share/man\fP .RE -.SS globalconfig +.SS \fBglobal\-style\fP .RS 0 .IP \(bu 2 -Default: {prefix}/etc/npmrc +Default: false .IP \(bu 2 -Type: path +Type: Boolean .RE .P -The config file to read for global config options\. -.SS global\-style +Causes npm to install the package into your local \fBnode_modules\fP folder with +the same layout it uses with the global \fBnode_modules\fP folder\. Only your +direct dependencies will show in \fBnode_modules\fP and everything they depend +on will be flattened in their \fBnode_modules\fP folders\. This obviously will +eliminate some deduping\. If used with \fBlegacy\-bundling\fP, \fBlegacy\-bundling\fP +will be preferred\. +.SS \fBglobalconfig\fP .RS 0 .IP \(bu 2 -Default: false +Default: The global \-\-prefix setting plus 'etc/npmrc'\. For example, +\|'/usr/local/etc/npmrc' .IP \(bu 2 -Type: Boolean +Type: Path .RE .P -Causes npm to install the package into your local \fBnode_modules\fP folder with -the same layout it uses with the global \fBnode_modules\fP folder\. Only your -direct dependencies will show in \fBnode_modules\fP and everything they depend -on will be flattened in their \fBnode_modules\fP folders\. This obviously will -eliminate some deduping\. If used with \fBlegacy\-bundling\fP, \fBlegacy\-bundling\fP will be -preferred\. -.SS heading +The config file to read for global config options\. +.SS \fBheading\fP .RS 0 .IP \(bu 2 -Default: \fB"npm"\fP +Default: "npm" .IP \(bu 2 Type: String .RE .P The string that starts all the debugging log output\. -.SS https\-proxy +.SS \fBhttps\-proxy\fP .RS 0 .IP \(bu 2 Default: null .IP \(bu 2 -Type: url +Type: null or URL .RE .P A proxy to use for outgoing https requests\. If the \fBHTTPS_PROXY\fP or \fBhttps_proxy\fP or \fBHTTP_PROXY\fP or \fBhttp_proxy\fP environment variables are set, -proxy settings will be honored by the underlying \fBrequest\fP library\. -.SS if\-present +proxy settings will be honored by the underlying \fBmake\-fetch\-happen\fP +library\. +.SS \fBif\-present\fP .RS 0 .IP \(bu 2 Default: false @@ -832,12 +816,13 @@ Type: Boolean .RE .P -If true, npm will not exit with an error code when \fBrun\-script\fP is invoked for -a script that isn't defined in the \fBscripts\fP section of \fBpackage\.json\fP\|\. This -option can be used when it's desirable to optionally run a script when it's -present and fail if the script fails\. This is useful, for example, when running -scripts that may only apply for some builds in an otherwise generic CI setup\. -.SS ignore\-prepublish +If true, npm will not exit with an error code when \fBrun\-script\fP is invoked +for a script that isn't defined in the \fBscripts\fP section of \fBpackage\.json\fP\|\. +This option can be used when it's desirable to optionally run a script when +it's present and fail if the script fails\. This is useful, for example, when +running scripts that may only apply for some builds in an otherwise generic +CI setup\. +.SS \fBignore\-scripts\fP .RS 0 .IP \(bu 2 Default: false @@ -846,47 +831,48 @@ Type: Boolean .RE .P -If true, npm will not run \fBprepublish\fP scripts\. -.SS ignore\-scripts +If true, npm does not run scripts specified in package\.json files\. +.SS \fBinclude\fP .RS 0 .IP \(bu 2 -Default: false +Default: .IP \(bu 2 -Type: Boolean +Type: "prod", "dev", "optional", or "peer" (can be set multiple times) .RE .P -If true, npm does not run scripts specified in package\.json files\. -.SS include +Option that allows for defining which types of dependencies to install\. +.P +This is the inverse of \fB\-\-omit=\fP\|\. +.P +Dependency types specified in \fB\-\-include\fP will not be omitted, regardless of +the order in which omit/include are specified on the command\-line\. +.SS \fBinclude\-staged\fP .RS 0 .IP \(bu 2 -Default: \fB[prod|dev|optional|peer]\fP +Default: false .IP \(bu 2 -Type: Array +Type: Boolean .RE .P -Option that allows for defining which types of dependencies to install\. -.SS init\-module +Allow installing "staged" published packages, as defined by npm RFC PR +#92 \fIhttps://github\.com/npm/rfcs/pull/92\fR\|\. +.P +This is experimental, and not implemented by the npm public registry\. +.SS \fBinit\-author\-email\fP .RS 0 .IP \(bu 2 -Alias: \fBinit\.module\fP -.IP \(bu 2 -Default: ~/\.npm\-init\.js +Default: "" .IP \(bu 2 -Type: path +Type: String .RE .P -A module that will be loaded by the \fBnpm init\fP command\. See the -documentation for the -init\-package\-json \fIhttps://github\.com/npm/init\-package\-json\fR module -for more information, or npm help init\. -.SS init\-author\-name +The value \fBnpm init\fP should use by default for the package author's email\. +.SS \fBinit\-author\-name\fP .RS 0 .IP \(bu 2 -Alias: \fBinit\.author\.name\fP -.IP \(bu 2 Default: "" .IP \(bu 2 Type: String @@ -894,56 +880,52 @@ Type: String .RE .P The value \fBnpm init\fP should use by default for the package author's name\. -.SS init\-author\-email +.SS \fBinit\-author\-url\fP .RS 0 .IP \(bu 2 -Alias: \fBinit\.author\.email\fP -.IP \(bu 2 Default: "" .IP \(bu 2 -Type: String +Type: "" or URL .RE .P -The value \fBnpm init\fP should use by default for the package author's email\. -.SS init\-author\-url +The value \fBnpm init\fP should use by default for the package author's +homepage\. +.SS \fBinit\-license\fP .RS 0 .IP \(bu 2 -Alias: \fBinit\.author\.url\fP -.IP \(bu 2 -Default: "" +Default: "ISC" .IP \(bu 2 Type: String .RE .P -The value \fBnpm init\fP should use by default for the package author's homepage\. -.SS init\-license +The value \fBnpm init\fP should use by default for the package license\. +.SS \fBinit\-module\fP .RS 0 .IP \(bu 2 -Alias: \fBinit\.license\fP -.IP \(bu 2 -Default: "ISC" +Default: "~/\.npm\-init\.js" .IP \(bu 2 -Type: String +Type: Path .RE .P -The value \fBnpm init\fP should use by default for the package license\. -.SS init\-version +A module that will be loaded by the \fBnpm init\fP command\. See the +documentation for the +init\-package\-json \fIhttps://github\.com/npm/init\-package\-json\fR module for +more information, or npm help init\. +.SS \fBinit\-version\fP .RS 0 .IP \(bu 2 -Alias: \fBinit\.version\fP -.IP \(bu 2 Default: "1\.0\.0" .IP \(bu 2 -Type: semver +Type: SemVer string .RE .P -The value that \fBnpm init\fP should use by default for the package -version number, if not already set in package\.json\. -.SS json +The value that \fBnpm init\fP should use by default for the package version +number, if not already set in package\.json\. +.SS \fBjson\fP .RS 0 .IP \(bu 2 Default: false @@ -954,19 +936,20 @@ Type: Boolean .P Whether or not to output JSON data, rather than the normal output\. .P -This feature is currently experimental, and the output data structures for many -commands is either not implemented in JSON yet, or subject to change\. Only the -output from \fBnpm ls \-\-json\fP and \fBnpm search \-\-json\fP are currently valid\. -.SS key +This feature is currently experimental, and the output data structures for +many commands is either not implemented in JSON yet, or subject to change\. +Only the output from \fBnpm ls \-\-json\fP and \fBnpm search \-\-json\fP are currently +valid\. +.SS \fBkey\fP .RS 0 .IP \(bu 2 -Default: \fBnull\fP +Default: null .IP \(bu 2 -Type: String +Type: null or String .RE .P -A client key to pass when accessing the registry\. Values should be in PEM +A client key to pass when accessing the registry\. Values should be in PEM format with newlines replaced by the string "\\n"\. For example: .P .RS 2 @@ -976,7 +959,7 @@ key="\-\-\-\-\-BEGIN PRIVATE KEY\-\-\-\-\-\\nXXXX\\nXXXX\\n\-\-\-\-\-END PRIVATE .RE .P It is \fInot\fR the path to a key file (and there is no "keyfile" option)\. -.SS legacy\-bundling +.SS \fBlegacy\-bundling\fP .RS 0 .IP \(bu 2 Default: false @@ -986,10 +969,10 @@ Type: Boolean .RE .P 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 +such as the one included with node 0\.8, can install the package\. This eliminates all automatic deduping\. If used with \fBglobal\-style\fP this option will be preferred\. -.SS legacy\-peer\-deps +.SS \fBlegacy\-peer\-deps\fP .RS 0 .IP \(bu 2 Default: false @@ -1001,9 +984,8 @@ Type: Boolean Causes npm to completely ignore \fBpeerDependencies\fP when building a package tree, as in npm versions 3 through 6\. .P -If a package cannot be installed because of overly strict -\fBpeerDependencies\fP that collide, it provides a way to move forward -resolving the situation\. +If a package cannot be installed because of overly strict \fBpeerDependencies\fP +that collide, it provides a way to move forward resolving the situation\. .P This differs from \fB\-\-omit=peer\fP, in that \fB\-\-omit=peer\fP will avoid unpacking \fBpeerDependencies\fP on disk, but will still design a tree such that @@ -1011,7 +993,7 @@ This differs from \fB\-\-omit=peer\fP, in that \fB\-\-omit=peer\fP will avoid un .P Use of \fBlegacy\-peer\-deps\fP is not recommended, as it will not enforce the \fBpeerDependencies\fP contract that meta\-dependencies may rely on\. -.SS link +.SS \fBlink\fP .RS 0 .IP \(bu 2 Default: false @@ -1023,45 +1005,44 @@ Type: Boolean If true, then local installs will link if there is a suitable globally installed package\. .P -Note that this means that local installs can cause things to be -installed into the global space at the same time\. The link is only done -if one of the two conditions are met: +Note that this means that local installs can cause things to be installed +into the global space at the same time\. The link is only done if one of the +two conditions are met: .RS 0 .IP \(bu 2 The package is not already installed globally, or .IP \(bu 2 -the globally installed version is identical to the version that is -being installed locally\. +the globally installed version is identical to the version that is being +installed locally\. .RE -.SS local\-address +.SS \fBlocal\-address\fP .RS 0 .IP \(bu 2 -Default: undefined +Default: null .IP \(bu 2 Type: IP Address .RE .P -The IP address of the local interface to use when making connections -to the npm registry\. Must be IPv4 in versions of Node prior to 0\.12\. -.SS loglevel +The IP address of the local interface to use when making connections to the +npm registry\. Must be IPv4 in versions of Node prior to 0\.12\. +.SS \fBloglevel\fP .RS 0 .IP \(bu 2 Default: "notice" .IP \(bu 2 -Type: String -.IP \(bu 2 -Values: "silent", "error", "warn", "notice", "http", "timing", "info", -"verbose", "silly" +Type: "silent", "error", "warn", "notice", "http", "timing", "info", +"verbose", or "silly" .RE .P -What level of logs to report\. On failure, \fIall\fR logs are written to +What level of logs to report\. On failure, \fIall\fR logs are written to \fBnpm\-debug\.log\fP in the current working directory\. .P -Any logs of a higher level than the setting are shown\. The default is "notice"\. -.SS logs\-max +Any logs of a higher level than the setting are shown\. The default is +"notice"\. +.SS \fBlogs\-max\fP .RS 0 .IP \(bu 2 Default: 10 @@ -1071,7 +1052,7 @@ Type: Number .RE .P The maximum number of log files to store\. -.SS long +.SS \fBlong\fP .RS 0 .IP \(bu 2 Default: false @@ -1081,18 +1062,18 @@ Type: Boolean .RE .P Show extended information in \fBnpm ls\fP and \fBnpm search\fP\|\. -.SS maxsockets +.SS \fBmaxsockets\fP .RS 0 .IP \(bu 2 -Default: 50 +Default: Infinity .IP \(bu 2 Type: Number .RE .P The maximum number of connections to use per origin (protocol/host/port -combination)\. Passed to the \fBhttp\fP \fBAgent\fP used to make the request\. -.SS message +combination)\. +.SS \fBmessage\fP .RS 0 .IP \(bu 2 Default: "%s" @@ -1104,39 +1085,51 @@ Type: String Commit message which is used by \fBnpm version\fP when creating version commit\. .P Any "%s" in the message will be replaced with the version number\. -.SS node\-options +.SS \fBnode\-options\fP .RS 0 .IP \(bu 2 Default: null .IP \(bu 2 -Type: String +Type: null or String .RE .P Options to pass through to Node\.js via the \fBNODE_OPTIONS\fP environment -variable\. This does not impact how npm itself is executed but it does -impact how lifecycle scripts are called\. -.SS node\-version +variable\. This does not impact how npm itself is executed but it does impact +how lifecycle scripts are called\. +.SS \fBnode\-version\fP .RS 0 .IP \(bu 2 -Default: process\.version +Default: Node\.js \fBprocess\.version\fP value .IP \(bu 2 -Type: semver or false +Type: SemVer string .RE .P -The node version to use when checking a package's \fBengines\fP map\. -.SS noproxy +The node version to use when checking a package's \fBengines\fP setting\. +.SS \fBnoproxy\fP .RS 0 .IP \(bu 2 -Default: null +Default: The value of the NO_PROXY environment variable +.IP \(bu 2 +Type: String (can be set multiple times) + +.RE +.P +Domain extensions that should bypass any proxies\. +.P +Also accepts a comma\-delimited string\. +.SS \fBnpm\-version\fP +.RS 0 +.IP \(bu 2 +Default: Output of \fBnpm \-\-version\fP .IP \(bu 2 -Type: String or Array +Type: SemVer string .RE .P -A comma\-separated string or an array of domain extensions that a proxy should not be used for\. -.SS offline +The npm version to use when checking a package's \fBengines\fP setting\. +.SS \fBoffline\fP .RS 0 .IP \(bu 2 Default: false @@ -1145,53 +1138,54 @@ Type: Boolean .RE .P -Force offline mode: no network requests will be done during install\. To allow -the CLI to fill in missing cache data, see \fB\-\-prefer\-offline\fP\|\. -.SS only +Force offline mode: no network requests will be done during install\. To +allow the CLI to fill in missing cache data, see \fB\-\-prefer\-offline\fP\|\. +.SS \fBomit\fP .RS 0 .IP \(bu 2 -Default: null +Default: 'dev' if the NODE_ENV environment variable is set to 'production', +otherwise empty\. .IP \(bu 2 -Type: String +Type: "dev", "optional", or "peer" (can be set multiple times) .RE .P -When "dev" or "development" and running local \fBnpm install\fP without any -arguments, only devDependencies (and their dependencies) are installed\. +Dependency types to omit from the installation tree on disk\. .P -When "dev" or "development" and running local \fBnpm ls\fP, \fBnpm outdated\fP, or -\fBnpm update\fP, is an alias for \fB\-\-dev\fP\|\. +Note that these dependencies \fIare\fR still resolved and added to the +\fBpackage\-lock\.json\fP or \fBnpm\-shrinkwrap\.json\fP file\. They are just not +physically installed on disk\. .P -When "prod" or "production" and running local \fBnpm install\fP without any -arguments, only non\-devDependencies (and their dependencies) are -installed\. +If a package type appears in both the \fB\-\-include\fP and \fB\-\-omit\fP lists, then +it will be included\. .P -When "prod" or "production" and running local \fBnpm ls\fP, \fBnpm outdated\fP, or -\fBnpm update\fP, is an alias for \fB\-\-production\fP\|\. -.SS optional +If the resulting omit list includes \fB\|'dev'\fP, then the \fBNODE_ENV\fP environment +variable will be set to \fB\|'production'\fP for all lifecycle scripts\. +.SS \fBotp\fP .RS 0 .IP \(bu 2 -Default: true +Default: null .IP \(bu 2 -Type: Boolean +Type: null or String .RE .P -Attempt to install packages in the \fBoptionalDependencies\fP object\. Note -that if these packages fail to install, the overall installation -process is not aborted\. -.SS otp +This is a one\-time password from a two\-factor authenticator\. It's needed +when publishing or changing package permissions with \fBnpm access\fP\|\. +.P +If not set, and a registry response fails with a challenge for a one\-time +password, npm will prompt on the command line for one\. +.SS \fBpackage\fP .RS 0 .IP \(bu 2 -Default: null +Default: .IP \(bu 2 -Type: Number +Type: String (can be set multiple times) .RE .P -This is a one\-time password from a two\-factor authenticator\. It's needed -when publishing or changing package permissions with \fBnpm access\fP\|\. -.SS package\-lock +The package to install for npm help \fBexec\fP +.SS \fBpackage\-lock\fP .RS 0 .IP \(bu 2 Default: true @@ -1204,11 +1198,9 @@ If set to false, then ignore \fBpackage\-lock\.json\fP files when installing\. T will also prevent \fIwriting\fR \fBpackage\-lock\.json\fP if \fBsave\fP is true\. .P When package package\-locks are disabled, automatic pruning of extraneous -modules will also be disabled\. To remove extraneous modules with +modules will also be disabled\. To remove extraneous modules with package\-locks disabled use \fBnpm prune\fP\|\. -.P -This option is an alias for \fB\-\-shrinkwrap\fP\|\. -.SS package\-lock\-only +.SS \fBpackage\-lock\-only\fP .RS 0 .IP \(bu 2 Default: false @@ -1217,9 +1209,9 @@ Type: Boolean .RE .P -If set to true, it will update only the \fBpackage\-lock\.json\fP, -instead of checking \fBnode_modules\fP and downloading dependencies\. -.SS parseable +If set to true, it will update only the \fBpackage\-lock\.json\fP, instead of +checking \fBnode_modules\fP and downloading dependencies\. +.SS \fBparseable\fP .RS 0 .IP \(bu 2 Default: false @@ -1228,9 +1220,9 @@ Type: Boolean .RE .P -Output parseable results from commands that write to -standard output\. For \fBnpm search\fP, this will be tab\-separated table format\. -.SS prefer\-offline +Output parseable results from commands that write to standard output\. For +\fBnpm search\fP, this will be tab\-separated table format\. +.SS \fBprefer\-offline\fP .RS 0 .IP \(bu 2 Default: false @@ -1240,10 +1232,9 @@ Type: Boolean .RE .P If true, staleness checks for cached data will be bypassed, but missing data -will be requested from the server\. To force full offline mode, use \fB\-\-offline\fP\|\. -.P -This option is effectively equivalent to \fB\-\-cache\-min=9999999\fP\|\. -.SS prefer\-online +will be requested from the server\. To force full offline mode, use +\fB\-\-offline\fP\|\. +.SS \fBprefer\-online\fP .RS 0 .IP \(bu 2 Default: false @@ -1252,20 +1243,22 @@ Type: Boolean .RE .P -If true, staleness checks for cached data will be forced, making the CLI look -for updates immediately even for fresh package data\. -.SS prefix +If true, staleness checks for cached data will be forced, making the CLI +look for updates immediately even for fresh package data\. +.SS \fBprefix\fP .RS 0 .IP \(bu 2 -Default: see npm help folders +Default: In global mode, the folder where the node executable is installed\. +In local mode, the nearest parent folder containing either a package\.json +file or a node_modules folder\. .IP \(bu 2 -Type: path +Type: Path .RE .P -The location to install global items\. If set on the command line, then -it forces non\-global commands to run in the specified folder\. -.SS preid +The location to install global items\. If set on the command line, then it +forces non\-global commands to run in the specified folder\. +.SS \fBpreid\fP .RS 0 .IP \(bu 2 Default: "" @@ -1274,30 +1267,12 @@ Type: String .RE .P -The "prerelease identifier" to use as a prefix for the "prerelease" part of a -semver\. Like the \fBrc\fP in \fB1\.2\.0\-rc\.8\fP\|\. -.SS production +The "prerelease identifier" to use as a prefix for the "prerelease" part of +a semver\. Like the \fBrc\fP in \fB1\.2\.0\-rc\.8\fP\|\. +.SS \fBprogress\fP .RS 0 .IP \(bu 2 -Default: false -.IP \(bu 2 -Type: Boolean - -.RE -.P -Set to true to run in "production" mode\. -.RS 0 -.IP 1. 3 -devDependencies are not installed at the topmost level when running -local \fBnpm install\fP without any arguments\. -.IP 2. 3 -Set the NODE_ENV="production" for lifecycle scripts\. - -.RE -.SS progress -.RS 0 -.IP \(bu 2 -Default: true, unless TRAVIS or CI env vars set\. +Default: \fBtrue\fP unless running in a known CI system .IP \(bu 2 Type: Boolean @@ -1307,19 +1282,19 @@ When set to \fBtrue\fP, npm will display a progress bar during time intensive operations, if \fBprocess\.stderr\fP is a TTY\. .P Set to \fBfalse\fP to suppress the progress bar\. -.SS proxy +.SS \fBproxy\fP .RS 0 .IP \(bu 2 Default: null .IP \(bu 2 -Type: url +Type: null, false, or URL .RE .P A proxy to use for outgoing http requests\. If the \fBHTTP_PROXY\fP or -\fBhttp_proxy\fP environment variables are set, proxy settings will be -honored by the underlying \fBrequest\fP library\. -.SS read\-only +\fBhttp_proxy\fP environment variables are set, proxy settings will be honored +by the underlying \fBrequest\fP library\. +.SS \fBread\-only\fP .RS 0 .IP \(bu 2 Default: false @@ -1328,8 +1303,9 @@ Type: Boolean .RE .P -This is used to mark a token as unable to publish when configuring limited access tokens with the \fBnpm token create\fP command\. -.SS rebuild\-bundle +This is used to mark a token as unable to publish when configuring limited +access tokens with the \fBnpm token create\fP command\. +.SS \fBrebuild\-bundle\fP .RS 0 .IP \(bu 2 Default: true @@ -1339,27 +1315,17 @@ Type: Boolean .RE .P Rebuild bundled dependencies after installation\. -.SS registry -.RS 0 -.IP \(bu 2 -Default: https://registry\.npmjs\.org/ -.IP \(bu 2 -Type: url - -.RE -.P -The base URL of the npm package registry\. -.SS rollback +.SS \fBregistry\fP .RS 0 .IP \(bu 2 -Default: true +Default: "https://registry\.npmjs\.org/" .IP \(bu 2 -Type: Boolean +Type: URL .RE .P -Remove failed installs\. -.SS save +The base URL of the npm registry\. +.SS \fBsave\fP .RS 0 .IP \(bu 2 Default: true @@ -1370,11 +1336,9 @@ Type: Boolean .P Save installed packages to a package\.json file as dependencies\. .P -When used with the \fBnpm rm\fP command, it removes it from the \fBdependencies\fP -object\. -.P -Only works if there is already a package\.json file present\. -.SS save\-bundle +When used with the \fBnpm rm\fP command, removes the dependency from +package\.json\. +.SS \fBsave\-bundle\fP .RS 0 .IP \(bu 2 Default: false @@ -1387,9 +1351,8 @@ If a package would be saved at install time by the use of \fB\-\-save\fP, \fB\-\-save\-dev\fP, or \fB\-\-save\-optional\fP, then also put it in the \fBbundleDependencies\fP list\. .P -When used with the \fBnpm rm\fP command, it removes it from the -bundledDependencies list\. -.SS save\-prod +Ignore if \fB\-\-save\-peer\fP is set, since peerDependencies cannot be bundled\. +.SS \fBsave\-dev\fP .RS 0 .IP \(bu 2 Default: false @@ -1398,12 +1361,8 @@ Type: Boolean .RE .P -Makes sure that a package will be saved into \fBdependencies\fP specifically\. This -is useful if a package already exists in \fBdevDependencies\fP or -\fBoptionalDependencies\fP, but you want to move it to be a production dep\. This is -also the default behavior if \fB\-\-save\fP is true, and neither \fB\-\-save\-dev\fP or -\fB\-\-save\-optional\fP are true\. -.SS save\-dev +Save installed packages to a package\.json file as \fBdevDependencies\fP\|\. +.SS \fBsave\-exact\fP .RS 0 .IP \(bu 2 Default: false @@ -1412,13 +1371,9 @@ Type: Boolean .RE .P -Save installed packages to a package\.json file as \fBdevDependencies\fP\|\. -.P -When used with the \fBnpm rm\fP command, it removes it from the -\fBdevDependencies\fP object\. -.P -Only works if there is already a package\.json file present\. -.SS save\-exact +Dependencies saved to package\.json will be configured with an exact version +rather than using npm's default semver range operator\. +.SS \fBsave\-optional\fP .RS 0 .IP \(bu 2 Default: false @@ -1427,10 +1382,8 @@ Type: Boolean .RE .P -Dependencies saved to package\.json using \fB\-\-save\fP, \fB\-\-save\-dev\fP or -\fB\-\-save\-optional\fP will be configured with an exact version rather than -using npm's default semver range operator\. -.SS save\-optional +Save installed packages to a package\.json file as \fBoptionalDependencies\fP\|\. +.SS \fBsave\-peer\fP .RS 0 .IP \(bu 2 Default: false @@ -1439,17 +1392,11 @@ Type: Boolean .RE .P -Save installed packages to a package\.json file as -optionalDependencies\. -.P -When used with the \fBnpm rm\fP command, it removes it from the -\fBdevDependencies\fP object\. -.P -Only works if there is already a package\.json file present\. -.SS save\-prefix +Save installed packages\. to a package\.json file as \fBpeerDependencies\fP +.SS \fBsave\-prefix\fP .RS 0 .IP \(bu 2 -Default: '^' +Default: "^" .IP \(bu 2 Type: String @@ -1458,68 +1405,58 @@ Type: String Configure how versions of packages installed to a package\.json file via \fB\-\-save\fP or \fB\-\-save\-dev\fP get prefixed\. .P -For example if a package has version \fB1\.2\.3\fP, by default its version is -set to \fB^1\.2\.3\fP which allows minor upgrades for that package, but after -\fBnpm config set save\-prefix='~'\fP it would be set to \fB~1\.2\.3\fP which only allows +For example if a package has version \fB1\.2\.3\fP, by default its version is set +to \fB^1\.2\.3\fP which allows minor upgrades for that package, but after \fBnpm +config set save\-prefix='~'\fP it would be set to \fB~1\.2\.3\fP which only allows patch upgrades\. -.SS scope +.SS \fBsave\-prod\fP .RS 0 .IP \(bu 2 -Default: the scope of the current project, if any, or "" +Default: false .IP \(bu 2 -Type: String +Type: Boolean .RE .P -Associate an operation with a scope for a scoped registry\. Useful when logging -in to a private registry for the first time: -\fBnpm login \-\-scope=@organization \-\-registry=registry\.organization\.com\fP, which -will cause \fB@organization\fP to be mapped to the registry for future installation -of packages specified according to the pattern \fB@organization/package\fP\|\. -.SS script\-shell -.RS 0 -.IP \(bu 2 -Default: \fBnull\fP -.IP \(bu 2 -Type: path - -.RE +Save installed packages into \fBdependencies\fP specifically\. This is useful if +a package already exists in \fBdevDependencies\fP or \fBoptionalDependencies\fP, but +you want to move it to be a non\-optional production dependency\. .P -The shell to use for scripts run with the \fBnpm run\fP command\. -.SS scripts\-prepend\-node\-path +This is the default behavior if \fB\-\-save\fP is true, and neither \fB\-\-save\-dev\fP +or \fB\-\-save\-optional\fP are true\. +.SS \fBscope\fP .RS 0 .IP \(bu 2 -Default: "warn\-only" +Default: the scope of the current project, if any, or "" .IP \(bu 2 -Type: Boolean, \fB"auto"\fP or \fB"warn\-only"\fP +Type: String .RE .P -If set to \fBtrue\fP, add the directory in which the current \fBnode\fP executable -resides to the \fBPATH\fP environment variable when running scripts, -even if that means that \fBnpm\fP will invoke a different \fBnode\fP executable than -the one which it is running\. +Associate an operation with a scope for a scoped registry\. .P -If set to \fBfalse\fP, never modify \fBPATH\fP with that\. +Useful when logging in to a private registry for the first time: .P -If set to \fB"warn\-only"\fP, never modify \fBPATH\fP but print a warning if \fBnpm\fP thinks -that you may want to run it with \fBtrue\fP, e\.g\. because the \fBnode\fP executable -in the \fBPATH\fP is not the one \fBnpm\fP was invoked with\. +.RS 2 +.nf +npm login \-\-scope=@mycorp \-\-registry=https://registry\.mycorp\.com +.fi +.RE .P -If set to \fBauto\fP, only add that directory to the \fBPATH\fP environment variable -if the \fBnode\fP executable with which \fBnpm\fP was invoked and the one that is found -first on the \fBPATH\fP are different\. -.SS searchexclude +This will cause \fB@mycorp\fP to be mapped to the registry for future +installation of packages specified according to the pattern +\fB@mycorp/package\fP\|\. +.SS \fBscript\-shell\fP .RS 0 .IP \(bu 2 -Default: "" +Default: '/bin/sh' on POSIX systems, 'cmd\.exe' on Windows .IP \(bu 2 -Type: String +Type: null or String .RE .P -Space\-separated options that limit the results from search\. -.SS searchopts +The shell to use for scripts run with the \fBnpm run\fP command\. +.SS \fBsearchexclude\fP .RS 0 .IP \(bu 2 Default: "" @@ -1528,8 +1465,8 @@ Type: String .RE .P -Space\-separated options that are always passed to search\. -.SS searchlimit +Space\-separated options that limit the results from search\. +.SS \fBsearchlimit\fP .RS 0 .IP \(bu 2 Default: 20 @@ -1540,10 +1477,20 @@ Type: Number .P Number of items to limit search results to\. Will not apply at all to legacy searches\. -.SS searchstaleness +.SS \fBsearchopts\fP .RS 0 .IP \(bu 2 -Default: 900 (15 minutes) +Default: "" +.IP \(bu 2 +Type: String + +.RE +.P +Space\-separated options that are always passed to search\. +.SS \fBsearchstaleness\fP +.RS 0 +.IP \(bu 2 +Default: 900 .IP \(bu 2 Type: Number @@ -1551,31 +1498,32 @@ Type: Number .P The age of the cache, in seconds, before another registry request is made if using legacy search endpoint\. -.SS shell +.SS \fBshell\fP .RS 0 .IP \(bu 2 -Default: SHELL environment variable, or "bash" on Posix, or "cmd" on +Default: SHELL environment variable, or "bash" on Posix, or "cmd\.exe" on Windows .IP \(bu 2 -Type: path +Type: String .RE .P The shell to run for the \fBnpm explore\fP command\. -.SS shrinkwrap +.SS \fBsign\-git\-commit\fP .RS 0 .IP \(bu 2 -Default: true +Default: false .IP \(bu 2 Type: Boolean .RE .P -If set to false, then ignore \fBnpm\-shrinkwrap\.json\fP files when installing\. This -will also prevent \fIwriting\fR \fBnpm\-shrinkwrap\.json\fP if \fBsave\fP is true\. +If set to true, then the \fBnpm version\fP command will commit the new package +version using \fB\-S\fP to add a signature\. .P -This option is an alias for \fB\-\-package\-lock\fP\|\. -.SS sign\-git\-commit +Note that git requires you to have set up GPG keys in your git configs for +this to work properly\. +.SS \fBsign\-git\-tag\fP .RS 0 .IP \(bu 2 Default: false @@ -1584,12 +1532,12 @@ Type: Boolean .RE .P -If set to true, then the \fBnpm version\fP command will commit the new package -version using \fB\-S\fP to add a signature\. +If set to true, then the \fBnpm version\fP command will tag the version using +\fB\-s\fP to add a signature\. .P -Note that git requires you to have set up GPG keys in your git configs -for this to work properly\. -.SS sign\-git\-tag +Note that git requires you to have set up GPG keys in your git configs for +this to work properly\. +.SS \fBstrict\-peer\-deps\fP .RS 0 .IP \(bu 2 Default: false @@ -1598,33 +1546,63 @@ Type: Boolean .RE .P -If set to true, then the \fBnpm version\fP command will tag the version -using \fB\-s\fP to add a signature\. +If set to \fBtrue\fP, and \fB\-\-legacy\-peer\-deps\fP is not set, then \fIany\fR +conflicting \fBpeerDependencies\fP will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non\-peer +dependency relationships\. +.P +By default, conflicting \fBpeerDependencies\fP deep in the dependency graph will +be resolved using the nearest non\-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's \fBpeerDependencies\fP object\. +.P +When such and override is performed, a warning is printed, explaining the +conflict and the packages involved\. If \fB\-\-strict\-peer\-deps\fP is set, then +this warning is treated as a failure\. +.SS \fBstrict\-ssl\fP +.RS 0 +.IP \(bu 2 +Default: true +.IP \(bu 2 +Type: Boolean + +.RE +.P +Whether or not to do SSL key validation when making requests to the registry +via https\. .P -Note that git requires you to have set up GPG keys in your git configs -for this to work properly\. -.SS sso\-poll\-frequency +See also the \fBca\fP config\. +.SS \fBtag\fP .RS 0 .IP \(bu 2 -Default: 500 +Default: "latest" .IP \(bu 2 -Type: Number +Type: String .RE .P -When used with SSO\-enabled \fBauth\-type\fPs, configures how regularly the registry -should be polled while the user is completing authentication\. -.SS sso\-type +If you ask npm to install a package and don't tell it a specific version, +then it will install the specified tag\. +.P +Also the tag that is added to the package@version specified by the \fBnpm tag\fP +command, if no explicit tag is given\. +.SS \fBtag\-version\-prefix\fP .RS 0 .IP \(bu 2 -Default: 'oauth' +Default: "v" .IP \(bu 2 -Type: 'oauth', 'saml', or null +Type: String .RE .P -If \fB\-\-auth\-type=sso\fP, the type of SSO type to use\. -.SS strict\-peer\-deps +If set, alters the prefix used when tagging a new version when performing a +version increment using \fBnpm\-version\fP\|\. To remove the prefix altogether, set +it to the empty string: \fB""\fP\|\. +.P +Because other tools may rely on the convention that npm version tags look +like \fBv1\.0\.0\fP, \fIonly use this property if it is absolutely necessary\fR\|\. In +particular, use care when overriding this setting for public packages\. +.SS \fBtiming\fP .RS 0 .IP \(bu 2 Default: false @@ -1633,19 +1611,48 @@ Type: Boolean .RE .P -If set to \fBtrue\fP, and \fB\-\-legacy\-peer\-deps\fP is not set, then \fIany\fR -conflicting \fBpeerDependencies\fP will be treated as an install failure, even -if npm could reasonably guess the appropriate resolution based on non\-peer -dependency relationships\. +If true, writes an \fBnpm\-debug\fP log to \fB_logs\fP and timing information to +\fB_timing\.json\fP, both in your cache, even if the command completes +successfully\. \fB_timing\.json\fP is a newline delimited list of JSON objects\. +.P +You can quickly view it with this json \fIhttps://npm\.im/json\fR command line: +\fBnpm exec \-\- json \-g < ~/\.npm/_timing\.json\fP\|\. +.SS \fBumask\fP +.RS 0 +.IP \(bu 2 +Default: 0 +.IP \(bu 2 +Type: Octal numeric string in range 0000\.\.0777 (0\.\.511) + +.RE +.P +The "umask" value to use when setting the file creation mode on files and +folders\. +.P +Folders and executables are given a mode which is \fB0o777\fP masked against +this value\. Other files are given a mode which is \fB0o666\fP masked against +this value\. +.P +Note that the underlying system will \fIalso\fR apply its own umask value to +files and folders that are created, and npm does not circumvent this, but +rather adds the \fB\-\-umask\fP config to it\. +.P +Thus, the effective default umask value on most POSIX systems is 0o22, +meaning that folders and executables are created with a mode of 0o755 and +other files are created with a mode of 0o644\. +.SS \fBunicode\fP +.RS 0 +.IP \(bu 2 +Default: false on windows, true on mac/unix systems with a unicode locale, +as defined by the LC_ALL, LC_CTYPE, or LANG environment variables\. +.IP \(bu 2 +Type: Boolean + +.RE .P -By default, conflicting \fBpeerDependencies\fP in the dependency graph will be -resolved using the nearest non\-peer dependency specification, even if doing -so will result in some packages receiving a peer dependency outside the -range set in their package's \fBpeerDependencies\fP object\. When such and -override is performed, a warning is printed, explaining the conflict and -the packages involved\. If \fB\-\-strict\-peer\-deps\fP is set, then the warning is -treated as a failure\. -.SS strict\-ssl +When set to true, npm uses unicode characters in the tree output\. When +false, it uses ascii characters instead of unicode glyphs\. +.SS \fBupdate\-notifier\fP .RS 0 .IP \(bu 2 Default: true @@ -1654,88 +1661,122 @@ Type: Boolean .RE .P -Whether or not to do SSL key validation when making requests to the -registry via https\. +Set to false to suppress the update notification when using an older version +of npm than the latest\. +.SS \fBusage\fP +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE .P -See also the \fBca\fP config\. -.SS tag +Show short usage output about the command specified\. +.SS \fBuser\-agent\fP .RS 0 .IP \(bu 2 -Default: latest +Default: "npm/{npm\-version} node/{node\-version} {platform} {arch} {ci}" .IP \(bu 2 Type: String .RE .P -If you ask npm to install a package and don't tell it a specific version, then -it will install the specified tag\. +Sets the User\-Agent request header\. The following fields are replaced with +their actual counterparts: +.RS 0 +.IP \(bu 2 +\fB{npm\-version}\fP \- The npm version in use +.IP \(bu 2 +\fB{node\-version}\fP \- The Node\.js version in use +.IP \(bu 2 +\fB{platform}\fP \- The value of \fBprocess\.platform\fP +.IP \(bu 2 +\fB{arch}\fP \- The value of \fBprocess\.arch\fP +.IP \(bu 2 +\fB{ci}\fP \- The value of the \fBci\-name\fP config, if set, prefixed with \fBci/\fP, or +an empty string if \fBci\-name\fP is empty\. + +.RE +.SS \fBuserconfig\fP +.RS 0 +.IP \(bu 2 +Default: "~/\.npmrc" +.IP \(bu 2 +Type: Path + +.RE +.P +The location of user\-level configuration settings\. .P -Also the tag that is added to the package@version specified by the \fBnpm -tag\fP command, if no explicit tag is given\. -.SS tag\-version\-prefix +This may be overridden by the \fBnpm_config_userconfig\fP environment variable +or the \fB\-\-userconfig\fP command line option, but may \fInot\fR be overridden by +settings in the \fBglobalconfig\fP file\. +.SS \fBversion\fP .RS 0 .IP \(bu 2 -Default: \fB"v"\fP +Default: false .IP \(bu 2 -Type: String +Type: Boolean .RE .P -If set, alters the prefix used when tagging a new version when performing a -version increment using \fBnpm\-version\fP\|\. To remove the prefix altogether, set it -to the empty string: \fB""\fP\|\. +If true, output the npm version and exit successfully\. .P -Because other tools may rely on the convention that npm version tags look like -\fBv1\.0\.0\fP, \fIonly use this property if it is absolutely necessary\fR\|\. In -particular, use care when overriding this setting for public packages\. -.SS timing +Only relevant when specified explicitly on the command line\. +.SS \fBversions\fP .RS 0 .IP \(bu 2 -Default: \fBfalse\fP +Default: false .IP \(bu 2 Type: Boolean .RE .P -If true, writes an \fBnpm\-debug\fP log to \fB_logs\fP and timing information to -\fB_timing\.json\fP, both in your cache\. \fB_timing\.json\fP is a newline delimited -list of JSON objects\. You can quickly view it with this -json \fIhttps://www\.npmjs\.com/package/json\fR command line: -\fBjson \-g < ~/\.npm/_timing\.json\fP\|\. -.SS tmp +If true, output the npm version as well as node's \fBprocess\.versions\fP map and +the version in the current working directory's \fBpackage\.json\fP file if one +exists, and exit successfully\. +.P +Only relevant when specified explicitly on the command line\. +.SS \fBviewer\fP .RS 0 .IP \(bu 2 -Default: TMPDIR environment variable, or "/tmp" +Default: "man" on Posix, "browser" on Windows .IP \(bu 2 -Type: path +Type: String .RE .P -Where to store temporary files and folders\. All temp files are deleted -on success, but left behind on failure for forensic purposes\. -.SS unicode +The program to use to view help content\. +.P +Set to \fB"browser"\fP to view html help content in the default web browser\. +.SS \fBwhich\fP .RS 0 .IP \(bu 2 -Default: false on windows, true on mac/unix systems with a unicode locale +Default: null .IP \(bu 2 -Type: Boolean +Type: null or Number .RE .P -When set to true, npm uses unicode characters in the tree output\. When -false, it uses ascii characters to draw trees\. -.SS update\-notifier +If there are multiple funding sources, which 1\-indexed source URL to open\. +.SS \fBworkspace\fP .RS 0 .IP \(bu 2 -Default: true +Default: .IP \(bu 2 -Type: Boolean +Type: String (can be set multiple times) .RE .P -Set to false to suppress the update notification when using an older -version of npm than the latest\. -.SS usage +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option\. +.P +Valid values for the \fBworkspace\fP config are either: \- Workspace names \- Path +to a workspace directory \- Path to a parent workspace directory (will result +to selecting all of the nested workspaces) +.SS \fBworkspaces\fP .RS 0 .IP \(bu 2 Default: false @@ -1744,80 +1785,236 @@ Type: Boolean .RE .P -Set to show short usage output (like the \-H output) -instead of complete help when doing npm help \fBhelp\fP\|\. -.SS userconfig +Enable running a command in the context of \fBall\fR the configured +workspaces\. +.SS \fByes\fP .RS 0 .IP \(bu 2 -Default: ~/\.npmrc +Default: null .IP \(bu 2 -Type: path +Type: null or Boolean .RE .P -The location of user\-level configuration settings\. -.SS umask +Automatically answer "yes" to any prompts that npm might print on the +command line\. +.SS \fBalso\fP .RS 0 .IP \(bu 2 -Default: 022 +Default: null .IP \(bu 2 -Type: Octal numeric string in range 0000\.\.0777 (0\.\.511) +Type: null, "dev", or "development" +.IP \(bu 2 +DEPRECATED: Please use \-\-include=dev instead\. .RE .P -The "umask" value to use when setting the file creation mode on files -and folders\. +When set to \fBdev\fP or \fBdevelopment\fP, this is an alias for \fB\-\-include=dev\fP\|\. +.SS \fBauth\-type\fP +.RS 0 +.IP \(bu 2 +Default: "legacy" +.IP \(bu 2 +Type: "legacy", "sso", "saml", or "oauth" +.IP \(bu 2 +DEPRECATED: This method of SSO/SAML/OAuth is deprecated and will be removed +in a future version of npm in favor of web\-based login\. + +.RE .P -Folders and executables are given a mode which is \fB0777\fP masked against -this value\. Other files are given a mode which is \fB0666\fP masked against -this value\. Thus, the defaults are \fB0755\fP and \fB0644\fP respectively\. -.SS user\-agent +What authentication strategy to use with \fBadduser\fP/\fBlogin\fP\|\. +.SS \fBcache\-max\fP .RS 0 .IP \(bu 2 -Default: node/{process\.version} {process\.platform} {process\.arch} +Default: Infinity +.IP \(bu 2 +Type: Number +.IP \(bu 2 +DEPRECATED: This option has been deprecated in favor of \fB\-\-prefer\-online\fP + +.RE +.P +\fB\-\-cache\-max=0\fP is an alias for \fB\-\-prefer\-online\fP +.SS \fBcache\-min\fP +.RS 0 +.IP \(bu 2 +Default: 0 +.IP \(bu 2 +Type: Number +.IP \(bu 2 +DEPRECATED: This option has been deprecated in favor of \fB\-\-prefer\-offline\fP\|\. + +.RE +.P +\fB\-\-cache\-min=9999 (or bigger)\fP is an alias for \fB\-\-prefer\-offline\fP\|\. +.SS \fBinit\.author\.email\fP +.RS 0 +.IP \(bu 2 +Default: "" .IP \(bu 2 Type: String +.IP \(bu 2 +DEPRECATED: Use \fB\-\-init\-author\-email\fP instead\. .RE .P -Sets a User\-Agent to the request header -.SS version +Alias for \fB\-\-init\-author\-email\fP +.SS \fBinit\.author\.name\fP .RS 0 .IP \(bu 2 -Default: false +Default: "" +.IP \(bu 2 +Type: String .IP \(bu 2 -Type: boolean +DEPRECATED: Use \fB\-\-init\-author\-name\fP instead\. .RE .P -If true, output the npm version and exit successfully\. +Alias for \fB\-\-init\-author\-name\fP +.SS \fBinit\.author\.url\fP +.RS 0 +.IP \(bu 2 +Default: "" +.IP \(bu 2 +Type: "" or URL +.IP \(bu 2 +DEPRECATED: Use \fB\-\-init\-author\-url\fP instead\. + +.RE .P -Only relevant when specified explicitly on the command line\. -.SS versions +Alias for \fB\-\-init\-author\-url\fP +.SS \fBinit\.license\fP +.RS 0 +.IP \(bu 2 +Default: "ISC" +.IP \(bu 2 +Type: String +.IP \(bu 2 +DEPRECATED: Use \fB\-\-init\-license\fP instead\. + +.RE +.P +Alias for \fB\-\-init\-license\fP +.SS \fBinit\.module\fP +.RS 0 +.IP \(bu 2 +Default: "~/\.npm\-init\.js" +.IP \(bu 2 +Type: Path +.IP \(bu 2 +DEPRECATED: Use \fB\-\-init\-module\fP instead\. + +.RE +.P +Alias for \fB\-\-init\-module\fP +.SS \fBinit\.version\fP +.RS 0 +.IP \(bu 2 +Default: "1\.0\.0" +.IP \(bu 2 +Type: SemVer string +.IP \(bu 2 +DEPRECATED: Use \fB\-\-init\-version\fP instead\. + +.RE +.P +Alias for \fB\-\-init\-version\fP +.SS \fBonly\fP +.RS 0 +.IP \(bu 2 +Default: null +.IP \(bu 2 +Type: null, "prod", or "production" +.IP \(bu 2 +DEPRECATED: Use \fB\-\-omit=dev\fP to omit dev dependencies from the install\. + +.RE +.P +When set to \fBprod\fP or \fBproduction\fP, this is an alias for \fB\-\-omit=dev\fP\|\. +.SS \fBoptional\fP +.RS 0 +.IP \(bu 2 +Default: null +.IP \(bu 2 +Type: null or Boolean +.IP \(bu 2 +DEPRECATED: Use \fB\-\-omit=optional\fP to exclude optional dependencies, or +\fB\-\-include=optional\fP to include them\. + +.RE +.P +Default value does install optional deps unless otherwise omitted\. +.P +Alias for \-\-include=optional or \-\-omit=optional +.SS \fBproduction\fP .RS 0 .IP \(bu 2 Default: false .IP \(bu 2 -Type: boolean +Type: Boolean +.IP \(bu 2 +DEPRECATED: Use \fB\-\-omit=dev\fP instead\. .RE .P -If true, output the npm version as well as node's \fBprocess\.versions\fP map, and -exit successfully\. +Alias for \fB\-\-omit=dev\fP +.SS \fBshrinkwrap\fP +.RS 0 +.IP \(bu 2 +Default: true +.IP \(bu 2 +Type: Boolean +.IP \(bu 2 +DEPRECATED: Use the \-\-package\-lock setting instead\. + +.RE .P -Only relevant when specified explicitly on the command line\. -.SS viewer +Alias for \-\-package\-lock +.SS \fBsso\-poll\-frequency\fP .RS 0 .IP \(bu 2 -Default: "man" on Posix, "browser" on Windows +Default: 500 +.IP \(bu 2 +Type: Number .IP \(bu 2 -Type: path +DEPRECATED: The \-\-auth\-type method of SSO/SAML/OAuth will be removed in a +future version of npm in favor of web\-based login\. .RE .P -The program to use to view help content\. +When used with SSO\-enabled \fBauth\-type\fPs, configures how regularly the +registry should be polled while the user is completing authentication\. +.SS \fBsso\-type\fP +.RS 0 +.IP \(bu 2 +Default: "oauth" +.IP \(bu 2 +Type: null, "oauth", or "saml" +.IP \(bu 2 +DEPRECATED: The \-\-auth\-type method of SSO/SAML/OAuth will be removed in a +future version of npm in favor of web\-based login\. + +.RE .P -Set to \fB"browser"\fP to view html help content in the default web browser\. +If \fB\-\-auth\-type=sso\fP, the type of SSO type to use\. +.SS \fBtmp\fP +.RS 0 +.IP \(bu 2 +Default: The value returned by the Node\.js \fBos\.tmpdir()\fP method +https://nodejs\.org/api/os\.html#os_os_tmpdir +.IP \(bu 2 +Type: Path +.IP \(bu 2 +DEPRECATED: This setting is no longer used\. npm stores temporary files in a +special location in the cache, and they are managed by +\fBcacache\fP \fIhttp://npm\.im/cacache\fR\|\. + +.RE +.P +Historically, the location where temporary files were stored\. No longer +relevant\. + + .SS See also .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man7/workspaces.7 b/deps/npm/man/man7/workspaces.7 index 61da2ce657c5c6..2fa6a9ccccdd9e 100644 --- a/deps/npm/man/man7/workspaces.7 +++ b/deps/npm/man/man7/workspaces.7 @@ -90,11 +90,65 @@ This demonstrates how the nature of \fBnode_modules\fP resolution allows for \fBworkspaces\fR to enable a portable workflow for requiring each \fBworkspace\fR in such a way that is also easy to npm help publish these nested workspaces to be consumed elsewhere\. +.SS Running commands in the context of workspaces +.P +You man use the \fBworkspace\fP configuration option to run commands in the context +of a configured workspace\. +.P +Following is a quick example on how to use the \fBnpm run\fP command in the context +of nested workspaces\. For a project containing multiple workspaces, e\.g: +.P +.RS 2 +.nf +\|\. ++\-\- package\.json +`\-\- packages + +\-\- a + | `\-\- package\.json + `\-\- b + `\-\- package\.json +.fi +.RE +.P +By running a command using the \fBworkspace\fP option, it's possible to run the +given command in the context of that specific workspace\. e\.g: +.P +.RS 2 +.nf +npm run test \-\-workspace=a +.fi +.RE +.P +This will run the \fBtest\fP script defined within the +\fB\|\./packages/a/package\.json\fP file\. +.P +Please note that you can also specify this argument multiple times in the +command\-line in order to target multiple workspaces, e\.g: +.P +.RS 2 +.nf +npm run test \-\-workspace=a \-\-workspace=b +.fi +.RE +.P +It's also possible to use the \fBworkspaces\fP (plural) configuration option to +enable the same behavior but running that command in the context of \fBall\fR +configured workspaces\. e\.g: +.P +.RS 2 +.nf +npm run test \-\-workspaces +.fi +.RE +.P +Will run the \fBtest\fP script in both \fB\|\./packages/a\fP and \fB\|\./packages/b\fP\|\. .SS See also .RS 0 .IP \(bu 2 npm help install .IP \(bu 2 npm help publish +.IP \(bu 2 +npm help run\-script .RE diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js b/deps/npm/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js index 9e4825c526451c..9a96fd1b3797cd 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js @@ -71,7 +71,7 @@ const addSingle = ({pkg, spec, saveBundle, saveType}) => { pkg.devDependencies[name] = pkg.peerDependencies[name] } - if (saveBundle) { + if (saveBundle && saveType !== 'peer' && saveType !== 'peerOptional') { // keep it sorted, keep it unique const bd = new Set(pkg.bundleDependencies || []) bd.add(spec.name) diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js index 803fb9782f07c0..0008045528d685 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js @@ -890,7 +890,7 @@ module.exports = cls => class Reifier extends cls { const root = this.idealTree const pkg = root.package for (const { name } of this[_resolvedAdd]) { - const req = npa(root.edgesOut.get(name).spec, root.realpath) + const req = npa.resolve(name, root.edgesOut.get(name).spec, root.realpath) const {rawSpec, subSpec} = req const spec = subSpec ? subSpec.rawSpec : rawSpec diff --git a/deps/npm/node_modules/@npmcli/arborist/package.json b/deps/npm/node_modules/@npmcli/arborist/package.json index bff10db4b0dd86..e745be2c77f7c0 100644 --- a/deps/npm/node_modules/@npmcli/arborist/package.json +++ b/deps/npm/node_modules/@npmcli/arborist/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/arborist", - "version": "2.2.8", + "version": "2.2.9", "description": "Manage node_modules trees", "dependencies": { "@npmcli/installed-package-contents": "^1.0.7", @@ -26,7 +26,7 @@ "promise-call-limit": "^1.0.1", "read-package-json-fast": "^2.0.2", "readdir-scoped-modules": "^1.1.0", - "semver": "^7.3.4", + "semver": "^7.3.5", "tar": "^6.1.0", "treeverse": "^1.0.4", "walk-up-path": "^1.0.0" diff --git a/deps/npm/node_modules/@npmcli/config/lib/get-user-agent.js b/deps/npm/node_modules/@npmcli/config/lib/get-user-agent.js deleted file mode 100644 index c3d3c7a1bf3de2..00000000000000 --- a/deps/npm/node_modules/@npmcli/config/lib/get-user-agent.js +++ /dev/null @@ -1,13 +0,0 @@ -// Accepts a config object, returns a user-agent string -const getUserAgent = (config) => { - const ciName = config.get('ci-name') - return (config.get('user-agent') || '') - .replace(/\{node-version\}/gi, config.get('node-version')) - .replace(/\{npm-version\}/gi, config.get('npm-version')) - .replace(/\{platform\}/gi, process.platform) - .replace(/\{arch\}/gi, process.arch) - .replace(/\{ci\}/gi, ciName ? `ci/${ciName}` : '') - .trim() -} - -module.exports = getUserAgent diff --git a/deps/npm/node_modules/@npmcli/config/lib/index.js b/deps/npm/node_modules/@npmcli/config/lib/index.js index e7fac96c1c8c8f..21a37ded48e7c3 100644 --- a/deps/npm/node_modules/@npmcli/config/lib/index.js +++ b/deps/npm/node_modules/@npmcli/config/lib/index.js @@ -47,7 +47,6 @@ const envReplace = require('./env-replace.js') const parseField = require('./parse-field.js') const typeDescription = require('./type-description.js') const setEnvs = require('./set-envs.js') -const getUserAgent = require('./get-user-agent.js') // types that can be saved back to const confFileTypes = new Set([ @@ -69,6 +68,9 @@ const _get = Symbol('get') const _find = Symbol('find') const _loadObject = Symbol('loadObject') const _loadFile = Symbol('loadFile') +const _checkDeprecated = Symbol('checkDeprecated') +const _flatten = Symbol('flatten') +const _flatOptions = Symbol('flatOptions') class Config { static get typeDefs () { @@ -76,9 +78,9 @@ class Config { } constructor ({ - types, + definitions, shorthands, - defaults, + flatten, npmPath, // options just to override in tests, mostly @@ -89,10 +91,27 @@ class Config { execPath = process.execPath, cwd = process.cwd(), }) { - this.npmPath = npmPath + + // turn the definitions into nopt's weirdo syntax + this.definitions = definitions + const types = {} + const defaults = {} + this.deprecated = {} + for (const [key, def] of Object.entries(definitions)) { + defaults[key] = def.default + types[key] = def.type + if (def.deprecated) + this.deprecated[key] = def.deprecated.trim().replace(/\n +/, '\n') + } + + // populated the first time we flatten the object + this[_flatOptions] = null + this[_flatten] = flatten this.types = types this.shorthands = shorthands this.defaults = defaults + + this.npmPath = npmPath this.log = log this.argv = argv this.env = env @@ -183,10 +202,31 @@ class Config { if (!email) throw new Error('Cannot set _auth without first setting email') } - this.data.get(where).data[key] = val + this[_checkDeprecated](key) + const { data } = this.data.get(where) + data[key] = val // this is now dirty, the next call to this.valid will have to check it this.data.get(where)[_valid] = null + + // the flat options are invalidated, regenerate next time they're needed + this[_flatOptions] = null + } + + get flat () { + if (this[_flatOptions]) + return this[_flatOptions] + + // create the object for flat options passed to deps + process.emit('time', 'config:load:flatten') + this[_flatOptions] = {} + // walk from least priority to highest + for (const { data } of this.data.values()) { + this[_flatten](data, this[_flatOptions]) + } + process.emit('timeEnd', 'config:load:flatten') + + return this[_flatOptions] } delete (key, where = 'cli') { @@ -233,11 +273,6 @@ class Config { await this.loadGlobalConfig() process.emit('timeEnd', 'config:load:global') - // now the extras - process.emit('time', 'config:load:cafile') - await this.loadCAFile() - process.emit('timeEnd', 'config:load:cafile') - // warn if anything is not valid process.emit('time', 'config:load:validate') this.validate() @@ -250,10 +285,6 @@ class Config { // set proper globalPrefix now that everything is loaded this.globalPrefix = this.get('prefix') - process.emit('time', 'config:load:setUserAgent') - this.setUserAgent() - process.emit('timeEnd', 'config:load:setUserAgent') - process.emit('time', 'config:load:setEnvs') this.setEnvs() process.emit('timeEnd', 'config:load:setEnvs') @@ -376,13 +407,13 @@ class Config { this.data.get(where)[_valid] = false if (Array.isArray(type)) { - if (type.indexOf(typeDefs.url.type) !== -1) + if (type.includes(typeDefs.url.type)) type = typeDefs.url.type else { /* istanbul ignore if - no actual configs matching this, but * path types SHOULD be handled this way, like URLs, for the * same reason */ - if (type.indexOf(typeDefs.path.type) !== -1) + if (type.includes(typeDefs.path.type)) type = typeDefs.path.type } } @@ -428,11 +459,21 @@ class Config { for (const [key, value] of Object.entries(obj)) { const k = envReplace(key, this.env) const v = this.parseField(value, k) + if (where !== 'default') + this[_checkDeprecated](k, where, obj, [key, value]) conf.data[k] = v } } } + [_checkDeprecated] (key, where, obj, kv) { + // XXX a future npm version will make this a warning. + // An even more future npm version will make this an error. + if (this.deprecated[key]) { + this.log.verbose('config', key, this.deprecated[key]) + } + } + // Parse a field, coercing it to the best type available. parseField (f, key, listElement = false) { return parseField(f, key, this, listElement) @@ -675,48 +716,6 @@ class Config { return creds } - async loadCAFile () { - const where = this[_find]('cafile') - - /* istanbul ignore if - it'll always be set in the defaults */ - if (!where) - return - - const cafile = this[_get]('cafile', where) - const ca = this[_get]('ca', where) - - // if you have a ca, or cafile is set to null, then nothing to do here. - if (ca || !cafile) - return - - const raw = await readFile(cafile, 'utf8').catch(er => { - if (er.code !== 'ENOENT') - throw er - }) - if (!raw) - return - - const delim = '-----END CERTIFICATE-----' - const output = raw.replace(/\r\n/g, '\n').split(delim) - .filter(section => section.trim()) - .map(section => section.trimLeft() + delim) - - // make it non-enumerable so we don't save it back by accident - const { data } = this.data.get(where) - Object.defineProperty(data, 'ca', { - value: output, - enumerable: false, - configurable: true, - writable: true, - }) - } - - // the user-agent configuration is a template that gets populated - // with some variables, that takes place here - setUserAgent () { - this.set('user-agent', getUserAgent(this)) - } - // set up the environment object we have with npm_config_* environs // for all configs that are different from their default values, and // set EDITOR and HOME. diff --git a/deps/npm/node_modules/@npmcli/config/lib/set-envs.js b/deps/npm/node_modules/@npmcli/config/lib/set-envs.js index 36d37145466e0d..ffaf5ab383c75f 100644 --- a/deps/npm/node_modules/@npmcli/config/lib/set-envs.js +++ b/deps/npm/node_modules/@npmcli/config/lib/set-envs.js @@ -50,11 +50,13 @@ const setEnvs = (config) => { platform, env, defaults, + definitions, list: [cliConf, envConf], } = config env.INIT_CWD = process.cwd() + // if the key is deprecated, skip it always. // if the key is the default value, // if the environ is NOT the default value, // set the environ @@ -65,6 +67,10 @@ const setEnvs = (config) => { const cliSet = new Set(Object.keys(cliConf)) const envSet = new Set(Object.keys(envConf)) for (const key in cliConf) { + const { deprecated } = definitions[key] || {} + if (deprecated) + continue + if (sameConfigValue(defaults[key], cliConf[key])) { // config is the default, if the env thought different, then we // have to set it BACK to the default in the environment. diff --git a/deps/npm/node_modules/@npmcli/config/package.json b/deps/npm/node_modules/@npmcli/config/package.json index 644544a49d8698..b2b34f6af2712f 100644 --- a/deps/npm/node_modules/@npmcli/config/package.json +++ b/deps/npm/node_modules/@npmcli/config/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/config", - "version": "1.2.9", + "version": "2.0.0", "files": [ "lib" ], diff --git a/deps/npm/node_modules/@npmcli/run-script/lib/make-spawn-args.js b/deps/npm/node_modules/@npmcli/run-script/lib/make-spawn-args.js index 4c38b9401ddf06..8ee24c06daf7b1 100644 --- a/deps/npm/node_modules/@npmcli/run-script/lib/make-spawn-args.js +++ b/deps/npm/node_modules/@npmcli/run-script/lib/make-spawn-args.js @@ -3,24 +3,6 @@ const isWindows = require('./is-windows.js') const setPATH = require('./set-path.js') const {resolve} = require('path') const npm_config_node_gyp = require.resolve('node-gyp/bin/node-gyp.js') -const { quoteForShell, ShellString, ShellStringText, ShellStringUnquoted } = require('puka') - -const escapeCmd = cmd => { - const result = [] - const parsed = ShellString.sh([cmd]) - for (const child of parsed.children) { - if (child instanceof ShellStringText) { - const children = child.contents.filter(segment => segment !== null).map(segment => quoteForShell(segment, false, isWindows && 'win32')) - result.push(...children) - } else if (child instanceof ShellStringUnquoted) { - result.push(child.value) - } else { - result.push(isWindows ? '&' : ';') - } - } - - return result.join('') -} const makeSpawnArgs = options => { const { @@ -34,7 +16,7 @@ const makeSpawnArgs = options => { } = options const isCmd = /(?:^|\\)cmd(?:\.exe)?$/i.test(scriptShell) - const args = isCmd ? ['/d', '/s', '/c', escapeCmd(cmd)] : ['-c', cmd] + const args = isCmd ? ['/d', '/s', '/c', cmd] : ['-c', cmd] const spawnOpts = { env: setPATH(path, { diff --git a/deps/npm/node_modules/@npmcli/run-script/package.json b/deps/npm/node_modules/@npmcli/run-script/package.json index 9df5b311787472..7e0e5255de4105 100644 --- a/deps/npm/node_modules/@npmcli/run-script/package.json +++ b/deps/npm/node_modules/@npmcli/run-script/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/run-script", - "version": "1.8.3", + "version": "1.8.4", "description": "Run a lifecycle script for a package (descendant of npm-lifecycle)", "author": "Isaac Z. Schlueter (https://izs.me)", "license": "ISC", @@ -32,7 +32,6 @@ "@npmcli/promise-spawn": "^1.3.2", "infer-owner": "^1.0.4", "node-gyp": "^7.1.0", - "puka": "^1.0.1", "read-package-json-fast": "^2.0.1" }, "files": [ diff --git a/deps/npm/node_modules/cacache/CHANGELOG.md b/deps/npm/node_modules/cacache/CHANGELOG.md index 14eee0b381c071..d10160846b1572 100644 --- a/deps/npm/node_modules/cacache/CHANGELOG.md +++ b/deps/npm/node_modules/cacache/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [15.0.6](https://github.com/npm/cacache/compare/v15.0.5...v15.0.6) (2021-03-22) + ### [15.0.5](https://github.com/npm/cacache/compare/v15.0.4...v15.0.5) (2020-07-11) ### [15.0.4](https://github.com/npm/cacache/compare/v15.0.3...v15.0.4) (2020-06-03) diff --git a/deps/npm/node_modules/cacache/package.json b/deps/npm/node_modules/cacache/package.json index 053c245b52b726..afe569c8bd6cb1 100644 --- a/deps/npm/node_modules/cacache/package.json +++ b/deps/npm/node_modules/cacache/package.json @@ -1,6 +1,6 @@ { "name": "cacache", - "version": "15.0.5", + "version": "15.0.6", "cache-version": { "content": "2", "index": "5" @@ -72,7 +72,7 @@ "p-map": "^4.0.0", "promise-inflight": "^1.0.1", "rimraf": "^3.0.2", - "ssri": "^8.0.0", + "ssri": "^8.0.1", "tar": "^6.0.2", "unique-filename": "^1.1.1" }, diff --git a/deps/npm/node_modules/hosted-git-info/README.md b/deps/npm/node_modules/hosted-git-info/README.md index 7b723f6b9e2134..87404060296269 100644 --- a/deps/npm/node_modules/hosted-git-info/README.md +++ b/deps/npm/node_modules/hosted-git-info/README.md @@ -22,7 +22,7 @@ var info = hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git", opts) If the URL can't be matched with a git host, `null` will be returned. We can match git, ssh and https urls. Additionally, we can match ssh connect strings (`git@github.com:npm/hosted-git-info`) and shortcuts (eg, -`github:npm/hosted-git-info`). Github specifically, is detected in the case +`github:npm/hosted-git-info`). GitHub specifically, is detected in the case of a third, unprefixed, form: `npm/hosted-git-info`. If it does match, the returned object has properties of: @@ -129,5 +129,5 @@ SSH connect strings will be normalized into `git+ssh` URLs. ## Supported hosts -Currently this supports Github, Bitbucket and Gitlab. Pull requests for +Currently this supports GitHub, Bitbucket and GitLab. Pull requests for additional hosts welcome. diff --git a/deps/npm/node_modules/hosted-git-info/git-host-info.js b/deps/npm/node_modules/hosted-git-info/git-host-info.js index da3348fa7b817c..360d7b096be617 100644 --- a/deps/npm/node_modules/hosted-git-info/git-host-info.js +++ b/deps/npm/node_modules/hosted-git-info/git-host-info.js @@ -1,79 +1,154 @@ 'use strict' +const maybeJoin = (...args) => args.every(arg => arg) ? args.join('') : '' +const maybeEncode = (arg) => arg ? encodeURIComponent(arg) : '' -var gitHosts = module.exports = { - github: { - // First two are insecure and generally shouldn't be used any more, but - // they are still supported. - 'protocols': [ 'git', 'http', 'git+ssh', 'git+https', 'ssh', 'https' ], - 'domain': 'github.com', - 'treepath': 'tree', - 'filetemplate': 'https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}', - 'bugstemplate': 'https://{domain}/{user}/{project}/issues', - 'gittemplate': 'git://{auth@}{domain}/{user}/{project}.git{#committish}', - 'tarballtemplate': 'https://codeload.{domain}/{user}/{project}/tar.gz/{committish}' - }, - bitbucket: { - 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ], - 'domain': 'bitbucket.org', - 'treepath': 'src', - 'tarballtemplate': 'https://{domain}/{user}/{project}/get/{committish}.tar.gz' - }, - gitlab: { - 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ], - 'domain': 'gitlab.com', - 'treepath': 'tree', - 'bugstemplate': 'https://{domain}/{user}/{project}/issues', - 'httpstemplate': 'git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}', - 'tarballtemplate': 'https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}', - 'pathmatch': /^\/([^/]+)\/((?!.*(\/-\/|\/repository(\/[^/]+)?\/archive\.tar\.gz)).*?)(?:\.git|\/)?$/ - }, - gist: { - 'protocols': [ 'git', 'git+ssh', 'git+https', 'ssh', 'https' ], - 'domain': 'gist.github.com', - 'pathmatch': /^[/](?:([^/]+)[/])?([a-z0-9]{7,})(?:[.]git)?$/, - 'filetemplate': 'https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}', - 'bugstemplate': 'https://{domain}/{project}', - 'gittemplate': 'git://{domain}/{project}.git{#committish}', - 'sshtemplate': 'git@{domain}:/{project}.git{#committish}', - 'sshurltemplate': 'git+ssh://git@{domain}/{project}.git{#committish}', - 'browsetemplate': 'https://{domain}/{project}{/committish}', - 'browsefiletemplate': 'https://{domain}/{project}{/committish}{#path}', - 'docstemplate': 'https://{domain}/{project}{/committish}', - 'httpstemplate': 'git+https://{domain}/{project}.git{#committish}', - 'shortcuttemplate': '{type}:{project}{#committish}', - 'pathtemplate': '{project}{#committish}', - 'tarballtemplate': 'https://codeload.github.com/gist/{project}/tar.gz/{committish}', - 'hashformat': function (fragment) { - return 'file-' + formatHashFragment(fragment) +const defaults = { + sshtemplate: ({ domain, user, project, committish }) => `git@${domain}:${user}/${project}.git${maybeJoin('#', committish)}`, + sshurltemplate: ({ domain, user, project, committish }) => `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, + browsetemplate: ({ domain, user, project, committish, treepath }) => `https://${domain}/${user}/${project}${maybeJoin('/', treepath, '/', maybeEncode(committish))}`, + browsefiletemplate: ({ domain, user, project, committish, treepath, path, fragment, hashformat }) => `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || 'master')}/${path}${maybeJoin('#', hashformat(fragment || ''))}`, + docstemplate: ({ domain, user, project, treepath, committish }) => `https://${domain}/${user}/${project}${maybeJoin('/', treepath, '/', maybeEncode(committish))}#readme`, + httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, + filetemplate: ({ domain, user, project, committish, path }) => `https://${domain}/${user}/${project}/raw/${maybeEncode(committish) || 'master'}/${path}`, + shortcuttemplate: ({ type, user, project, committish }) => `${type}:${user}/${project}${maybeJoin('#', committish)}`, + pathtemplate: ({ user, project, committish }) => `${user}/${project}${maybeJoin('#', committish)}`, + bugstemplate: ({ domain, user, project }) => `https://${domain}/${user}/${project}/issues`, + hashformat: formatHashFragment +} + +const gitHosts = {} +gitHosts.github = Object.assign({}, defaults, { + // First two are insecure and generally shouldn't be used any more, but + // they are still supported. + protocols: ['git:', 'http:', 'git+ssh:', 'git+https:', 'ssh:', 'https:'], + domain: 'github.com', + treepath: 'tree', + filetemplate: ({ auth, user, project, committish, path }) => `https://${maybeJoin(auth, '@')}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish) || 'master'}/${path}`, + gittemplate: ({ auth, domain, user, project, committish }) => `git://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, + tarballtemplate: ({ domain, user, project, committish }) => `https://codeload.${domain}/${user}/${project}/tar.gz/${maybeEncode(committish) || 'master'}`, + extract: (url) => { + let [, user, project, type, committish] = url.pathname.split('/', 5) + if (type && type !== 'tree') { + return + } + + if (!type) { + committish = url.hash.slice(1) + } + + if (project && project.endsWith('.git')) { + project = project.slice(0, -4) + } + + if (!user || !project) { + return } + + return { user, project, committish } } -} +}) -var gitHostDefaults = { - 'sshtemplate': 'git@{domain}:{user}/{project}.git{#committish}', - 'sshurltemplate': 'git+ssh://git@{domain}/{user}/{project}.git{#committish}', - 'browsetemplate': 'https://{domain}/{user}/{project}{/tree/committish}', - 'browsefiletemplate': 'https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}', - 'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#readme', - 'httpstemplate': 'git+https://{auth@}{domain}/{user}/{project}.git{#committish}', - 'filetemplate': 'https://{domain}/{user}/{project}/raw/{committish}/{path}', - 'shortcuttemplate': '{type}:{user}/{project}{#committish}', - 'pathtemplate': '{user}/{project}{#committish}', - 'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/, - 'hashformat': formatHashFragment -} +gitHosts.bitbucket = Object.assign({}, defaults, { + protocols: ['git+ssh:', 'git+https:', 'ssh:', 'https:'], + domain: 'bitbucket.org', + treepath: 'src', + tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/get/${maybeEncode(committish) || 'master'}.tar.gz`, + extract: (url) => { + let [, user, project, aux] = url.pathname.split('/', 4) + if (['get'].includes(aux)) { + return + } + + if (project && project.endsWith('.git')) { + project = project.slice(0, -4) + } + + if (!user || !project) { + return + } + + return { user, project, committish: url.hash.slice(1) } + } +}) + +gitHosts.gitlab = Object.assign({}, defaults, { + protocols: ['git+ssh:', 'git+https:', 'ssh:', 'https:'], + domain: 'gitlab.com', + treepath: 'tree', + httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, + tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/repository/archive.tar.gz?ref=${maybeEncode(committish) || 'master'}`, + extract: (url) => { + const path = url.pathname.slice(1) + if (path.includes('/-/')) { + return + } + + const segments = path.split('/') + let project = segments.pop() + if (project.endsWith('.git')) { + project = project.slice(0, -4) + } + + const user = segments.join('/') + if (!user || !project) { + return + } + + return { user, project, committish: url.hash.slice(1) } + } +}) + +gitHosts.gist = Object.assign({}, defaults, { + protocols: ['git:', 'git+ssh:', 'git+https:', 'ssh:', 'https:'], + domain: 'gist.github.com', + sshtemplate: ({ domain, project, committish }) => `git@${domain}:${project}.git${maybeJoin('#', committish)}`, + sshurltemplate: ({ domain, project, committish }) => `git+ssh://git@${domain}/${project}.git${maybeJoin('#', committish)}`, + browsetemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}`, + browsefiletemplate: ({ domain, project, committish, path, hashformat }) => `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}${maybeJoin('#', hashformat(path))}`, + docstemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}`, + httpstemplate: ({ domain, project, committish }) => `git+https://${domain}/${project}.git${maybeJoin('#', committish)}`, + filetemplate: ({ user, project, committish, path }) => `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin('/', maybeEncode(committish))}/${path}`, + shortcuttemplate: ({ type, project, committish }) => `${type}:${project}${maybeJoin('#', committish)}`, + pathtemplate: ({ project, committish }) => `${project}${maybeJoin('#', committish)}`, + bugstemplate: ({ domain, project }) => `https://${domain}/${project}`, + gittemplate: ({ domain, project, committish }) => `git://${domain}/${project}.git${maybeJoin('#', committish)}`, + tarballtemplate: ({ project, committish }) => `https://codeload.github.com/gist/${project}/tar.gz/${maybeEncode(committish) || 'master'}`, + extract: (url) => { + let [, user, project, aux] = url.pathname.split('/', 4) + if (aux === 'raw') { + return + } + + if (!project) { + if (!user) { + return + } + + project = user + user = null + } + + if (project.endsWith('.git')) { + project = project.slice(0, -4) + } -Object.keys(gitHosts).forEach(function (name) { - Object.keys(gitHostDefaults).forEach(function (key) { - if (gitHosts[name][key]) return - gitHosts[name][key] = gitHostDefaults[key] - }) - gitHosts[name].protocols_re = RegExp('^(' + - gitHosts[name].protocols.map(function (protocol) { - return protocol.replace(/([\\+*{}()[\]$^|])/g, '\\$1') - }).join('|') + '):$') + return { user, project, committish: url.hash.slice(1) } + }, + hashformat: function (fragment) { + return fragment && 'file-' + formatHashFragment(fragment) + } }) +const names = Object.keys(gitHosts) +gitHosts.byShortcut = {} +gitHosts.byDomain = {} +for (const name of names) { + gitHosts.byShortcut[`${name}:`] = name + gitHosts.byDomain[gitHosts[name].domain] = name +} + function formatHashFragment (fragment) { return fragment.toLowerCase().replace(/^\W+|\/|\W+$/g, '').replace(/\W+/g, '-') } + +module.exports = gitHosts diff --git a/deps/npm/node_modules/hosted-git-info/git-host.js b/deps/npm/node_modules/hosted-git-info/git-host.js index f9b1ec74563208..8a975e92e58bb7 100644 --- a/deps/npm/node_modules/hosted-git-info/git-host.js +++ b/deps/npm/node_modules/hosted-git-info/git-host.js @@ -1,156 +1,110 @@ 'use strict' -var gitHosts = require('./git-host-info.js') -/* eslint-disable node/no-deprecated-api */ - -// copy-pasta util._extend from node's source, to avoid pulling -// the whole util module into peoples' webpack bundles. -/* istanbul ignore next */ -var extend = Object.assign || function _extend (target, source) { - // Don't do anything if source isn't an object - if (source === null || typeof source !== 'object') return target - - const keys = Object.keys(source) - let i = keys.length - while (i--) { - target[keys[i]] = source[keys[i]] - } - return target -} +const gitHosts = require('./git-host-info.js') + +class GitHost { + constructor (type, user, auth, project, committish, defaultRepresentation, opts = {}) { + Object.assign(this, gitHosts[type]) + this.type = type + this.user = user + this.auth = auth + this.project = project + this.committish = committish + this.default = defaultRepresentation + this.opts = opts + } -module.exports = GitHost -function GitHost (type, user, auth, project, committish, defaultRepresentation, opts) { - var gitHostInfo = this - gitHostInfo.type = type - Object.keys(gitHosts[type]).forEach(function (key) { - gitHostInfo[key] = gitHosts[type][key] - }) - gitHostInfo.user = user - gitHostInfo.auth = auth - gitHostInfo.project = project - gitHostInfo.committish = committish - gitHostInfo.default = defaultRepresentation - gitHostInfo.opts = opts || {} -} + hash () { + return this.committish ? `#${this.committish}` : '' + } -GitHost.prototype.hash = function () { - return this.committish ? '#' + this.committish : '' -} + ssh (opts) { + return this._fill(this.sshtemplate, opts) + } + + _fill (template, opts) { + if (typeof template === 'function') { + const options = { ...this, ...this.opts, ...opts } + + // the path should always be set so we don't end up with 'undefined' in urls + if (!options.path) { + options.path = '' + } + + // template functions will insert the leading slash themselves + if (options.path.startsWith('/')) { + options.path = options.path.slice(1) + } -GitHost.prototype._fill = function (template, opts) { - if (!template) return - var vars = extend({}, opts) - vars.path = vars.path ? vars.path.replace(/^[/]+/g, '') : '' - opts = extend(extend({}, this.opts), opts) - var self = this - Object.keys(this).forEach(function (key) { - if (self[key] != null && vars[key] == null) vars[key] = self[key] - }) - var rawAuth = vars.auth - var rawcommittish = vars.committish - var rawFragment = vars.fragment - var rawPath = vars.path - var rawProject = vars.project - Object.keys(vars).forEach(function (key) { - var value = vars[key] - if ((key === 'path' || key === 'project') && typeof value === 'string') { - vars[key] = value.split('/').map(function (pathComponent) { - return encodeURIComponent(pathComponent) - }).join('/') - } else if (key !== 'domain') { - vars[key] = encodeURIComponent(value) + if (options.noCommittish) { + options.committish = null + } + + const result = template(options) + return options.noGitPlus && result.startsWith('git+') ? result.slice(4) : result } - }) - vars['auth@'] = rawAuth ? rawAuth + '@' : '' - vars['#fragment'] = rawFragment ? '#' + this.hashformat(rawFragment) : '' - vars.fragment = vars.fragment ? vars.fragment : '' - vars['#path'] = rawPath ? '#' + this.hashformat(rawPath) : '' - vars['/path'] = vars.path ? '/' + vars.path : '' - vars.projectPath = rawProject.split('/').map(encodeURIComponent).join('/') - if (opts.noCommittish) { - vars['#committish'] = '' - vars['/tree/committish'] = '' - vars['/committish'] = '' - vars.committish = '' - } else { - vars['#committish'] = rawcommittish ? '#' + rawcommittish : '' - vars['/tree/committish'] = vars.committish - ? '/' + vars.treepath + '/' + vars.committish - : '' - vars['/committish'] = vars.committish ? '/' + vars.committish : '' - vars.committish = vars.committish || 'master' - } - var res = template - Object.keys(vars).forEach(function (key) { - res = res.replace(new RegExp('[{]' + key + '[}]', 'g'), vars[key]) - }) - if (opts.noGitPlus) { - return res.replace(/^git[+]/, '') - } else { - return res + + return null } -} -GitHost.prototype.ssh = function (opts) { - return this._fill(this.sshtemplate, opts) -} + sshurl (opts) { + return this._fill(this.sshurltemplate, opts) + } -GitHost.prototype.sshurl = function (opts) { - return this._fill(this.sshurltemplate, opts) -} + browse (path, fragment, opts) { + // not a string, treat path as opts + if (typeof path !== 'string') { + return this._fill(this.browsetemplate, path) + } -GitHost.prototype.browse = function (P, F, opts) { - if (typeof P === 'string') { - if (typeof F !== 'string') { - opts = F - F = null + if (typeof fragment !== 'string') { + opts = fragment + fragment = null } - return this._fill(this.browsefiletemplate, extend({ - fragment: F, - path: P - }, opts)) - } else { - return this._fill(this.browsetemplate, P) + return this._fill(this.browsefiletemplate, { ...opts, fragment, path }) } -} -GitHost.prototype.docs = function (opts) { - return this._fill(this.docstemplate, opts) -} + docs (opts) { + return this._fill(this.docstemplate, opts) + } -GitHost.prototype.bugs = function (opts) { - return this._fill(this.bugstemplate, opts) -} + bugs (opts) { + return this._fill(this.bugstemplate, opts) + } -GitHost.prototype.https = function (opts) { - return this._fill(this.httpstemplate, opts) -} + https (opts) { + return this._fill(this.httpstemplate, opts) + } -GitHost.prototype.git = function (opts) { - return this._fill(this.gittemplate, opts) -} + git (opts) { + return this._fill(this.gittemplate, opts) + } -GitHost.prototype.shortcut = function (opts) { - return this._fill(this.shortcuttemplate, opts) -} + shortcut (opts) { + return this._fill(this.shortcuttemplate, opts) + } -GitHost.prototype.path = function (opts) { - return this._fill(this.pathtemplate, opts) -} + path (opts) { + return this._fill(this.pathtemplate, opts) + } -GitHost.prototype.tarball = function (opts_) { - var opts = extend({}, opts_, { noCommittish: false }) - return this._fill(this.tarballtemplate, opts) -} + tarball (opts) { + return this._fill(this.tarballtemplate, { ...opts, noCommittish: false }) + } -GitHost.prototype.file = function (P, opts) { - return this._fill(this.filetemplate, extend({ path: P }, opts)) -} + file (path, opts) { + return this._fill(this.filetemplate, { ...opts, path }) + } -GitHost.prototype.getDefaultRepresentation = function () { - return this.default -} + getDefaultRepresentation () { + return this.default + } + + toString (opts) { + if (this.default && typeof this[this.default] === 'function') { + return this[this.default](opts) + } -GitHost.prototype.toString = function (opts) { - if (this.default && typeof this[this.default] === 'function') return this[this.default](opts) - return this.sshurl(opts) + return this.sshurl(opts) + } } +module.exports = GitHost diff --git a/deps/npm/node_modules/hosted-git-info/index.js b/deps/npm/node_modules/hosted-git-info/index.js index 8b3eaba3da7fb9..f35c570c46b595 100644 --- a/deps/npm/node_modules/hosted-git-info/index.js +++ b/deps/npm/node_modules/hosted-git-info/index.js @@ -1,11 +1,11 @@ 'use strict' -var url = require('url') -var gitHosts = require('./git-host-info.js') -var GitHost = module.exports = require('./git-host.js') -var LRU = require('lru-cache') -var cache = new LRU({max: 1000}) +const url = require('url') +const gitHosts = require('./git-host-info.js') +const GitHost = module.exports = require('./git-host.js') +const LRU = require('lru-cache') +const cache = new LRU({ max: 1000 }) -var protocolToRepresentationMap = { +const protocolToRepresentationMap = { 'git+ssh:': 'sshurl', 'git+https:': 'https', 'ssh:': 'sshurl', @@ -16,7 +16,7 @@ function protocolToRepresentation (protocol) { return protocolToRepresentationMap[protocol] || protocol.slice(0, -1) } -var authProtocols = { +const authProtocols = { 'git:': true, 'https:': true, 'git+https:': true, @@ -24,9 +24,14 @@ var authProtocols = { 'git+http:': true } +const knownProtocols = Object.keys(gitHosts.byShortcut).concat(['http:', 'https:', 'git:', 'git+ssh:', 'git+https:', 'ssh:']) + module.exports.fromUrl = function (giturl, opts) { - if (typeof giturl !== 'string') return - var key = giturl + JSON.stringify(opts || {}) + if (typeof giturl !== 'string') { + return + } + + const key = giturl + JSON.stringify(opts || {}) if (!cache.has(key)) { cache.set(key, fromUrl(giturl, opts)) @@ -36,111 +41,197 @@ module.exports.fromUrl = function (giturl, opts) { } function fromUrl (giturl, opts) { - if (giturl == null || giturl === '') return - var url = fixupUnqualifiedGist( - isGitHubShorthand(giturl) ? 'github:' + giturl : giturl - ) - var parsed = parseGitUrl(url) - var shortcutMatch = url.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/) - var matches = Object.keys(gitHosts).map(function (gitHostName) { - try { - var gitHostInfo = gitHosts[gitHostName] - var auth = null - if (parsed.auth && authProtocols[parsed.protocol]) { - auth = parsed.auth + if (!giturl) { + return + } + + const url = isGitHubShorthand(giturl) ? 'github:' + giturl : correctProtocol(giturl) + const parsed = parseGitUrl(url) + if (!parsed) { + return parsed + } + + const gitHostShortcut = gitHosts.byShortcut[parsed.protocol] + const gitHostDomain = gitHosts.byDomain[parsed.hostname.startsWith('www.') ? parsed.hostname.slice(4) : parsed.hostname] + const gitHostName = gitHostShortcut || gitHostDomain + if (!gitHostName) { + return + } + + const gitHostInfo = gitHosts[gitHostShortcut || gitHostDomain] + let auth = null + if (authProtocols[parsed.protocol] && (parsed.username || parsed.password)) { + auth = `${parsed.username}${parsed.password ? ':' + parsed.password : ''}` + } + + let committish = null + let user = null + let project = null + let defaultRepresentation = null + + try { + if (gitHostShortcut) { + let pathname = parsed.pathname.startsWith('/') ? parsed.pathname.slice(1) : parsed.pathname + const firstAt = pathname.indexOf('@') + // we ignore auth for shortcuts, so just trim it out + if (firstAt > -1) { + pathname = pathname.slice(firstAt + 1) } - var committish = parsed.hash ? decodeURIComponent(parsed.hash.substr(1)) : null - var user = null - var project = null - var defaultRepresentation = null - if (shortcutMatch && shortcutMatch[1] === gitHostName) { - user = shortcutMatch[2] && decodeURIComponent(shortcutMatch[2]) - project = decodeURIComponent(shortcutMatch[3].replace(/\.git$/, '')) - defaultRepresentation = 'shortcut' - } else { - if (parsed.host && parsed.host !== gitHostInfo.domain && parsed.host.replace(/^www[.]/, '') !== gitHostInfo.domain) return - if (!gitHostInfo.protocols_re.test(parsed.protocol)) return - if (!parsed.path) return - var pathmatch = gitHostInfo.pathmatch - var matched = parsed.path.match(pathmatch) - if (!matched) return - /* istanbul ignore else */ - if (matched[1] !== null && matched[1] !== undefined) { - user = decodeURIComponent(matched[1].replace(/^:/, '')) + + const lastSlash = pathname.lastIndexOf('/') + if (lastSlash > -1) { + user = decodeURIComponent(pathname.slice(0, lastSlash)) + // we want nulls only, never empty strings + if (!user) { + user = null } - project = decodeURIComponent(matched[2]) - defaultRepresentation = protocolToRepresentation(parsed.protocol) + project = decodeURIComponent(pathname.slice(lastSlash + 1)) + } else { + project = decodeURIComponent(pathname) + } + + if (project.endsWith('.git')) { + project = project.slice(0, -4) + } + + if (parsed.hash) { + committish = decodeURIComponent(parsed.hash.slice(1)) + } + + defaultRepresentation = 'shortcut' + } else { + if (!gitHostInfo.protocols.includes(parsed.protocol)) { + return } - return new GitHost(gitHostName, user, auth, project, committish, defaultRepresentation, opts) - } catch (ex) { - /* istanbul ignore else */ - if (ex instanceof URIError) { - } else throw ex + + const segments = gitHostInfo.extract(parsed) + if (!segments) { + return + } + + user = segments.user && decodeURIComponent(segments.user) + project = decodeURIComponent(segments.project) + committish = decodeURIComponent(segments.committish) + defaultRepresentation = protocolToRepresentation(parsed.protocol) } - }).filter(function (gitHostInfo) { return gitHostInfo }) - if (matches.length !== 1) return - return matches[0] -} + } catch (err) { + /* istanbul ignore else */ + if (err instanceof URIError) { + return + } else { + throw err + } + } -function isGitHubShorthand (arg) { - // Note: This does not fully test the git ref format. - // See https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html - // - // The only way to do this properly would be to shell out to - // git-check-ref-format, and as this is a fast sync function, - // we don't want to do that. Just let git fail if it turns - // out that the commit-ish is invalid. - // GH usernames cannot start with . or - - return /^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(arg) + return new GitHost(gitHostName, user, auth, project, committish, defaultRepresentation, opts) } -function fixupUnqualifiedGist (giturl) { - // necessary for round-tripping gists - var parsed = url.parse(giturl) - if (parsed.protocol === 'gist:' && parsed.host && !parsed.path) { - return parsed.protocol + '/' + parsed.host - } else { - return giturl +// accepts input like git:github.com:user/repo and inserts the // after the first : +const correctProtocol = (arg) => { + const firstColon = arg.indexOf(':') + const proto = arg.slice(0, firstColon + 1) + if (knownProtocols.includes(proto)) { + return arg } -} -function parseGitUrl (giturl) { - var matched = giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/) - if (!matched) { - var legacy = url.parse(giturl) - if (legacy.auth) { - // git urls can be in the form of scp-style/ssh-connect strings, like - // git+ssh://user@host.com:some/path, which the legacy url parser - // supports, but WhatWG url.URL class does not. However, the legacy - // parser de-urlencodes the username and password, so something like - // https://user%3An%40me:p%40ss%3Aword@x.com/ becomes - // https://user:n@me:p@ss:word@x.com/ which is all kinds of wrong. - // Pull off just the auth and host, so we dont' get the confusing - // scp-style URL, then pass that to the WhatWG parser to get the - // auth properly escaped. - const authmatch = giturl.match(/[^@]+@[^:/]+/) - /* istanbul ignore else - this should be impossible */ - if (authmatch) { - var whatwg = new url.URL(authmatch[0]) - legacy.auth = whatwg.username || '' - if (whatwg.password) legacy.auth += ':' + whatwg.password - } + const firstAt = arg.indexOf('@') + if (firstAt > -1) { + if (firstAt > firstColon) { + return `git+ssh://${arg}` + } else { + return arg } - return legacy } - return { - protocol: 'git+ssh:', - slashes: true, - auth: matched[1], - host: matched[2], - port: null, - hostname: matched[2], - hash: matched[4], - search: null, - query: null, - pathname: '/' + matched[3], - path: '/' + matched[3], - href: 'git+ssh://' + matched[1] + '@' + matched[2] + - '/' + matched[3] + (matched[4] || '') + + const doubleSlash = arg.indexOf('//') + if (doubleSlash === firstColon + 1) { + return arg + } + + return arg.slice(0, firstColon + 1) + '//' + arg.slice(firstColon + 1) +} + +// look for github shorthand inputs, such as npm/cli +const isGitHubShorthand = (arg) => { + // it cannot contain whitespace before the first # + // it cannot start with a / because that's probably an absolute file path + // but it must include a slash since repos are username/repository + // it cannot start with a . because that's probably a relative file path + // it cannot start with an @ because that's a scoped package if it passes the other tests + // it cannot contain a : before a # because that tells us that there's a protocol + // a second / may not exist before a # + const firstHash = arg.indexOf('#') + const firstSlash = arg.indexOf('/') + const secondSlash = arg.indexOf('/', firstSlash + 1) + const firstColon = arg.indexOf(':') + const firstSpace = /\s/.exec(arg) + const firstAt = arg.indexOf('@') + + const spaceOnlyAfterHash = !firstSpace || (firstHash > -1 && firstSpace.index > firstHash) + const atOnlyAfterHash = firstAt === -1 || (firstHash > -1 && firstAt > firstHash) + const colonOnlyAfterHash = firstColon === -1 || (firstHash > -1 && firstColon > firstHash) + const secondSlashOnlyAfterHash = secondSlash === -1 || (firstHash > -1 && secondSlash > firstHash) + const hasSlash = firstSlash > 0 + // if a # is found, what we really want to know is that the character immediately before # is not a / + const doesNotEndWithSlash = firstHash > -1 ? arg[firstHash - 1] !== '/' : !arg.endsWith('/') + const doesNotStartWithDot = !arg.startsWith('.') + + return spaceOnlyAfterHash && hasSlash && doesNotEndWithSlash && doesNotStartWithDot && atOnlyAfterHash && colonOnlyAfterHash && secondSlashOnlyAfterHash +} + +// attempt to correct an scp style url so that it will parse with `new URL()` +const correctUrl = (giturl) => { + const firstAt = giturl.indexOf('@') + const lastHash = giturl.lastIndexOf('#') + let firstColon = giturl.indexOf(':') + let lastColon = giturl.lastIndexOf(':', lastHash > -1 ? lastHash : Infinity) + + let corrected + if (lastColon > firstAt) { + // the last : comes after the first @ (or there is no @) + // like it would in: + // proto://hostname.com:user/repo + // username@hostname.com:user/repo + // :password@hostname.com:user/repo + // username:password@hostname.com:user/repo + // proto://username@hostname.com:user/repo + // proto://:password@hostname.com:user/repo + // proto://username:password@hostname.com:user/repo + // then we replace the last : with a / to create a valid path + corrected = giturl.slice(0, lastColon) + '/' + giturl.slice(lastColon + 1) + // // and we find our new : positions + firstColon = corrected.indexOf(':') + lastColon = corrected.lastIndexOf(':') + } + + if (firstColon === -1 && giturl.indexOf('//') === -1) { + // we have no : at all + // as it would be in: + // username@hostname.com/user/repo + // then we prepend a protocol + corrected = `git+ssh://${corrected}` + } + + return corrected +} + +// try to parse the url as its given to us, if that throws +// then we try to clean the url and parse that result instead +// THIS FUNCTION SHOULD NEVER THROW +const parseGitUrl = (giturl) => { + let result + try { + result = new url.URL(giturl) + } catch (err) {} + + if (result) { + return result } + + const correctedUrl = correctUrl(giturl) + try { + result = new url.URL(correctedUrl) + } catch (err) {} + + return result } diff --git a/deps/npm/node_modules/hosted-git-info/package.json b/deps/npm/node_modules/hosted-git-info/package.json index 32712269f04278..930e3b693b9801 100644 --- a/deps/npm/node_modules/hosted-git-info/package.json +++ b/deps/npm/node_modules/hosted-git-info/package.json @@ -1,7 +1,7 @@ { "name": "hosted-git-info", - "version": "3.0.8", - "description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab", + "version": "4.0.1", + "description": "Provides metadata and conversions from repository urls for GitHub, Bitbucket and GitLab", "main": "index.js", "repository": { "type": "git", @@ -20,20 +20,21 @@ }, "homepage": "https://github.com/npm/hosted-git-info", "scripts": { - "prerelease": "npm t", - "postrelease": "npm publish && git push --follow-tags", "posttest": "standard", - "release": "standard-version -s", - "test:coverage": "tap --coverage-report=html -J --100 --no-esm test/*.js", - "test": "tap -J --100 --no-esm test/*.js" + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "preversion": "npm test", + "snap": "tap", + "test": "tap", + "test:coverage": "tap --coverage-report=html" }, "dependencies": { "lru-cache": "^6.0.0" }, "devDependencies": { - "standard": "^11.0.1", - "standard-version": "^4.4.0", - "tap": "^12.7.0" + "standard": "^16.0.3", + "standard-version": "^9.1.0", + "tap": "^14.11.0" }, "files": [ "index.js", @@ -42,5 +43,10 @@ ], "engines": { "node": ">=10" + }, + "tap": { + "color": 1, + "coverage": true, + "esm": false } } diff --git a/deps/npm/node_modules/libnpmversion/lib/index.js b/deps/npm/node_modules/libnpmversion/lib/index.js index 525d8264e737a8..c3f554834bf81d 100644 --- a/deps/npm/node_modules/libnpmversion/lib/index.js +++ b/deps/npm/node_modules/libnpmversion/lib/index.js @@ -1,4 +1,4 @@ -const readJson = require('read-package-json-fast') +const readJson = require('./read-json.js') const version = require('./version.js') const proclog = require('./proc-log.js') diff --git a/deps/npm/node_modules/libnpmversion/lib/read-json.js b/deps/npm/node_modules/libnpmversion/lib/read-json.js new file mode 100644 index 00000000000000..0a1f64f2f70e7e --- /dev/null +++ b/deps/npm/node_modules/libnpmversion/lib/read-json.js @@ -0,0 +1,7 @@ +// can't use read-package-json-fast, because we want to ensure +// that we make as few changes as possible, even for safety issues. +const {promisify} = require('util') +const readFile = promisify(require('fs').readFile) +const parse = require('json-parse-even-better-errors') + +module.exports = async path => parse(await readFile(path)) diff --git a/deps/npm/node_modules/libnpmversion/lib/version.js b/deps/npm/node_modules/libnpmversion/lib/version.js index 31e6023f017a5a..0fe1ea6213fc6f 100644 --- a/deps/npm/node_modules/libnpmversion/lib/version.js +++ b/deps/npm/node_modules/libnpmversion/lib/version.js @@ -4,7 +4,7 @@ const retrieveTag = require('./retrieve-tag.js') const semver = require('semver') const enforceClean = require('./enforce-clean.js') const writeJson = require('./write-json.js') -const readJson = require('read-package-json-fast') +const readJson = require('./read-json.js') const git = require('@npmcli/git') const commit = require('./commit.js') const tag = require('./tag.js') diff --git a/deps/npm/node_modules/libnpmversion/package.json b/deps/npm/node_modules/libnpmversion/package.json index 3d15bbc2f7f72c..0135c21e7232cb 100644 --- a/deps/npm/node_modules/libnpmversion/package.json +++ b/deps/npm/node_modules/libnpmversion/package.json @@ -1,6 +1,6 @@ { "name": "libnpmversion", - "version": "1.0.11", + "version": "1.0.12", "main": "lib/index.js", "files": [ "lib/*.js" @@ -30,7 +30,7 @@ "dependencies": { "@npmcli/git": "^2.0.6", "@npmcli/run-script": "^1.8.3", - "read-package-json-fast": "^2.0.1", + "json-parse-even-better-errors": "^2.3.1", "semver": "^7.3.4", "stringify-package": "^1.0.1" } diff --git a/deps/npm/node_modules/normalize-package-data/README.md b/deps/npm/node_modules/normalize-package-data/README.md index d2bd7bc7ff6062..84da5e8bcf2ddd 100644 --- a/deps/npm/node_modules/normalize-package-data/README.md +++ b/deps/npm/node_modules/normalize-package-data/README.md @@ -1,4 +1,6 @@ -# normalize-package-data [![Build Status](https://travis-ci.org/npm/normalize-package-data.png?branch=master)](https://travis-ci.org/npm/normalize-package-data) +# normalize-package-data + +[![Build Status](https://travis-ci.org/npm/normalize-package-data.svg?branch=master)](https://travis-ci.org/npm/normalize-package-data) normalize-package-data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry. diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/CHANGELOG.md b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/CHANGELOG.md new file mode 100644 index 00000000000000..3ffcacacc575c0 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/CHANGELOG.md @@ -0,0 +1,185 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +## [3.0.8](https://github.com/npm/hosted-git-info/compare/v3.0.7...v3.0.8) (2021-01-28) + + +### Bug Fixes + +* simplify the regular expression for shortcut matching ([bede0dc](https://github.com/npm/hosted-git-info/commit/bede0dc)), closes [#76](https://github.com/npm/hosted-git-info/issues/76) + + + + +## [3.0.7](https://github.com/npm/hosted-git-info/compare/v3.0.6...v3.0.7) (2020-10-15) + + +### Bug Fixes + +* correctly filter out urls for tarballs in gitlab ([eb5bd5a](https://github.com/npm/hosted-git-info/commit/eb5bd5a)), closes [#69](https://github.com/npm/hosted-git-info/issues/69) + + + + +## [3.0.6](https://github.com/npm/hosted-git-info/compare/v3.0.5...v3.0.6) (2020-10-12) + + +### Bug Fixes + +* support to github gist legacy hash length ([c067102](https://github.com/npm/hosted-git-info/commit/c067102)), closes [#68](https://github.com/npm/hosted-git-info/issues/68) + + + + +## [3.0.5](https://github.com/npm/hosted-git-info/compare/v3.0.4...v3.0.5) (2020-07-11) + + + + +## [3.0.4](https://github.com/npm/hosted-git-info/compare/v3.0.3...v3.0.4) (2020-02-26) + + +### Bug Fixes + +* Do not pass scp-style URLs to the WhatWG url.URL ([0835306](https://github.com/npm/hosted-git-info/commit/0835306)), closes [#60](https://github.com/npm/hosted-git-info/issues/60) [#63](https://github.com/npm/hosted-git-info/issues/63) + + + + +## [3.0.3](https://github.com/npm/hosted-git-info/compare/v3.0.2...v3.0.3) (2020-02-25) + + + + +## [3.0.2](https://github.com/npm/hosted-git-info/compare/v3.0.1...v3.0.2) (2019-10-08) + + +### Bug Fixes + +* do not encodeURIComponent the domain ([3e5fbec](https://github.com/npm/hosted-git-info/commit/3e5fbec)), closes [#53](https://github.com/npm/hosted-git-info/issues/53) + + + + +## [3.0.1](https://github.com/npm/hosted-git-info/compare/v3.0.0...v3.0.1) (2019-10-07) + + +### Bug Fixes + +* update pathmatch for gitlab ([e3e3054](https://github.com/npm/hosted-git-info/commit/e3e3054)), closes [#52](https://github.com/npm/hosted-git-info/issues/52) +* updated pathmatch for gitlab ([fa87af7](https://github.com/npm/hosted-git-info/commit/fa87af7)) + + + + +# [3.0.0](https://github.com/npm/hosted-git-info/compare/v2.8.3...v3.0.0) (2019-08-12) + + +### Bug Fixes + +* **cache:** Switch to lru-cache to save ourselves from unlimited memory consumption ([37c2891](https://github.com/npm/hosted-git-info/commit/37c2891)), closes [#38](https://github.com/npm/hosted-git-info/issues/38) + + +### BREAKING CHANGES + +* **cache:** Drop support for node 0.x + + + + +## [2.8.3](https://github.com/npm/hosted-git-info/compare/v2.8.2...v2.8.3) (2019-08-12) + + + + +## [2.8.2](https://github.com/npm/hosted-git-info/compare/v2.8.1...v2.8.2) (2019-08-05) + + +### Bug Fixes + +* http protocol use sshurl by default ([3b1d629](https://github.com/npm/hosted-git-info/commit/3b1d629)), closes [#48](https://github.com/npm/hosted-git-info/issues/48) + + + + +## [2.8.1](https://github.com/npm/hosted-git-info/compare/v2.8.0...v2.8.1) (2019-08-05) + + +### Bug Fixes + +* ignore noCommittish on tarball url generation ([5d4a8d7](https://github.com/npm/hosted-git-info/commit/5d4a8d7)) +* use gist tarball url that works for anonymous gists ([1692435](https://github.com/npm/hosted-git-info/commit/1692435)) + + + + +# [2.8.0](https://github.com/npm/hosted-git-info/compare/v2.7.1...v2.8.0) (2019-08-05) + + +### Bug Fixes + +* Allow slashes in gitlab project section ([bbcf7b2](https://github.com/npm/hosted-git-info/commit/bbcf7b2)), closes [#46](https://github.com/npm/hosted-git-info/issues/46) [#43](https://github.com/npm/hosted-git-info/issues/43) +* **git-host:** disallow URI-encoded slash (%2F) in `path` ([3776fa5](https://github.com/npm/hosted-git-info/commit/3776fa5)), closes [#44](https://github.com/npm/hosted-git-info/issues/44) +* **gitlab:** Do not URL encode slashes in project name for GitLab https URL ([cbf04f9](https://github.com/npm/hosted-git-info/commit/cbf04f9)), closes [#47](https://github.com/npm/hosted-git-info/issues/47) +* do not allow invalid gist urls ([d5cf830](https://github.com/npm/hosted-git-info/commit/d5cf830)) +* **cache:** Switch to lru-cache to save ourselves from unlimited memory consumption ([e518222](https://github.com/npm/hosted-git-info/commit/e518222)), closes [#38](https://github.com/npm/hosted-git-info/issues/38) + + +### Features + +* give these objects a name ([60abaea](https://github.com/npm/hosted-git-info/commit/60abaea)) + + + + +## [2.7.1](https://github.com/npm/hosted-git-info/compare/v2.7.0...v2.7.1) (2018-07-07) + + +### Bug Fixes + +* **index:** Guard against non-string types ([5bc580d](https://github.com/npm/hosted-git-info/commit/5bc580d)) +* **parse:** Crash on strings that parse to having no host ([c931482](https://github.com/npm/hosted-git-info/commit/c931482)), closes [#35](https://github.com/npm/hosted-git-info/issues/35) + + + + +# [2.7.0](https://github.com/npm/hosted-git-info/compare/v2.6.1...v2.7.0) (2018-07-06) + + +### Bug Fixes + +* **github tarball:** update github tarballtemplate ([6efd582](https://github.com/npm/hosted-git-info/commit/6efd582)), closes [#34](https://github.com/npm/hosted-git-info/issues/34) +* **gitlab docs:** switched to lowercase anchors for readmes ([701bcd1](https://github.com/npm/hosted-git-info/commit/701bcd1)) + + +### Features + +* **all:** Support www. prefixes on hostnames ([3349575](https://github.com/npm/hosted-git-info/commit/3349575)), closes [#32](https://github.com/npm/hosted-git-info/issues/32) + + + + +## [2.6.1](https://github.com/npm/hosted-git-info/compare/v2.6.0...v2.6.1) (2018-06-25) + +### Bug Fixes + +* **Revert:** "compat: remove Object.assign fallback ([#25](https://github.com/npm/hosted-git-info/issues/25))" ([cce5a62](https://github.com/npm/hosted-git-info/commit/cce5a62)) +* **Revert:** "git-host: fix forgotten extend()" ([a815ec9](https://github.com/npm/hosted-git-info/commit/a815ec9)) + + + + +# [2.6.0](https://github.com/npm/hosted-git-info/compare/v2.5.0...v2.6.0) (2018-03-07) + + +### Bug Fixes + +* **compat:** remove Object.assign fallback ([#25](https://github.com/npm/hosted-git-info/issues/25)) ([627ab55](https://github.com/npm/hosted-git-info/commit/627ab55)) +* **git-host:** fix forgotten extend() ([eba1f7b](https://github.com/npm/hosted-git-info/commit/eba1f7b)) + + +### Features + +* **browse:** fragment support for browse() ([#28](https://github.com/npm/hosted-git-info/issues/28)) ([cd5e5bb](https://github.com/npm/hosted-git-info/commit/cd5e5bb)) diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/LICENSE b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/LICENSE new file mode 100644 index 00000000000000..45055763dc838d --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/README.md b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/README.md new file mode 100644 index 00000000000000..87404060296269 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/README.md @@ -0,0 +1,133 @@ +# hosted-git-info + +This will let you identify and transform various git hosts URLs between +protocols. It also can tell you what the URL is for the raw path for +particular file for direct access without git. + +## Example + +```javascript +var hostedGitInfo = require("hosted-git-info") +var info = hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git", opts) +/* info looks like: +{ + type: "github", + domain: "github.com", + user: "npm", + project: "hosted-git-info" +} +*/ +``` + +If the URL can't be matched with a git host, `null` will be returned. We +can match git, ssh and https urls. Additionally, we can match ssh connect +strings (`git@github.com:npm/hosted-git-info`) and shortcuts (eg, +`github:npm/hosted-git-info`). GitHub specifically, is detected in the case +of a third, unprefixed, form: `npm/hosted-git-info`. + +If it does match, the returned object has properties of: + +* info.type -- The short name of the service +* info.domain -- The domain for git protocol use +* info.user -- The name of the user/org on the git host +* info.project -- The name of the project on the git host + +## Version Contract + +The major version will be bumped any time… + +* The constructor stops accepting URLs that it previously accepted. +* A method is removed. +* A method can no longer accept the number and type of arguments it previously accepted. +* A method can return a different type than it currently returns. + +Implications: + +* I do not consider the specific format of the urls returned from, say + `.https()` to be a part of the contract. The contract is that it will + return a string that can be used to fetch the repo via HTTPS. But what + that string looks like, specifically, can change. +* Dropping support for a hosted git provider would constitute a breaking + change. + +## Usage + +### var info = hostedGitInfo.fromUrl(gitSpecifier[, options]) + +* *gitSpecifer* is a URL of a git repository or a SCP-style specifier of one. +* *options* is an optional object. It can have the following properties: + * *noCommittish* — If true then committishes won't be included in generated URLs. + * *noGitPlus* — If true then `git+` won't be prefixed on URLs. + +## Methods + +All of the methods take the same options as the `fromUrl` factory. Options +provided to a method override those provided to the constructor. + +* info.file(path, opts) + +Given the path of a file relative to the repository, returns a URL for +directly fetching it from the githost. If no committish was set then +`master` will be used as the default. + +For example `hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git#v1.0.0").file("package.json")` +would return `https://raw.githubusercontent.com/npm/hosted-git-info/v1.0.0/package.json` + +* info.shortcut(opts) + +eg, `github:npm/hosted-git-info` + +* info.browse(path, fragment, opts) + +eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0`, +`https://github.com/npm/hosted-git-info/tree/v1.2.0/package.json`, +`https://github.com/npm/hosted-git-info/tree/v1.2.0/REAMDE.md#supported-hosts` + +* info.bugs(opts) + +eg, `https://github.com/npm/hosted-git-info/issues` + +* info.docs(opts) + +eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0#readme` + +* info.https(opts) + +eg, `git+https://github.com/npm/hosted-git-info.git` + +* info.sshurl(opts) + +eg, `git+ssh://git@github.com/npm/hosted-git-info.git` + +* info.ssh(opts) + +eg, `git@github.com:npm/hosted-git-info.git` + +* info.path(opts) + +eg, `npm/hosted-git-info` + +* info.tarball(opts) + +eg, `https://github.com/npm/hosted-git-info/archive/v1.2.0.tar.gz` + +* info.getDefaultRepresentation() + +Returns the default output type. The default output type is based on the +string you passed in to be parsed + +* info.toString(opts) + +Uses the getDefaultRepresentation to call one of the other methods to get a URL for +this resource. As such `hostedGitInfo.fromUrl(url).toString()` will give +you a normalized version of the URL that still uses the same protocol. + +Shortcuts will still be returned as shortcuts, but the special case github +form of `org/project` will be normalized to `github:org/project`. + +SSH connect strings will be normalized into `git+ssh` URLs. + +## Supported hosts + +Currently this supports GitHub, Bitbucket and GitLab. Pull requests for +additional hosts welcome. diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/git-host-info.js b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/git-host-info.js new file mode 100644 index 00000000000000..360d7b096be617 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/git-host-info.js @@ -0,0 +1,154 @@ +'use strict' +const maybeJoin = (...args) => args.every(arg => arg) ? args.join('') : '' +const maybeEncode = (arg) => arg ? encodeURIComponent(arg) : '' + +const defaults = { + sshtemplate: ({ domain, user, project, committish }) => `git@${domain}:${user}/${project}.git${maybeJoin('#', committish)}`, + sshurltemplate: ({ domain, user, project, committish }) => `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, + browsetemplate: ({ domain, user, project, committish, treepath }) => `https://${domain}/${user}/${project}${maybeJoin('/', treepath, '/', maybeEncode(committish))}`, + browsefiletemplate: ({ domain, user, project, committish, treepath, path, fragment, hashformat }) => `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || 'master')}/${path}${maybeJoin('#', hashformat(fragment || ''))}`, + docstemplate: ({ domain, user, project, treepath, committish }) => `https://${domain}/${user}/${project}${maybeJoin('/', treepath, '/', maybeEncode(committish))}#readme`, + httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, + filetemplate: ({ domain, user, project, committish, path }) => `https://${domain}/${user}/${project}/raw/${maybeEncode(committish) || 'master'}/${path}`, + shortcuttemplate: ({ type, user, project, committish }) => `${type}:${user}/${project}${maybeJoin('#', committish)}`, + pathtemplate: ({ user, project, committish }) => `${user}/${project}${maybeJoin('#', committish)}`, + bugstemplate: ({ domain, user, project }) => `https://${domain}/${user}/${project}/issues`, + hashformat: formatHashFragment +} + +const gitHosts = {} +gitHosts.github = Object.assign({}, defaults, { + // First two are insecure and generally shouldn't be used any more, but + // they are still supported. + protocols: ['git:', 'http:', 'git+ssh:', 'git+https:', 'ssh:', 'https:'], + domain: 'github.com', + treepath: 'tree', + filetemplate: ({ auth, user, project, committish, path }) => `https://${maybeJoin(auth, '@')}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish) || 'master'}/${path}`, + gittemplate: ({ auth, domain, user, project, committish }) => `git://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, + tarballtemplate: ({ domain, user, project, committish }) => `https://codeload.${domain}/${user}/${project}/tar.gz/${maybeEncode(committish) || 'master'}`, + extract: (url) => { + let [, user, project, type, committish] = url.pathname.split('/', 5) + if (type && type !== 'tree') { + return + } + + if (!type) { + committish = url.hash.slice(1) + } + + if (project && project.endsWith('.git')) { + project = project.slice(0, -4) + } + + if (!user || !project) { + return + } + + return { user, project, committish } + } +}) + +gitHosts.bitbucket = Object.assign({}, defaults, { + protocols: ['git+ssh:', 'git+https:', 'ssh:', 'https:'], + domain: 'bitbucket.org', + treepath: 'src', + tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/get/${maybeEncode(committish) || 'master'}.tar.gz`, + extract: (url) => { + let [, user, project, aux] = url.pathname.split('/', 4) + if (['get'].includes(aux)) { + return + } + + if (project && project.endsWith('.git')) { + project = project.slice(0, -4) + } + + if (!user || !project) { + return + } + + return { user, project, committish: url.hash.slice(1) } + } +}) + +gitHosts.gitlab = Object.assign({}, defaults, { + protocols: ['git+ssh:', 'git+https:', 'ssh:', 'https:'], + domain: 'gitlab.com', + treepath: 'tree', + httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, + tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/repository/archive.tar.gz?ref=${maybeEncode(committish) || 'master'}`, + extract: (url) => { + const path = url.pathname.slice(1) + if (path.includes('/-/')) { + return + } + + const segments = path.split('/') + let project = segments.pop() + if (project.endsWith('.git')) { + project = project.slice(0, -4) + } + + const user = segments.join('/') + if (!user || !project) { + return + } + + return { user, project, committish: url.hash.slice(1) } + } +}) + +gitHosts.gist = Object.assign({}, defaults, { + protocols: ['git:', 'git+ssh:', 'git+https:', 'ssh:', 'https:'], + domain: 'gist.github.com', + sshtemplate: ({ domain, project, committish }) => `git@${domain}:${project}.git${maybeJoin('#', committish)}`, + sshurltemplate: ({ domain, project, committish }) => `git+ssh://git@${domain}/${project}.git${maybeJoin('#', committish)}`, + browsetemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}`, + browsefiletemplate: ({ domain, project, committish, path, hashformat }) => `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}${maybeJoin('#', hashformat(path))}`, + docstemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}`, + httpstemplate: ({ domain, project, committish }) => `git+https://${domain}/${project}.git${maybeJoin('#', committish)}`, + filetemplate: ({ user, project, committish, path }) => `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin('/', maybeEncode(committish))}/${path}`, + shortcuttemplate: ({ type, project, committish }) => `${type}:${project}${maybeJoin('#', committish)}`, + pathtemplate: ({ project, committish }) => `${project}${maybeJoin('#', committish)}`, + bugstemplate: ({ domain, project }) => `https://${domain}/${project}`, + gittemplate: ({ domain, project, committish }) => `git://${domain}/${project}.git${maybeJoin('#', committish)}`, + tarballtemplate: ({ project, committish }) => `https://codeload.github.com/gist/${project}/tar.gz/${maybeEncode(committish) || 'master'}`, + extract: (url) => { + let [, user, project, aux] = url.pathname.split('/', 4) + if (aux === 'raw') { + return + } + + if (!project) { + if (!user) { + return + } + + project = user + user = null + } + + if (project.endsWith('.git')) { + project = project.slice(0, -4) + } + + return { user, project, committish: url.hash.slice(1) } + }, + hashformat: function (fragment) { + return fragment && 'file-' + formatHashFragment(fragment) + } +}) + +const names = Object.keys(gitHosts) +gitHosts.byShortcut = {} +gitHosts.byDomain = {} +for (const name of names) { + gitHosts.byShortcut[`${name}:`] = name + gitHosts.byDomain[gitHosts[name].domain] = name +} + +function formatHashFragment (fragment) { + return fragment.toLowerCase().replace(/^\W+|\/|\W+$/g, '').replace(/\W+/g, '-') +} + +module.exports = gitHosts diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/git-host.js b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/git-host.js new file mode 100644 index 00000000000000..8a975e92e58bb7 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/git-host.js @@ -0,0 +1,110 @@ +'use strict' +const gitHosts = require('./git-host-info.js') + +class GitHost { + constructor (type, user, auth, project, committish, defaultRepresentation, opts = {}) { + Object.assign(this, gitHosts[type]) + this.type = type + this.user = user + this.auth = auth + this.project = project + this.committish = committish + this.default = defaultRepresentation + this.opts = opts + } + + hash () { + return this.committish ? `#${this.committish}` : '' + } + + ssh (opts) { + return this._fill(this.sshtemplate, opts) + } + + _fill (template, opts) { + if (typeof template === 'function') { + const options = { ...this, ...this.opts, ...opts } + + // the path should always be set so we don't end up with 'undefined' in urls + if (!options.path) { + options.path = '' + } + + // template functions will insert the leading slash themselves + if (options.path.startsWith('/')) { + options.path = options.path.slice(1) + } + + if (options.noCommittish) { + options.committish = null + } + + const result = template(options) + return options.noGitPlus && result.startsWith('git+') ? result.slice(4) : result + } + + return null + } + + sshurl (opts) { + return this._fill(this.sshurltemplate, opts) + } + + browse (path, fragment, opts) { + // not a string, treat path as opts + if (typeof path !== 'string') { + return this._fill(this.browsetemplate, path) + } + + if (typeof fragment !== 'string') { + opts = fragment + fragment = null + } + return this._fill(this.browsefiletemplate, { ...opts, fragment, path }) + } + + docs (opts) { + return this._fill(this.docstemplate, opts) + } + + bugs (opts) { + return this._fill(this.bugstemplate, opts) + } + + https (opts) { + return this._fill(this.httpstemplate, opts) + } + + git (opts) { + return this._fill(this.gittemplate, opts) + } + + shortcut (opts) { + return this._fill(this.shortcuttemplate, opts) + } + + path (opts) { + return this._fill(this.pathtemplate, opts) + } + + tarball (opts) { + return this._fill(this.tarballtemplate, { ...opts, noCommittish: false }) + } + + file (path, opts) { + return this._fill(this.filetemplate, { ...opts, path }) + } + + getDefaultRepresentation () { + return this.default + } + + toString (opts) { + if (this.default && typeof this[this.default] === 'function') { + return this[this.default](opts) + } + + return this.sshurl(opts) + } +} +module.exports = GitHost diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/index.js b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/index.js new file mode 100644 index 00000000000000..f35c570c46b595 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/index.js @@ -0,0 +1,237 @@ +'use strict' +const url = require('url') +const gitHosts = require('./git-host-info.js') +const GitHost = module.exports = require('./git-host.js') +const LRU = require('lru-cache') +const cache = new LRU({ max: 1000 }) + +const protocolToRepresentationMap = { + 'git+ssh:': 'sshurl', + 'git+https:': 'https', + 'ssh:': 'sshurl', + 'git:': 'git' +} + +function protocolToRepresentation (protocol) { + return protocolToRepresentationMap[protocol] || protocol.slice(0, -1) +} + +const authProtocols = { + 'git:': true, + 'https:': true, + 'git+https:': true, + 'http:': true, + 'git+http:': true +} + +const knownProtocols = Object.keys(gitHosts.byShortcut).concat(['http:', 'https:', 'git:', 'git+ssh:', 'git+https:', 'ssh:']) + +module.exports.fromUrl = function (giturl, opts) { + if (typeof giturl !== 'string') { + return + } + + const key = giturl + JSON.stringify(opts || {}) + + if (!cache.has(key)) { + cache.set(key, fromUrl(giturl, opts)) + } + + return cache.get(key) +} + +function fromUrl (giturl, opts) { + if (!giturl) { + return + } + + const url = isGitHubShorthand(giturl) ? 'github:' + giturl : correctProtocol(giturl) + const parsed = parseGitUrl(url) + if (!parsed) { + return parsed + } + + const gitHostShortcut = gitHosts.byShortcut[parsed.protocol] + const gitHostDomain = gitHosts.byDomain[parsed.hostname.startsWith('www.') ? parsed.hostname.slice(4) : parsed.hostname] + const gitHostName = gitHostShortcut || gitHostDomain + if (!gitHostName) { + return + } + + const gitHostInfo = gitHosts[gitHostShortcut || gitHostDomain] + let auth = null + if (authProtocols[parsed.protocol] && (parsed.username || parsed.password)) { + auth = `${parsed.username}${parsed.password ? ':' + parsed.password : ''}` + } + + let committish = null + let user = null + let project = null + let defaultRepresentation = null + + try { + if (gitHostShortcut) { + let pathname = parsed.pathname.startsWith('/') ? parsed.pathname.slice(1) : parsed.pathname + const firstAt = pathname.indexOf('@') + // we ignore auth for shortcuts, so just trim it out + if (firstAt > -1) { + pathname = pathname.slice(firstAt + 1) + } + + const lastSlash = pathname.lastIndexOf('/') + if (lastSlash > -1) { + user = decodeURIComponent(pathname.slice(0, lastSlash)) + // we want nulls only, never empty strings + if (!user) { + user = null + } + project = decodeURIComponent(pathname.slice(lastSlash + 1)) + } else { + project = decodeURIComponent(pathname) + } + + if (project.endsWith('.git')) { + project = project.slice(0, -4) + } + + if (parsed.hash) { + committish = decodeURIComponent(parsed.hash.slice(1)) + } + + defaultRepresentation = 'shortcut' + } else { + if (!gitHostInfo.protocols.includes(parsed.protocol)) { + return + } + + const segments = gitHostInfo.extract(parsed) + if (!segments) { + return + } + + user = segments.user && decodeURIComponent(segments.user) + project = decodeURIComponent(segments.project) + committish = decodeURIComponent(segments.committish) + defaultRepresentation = protocolToRepresentation(parsed.protocol) + } + } catch (err) { + /* istanbul ignore else */ + if (err instanceof URIError) { + return + } else { + throw err + } + } + + return new GitHost(gitHostName, user, auth, project, committish, defaultRepresentation, opts) +} + +// accepts input like git:github.com:user/repo and inserts the // after the first : +const correctProtocol = (arg) => { + const firstColon = arg.indexOf(':') + const proto = arg.slice(0, firstColon + 1) + if (knownProtocols.includes(proto)) { + return arg + } + + const firstAt = arg.indexOf('@') + if (firstAt > -1) { + if (firstAt > firstColon) { + return `git+ssh://${arg}` + } else { + return arg + } + } + + const doubleSlash = arg.indexOf('//') + if (doubleSlash === firstColon + 1) { + return arg + } + + return arg.slice(0, firstColon + 1) + '//' + arg.slice(firstColon + 1) +} + +// look for github shorthand inputs, such as npm/cli +const isGitHubShorthand = (arg) => { + // it cannot contain whitespace before the first # + // it cannot start with a / because that's probably an absolute file path + // but it must include a slash since repos are username/repository + // it cannot start with a . because that's probably a relative file path + // it cannot start with an @ because that's a scoped package if it passes the other tests + // it cannot contain a : before a # because that tells us that there's a protocol + // a second / may not exist before a # + const firstHash = arg.indexOf('#') + const firstSlash = arg.indexOf('/') + const secondSlash = arg.indexOf('/', firstSlash + 1) + const firstColon = arg.indexOf(':') + const firstSpace = /\s/.exec(arg) + const firstAt = arg.indexOf('@') + + const spaceOnlyAfterHash = !firstSpace || (firstHash > -1 && firstSpace.index > firstHash) + const atOnlyAfterHash = firstAt === -1 || (firstHash > -1 && firstAt > firstHash) + const colonOnlyAfterHash = firstColon === -1 || (firstHash > -1 && firstColon > firstHash) + const secondSlashOnlyAfterHash = secondSlash === -1 || (firstHash > -1 && secondSlash > firstHash) + const hasSlash = firstSlash > 0 + // if a # is found, what we really want to know is that the character immediately before # is not a / + const doesNotEndWithSlash = firstHash > -1 ? arg[firstHash - 1] !== '/' : !arg.endsWith('/') + const doesNotStartWithDot = !arg.startsWith('.') + + return spaceOnlyAfterHash && hasSlash && doesNotEndWithSlash && doesNotStartWithDot && atOnlyAfterHash && colonOnlyAfterHash && secondSlashOnlyAfterHash +} + +// attempt to correct an scp style url so that it will parse with `new URL()` +const correctUrl = (giturl) => { + const firstAt = giturl.indexOf('@') + const lastHash = giturl.lastIndexOf('#') + let firstColon = giturl.indexOf(':') + let lastColon = giturl.lastIndexOf(':', lastHash > -1 ? lastHash : Infinity) + + let corrected + if (lastColon > firstAt) { + // the last : comes after the first @ (or there is no @) + // like it would in: + // proto://hostname.com:user/repo + // username@hostname.com:user/repo + // :password@hostname.com:user/repo + // username:password@hostname.com:user/repo + // proto://username@hostname.com:user/repo + // proto://:password@hostname.com:user/repo + // proto://username:password@hostname.com:user/repo + // then we replace the last : with a / to create a valid path + corrected = giturl.slice(0, lastColon) + '/' + giturl.slice(lastColon + 1) + // // and we find our new : positions + firstColon = corrected.indexOf(':') + lastColon = corrected.lastIndexOf(':') + } + + if (firstColon === -1 && giturl.indexOf('//') === -1) { + // we have no : at all + // as it would be in: + // username@hostname.com/user/repo + // then we prepend a protocol + corrected = `git+ssh://${corrected}` + } + + return corrected +} + +// try to parse the url as its given to us, if that throws +// then we try to clean the url and parse that result instead +// THIS FUNCTION SHOULD NEVER THROW +const parseGitUrl = (giturl) => { + let result + try { + result = new url.URL(giturl) + } catch (err) {} + + if (result) { + return result + } + + const correctedUrl = correctUrl(giturl) + try { + result = new url.URL(correctedUrl) + } catch (err) {} + + return result +} diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/package.json b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/package.json new file mode 100644 index 00000000000000..930e3b693b9801 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/package.json @@ -0,0 +1,52 @@ +{ + "name": "hosted-git-info", + "version": "4.0.1", + "description": "Provides metadata and conversions from repository urls for GitHub, Bitbucket and GitLab", + "main": "index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/hosted-git-info.git" + }, + "keywords": [ + "git", + "github", + "bitbucket", + "gitlab" + ], + "author": "Rebecca Turner (http://re-becca.org)", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/hosted-git-info/issues" + }, + "homepage": "https://github.com/npm/hosted-git-info", + "scripts": { + "posttest": "standard", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "preversion": "npm test", + "snap": "tap", + "test": "tap", + "test:coverage": "tap --coverage-report=html" + }, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "devDependencies": { + "standard": "^16.0.3", + "standard-version": "^9.1.0", + "tap": "^14.11.0" + }, + "files": [ + "index.js", + "git-host.js", + "git-host-info.js" + ], + "engines": { + "node": ">=10" + }, + "tap": { + "color": 1, + "coverage": true, + "esm": false + } +} diff --git a/deps/npm/node_modules/normalize-package-data/package.json b/deps/npm/node_modules/normalize-package-data/package.json index 8df2f8fcac21e7..09b184c19d563e 100644 --- a/deps/npm/node_modules/normalize-package-data/package.json +++ b/deps/npm/node_modules/normalize-package-data/package.json @@ -1,6 +1,6 @@ { "name": "normalize-package-data", - "version": "3.0.0", + "version": "3.0.2", "author": "Meryn Stol ", "description": "Normalizes data that can be found in package.json files.", "license": "BSD-2-Clause", @@ -10,16 +10,19 @@ }, "main": "lib/normalize.js", "scripts": { + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "preversion": "npm test", "test": "tap test/*.js" }, "dependencies": { - "hosted-git-info": "^3.0.6", - "resolve": "^1.17.0", - "semver": "^7.3.2", + "hosted-git-info": "^4.0.1", + "resolve": "^1.20.0", + "semver": "^7.3.4", "validate-npm-package-license": "^3.0.1" }, "devDependencies": { - "tap": "^14.10.8" + "tap": "^14.11.0" }, "files": [ "lib/*.js", diff --git a/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/CHANGELOG.md b/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/CHANGELOG.md new file mode 100644 index 00000000000000..3ffcacacc575c0 --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/CHANGELOG.md @@ -0,0 +1,185 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +## [3.0.8](https://github.com/npm/hosted-git-info/compare/v3.0.7...v3.0.8) (2021-01-28) + + +### Bug Fixes + +* simplify the regular expression for shortcut matching ([bede0dc](https://github.com/npm/hosted-git-info/commit/bede0dc)), closes [#76](https://github.com/npm/hosted-git-info/issues/76) + + + + +## [3.0.7](https://github.com/npm/hosted-git-info/compare/v3.0.6...v3.0.7) (2020-10-15) + + +### Bug Fixes + +* correctly filter out urls for tarballs in gitlab ([eb5bd5a](https://github.com/npm/hosted-git-info/commit/eb5bd5a)), closes [#69](https://github.com/npm/hosted-git-info/issues/69) + + + + +## [3.0.6](https://github.com/npm/hosted-git-info/compare/v3.0.5...v3.0.6) (2020-10-12) + + +### Bug Fixes + +* support to github gist legacy hash length ([c067102](https://github.com/npm/hosted-git-info/commit/c067102)), closes [#68](https://github.com/npm/hosted-git-info/issues/68) + + + + +## [3.0.5](https://github.com/npm/hosted-git-info/compare/v3.0.4...v3.0.5) (2020-07-11) + + + + +## [3.0.4](https://github.com/npm/hosted-git-info/compare/v3.0.3...v3.0.4) (2020-02-26) + + +### Bug Fixes + +* Do not pass scp-style URLs to the WhatWG url.URL ([0835306](https://github.com/npm/hosted-git-info/commit/0835306)), closes [#60](https://github.com/npm/hosted-git-info/issues/60) [#63](https://github.com/npm/hosted-git-info/issues/63) + + + + +## [3.0.3](https://github.com/npm/hosted-git-info/compare/v3.0.2...v3.0.3) (2020-02-25) + + + + +## [3.0.2](https://github.com/npm/hosted-git-info/compare/v3.0.1...v3.0.2) (2019-10-08) + + +### Bug Fixes + +* do not encodeURIComponent the domain ([3e5fbec](https://github.com/npm/hosted-git-info/commit/3e5fbec)), closes [#53](https://github.com/npm/hosted-git-info/issues/53) + + + + +## [3.0.1](https://github.com/npm/hosted-git-info/compare/v3.0.0...v3.0.1) (2019-10-07) + + +### Bug Fixes + +* update pathmatch for gitlab ([e3e3054](https://github.com/npm/hosted-git-info/commit/e3e3054)), closes [#52](https://github.com/npm/hosted-git-info/issues/52) +* updated pathmatch for gitlab ([fa87af7](https://github.com/npm/hosted-git-info/commit/fa87af7)) + + + + +# [3.0.0](https://github.com/npm/hosted-git-info/compare/v2.8.3...v3.0.0) (2019-08-12) + + +### Bug Fixes + +* **cache:** Switch to lru-cache to save ourselves from unlimited memory consumption ([37c2891](https://github.com/npm/hosted-git-info/commit/37c2891)), closes [#38](https://github.com/npm/hosted-git-info/issues/38) + + +### BREAKING CHANGES + +* **cache:** Drop support for node 0.x + + + + +## [2.8.3](https://github.com/npm/hosted-git-info/compare/v2.8.2...v2.8.3) (2019-08-12) + + + + +## [2.8.2](https://github.com/npm/hosted-git-info/compare/v2.8.1...v2.8.2) (2019-08-05) + + +### Bug Fixes + +* http protocol use sshurl by default ([3b1d629](https://github.com/npm/hosted-git-info/commit/3b1d629)), closes [#48](https://github.com/npm/hosted-git-info/issues/48) + + + + +## [2.8.1](https://github.com/npm/hosted-git-info/compare/v2.8.0...v2.8.1) (2019-08-05) + + +### Bug Fixes + +* ignore noCommittish on tarball url generation ([5d4a8d7](https://github.com/npm/hosted-git-info/commit/5d4a8d7)) +* use gist tarball url that works for anonymous gists ([1692435](https://github.com/npm/hosted-git-info/commit/1692435)) + + + + +# [2.8.0](https://github.com/npm/hosted-git-info/compare/v2.7.1...v2.8.0) (2019-08-05) + + +### Bug Fixes + +* Allow slashes in gitlab project section ([bbcf7b2](https://github.com/npm/hosted-git-info/commit/bbcf7b2)), closes [#46](https://github.com/npm/hosted-git-info/issues/46) [#43](https://github.com/npm/hosted-git-info/issues/43) +* **git-host:** disallow URI-encoded slash (%2F) in `path` ([3776fa5](https://github.com/npm/hosted-git-info/commit/3776fa5)), closes [#44](https://github.com/npm/hosted-git-info/issues/44) +* **gitlab:** Do not URL encode slashes in project name for GitLab https URL ([cbf04f9](https://github.com/npm/hosted-git-info/commit/cbf04f9)), closes [#47](https://github.com/npm/hosted-git-info/issues/47) +* do not allow invalid gist urls ([d5cf830](https://github.com/npm/hosted-git-info/commit/d5cf830)) +* **cache:** Switch to lru-cache to save ourselves from unlimited memory consumption ([e518222](https://github.com/npm/hosted-git-info/commit/e518222)), closes [#38](https://github.com/npm/hosted-git-info/issues/38) + + +### Features + +* give these objects a name ([60abaea](https://github.com/npm/hosted-git-info/commit/60abaea)) + + + + +## [2.7.1](https://github.com/npm/hosted-git-info/compare/v2.7.0...v2.7.1) (2018-07-07) + + +### Bug Fixes + +* **index:** Guard against non-string types ([5bc580d](https://github.com/npm/hosted-git-info/commit/5bc580d)) +* **parse:** Crash on strings that parse to having no host ([c931482](https://github.com/npm/hosted-git-info/commit/c931482)), closes [#35](https://github.com/npm/hosted-git-info/issues/35) + + + + +# [2.7.0](https://github.com/npm/hosted-git-info/compare/v2.6.1...v2.7.0) (2018-07-06) + + +### Bug Fixes + +* **github tarball:** update github tarballtemplate ([6efd582](https://github.com/npm/hosted-git-info/commit/6efd582)), closes [#34](https://github.com/npm/hosted-git-info/issues/34) +* **gitlab docs:** switched to lowercase anchors for readmes ([701bcd1](https://github.com/npm/hosted-git-info/commit/701bcd1)) + + +### Features + +* **all:** Support www. prefixes on hostnames ([3349575](https://github.com/npm/hosted-git-info/commit/3349575)), closes [#32](https://github.com/npm/hosted-git-info/issues/32) + + + + +## [2.6.1](https://github.com/npm/hosted-git-info/compare/v2.6.0...v2.6.1) (2018-06-25) + +### Bug Fixes + +* **Revert:** "compat: remove Object.assign fallback ([#25](https://github.com/npm/hosted-git-info/issues/25))" ([cce5a62](https://github.com/npm/hosted-git-info/commit/cce5a62)) +* **Revert:** "git-host: fix forgotten extend()" ([a815ec9](https://github.com/npm/hosted-git-info/commit/a815ec9)) + + + + +# [2.6.0](https://github.com/npm/hosted-git-info/compare/v2.5.0...v2.6.0) (2018-03-07) + + +### Bug Fixes + +* **compat:** remove Object.assign fallback ([#25](https://github.com/npm/hosted-git-info/issues/25)) ([627ab55](https://github.com/npm/hosted-git-info/commit/627ab55)) +* **git-host:** fix forgotten extend() ([eba1f7b](https://github.com/npm/hosted-git-info/commit/eba1f7b)) + + +### Features + +* **browse:** fragment support for browse() ([#28](https://github.com/npm/hosted-git-info/issues/28)) ([cd5e5bb](https://github.com/npm/hosted-git-info/commit/cd5e5bb)) diff --git a/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/LICENSE b/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/LICENSE new file mode 100644 index 00000000000000..45055763dc838d --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/README.md b/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/README.md new file mode 100644 index 00000000000000..87404060296269 --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/README.md @@ -0,0 +1,133 @@ +# hosted-git-info + +This will let you identify and transform various git hosts URLs between +protocols. It also can tell you what the URL is for the raw path for +particular file for direct access without git. + +## Example + +```javascript +var hostedGitInfo = require("hosted-git-info") +var info = hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git", opts) +/* info looks like: +{ + type: "github", + domain: "github.com", + user: "npm", + project: "hosted-git-info" +} +*/ +``` + +If the URL can't be matched with a git host, `null` will be returned. We +can match git, ssh and https urls. Additionally, we can match ssh connect +strings (`git@github.com:npm/hosted-git-info`) and shortcuts (eg, +`github:npm/hosted-git-info`). GitHub specifically, is detected in the case +of a third, unprefixed, form: `npm/hosted-git-info`. + +If it does match, the returned object has properties of: + +* info.type -- The short name of the service +* info.domain -- The domain for git protocol use +* info.user -- The name of the user/org on the git host +* info.project -- The name of the project on the git host + +## Version Contract + +The major version will be bumped any time… + +* The constructor stops accepting URLs that it previously accepted. +* A method is removed. +* A method can no longer accept the number and type of arguments it previously accepted. +* A method can return a different type than it currently returns. + +Implications: + +* I do not consider the specific format of the urls returned from, say + `.https()` to be a part of the contract. The contract is that it will + return a string that can be used to fetch the repo via HTTPS. But what + that string looks like, specifically, can change. +* Dropping support for a hosted git provider would constitute a breaking + change. + +## Usage + +### var info = hostedGitInfo.fromUrl(gitSpecifier[, options]) + +* *gitSpecifer* is a URL of a git repository or a SCP-style specifier of one. +* *options* is an optional object. It can have the following properties: + * *noCommittish* — If true then committishes won't be included in generated URLs. + * *noGitPlus* — If true then `git+` won't be prefixed on URLs. + +## Methods + +All of the methods take the same options as the `fromUrl` factory. Options +provided to a method override those provided to the constructor. + +* info.file(path, opts) + +Given the path of a file relative to the repository, returns a URL for +directly fetching it from the githost. If no committish was set then +`master` will be used as the default. + +For example `hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git#v1.0.0").file("package.json")` +would return `https://raw.githubusercontent.com/npm/hosted-git-info/v1.0.0/package.json` + +* info.shortcut(opts) + +eg, `github:npm/hosted-git-info` + +* info.browse(path, fragment, opts) + +eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0`, +`https://github.com/npm/hosted-git-info/tree/v1.2.0/package.json`, +`https://github.com/npm/hosted-git-info/tree/v1.2.0/REAMDE.md#supported-hosts` + +* info.bugs(opts) + +eg, `https://github.com/npm/hosted-git-info/issues` + +* info.docs(opts) + +eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0#readme` + +* info.https(opts) + +eg, `git+https://github.com/npm/hosted-git-info.git` + +* info.sshurl(opts) + +eg, `git+ssh://git@github.com/npm/hosted-git-info.git` + +* info.ssh(opts) + +eg, `git@github.com:npm/hosted-git-info.git` + +* info.path(opts) + +eg, `npm/hosted-git-info` + +* info.tarball(opts) + +eg, `https://github.com/npm/hosted-git-info/archive/v1.2.0.tar.gz` + +* info.getDefaultRepresentation() + +Returns the default output type. The default output type is based on the +string you passed in to be parsed + +* info.toString(opts) + +Uses the getDefaultRepresentation to call one of the other methods to get a URL for +this resource. As such `hostedGitInfo.fromUrl(url).toString()` will give +you a normalized version of the URL that still uses the same protocol. + +Shortcuts will still be returned as shortcuts, but the special case github +form of `org/project` will be normalized to `github:org/project`. + +SSH connect strings will be normalized into `git+ssh` URLs. + +## Supported hosts + +Currently this supports GitHub, Bitbucket and GitLab. Pull requests for +additional hosts welcome. diff --git a/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/git-host-info.js b/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/git-host-info.js new file mode 100644 index 00000000000000..360d7b096be617 --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/git-host-info.js @@ -0,0 +1,154 @@ +'use strict' +const maybeJoin = (...args) => args.every(arg => arg) ? args.join('') : '' +const maybeEncode = (arg) => arg ? encodeURIComponent(arg) : '' + +const defaults = { + sshtemplate: ({ domain, user, project, committish }) => `git@${domain}:${user}/${project}.git${maybeJoin('#', committish)}`, + sshurltemplate: ({ domain, user, project, committish }) => `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, + browsetemplate: ({ domain, user, project, committish, treepath }) => `https://${domain}/${user}/${project}${maybeJoin('/', treepath, '/', maybeEncode(committish))}`, + browsefiletemplate: ({ domain, user, project, committish, treepath, path, fragment, hashformat }) => `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || 'master')}/${path}${maybeJoin('#', hashformat(fragment || ''))}`, + docstemplate: ({ domain, user, project, treepath, committish }) => `https://${domain}/${user}/${project}${maybeJoin('/', treepath, '/', maybeEncode(committish))}#readme`, + httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, + filetemplate: ({ domain, user, project, committish, path }) => `https://${domain}/${user}/${project}/raw/${maybeEncode(committish) || 'master'}/${path}`, + shortcuttemplate: ({ type, user, project, committish }) => `${type}:${user}/${project}${maybeJoin('#', committish)}`, + pathtemplate: ({ user, project, committish }) => `${user}/${project}${maybeJoin('#', committish)}`, + bugstemplate: ({ domain, user, project }) => `https://${domain}/${user}/${project}/issues`, + hashformat: formatHashFragment +} + +const gitHosts = {} +gitHosts.github = Object.assign({}, defaults, { + // First two are insecure and generally shouldn't be used any more, but + // they are still supported. + protocols: ['git:', 'http:', 'git+ssh:', 'git+https:', 'ssh:', 'https:'], + domain: 'github.com', + treepath: 'tree', + filetemplate: ({ auth, user, project, committish, path }) => `https://${maybeJoin(auth, '@')}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish) || 'master'}/${path}`, + gittemplate: ({ auth, domain, user, project, committish }) => `git://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, + tarballtemplate: ({ domain, user, project, committish }) => `https://codeload.${domain}/${user}/${project}/tar.gz/${maybeEncode(committish) || 'master'}`, + extract: (url) => { + let [, user, project, type, committish] = url.pathname.split('/', 5) + if (type && type !== 'tree') { + return + } + + if (!type) { + committish = url.hash.slice(1) + } + + if (project && project.endsWith('.git')) { + project = project.slice(0, -4) + } + + if (!user || !project) { + return + } + + return { user, project, committish } + } +}) + +gitHosts.bitbucket = Object.assign({}, defaults, { + protocols: ['git+ssh:', 'git+https:', 'ssh:', 'https:'], + domain: 'bitbucket.org', + treepath: 'src', + tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/get/${maybeEncode(committish) || 'master'}.tar.gz`, + extract: (url) => { + let [, user, project, aux] = url.pathname.split('/', 4) + if (['get'].includes(aux)) { + return + } + + if (project && project.endsWith('.git')) { + project = project.slice(0, -4) + } + + if (!user || !project) { + return + } + + return { user, project, committish: url.hash.slice(1) } + } +}) + +gitHosts.gitlab = Object.assign({}, defaults, { + protocols: ['git+ssh:', 'git+https:', 'ssh:', 'https:'], + domain: 'gitlab.com', + treepath: 'tree', + httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, + tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/repository/archive.tar.gz?ref=${maybeEncode(committish) || 'master'}`, + extract: (url) => { + const path = url.pathname.slice(1) + if (path.includes('/-/')) { + return + } + + const segments = path.split('/') + let project = segments.pop() + if (project.endsWith('.git')) { + project = project.slice(0, -4) + } + + const user = segments.join('/') + if (!user || !project) { + return + } + + return { user, project, committish: url.hash.slice(1) } + } +}) + +gitHosts.gist = Object.assign({}, defaults, { + protocols: ['git:', 'git+ssh:', 'git+https:', 'ssh:', 'https:'], + domain: 'gist.github.com', + sshtemplate: ({ domain, project, committish }) => `git@${domain}:${project}.git${maybeJoin('#', committish)}`, + sshurltemplate: ({ domain, project, committish }) => `git+ssh://git@${domain}/${project}.git${maybeJoin('#', committish)}`, + browsetemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}`, + browsefiletemplate: ({ domain, project, committish, path, hashformat }) => `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}${maybeJoin('#', hashformat(path))}`, + docstemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}`, + httpstemplate: ({ domain, project, committish }) => `git+https://${domain}/${project}.git${maybeJoin('#', committish)}`, + filetemplate: ({ user, project, committish, path }) => `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin('/', maybeEncode(committish))}/${path}`, + shortcuttemplate: ({ type, project, committish }) => `${type}:${project}${maybeJoin('#', committish)}`, + pathtemplate: ({ project, committish }) => `${project}${maybeJoin('#', committish)}`, + bugstemplate: ({ domain, project }) => `https://${domain}/${project}`, + gittemplate: ({ domain, project, committish }) => `git://${domain}/${project}.git${maybeJoin('#', committish)}`, + tarballtemplate: ({ project, committish }) => `https://codeload.github.com/gist/${project}/tar.gz/${maybeEncode(committish) || 'master'}`, + extract: (url) => { + let [, user, project, aux] = url.pathname.split('/', 4) + if (aux === 'raw') { + return + } + + if (!project) { + if (!user) { + return + } + + project = user + user = null + } + + if (project.endsWith('.git')) { + project = project.slice(0, -4) + } + + return { user, project, committish: url.hash.slice(1) } + }, + hashformat: function (fragment) { + return fragment && 'file-' + formatHashFragment(fragment) + } +}) + +const names = Object.keys(gitHosts) +gitHosts.byShortcut = {} +gitHosts.byDomain = {} +for (const name of names) { + gitHosts.byShortcut[`${name}:`] = name + gitHosts.byDomain[gitHosts[name].domain] = name +} + +function formatHashFragment (fragment) { + return fragment.toLowerCase().replace(/^\W+|\/|\W+$/g, '').replace(/\W+/g, '-') +} + +module.exports = gitHosts diff --git a/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/git-host.js b/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/git-host.js new file mode 100644 index 00000000000000..8a975e92e58bb7 --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/git-host.js @@ -0,0 +1,110 @@ +'use strict' +const gitHosts = require('./git-host-info.js') + +class GitHost { + constructor (type, user, auth, project, committish, defaultRepresentation, opts = {}) { + Object.assign(this, gitHosts[type]) + this.type = type + this.user = user + this.auth = auth + this.project = project + this.committish = committish + this.default = defaultRepresentation + this.opts = opts + } + + hash () { + return this.committish ? `#${this.committish}` : '' + } + + ssh (opts) { + return this._fill(this.sshtemplate, opts) + } + + _fill (template, opts) { + if (typeof template === 'function') { + const options = { ...this, ...this.opts, ...opts } + + // the path should always be set so we don't end up with 'undefined' in urls + if (!options.path) { + options.path = '' + } + + // template functions will insert the leading slash themselves + if (options.path.startsWith('/')) { + options.path = options.path.slice(1) + } + + if (options.noCommittish) { + options.committish = null + } + + const result = template(options) + return options.noGitPlus && result.startsWith('git+') ? result.slice(4) : result + } + + return null + } + + sshurl (opts) { + return this._fill(this.sshurltemplate, opts) + } + + browse (path, fragment, opts) { + // not a string, treat path as opts + if (typeof path !== 'string') { + return this._fill(this.browsetemplate, path) + } + + if (typeof fragment !== 'string') { + opts = fragment + fragment = null + } + return this._fill(this.browsefiletemplate, { ...opts, fragment, path }) + } + + docs (opts) { + return this._fill(this.docstemplate, opts) + } + + bugs (opts) { + return this._fill(this.bugstemplate, opts) + } + + https (opts) { + return this._fill(this.httpstemplate, opts) + } + + git (opts) { + return this._fill(this.gittemplate, opts) + } + + shortcut (opts) { + return this._fill(this.shortcuttemplate, opts) + } + + path (opts) { + return this._fill(this.pathtemplate, opts) + } + + tarball (opts) { + return this._fill(this.tarballtemplate, { ...opts, noCommittish: false }) + } + + file (path, opts) { + return this._fill(this.filetemplate, { ...opts, path }) + } + + getDefaultRepresentation () { + return this.default + } + + toString (opts) { + if (this.default && typeof this[this.default] === 'function') { + return this[this.default](opts) + } + + return this.sshurl(opts) + } +} +module.exports = GitHost diff --git a/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/index.js b/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/index.js new file mode 100644 index 00000000000000..f35c570c46b595 --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/index.js @@ -0,0 +1,237 @@ +'use strict' +const url = require('url') +const gitHosts = require('./git-host-info.js') +const GitHost = module.exports = require('./git-host.js') +const LRU = require('lru-cache') +const cache = new LRU({ max: 1000 }) + +const protocolToRepresentationMap = { + 'git+ssh:': 'sshurl', + 'git+https:': 'https', + 'ssh:': 'sshurl', + 'git:': 'git' +} + +function protocolToRepresentation (protocol) { + return protocolToRepresentationMap[protocol] || protocol.slice(0, -1) +} + +const authProtocols = { + 'git:': true, + 'https:': true, + 'git+https:': true, + 'http:': true, + 'git+http:': true +} + +const knownProtocols = Object.keys(gitHosts.byShortcut).concat(['http:', 'https:', 'git:', 'git+ssh:', 'git+https:', 'ssh:']) + +module.exports.fromUrl = function (giturl, opts) { + if (typeof giturl !== 'string') { + return + } + + const key = giturl + JSON.stringify(opts || {}) + + if (!cache.has(key)) { + cache.set(key, fromUrl(giturl, opts)) + } + + return cache.get(key) +} + +function fromUrl (giturl, opts) { + if (!giturl) { + return + } + + const url = isGitHubShorthand(giturl) ? 'github:' + giturl : correctProtocol(giturl) + const parsed = parseGitUrl(url) + if (!parsed) { + return parsed + } + + const gitHostShortcut = gitHosts.byShortcut[parsed.protocol] + const gitHostDomain = gitHosts.byDomain[parsed.hostname.startsWith('www.') ? parsed.hostname.slice(4) : parsed.hostname] + const gitHostName = gitHostShortcut || gitHostDomain + if (!gitHostName) { + return + } + + const gitHostInfo = gitHosts[gitHostShortcut || gitHostDomain] + let auth = null + if (authProtocols[parsed.protocol] && (parsed.username || parsed.password)) { + auth = `${parsed.username}${parsed.password ? ':' + parsed.password : ''}` + } + + let committish = null + let user = null + let project = null + let defaultRepresentation = null + + try { + if (gitHostShortcut) { + let pathname = parsed.pathname.startsWith('/') ? parsed.pathname.slice(1) : parsed.pathname + const firstAt = pathname.indexOf('@') + // we ignore auth for shortcuts, so just trim it out + if (firstAt > -1) { + pathname = pathname.slice(firstAt + 1) + } + + const lastSlash = pathname.lastIndexOf('/') + if (lastSlash > -1) { + user = decodeURIComponent(pathname.slice(0, lastSlash)) + // we want nulls only, never empty strings + if (!user) { + user = null + } + project = decodeURIComponent(pathname.slice(lastSlash + 1)) + } else { + project = decodeURIComponent(pathname) + } + + if (project.endsWith('.git')) { + project = project.slice(0, -4) + } + + if (parsed.hash) { + committish = decodeURIComponent(parsed.hash.slice(1)) + } + + defaultRepresentation = 'shortcut' + } else { + if (!gitHostInfo.protocols.includes(parsed.protocol)) { + return + } + + const segments = gitHostInfo.extract(parsed) + if (!segments) { + return + } + + user = segments.user && decodeURIComponent(segments.user) + project = decodeURIComponent(segments.project) + committish = decodeURIComponent(segments.committish) + defaultRepresentation = protocolToRepresentation(parsed.protocol) + } + } catch (err) { + /* istanbul ignore else */ + if (err instanceof URIError) { + return + } else { + throw err + } + } + + return new GitHost(gitHostName, user, auth, project, committish, defaultRepresentation, opts) +} + +// accepts input like git:github.com:user/repo and inserts the // after the first : +const correctProtocol = (arg) => { + const firstColon = arg.indexOf(':') + const proto = arg.slice(0, firstColon + 1) + if (knownProtocols.includes(proto)) { + return arg + } + + const firstAt = arg.indexOf('@') + if (firstAt > -1) { + if (firstAt > firstColon) { + return `git+ssh://${arg}` + } else { + return arg + } + } + + const doubleSlash = arg.indexOf('//') + if (doubleSlash === firstColon + 1) { + return arg + } + + return arg.slice(0, firstColon + 1) + '//' + arg.slice(firstColon + 1) +} + +// look for github shorthand inputs, such as npm/cli +const isGitHubShorthand = (arg) => { + // it cannot contain whitespace before the first # + // it cannot start with a / because that's probably an absolute file path + // but it must include a slash since repos are username/repository + // it cannot start with a . because that's probably a relative file path + // it cannot start with an @ because that's a scoped package if it passes the other tests + // it cannot contain a : before a # because that tells us that there's a protocol + // a second / may not exist before a # + const firstHash = arg.indexOf('#') + const firstSlash = arg.indexOf('/') + const secondSlash = arg.indexOf('/', firstSlash + 1) + const firstColon = arg.indexOf(':') + const firstSpace = /\s/.exec(arg) + const firstAt = arg.indexOf('@') + + const spaceOnlyAfterHash = !firstSpace || (firstHash > -1 && firstSpace.index > firstHash) + const atOnlyAfterHash = firstAt === -1 || (firstHash > -1 && firstAt > firstHash) + const colonOnlyAfterHash = firstColon === -1 || (firstHash > -1 && firstColon > firstHash) + const secondSlashOnlyAfterHash = secondSlash === -1 || (firstHash > -1 && secondSlash > firstHash) + const hasSlash = firstSlash > 0 + // if a # is found, what we really want to know is that the character immediately before # is not a / + const doesNotEndWithSlash = firstHash > -1 ? arg[firstHash - 1] !== '/' : !arg.endsWith('/') + const doesNotStartWithDot = !arg.startsWith('.') + + return spaceOnlyAfterHash && hasSlash && doesNotEndWithSlash && doesNotStartWithDot && atOnlyAfterHash && colonOnlyAfterHash && secondSlashOnlyAfterHash +} + +// attempt to correct an scp style url so that it will parse with `new URL()` +const correctUrl = (giturl) => { + const firstAt = giturl.indexOf('@') + const lastHash = giturl.lastIndexOf('#') + let firstColon = giturl.indexOf(':') + let lastColon = giturl.lastIndexOf(':', lastHash > -1 ? lastHash : Infinity) + + let corrected + if (lastColon > firstAt) { + // the last : comes after the first @ (or there is no @) + // like it would in: + // proto://hostname.com:user/repo + // username@hostname.com:user/repo + // :password@hostname.com:user/repo + // username:password@hostname.com:user/repo + // proto://username@hostname.com:user/repo + // proto://:password@hostname.com:user/repo + // proto://username:password@hostname.com:user/repo + // then we replace the last : with a / to create a valid path + corrected = giturl.slice(0, lastColon) + '/' + giturl.slice(lastColon + 1) + // // and we find our new : positions + firstColon = corrected.indexOf(':') + lastColon = corrected.lastIndexOf(':') + } + + if (firstColon === -1 && giturl.indexOf('//') === -1) { + // we have no : at all + // as it would be in: + // username@hostname.com/user/repo + // then we prepend a protocol + corrected = `git+ssh://${corrected}` + } + + return corrected +} + +// try to parse the url as its given to us, if that throws +// then we try to clean the url and parse that result instead +// THIS FUNCTION SHOULD NEVER THROW +const parseGitUrl = (giturl) => { + let result + try { + result = new url.URL(giturl) + } catch (err) {} + + if (result) { + return result + } + + const correctedUrl = correctUrl(giturl) + try { + result = new url.URL(correctedUrl) + } catch (err) {} + + return result +} diff --git a/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/package.json b/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/package.json new file mode 100644 index 00000000000000..930e3b693b9801 --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/package.json @@ -0,0 +1,52 @@ +{ + "name": "hosted-git-info", + "version": "4.0.1", + "description": "Provides metadata and conversions from repository urls for GitHub, Bitbucket and GitLab", + "main": "index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/hosted-git-info.git" + }, + "keywords": [ + "git", + "github", + "bitbucket", + "gitlab" + ], + "author": "Rebecca Turner (http://re-becca.org)", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/hosted-git-info/issues" + }, + "homepage": "https://github.com/npm/hosted-git-info", + "scripts": { + "posttest": "standard", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "preversion": "npm test", + "snap": "tap", + "test": "tap", + "test:coverage": "tap --coverage-report=html" + }, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "devDependencies": { + "standard": "^16.0.3", + "standard-version": "^9.1.0", + "tap": "^14.11.0" + }, + "files": [ + "index.js", + "git-host.js", + "git-host-info.js" + ], + "engines": { + "node": ">=10" + }, + "tap": { + "color": 1, + "coverage": true, + "esm": false + } +} diff --git a/deps/npm/node_modules/npm-package-arg/package.json b/deps/npm/node_modules/npm-package-arg/package.json index c460be828efcb4..ed3b364442c2cc 100644 --- a/deps/npm/node_modules/npm-package-arg/package.json +++ b/deps/npm/node_modules/npm-package-arg/package.json @@ -1,6 +1,6 @@ { "name": "npm-package-arg", - "version": "8.1.1", + "version": "8.1.2", "description": "Parse the things that can be arguments to `npm install`", "main": "npa.js", "directories": { @@ -10,12 +10,12 @@ "npa.js" ], "dependencies": { - "hosted-git-info": "^3.0.6", - "semver": "^7.0.0", + "hosted-git-info": "^4.0.1", + "semver": "^7.3.4", "validate-npm-package-name": "^3.0.0" }, "devDependencies": { - "tap": "^14.10.2" + "tap": "^14.11.0" }, "scripts": { "preversion": "npm test", diff --git a/deps/npm/node_modules/npm-pick-manifest/CHANGELOG.md b/deps/npm/node_modules/npm-pick-manifest/CHANGELOG.md index a4ee13e92ab45c..5edb4a33c1a409 100644 --- a/deps/npm/node_modules/npm-pick-manifest/CHANGELOG.md +++ b/deps/npm/node_modules/npm-pick-manifest/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +All notable changes to this project will be documented in this file. + +## [6.1.1](https://github.com/npm/npm-pick-manifest/compare/v6.0.0...v6.1.0) (2020-04-07) + +* normalize package bins in returned manifest ## [6.1.0](https://github.com/npm/npm-pick-manifest/compare/v6.0.0...v6.1.0) (2020-04-07) diff --git a/deps/npm/node_modules/npm-pick-manifest/index.js b/deps/npm/node_modules/npm-pick-manifest/index.js index 2b3ea6ffa4930e..695450524dc13d 100644 --- a/deps/npm/node_modules/npm-pick-manifest/index.js +++ b/deps/npm/node_modules/npm-pick-manifest/index.js @@ -3,6 +3,7 @@ const npa = require('npm-package-arg') const semver = require('semver') const { checkEngine } = require('npm-install-checks') +const normalizeBin = require('npm-normalize-package-bin') const engineOk = (manifest, npmVersion, nodeVersion) => { try { @@ -183,7 +184,8 @@ const pickManifest = (packument, wanted, opts) => { } module.exports = (packument, wanted, opts = {}) => { - const picked = pickManifest(packument, wanted, opts) + const mani = pickManifest(packument, wanted, opts) + const picked = mani && normalizeBin(mani) const policyRestrictions = packument.policyRestrictions const restricted = (policyRestrictions && policyRestrictions.versions) || {} diff --git a/deps/npm/node_modules/npm-pick-manifest/package.json b/deps/npm/node_modules/npm-pick-manifest/package.json index 805f5ac23a8463..4b4866cbf88326 100644 --- a/deps/npm/node_modules/npm-pick-manifest/package.json +++ b/deps/npm/node_modules/npm-pick-manifest/package.json @@ -1,6 +1,6 @@ { "name": "npm-pick-manifest", - "version": "6.1.0", + "version": "6.1.1", "description": "Resolves a matching manifest from a package metadata document according to standard npm semver resolution rules.", "main": "index.js", "files": [ @@ -9,12 +9,11 @@ "scripts": { "coverage": "tap", "lint": "standard", - "postrelease": "npm publish", + "test": "tap", "posttest": "npm run lint", - "prepublishOnly": "git push --follow-tags", - "prerelease": "npm t", - "release": "standard-version -s", - "test": "tap" + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" }, "repository": "https://github.com/npm/npm-pick-manifest", "keywords": [ @@ -30,13 +29,13 @@ "license": "ISC", "dependencies": { "npm-install-checks": "^4.0.0", - "npm-package-arg": "^8.0.0", - "semver": "^7.0.0" + "npm-normalize-package-bin": "^1.0.1", + "npm-package-arg": "^8.1.2", + "semver": "^7.3.4" }, "devDependencies": { "standard": "^14.3.1", - "standard-version": "^7.0.1", - "tap": "^14.10.2" + "tap": "^14.11.0" }, "tap": { "check-coverage": true diff --git a/deps/npm/node_modules/pacote/lib/util/tar-create-options.js b/deps/npm/node_modules/pacote/lib/util/tar-create-options.js index e8abbe175b2626..31ab34c9d949f8 100644 --- a/deps/npm/node_modules/pacote/lib/util/tar-create-options.js +++ b/deps/npm/node_modules/pacote/lib/util/tar-create-options.js @@ -4,7 +4,13 @@ const tarCreateOptions = manifest => ({ cwd: manifest._resolved, prefix: 'package/', portable: true, - gzip: true, + gzip: { + // forcing the level to 9 seems to avoid some + // platform specific optimizations that cause + // integrity mismatch errors due to differing + // end results after compression + level: 9 + }, // ensure that package bins are always executable // Note that npm-packlist is already filtering out diff --git a/deps/npm/node_modules/pacote/package.json b/deps/npm/node_modules/pacote/package.json index dca67f3e8876ac..dd6bf9400c6ea3 100644 --- a/deps/npm/node_modules/pacote/package.json +++ b/deps/npm/node_modules/pacote/package.json @@ -1,6 +1,6 @@ { "name": "pacote", - "version": "11.3.0", + "version": "11.3.1", "description": "JavaScript package downloader", "author": "Isaac Z. Schlueter (https://izs.me)", "bin": { diff --git a/deps/npm/node_modules/puka/CHANGELOG.md b/deps/npm/node_modules/puka/CHANGELOG.md deleted file mode 100644 index 781b81295a4a7f..00000000000000 --- a/deps/npm/node_modules/puka/CHANGELOG.md +++ /dev/null @@ -1,31 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [1.0.1](https://gitlab.com/rhendric/puka/-/compare/v1.0.0...v1.0.1) - 2020-05-16 - -### Fixed - -- Add more carets to win32 command arguments ([45965ca](https://gitlab.com/rhendric/puka/-/commit/45965ca60fcc518082e0b085d8e81f3f3279ffb4)) - - As previously documented and implemented, Puka assumed that all programs - are batch files for the purpose of multi-escaping commands that appear - in pipelines. However, regardless of whether a command is in a pipeline, - one extra layer of escaping is needed if the command invokes a batch - file, which Puka was not producing. This only applies to the arguments - to the command, not to the batch file path, nor to paths used in - redirects. (The property-based spawn test which was supposed to catch - such oversights missed this one because it was invoking the Node.js - executable directly, not, as recommended in the documentation, a batch - file.) - - Going forward, the caveats described in the documentation continue to - apply: if you are running programs on Windows with Puka, make sure they - are batch files, or you may find arguments are being escaped with too - many carets. As the documentation says, if this causes problems for you, - please open an issue so we can work out the details of what a good - workaround looks like. - -## [1.0.0](https://gitlab.com/rhendric/puka/-/tags/v1.0.0) - 2017-09-29 diff --git a/deps/npm/node_modules/puka/LICENSE.txt b/deps/npm/node_modules/puka/LICENSE.txt deleted file mode 100644 index 0141196a593376..00000000000000 --- a/deps/npm/node_modules/puka/LICENSE.txt +++ /dev/null @@ -1,18 +0,0 @@ -Copyright 2017 Ryan Hendrickson - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/puka/README.md b/deps/npm/node_modules/puka/README.md deleted file mode 100644 index 2670f742b36773..00000000000000 --- a/deps/npm/node_modules/puka/README.md +++ /dev/null @@ -1,411 +0,0 @@ -# Puka - -[![GitLab CI pipeline status](https://gitlab.com/rhendric/puka/badges/master/pipeline.svg)](https://gitlab.com/rhendric/puka/commits/master) [![AppVeyor build status](https://img.shields.io/appveyor/ci/rhendric/puka.svg?label=windows%20tests)](https://ci.appveyor.com/project/rhendric/puka) [![Codecov status](https://img.shields.io/codecov/c/gl/rhendric/puka.svg)](https://codecov.io/gl/rhendric/puka) - -Puka is a cross-platform library for safely passing strings through shells. - -#### Contents - -- [Introduction](#introduction) - - [Why would I use Puka?](#why-would-i-use-puka) - - [How do I use Puka?](#how-do-i-use-puka) - - [What's the catch?](#whats-the-catch) -- [API Documentation](#api-documentation) - - [Basic API](#basic-api) - - [sh](#sh) - - [unquoted](#unquoted) - - [Advanced API](#advanced-api) - - [quoteForShell](#quoteforshell) - - [quoteForCmd](#quoteforcmd) - - [quoteForSh](#quoteforsh) - - [ShellString](#shellstring) - - [Secret API](#secret-api) -- [The sh DSL](#the-sh-dsl) - - [Syntax](#syntax) - - [Semantics](#semantics) - - [Types of placeholders](#types-of-placeholders) - -## Introduction - -### Why would I use Puka? - -When launching a child process from Node, you have a choice between launching -directly from the operating system (as with [child_process.spawn](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options), -if you don't use the `{ shell: true }` option), and running the command through -a shell (as with [child_process.exec](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback)). -Using a shell gives you more power, such as the ability to chain multiple -commands together or use redirection, but you have to construct your command as -a single string instead of using an array of arguments. And doing that can be -buggy (if not dangerous) if you don't take care to quote any arguments -correctly for the shell you're targeting, _and_ the quoting has to be done -differently on Windows and non-Windows shells. - -Puka solves that problem by giving you a simple and platform-agnostic way to -build shell commands with arguments that pass through your shell unaltered and -with no unsafe side effects, **whether you are running on Windows or a -Unix-based OS**. - -### How do I use Puka? - -Puka gives you an `sh` function intended for tagging -[template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals), -which quotes (if necessary) any values interpolated into the template. A simple -example: - -```javascript -const { sh } = require('puka'); -const { execSync } = require('child_process'); - -const arg = 'file with spaces.txt'; -execSync(sh`some-command ${arg}`); -``` - -But Puka supports more than this! See [the `sh` DSL documentation](#the-sh-dsl) -for a detailed description of all the features currently supported. - -### What's the catch? - -Here are the ones I know about: - -Puka does _not_ ensure that the actual commands you're running are -cross-platform. If you're running npm programs, you generally won't have a -problem with that, but if you want to run ``sh`cat file` `` on Windows, you'll -need to depend on something like -[cash-cat](https://www.npmjs.com/package/cash-cat). - -I searched for days for a way to quote or escape line breaks in arguments to -`cmd.exe`, but couldn't find one (regular `^`-prepending and quotation marks -don't seem to cut it). If you know of a way that works, please [open an -issue](https://gitlab.com/rhendric/puka/issues/new) to tell me about it! Until -then, any line break characters (`\r` or `\n`) in values being interpolated by -`sh` will cause an error to be thrown on Windows only. - -Also on Windows, you may notice quoting mistakes if you run commands that -involve invoking a native executable (not a batch file ending in `.cmd` or -`.bat`). Unfortunately, batch files require some extra escaping on Windows, and -Puka assumes all programs are batch files because npm creates batch file shims -for programs it installs (and, if you care about cross-platform, you'll be -using npm programs in your commands). If this causes problems for you, please -[open an issue](https://gitlab.com/rhendric/puka/issues/new); if your situation -is specific enough, there may be workarounds or improvements to Puka to be -found. - -## API Documentation - -### Basic API - - - - -#### sh - -A string template tag for safely constructing cross-platform shell commands. - -An `sh` template is not actually treated as a literal string to be -interpolated; instead, it is a tiny DSL designed to make working with shell -strings safe, simple, and straightforward. To get started quickly, see the -examples below. [More detailed documentation][1] is available -further down. - -##### Examples - -```javascript -const title = '"this" & "that"'; -sh`script --title=${title}`; // => "script '--title=\"this\" & \"that\"'" -// Note: these examples show results for non-Windows platforms. -// On Windows, the above would instead be -// 'script ^^^"--title=\\^^^"this\\^^^" ^^^& \\^^^"that\\^^^"^^^"'. - -const names = ['file1', 'file 2']; -sh`rimraf ${names}.txt`; // => "rimraf file1.txt 'file 2.txt'" - -const cmd1 = ['cat', 'file 1.txt', 'file 2.txt']; -const cmd2 = ['use-input', '-abc']; -sh`${cmd1}|${cmd2}`; // => "cat 'file 1.txt' 'file 2.txt'|use-input -abc" -``` - -Returns **[String][2]** a string formatted for the platform Node is currently -running on. - -#### unquoted - -This function permits raw strings to be interpolated into a `sh` template. - -**IMPORTANT**: If you're using Puka due to security concerns, make sure you -don't pass any untrusted content to `unquoted`. This may be obvious, but -stray punctuation in an `unquoted` section can compromise the safety of the -entire shell command. - -##### Parameters - -- `value` any value (it will be treated as a string) - -##### Examples - -```javascript -const both = true; -sh`foo ${unquoted(both ? '&&' : '||')} bar`; // => 'foo && bar' -``` - -### Advanced API - -If these functions make life easier for you, go ahead and use them; they -are just as well supported as the above. But if you aren't certain you -need them, you probably don't. - - -#### quoteForShell - -Quotes a string for injecting into a shell command. - -This function is exposed for some hypothetical case when the `sh` DSL simply -won't do; `sh` is expected to be the more convenient option almost always. -Compare: - -```javascript -console.log('cmd' + args.map(a => ' ' + quoteForShell(a)).join('')); -console.log(sh`cmd ${args}`); // same as above - -console.log('cmd' + args.map(a => ' ' + quoteForShell(a, true)).join('')); -console.log(sh`cmd "${args}"`); // same as above -``` - -Additionally, on Windows, `sh` checks the entire command string for pipes, -which subtly change how arguments need to be quoted. If your commands may -involve pipes, you are strongly encouraged to use `sh` and not try to roll -your own with `quoteForShell`. - -##### Parameters - -- `text` **[String][2]** to be quoted -- `forceQuote` **[Boolean][3]?** whether to always add quotes even if the string - is already safe. Defaults to `false`. -- `platform` **[String][2]?** a value that `process.platform` might take: - `'win32'`, `'linux'`, etc.; determines how the string is to be formatted. - When omitted, effectively the same as `process.platform`. - -Returns **[String][2]** a string that is safe for the current (or specified) -platform. - -#### quoteForCmd - -A Windows-specific version of [quoteForShell][4]. - -##### Parameters - -- `text` **[String][2]** to be quoted -- `forceQuote` **[Boolean][3]?** whether to always add quotes even if the string - is already safe. Defaults to `false`. - -#### quoteForSh - -A Unix-specific version of [quoteForShell][4]. - -##### Parameters - -- `text` **[String][2]** to be quoted -- `forceQuote` **[Boolean][3]?** whether to always add quotes even if the string - is already safe. Defaults to `false`. - -#### ShellString - -A ShellString represents a shell command after it has been interpolated, but -before it has been formatted for a particular platform. ShellStrings are -useful if you want to prepare a command for a different platform than the -current one, for instance. - -To create a ShellString, use `ShellString.sh` the same way you would use -top-level `sh`. - -##### toString - -A method to format a ShellString into a regular String formatted for a -particular platform. - -###### Parameters - -- `platform` **[String][2]?** a value that `process.platform` might take: - `'win32'`, `'linux'`, etc.; determines how the string is to be formatted. - When omitted, effectively the same as `process.platform`. - -Returns **[String][2]** - -##### sh - -`ShellString.sh` is a template tag just like `sh`; the only difference is -that this function returns a ShellString which has not yet been formatted -into a String. - -Returns **[ShellString][5]** - -### Secret API - -Some internals of string formatting have been exposed for the ambitious and -brave souls who want to try to extend Puka to handle more shells or custom -interpolated values. This ‘secret’ API is partially documented in the code -but not here, and the semantic versioning guarantees on this API are bumped -down by one level: in other words, minor version releases of Puka can change -the secret API in backward-incompatible ways, and patch releases can add or -deprecate functionality. - -If it's not even documented in the code, use at your own risk—no semver -guarantees apply. - - -[1]: #the-sh-dsl - -[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String - -[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean - -[4]: #quoteforshell - -[5]: #shellstring - -## The sh DSL - -### Syntax - -An `sh` template comprises words, separated by whitespace. Words can contain: - -- text, which is composed of any characters that are not whitespace, single or - double quotes, or any of the special characters - ``# $ & ( ) ; < > \ ` |``; -- quotations, which are matching single or double quotes surrounding any - characters other than the delimiting quote; and -- placeholders, using the standard JavaScript template syntax (`${}`). - (Placeholders may also appear inside quotations.) - -The special characters ``# $ & ( ) ; < > \ ` |``, if unquoted, form their own -words. - -Redirect operators (`<`, `>`, `>>`, `2>`, etc.) receive their own special -handling, as do semicolons. Other than these two exceptions, no attempt is made -to understand any more sophisticated features of shell syntax. - -Standard JavaScript escape sequences, such as `\t`, are honored in the template -literal, and are treated equivalently to the characters they represent. There -is no further mechanism for escaping within the `sh` DSL itself; in particular, -if you want to put quotes inside quotes, you have to use interpolation, like -this: - -```javascript -sh`echo "${'single = \', double = "'}"` // => "echo 'single = '\\'', double = \"'" -``` - -### Semantics - -Words that do not contain placeholders are emitted mostly verbatim to the -output string. Quotations are formatted in the expected style for the target -platform (single quotes for Unix, double quotes for Windows) regardless of the -quotes used in the template literal—as with JavaScript, single and double quotes -are interchangeable, except for the requirement to pair like with like. Unquoted -semicolons are translated to ampersands on Windows; all other special characters -(as enumerated above), when unquoted, are passed as-is to the output for the -shell to interpret. - -Puka may still quote words not containing the above special characters, if they -contain characters that need quoting on the target platform. For example, on -Windows, the character `%` is used for variable interpolation in `cmd.exe`, and -Puka quotes it on on that platform even if it appears unquoted in the template -literal. Consequently, there is no need to be paranoid about quoting anything -that doesn't look alphanumeric inside a `sh` template literal, for fear of being -burned on a different operating system; anything that matches the definition of -‘text’ above will never need manual quoting. - -#### Types of placeholders - -##### Strings - -If a word contains a string placeholder, then the value of the placeholder is -interpolated into the word and the entire word, if necessary, is quoted. If -the placeholder occurs within quotes, no further quoting is performed: - -```javascript -sh`script --file="${'herp derp'}.txt"`; // => "script --file='herp derp.txt'" -``` - -This behavior can be exploited to force consistent quoting, if desired; but -both of the examples below are safe on all platforms: - -```javascript -const words = ['oneword', 'two words']; -sh`minimal ${words[0]}`; // => "minimal oneword" -sh`minimal ${words[1]}`; // => "minimal 'two words'" -sh`consistent '${words[0]}'`; // => "consistent 'oneword'" -sh`consistent '${words[1]}'`; // => "consistent 'two words'" -``` - -##### Arrays and iterables - -If a word contains a placeholder for an array (or other iterable object), then -the entire word is repeated once for each value in the array, separated by -spaces. If the array is empty, then the word is not emitted at all, and neither -is any leading whitespace. - -```javascript -const files = ['foo', 'bar']; -sh`script ${files}`; // => "script foo bar" -sh`script --file=${files}`; // => "script --file=foo --file=bar" -sh`script --file=${[]}`; // => "script" -``` - -Note that, since special characters are their own words, the pipe operator here -is not repeated: - -```javascript -const cmd = ['script', 'foo', 'bar']; -sh`${cmd}|another-script`; // => "script foo bar|another-script" -``` - -Multiple arrays in the same word generate a Cartesian product: - -```javascript -const names = ['foo', 'bar'], exts = ['log', 'txt']; -// Same word -sh`... ${names}.${exts}`; // => "... foo.log foo.txt bar.log bar.txt" -sh`... "${names} ${exts}"`; // => "... 'foo log' 'foo txt' 'bar log' 'bar txt'" - -// Not the same word (extra space just for emphasis): -sh`... ${names} ${exts}`; // => "... foo bar log txt" -sh`... ${names};${exts}`; // => "... foo bar;log txt" -``` - -Finally, if a placeholder appears in the object of a redirect operator, the -entire redirect is repeated as necessary: - -```javascript -sh`script > ${['foo', 'bar']}.txt`; // => "script > foo.txt > bar.txt" -sh`script > ${[]}.txt`; // => "script" -``` - -##### unquoted - -The `unquoted` function returns a value that will skip being quoted when used -in a placeholder, alone or in an array. - -```javascript -const cmd = 'script < input.txt'; -const fields = ['foo', 'bar']; -sh`${unquoted(cmd)} | json ${fields}`; // => "script < input.txt | json foo bar" -``` - -##### ShellString - -If `ShellString.sh` is used to construct an unformatted ShellString, that value -can be used in a placeholder to insert the contents of the ShellString into the -outer template literal. This is safer than using `unquoted` as in the previous -example, but `unquoted` can be used when all you have is a string from another -(trusted!) source. - -```javascript -const url = 'http://example.com/data.json?x=1&y=2'; -const curl = ShellString.sh`curl -L ${url}`; -const fields = ['foo', 'bar']; -sh`${curl} | json ${fields}`; // => "curl -L 'http://example.com/data.json?x=1&y=2' | json foo bar" -``` - -##### Anything else - -... is treated like a string—namely, a value `x` is equivalent to `'' + x`, if -not in one of the above categories. diff --git a/deps/npm/node_modules/puka/index.js b/deps/npm/node_modules/puka/index.js deleted file mode 100644 index b69e47d7639db9..00000000000000 --- a/deps/npm/node_modules/puka/index.js +++ /dev/null @@ -1,804 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -/** - * Key a method on your object with this symbol and you can get special - * formatting for that value! See ShellStringText, ShellStringUnquoted, or - * shellStringSemicolon for examples. - * @ignore - */ -const formatSymbol = Symbol('format'); -/** - * This symbol is for implementing advanced behaviors like the need for extra - * carets in Windows shell strings that use pipes. If present, it's called in - * an earlier phase than formatSymbol, and is passed a mutable context that can - * be read during the format phase to influence formatting. - * @ignore - */ -const preformatSymbol = Symbol('preformat'); - -// When minimum Node version becomes 6, replace calls to sticky with /.../y and -// inline execFrom. -let stickySupported = true; -try { - new RegExp('', 'y'); -} catch (e) { - stickySupported = false; -} -const sticky = stickySupported ? source => new RegExp(source, 'y') : source => new RegExp(`^(?:${source})`); -const execFrom = stickySupported ? (re, haystack, index) => (re.lastIndex = index, re.exec(haystack)) : (re, haystack, index) => re.exec(haystack.substr(index)); - -function quoteForCmd(text, forceQuote) { - let caretDepth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - // See the below blog post for an explanation of this function and - // quoteForWin32: - // https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/ - if (!text.length) { - return '""'; - } - if (/[\n\r]/.test(text)) { - throw new Error("Line breaks can't be quoted on Windows"); - } - const caretEscape = /["%]/.test(text); - text = quoteForWin32(text, forceQuote || !caretEscape && /[&()<>^|]/.test(text)); - if (caretEscape) { - // See Win32Context for explanation of what caretDepth is for. - do { - text = text.replace(/[\t "%&()<>^|]/g, '^$&'); - } while (caretDepth--); - } - return text; -} -const quoteForWin32 = (text, forceQuote) => forceQuote || /[\t "]/.test(text) ? `"${text.replace(/\\+(?=$|")/g, '$&$&').replace(/"/g, '\\"')}"` : text; -const cmdMetaChars = /[\t\n\r "%&()<>^|]/; -class Win32Context { - constructor() { - this.currentScope = newScope(null); - this.scopesByObject = new Map(); - this.argDetectState = 0; - this.argSet = new Set(); - } - read(text) { - // When cmd.exe executes a batch file, or pipes to or from one, it spawns a - // second copy of itself to run the inner command. This necessitates - // doubling up on carets so that escaped characters survive both cmd.exe - // invocations. See: - // https://stackoverflow.com/questions/8192318/why-does-delayed-expansion-fail-when-inside-a-piped-block-of-code#8194279 - // https://ss64.com/nt/syntax-redirection.html - // - // Parentheses can create an additional subshell, requiring additional - // escaping... it's a mess. - // - // So here's what we do about it: we read all unquoted text in a shell - // string and put it through this tiny parser that looks for pipes, - // sequence operators (&, &&, ||), redirects, and parentheses. This can't - // be part of the main Puka parsing, because it can be affected by - // `unquoted(...)` values provided at evaluation time. - // - // Then, after associating each thing that needs to be quoted with a scope - // (via `mark()`), and identifying whether or not it's an argument to a - // command, we can determine the depth of caret escaping required in each - // scope and pass it (via `Formatter::quote()`) to `quoteForCmd()`. - // - // See also `ShellStringText`, which holds the logic for the previous - // paragraph. - const length = text.length; - for (let pos = 0, match; pos < length;) { - while (match = execFrom(reUnimportant, text, pos)) { - if (match[2] == null) { - // (not whitespace) - if (match[1] != null) { - // (>&) - this.argDetectState = this.argDetectState === 0 ? ADS_FLAG_INITIAL_REDIRECT : 0; - } else if (this.argDetectState !== ADS_FLAG_ARGS) { - this.argDetectState |= ADS_FLAG_WORD; - } - } else { - // (whitespace) - if ((this.argDetectState & ADS_FLAG_WORD) !== 0) { - this.argDetectState = ADS_FLAG_ARGS & ~this.argDetectState >> 1; - } - } - pos += match[0].length; - } - if (pos >= length) break; - if (match = execFrom(reSeqOp, text, pos)) { - this.seq(); - pos += match[0].length; - } else { - const char = text.charCodeAt(pos); - if (char === CARET) { - pos += 2; - } else if (char === QUOTE) { - // If you were foolish enough to leave a dangling quotation mark in - // an unquoted span... you're likely to have bigger problems than - // incorrect escaping. So we just do the simplest thing of looking for - // the end quote only in this piece of text. - pos += execFrom(reNotQuote, text, pos + 1)[0].length + 2; - } else { - if (char === OPEN_PAREN) { - this.enterScope(); - } else if (char === CLOSE_PAREN) { - this.exitScope(); - } else if (char === PIPE) { - this.pipe(); - } else { - // (char === '<' or '>') - this.argDetectState = this.argDetectState === 0 ? ADS_FLAG_INITIAL_REDIRECT : 0; - } - pos++; - } - } - } - } - enterScope() { - this.currentScope = newScope(this.currentScope); - this.argDetectState = 0; - } - exitScope() { - this.currentScope = this.currentScope.parent || (this.currentScope.parent = newScope(null)); - this.argDetectState = ADS_FLAG_ARGS; - } - seq() { - // | binds tighter than sequence operators, so the latter create new sibling - // scopes for future |s to mutate. - this.currentScope = newScope(this.currentScope.parent); - this.argDetectState = 0; - } - pipe() { - this.currentScope.depthDelta = 1; - this.argDetectState = 0; - } - mark(obj) { - this.scopesByObject.set(obj, this.currentScope); - if (this.argDetectState === ADS_FLAG_ARGS) { - this.argSet.add(obj); - } else { - this.argDetectState |= ADS_FLAG_WORD; - } - } - at(obj) { - const scope = this.scopesByObject.get(obj); - return { - depth: getDepth(scope), - isArgument: this.argSet.has(obj), - isNative: scope.isNative - }; - } -} -// These flags span the Win32Context's argument detection state machine. WORD -// is set when the context is inside a word that is not an argument (meaning it -// is either the first word in the command, or it is the object of a redirect). -// ARGS is set when the context has reached the arguments of a command. -// INITIAL_REDIRECT tracks the edge case when a redirect occurs before the -// first word of the command (if this flag is set, reaching the end of a word -// should take the state machine back to 0 instead of setting ADS_FLAG_ARGS). -const ADS_FLAG_WORD = 0x1; -const ADS_FLAG_ARGS = 0x2; -const ADS_FLAG_INITIAL_REDIRECT = 0x4; -const getDepth = scope => scope === null ? 0 : scope.depth !== -1 ? scope.depth : scope.depth = getDepth(scope.parent) + scope.depthDelta; -const newScope = parent => ({ - parent, - depthDelta: 0, - depth: -1, - isNative: false -}); -const CARET = '^'.charCodeAt(); -const QUOTE = '"'.charCodeAt(); -const OPEN_PAREN = '('.charCodeAt(); -const CLOSE_PAREN = ')'.charCodeAt(); -const PIPE = '|'.charCodeAt(); -const reNotQuote = sticky('[^"]*'); -const reSeqOp = sticky('&&?|\\|\\|'); -const reUnimportant = sticky('(\\d*>&)|[^\\s"$&()<>^|]+|(\\s+)'); - -const quoteForSh = (text, forceQuote) => text.length ? forceQuote || shMetaChars.test(text) ? `'${text.replace(/'/g, "'\\''")}'`.replace(/^(?:'')+(?!$)/, '').replace(/\\'''/g, "\\'") : text : "''"; -const shMetaChars = /[\t\n\r "#$&'()*;<>?\\`|~]/; - -/** - * To get a Formatter, call `Formatter.for`. - * - * To create a new Formatter, pass an object to `Formatter.declare`. - * - * To set the global default Formatter, assign to `Formatter.default`. - * - * @class - * @property {Formatter} default - The Formatter to be used when no platform - * is provided—for example, when creating strings with `sh`. - * @ignore - */ -function Formatter() {} -Object.assign(Formatter, -/** @lends Formatter */ -{ - /** - * Gets a Formatter that has been declared for the provided platform, or - * the base `'sh'` formatter if there is no Formatter specific to this - * platform, or the Formatter for the current platform if no specific platform - * is provided. - */ - for(platform) { - return platform == null ? Formatter.default || (Formatter.default = Formatter.for(process.platform)) : Formatter._registry.get(platform) || Formatter._registry.get('sh'); - }, - /** - * Creates a new Formatter or mutates the properties on an existing - * Formatter. The `platform` key on the provided properties object determines - * when the Formatter is retrieved. - */ - declare(props) { - const platform = props && props.platform || 'sh'; - const existingFormatter = Formatter._registry.get(platform); - const formatter = Object.assign(existingFormatter || new Formatter(), props); - formatter.emptyString === void 0 && (formatter.emptyString = formatter.quote('', true)); - existingFormatter || Formatter._registry.set(formatter.platform, formatter); - }, - _registry: new Map(), - prototype: { - platform: 'sh', - quote: quoteForSh, - metaChars: shMetaChars, - hasExtraMetaChars: false, - statementSeparator: ';', - createContext() { - return defaultContext; - } - } -}); -const defaultContext = { - at() {} -}; -Formatter.declare(); -Formatter.declare({ - platform: 'win32', - quote(text, forceQuote, opts) { - const caretDepth = opts ? (opts.depth || 0) + (opts.isArgument && !opts.isNative ? 1 : 0) : 0; - return quoteForCmd(text, forceQuote, caretDepth); - }, - metaChars: cmdMetaChars, - hasExtraMetaChars: true, - statementSeparator: '&', - createContext(root) { - const context = new this.Context(); - root[preformatSymbol](context); - return context; - }, - Context: Win32Context -}); - -const isObject = any => any === Object(any); -function memoize(f) { - const cache = new WeakMap(); - return arg => { - let result = cache.get(arg); - if (result === void 0) { - result = f(arg); - cache.set(arg, result); - } - return result; - }; -} - -/** - * Represents a contiguous span of text that may or must be quoted. The contents - * may already contain quoted segments, which will always be quoted. If unquoted - * segments also require quoting, the entire span will be quoted together. - * @ignore - */ -class ShellStringText { - constructor(contents, untested) { - this.contents = contents; - this.untested = untested; - } - [formatSymbol](formatter, context) { - const unformattedContents = this.contents; - const length = unformattedContents.length; - const contents = new Array(length); - for (let i = 0; i < length; i++) { - const c = unformattedContents[i]; - contents[i] = isObject(c) && formatSymbol in c ? c[formatSymbol](formatter) : c; - } - for (let unquoted = true, i = 0; i < length; i++) { - const content = contents[i]; - if (content === null) { - unquoted = !unquoted; - } else { - if (unquoted && (formatter.hasExtraMetaChars || this.untested && this.untested.has(i)) && formatter.metaChars.test(content)) { - return formatter.quote(contents.join(''), false, context.at(this)); - } - } - } - const parts = []; - for (let quoted = null, i = 0; i < length; i++) { - const content = contents[i]; - if (content === null) { - quoted = quoted ? (parts.push(formatter.quote(quoted.join(''), true, context.at(this))), null) : []; - } else { - (quoted || parts).push(content); - } - } - const result = parts.join(''); - return result.length ? result : formatter.emptyString; - } - [preformatSymbol](context) { - context.mark(this); - } -} - -/** - * Represents a contiguous span of text that will not be quoted. - * @ignore - */ -class ShellStringUnquoted { - constructor(value) { - this.value = value; - } - [formatSymbol]() { - return this.value; - } - [preformatSymbol](context) { - context.read(this.value); - } -} - -/** - * Represents a semicolon... or an ampersand, on Windows. - * @ignore - */ -const shellStringSemicolon = { - [formatSymbol](formatter) { - return formatter.statementSeparator; - }, - [preformatSymbol](context) { - context.seq(); - } -}; - -const PLACEHOLDER = {}; -const parse = memoize(templateSpans => { - // These are the token types our DSL can recognize. Their values won't escape - // this function. - const TOKEN_TEXT = 0; - const TOKEN_QUOTE = 1; - const TOKEN_SEMI = 2; - const TOKEN_UNQUOTED = 3; - const TOKEN_SPACE = 4; - const TOKEN_REDIRECT = 5; - const result = []; - let placeholderCount = 0; - let prefix = null; - let onlyPrefixOnce = false; - let contents = []; - let quote = 0; - const lastSpan = templateSpans.length - 1; - for (let spanIndex = 0; spanIndex <= lastSpan; spanIndex++) { - const templateSpan = templateSpans[spanIndex]; - const posEnd = templateSpan.length; - let tokenStart = 0; - if (spanIndex) { - placeholderCount++; - contents.push(PLACEHOLDER); - } - // For each span, we first do a recognizing pass in which we use regular - // expressions to identify the positions of tokens in the text, and then - // a second pass that actually splits the text into the minimum number of - // substrings necessary. - const recognized = []; // [type1, index1, type2, index2...] - let firstWordBreak = -1; - let lastWordBreak = -1; - { - let pos = 0, - match; - while (pos < posEnd) { - if (quote) { - if (match = execFrom(quote === CHAR_SQUO ? reQuotation1 : reQuotation2, templateSpan, pos)) { - recognized.push(TOKEN_TEXT, pos); - pos += match[0].length; - } - if (pos < posEnd) { - recognized.push(TOKEN_QUOTE, pos++); - quote = 0; - } - } else { - if (match = execFrom(reRedirectOrSpace, templateSpan, pos)) { - firstWordBreak < 0 && (firstWordBreak = pos); - lastWordBreak = pos; - recognized.push(match[1] ? TOKEN_REDIRECT : TOKEN_SPACE, pos); - pos += match[0].length; - } - if (match = execFrom(reText, templateSpan, pos)) { - const setBreaks = match[1] != null; - setBreaks && firstWordBreak < 0 && (firstWordBreak = pos); - recognized.push(setBreaks ? TOKEN_UNQUOTED : TOKEN_TEXT, pos); - pos += match[0].length; - setBreaks && (lastWordBreak = pos); - } - const char = templateSpan.charCodeAt(pos); - if (char === CHAR_SEMI) { - firstWordBreak < 0 && (firstWordBreak = pos); - recognized.push(TOKEN_SEMI, pos++); - lastWordBreak = pos; - } else if (char === CHAR_SQUO || char === CHAR_DQUO) { - recognized.push(TOKEN_QUOTE, pos++); - quote = char; - } - } - } - } - // Word breaks are only important if they separate words with placeholders, - // so we can ignore the first/last break if this is the first/last span. - spanIndex === 0 && (firstWordBreak = -1); - spanIndex === lastSpan && (lastWordBreak = posEnd); - // Here begins the second pass mentioned above. This loop runs one more - // iteration than there are tokens in recognized, because it handles tokens - // on a one-iteration delay; hence the i <= iEnd instead of i < iEnd. - const iEnd = recognized.length; - for (let i = 0, type = -1; i <= iEnd; i += 2) { - let typeNext = -1, - pos; - if (i === iEnd) { - pos = posEnd; - } else { - typeNext = recognized[i]; - pos = recognized[i + 1]; - // If the next token is space or redirect, but there's another word - // break in this span, then we can handle that token the same way we - // would handle unquoted text because it isn't being attached to a - // placeholder. - typeNext >= TOKEN_SPACE && pos !== lastWordBreak && (typeNext = TOKEN_UNQUOTED); - } - const breakHere = pos === firstWordBreak || pos === lastWordBreak; - if (pos && (breakHere || typeNext !== type)) { - let value = type === TOKEN_QUOTE ? null : type === TOKEN_SEMI ? shellStringSemicolon : templateSpan.substring(tokenStart, pos); - if (type >= TOKEN_SEMI) { - // This branch handles semicolons, unquoted text, spaces, and - // redirects. shellStringSemicolon is already a formatSymbol object; - // the rest need to be wrapped. - type === TOKEN_SEMI || (value = new ShellStringUnquoted(value)); - // We don't need to check placeholderCount here like we do below; - // that's only relevant during the first word break of the span, and - // because this iteration of the loop is processing the token that - // was checked for breaks in the previous iteration, it will have - // already been handled. For the same reason, prefix is guaranteed to - // be null. - if (contents.length) { - result.push(new ShellStringText(contents, null)); - contents = []; - } - // Only spaces and redirects become prefixes, but not if they've been - // rewritten to unquoted above. - if (type >= TOKEN_SPACE) { - prefix = value; - onlyPrefixOnce = type === TOKEN_SPACE; - } else { - result.push(value); - } - } else { - contents.push(value); - } - tokenStart = pos; - } - if (breakHere) { - if (placeholderCount) { - result.push({ - contents, - placeholderCount, - prefix, - onlyPrefixOnce - }); - } else { - // There's no prefix to handle in this branch; a prefix prior to this - // span would mean placeholderCount > 0, and a prefix in this span - // can't be created because spaces and redirects get rewritten to - // unquoted before the last word break. - contents.length && result.push(new ShellStringText(contents, null)); - } - placeholderCount = 0; - prefix = null; - onlyPrefixOnce = false; - contents = []; - } - type = typeNext; - } - } - if (quote) { - throw new SyntaxError(`String is missing a ${String.fromCharCode(quote)} character`); - } - return result; -}); -const CHAR_SEMI = ';'.charCodeAt(); -const CHAR_SQUO = "'".charCodeAt(); -const CHAR_DQUO = '"'.charCodeAt(); -const reQuotation1 = sticky("[^']+"); -const reQuotation2 = sticky('[^"]+'); -const reText = sticky('[^\\s"#$&\'();<>\\\\`|]+|([#$&()\\\\`|]+)'); -const reRedirectOrSpace = sticky('(\\s*\\d*[<>]+\\s*)|\\s+'); - -class BitSet { - constructor() { - this.vector = new Int32Array(1); - } - has(n) { - return (this.vector[n >>> 5] & 1 << n) !== 0; - } - add(n) { - const i = n >>> 5, - requiredLength = i + 1; - let vector = this.vector, - _vector = vector, - length = _vector.length; - if (requiredLength > length) { - while (requiredLength > (length *= 2)); - const oldValues = vector; - vector = new Int32Array(length); - vector.set(oldValues); - this.vector = vector; - } - vector[i] |= 1 << n; - } -} - -function evaluate(template, values) { - values = values.map(toStringishArray); - const children = []; - let valuesStart = 0; - for (let i = 0, iMax = template.length; i < iMax; i++) { - const word = template[i]; - if (formatSymbol in word) { - children.push(word); - continue; - } - const contents = word.contents, - placeholderCount = word.placeholderCount, - prefix = word.prefix, - onlyPrefixOnce = word.onlyPrefixOnce; - const kMax = contents.length; - const valuesEnd = valuesStart + placeholderCount; - const tuples = cartesianProduct(values, valuesStart, valuesEnd); - valuesStart = valuesEnd; - for (let j = 0, jMax = tuples.length; j < jMax; j++) { - const needSpace = j > 0; - const tuple = tuples[j]; - (needSpace || prefix) && children.push(needSpace && (onlyPrefixOnce || !prefix) ? unquotedSpace : prefix); - let interpolatedContents = []; - let untested = null; - let quoting = false; - let tupleIndex = 0; - for (let k = 0; k < kMax; k++) { - const content = contents[k]; - if (content === PLACEHOLDER) { - const value = tuple[tupleIndex++]; - if (quoting) { - interpolatedContents.push(value); - } else { - if (isObject(value) && formatSymbol in value) { - if (interpolatedContents.length) { - children.push(new ShellStringText(interpolatedContents, untested)); - interpolatedContents = []; - untested = null; - } - children.push(value); - } else { - (untested || (untested = new BitSet())).add(interpolatedContents.length); - interpolatedContents.push(value); - } - } - } else { - interpolatedContents.push(content); - content === null && (quoting = !quoting); - } - } - if (interpolatedContents.length) { - children.push(new ShellStringText(interpolatedContents, untested)); - } - } - } - return children; -} -const primToStringish = value => value == null ? '' + value : value; -function toStringishArray(value) { - let array; - switch (true) { - default: - if (isObject(value)) { - if (Array.isArray(value)) { - array = value; - break; - } - if (Symbol.iterator in value) { - array = Array.from(value); - break; - } - } - array = [value]; - } - return array.map(primToStringish); -} -function cartesianProduct(arrs, start, end) { - const size = end - start; - let resultLength = 1; - for (let i = start; i < end; i++) { - resultLength *= arrs[i].length; - } - if (resultLength > 1e6) { - throw new RangeError("Far too many elements to interpolate"); - } - const result = new Array(resultLength); - const indices = new Array(size).fill(0); - for (let i = 0; i < resultLength; i++) { - const value = result[i] = new Array(size); - for (let j = 0; j < size; j++) { - value[j] = arrs[j + start][indices[j]]; - } - for (let j = size - 1; j >= 0; j--) { - if (++indices[j] < arrs[j + start].length) break; - indices[j] = 0; - } - } - return result; -} -const unquotedSpace = new ShellStringUnquoted(' '); - -/** - * A ShellString represents a shell command after it has been interpolated, but - * before it has been formatted for a particular platform. ShellStrings are - * useful if you want to prepare a command for a different platform than the - * current one, for instance. - * - * To create a ShellString, use `ShellString.sh` the same way you would use - * top-level `sh`. - */ -class ShellString { - /** @hideconstructor */ - constructor(children) { - this.children = children; - } - /** - * `ShellString.sh` is a template tag just like `sh`; the only difference is - * that this function returns a ShellString which has not yet been formatted - * into a String. - * @returns {ShellString} - * @function sh - * @static - * @memberof ShellString - */ - static sh(templateSpans) { - for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - values[_key - 1] = arguments[_key]; - } - return new ShellString(evaluate(parse(templateSpans), values)); - } - /** - * A method to format a ShellString into a regular String formatted for a - * particular platform. - * - * @param {String} [platform] a value that `process.platform` might take: - * `'win32'`, `'linux'`, etc.; determines how the string is to be formatted. - * When omitted, effectively the same as `process.platform`. - * @returns {String} - */ - toString(platform) { - return this[formatSymbol](Formatter.for(platform)); - } - [formatSymbol](formatter) { - let context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : formatter.createContext(this); - return this.children.map(child => child[formatSymbol](formatter, context)).join(''); - } - [preformatSymbol](context) { - const children = this.children; - for (let i = 0, iMax = children.length; i < iMax; i++) { - const child = children[i]; - if (preformatSymbol in child) { - child[preformatSymbol](context); - } - } - } -} - -/** - * A Windows-specific version of {@link quoteForShell}. - * @param {String} text to be quoted - * @param {Boolean} [forceQuote] whether to always add quotes even if the string - * is already safe. Defaults to `false`. - */ - -/** - * A Unix-specific version of {@link quoteForShell}. - * @param {String} text to be quoted - * @param {Boolean} [forceQuote] whether to always add quotes even if the string - * is already safe. Defaults to `false`. - */ - -/** - * Quotes a string for injecting into a shell command. - * - * This function is exposed for some hypothetical case when the `sh` DSL simply - * won't do; `sh` is expected to be the more convenient option almost always. - * Compare: - * - * ```javascript - * console.log('cmd' + args.map(a => ' ' + quoteForShell(a)).join('')); - * console.log(sh`cmd ${args}`); // same as above - * - * console.log('cmd' + args.map(a => ' ' + quoteForShell(a, true)).join('')); - * console.log(sh`cmd "${args}"`); // same as above - * ``` - * - * Additionally, on Windows, `sh` checks the entire command string for pipes, - * which subtly change how arguments need to be quoted. If your commands may - * involve pipes, you are strongly encouraged to use `sh` and not try to roll - * your own with `quoteForShell`. - * - * @param {String} text to be quoted - * @param {Boolean} [forceQuote] whether to always add quotes even if the string - * is already safe. Defaults to `false`. - * @param {String} [platform] a value that `process.platform` might take: - * `'win32'`, `'linux'`, etc.; determines how the string is to be formatted. - * When omitted, effectively the same as `process.platform`. - * - * @returns {String} a string that is safe for the current (or specified) - * platform. - */ -function quoteForShell(text, forceQuote, platform) { - return Formatter.for(platform).quote(text, forceQuote); -} - -/** - * A string template tag for safely constructing cross-platform shell commands. - * - * An `sh` template is not actually treated as a literal string to be - * interpolated; instead, it is a tiny DSL designed to make working with shell - * strings safe, simple, and straightforward. To get started quickly, see the - * examples below. {@link #the-sh-dsl More detailed documentation} is available - * further down. - * - * @name sh - * @example - * const title = '"this" & "that"'; - * sh`script --title=${title}`; // => "script '--title=\"this\" & \"that\"'" - * // Note: these examples show results for non-Windows platforms. - * // On Windows, the above would instead be - * // 'script ^^^"--title=\\^^^"this\\^^^" ^^^& \\^^^"that\\^^^"^^^"'. - * - * const names = ['file1', 'file 2']; - * sh`rimraf ${names}.txt`; // => "rimraf file1.txt 'file 2.txt'" - * - * const cmd1 = ['cat', 'file 1.txt', 'file 2.txt']; - * const cmd2 = ['use-input', '-abc']; - * sh`${cmd1}|${cmd2}`; // => "cat 'file 1.txt' 'file 2.txt'|use-input -abc" - * - * @returns {String} - a string formatted for the platform Node is currently - * running on. - */ -const sh = function () { - return ShellString.sh.apply(ShellString, arguments).toString(); -}; - -/** - * This function permits raw strings to be interpolated into a `sh` template. - * - * **IMPORTANT**: If you're using Puka due to security concerns, make sure you - * don't pass any untrusted content to `unquoted`. This may be obvious, but - * stray punctuation in an `unquoted` section can compromise the safety of the - * entire shell command. - * - * @param value - any value (it will be treated as a string) - * - * @example - * const both = true; - * sh`foo ${unquoted(both ? '&&' : '||')} bar`; // => 'foo && bar' - */ -const unquoted = value => new ShellStringUnquoted(value); - -exports.Formatter = Formatter; -exports.ShellString = ShellString; -exports.ShellStringText = ShellStringText; -exports.ShellStringUnquoted = ShellStringUnquoted; -exports.quoteForCmd = quoteForCmd; -exports.quoteForSh = quoteForSh; -exports.quoteForShell = quoteForShell; -exports.sh = sh; -exports.shellStringSemicolon = shellStringSemicolon; -exports.formatSymbol = formatSymbol; -exports.preformatSymbol = preformatSymbol; -exports.unquoted = unquoted; diff --git a/deps/npm/node_modules/puka/package.json b/deps/npm/node_modules/puka/package.json deleted file mode 100644 index 41798dc2493b85..00000000000000 --- a/deps/npm/node_modules/puka/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "puka", - "version": "1.0.1", - "description": "A cross-platform library for safely passing strings through shells", - "keywords": [ - "args", - "arguments", - "cmd", - "command", - "command-line", - "cross-platform", - "escape", - "escaping", - "exec", - "linux", - "mac", - "macos", - "osx", - "quote", - "quoting", - "sh", - "shell", - "spawn", - "unix", - "win", - "win32", - "windows" - ], - "homepage": "https://gitlab.com/rhendric/puka", - "bugs": "https://gitlab.com/rhendric/puka/issues", - "license": "MIT", - "author": "Ryan Hendrickson ", - "repository": "gitlab:rhendric/puka", - "dependencies": {}, - "engines": { - "node": ">=4" - } -} \ No newline at end of file diff --git a/deps/npm/node_modules/semver/package.json b/deps/npm/node_modules/semver/package.json index d4043d38a13529..4e1154195a5f17 100644 --- a/deps/npm/node_modules/semver/package.json +++ b/deps/npm/node_modules/semver/package.json @@ -1,6 +1,6 @@ { "name": "semver", - "version": "7.3.4", + "version": "7.3.5", "description": "The semantic version parser used by npm.", "main": "index.js", "scripts": { diff --git a/deps/npm/node_modules/semver/ranges/subset.js b/deps/npm/node_modules/semver/ranges/subset.js index bb7d15fe2696bb..532fd1364ce754 100644 --- a/deps/npm/node_modules/semver/ranges/subset.js +++ b/deps/npm/node_modules/semver/ranges/subset.js @@ -1,20 +1,28 @@ const Range = require('../classes/range.js') -const { ANY } = require('../classes/comparator.js') +const Comparator = require('../classes/comparator.js') +const { ANY } = Comparator const satisfies = require('../functions/satisfies.js') const compare = require('../functions/compare.js') // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: -// - Every simple range `r1, r2, ...` is a subset of some `R1, R2, ...` +// - Every simple range `r1, r2, ...` is a null set, OR +// - Every simple range `r1, r2, ...` which is not a null set is a subset of +// some `R1, R2, ...` // // Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: // - If c is only the ANY comparator // - If C is only the ANY comparator, return true -// - Else return false +// - Else if in prerelease mode, return false +// - else replace c with `[>=0.0.0]` +// - If C is only the ANY comparator +// - if in prerelease mode, return true +// - else replace C with `[>=0.0.0]` // - Let EQ be the set of = comparators in c // - If EQ is more than one, return true (null set) // - Let GT be the highest > or >= comparator in c // - Let LT be the lowest < or <= comparator in c // - If GT and LT, and GT.semver > LT.semver, return true (null set) +// - If any C is a = range, and GT or LT are set, return false // - If EQ // - If GT, and EQ does not satisfy GT, return true (null set) // - If LT, and EQ does not satisfy LT, return true (null set) @@ -23,13 +31,16 @@ const compare = require('../functions/compare.js') // - If GT // - If GT.semver is lower than any > or >= comp in C, return false // - If GT is >=, and GT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the GT.semver tuple, return false // - If LT // - If LT.semver is greater than any < or <= comp in C, return false // - If LT is <=, and LT.semver does not satisfy every C, return false -// - If any C is a = range, and GT or LT are set, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the LT.semver tuple, return false // - Else return true -const subset = (sub, dom, options) => { +const subset = (sub, dom, options = {}) => { if (sub === dom) return true @@ -58,8 +69,21 @@ const simpleSubset = (sub, dom, options) => { if (sub === dom) return true - if (sub.length === 1 && sub[0].semver === ANY) - return dom.length === 1 && dom[0].semver === ANY + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) + return true + else if (options.includePrerelease) + sub = [ new Comparator('>=0.0.0-0') ] + else + sub = [ new Comparator('>=0.0.0') ] + } + + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) + return true + else + dom = [ new Comparator('>=0.0.0') ] + } const eqSet = new Set() let gt, lt @@ -102,10 +126,32 @@ const simpleSubset = (sub, dom, options) => { let higher, lower let hasDomLT, hasDomGT + // if the subset has a prerelease, we need a comparator in the superset + // with the same tuple and a prerelease, or it's not a subset + let needDomLTPre = lt && + !options.includePrerelease && + lt.semver.prerelease.length ? lt.semver : false + let needDomGTPre = gt && + !options.includePrerelease && + gt.semver.prerelease.length ? gt.semver : false + // exception: <1.2.3-0 is the same as <1.2.3 + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && + lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false + } + for (const c of dom) { hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' if (gt) { + if (needDomGTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomGTPre.major && + c.semver.minor === needDomGTPre.minor && + c.semver.patch === needDomGTPre.patch) { + needDomGTPre = false + } + } if (c.operator === '>' || c.operator === '>=') { higher = higherGT(gt, c, options) if (higher === c && higher !== gt) @@ -114,6 +160,14 @@ const simpleSubset = (sub, dom, options) => { return false } if (lt) { + if (needDomLTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomLTPre.major && + c.semver.minor === needDomLTPre.minor && + c.semver.patch === needDomLTPre.patch) { + needDomLTPre = false + } + } if (c.operator === '<' || c.operator === '<=') { lower = lowerLT(lt, c, options) if (lower === c && lower !== lt) @@ -134,6 +188,12 @@ const simpleSubset = (sub, dom, options) => { if (lt && hasDomGT && !gt && gtltComp !== 0) return false + // we needed a prerelease range in a specific tuple, but didn't get one + // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, + // because it includes prereleases in the 1.2.3 tuple + if (needDomGTPre || needDomLTPre) + return false + return true } diff --git a/deps/npm/package.json b/deps/npm/package.json index afd3b36cb08f7b..c4b10a831b610b 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "7.6.3", + "version": "7.7.0", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ @@ -42,16 +42,16 @@ "./package.json": "./package.json" }, "dependencies": { - "@npmcli/arborist": "^2.2.8", + "@npmcli/arborist": "^2.2.9", "@npmcli/ci-detect": "^1.2.0", - "@npmcli/config": "^1.2.9", - "@npmcli/run-script": "^1.8.3", + "@npmcli/config": "^2.0.0", + "@npmcli/run-script": "^1.8.4", "abbrev": "~1.1.1", "ansicolors": "~0.3.2", "ansistyles": "~0.1.3", "archy": "~1.0.0", "byte-size": "^7.0.1", - "cacache": "^15.0.5", + "cacache": "^15.0.6", "chalk": "^4.1.0", "chownr": "^2.0.0", "cli-columns": "^3.1.2", @@ -59,7 +59,7 @@ "columnify": "~1.5.4", "glob": "^7.1.4", "graceful-fs": "^4.2.6", - "hosted-git-info": "^3.0.8", + "hosted-git-info": "^4.0.1", "ini": "^2.0.0", "init-package-json": "^2.0.2", "is-cidr": "^4.0.2", @@ -74,7 +74,7 @@ "libnpmpublish": "^4.0.0", "libnpmsearch": "^3.1.0", "libnpmteam": "^2.0.2", - "libnpmversion": "^1.0.11", + "libnpmversion": "^1.0.12", "make-fetch-happen": "^8.0.14", "minipass": "^3.1.3", "minipass-pipeline": "^1.2.4", @@ -84,14 +84,14 @@ "node-gyp": "^7.1.2", "nopt": "^5.0.0", "npm-audit-report": "^2.1.4", - "npm-package-arg": "^8.1.1", - "npm-pick-manifest": "^6.1.0", + "npm-package-arg": "^8.1.2", + "npm-pick-manifest": "^6.1.1", "npm-profile": "^5.0.2", "npm-registry-fetch": "^9.0.0", "npm-user-validate": "^1.0.1", "npmlog": "~4.1.2", "opener": "^1.5.2", - "pacote": "^11.3.0", + "pacote": "^11.3.1", "parse-conflict-json": "^1.1.1", "qrcode-terminal": "^0.12.0", "read": "~1.0.7", @@ -99,7 +99,7 @@ "read-package-json-fast": "^2.0.2", "readdir-scoped-modules": "^1.1.0", "rimraf": "^3.0.2", - "semver": "^7.3.4", + "semver": "^7.3.5", "ssri": "^8.0.1", "tar": "^6.1.0", "text-table": "~0.2.0", @@ -180,17 +180,17 @@ "devDependencies": { "@mdx-js/mdx": "^1.6.22", "cmark-gfm": "^0.8.5", - "eslint": "^7.21.0", + "eslint": "^7.22.0", "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.3.1", "eslint-plugin-standard": "^5.0.0", - "jsdom": "^16.4.0", + "jsdom": "^16.5.1", "licensee": "^8.1.0", "marked-man": "^0.7.0", "require-inject": "^1.4.4", "tap": "^14.11.0", - "yaml": "^1.10.0" + "yaml": "^1.10.2" }, "scripts": { "dumpconf": "env | grep npm | sort | uniq", diff --git a/deps/npm/tap-snapshots/test-lib-dist-tag.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-dist-tag.js-TAP.test.js index 89a87ae64e137c..06936795bcf035 100644 --- a/deps/npm/tap-snapshots/test-lib-dist-tag.js-TAP.test.js +++ b/deps/npm/tap-snapshots/test-lib-dist-tag.js-TAP.test.js @@ -8,6 +8,8 @@ exports[`test/lib/dist-tag.js TAP add missing args > should exit usage error message 1`] = ` npm dist-tag +Modify package distribution tags + Usage: npm dist-tag add @ [] npm dist-tag rm @@ -21,6 +23,8 @@ Run "npm help dist-tag" for more info exports[`test/lib/dist-tag.js TAP add missing pkg name > should exit usage error message 1`] = ` npm dist-tag +Modify package distribution tags + Usage: npm dist-tag add @ [] npm dist-tag rm @@ -43,6 +47,8 @@ dist-tag add 1.0.0 to @scoped/another@7.7.7 exports[`test/lib/dist-tag.js TAP borked cmd usage > should show usage error 1`] = ` npm dist-tag +Modify package distribution tags + Usage: npm dist-tag add @ [] npm dist-tag rm @@ -62,6 +68,8 @@ latest: 1.0.0 exports[`test/lib/dist-tag.js TAP ls on missing name in current package > should throw usage error message 1`] = ` npm dist-tag +Modify package distribution tags + Usage: npm dist-tag add @ [] npm dist-tag rm @@ -111,6 +119,8 @@ exports[`test/lib/dist-tag.js TAP remove existing tag > should return success ms exports[`test/lib/dist-tag.js TAP remove missing pkg name > should exit usage error message 1`] = ` npm dist-tag +Modify package distribution tags + Usage: npm dist-tag add @ [] npm dist-tag rm diff --git a/deps/npm/tap-snapshots/test-lib-publish.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-publish.js-TAP.test.js index 97ce7a7733384e..172ed5b29f478e 100644 --- a/deps/npm/tap-snapshots/test-lib-publish.js-TAP.test.js +++ b/deps/npm/tap-snapshots/test-lib-publish.js-TAP.test.js @@ -8,8 +8,13 @@ exports[`test/lib/publish.js TAP shows usage with wrong set of arguments > should print usage 1`] = ` npm publish +Publish a package + Usage: -npm publish [] [--tag ] [--access ] [--dry-run] +npm publish [] + +Options: +[--tag ] [--access ] [--dry-run] Run "npm help publish" for more info ` diff --git a/deps/npm/tap-snapshots/test-lib-utils-config-definition.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-config-definition.js-TAP.test.js new file mode 100644 index 00000000000000..ad506ae8e3585c --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-utils-config-definition.js-TAP.test.js @@ -0,0 +1,264 @@ +/* IMPORTANT + * This snapshot file is auto-generated, but designed for humans. + * It should be checked into source control and tracked carefully. + * Re-generate by setting TAP_SNAPSHOT=1 and running tests. + * Make sure to inspect the output below. Do not ignore changes! + */ +'use strict' +exports[`test/lib/utils/config/definition.js TAP basic definition > description of deprecated thing 1`] = ` +#### \`deprecated\` + +* Default: A number bigger than 1 +* Type: An expression of a numeric quantity using numerals +* DEPRECATED: do not use this + +it should not be used ever + +not even once. +` + +exports[`test/lib/utils/config/definition.js TAP basic definition > human-readable description 1`] = ` +#### \`key\` + +* Default: "some default value" +* Type: Number or String + +just a test thingie +` + +exports[`test/lib/utils/config/definition.js TAP long description > cols=-1 1`] = ` +#### \`walden\` + +* Default: true +* Type: Boolean + +WHEN I WROTE the +following pages, +or rather the +bulk of them, I +lived alone, in +the woods, a +mile from any +neighbor, in a +house which I +had built +myself, on the +shore of Walden +Pond, in +Concord, +Massachusetts, +and earned my +living by the +labor of my +hands only. I +lived there two +years and two +months. At +present I am a +sojourner in +civilized life +again. + +I should not +obtrude my +affairs so much +on the notice of +my readers if +very particular +inquiries had +not been made by +my townsmen +concerning my +mode of life, +which some would +call +impertinent, +though they do +not appear to me +at all +impertinent, +but, considering +the +circumstances, +very natural and +pertinent. + +\`\`\` +this.is('a', { + code: 'sample', +}) + +with (multiple) { + blocks() +} +\`\`\` + +` + +exports[`test/lib/utils/config/definition.js TAP long description > cols=0 1`] = ` +#### \`walden\` + +* Default: true +* Type: Boolean + +WHEN I WROTE the +following pages, +or rather the +bulk of them, I +lived alone, in +the woods, a +mile from any +neighbor, in a +house which I +had built +myself, on the +shore of Walden +Pond, in +Concord, +Massachusetts, +and earned my +living by the +labor of my +hands only. I +lived there two +years and two +months. At +present I am a +sojourner in +civilized life +again. + +I should not +obtrude my +affairs so much +on the notice of +my readers if +very particular +inquiries had +not been made by +my townsmen +concerning my +mode of life, +which some would +call +impertinent, +though they do +not appear to me +at all +impertinent, +but, considering +the +circumstances, +very natural and +pertinent. + +\`\`\` +this.is('a', { + code: 'sample', +}) + +with (multiple) { + blocks() +} +\`\`\` + +` + +exports[`test/lib/utils/config/definition.js TAP long description > cols=40 1`] = ` +#### \`walden\` + +* Default: true +* Type: Boolean + +WHEN I WROTE the following pages, or +rather the bulk of them, I lived +alone, in the woods, a mile from any +neighbor, in a house which I had +built myself, on the shore of Walden +Pond, in Concord, Massachusetts, and +earned my living by the labor of my +hands only. I lived there two years +and two months. At present I am a +sojourner in civilized life again. + +I should not obtrude my affairs so +much on the notice of my readers if +very particular inquiries had not +been made by my townsmen concerning +my mode of life, which some would +call impertinent, though they do not +appear to me at all impertinent, +but, considering the circumstances, +very natural and pertinent. + +\`\`\` +this.is('a', { + code: 'sample', +}) + +with (multiple) { + blocks() +} +\`\`\` + +` + +exports[`test/lib/utils/config/definition.js TAP long description > cols=9000 1`] = ` +#### \`walden\` + +* Default: true +* Type: Boolean + +WHEN I WROTE the following pages, or rather the bulk of them, I lived alone, +in the woods, a mile from any neighbor, in a house which I had built myself, +on the shore of Walden Pond, in Concord, Massachusetts, and earned my living +by the labor of my hands only. I lived there two years and two months. At +present I am a sojourner in civilized life again. + +I should not obtrude my affairs so much on the notice of my readers if very +particular inquiries had not been made by my townsmen concerning my mode of +life, which some would call impertinent, though they do not appear to me at +all impertinent, but, considering the circumstances, very natural and +pertinent. + +\`\`\` +this.is('a', { + code: 'sample', +}) + +with (multiple) { + blocks() +} +\`\`\` + +` + +exports[`test/lib/utils/config/definition.js TAP long description > cols=NaN 1`] = ` +#### \`walden\` + +* Default: true +* Type: Boolean + +WHEN I WROTE the following pages, or rather the bulk of them, I lived alone, +in the woods, a mile from any neighbor, in a house which I had built myself, +on the shore of Walden Pond, in Concord, Massachusetts, and earned my living +by the labor of my hands only. I lived there two years and two months. At +present I am a sojourner in civilized life again. + +I should not obtrude my affairs so much on the notice of my readers if very +particular inquiries had not been made by my townsmen concerning my mode of +life, which some would call impertinent, though they do not appear to me at +all impertinent, but, considering the circumstances, very natural and +pertinent. + +\`\`\` +this.is('a', { + code: 'sample', +}) + +with (multiple) { + blocks() +} +\`\`\` + +` diff --git a/deps/npm/tap-snapshots/test-lib-utils-config-definitions.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-config-definitions.js-TAP.test.js new file mode 100644 index 00000000000000..2ed810da8a2840 --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-utils-config-definitions.js-TAP.test.js @@ -0,0 +1,156 @@ +/* IMPORTANT + * This snapshot file is auto-generated, but designed for humans. + * It should be checked into source control and tracked carefully. + * Re-generate by setting TAP_SNAPSHOT=1 and running tests. + * Make sure to inspect the output below. Do not ignore changes! + */ +'use strict' +exports[`test/lib/utils/config/definitions.js TAP > all config keys 1`] = ` +Array [ + "_auth", + "access", + "all", + "allow-same-version", + "also", + "always-auth", + "audit", + "audit-level", + "auth-type", + "before", + "bin-links", + "browser", + "ca", + "cache", + "cache-max", + "cache-min", + "cafile", + "call", + "cert", + "ci-name", + "cidr", + "color", + "commit-hooks", + "depth", + "description", + "diff", + "diff-ignore-all-space", + "diff-name-only", + "diff-no-prefix", + "diff-dst-prefix", + "diff-src-prefix", + "diff-text", + "diff-unified", + "dry-run", + "editor", + "engine-strict", + "fetch-retries", + "fetch-retry-factor", + "fetch-retry-maxtimeout", + "fetch-retry-mintimeout", + "fetch-timeout", + "force", + "foreground-scripts", + "format-package-lock", + "fund", + "git", + "git-tag-version", + "global", + "global-style", + "globalconfig", + "heading", + "https-proxy", + "if-present", + "ignore-scripts", + "include", + "include-staged", + "init-author-email", + "init-author-name", + "init-author-url", + "init-license", + "init-module", + "init-version", + "init.author.email", + "init.author.name", + "init.author.url", + "init.license", + "init.module", + "init.version", + "json", + "key", + "legacy-bundling", + "legacy-peer-deps", + "link", + "local-address", + "loglevel", + "logs-max", + "long", + "maxsockets", + "message", + "node-options", + "node-version", + "noproxy", + "npm-version", + "offline", + "omit", + "only", + "optional", + "otp", + "package", + "package-lock", + "package-lock-only", + "parseable", + "prefer-offline", + "prefer-online", + "prefix", + "preid", + "production", + "progress", + "proxy", + "read-only", + "rebuild-bundle", + "registry", + "save", + "save-bundle", + "save-dev", + "save-exact", + "save-optional", + "save-peer", + "save-prefix", + "save-prod", + "scope", + "script-shell", + "searchexclude", + "searchlimit", + "searchopts", + "searchstaleness", + "shell", + "shrinkwrap", + "sign-git-commit", + "sign-git-tag", + "sso-poll-frequency", + "sso-type", + "strict-peer-deps", + "strict-ssl", + "tag", + "tag-version-prefix", + "timing", + "tmp", + "umask", + "unicode", + "update-notifier", + "usage", + "user-agent", + "userconfig", + "version", + "versions", + "viewer", + "which", + "workspace", + "workspaces", + "yes", +] +` + +exports[`test/lib/utils/config/definitions.js TAP > all config keys that are shared to flatOptions 1`] = ` +Array [] +` diff --git a/deps/npm/tap-snapshots/test-lib-utils-config-describe-all.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-config-describe-all.js-TAP.test.js new file mode 100644 index 00000000000000..8323e793e075f8 --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-utils-config-describe-all.js-TAP.test.js @@ -0,0 +1,1377 @@ +/* IMPORTANT + * This snapshot file is auto-generated, but designed for humans. + * It should be checked into source control and tracked carefully. + * Re-generate by setting TAP_SNAPSHOT=1 and running tests. + * Make sure to inspect the output below. Do not ignore changes! + */ +'use strict' +exports[`test/lib/utils/config/describe-all.js TAP > must match snapshot 1`] = ` +#### \`_auth\` + +* Default: null +* Type: null or String + +A basic-auth string to use when authenticating against the npm registry. + +Warning: This should generally not be set via a command-line option. It is +safer to use a registry-provided authentication bearer token stored in the +~/.npmrc file by running \`npm login\`. + +#### \`access\` + +* Default: 'restricted' for scoped packages, 'public' for unscoped packages +* Type: null, "restricted", or "public" + +When publishing scoped packages, the access level defaults to \`restricted\`. +If you want your scoped package to be publicly viewable (and installable) +set \`--access=public\`. The only valid values for \`access\` are \`public\` and +\`restricted\`. Unscoped packages _always_ have an access level of \`public\`. + +#### \`all\` + +* Default: false +* Type: Boolean + +When running \`npm outdated\` and \`npm ls\`, setting \`--all\` will show all +outdated or installed packages, rather than only those directly depended +upon by the current project. + +#### \`allow-same-version\` + +* Default: false +* Type: Boolean + +Prevents throwing an error when \`npm version\` is used to set the new version +to the same value as the current version. + +#### \`always-auth\` + +* Default: false +* Type: Boolean + +Force npm to always require authentication when accessing the registry, even +for \`GET\` requests. + +#### \`audit\` + +* Default: true +* Type: Boolean + +When "true" submit audit reports alongside \`npm install\` runs to the default +registry and all registries configured for scopes. See the documentation for +[\`npm audit\`](/commands/npm-audit) for details on what is submitted. + +#### \`audit-level\` + +* Default: null +* Type: "low", "moderate", "high", "critical", "none", or null + +The minimum level of vulnerability for \`npm audit\` to exit with a non-zero +exit code. + +#### \`before\` + +* Default: null +* Type: null or Date + +If passed to \`npm install\`, will rebuild the npm tree such that only +versions that were available **on or before** the \`--before\` time get +installed. If there's no versions available for the current set of direct +dependencies, the command will error. + +If the requested version is a \`dist-tag\` and the given tag does not pass the +\`--before\` filter, the most recent version less than or equal to that tag +will be used. For example, \`foo@latest\` might install \`foo@1.2\` even though +\`latest\` is \`2.0\`. + +#### \`bin-links\` + +* Default: true +* Type: Boolean + +Tells npm to create symlinks (or \`.cmd\` shims on Windows) for package +executables. + +Set to false to have it not do this. This can be used to work around the +fact that some file systems don't support symlinks, even on ostensibly Unix +systems. + +#### \`browser\` + +* Default: OS X: \`"open"\`, Windows: \`"start"\`, Others: \`"xdg-open"\` +* Type: null, Boolean, or String + +The browser that is called by npm commands to open websites. + +Set to \`false\` to suppress browser behavior and instead print urls to +terminal. + +Set to \`true\` to use default system URL opener. + +#### \`ca\` + +* Default: null +* Type: null or String (can be set multiple times) + +The Certificate Authority signing certificate that is trusted for SSL +connections to the registry. Values should be in PEM format (Windows calls +it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string +"\\n". For example: + +\`\`\`ini +ca="-----BEGIN CERTIFICATE-----\\nXXXX\\nXXXX\\n-----END CERTIFICATE-----" +\`\`\` + +Set to \`null\` to only allow "known" registrars, or to a specific CA cert to +trust only that specific signing authority. + +Multiple CAs can be trusted by specifying an array of certificates: + +\`\`\`ini +ca[]="..." +ca[]="..." +\`\`\` + +See also the \`strict-ssl\` config. + +#### \`cache\` + +* Default: Windows: \`%LocalAppData%\\npm-cache\`, Posix: \`~/.npm\` +* Type: Path + +The location of npm's cache directory. See [\`npm +cache\`](/commands/npm-cache) + +#### \`cafile\` + +* Default: null +* Type: Path + +A path to a file containing one or multiple Certificate Authority signing +certificates. Similar to the \`ca\` setting, but allows for multiple CA's, as +well as for the CA information to be stored in a file on disk. + +#### \`call\` + +* Default: "" +* Type: String + +Optional companion option for \`npm exec\`, \`npx\` that allows for specifying a +custom command to be run along with the installed packages. + +\`\`\`bash +npm exec --package yo --package generator-node --call "yo node" +\`\`\` + + +#### \`cert\` + +* Default: null +* Type: null or String + +A client certificate to pass when accessing the registry. Values should be +in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with +newlines replaced by the string "\\n". For example: + +\`\`\`ini +cert="-----BEGIN CERTIFICATE-----\\nXXXX\\nXXXX\\n-----END CERTIFICATE-----" +\`\`\` + +It is _not_ the path to a certificate file (and there is no "certfile" +option). + +#### \`ci-name\` + +* Default: The name of the current CI system, or \`null\` when not on a known CI + platform. +* Type: null or String + +The name of a continuous integration system. If not set explicitly, npm will +detect the current CI environment using the +[\`@npmcli/ci-detect\`](http://npm.im/@npmcli/ci-detect) module. + +#### \`cidr\` + +* Default: null +* Type: null or String (can be set multiple times) + +This is a list of CIDR address to be used when configuring limited access +tokens with the \`npm token create\` command. + +#### \`color\` + +* Default: true unless the NO_COLOR environ is set to something other than '0' +* Type: "always" or Boolean + +If false, never shows colors. If \`"always"\` then always shows colors. If +true, then only prints color codes for tty file descriptors. + +#### \`commit-hooks\` + +* Default: true +* Type: Boolean + +Run git commit hooks when using the \`npm version\` command. + +#### \`depth\` + +* Default: \`Infinity\` if \`--all\` is set, otherwise \`1\` +* Type: null or Number + +The depth to go when recursing packages for \`npm ls\`. + +If not set, \`npm ls\` will show only the immediate dependencies of the root +project. If \`--all\` is set, then npm will show all dependencies by default. + +#### \`description\` + +* Default: true +* Type: Boolean + +Show the description in \`npm search\` + +#### \`diff\` + +* Default: +* Type: String (can be set multiple times) + +Define arguments to compare in \`npm diff\`. + +#### \`diff-dst-prefix\` + +* Default: "b/" +* Type: String + +Destination prefix to be used in \`npm diff\` output. + +#### \`diff-ignore-all-space\` + +* Default: false +* Type: Boolean + +Ignore whitespace when comparing lines in \`npm diff\`. + +#### \`diff-name-only\` + +* Default: false +* Type: Boolean + +Prints only filenames when using \`npm diff\`. + +#### \`diff-no-prefix\` + +* Default: false +* Type: Boolean + +Do not show any source or destination prefix in \`npm diff\` output. + +Note: this causes \`npm diff\` to ignore the \`--diff-src-prefix\` and +\`--diff-dst-prefix\` configs. + +#### \`diff-src-prefix\` + +* Default: "a/" +* Type: String + +Source prefix to be used in \`npm diff\` output. + +#### \`diff-text\` + +* Default: false +* Type: Boolean + +Treat all files as text in \`npm diff\`. + +#### \`diff-unified\` + +* Default: 3 +* Type: Number + +The number of lines of context to print in \`npm diff\`. + +#### \`dry-run\` + +* Default: false +* Type: Boolean + +Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, \`install\`, \`update\`, +\`dedupe\`, \`uninstall\`, as well as \`pack\` and \`publish\`. + +Note: This is NOT honored by other network related commands, eg \`dist-tags\`, +\`owner\`, etc. + +#### \`editor\` + +* Default: The EDITOR or VISUAL environment variables, or 'notepad.exe' on + Windows, or 'vim' on Unix systems +* Type: String + +The command to run for \`npm edit\` and \`npm config edit\`. + +#### \`engine-strict\` + +* Default: false +* Type: Boolean + +If set to true, then npm will stubbornly refuse to install (or even consider +installing) any package that claims to not be compatible with the current +Node.js version. + +This can be overridden by setting the \`--force\` flag. + +#### \`fetch-retries\` + +* Default: 2 +* Type: Number + +The "retries" config for the \`retry\` module to use when fetching packages +from the registry. + +npm will retry idempotent read requests to the registry in the case of +network failures or 5xx HTTP errors. + +#### \`fetch-retry-factor\` + +* Default: 10 +* Type: Number + +The "factor" config for the \`retry\` module to use when fetching packages. + +#### \`fetch-retry-maxtimeout\` + +* Default: 60000 (1 minute) +* Type: Number + +The "maxTimeout" config for the \`retry\` module to use when fetching +packages. + +#### \`fetch-retry-mintimeout\` + +* Default: 10000 (10 seconds) +* Type: Number + +The "minTimeout" config for the \`retry\` module to use when fetching +packages. + +#### \`fetch-timeout\` + +* Default: 300000 (5 minutes) +* Type: Number + +The maximum amount of time to wait for HTTP requests to complete. + +#### \`force\` + +* Default: false +* Type: Boolean + +Removes various protections against unfortunate side effects, common +mistakes, unnecessary performance degradation, and malicious input. + +* Allow clobbering non-npm files in global installs. +* Allow the \`npm version\` command to work on an unclean git repository. +* Allow deleting the cache folder with \`npm cache clean\`. +* Allow installing packages that have an \`engines\` declaration requiring a + different version of npm. +* Allow installing packages that have an \`engines\` declaration requiring a + different version of \`node\`, even if \`--engine-strict\` is enabled. +* Allow \`npm audit fix\` to install modules outside your stated dependency + range (including SemVer-major changes). +* Allow unpublishing all versions of a published package. +* Allow conflicting peerDependencies to be installed in the root project. + +If you don't have a clear idea of what you want to do, it is strongly +recommended that you do not use this option! + +#### \`foreground-scripts\` + +* Default: false +* Type: Boolean + +Run all build scripts (ie, \`preinstall\`, \`install\`, and \`postinstall\`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. + +#### \`format-package-lock\` + +* Default: true +* Type: Boolean + +Format \`package-lock.json\` or \`npm-shrinkwrap.json\` as a human readable +file. + +#### \`fund\` + +* Default: true +* Type: Boolean + +When "true" displays the message at the end of each \`npm install\` +acknowledging the number of dependencies looking for funding. See [\`npm +fund\`](/commands/npm-fund) for details. + +#### \`git\` + +* Default: "git" +* Type: String + +The command to use for git commands. If git is installed on the computer, +but is not in the \`PATH\`, then set this to the full path to the git binary. + +#### \`git-tag-version\` + +* Default: true +* Type: Boolean + +Tag the commit when using the \`npm version\` command. + +#### \`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. + +#### \`globalconfig\` + +* Default: The global --prefix setting plus 'etc/npmrc'. For example, + '/usr/local/etc/npmrc' +* Type: Path + +The config file to read for global config options. + +#### \`heading\` + +* Default: "npm" +* Type: String + +The string that starts all the debugging log output. + +#### \`https-proxy\` + +* Default: null +* Type: null or URL + +A proxy to use for outgoing https requests. If the \`HTTPS_PROXY\` or +\`https_proxy\` or \`HTTP_PROXY\` or \`http_proxy\` environment variables are set, +proxy settings will be honored by the underlying \`make-fetch-happen\` +library. + +#### \`if-present\` + +* Default: false +* Type: Boolean + +If true, npm will not exit with an error code when \`run-script\` is invoked +for a script that isn't defined in the \`scripts\` section of \`package.json\`. +This option can be used when it's desirable to optionally run a script when +it's present and fail if the script fails. This is useful, for example, when +running scripts that may only apply for some builds in an otherwise generic +CI setup. + +#### \`ignore-scripts\` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +#### \`include\` + +* Default: +* Type: "prod", "dev", "optional", or "peer" (can be set multiple times) + +Option that allows for defining which types of dependencies to install. + +This is the inverse of \`--omit=\`. + +Dependency types specified in \`--include\` will not be omitted, regardless of +the order in which omit/include are specified on the command-line. + +#### \`include-staged\` + +* Default: false +* Type: Boolean + +Allow installing "staged" published packages, as defined by [npm RFC PR +#92](https://github.com/npm/rfcs/pull/92). + +This is experimental, and not implemented by the npm public registry. + +#### \`init-author-email\` + +* Default: "" +* Type: String + +The value \`npm init\` should use by default for the package author's email. + +#### \`init-author-name\` + +* Default: "" +* Type: String + +The value \`npm init\` should use by default for the package author's name. + +#### \`init-author-url\` + +* Default: "" +* Type: "" or URL + +The value \`npm init\` should use by default for the package author's +homepage. + +#### \`init-license\` + +* Default: "ISC" +* Type: String + +The value \`npm init\` should use by default for the package license. + +#### \`init-module\` + +* Default: "~/.npm-init.js" +* Type: Path + +A module that will be loaded by the \`npm init\` command. See the +documentation for the +[init-package-json](https://github.com/npm/init-package-json) module for +more information, or [npm init](/commands/npm-init). + +#### \`init-version\` + +* Default: "1.0.0" +* Type: SemVer string + +The value that \`npm init\` should use by default for the package version +number, if not already set in package.json. + +#### \`json\` + +* Default: false +* Type: Boolean + +Whether or not to output JSON data, rather than the normal output. + +This feature is currently experimental, and the output data structures for +many commands is either not implemented in JSON yet, or subject to change. +Only the output from \`npm ls --json\` and \`npm search --json\` are currently +valid. + +#### \`key\` + +* Default: null +* Type: null or String + +A client key to pass when accessing the registry. Values should be in PEM +format with newlines replaced by the string "\\n". For example: + +\`\`\`ini +key="-----BEGIN PRIVATE KEY-----\\nXXXX\\nXXXX\\n-----END PRIVATE KEY-----" +\`\`\` + +It is _not_ the path to a key file (and there is no "keyfile" option). + +#### \`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. + +#### \`legacy-peer-deps\` + +* Default: false +* Type: Boolean + +Causes npm to completely ignore \`peerDependencies\` when building a package +tree, as in npm versions 3 through 6. + +If a package cannot be installed because of overly strict \`peerDependencies\` +that collide, it provides a way to move forward resolving the situation. + +This differs from \`--omit=peer\`, in that \`--omit=peer\` will avoid unpacking +\`peerDependencies\` on disk, but will still design a tree such that +\`peerDependencies\` _could_ be unpacked in a correct place. + +Use of \`legacy-peer-deps\` is not recommended, as it will not enforce the +\`peerDependencies\` contract that meta-dependencies may rely on. + +#### \`link\` + +* Default: false +* Type: Boolean + +If true, then local installs will link if there is a suitable globally +installed package. + +Note that this means that local installs can cause things to be installed +into the global space at the same time. The link is only done if one of the +two conditions are met: + +* The package is not already installed globally, or +* the globally installed version is identical to the version that is being + installed locally. + +#### \`local-address\` + +* Default: null +* Type: IP Address + +The IP address of the local interface to use when making connections to the +npm registry. Must be IPv4 in versions of Node prior to 0.12. + +#### \`loglevel\` + +* Default: "notice" +* Type: "silent", "error", "warn", "notice", "http", "timing", "info", + "verbose", or "silly" + +What level of logs to report. On failure, *all* logs are written to +\`npm-debug.log\` in the current working directory. + +Any logs of a higher level than the setting are shown. The default is +"notice". + +#### \`logs-max\` + +* Default: 10 +* Type: Number + +The maximum number of log files to store. + +#### \`long\` + +* Default: false +* Type: Boolean + +Show extended information in \`npm ls\` and \`npm search\`. + +#### \`maxsockets\` + +* Default: Infinity +* Type: Number + +The maximum number of connections to use per origin (protocol/host/port +combination). + +#### \`message\` + +* Default: "%s" +* Type: String + +Commit message which is used by \`npm version\` when creating version commit. + +Any "%s" in the message will be replaced with the version number. + +#### \`node-options\` + +* Default: null +* Type: null or String + +Options to pass through to Node.js via the \`NODE_OPTIONS\` environment +variable. This does not impact how npm itself is executed but it does impact +how lifecycle scripts are called. + +#### \`node-version\` + +* Default: Node.js \`process.version\` value +* Type: SemVer string + +The node version to use when checking a package's \`engines\` setting. + +#### \`noproxy\` + +* Default: The value of the NO_PROXY environment variable +* Type: String (can be set multiple times) + +Domain extensions that should bypass any proxies. + +Also accepts a comma-delimited string. + +#### \`npm-version\` + +* Default: Output of \`npm --version\` +* Type: SemVer string + +The npm version to use when checking a package's \`engines\` setting. + +#### \`offline\` + +* Default: false +* Type: Boolean + +Force offline mode: no network requests will be done during install. To +allow the CLI to fill in missing cache data, see \`--prefer-offline\`. + +#### \`omit\` + +* Default: 'dev' if the NODE_ENV environment variable is set to 'production', + otherwise empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) + +Dependency types to omit from the installation tree on disk. + +Note that these dependencies _are_ still resolved and added to the +\`package-lock.json\` or \`npm-shrinkwrap.json\` file. They are just not +physically installed on disk. + +If a package type appears in both the \`--include\` and \`--omit\` lists, then +it will be included. + +If the resulting omit list includes \`'dev'\`, then the \`NODE_ENV\` environment +variable will be set to \`'production'\` for all lifecycle scripts. + +#### \`otp\` + +* Default: null +* Type: null or String + +This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with \`npm access\`. + +If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one. + +#### \`package\` + +* Default: +* Type: String (can be set multiple times) + +The package to install for [\`npm exec\`](/commands/npm-exec) + +#### \`package-lock\` + +* Default: true +* Type: Boolean + +If set to false, then ignore \`package-lock.json\` files when installing. This +will also prevent _writing_ \`package-lock.json\` if \`save\` is true. + +When package package-locks are disabled, automatic pruning of extraneous +modules will also be disabled. To remove extraneous modules with +package-locks disabled use \`npm prune\`. + +#### \`package-lock-only\` + +* Default: false +* Type: Boolean + +If set to true, it will update only the \`package-lock.json\`, instead of +checking \`node_modules\` and downloading dependencies. + +#### \`parseable\` + +* Default: false +* Type: Boolean + +Output parseable results from commands that write to standard output. For +\`npm search\`, this will be tab-separated table format. + +#### \`prefer-offline\` + +* Default: false +* Type: Boolean + +If true, staleness checks for cached data will be bypassed, but missing data +will be requested from the server. To force full offline mode, use +\`--offline\`. + +#### \`prefer-online\` + +* Default: false +* Type: Boolean + +If true, staleness checks for cached data will be forced, making the CLI +look for updates immediately even for fresh package data. + +#### \`prefix\` + +* Default: In global mode, the folder where the node executable is installed. + In local mode, the nearest parent folder containing either a package.json + file or a node_modules folder. +* Type: Path + +The location to install global items. If set on the command line, then it +forces non-global commands to run in the specified folder. + +#### \`preid\` + +* Default: "" +* Type: String + +The "prerelease identifier" to use as a prefix for the "prerelease" part of +a semver. Like the \`rc\` in \`1.2.0-rc.8\`. + +#### \`progress\` + +* Default: \`true\` unless running in a known CI system +* Type: Boolean + +When set to \`true\`, npm will display a progress bar during time intensive +operations, if \`process.stderr\` is a TTY. + +Set to \`false\` to suppress the progress bar. + +#### \`proxy\` + +* Default: null +* Type: null, false, or URL + +A proxy to use for outgoing http requests. If the \`HTTP_PROXY\` or +\`http_proxy\` environment variables are set, proxy settings will be honored +by the underlying \`request\` library. + +#### \`read-only\` + +* Default: false +* Type: Boolean + +This is used to mark a token as unable to publish when configuring limited +access tokens with the \`npm token create\` command. + +#### \`rebuild-bundle\` + +* Default: true +* Type: Boolean + +Rebuild bundled dependencies after installation. + +#### \`registry\` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + +#### \`save\` + +* Default: true +* 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. + +#### \`save-bundle\` + +* Default: false +* Type: Boolean + +If a package would be saved at install time by the use of \`--save\`, +\`--save-dev\`, or \`--save-optional\`, then also put it in the +\`bundleDependencies\` list. + +Ignore if \`--save-peer\` is set, since peerDependencies cannot be bundled. + +#### \`save-dev\` + +* Default: false +* Type: Boolean + +Save installed packages to a package.json file as \`devDependencies\`. + +#### \`save-exact\` + +* Default: false +* Type: Boolean + +Dependencies saved to package.json will be configured with an exact version +rather than using npm's default semver range operator. + +#### \`save-optional\` + +* Default: false +* Type: Boolean + +Save installed packages to a package.json file as \`optionalDependencies\`. + +#### \`save-peer\` + +* Default: false +* Type: Boolean + +Save installed packages. to a package.json file as \`peerDependencies\` + +#### \`save-prefix\` + +* Default: "^" +* Type: String + +Configure how versions of packages installed to a package.json file via +\`--save\` or \`--save-dev\` get prefixed. + +For example if a package has version \`1.2.3\`, by default its version is set +to \`^1.2.3\` which allows minor upgrades for that package, but after \`npm +config set save-prefix='~'\` it would be set to \`~1.2.3\` which only allows +patch upgrades. + +#### \`save-prod\` + +* Default: false +* Type: Boolean + +Save installed packages into \`dependencies\` specifically. This is useful if +a package already exists in \`devDependencies\` or \`optionalDependencies\`, but +you want to move it to be a non-optional production dependency. + +This is the default behavior if \`--save\` is true, and neither \`--save-dev\` +or \`--save-optional\` are true. + +#### \`scope\` + +* Default: the scope of the current project, if any, or "" +* Type: String + +Associate an operation with a scope for a scoped registry. + +Useful when logging in to a private registry for the first time: + +\`\`\`bash +npm login --scope=@mycorp --registry=https://registry.mycorp.com +\`\`\` + +This will cause \`@mycorp\` to be mapped to the registry for future +installation of packages specified according to the pattern +\`@mycorp/package\`. + +#### \`script-shell\` + +* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows +* Type: null or String + +The shell to use for scripts run with the \`npm run\` command. + +#### \`searchexclude\` + +* Default: "" +* Type: String + +Space-separated options that limit the results from search. + +#### \`searchlimit\` + +* Default: 20 +* Type: Number + +Number of items to limit search results to. Will not apply at all to legacy +searches. + +#### \`searchopts\` + +* Default: "" +* Type: String + +Space-separated options that are always passed to search. + +#### \`searchstaleness\` + +* Default: 900 +* Type: Number + +The age of the cache, in seconds, before another registry request is made if +using legacy search endpoint. + +#### \`shell\` + +* Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on + Windows +* Type: String + +The shell to run for the \`npm explore\` command. + +#### \`sign-git-commit\` + +* Default: false +* Type: Boolean + +If set to true, then the \`npm version\` command will commit the new package +version using \`-S\` to add a signature. + +Note that git requires you to have set up GPG keys in your git configs for +this to work properly. + +#### \`sign-git-tag\` + +* Default: false +* Type: Boolean + +If set to true, then the \`npm version\` command will tag the version using +\`-s\` to add a signature. + +Note that git requires you to have set up GPG keys in your git configs for +this to work properly. + +#### \`strict-peer-deps\` + +* Default: false +* Type: Boolean + +If set to \`true\`, and \`--legacy-peer-deps\` is not set, then _any_ +conflicting \`peerDependencies\` will be treated as an install failure, even +if npm could reasonably guess the appropriate resolution based on non-peer +dependency relationships. + +By default, conflicting \`peerDependencies\` deep in the dependency graph will +be resolved using the nearest non-peer dependency specification, even if +doing so will result in some packages receiving a peer dependency outside +the range set in their package's \`peerDependencies\` object. + +When such 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. + +#### \`strict-ssl\` + +* Default: true +* Type: Boolean + +Whether or not to do SSL key validation when making requests to the registry +via https. + +See also the \`ca\` config. + +#### \`tag\` + +* Default: "latest" +* Type: String + +If you ask npm to install a package and don't tell it a specific version, +then it will install the specified tag. + +Also the tag that is added to the package@version specified by the \`npm tag\` +command, if no explicit tag is given. + +#### \`tag-version-prefix\` + +* Default: "v" +* Type: String + +If set, alters the prefix used when tagging a new version when performing a +version increment using \`npm-version\`. To remove the prefix altogether, set +it to the empty string: \`""\`. + +Because other tools may rely on the convention that npm version tags look +like \`v1.0.0\`, _only use this property if it is absolutely necessary_. In +particular, use care when overriding this setting for public packages. + +#### \`timing\` + +* Default: false +* Type: Boolean + +If true, writes an \`npm-debug\` log to \`_logs\` and timing information to +\`_timing.json\`, both in your cache, even if the command completes +successfully. \`_timing.json\` is a newline delimited list of JSON objects. + +You can quickly view it with this [json](https://npm.im/json) command line: +\`npm exec -- json -g < ~/.npm/_timing.json\`. + +#### \`umask\` + +* Default: 0 +* Type: Octal numeric string in range 0000..0777 (0..511) + +The "umask" value to use when setting the file creation mode on files and +folders. + +Folders and executables are given a mode which is \`0o777\` masked against +this value. Other files are given a mode which is \`0o666\` masked against +this value. + +Note that the underlying system will _also_ apply its own umask value to +files and folders that are created, and npm does not circumvent this, but +rather adds the \`--umask\` config to it. + +Thus, the effective default umask value on most POSIX systems is 0o22, +meaning that folders and executables are created with a mode of 0o755 and +other files are created with a mode of 0o644. + +#### \`unicode\` + +* Default: false on windows, true on mac/unix systems with a unicode locale, + as defined by the LC_ALL, LC_CTYPE, or LANG environment variables. +* Type: Boolean + +When set to true, npm uses unicode characters in the tree output. When +false, it uses ascii characters instead of unicode glyphs. + +#### \`update-notifier\` + +* Default: true +* Type: Boolean + +Set to false to suppress the update notification when using an older version +of npm than the latest. + +#### \`usage\` + +* Default: false +* Type: Boolean + +Show short usage output about the command specified. + +#### \`user-agent\` + +* Default: "npm/{npm-version} node/{node-version} {platform} {arch} {ci}" +* Type: String + +Sets the User-Agent request header. The following fields are replaced with +their actual counterparts: + +* \`{npm-version}\` - The npm version in use +* \`{node-version}\` - The Node.js version in use +* \`{platform}\` - The value of \`process.platform\` +* \`{arch}\` - The value of \`process.arch\` +* \`{ci}\` - The value of the \`ci-name\` config, if set, prefixed with \`ci/\`, or + an empty string if \`ci-name\` is empty. + +#### \`userconfig\` + +* Default: "~/.npmrc" +* Type: Path + +The location of user-level configuration settings. + +This may be overridden by the \`npm_config_userconfig\` environment variable +or the \`--userconfig\` command line option, but may _not_ be overridden by +settings in the \`globalconfig\` file. + +#### \`version\` + +* Default: false +* Type: Boolean + +If true, output the npm version and exit successfully. + +Only relevant when specified explicitly on the command line. + +#### \`versions\` + +* Default: false +* Type: Boolean + +If true, output the npm version as well as node's \`process.versions\` map and +the version in the current working directory's \`package.json\` file if one +exists, and exit successfully. + +Only relevant when specified explicitly on the command line. + +#### \`viewer\` + +* Default: "man" on Posix, "browser" on Windows +* Type: String + +The program to use to view help content. + +Set to \`"browser"\` to view html help content in the default web browser. + +#### \`which\` + +* Default: null +* Type: null or Number + +If there are multiple funding sources, which 1-indexed source URL to open. + +#### \`workspace\` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the \`workspace\` config are either: - Workspace names - Path +to a workspace directory - Path to a parent workspace directory (will result +to selecting all of the nested workspaces) + +#### \`workspaces\` + +* Default: false +* Type: Boolean + +Enable running a command in the context of **all** the configured +workspaces. + +#### \`yes\` + +* Default: null +* Type: null or Boolean + +Automatically answer "yes" to any prompts that npm might print on the +command line. + +#### \`also\` + +* Default: null +* Type: null, "dev", or "development" +* DEPRECATED: Please use --include=dev instead. + +When set to \`dev\` or \`development\`, this is an alias for \`--include=dev\`. + +#### \`auth-type\` + +* Default: "legacy" +* Type: "legacy", "sso", "saml", or "oauth" +* DEPRECATED: This method of SSO/SAML/OAuth is deprecated and will be removed + in a future version of npm in favor of web-based login. + +What authentication strategy to use with \`adduser\`/\`login\`. + +#### \`cache-max\` + +* Default: Infinity +* Type: Number +* DEPRECATED: This option has been deprecated in favor of \`--prefer-online\` + +\`--cache-max=0\` is an alias for \`--prefer-online\` + +#### \`cache-min\` + +* Default: 0 +* Type: Number +* DEPRECATED: This option has been deprecated in favor of \`--prefer-offline\`. + +\`--cache-min=9999 (or bigger)\` is an alias for \`--prefer-offline\`. + +#### \`init.author.email\` + +* Default: "" +* Type: String +* DEPRECATED: Use \`--init-author-email\` instead. + +Alias for \`--init-author-email\` + +#### \`init.author.name\` + +* Default: "" +* Type: String +* DEPRECATED: Use \`--init-author-name\` instead. + +Alias for \`--init-author-name\` + +#### \`init.author.url\` + +* Default: "" +* Type: "" or URL +* DEPRECATED: Use \`--init-author-url\` instead. + +Alias for \`--init-author-url\` + +#### \`init.license\` + +* Default: "ISC" +* Type: String +* DEPRECATED: Use \`--init-license\` instead. + +Alias for \`--init-license\` + +#### \`init.module\` + +* Default: "~/.npm-init.js" +* Type: Path +* DEPRECATED: Use \`--init-module\` instead. + +Alias for \`--init-module\` + +#### \`init.version\` + +* Default: "1.0.0" +* Type: SemVer string +* DEPRECATED: Use \`--init-version\` instead. + +Alias for \`--init-version\` + +#### \`only\` + +* Default: null +* Type: null, "prod", or "production" +* DEPRECATED: Use \`--omit=dev\` to omit dev dependencies from the install. + +When set to \`prod\` or \`production\`, this is an alias for \`--omit=dev\`. + +#### \`optional\` + +* Default: null +* Type: null or Boolean +* DEPRECATED: Use \`--omit=optional\` to exclude optional dependencies, or + \`--include=optional\` to include them. + +Default value does install optional deps unless otherwise omitted. + +Alias for --include=optional or --omit=optional + +#### \`production\` + +* Default: false +* Type: Boolean +* DEPRECATED: Use \`--omit=dev\` instead. + +Alias for \`--omit=dev\` + +#### \`shrinkwrap\` + +* Default: true +* Type: Boolean +* DEPRECATED: Use the --package-lock setting instead. + +Alias for --package-lock + +#### \`sso-poll-frequency\` + +* Default: 500 +* Type: Number +* DEPRECATED: The --auth-type method of SSO/SAML/OAuth will be removed in a + future version of npm in favor of web-based login. + +When used with SSO-enabled \`auth-type\`s, configures how regularly the +registry should be polled while the user is completing authentication. + +#### \`sso-type\` + +* Default: "oauth" +* Type: null, "oauth", or "saml" +* DEPRECATED: The --auth-type method of SSO/SAML/OAuth will be removed in a + future version of npm in favor of web-based login. + +If \`--auth-type=sso\`, the type of SSO type to use. + +#### \`tmp\` + +* Default: The value returned by the Node.js \`os.tmpdir()\` method + +* Type: Path +* DEPRECATED: This setting is no longer used. npm stores temporary files in a + special location in the cache, and they are managed by + [\`cacache\`](http://npm.im/cacache). + +Historically, the location where temporary files were stored. No longer +relevant. +` diff --git a/deps/npm/tap-snapshots/test-lib-utils-config-index.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-config-index.js-TAP.test.js new file mode 100644 index 00000000000000..1e5ca232452e02 --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-utils-config-index.js-TAP.test.js @@ -0,0 +1,133 @@ +/* IMPORTANT + * This snapshot file is auto-generated, but designed for humans. + * It should be checked into source control and tracked carefully. + * Re-generate by setting TAP_SNAPSHOT=1 and running tests. + * Make sure to inspect the output below. Do not ignore changes! + */ +'use strict' +exports[`test/lib/utils/config/index.js TAP > shorthands 1`] = ` +Object { + "?": Array [ + "--usage", + ], + "a": Array [ + "--all", + ], + "B": Array [ + "--save-bundle", + ], + "c": Array [ + "--call", + ], + "C": Array [ + "--prefix", + ], + "d": Array [ + "--loglevel", + "info", + ], + "D": Array [ + "--save-dev", + ], + "dd": Array [ + "--loglevel", + "verbose", + ], + "ddd": Array [ + "--loglevel", + "silly", + ], + "desc": Array [ + "--description", + ], + "E": Array [ + "--save-exact", + ], + "enjoy-by": Array [ + "--before", + ], + "f": Array [ + "--force", + ], + "g": Array [ + "--global", + ], + "h": Array [ + "--usage", + ], + "H": Array [ + "--usage", + ], + "help": Array [ + "--usage", + ], + "l": Array [ + "--long", + ], + "local": Array [ + "--no-global", + ], + "m": Array [ + "--message", + ], + "n": Array [ + "--no-yes", + ], + "no": Array [ + "--no-yes", + ], + "O": Array [ + "--save-optional", + ], + "p": Array [ + "--parseable", + ], + "P": Array [ + "--save-prod", + ], + "porcelain": Array [ + "--parseable", + ], + "q": Array [ + "--loglevel", + "warn", + ], + "quiet": Array [ + "--loglevel", + "warn", + ], + "readonly": Array [ + "--read-only", + ], + "reg": Array [ + "--registry", + ], + "s": Array [ + "--loglevel", + "silent", + ], + "S": Array [ + "--save", + ], + "silent": Array [ + "--loglevel", + "silent", + ], + "v": Array [ + "--version", + ], + "verbose": Array [ + "--loglevel", + "verbose", + ], + "w": Array [ + "--workspace", + ], + "ws": Array [ + "--workspaces", + ], + "y": Array [ + "--yes", + ], +} +` diff --git a/deps/npm/tap-snapshots/test-lib-utils-config.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-config.js-TAP.test.js deleted file mode 100644 index 39927e600e1232..00000000000000 --- a/deps/npm/tap-snapshots/test-lib-utils-config.js-TAP.test.js +++ /dev/null @@ -1,1110 +0,0 @@ -/* IMPORTANT - * This snapshot file is auto-generated, but designed for humans. - * It should be checked into source control and tracked carefully. - * Re-generate by setting TAP_SNAPSHOT=1 and running tests. - * Make sure to inspect the output below. Do not ignore changes! - */ -'use strict' -exports[`test/lib/utils/config.js TAP no working network interfaces, on windows > must match snapshot 1`] = ` -Object { - "defaults": Object { - "_auth": null, - "access": null, - "all": false, - "allow-same-version": false, - "also": null, - "always-auth": false, - "audit": true, - "audit-level": null, - "auth-type": "legacy", - "before": null, - "bin-links": true, - "browser": null, - "ca": null, - "cache": "{CACHE DIR} npm-cache", - "cache-lock-retries": 10, - "cache-lock-stale": 60000, - "cache-lock-wait": 10000, - "cache-max": null, - "cache-min": 10, - "cafile": null, - "call": "", - "cert": null, - "ci-name": null, - "cidr": null, - "color": true, - "commit-hooks": true, - "depth": null, - "description": true, - "dev": false, - "diff": Array [], - "diff-dst-prefix": "", - "diff-ignore-all-space": false, - "diff-name-only": false, - "diff-no-prefix": false, - "diff-src-prefix": "", - "diff-text": false, - "diff-unified": null, - "dry-run": false, - "editor": "vim", - "engine-strict": false, - "fetch-retries": 2, - "fetch-retry-factor": 10, - "fetch-retry-maxtimeout": 60000, - "fetch-retry-mintimeout": 10000, - "fetch-timeout": 300000, - "force": false, - "foreground-script": false, - "format-package-lock": true, - "fund": true, - "git": "git", - "git-tag-version": true, - "global": false, - "global-style": false, - "heading": "npm", - "https-proxy": null, - "if-present": false, - "ignore-prepublish": false, - "ignore-scripts": false, - "include": Array [], - "include-staged": false, - "init-author-email": "", - "init-author-name": "", - "init-author-url": "", - "init-license": "ISC", - "init-module": "~/.npm-init.js", - "init-version": "1.0.0", - "init.author.email": "", - "init.author.name": "", - "init.author.url": "", - "init.license": "ISC", - "init.module": "~/.npm-init.js", - "init.version": "1.0.0", - "json": false, - "key": null, - "legacy-bundling": false, - "legacy-peer-deps": false, - "link": false, - "local-address": undefined, - "loglevel": "notice", - "logs-max": 10, - "long": false, - "maxsockets": 50, - "message": "%s", - "node-options": null, - "node-version": "v14.8.0", - "noproxy": null, - "npm-version": "7.0.0", - "offline": false, - "omit": Array [], - "only": null, - "optional": true, - "otp": null, - "package": Array [], - "package-lock": true, - "package-lock-only": false, - "parseable": false, - "prefer-offline": false, - "prefer-online": false, - "preid": "", - "production": false, - "progress": true, - "proxy": null, - "read-only": false, - "rebuild-bundle": true, - "registry": "https://registry.npmjs.org/", - "rollback": true, - "save": true, - "save-bundle": false, - "save-dev": false, - "save-exact": false, - "save-optional": false, - "save-prefix": "^", - "save-prod": false, - "scope": "", - "script-shell": null, - "scripts-prepend-node-path": "warn-only", - "searchexclude": null, - "searchlimit": 20, - "searchopts": "", - "searchstaleness": 900, - "shell": "cmd.exe", - "shrinkwrap": true, - "sign-git-commit": false, - "sign-git-tag": false, - "sso-poll-frequency": 500, - "sso-type": "oauth", - "strict-peer-deps": false, - "strict-ssl": true, - "tag": "latest", - "tag-version-prefix": "v", - "timing": false, - "tmp": "/tmp", - "umask": 0, - "unicode": true, - "update-notifier": true, - "usage": false, - "user-agent": "npm/{npm-version} node/{node-version} {platform} {arch} {ci}", - "userconfig": "~/.npmrc", - "version": false, - "versions": false, - "viewer": "browser", - }, - "shorthands": Object { - "?": Array [ - "--usage", - ], - "a": Array [ - "--all", - ], - "B": Array [ - "--save-bundle", - ], - "c": Array [ - "--call", - ], - "C": Array [ - "--prefix", - ], - "d": Array [ - "--loglevel", - "info", - ], - "D": Array [ - "--save-dev", - ], - "dd": Array [ - "--loglevel", - "verbose", - ], - "ddd": Array [ - "--loglevel", - "silly", - ], - "desc": Array [ - "--description", - ], - "E": Array [ - "--save-exact", - ], - "enjoy-by": Array [ - "--before", - ], - "f": Array [ - "--force", - ], - "g": Array [ - "--global", - ], - "h": Array [ - "--usage", - ], - "H": Array [ - "--usage", - ], - "help": Array [ - "--usage", - ], - "l": Array [ - "--long", - ], - "local": Array [ - "--no-global", - ], - "m": Array [ - "--message", - ], - "n": Array [ - "--no-yes", - ], - "no-desc": Array [ - "--no-description", - ], - "no-reg": Array [ - "--no-registry", - ], - "noreg": Array [ - "--no-registry", - ], - "O": Array [ - "--save-optional", - ], - "p": Array [ - "--parseable", - ], - "P": Array [ - "--save-prod", - ], - "porcelain": Array [ - "--parseable", - ], - "q": Array [ - "--loglevel", - "warn", - ], - "quiet": Array [ - "--loglevel", - "warn", - ], - "readonly": Array [ - "--read-only", - ], - "reg": Array [ - "--registry", - ], - "s": Array [ - "--loglevel", - "silent", - ], - "S": Array [ - "--save", - ], - "silent": Array [ - "--loglevel", - "silent", - ], - "v": Array [ - "--version", - ], - "verbose": Array [ - "--loglevel", - "verbose", - ], - "y": Array [ - "--yes", - ], - }, - "types": Object { - "_auth": Array [ - null, - "{String TYPE}", - ], - "access": Array [ - null, - "restricted", - "public", - ], - "all": "{Boolean TYPE}", - "allow-same-version": "{Boolean TYPE}", - "also": Array [ - null, - "dev", - "development", - ], - "always-auth": "{Boolean TYPE}", - "audit": "{Boolean TYPE}", - "audit-level": Array [ - "low", - "moderate", - "high", - "critical", - "none", - null, - ], - "auth-type": Array [ - "legacy", - "sso", - "saml", - "oauth", - ], - "before": Array [ - null, - "{Date TYPE}", - ], - "bin-links": "{Boolean TYPE}", - "browser": Array [ - null, - "{Boolean TYPE}", - "{String TYPE}", - ], - "ca": Array [ - null, - "{String TYPE}", - "{Array TYPE}", - ], - "cache": "{PATH MODULE}", - "cache-lock-retries": "{Number TYPE}", - "cache-lock-stale": "{Number TYPE}", - "cache-lock-wait": "{Number TYPE}", - "cache-max": "{Number TYPE}", - "cache-min": "{Number TYPE}", - "cafile": "{PATH MODULE}", - "call": "{String TYPE}", - "cert": Array [ - null, - "{String TYPE}", - ], - "ci-name": Array [ - null, - "{String TYPE}", - ], - "cidr": Array [ - null, - "{String TYPE}", - "{Array TYPE}", - ], - "color": Array [ - "always", - "{Boolean TYPE}", - ], - "commit-hooks": "{Boolean TYPE}", - "depth": Array [ - null, - "{Number TYPE}", - ], - "description": "{Boolean TYPE}", - "dev": "{Boolean TYPE}", - "diff": Array [ - "{String TYPE}", - "{Array TYPE}", - ], - "diff-dst-prefix": "{String TYPE}", - "diff-ignore-all-space": "{Boolean TYPE}", - "diff-name-only": "{Boolean TYPE}", - "diff-no-prefix": "{Boolean TYPE}", - "diff-src-prefix": "{String TYPE}", - "diff-text": "{Boolean TYPE}", - "diff-unified": Array [ - null, - "{Number TYPE}", - ], - "dry-run": "{Boolean TYPE}", - "editor": "{String TYPE}", - "engine-strict": "{Boolean TYPE}", - "fetch-retries": "{Number TYPE}", - "fetch-retry-factor": "{Number TYPE}", - "fetch-retry-maxtimeout": "{Number TYPE}", - "fetch-retry-mintimeout": "{Number TYPE}", - "fetch-timeout": "{Number TYPE}", - "force": "{Boolean TYPE}", - "foreground-script": "{Boolean TYPE}", - "format-package-lock": "{Boolean TYPE}", - "fund": "{Boolean TYPE}", - "git": "{String TYPE}", - "git-tag-version": "{Boolean TYPE}", - "global": "{Boolean TYPE}", - "global-style": "{Boolean TYPE}", - "globalconfig": "{PATH MODULE}", - "heading": "{String TYPE}", - "https-proxy": Array [ - null, - "{URL MODULE}", - ], - "if-present": "{Boolean TYPE}", - "ignore-prepublish": "{Boolean TYPE}", - "ignore-scripts": "{Boolean TYPE}", - "include": Array [ - "{Array TYPE}", - "prod", - "dev", - "optional", - "peer", - ], - "include-staged": "{Boolean TYPE}", - "init-author-email": "{String TYPE}", - "init-author-name": "{String TYPE}", - "init-author-url": Array [ - "", - "{URL MODULE}", - ], - "init-license": "{String TYPE}", - "init-module": "{PATH MODULE}", - "init-version": "{SEMVER MODULE}", - "init.author.email": "{String TYPE}", - "init.author.name": "{String TYPE}", - "init.author.url": Array [ - "", - "{URL MODULE}", - ], - "init.license": "{String TYPE}", - "init.module": "{PATH MODULE}", - "init.version": "{SEMVER MODULE}", - "json": "{Boolean TYPE}", - "key": Array [ - null, - "{String TYPE}", - ], - "legacy-bundling": "{Boolean TYPE}", - "legacy-peer-deps": "{Boolean TYPE}", - "link": "{Boolean TYPE}", - "local-address": Array [ - undefined, - ], - "loglevel": Array [ - "silent", - "error", - "warn", - "notice", - "http", - "timing", - "info", - "verbose", - "silly", - ], - "logs-max": "{Number TYPE}", - "long": "{Boolean TYPE}", - "maxsockets": "{Number TYPE}", - "message": "{String TYPE}", - "node-options": Array [ - null, - "{String TYPE}", - ], - "node-version": Array [ - null, - "{SEMVER MODULE}", - ], - "noproxy": Array [ - null, - "{String TYPE}", - "{Array TYPE}", - ], - "npm-version": "{SEMVER MODULE}", - "offline": "{Boolean TYPE}", - "omit": Array [ - "{Array TYPE}", - "dev", - "optional", - "peer", - ], - "only": Array [ - null, - "dev", - "development", - "prod", - "production", - ], - "optional": "{Boolean TYPE}", - "otp": Array [ - null, - "{String TYPE}", - ], - "package": Array [ - "{String TYPE}", - "{Array TYPE}", - ], - "package-lock": "{Boolean TYPE}", - "package-lock-only": "{Boolean TYPE}", - "parseable": "{Boolean TYPE}", - "prefer-offline": "{Boolean TYPE}", - "prefer-online": "{Boolean TYPE}", - "prefix": "{PATH MODULE}", - "preid": "{String TYPE}", - "production": "{Boolean TYPE}", - "progress": "{Boolean TYPE}", - "proxy": Array [ - null, - false, - "{URL MODULE}", - ], - "read-only": "{Boolean TYPE}", - "rebuild-bundle": "{Boolean TYPE}", - "registry": Array [ - null, - "{URL MODULE}", - ], - "rollback": "{Boolean TYPE}", - "save": "{Boolean TYPE}", - "save-bundle": "{Boolean TYPE}", - "save-dev": "{Boolean TYPE}", - "save-exact": "{Boolean TYPE}", - "save-optional": "{Boolean TYPE}", - "save-prefix": "{String TYPE}", - "save-prod": "{Boolean TYPE}", - "scope": "{String TYPE}", - "script-shell": Array [ - null, - "{String TYPE}", - ], - "scripts-prepend-node-path": Array [ - "{Boolean TYPE}", - "auto", - "warn-only", - ], - "searchexclude": Array [ - null, - "{String TYPE}", - ], - "searchlimit": "{Number TYPE}", - "searchopts": "{String TYPE}", - "searchstaleness": "{Number TYPE}", - "shell": "{String TYPE}", - "shrinkwrap": "{Boolean TYPE}", - "sign-git-commit": "{Boolean TYPE}", - "sign-git-tag": "{Boolean TYPE}", - "sso-poll-frequency": "{Number TYPE}", - "sso-type": Array [ - null, - "oauth", - "saml", - ], - "strict-peer-deps": "{Boolean TYPE}", - "strict-ssl": "{Boolean TYPE}", - "tag": "{String TYPE}", - "tag-version-prefix": "{String TYPE}", - "timing": "{Boolean TYPE}", - "tmp": "{PATH MODULE}", - "umask": "{Umask TYPE}", - "unicode": "{Boolean TYPE}", - "update-notifier": "{Boolean TYPE}", - "usage": "{Boolean TYPE}", - "user-agent": "{String TYPE}", - "userconfig": "{PATH MODULE}", - "version": "{Boolean TYPE}", - "versions": "{Boolean TYPE}", - "viewer": "{String TYPE}", - }, -} -` - -exports[`test/lib/utils/config.js TAP working network interfaces, not windows > must match snapshot 1`] = ` -Object { - "defaults": Object { - "_auth": null, - "access": null, - "all": false, - "allow-same-version": false, - "also": null, - "always-auth": false, - "audit": true, - "audit-level": null, - "auth-type": "legacy", - "before": null, - "bin-links": true, - "browser": null, - "ca": null, - "cache": "{CACHE DIR} .npm", - "cache-lock-retries": 10, - "cache-lock-stale": 60000, - "cache-lock-wait": 10000, - "cache-max": null, - "cache-min": 10, - "cafile": null, - "call": "", - "cert": null, - "ci-name": null, - "cidr": null, - "color": true, - "commit-hooks": true, - "depth": null, - "description": true, - "dev": false, - "diff": Array [], - "diff-dst-prefix": "", - "diff-ignore-all-space": false, - "diff-name-only": false, - "diff-no-prefix": false, - "diff-src-prefix": "", - "diff-text": false, - "diff-unified": null, - "dry-run": false, - "editor": "vim", - "engine-strict": false, - "fetch-retries": 2, - "fetch-retry-factor": 10, - "fetch-retry-maxtimeout": 60000, - "fetch-retry-mintimeout": 10000, - "fetch-timeout": 300000, - "force": false, - "foreground-script": false, - "format-package-lock": true, - "fund": true, - "git": "git", - "git-tag-version": true, - "global": false, - "global-style": false, - "heading": "npm", - "https-proxy": null, - "if-present": false, - "ignore-prepublish": false, - "ignore-scripts": false, - "include": Array [], - "include-staged": false, - "init-author-email": "", - "init-author-name": "", - "init-author-url": "", - "init-license": "ISC", - "init-module": "~/.npm-init.js", - "init-version": "1.0.0", - "init.author.email": "", - "init.author.name": "", - "init.author.url": "", - "init.license": "ISC", - "init.module": "~/.npm-init.js", - "init.version": "1.0.0", - "json": false, - "key": null, - "legacy-bundling": false, - "legacy-peer-deps": false, - "link": false, - "local-address": undefined, - "loglevel": "notice", - "logs-max": 10, - "long": false, - "maxsockets": 50, - "message": "%s", - "node-options": null, - "node-version": "v14.8.0", - "noproxy": null, - "npm-version": "7.0.0", - "offline": false, - "omit": Array [], - "only": null, - "optional": true, - "otp": null, - "package": Array [], - "package-lock": true, - "package-lock-only": false, - "parseable": false, - "prefer-offline": false, - "prefer-online": false, - "preid": "", - "production": false, - "progress": true, - "proxy": null, - "read-only": false, - "rebuild-bundle": true, - "registry": "https://registry.npmjs.org/", - "rollback": true, - "save": true, - "save-bundle": false, - "save-dev": false, - "save-exact": false, - "save-optional": false, - "save-prefix": "^", - "save-prod": false, - "scope": "", - "script-shell": null, - "scripts-prepend-node-path": "warn-only", - "searchexclude": null, - "searchlimit": 20, - "searchopts": "", - "searchstaleness": 900, - "shell": "/usr/local/bin/bash", - "shrinkwrap": true, - "sign-git-commit": false, - "sign-git-tag": false, - "sso-poll-frequency": 500, - "sso-type": "oauth", - "strict-peer-deps": false, - "strict-ssl": true, - "tag": "latest", - "tag-version-prefix": "v", - "timing": false, - "tmp": "/tmp", - "umask": 0, - "unicode": true, - "update-notifier": true, - "usage": false, - "user-agent": "npm/{npm-version} node/{node-version} {platform} {arch} {ci}", - "userconfig": "~/.npmrc", - "version": false, - "versions": false, - "viewer": "man", - }, - "shorthands": Object { - "?": Array [ - "--usage", - ], - "a": Array [ - "--all", - ], - "B": Array [ - "--save-bundle", - ], - "c": Array [ - "--call", - ], - "C": Array [ - "--prefix", - ], - "d": Array [ - "--loglevel", - "info", - ], - "D": Array [ - "--save-dev", - ], - "dd": Array [ - "--loglevel", - "verbose", - ], - "ddd": Array [ - "--loglevel", - "silly", - ], - "desc": Array [ - "--description", - ], - "E": Array [ - "--save-exact", - ], - "enjoy-by": Array [ - "--before", - ], - "f": Array [ - "--force", - ], - "g": Array [ - "--global", - ], - "h": Array [ - "--usage", - ], - "H": Array [ - "--usage", - ], - "help": Array [ - "--usage", - ], - "l": Array [ - "--long", - ], - "local": Array [ - "--no-global", - ], - "m": Array [ - "--message", - ], - "n": Array [ - "--no-yes", - ], - "no-desc": Array [ - "--no-description", - ], - "no-reg": Array [ - "--no-registry", - ], - "noreg": Array [ - "--no-registry", - ], - "O": Array [ - "--save-optional", - ], - "p": Array [ - "--parseable", - ], - "P": Array [ - "--save-prod", - ], - "porcelain": Array [ - "--parseable", - ], - "q": Array [ - "--loglevel", - "warn", - ], - "quiet": Array [ - "--loglevel", - "warn", - ], - "readonly": Array [ - "--read-only", - ], - "reg": Array [ - "--registry", - ], - "s": Array [ - "--loglevel", - "silent", - ], - "S": Array [ - "--save", - ], - "silent": Array [ - "--loglevel", - "silent", - ], - "v": Array [ - "--version", - ], - "verbose": Array [ - "--loglevel", - "verbose", - ], - "y": Array [ - "--yes", - ], - }, - "types": Object { - "_auth": Array [ - null, - "{String TYPE}", - ], - "access": Array [ - null, - "restricted", - "public", - ], - "all": "{Boolean TYPE}", - "allow-same-version": "{Boolean TYPE}", - "also": Array [ - null, - "dev", - "development", - ], - "always-auth": "{Boolean TYPE}", - "audit": "{Boolean TYPE}", - "audit-level": Array [ - "low", - "moderate", - "high", - "critical", - "none", - null, - ], - "auth-type": Array [ - "legacy", - "sso", - "saml", - "oauth", - ], - "before": Array [ - null, - "{Date TYPE}", - ], - "bin-links": "{Boolean TYPE}", - "browser": Array [ - null, - "{Boolean TYPE}", - "{String TYPE}", - ], - "ca": Array [ - null, - "{String TYPE}", - "{Array TYPE}", - ], - "cache": "{PATH MODULE}", - "cache-lock-retries": "{Number TYPE}", - "cache-lock-stale": "{Number TYPE}", - "cache-lock-wait": "{Number TYPE}", - "cache-max": "{Number TYPE}", - "cache-min": "{Number TYPE}", - "cafile": "{PATH MODULE}", - "call": "{String TYPE}", - "cert": Array [ - null, - "{String TYPE}", - ], - "ci-name": Array [ - null, - "{String TYPE}", - ], - "cidr": Array [ - null, - "{String TYPE}", - "{Array TYPE}", - ], - "color": Array [ - "always", - "{Boolean TYPE}", - ], - "commit-hooks": "{Boolean TYPE}", - "depth": Array [ - null, - "{Number TYPE}", - ], - "description": "{Boolean TYPE}", - "dev": "{Boolean TYPE}", - "diff": Array [ - "{String TYPE}", - "{Array TYPE}", - ], - "diff-dst-prefix": "{String TYPE}", - "diff-ignore-all-space": "{Boolean TYPE}", - "diff-name-only": "{Boolean TYPE}", - "diff-no-prefix": "{Boolean TYPE}", - "diff-src-prefix": "{String TYPE}", - "diff-text": "{Boolean TYPE}", - "diff-unified": Array [ - null, - "{Number TYPE}", - ], - "dry-run": "{Boolean TYPE}", - "editor": "{String TYPE}", - "engine-strict": "{Boolean TYPE}", - "fetch-retries": "{Number TYPE}", - "fetch-retry-factor": "{Number TYPE}", - "fetch-retry-maxtimeout": "{Number TYPE}", - "fetch-retry-mintimeout": "{Number TYPE}", - "fetch-timeout": "{Number TYPE}", - "force": "{Boolean TYPE}", - "foreground-script": "{Boolean TYPE}", - "format-package-lock": "{Boolean TYPE}", - "fund": "{Boolean TYPE}", - "git": "{String TYPE}", - "git-tag-version": "{Boolean TYPE}", - "global": "{Boolean TYPE}", - "global-style": "{Boolean TYPE}", - "globalconfig": "{PATH MODULE}", - "heading": "{String TYPE}", - "https-proxy": Array [ - null, - "{URL MODULE}", - ], - "if-present": "{Boolean TYPE}", - "ignore-prepublish": "{Boolean TYPE}", - "ignore-scripts": "{Boolean TYPE}", - "include": Array [ - "{Array TYPE}", - "prod", - "dev", - "optional", - "peer", - ], - "include-staged": "{Boolean TYPE}", - "init-author-email": "{String TYPE}", - "init-author-name": "{String TYPE}", - "init-author-url": Array [ - "", - "{URL MODULE}", - ], - "init-license": "{String TYPE}", - "init-module": "{PATH MODULE}", - "init-version": "{SEMVER MODULE}", - "init.author.email": "{String TYPE}", - "init.author.name": "{String TYPE}", - "init.author.url": Array [ - "", - "{URL MODULE}", - ], - "init.license": "{String TYPE}", - "init.module": "{PATH MODULE}", - "init.version": "{SEMVER MODULE}", - "json": "{Boolean TYPE}", - "key": Array [ - null, - "{String TYPE}", - ], - "legacy-bundling": "{Boolean TYPE}", - "legacy-peer-deps": "{Boolean TYPE}", - "link": "{Boolean TYPE}", - "local-address": Array [ - undefined, - "127.0.0.1", - "no place like home", - ], - "loglevel": Array [ - "silent", - "error", - "warn", - "notice", - "http", - "timing", - "info", - "verbose", - "silly", - ], - "logs-max": "{Number TYPE}", - "long": "{Boolean TYPE}", - "maxsockets": "{Number TYPE}", - "message": "{String TYPE}", - "node-options": Array [ - null, - "{String TYPE}", - ], - "node-version": Array [ - null, - "{SEMVER MODULE}", - ], - "noproxy": Array [ - null, - "{String TYPE}", - "{Array TYPE}", - ], - "npm-version": "{SEMVER MODULE}", - "offline": "{Boolean TYPE}", - "omit": Array [ - "{Array TYPE}", - "dev", - "optional", - "peer", - ], - "only": Array [ - null, - "dev", - "development", - "prod", - "production", - ], - "optional": "{Boolean TYPE}", - "otp": Array [ - null, - "{String TYPE}", - ], - "package": Array [ - "{String TYPE}", - "{Array TYPE}", - ], - "package-lock": "{Boolean TYPE}", - "package-lock-only": "{Boolean TYPE}", - "parseable": "{Boolean TYPE}", - "prefer-offline": "{Boolean TYPE}", - "prefer-online": "{Boolean TYPE}", - "prefix": "{PATH MODULE}", - "preid": "{String TYPE}", - "production": "{Boolean TYPE}", - "progress": "{Boolean TYPE}", - "proxy": Array [ - null, - false, - "{URL MODULE}", - ], - "read-only": "{Boolean TYPE}", - "rebuild-bundle": "{Boolean TYPE}", - "registry": Array [ - null, - "{URL MODULE}", - ], - "rollback": "{Boolean TYPE}", - "save": "{Boolean TYPE}", - "save-bundle": "{Boolean TYPE}", - "save-dev": "{Boolean TYPE}", - "save-exact": "{Boolean TYPE}", - "save-optional": "{Boolean TYPE}", - "save-prefix": "{String TYPE}", - "save-prod": "{Boolean TYPE}", - "scope": "{String TYPE}", - "script-shell": Array [ - null, - "{String TYPE}", - ], - "scripts-prepend-node-path": Array [ - "{Boolean TYPE}", - "auto", - "warn-only", - ], - "searchexclude": Array [ - null, - "{String TYPE}", - ], - "searchlimit": "{Number TYPE}", - "searchopts": "{String TYPE}", - "searchstaleness": "{Number TYPE}", - "shell": "{String TYPE}", - "shrinkwrap": "{Boolean TYPE}", - "sign-git-commit": "{Boolean TYPE}", - "sign-git-tag": "{Boolean TYPE}", - "sso-poll-frequency": "{Number TYPE}", - "sso-type": Array [ - null, - "oauth", - "saml", - ], - "strict-peer-deps": "{Boolean TYPE}", - "strict-ssl": "{Boolean TYPE}", - "tag": "{String TYPE}", - "tag-version-prefix": "{String TYPE}", - "timing": "{Boolean TYPE}", - "tmp": "{PATH MODULE}", - "umask": "{Umask TYPE}", - "unicode": "{Boolean TYPE}", - "update-notifier": "{Boolean TYPE}", - "usage": "{Boolean TYPE}", - "user-agent": "{String TYPE}", - "userconfig": "{PATH MODULE}", - "version": "{Boolean TYPE}", - "versions": "{Boolean TYPE}", - "viewer": "{String TYPE}", - }, -} -` diff --git a/deps/npm/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js deleted file mode 100644 index 47de89e9761484..00000000000000 --- a/deps/npm/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js +++ /dev/null @@ -1,129 +0,0 @@ -/* IMPORTANT - * This snapshot file is auto-generated, but designed for humans. - * It should be checked into source control and tracked carefully. - * Re-generate by setting TAP_SNAPSHOT=1 and running tests. - * Make sure to inspect the output below. Do not ignore changes! - */ -'use strict' -exports[`test/lib/utils/flat-options.js TAP basic > flat options 1`] = ` -Object { - "_auth": undefined, - "@scope:registry": "@scope:registry", - "//nerf.dart:_authToken": "//nerf.dart:_authToken", - "access": "access", - "all": undefined, - "allowSameVersion": "allow-same-version", - "alwaysAuth": "always-auth", - "audit": "audit", - "auditLevel": "audit-level", - "authType": "auth-type", - "before": "before", - "binLinks": "bin-links", - "browser": "browser", - "ca": "ca", - "cache": "cache/_cacache", - "cafile": "cafile", - "call": "call", - "cert": "cert", - "cidr": "cidr", - "color": true, - "commitHooks": "commit-hooks", - "defaultTag": "tag", - "depth": "depth", - "diff": undefined, - "diffDstPrefix": undefined, - "diffIgnoreAllSpace": undefined, - "diffNameOnly": undefined, - "diffNoPrefix": undefined, - "diffSrcPrefix": undefined, - "diffText": undefined, - "diffUnified": undefined, - "dmode": 511, - "dryRun": "dry-run", - "editor": "editor", - "engineStrict": "engine-strict", - "fmode": 438, - "force": "force", - "foregroundScripts": false, - "formatPackageLock": "format-package-lock", - "fund": "fund", - "git": "git", - "gitTagVersion": "git-tag-version", - "global": "global", - "globalPrefix": "/usr/local", - "globalStyle": "global-style", - "hashAlgorithm": "sha1", - "ignoreScripts": undefined, - "includeStaged": undefined, - "json": undefined, - "key": "key", - "legacyBundling": "legacy-bundling", - "legacyPeerDeps": undefined, - "localPrefix": "/path/to/npm/cli", - "log": Object {}, - "long": undefined, - "message": "message", - "nodeBin": "/path/to/some/node", - "nodeVersion": "1.2.3", - "noProxy": "noproxy", - "npmBin": "/path/to/npm/bin.js", - "npmCommand": null, - "npmSession": "12345", - "npmVersion": "7.6.5", - "offline": "offline", - "omit": Array [], - "otp": "otp", - "package": "package", - "packageLock": true, - "packageLockOnly": "package-lock-only", - "parseable": undefined, - "preferDedupe": undefined, - "preferOffline": "prefer-offline", - "preferOnline": "prefer-online", - "prefix": "/path/to/npm/cli", - "preid": "preid", - "projectScope": "@npmcli", - "proxy": "proxy", - "readOnly": "read-only", - "rebuildBundle": "rebuild-bundle", - "registry": "registry", - "retry": Object { - "factor": "fetch-retry-factor", - "maxTimeout": "fetch-retry-maxtimeout", - "minTimeout": "fetch-retry-mintimeout", - "retries": "fetch-retries", - }, - "save": "save", - "saveBundle": false, - "savePrefix": "", - "saveType": "peerOptional", - "scope": "", - "scriptShell": "script-shell", - "search": Object { - "description": "description", - "exclude": "searchexclude", - "limit": "searchlimit", - "opts": Null Object { - "from": "1", - }, - "staleness": "searchstaleness", - }, - "shell": undefined, - "signGitCommit": "sign-git-commit", - "signGitTag": "sign-git-tag", - "ssoPollFrequency": undefined, - "ssoType": undefined, - "strictPeerDeps": undefined, - "strictSSL": "strict-ssl", - "tag": "tag", - "tagVersionPrefix": "tag-version-prefix", - "timeout": "fetch-timeout", - "tmp": "/tmp", - "umask": 18, - "unicode": undefined, - "userAgent": "user-agent", - "viewer": "viewer", - "which": undefined, - "yes": undefined, -} -` diff --git a/deps/npm/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js index 318f3ac1738624..cf085f1ad5b1aa 100644 --- a/deps/npm/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js +++ b/deps/npm/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js @@ -6,8 +6,9 @@ */ 'use strict' exports[`test/lib/utils/npm-usage.js TAP usage basic usage > must match snapshot 1`] = ` +npm -Usage: npm +Usage: npm install install all the dependencies in your project npm install add the dependency to your project @@ -38,55 +39,12 @@ More configuration info: npm help config Configuration fields: npm help 7 config npm@{VERSION} {BASEDIR} - -` - -exports[`test/lib/utils/npm-usage.js TAP usage did you mean? > must match snapshot 1`] = ` - -Usage: npm - -npm install install all the dependencies in your project -npm install add the dependency to your project -npm test run this project's tests -npm run run the script named -npm -h quick help on -npm -l display usage info for all commands -npm help search for help on -npm help npm more involved overview - -All commands: - - access, adduser, audit, bin, bugs, cache, ci, completion, - config, dedupe, deprecate, diff, dist-tag, docs, doctor, - edit, exec, explain, explore, find-dupes, fund, get, help, - hook, init, install, install-ci-test, install-test, link, - ll, login, logout, ls, org, outdated, owner, pack, ping, - prefix, profile, prune, publish, rebuild, repo, restart, - root, run-script, search, set, set-script, shrinkwrap, star, - stars, start, stop, team, test, token, uninstall, unpublish, - unstar, update, version, view, whoami - -Specify configs in the ini-formatted file: - /some/config/file/.npmrc -or on the command line via: npm --key=value - -More configuration info: npm help config -Configuration fields: npm help 7 config - -npm@{VERSION} {BASEDIR} - -` - -exports[`test/lib/utils/npm-usage.js TAP usage did you mean? > must match snapshot 2`] = ` - -Did you mean one of these? - install - uninstall ` exports[`test/lib/utils/npm-usage.js TAP usage set process.stdout.columns columns=0 > must match snapshot 1`] = ` +npm -Usage: npm +Usage: npm install install all the dependencies in your project npm install add the dependency to your project @@ -117,12 +75,12 @@ More configuration info: npm help config Configuration fields: npm help 7 config npm@{VERSION} {BASEDIR} - ` exports[`test/lib/utils/npm-usage.js TAP usage set process.stdout.columns columns=90 > must match snapshot 1`] = ` +npm -Usage: npm +Usage: npm install install all the dependencies in your project npm install add the dependency to your project @@ -153,12 +111,12 @@ More configuration info: npm help config Configuration fields: npm help 7 config npm@{VERSION} {BASEDIR} - ` exports[`test/lib/utils/npm-usage.js TAP usage with browser > must match snapshot 1`] = ` +npm -Usage: npm +Usage: npm install install all the dependencies in your project npm install add the dependency to your project @@ -189,12 +147,12 @@ More configuration info: npm help config Configuration fields: npm help 7 config npm@{VERSION} {BASEDIR} - ` exports[`test/lib/utils/npm-usage.js TAP usage with long > must match snapshot 1`] = ` +npm -Usage: npm +Usage: npm install install all the dependencies in your project npm install add the dependency to your project @@ -209,6 +167,8 @@ All commands: access npm access + Set access level on published packages + Usage: npm access public [] npm access restricted [] @@ -224,8 +184,13 @@ All commands: adduser npm adduser + Add a registry user account + Usage: - npm adduser [--registry=url] [--scope=@orgname] [--always-auth] + npm adduser + + Options: + [--registry ] [--scope <@scope>] [--always-auth] aliases: login, add-user @@ -233,21 +198,32 @@ All commands: audit npm audit + Run a security audit + Usage: - npm audit [--json] [--production] - npm audit fix [--force|--package-lock-only|--dry-run|--production|--only=(dev|prod)] + npm audit [fix] + + Options: + [--dry-run] [-f|--force] [--json] [--package-lock-only] [--production] Run "npm help audit" for more info bin npm bin + Display npm bin folder + Usage: - npm bin [-g] + npm bin + + Options: + [-g|--global] Run "npm help bin" for more info bugs npm bugs + Report bugs for a package in a web browser + Usage: npm bugs [] @@ -257,6 +233,8 @@ All commands: cache npm cache + Manipulates packages cache + Usage: npm cache add npm cache add @@ -270,6 +248,8 @@ All commands: ci npm ci + Install a project with a clean slate + Usage: npm ci @@ -279,7 +259,7 @@ All commands: completion npm completion - npm command completion script. save to ~/.bashrc or ~/.zshrc + Tab Completion for npm Usage: npm completion @@ -288,6 +268,8 @@ All commands: config npm config + Manage the npm configuration files + Usage: npm config set = [= ...] npm config get [ [ ...]] @@ -301,6 +283,8 @@ All commands: dedupe npm dedupe + Reduce duplication in the package tree + Usage: npm dedupe @@ -310,6 +294,8 @@ All commands: deprecate npm deprecate + Deprecate a version of a package + Usage: npm deprecate [@] @@ -317,6 +303,8 @@ All commands: diff npm diff + The registry diff command + Usage: npm diff [...] npm diff --diff= [...] @@ -328,6 +316,8 @@ All commands: dist-tag npm dist-tag + Modify package distribution tags + Usage: npm dist-tag add @ [] npm dist-tag rm @@ -337,12 +327,21 @@ All commands: Run "npm help dist-tag" for more info - docs npm docs [ [ ...]] + docs npm docs + + Open documentation for a package in a web browser + + Usage: + npm docs [ [ ...]] alias: home + Run "npm help docs" for more info + doctor npm doctor + Check your npm environment + Usage: npm doctor @@ -350,6 +349,8 @@ All commands: edit npm edit + Edit an installed package + Usage: npm edit [/...] @@ -357,7 +358,7 @@ All commands: exec npm exec - Run a command from a local or remote npm package. + Run a command from a local or remote npm package Usage: npm exec -- [@] [args...] @@ -371,6 +372,8 @@ All commands: explain npm explain + Explain installed packages + Usage: npm explain @@ -380,6 +383,8 @@ All commands: explore npm explore + Browse an installed package + Usage: npm explore [ -- ] @@ -387,6 +392,8 @@ All commands: find-dupes npm find-dupes + Find duplication in the package tree + Usage: npm find-dupes @@ -394,13 +401,20 @@ All commands: fund npm fund + Retrieve funding information + Usage: - npm fund [--json] [--browser] [--unicode] [[<@scope>/] [--which=] + npm fund [[<@scope>/]] + + Options: + [--json] [--browser|--browser ] [--unicode] [--which ] Run "npm help fund" for more info get npm get + Get a value from the npm configuration + Usage: npm get [ ...] (See \`npm config\`) @@ -408,6 +422,8 @@ All commands: help npm help + Get help on npm + Usage: npm help [] @@ -417,6 +433,8 @@ All commands: hook npm hook + Manage registry hooks + Usage: npm hook add [--type=] npm hook ls [pkg] @@ -427,6 +445,8 @@ All commands: init npm init + Create a package.json file + Usage: npm init [--force|-f|--yes|-y|--scope] npm init <@scope> (same as \`npx <@scope>/create\`) @@ -438,6 +458,8 @@ All commands: install npm install + Install a package + Usage: npm install [<@scope>/] npm install [<@scope>/]@ @@ -448,7 +470,10 @@ All commands: npm install npm install npm install - npm install / [--save-prod|--save-dev|--save-optional|--save-peer] [--save-exact] [--no-save] + npm install / + + Options: + [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer] [-E|--save-exact] aliases: i, in, ins, inst, insta, instal, isnt, isnta, isntal, add @@ -456,6 +481,8 @@ All commands: install-ci-test npm install-ci-test + Install a project with a clean slate and run tests + Usage: npm install-ci-test @@ -465,6 +492,8 @@ All commands: install-test npm install-test + Install package(s) and run tests + Usage: npm install-test [<@scope>/] npm install-test [<@scope>/]@ @@ -475,7 +504,10 @@ All commands: npm install-test npm install-test npm install-test - npm install-test / [--save-prod|--save-dev|--save-optional|--save-peer] [--save-exact] [--no-save] + npm install-test / + + Options: + [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer] [-E|--save-exact] alias: it @@ -483,6 +515,8 @@ All commands: link npm link + Symlink a package folder + Usage: npm link (in package dir) npm link [<@scope>/][@] @@ -493,6 +527,8 @@ All commands: ll npm ll + List installed packages + Usage: npm ll [[<@scope>/] ...] @@ -502,8 +538,13 @@ All commands: login npm adduser + Add a registry user account + Usage: - npm adduser [--registry=url] [--scope=@orgname] [--always-auth] + npm adduser + + Options: + [--registry ] [--scope <@scope>] [--always-auth] aliases: login, add-user @@ -511,13 +552,20 @@ All commands: logout npm logout + Log out of the registry + Usage: - npm logout [--registry=] [--scope=<@scope>] + npm logout + + Options: + [--registry ] [--scope <@scope>] Run "npm help logout" for more info ls npm ls + List installed packages + Usage: npm ls npm ls [[<@scope>/] ...] @@ -527,6 +575,8 @@ All commands: org npm org + Manage orgs + Usage: npm org set orgname username [developer | admin | owner] npm org rm orgname username @@ -538,6 +588,8 @@ All commands: outdated npm outdated + Check for outdated packages + Usage: npm outdated [[<@scope>/] ...] @@ -545,6 +597,8 @@ All commands: owner npm owner + Manage package owners + Usage: npm owner add [<@scope>/] npm owner rm [<@scope>/] @@ -556,22 +610,32 @@ All commands: pack npm pack + Create a tarball from a package + Usage: - npm pack [[<@scope>/]...] [--dry-run] + npm pack [[<@scope>/]...] + + Options: + [--dry-run] Run "npm help pack" for more info ping npm ping - ping registry + Ping npm registry Usage: npm ping + Options: + [--registry ] + Run "npm help ping" for more info prefix npm prefix + Display prefix + Usage: npm prefix [-g] @@ -579,6 +643,8 @@ All commands: profile npm profile + Change settings on your registry profile + Usage: npm profile enable-2fa [auth-only|auth-and-writes] npm profile disable-2fa @@ -589,20 +655,32 @@ All commands: prune npm prune + Remove extraneous packages + Usage: - npm prune [[<@scope>/]...] [--production] + npm prune [[<@scope>/]...] + + Options: + [--production] Run "npm help prune" for more info publish npm publish + Publish a package + Usage: - npm publish [] [--tag ] [--access ] [--dry-run] + npm publish [] + + Options: + [--tag ] [--access ] [--dry-run] Run "npm help publish" for more info rebuild npm rebuild + Rebuild a package + Usage: npm rebuild [[<@scope>/][@] ...] @@ -612,6 +690,8 @@ All commands: repo npm repo + Open package repository page in the browser + Usage: npm repo [ [ ...]] @@ -619,6 +699,8 @@ All commands: restart npm restart + Restart a package + Usage: npm restart [-- ] @@ -626,13 +708,20 @@ All commands: root npm root + Display npm root + Usage: - npm root [-g] + npm root + + Options: + [-g|--global] Run "npm help root" for more info run-script npm run-script + Run arbitrary package scripts + Usage: npm run-script [-- ] @@ -642,8 +731,13 @@ All commands: search npm search + Search for pacakges + Usage: - npm search [-l|--long] [--json] [--parseable] [--no-description] [search terms ...] + npm search [search terms ...] + + Options: + [-l|--long] [--json] [-p|--parseable] [--no-description] aliases: s, se, find @@ -651,6 +745,8 @@ All commands: set npm set + Set a value in the npm configuration + Usage: npm set = [= ...] (See \`npm config\`) @@ -658,6 +754,8 @@ All commands: set-script npm set-script + Set tasks in the scripts section of package.json + Usage: npm set-script [